playbook_ui 9.10.0.pre.date.time.stacked.1 → 9.13.0
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/data/menu.yml +1 -0
- data/app/pb_kits/playbook/index.js +1 -0
- data/app/pb_kits/playbook/pb_background/background.rb +0 -1
- data/app/pb_kits/playbook/pb_badge/_badge.jsx +26 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.jsx +51 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.jsx +49 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.scss +55 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.html.erb +9 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumb_item.rb +12 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.html.erb +7 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.rb +11 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/bread_crumbs.test.js +35 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.html.erb +17 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +56 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_description.md +1 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/_button.jsx +8 -19
- data/app/pb_kits/playbook/pb_button/button.rb +5 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.html.erb +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_accessibility.jsx +1 -1
- data/app/pb_kits/playbook/pb_button/docs/_button_link.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_link.jsx +3 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.html.erb +3 -3
- data/app/pb_kits/playbook/pb_button/docs/_button_loading.jsx +3 -0
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +9 -10
- data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.rb +4 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +6 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +3 -0
- data/app/pb_kits/playbook/pb_date_stacked/date_stacked.rb +6 -8
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.rb +6 -6
- data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +2 -2
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +1 -1
- data/app/pb_kits/playbook/pb_flex/flex.rb +4 -4
- data/app/pb_kits/playbook/pb_form/form.rb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.jsx +12 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +19 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.html.erb +13 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +25 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb +4 -5
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +2 -6
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +5 -0
- data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +0 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.jsx +13 -11
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +18 -13
- data/app/pb_kits/playbook/pb_passphrase/useZxcvbn.js +3 -3
- data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +2 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +1 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +10 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +61 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.html.erb +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_inline.jsx +16 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.html.erb +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_toolbar_bottom.jsx +14 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +9 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/selectable_card_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_selectable_icon/selectable_icon.rb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/stat_change.rb +8 -12
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +83 -31
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +106 -0
- data/app/pb_kits/playbook/pb_text_input/add_on.html.erb +13 -0
- data/app/pb_kits/playbook/pb_text_input/add_on.rb +30 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.html.erb +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on.jsx +82 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_custom.html.erb +1 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_inline.html.erb +5 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_inline.jsx +22 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_text_input/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +7 -16
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +43 -3
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +11 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +23 -0
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +23 -11
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +17 -4
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_createable.jsx +25 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.html.erb +36 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_inline.jsx +43 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.html.erb +35 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_multi_kit.jsx +44 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +8 -5
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +1 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +18 -2
- data/app/pb_kits/playbook/pb_user_badge/user_badge.rb +1 -1
- data/lib/playbook/forms/builder/action_area.rb +2 -2
- data/lib/playbook/forms/builder/collection_select_field.rb +2 -2
- data/lib/playbook/forms/builder/select_field.rb +1 -1
- data/lib/playbook/kit_resolver.rb +1 -1
- data/lib/playbook/markdown/template_handler.rb +4 -2
- data/lib/playbook/pb_doc_helper.rb +4 -2
- data/lib/playbook/props.rb +2 -4
- data/lib/playbook/props/base.rb +1 -2
- data/lib/playbook/props/nested_props.rb +23 -0
- data/lib/playbook/version.rb +1 -1
- metadata +56 -26
@@ -21,11 +21,12 @@ module Playbook
|
|
21
21
|
|
22
22
|
def options
|
23
23
|
{
|
24
|
-
|
25
|
-
data: data,
|
24
|
+
aria: aria,
|
26
25
|
class: classname,
|
26
|
+
data: data,
|
27
27
|
disabled: disabled,
|
28
|
-
|
28
|
+
id: id,
|
29
|
+
role: "button",
|
29
30
|
type: type,
|
30
31
|
value: value,
|
31
32
|
}.compact
|
@@ -34,6 +35,7 @@ module Playbook
|
|
34
35
|
def link_options
|
35
36
|
options.merge(
|
36
37
|
href: link,
|
38
|
+
role: "link",
|
37
39
|
target: new_window ? "_blank" : "_self"
|
38
40
|
)
|
39
41
|
end
|
@@ -1 +1 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "
|
1
|
+
<%= pb_rails("button", props: { text: "Button with ARIA", aria: {label: "Go to Google"}, tag: "a", link: "http://google.com" }) %>
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "A Tag Button", tag: "a", link: "http://google.com" }) %>
|
2
|
-
<%= pb_rails("button", props: { text: "Open in new Window", new_window: true, link: "http://google.com" }) %>
|
3
|
-
<%= pb_rails("button", props: { text: "A Tag Button Disabled", disabled: true, link: "http://google.com" }) %>
|
1
|
+
<%= pb_rails("button", props: { text: "A Tag Button", aria: { label: "Link to Google" }, tag: "a", link: "http://google.com" }) %>
|
2
|
+
<%= pb_rails("button", props: { text: "Open in new Window", aria: { label: "Link to Google in new window" }, new_window: true, link: "http://google.com" }) %>
|
3
|
+
<%= pb_rails("button", props: { text: "A Tag Button Disabled", aria: { label: "Disabled link to Google" }, disabled: true, link: "http://google.com" }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLink = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Link to Google' }}
|
7
8
|
link="https://google.com"
|
8
9
|
text="A Tag Button"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Link to Google in new window' }}
|
13
15
|
link="https://google.com"
|
14
16
|
newWindow
|
15
17
|
text="Open in New Window"
|
@@ -17,6 +19,7 @@ const ButtonLink = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Disabled link to Google' }}
|
20
23
|
disabled
|
21
24
|
link="https://google.com"
|
22
25
|
text="A Tag Button Disabled"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
<%= pb_rails("button", props: { text: "Button Primary", loading: true }) %>
|
2
|
-
<%= pb_rails("button", props: { text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
-
<%= pb_rails("button", props: { text: "Button Primary", variant: "link", loading: true }) %>
|
1
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", loading: true }) %>
|
2
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "secondary", loading: true }) %>
|
3
|
+
<%= pb_rails("button", props: { aria: { label: "Loading" }, text: "Button Primary", variant: "link", loading: true }) %>
|
@@ -4,12 +4,14 @@ import { Button } from '../../'
|
|
4
4
|
const ButtonLoading = (props) => (
|
5
5
|
<div>
|
6
6
|
<Button
|
7
|
+
aria={{ label: 'Loading' }}
|
7
8
|
loading
|
8
9
|
text="Button Primary"
|
9
10
|
{...props}
|
10
11
|
/>
|
11
12
|
{' '}
|
12
13
|
<Button
|
14
|
+
aria={{ label: 'Loading' }}
|
13
15
|
loading
|
14
16
|
text="Button Secondary"
|
15
17
|
variant="secondary"
|
@@ -17,6 +19,7 @@ const ButtonLoading = (props) => (
|
|
17
19
|
/>
|
18
20
|
{' '}
|
19
21
|
<Button
|
22
|
+
aria={{ label: 'Loading' }}
|
20
23
|
loading
|
21
24
|
text="A Tag Button Disabled"
|
22
25
|
variant="link"
|
@@ -6,37 +6,36 @@ module Playbook
|
|
6
6
|
prop :chart_data, type: Playbook::Props::Array,
|
7
7
|
default: []
|
8
8
|
prop :style, type: Playbook::Props::Enum,
|
9
|
-
|
10
|
-
|
9
|
+
values: %w[pie],
|
10
|
+
default: "pie"
|
11
11
|
|
12
12
|
prop :data_labels, type: Playbook::Props::Boolean, default: false
|
13
13
|
prop :min_point_size, type: Playbook::Props::Numeric
|
14
14
|
prop :max_point_size, type: Playbook::Props::Numeric
|
15
15
|
prop :inner_size, type: Playbook::Props::Enum,
|
16
|
-
|
17
|
-
|
16
|
+
values: %w[sm md lg none],
|
17
|
+
default: "md"
|
18
18
|
prop :z_min, type: Playbook::Props::Numeric
|
19
19
|
prop :start_angle, type: Playbook::Props::Numeric
|
20
20
|
prop :header_format
|
21
|
-
prop :data_label_html, default:
|
21
|
+
prop :data_label_html, default: "<div>{point.name}</div>"
|
22
22
|
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">●</span>
|
23
23
|
{point.name}: ' + '<b>{point.y}
|
24
24
|
</b>'
|
25
25
|
prop :use_html, type: Playbook::Props::Boolean, default: false
|
26
26
|
prop :legend, type: Playbook::Props::Boolean, default: false
|
27
|
-
prop :title, default:
|
27
|
+
prop :title, default: ""
|
28
28
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
29
29
|
prop :colors, type: Playbook::Props::Array,
|
30
30
|
default: []
|
31
31
|
|
32
|
-
|
33
32
|
def chart_type
|
34
33
|
style == "variablepie" ? "variablepie" : "pie"
|
35
34
|
end
|
36
35
|
|
37
36
|
def chart_data_formatted
|
38
|
-
chart_data.map{ |hash| hash[:y] = hash.delete :value}
|
39
|
-
|
37
|
+
chart_data.map { |hash| hash[:y] = hash.delete :value }
|
38
|
+
chart_data
|
40
39
|
end
|
41
40
|
|
42
41
|
def inner_size_format
|
@@ -57,7 +56,7 @@ module Playbook
|
|
57
56
|
end
|
58
57
|
|
59
58
|
def rounded_border_color
|
60
|
-
rounded == true ?
|
59
|
+
rounded == true ? "null" : nil
|
61
60
|
end
|
62
61
|
|
63
62
|
def chart_options
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Playbook
|
2
4
|
module PbCircleIconButton
|
3
5
|
class CircleIconButton < Playbook::KitBase
|
@@ -8,11 +10,11 @@ module Playbook
|
|
8
10
|
values: %w[primary secondary link],
|
9
11
|
default: "primary"
|
10
12
|
prop :disabled, type: Playbook::Props::Boolean,
|
11
|
-
|
13
|
+
default: false
|
12
14
|
prop :icon, required: true
|
13
15
|
prop :link
|
14
16
|
prop :new_window, type: Playbook::Props::Boolean,
|
15
|
-
|
17
|
+
default: false
|
16
18
|
def classname
|
17
19
|
generate_classname("pb_circle_icon_button_kit")
|
18
20
|
end
|
@@ -25,6 +25,8 @@ type DatePickerProps = {
|
|
25
25
|
id?: String,
|
26
26
|
inputAria?: object,
|
27
27
|
inputData?: object,
|
28
|
+
inputOnChange?: (String) => void,
|
29
|
+
inputValue?: any,
|
28
30
|
label?: String,
|
29
31
|
maxDate: String,
|
30
32
|
minDate: String,
|
@@ -55,6 +57,8 @@ const DatePicker = (props: DatePickerProps) => {
|
|
55
57
|
id,
|
56
58
|
inputAria,
|
57
59
|
inputData,
|
60
|
+
inputOnChange,
|
61
|
+
inputValue,
|
58
62
|
label = 'Date Picker',
|
59
63
|
maxDate,
|
60
64
|
minDate,
|
@@ -114,7 +118,6 @@ const DatePicker = (props: DatePickerProps) => {
|
|
114
118
|
className={classes}
|
115
119
|
id={id}
|
116
120
|
>
|
117
|
-
{className}
|
118
121
|
<div className="input_wrapper">
|
119
122
|
<TextInput
|
120
123
|
aria={inputAria}
|
@@ -126,7 +129,9 @@ const DatePicker = (props: DatePickerProps) => {
|
|
126
129
|
id={pickerId}
|
127
130
|
label={hideLabel ? null : label}
|
128
131
|
name={name}
|
132
|
+
onChange={inputOnChange}
|
129
133
|
placeholder={placeholder}
|
134
|
+
value={inputValue}
|
130
135
|
/>
|
131
136
|
<If condition={!hideIcon}>
|
132
137
|
<div
|
@@ -166,6 +166,9 @@ const datePickerHelper = (config) => {
|
|
166
166
|
picker.input.style.caretColor = 'transparent'
|
167
167
|
picker.input.style.cursor = 'pointer'
|
168
168
|
}
|
169
|
+
|
170
|
+
// Fix event bubbling bug on wrapper
|
171
|
+
document.querySelector(`#${pickerId}`).parentElement.addEventListener('click', (e) => e.stopPropagation())
|
169
172
|
}
|
170
173
|
|
171
174
|
export default datePickerHelper
|
@@ -5,13 +5,13 @@ module Playbook
|
|
5
5
|
class DateStacked < Playbook::KitBase
|
6
6
|
prop :date, type: Playbook::Props::Date, required: true
|
7
7
|
prop :align, type: Playbook::Props::Enum,
|
8
|
-
|
9
|
-
|
8
|
+
values: %w[left center right],
|
9
|
+
default: "left"
|
10
10
|
prop :size, type: Playbook::Props::Enum,
|
11
11
|
values: %w[sm md],
|
12
12
|
default: "sm"
|
13
13
|
prop :reverse, type: Playbook::Props::Boolean,
|
14
|
-
|
14
|
+
default: false
|
15
15
|
prop :dark, type: Playbook::Props::Boolean,
|
16
16
|
default: false
|
17
17
|
prop :bold, type: Playbook::Props::Boolean,
|
@@ -22,13 +22,13 @@ module Playbook
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def title_size
|
25
|
-
size == "md" ? 3: 4
|
25
|
+
size == "md" ? 3 : 4
|
26
26
|
end
|
27
27
|
|
28
28
|
def day
|
29
29
|
day = Playbook::PbKit::PbDateTime.new(date)
|
30
30
|
content_tag(:time, datetime: day.to_iso) do
|
31
|
-
|
31
|
+
day.to_day.to_s
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -41,9 +41,8 @@ module Playbook
|
|
41
41
|
year = Playbook::PbKit::PbDateTime.new(date).to_year.to_i
|
42
42
|
if current_year != year
|
43
43
|
content_tag(:time, datetime: year) do
|
44
|
-
|
44
|
+
year.to_s
|
45
45
|
end
|
46
|
-
else
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
@@ -64,7 +63,6 @@ module Playbook
|
|
64
63
|
def dark_class
|
65
64
|
dark ? "dark" : nil
|
66
65
|
end
|
67
|
-
|
68
66
|
end
|
69
67
|
end
|
70
68
|
end
|
@@ -5,15 +5,15 @@ module Playbook
|
|
5
5
|
class DateTimeStacked < Playbook::KitBase
|
6
6
|
prop :date, deprecated: true
|
7
7
|
prop :date_time, type: Playbook::Props::Date,
|
8
|
-
|
8
|
+
default: ::DateTime.current
|
9
9
|
prop :dark, type: Playbook::Props::Boolean,
|
10
10
|
default: false
|
11
11
|
prop :timezone, type: Playbook::Props::String,
|
12
|
-
|
12
|
+
default: "America/New_York"
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
def date_time_value
|
15
|
+
date || date_time
|
16
|
+
end
|
17
17
|
end
|
18
18
|
end
|
19
|
-
end
|
19
|
+
end
|
@@ -7,9 +7,9 @@ module Playbook
|
|
7
7
|
values: %w[lg sm],
|
8
8
|
default: "lg"
|
9
9
|
prop :widths, type: Playbook::Props::NumberArray,
|
10
|
-
|
10
|
+
default: [1]
|
11
11
|
prop :colors, type: Playbook::Props::Array,
|
12
|
-
|
12
|
+
default: []
|
13
13
|
|
14
14
|
def classname
|
15
15
|
generate_classname("pb_distribution_bar", size)
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module Playbook
|
4
4
|
module PbFilter
|
5
5
|
class Filter < Playbook::KitBase
|
6
|
-
prop :filters, type: Playbook::Props::HashArray, default: [{name:
|
6
|
+
prop :filters, type: Playbook::Props::HashArray, default: [{ name: "" }]
|
7
7
|
prop :sort_menu, type: Playbook::Props::HashArray, default: [{}]
|
8
8
|
prop :results, type: Playbook::Props::Numeric
|
9
9
|
prop :template, type: Playbook::Props::Enum,
|
@@ -74,8 +74,8 @@ module Playbook
|
|
74
74
|
def horizontal_class
|
75
75
|
if orientation == "row"
|
76
76
|
"justify_content_#{horizontal}"
|
77
|
-
|
78
|
-
"align_items_#{horizontal}"
|
77
|
+
elsif align == "none"
|
78
|
+
"align_items_#{horizontal}"
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
@@ -102,8 +102,8 @@ module Playbook
|
|
102
102
|
def vertical_class
|
103
103
|
if orientation == "row"
|
104
104
|
"align_items_#{vertical}"
|
105
|
-
|
106
|
-
"justify_content_#{vertical}"
|
105
|
+
elsif justify == "none"
|
106
|
+
"justify_content_#{vertical}"
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -14,6 +14,7 @@ type FormPillProps = {
|
|
14
14
|
onClick?: EventHandler,
|
15
15
|
avatar?: boolean,
|
16
16
|
avatarUrl?: string,
|
17
|
+
size?: string,
|
17
18
|
closeProps?: {
|
18
19
|
onClick?: EventHandler,
|
19
20
|
onMouseDown?: EventHandler,
|
@@ -21,11 +22,20 @@ type FormPillProps = {
|
|
21
22
|
},
|
22
23
|
}
|
23
24
|
const FormPill = (props: FormPillProps) => {
|
24
|
-
const {
|
25
|
+
const {
|
26
|
+
className,
|
27
|
+
text,
|
28
|
+
name,
|
29
|
+
onClick = () => {},
|
30
|
+
avatarUrl,
|
31
|
+
closeProps = {},
|
32
|
+
size = '',
|
33
|
+
} = props
|
25
34
|
const css = classnames(
|
26
35
|
`pb_form_pill_kit_${'primary'}`,
|
27
36
|
globalProps(props),
|
28
|
-
className
|
37
|
+
className,
|
38
|
+
size === 'small' ? 'small' : null,
|
29
39
|
)
|
30
40
|
return (
|
31
41
|
<div className={css}>
|
@@ -51,4 +51,23 @@ $form_pill_colors: (
|
|
51
51
|
}
|
52
52
|
}
|
53
53
|
}
|
54
|
+
&.small {
|
55
|
+
height: fit-content;
|
56
|
+
height: -moz-fit-content;
|
57
|
+
.pb_form_pill_text, .pb_form_pill_close, .pb_form_pill_tag {
|
58
|
+
font-size: 16px;
|
59
|
+
font-weight: 400;
|
60
|
+
}
|
61
|
+
.pb_form_pill_text, .pb_form_pill_tag {
|
62
|
+
line-height: 1.7;
|
63
|
+
padding-left: $space_xs;
|
64
|
+
padding-right: 2px;
|
65
|
+
}
|
66
|
+
[class^=pb_avatar_kit], [class^=pb_avatar_kit] .avatar_wrapper {
|
67
|
+
width: 20px;
|
68
|
+
height: 20px;
|
69
|
+
flex-basis: 20px;
|
70
|
+
&::before { line-height: 21px; }
|
71
|
+
}
|
72
|
+
}
|
54
73
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<%= pb_rails("form_pill", props: {
|
2
|
+
name: "Anna Black",
|
3
|
+
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
4
|
+
size: "small",
|
5
|
+
}) %>
|
6
|
+
|
7
|
+
<br />
|
8
|
+
<br />
|
9
|
+
|
10
|
+
<%= pb_rails("form_pill", props: {
|
11
|
+
name: "Anna Black",
|
12
|
+
size: "small",
|
13
|
+
}) %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import FormPill from '../_form_pill.jsx'
|
3
|
+
|
4
|
+
const FormPillSize = (props) => {
|
5
|
+
return (
|
6
|
+
|
7
|
+
<div>
|
8
|
+
<FormPill
|
9
|
+
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
10
|
+
name="Anna Black"
|
11
|
+
size="small"
|
12
|
+
{...props}
|
13
|
+
/>
|
14
|
+
<br />
|
15
|
+
<br />
|
16
|
+
<FormPill
|
17
|
+
name="Anna Black"
|
18
|
+
size="small"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
</div>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
export default FormPillSize
|