playbook_ui 13.14.0 → 13.15.0.pre.alpha.PLAY11311893
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/_playbook.scss +1 -0
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
- data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
- data/app/pb_kits/playbook/pb_body/body.rb +1 -8
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
- data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
- data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_colors_swift.md +27 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default_swift.md +22 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_props_table.md +8 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_sizes_swift.md +26 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -55
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +5 -56
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
- data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -5
- data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
- data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
- data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_bold_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_default_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_no_highlight_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_bold_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_default_swift.md +18 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_no_highlight_swift.md +19 -0
- data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_swift.md +17 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +17 -0
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
- data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
- data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +13 -4
- data/app/pb_kits/playbook/pb_select/_select.tsx +8 -5
- data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.html.erb +24 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_inline_show_arrow.jsx +38 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_select/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_select/select.rb +6 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
- data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
- data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
- data/app/pb_kits/playbook/pb_title/title.rb +2 -9
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
- data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
- data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
- data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
- data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
- data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
- data/app/pb_kits/playbook/utilities/props.ts +2 -2
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/classnames.rb +1 -0
- data/lib/playbook/kit_base.rb +2 -0
- data/lib/playbook/truncate.rb +29 -0
- data/lib/playbook/version.rb +2 -2
- metadata +41 -7
@@ -35,7 +35,7 @@ type RichTextEditorProps = {
|
|
35
35
|
className?: string,
|
36
36
|
data?: { [key: string]: string },
|
37
37
|
focus?: boolean,
|
38
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
38
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
39
39
|
id?: string,
|
40
40
|
inline?: boolean,
|
41
41
|
extensions?: { [key: string]: string }[],
|
@@ -12,7 +12,7 @@ type SectionSeparatorProps = {
|
|
12
12
|
className?: string,
|
13
13
|
dark?: boolean,
|
14
14
|
data?: { [key: string]: string; },
|
15
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
15
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
id?: string,
|
17
17
|
lineStyle?: "solid" | "dashed",
|
18
18
|
orientation?: "horizontal" | "vertical",
|
@@ -102,20 +102,29 @@
|
|
102
102
|
pointer-events: none;
|
103
103
|
}
|
104
104
|
&.inline {
|
105
|
+
@mixin active_arrow_style {
|
106
|
+
svg {
|
107
|
+
color: $primary !important;
|
108
|
+
font-size: 16px;
|
109
|
+
}
|
110
|
+
}
|
105
111
|
&:not(:hover) {
|
106
112
|
svg {
|
107
113
|
display: none;
|
108
114
|
}
|
109
115
|
}
|
116
|
+
&.show_arrow:not(:hover) {
|
117
|
+
svg {
|
118
|
+
display: block;
|
119
|
+
}
|
120
|
+
@include active_arrow_style();
|
121
|
+
}
|
110
122
|
&:hover {
|
123
|
+
@include active_arrow_style();
|
111
124
|
select {
|
112
125
|
color: $primary !important;
|
113
126
|
background: rgba(0,130,255,0.1);
|
114
127
|
}
|
115
|
-
svg {
|
116
|
-
color: $primary !important;
|
117
|
-
font-size: 16px;
|
118
|
-
}
|
119
128
|
}
|
120
129
|
select {
|
121
130
|
box-shadow: none;
|
@@ -24,7 +24,7 @@ type SelectProps = {
|
|
24
24
|
data?: { [key: string]: string },
|
25
25
|
disabled?: boolean,
|
26
26
|
error?: string,
|
27
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
27
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
28
28
|
id?: string,
|
29
29
|
includeBlank?: string,
|
30
30
|
inline?: boolean,
|
@@ -36,6 +36,7 @@ type SelectProps = {
|
|
36
36
|
onChange: InputCallback<HTMLSelectElement>,
|
37
37
|
options: SelectOption[],
|
38
38
|
required?: boolean,
|
39
|
+
showArrow?: boolean,
|
39
40
|
value?: string,
|
40
41
|
} & GlobalProps
|
41
42
|
|
@@ -63,9 +64,10 @@ const Select = ({
|
|
63
64
|
inline = false,
|
64
65
|
multiple = false,
|
65
66
|
name,
|
66
|
-
onChange = () =>
|
67
|
+
onChange = () => undefined,
|
67
68
|
options = [],
|
68
69
|
required = false,
|
70
|
+
showArrow = false,
|
69
71
|
value,
|
70
72
|
...props
|
71
73
|
}: SelectProps, ref: React.LegacyRef<HTMLSelectElement>) => {
|
@@ -77,15 +79,16 @@ const Select = ({
|
|
77
79
|
const inlineClass = inline ? 'inline' : null
|
78
80
|
const compactClass = compact ? 'compact' : null
|
79
81
|
const classes = classnames(
|
80
|
-
buildCss(
|
82
|
+
buildCss("pb_select"),
|
81
83
|
globalProps({
|
82
84
|
...props,
|
83
|
-
marginBottom: props.marginBottom || props.margin ||
|
85
|
+
marginBottom: props.marginBottom || props.margin || "sm",
|
84
86
|
}),
|
85
87
|
className,
|
86
88
|
inlineClass,
|
89
|
+
{ show_arrow: showArrow },
|
87
90
|
compactClass
|
88
|
-
)
|
91
|
+
);
|
89
92
|
|
90
93
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
91
94
|
const selectBody =(() =>{
|
@@ -0,0 +1,15 @@
|
|
1
|
+
![select-default](https://github.com/powerhome/playbook/assets/54749071/ead0e074-46ae-425a-ab32-d9c4418a0783)
|
2
|
+
|
3
|
+
|
4
|
+
```swift
|
5
|
+
let defaultOptions = [
|
6
|
+
(value: "1", text: "Burgers"),
|
7
|
+
(value: "2", text: "Pizza"),
|
8
|
+
(value: "3", text: "Tacos")
|
9
|
+
]
|
10
|
+
@State private var defaultState = ""
|
11
|
+
|
12
|
+
PBSelect(title: "Favorite Food", options: defaultOptions, style: .default) { selected in
|
13
|
+
defaultState = selected
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,18 @@
|
|
1
|
+
![select-error](https://github.com/powerhome/playbook/assets/54749071/c02e365b-c3a1-446b-b9f2-47db11315786)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
let defaultOptions = [
|
5
|
+
(value: "1", text: "Burgers"),
|
6
|
+
(value: "2", text: "Pizza"),
|
7
|
+
(value: "3", text: "Tacos")
|
8
|
+
]
|
9
|
+
@State private var errorState = ""
|
10
|
+
|
11
|
+
PBSelect(
|
12
|
+
title: "Favorite Food",
|
13
|
+
options: defaultOptions,
|
14
|
+
style: .error("Please make a valid selection")
|
15
|
+
) { selected in
|
16
|
+
errorState = selected
|
17
|
+
}
|
18
|
+
```
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%= pb_rails("select", props: {
|
2
|
+
label: "Favorite Food",
|
3
|
+
name: "food",
|
4
|
+
inline: true,
|
5
|
+
options: [
|
6
|
+
{
|
7
|
+
value: "1",
|
8
|
+
value_text: "Burgers",
|
9
|
+
},
|
10
|
+
{
|
11
|
+
value: "2",
|
12
|
+
value_text: "Pizza",
|
13
|
+
},
|
14
|
+
{
|
15
|
+
value: "3",
|
16
|
+
value_text: "Tacos",
|
17
|
+
},
|
18
|
+
{
|
19
|
+
value: "4",
|
20
|
+
value_text: "BBQ",
|
21
|
+
},
|
22
|
+
],
|
23
|
+
show_arrow: true
|
24
|
+
}) %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Body, Select } from '../..'
|
3
|
+
|
4
|
+
const SelectInlineShowArrow = (props) => {
|
5
|
+
const options = [
|
6
|
+
{
|
7
|
+
value: '1',
|
8
|
+
text: 'Burgers',
|
9
|
+
},
|
10
|
+
{
|
11
|
+
value: '2',
|
12
|
+
text: 'Pizza',
|
13
|
+
},
|
14
|
+
{
|
15
|
+
value: '3',
|
16
|
+
text: 'Tacos',
|
17
|
+
},
|
18
|
+
]
|
19
|
+
|
20
|
+
return (
|
21
|
+
<div>
|
22
|
+
<Select
|
23
|
+
inline
|
24
|
+
label="Favorite Food"
|
25
|
+
name="food"
|
26
|
+
options={options}
|
27
|
+
showArrow
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
<Body
|
31
|
+
status="negative"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
)
|
36
|
+
}
|
37
|
+
|
38
|
+
export default SelectInlineShowArrow
|
@@ -0,0 +1,8 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **title** | `String` | Sets label title for dropdown | | |
|
5
|
+
| **options** | `(String, String)` | Displays the list of dropdown options | | |
|
6
|
+
| **style** | `Variant` | Options for the state of dropdown | `.default` | `default` `disabled` `error` |
|
7
|
+
| **selectedOption** | `String` | Changes selected value when new value is selected | | |
|
8
|
+
| **selected** | `String` | Changes the value of the option selected in dropdown | | |
|
@@ -10,6 +10,7 @@ examples:
|
|
10
10
|
- select_custom_select: Custom Select
|
11
11
|
- select_error: Select w/ Error
|
12
12
|
- select_inline: Select Inline
|
13
|
+
- select_inline_show_arrow: Select Inline (Always Show Arrow)
|
13
14
|
- select_inline_compact: Select Inline Compact
|
14
15
|
- select_attributes: Select W/ Attributes
|
15
16
|
- select_multiple: Select Multiple
|
@@ -26,5 +27,11 @@ examples:
|
|
26
27
|
- select_custom_select: Custom Select
|
27
28
|
- select_error: Select w/ Error
|
28
29
|
- select_inline: Select Inline
|
30
|
+
- select_inline_show_arrow: Select Inline (Always Show Arrow)
|
29
31
|
- select_inline_compact: Select Inline Compact
|
30
32
|
- select_multiple: Select Multiple
|
33
|
+
|
34
|
+
swift:
|
35
|
+
- select_default_swift: Default
|
36
|
+
- select_error_swift: Error
|
37
|
+
- select_props_table: ""
|
@@ -7,5 +7,6 @@ export { default as SelectCustomSelect } from './_select_custom_select.jsx'
|
|
7
7
|
export { default as SelectValueTextSame } from './_select_value_text_same.jsx'
|
8
8
|
export { default as SelectError } from './_select_error.jsx'
|
9
9
|
export { default as SelectInline } from './_select_inline.jsx'
|
10
|
+
export { default as SelectInlineShowArrow } from './_select_inline_show_arrow.jsx'
|
10
11
|
export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
|
11
12
|
export { default as SelectMultiple } from './_select_multiple.jsx'
|
@@ -19,10 +19,11 @@ module Playbook
|
|
19
19
|
prop :name
|
20
20
|
prop :onchange
|
21
21
|
prop :options, type: Playbook::Props::HashArray, required: false, default: []
|
22
|
+
prop :show_arrow, type: Playbook::Props::Boolean, default: false
|
22
23
|
prop :required, type: Playbook::Props::Boolean, default: false
|
23
24
|
|
24
25
|
def classnames
|
25
|
-
classname + inline_class + compact_class
|
26
|
+
classname + inline_class + compact_class + show_arrow_class
|
26
27
|
end
|
27
28
|
|
28
29
|
def all_attributes
|
@@ -49,6 +50,10 @@ module Playbook
|
|
49
50
|
compact ? "compact" : ""
|
50
51
|
end
|
51
52
|
|
53
|
+
def show_arrow_class
|
54
|
+
show_arrow ? "show_arrow" : ""
|
55
|
+
end
|
56
|
+
|
52
57
|
def select_wrapper_class
|
53
58
|
"pb_select_kit_wrapper" + error_class
|
54
59
|
end
|
@@ -28,7 +28,7 @@ type SelectableCardProps = {
|
|
28
28
|
disabled?: boolean,
|
29
29
|
error?: boolean,
|
30
30
|
icon?: boolean,
|
31
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
31
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
32
32
|
inputId?: string,
|
33
33
|
id?: string,
|
34
34
|
multi?: boolean,
|
@@ -22,7 +22,7 @@ type SelectableCardIconProps = {
|
|
22
22
|
dark?: boolean,
|
23
23
|
data?: { [key: string]: string },
|
24
24
|
disabled?: boolean,
|
25
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
26
|
icon?: string,
|
27
27
|
inputId?: string,
|
28
28
|
multi?: boolean,
|
@@ -18,7 +18,7 @@ type SelectableIconProps = {
|
|
18
18
|
customIcon?: {[key: string] :SVGElement},
|
19
19
|
disabled?: boolean,
|
20
20
|
data?: Object,
|
21
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
21
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
22
22
|
icon: string,
|
23
23
|
inputId: string,
|
24
24
|
inputs: string,
|
@@ -15,7 +15,7 @@ export type SelectableListItemProps = {
|
|
15
15
|
className?: string;
|
16
16
|
data?: object;
|
17
17
|
defaultChecked?: boolean;
|
18
|
-
htmlOptions?: { [key: string]: string | number | boolean |
|
18
|
+
htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
|
19
19
|
id?: string;
|
20
20
|
label?: string;
|
21
21
|
text?: string;
|
@@ -13,7 +13,7 @@ type SelectableListProps = {
|
|
13
13
|
children?: React.ReactElement[],
|
14
14
|
className?: string,
|
15
15
|
data?: object,
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
variant?: 'checkbox' | 'radio',
|
19
19
|
}
|
@@ -15,7 +15,7 @@ type SourceProps = {
|
|
15
15
|
className?: string,
|
16
16
|
data?: { [key: string]: string },
|
17
17
|
hideIcon: boolean,
|
18
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
18
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
19
19
|
id?: string,
|
20
20
|
source?: string,
|
21
21
|
type: "events" | "inbound" | "outbound" | "prospecting" | "referral" | "retail" | "user",
|
@@ -17,7 +17,7 @@ type StarRatingProps = {
|
|
17
17
|
dark?: boolean,
|
18
18
|
fixedWidth?: boolean,
|
19
19
|
layoutOption?: "default" | "number" | "onestar",
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
icon?: string,
|
22
22
|
id?: string,
|
23
23
|
rating: number,
|
@@ -22,7 +22,7 @@ type StatChangeProps = {
|
|
22
22
|
change?: 'increase' | 'decrease' | 'neutral',
|
23
23
|
className?: string,
|
24
24
|
icon?: string,
|
25
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
26
|
id?: string,
|
27
27
|
value?: string | number,
|
28
28
|
}
|
@@ -7,7 +7,7 @@ import Title from '../pb_title/_title'
|
|
7
7
|
|
8
8
|
type StatValueProps = {
|
9
9
|
className?: string,
|
10
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
10
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
11
11
|
id?: string,
|
12
12
|
unit?: string,
|
13
13
|
value: string | number,
|
@@ -14,7 +14,7 @@ type TableProps = {
|
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
dataTable: boolean,
|
16
16
|
disableHover: boolean,
|
17
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
18
|
id?: string,
|
19
19
|
responsive: "collapse" | "scroll" | "none",
|
20
20
|
singleLine: boolean,
|
@@ -8,7 +8,7 @@ type TableRowPropTypes = {
|
|
8
8
|
children: React.ReactNode[] | React.ReactNode,
|
9
9
|
className: string,
|
10
10
|
data?: { [key: string]: string },
|
11
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
11
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
12
12
|
id?: string,
|
13
13
|
sideHighlightColor: string,
|
14
14
|
}
|
@@ -17,7 +17,7 @@ type TextInputProps = {
|
|
17
17
|
dark?: boolean,
|
18
18
|
disabled?: boolean,
|
19
19
|
error?: string,
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string,
|
22
22
|
inline?: boolean,
|
23
23
|
name: string,
|
@@ -22,7 +22,7 @@ type TextareaProps = {
|
|
22
22
|
data?: {[key: string]: string},
|
23
23
|
disabled?: boolean,
|
24
24
|
error?: string,
|
25
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
25
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
26
26
|
id?: string,
|
27
27
|
inline?: boolean,
|
28
28
|
object?: string,
|
@@ -16,7 +16,7 @@ type TimeProps = {
|
|
16
16
|
date: Date;
|
17
17
|
dark?: boolean;
|
18
18
|
id?: string;
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
showIcon?: boolean;
|
21
21
|
size?: "md" | "sm";
|
22
22
|
showTimezone?: boolean;
|
@@ -12,7 +12,7 @@ import Icon from '../pb_icon/_icon'
|
|
12
12
|
type TimeRangeInlineProps = {
|
13
13
|
aria?: { [key: string]: string },
|
14
14
|
className?: string,
|
15
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
15
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
16
16
|
id?: string,
|
17
17
|
data?: { [key: string]: string },
|
18
18
|
alignment?: "left" | "center" | "vertical",
|
@@ -14,7 +14,7 @@ type TimeStackedProps = {
|
|
14
14
|
dark?: boolean,
|
15
15
|
data?: { [key: string]: string },
|
16
16
|
date?: Date,
|
17
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
17
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
18
18
|
id?: string,
|
19
19
|
time?: number | Date,
|
20
20
|
timeZone?: string,
|
@@ -10,7 +10,7 @@ type ItemProps = {
|
|
10
10
|
className?: string,
|
11
11
|
children?: React.ReactNode[] | React.ReactNode,
|
12
12
|
date?: Date,
|
13
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
13
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
14
14
|
icon?: string,
|
15
15
|
iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
|
16
16
|
lineStyle?: 'solid' | 'dotted',
|
@@ -10,7 +10,7 @@ type TimelineProps = {
|
|
10
10
|
children?: React.ReactChild[] | React.ReactChild,
|
11
11
|
className?: string,
|
12
12
|
data?: { [key: string]: string },
|
13
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
13
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
14
14
|
id?: string,
|
15
15
|
orientation?: string,
|
16
16
|
showDate?: boolean,
|
@@ -16,7 +16,7 @@ type TimestampProps = {
|
|
16
16
|
text: string,
|
17
17
|
timestamp: Date | string,
|
18
18
|
timezone: string,
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
showDate?: boolean,
|
22
22
|
showUser?: boolean,
|
@@ -31,10 +31,6 @@
|
|
31
31
|
@include pb_title_thin;
|
32
32
|
}
|
33
33
|
|
34
|
-
&[class*=_truncate] {
|
35
|
-
@include title_truncate;
|
36
|
-
}
|
37
|
-
|
38
34
|
@each $size, $size_value in $breakpoints_grid {
|
39
35
|
@for $title_size_value from 1 through 4 {
|
40
36
|
$min_size: map-get($size_value, "min");
|
@@ -46,7 +42,6 @@
|
|
46
42
|
@else if $title_size_value == 3 { @include pb_title_3; }
|
47
43
|
@else if $title_size_value == 4 { @include pb_title_4; }
|
48
44
|
@include title_colors;
|
49
|
-
@include title_truncate;
|
50
45
|
@if $title_size_value != 4 { @include pb_title_bold; }
|
51
46
|
}
|
52
47
|
}
|
@@ -13,12 +13,11 @@ type TitleProps = {
|
|
13
13
|
className?: string,
|
14
14
|
color?: "default" | "light" | "lighter" | "success" | "error" | "link",
|
15
15
|
data?: {[key: string]: string},
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
size?: SizeType | SizeResponsiveType,
|
19
19
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" | "span",
|
20
20
|
text?: string,
|
21
|
-
truncate?: null | "1" | "2" | "3" | "4" | "5",
|
22
21
|
variant?: null | "link",
|
23
22
|
} & GlobalProps
|
24
23
|
|
@@ -36,7 +35,6 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
36
35
|
bold = true,
|
37
36
|
tag = 'h3',
|
38
37
|
text,
|
39
|
-
truncate = null,
|
40
38
|
variant = null,
|
41
39
|
} = props
|
42
40
|
|
@@ -44,7 +42,6 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
44
42
|
const dataProps: {[key: string]: string | number} = buildDataProps(data)
|
45
43
|
const htmlProps = buildHtmlProps(htmlOptions)
|
46
44
|
const getBold = bold ? '' : 'thin'
|
47
|
-
const isTruncated = truncate ? `truncate-${truncate}` : null
|
48
45
|
const isSizeNumberOrString = typeof size === "number" || typeof size === "string"
|
49
46
|
|
50
47
|
const buildResponsiveSizeCss = () => {
|
@@ -60,7 +57,7 @@ const Title = (props: TitleProps): React.ReactElement => {
|
|
60
57
|
}
|
61
58
|
|
62
59
|
const classes = classnames(
|
63
|
-
buildCss('pb_title_kit', isSizeNumberOrString ? `size_${size}` : "", variant, color, getBold
|
60
|
+
buildCss('pb_title_kit', isSizeNumberOrString ? `size_${size}` : "", variant, color, getBold),
|
64
61
|
globalProps(props),
|
65
62
|
buildResponsiveSizeCss(),
|
66
63
|
className
|
@@ -16,22 +16,3 @@ $pb_title_colors: (
|
|
16
16
|
}
|
17
17
|
}
|
18
18
|
}
|
19
|
-
|
20
|
-
$pb_title_truncate: (
|
21
|
-
truncate-1: 1,
|
22
|
-
truncate-2: 2,
|
23
|
-
truncate-3: 3,
|
24
|
-
truncate-4: 4,
|
25
|
-
truncate-5: 5
|
26
|
-
);
|
27
|
-
|
28
|
-
@mixin title_truncate {
|
29
|
-
@each $name, $number in $pb_title_truncate {
|
30
|
-
&[class*=_#{$name}] {
|
31
|
-
overflow: hidden;
|
32
|
-
display: -webkit-box;
|
33
|
-
-webkit-line-clamp: $number;
|
34
|
-
-webkit-box-orient: vertical;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
@@ -16,15 +16,12 @@ module Playbook
|
|
16
16
|
default: nil,
|
17
17
|
deprecated: true
|
18
18
|
prop :bold, type: Playbook::Props::Boolean, default: true
|
19
|
-
prop :truncate, type: Playbook::Props::Enum,
|
20
|
-
values: [nil, "1", "2", "3", "4", "5"],
|
21
|
-
default: nil
|
22
19
|
|
23
20
|
def classname
|
24
21
|
if is_size_responsive
|
25
|
-
generate_classname("pb_title_kit", variant, color, is_bold
|
22
|
+
generate_classname("pb_title_kit", variant, color, is_bold) + generate_responsive_size_classname
|
26
23
|
else
|
27
|
-
generate_classname("pb_title_kit", size, variant, color, is_bold
|
24
|
+
generate_classname("pb_title_kit", size, variant, color, is_bold)
|
28
25
|
end
|
29
26
|
end
|
30
27
|
|
@@ -32,10 +29,6 @@ module Playbook
|
|
32
29
|
bold ? nil : "thin"
|
33
30
|
end
|
34
31
|
|
35
|
-
def is_truncated
|
36
|
-
truncate ? "truncate-#{truncate}" : nil
|
37
|
-
end
|
38
|
-
|
39
32
|
def is_size_responsive
|
40
33
|
try(:size).is_a?(::Hash)
|
41
34
|
end
|
@@ -16,7 +16,7 @@ type TitleCountProps = {
|
|
16
16
|
count?: number,
|
17
17
|
dark?: boolean,
|
18
18
|
data?: { [key: string]: string },
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
title?: string,
|
22
22
|
size?: "lg" | "sm",
|
@@ -13,7 +13,7 @@ type TitleDetailProps = {
|
|
13
13
|
className?: string,
|
14
14
|
data?: { [key: string]: string },
|
15
15
|
detail: string,
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
16
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
17
|
id?: string,
|
18
18
|
title: string,
|
19
19
|
} & GlobalProps
|
@@ -17,7 +17,7 @@ type Props = {
|
|
17
17
|
children?: React.ReactNode | React.ReactNode[],
|
18
18
|
className?: string,
|
19
19
|
data?: { [key: string]: string },
|
20
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
20
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
21
21
|
id?: string,
|
22
22
|
name?: string,
|
23
23
|
onChange?: InputCallback<HTMLInputElement>,
|
@@ -23,7 +23,7 @@ type TooltipProps = {
|
|
23
23
|
children: JSX.Element,
|
24
24
|
data?: { [key: string]: string },
|
25
25
|
delay?: number | Partial<{open: number; close: number}>,
|
26
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
26
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
27
27
|
icon?: string,
|
28
28
|
interaction?: boolean,
|
29
29
|
placement?: Placement,
|
@@ -25,7 +25,7 @@ type TreemapChartProps = {
|
|
25
25
|
drillable: boolean;
|
26
26
|
grouped: boolean;
|
27
27
|
height?: string;
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
28
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
29
29
|
id: number | string;
|
30
30
|
title?: string;
|
31
31
|
tooltipHtml: string;
|
@@ -34,7 +34,7 @@ type TypeaheadProps = {
|
|
34
34
|
dark?: boolean,
|
35
35
|
data?: { [key: string]: string },
|
36
36
|
error?: string,
|
37
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
37
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
38
38
|
id?: string,
|
39
39
|
label?: string,
|
40
40
|
loadOptions?: string | Noop,
|
@@ -16,7 +16,7 @@ type UserProps = {
|
|
16
16
|
className?: string,
|
17
17
|
dark?: boolean,
|
18
18
|
data?: {[key: string]: string},
|
19
|
-
htmlOptions?: {[key: string]: string | number | boolean |
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
20
20
|
id?: string,
|
21
21
|
name?: string,
|
22
22
|
orientation?: "horizontal" | "vertical",
|