playbook_ui 14.3.2.pre.alpha.pbntr523enablekitsforradiofix3809 → 14.3.2.pre.alpha.play1472newicons3773
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/Components/SortIconButton.tsx +23 -4
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +17 -5
- data/app/pb_kits/playbook/pb_contact/contact.html.erb +14 -6
- data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
- data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -3
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +6 -3
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +3 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +6 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +23 -245
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_form_pill/form_pill.rb +1 -1
- data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +0 -4
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +21 -97
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +0 -166
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +6 -45
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +2 -6
- data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +1 -21
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +10 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +33 -92
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_radio/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_radio/radio.html.erb +13 -35
- data/app/pb_kits/playbook/pb_radio/radio.rb +1 -3
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -5
- data/app/pb_kits/playbook/pb_select/_select.tsx +5 -2
- data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
- data/app/pb_kits/playbook/pb_select/select.rb +4 -0
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +0 -16
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +0 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +18 -26
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -4
- data/app/pb_kits/playbook/tokens/_colors.scss +0 -2
- data/app/pb_kits/playbook/utilities/icons/allicons.tsx +123 -0
- data/app/pb_kits/playbook/utilities/icons/angle-down.svg +3 -0
- data/app/pb_kits/playbook/utilities/icons/envelope.svg +3 -0
- data/dist/chunks/_typeahead-C7opsM-6.js +22 -0
- data/dist/chunks/_weekday_stacked-Bhq2bj8p.js +45 -0
- data/dist/chunks/lib-ACUFk6Hu.js +29 -0
- data/dist/chunks/{pb_form_validation-zV9OpdSt.js → pb_form_validation-CA0nEXlG.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +8 -23
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.html.erb +0 -117
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.jsx +0 -227
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_colors.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.html.erb +0 -72
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color.jsx +0 -91
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_rails.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_color_react.md +0 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.html.erb +0 -73
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_bubble.jsx +0 -86
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +0 -48
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +0 -59
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.md +0 -1
- data/app/pb_kits/playbook/pb_radio/index.js +0 -17
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.html.erb +0 -31
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color.jsx +0 -26
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_rails.md +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_color_react.md +0 -1
- data/dist/chunks/_typeahead-468tQVei.js +0 -22
- data/dist/chunks/_weekday_stacked-CODev76A.js +0 -45
- data/dist/chunks/lib-D2U4I1U6.js +0 -16
@@ -1,30 +1,28 @@
|
|
1
|
-
/*eslint-disable react/no-multi-comp */
|
1
|
+
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
2
2
|
|
3
|
-
import React, { forwardRef
|
3
|
+
import React, { forwardRef } from 'react'
|
4
4
|
import Body from '../pb_body/_body'
|
5
|
-
import Flex from '../pb_flex/_flex'
|
6
5
|
import classnames from 'classnames'
|
7
6
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
8
7
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
9
8
|
|
10
9
|
type RadioProps = {
|
11
|
-
aria?: {
|
10
|
+
aria?: {[key: string]: string},
|
12
11
|
alignment?: string,
|
13
12
|
checked?: boolean,
|
14
13
|
children?: React.ReactChild[] | React.ReactChild,
|
15
|
-
customChildren?: boolean,
|
16
14
|
className?: string,
|
17
15
|
dark?: boolean,
|
18
|
-
data?: {
|
16
|
+
data?: {[key: string]: string},
|
19
17
|
disabled?: boolean,
|
20
18
|
error?: boolean,
|
21
|
-
htmlOptions?: {
|
19
|
+
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
22
20
|
id?: string,
|
23
21
|
label: string,
|
24
22
|
name?: string,
|
25
23
|
value?: string,
|
26
24
|
text?: string,
|
27
|
-
onChange: (event: React.FormEvent<HTMLInputElement> | null)
|
25
|
+
onChange: (event: React.FormEvent<HTMLInputElement> | null)=>void,
|
28
26
|
} & GlobalProps
|
29
27
|
|
30
28
|
const Radio = ({
|
@@ -32,11 +30,10 @@ const Radio = ({
|
|
32
30
|
alignment,
|
33
31
|
children,
|
34
32
|
className,
|
35
|
-
customChildren,
|
36
33
|
dark = false,
|
34
|
+
data = {},
|
37
35
|
disabled = false,
|
38
36
|
error = false,
|
39
|
-
data = {},
|
40
37
|
htmlOptions = {},
|
41
38
|
id,
|
42
39
|
label,
|
@@ -46,28 +43,17 @@ const Radio = ({
|
|
46
43
|
onChange = () => { void 0 },
|
47
44
|
...props
|
48
45
|
}: RadioProps, ref: any) => {
|
49
|
-
const
|
50
|
-
|
51
|
-
const
|
52
|
-
const dataProps = buildDataProps(data);
|
53
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
46
|
+
const ariaProps = buildAriaProps(aria)
|
47
|
+
const dataProps = buildDataProps(data)
|
48
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
54
49
|
const classes = classnames(
|
55
|
-
buildCss('pb_radio_kit', alignment),
|
56
|
-
dark ? 'dark' : null,
|
57
|
-
error ? 'error' : null,
|
50
|
+
buildCss('pb_radio_kit', alignment ),
|
51
|
+
dark ? 'dark': null, error ? 'error': null,
|
58
52
|
globalProps(props),
|
59
|
-
className
|
60
|
-
);
|
61
|
-
|
62
|
-
const classesCustom = classnames(
|
63
|
-
dark ? 'dark' : null,
|
64
|
-
error ? 'error' : null,
|
65
|
-
globalProps(props),
|
66
|
-
className
|
67
|
-
);
|
53
|
+
className)
|
68
54
|
|
69
55
|
const displayRadio = (props: RadioProps & any) => {
|
70
|
-
if (children
|
56
|
+
if (children)
|
71
57
|
return (children)
|
72
58
|
else
|
73
59
|
return (
|
@@ -84,69 +70,24 @@ const Radio = ({
|
|
84
70
|
/>
|
85
71
|
)}
|
86
72
|
|
87
|
-
const handleContainerClick = (event: React.MouseEvent<HTMLDivElement, MouseEvent> | undefined) => {
|
88
|
-
if (event) {
|
89
|
-
const target = event.target as HTMLElement;
|
90
|
-
if (
|
91
|
-
target.id === 'pb-radio-children-wrapper' ||
|
92
|
-
target.closest('#pb-radio-children-wrapper')
|
93
|
-
) {
|
94
|
-
radioRef.current?.click();
|
95
|
-
}
|
96
|
-
}
|
97
|
-
};
|
98
|
-
|
99
73
|
return (
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
disabled={disabled}
|
119
|
-
id={id}
|
120
|
-
name={name}
|
121
|
-
onChange={onChange}
|
122
|
-
ref={radioRef}
|
123
|
-
type="radio"
|
124
|
-
value={value}
|
125
|
-
{...props}
|
126
|
-
/>
|
127
|
-
<span className="pb_radio_button" />
|
128
|
-
</label>
|
129
|
-
<div id="pb-radio-children-wrapper"> {children} </div>
|
130
|
-
</Flex>
|
131
|
-
) : (
|
132
|
-
<label
|
133
|
-
{...ariaProps}
|
134
|
-
{...dataProps}
|
135
|
-
{...htmlProps}
|
136
|
-
className={classes}
|
137
|
-
htmlFor={id}
|
138
|
-
>
|
139
|
-
<>{displayRadio(props)}</>
|
140
|
-
<span className="pb_radio_button" />
|
141
|
-
<Body
|
142
|
-
dark={dark}
|
143
|
-
status={error ? 'negative' : null}
|
144
|
-
text={label}
|
145
|
-
variant={null}
|
146
|
-
/>
|
147
|
-
</label>
|
148
|
-
)
|
149
|
-
);
|
150
|
-
};
|
74
|
+
<label
|
75
|
+
{...ariaProps}
|
76
|
+
{...dataProps}
|
77
|
+
{...htmlProps}
|
78
|
+
className={classes}
|
79
|
+
htmlFor={id}
|
80
|
+
>
|
81
|
+
<>{displayRadio(props)}</>
|
82
|
+
<span className="pb_radio_button" />
|
83
|
+
<Body
|
84
|
+
dark={dark}
|
85
|
+
status={error ? 'negative' : null}
|
86
|
+
text={label}
|
87
|
+
variant={null}
|
88
|
+
/>
|
89
|
+
</label>
|
90
|
+
)
|
91
|
+
}
|
151
92
|
|
152
|
-
export default forwardRef(Radio)
|
93
|
+
export default forwardRef(Radio)
|
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- radio_options: With Options
|
8
8
|
- radio_alignment: Alignment
|
9
9
|
- radio_disabled: Disabled
|
10
|
-
- radio_custom_children: Custom Children
|
11
10
|
|
12
11
|
react:
|
13
12
|
- radio_default: Default
|
@@ -15,7 +14,6 @@ examples:
|
|
15
14
|
- radio_error: With Error
|
16
15
|
- radio_alignment: Alignment
|
17
16
|
- radio_disabled: Disabled
|
18
|
-
- radio_custom_children: Custom Children
|
19
17
|
|
20
18
|
swift:
|
21
19
|
- radio_default_swift: Default
|
@@ -3,4 +3,3 @@ export { default as RadioCustom } from './_radio_custom.jsx'
|
|
3
3
|
export { default as RadioError } from './_radio_error.jsx'
|
4
4
|
export { default as RadioAlignment } from './_radio_alignment.jsx'
|
5
5
|
export { default as RadioDisabled } from './_radio_disabled.jsx'
|
6
|
-
export { default as RadioCustomChildren } from './_radio_custom_children.jsx'
|
@@ -1,40 +1,18 @@
|
|
1
|
-
|
2
|
-
<%= pb_rails("flex", props: {
|
1
|
+
<%= content_tag(:label,
|
3
2
|
aria: object.aria,
|
4
|
-
|
3
|
+
checked: object.checked,
|
5
4
|
class: object.classname,
|
6
|
-
cursor: "pointer",
|
7
5
|
data: object.data,
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
'data-pb-radio-children': 'true',
|
12
|
-
checked: object.checked,
|
13
|
-
class: object.classname,
|
14
|
-
id: object.id,
|
15
|
-
value: object.value) do %>
|
16
|
-
<%= input %>
|
17
|
-
<span class="pb_radio_button"></span>
|
18
|
-
<% end %>
|
19
|
-
<div data-pb-radio-children-wrapper="true"> <%= content %> </div>
|
20
|
-
<% end %>
|
21
|
-
<% else %>
|
22
|
-
<%= content_tag(:label,
|
23
|
-
aria: object.aria,
|
24
|
-
checked: object.checked,
|
25
|
-
class: object.classname,
|
26
|
-
data: object.data,
|
27
|
-
id: object.id,
|
28
|
-
value: object.value,
|
29
|
-
**combined_html_options) do %>
|
6
|
+
id: object.id,
|
7
|
+
value: object.value,
|
8
|
+
**combined_html_options) do %>
|
30
9
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
10
|
+
<% if content.present? %>
|
11
|
+
<%= content %>
|
12
|
+
<% else %>
|
13
|
+
<%= radio_button_tag object.name, object.value, object.selected, object.input_options %>
|
14
|
+
<% end %>
|
36
15
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
<% end %>
|
16
|
+
<span class="pb_radio_button"></span>
|
17
|
+
<%= pb_rails("body", props: { status: object.body_status, text: object.text, dark: object.dark }) %>
|
18
|
+
<% end %>
|
@@ -20,8 +20,6 @@ module Playbook
|
|
20
20
|
default: "Radio Text"
|
21
21
|
prop :value, type: Playbook::Props::String,
|
22
22
|
default: "radio_text"
|
23
|
-
prop :custom_children, type: Playbook::Props::Boolean,
|
24
|
-
default: false
|
25
23
|
|
26
24
|
def classname
|
27
25
|
generate_classname("pb_radio_kit") + error_class + alignment_class
|
@@ -36,7 +34,7 @@ module Playbook
|
|
36
34
|
end
|
37
35
|
|
38
36
|
def input
|
39
|
-
radio_button_tag(name, value, checked, input_options.merge(disabled: disabled
|
37
|
+
radio_button_tag(name, value, checked, input_options.merge(disabled: disabled))
|
40
38
|
end
|
41
39
|
|
42
40
|
private
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
|
3
|
+
import { getAllIcons } from "../../utilities/icons/allicons"
|
4
|
+
|
3
5
|
import Flex from '../../pb_flex/_flex'
|
4
6
|
import PbReactPopover from '../../pb_popover/_popover'
|
5
7
|
import Button from '../../pb_button/_button'
|
@@ -65,6 +67,7 @@ const toolbarDropdownItems = [
|
|
65
67
|
},
|
66
68
|
]
|
67
69
|
|
70
|
+
const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
|
68
71
|
|
69
72
|
const handleTogglePopover = () => {
|
70
73
|
setShowPopover(!showPopover)
|
@@ -92,8 +95,10 @@ for (const { text, isActive, icon } of toolbarDropdownItems) {
|
|
92
95
|
<Flex className={showPopover ? "fa-flip-vertical" : ""}
|
93
96
|
display="inline_flex"
|
94
97
|
>
|
95
|
-
<Icon
|
96
|
-
|
98
|
+
<Icon
|
99
|
+
className="svg-inline--fa"
|
100
|
+
customIcon={angleDown}
|
101
|
+
fixedWidth
|
97
102
|
margin-left="xs"
|
98
103
|
/>
|
99
104
|
</Flex>
|
@@ -125,8 +130,10 @@ const popoverReference = (
|
|
125
130
|
<Flex className={showPopover ? "fa-flip-vertical" : ""}
|
126
131
|
display="inline_flex"
|
127
132
|
>
|
128
|
-
<Icon
|
129
|
-
|
133
|
+
<Icon
|
134
|
+
className="svg-inline--fa"
|
135
|
+
customIcon={angleDown}
|
136
|
+
fixedWidth
|
130
137
|
margin-left="xs"
|
131
138
|
/>
|
132
139
|
</Flex>
|
@@ -169,4 +176,4 @@ const popoverReference = (
|
|
169
176
|
)
|
170
177
|
}
|
171
178
|
|
172
|
-
export default ToolbarDropdown
|
179
|
+
export default ToolbarDropdown
|
@@ -4,6 +4,7 @@ import classnames from 'classnames'
|
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
5
5
|
import { globalProps, GlobalProps, domSafeProps } from '../utilities/globalProps'
|
6
6
|
import type { InputCallback } from '../types'
|
7
|
+
import { getAllIcons } from "../utilities/icons/allicons"
|
7
8
|
|
8
9
|
import Body from '../pb_body/_body'
|
9
10
|
import Caption from '../pb_caption/_caption'
|
@@ -90,6 +91,8 @@ const Select = ({
|
|
90
91
|
compactClass
|
91
92
|
);
|
92
93
|
|
94
|
+
const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
|
95
|
+
|
93
96
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
94
97
|
const selectBody =(() =>{
|
95
98
|
if (children) return children
|
@@ -134,9 +137,9 @@ const Select = ({
|
|
134
137
|
{selectBody}
|
135
138
|
{ multiple !== true ?
|
136
139
|
<Icon
|
137
|
-
className="pb_select_kit_caret"
|
140
|
+
className="pb_select_kit_caret svg-inline--fa"
|
141
|
+
customIcon={angleDown}
|
138
142
|
fixedWidth
|
139
|
-
icon="angle-down"
|
140
143
|
/>
|
141
144
|
:
|
142
145
|
null
|
@@ -26,7 +26,7 @@
|
|
26
26
|
<%= pb_rails("body", props: { status: "negative", text: object.error }) %>
|
27
27
|
<% end %>
|
28
28
|
<% if object.multiple != true %>
|
29
|
-
<%= pb_rails("icon", props: {
|
29
|
+
<%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(angle_down_path), fixed_width: true, classname: "pb_select_kit_caret"}) %>
|
30
30
|
<% end %>
|
31
31
|
</label>
|
32
32
|
<% end %>
|
@@ -107,20 +107,4 @@ test('should pass className prop', () => {
|
|
107
107
|
|
108
108
|
const kit = screen.getByTestId('typeahead-test')
|
109
109
|
expect(kit).toHaveClass(className)
|
110
|
-
})
|
111
|
-
|
112
|
-
test('typeahead with colored pills', () => {
|
113
|
-
render(
|
114
|
-
<Typeahead
|
115
|
-
data={{ testid: 'pills-color-test' }}
|
116
|
-
defaultValue={[options[0]]}
|
117
|
-
isMulti
|
118
|
-
options={options}
|
119
|
-
pillColor="neutral"
|
120
|
-
/>
|
121
|
-
)
|
122
|
-
|
123
|
-
const kit = screen.getByTestId('pills-color-test')
|
124
|
-
const pill = kit.querySelector(".pb_form_pill_kit_neutral")
|
125
|
-
expect(pill).toBeInTheDocument()
|
126
110
|
})
|
@@ -45,14 +45,12 @@ type TypeaheadProps = {
|
|
45
45
|
getOptionLabel?: string | (() => any),
|
46
46
|
getOptionValue?: string | (() => any),
|
47
47
|
name?: string,
|
48
|
-
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
49
48
|
} & GlobalProps
|
50
49
|
|
51
50
|
export type SelectValueType = {
|
52
51
|
label: string,
|
53
52
|
value: string,
|
54
53
|
imageUrl?: string,
|
55
|
-
pillColor?: string,
|
56
54
|
}
|
57
55
|
|
58
56
|
type TagOnChangeValues = {
|
@@ -78,7 +76,6 @@ const Typeahead = ({
|
|
78
76
|
htmlOptions = {},
|
79
77
|
id,
|
80
78
|
loadOptions = noop,
|
81
|
-
pillColor,
|
82
79
|
...props
|
83
80
|
}: TypeaheadProps) => {
|
84
81
|
const selectProps = {
|
@@ -108,7 +105,6 @@ const Typeahead = ({
|
|
108
105
|
onCreateOption: null as null,
|
109
106
|
plusIcon: false,
|
110
107
|
onMultiValueClick: (_option: SelectValueType): any => undefined,
|
111
|
-
pillColor: pillColor,
|
112
108
|
...props,
|
113
109
|
}
|
114
110
|
|
@@ -8,7 +8,6 @@ import { SelectValueType } from '../_typeahead'
|
|
8
8
|
type Props = {
|
9
9
|
data: SelectValueType,
|
10
10
|
multiValueTemplate: any,
|
11
|
-
pillColor?: "primary" | "neutral" | "success" | "warning" | "error" | "info" | "data_1" | "data_2" | "data_3" | "data_4" | "data_5" | "data_6" | "data_7" | "data_8" | "windows" | "siding" | "roofing" | "doors" | "gutters" | "solar" | "insulation" | "accessories",
|
12
11
|
removeProps: any,
|
13
12
|
selectProps: any,
|
14
13
|
}
|
@@ -16,55 +15,48 @@ type Props = {
|
|
16
15
|
const MultiValue = (props: Props) => {
|
17
16
|
const { removeProps } = props
|
18
17
|
const { imageUrl, label } = props.data
|
19
|
-
const {
|
18
|
+
const { multiKit } = props.selectProps
|
20
19
|
|
21
20
|
const formPillProps = {
|
22
21
|
marginRight: 'xs',
|
23
22
|
name: label,
|
24
23
|
avatarUrl: '',
|
25
|
-
dark,
|
26
24
|
}
|
27
25
|
|
28
26
|
if (typeof imageUrl === 'string') formPillProps.avatarUrl = imageUrl
|
29
27
|
|
30
28
|
return (
|
31
29
|
<components.MultiValueContainer
|
32
|
-
|
33
|
-
|
30
|
+
className="text_input_multivalue_container"
|
31
|
+
{...props}
|
34
32
|
>
|
35
33
|
{multiKit === 'badge' &&
|
36
34
|
<Badge
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
closeProps={removeProps}
|
36
|
+
removeIcon
|
37
|
+
text={label}
|
38
|
+
variant="primary"
|
41
39
|
/>
|
42
40
|
}
|
43
41
|
|
44
42
|
{multiKit !== 'badge' && imageUrl &&
|
45
43
|
<FormPill
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
size={multiKit === 'smallPill' ? 'small' : ''}
|
53
|
-
text=''
|
54
|
-
{...props}
|
44
|
+
avatarUrl={imageUrl}
|
45
|
+
closeProps={removeProps}
|
46
|
+
marginRight="xs"
|
47
|
+
name={label}
|
48
|
+
size={multiKit === 'smallPill' ? 'small' : ''}
|
49
|
+
text=''
|
55
50
|
/>
|
56
51
|
}
|
57
52
|
|
58
53
|
{multiKit !== 'badge' && !imageUrl &&
|
59
54
|
<FormPill
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
size={multiKit === 'smallPill' ? 'small' : ''}
|
66
|
-
text={label}
|
67
|
-
{...props}
|
55
|
+
closeProps={removeProps}
|
56
|
+
marginRight="xs"
|
57
|
+
name=''
|
58
|
+
size={multiKit === 'smallPill' ? 'small' : ''}
|
59
|
+
text={label}
|
68
60
|
/>
|
69
61
|
}
|
70
62
|
</components.MultiValueContainer>
|
@@ -9,7 +9,6 @@ examples:
|
|
9
9
|
- typeahead_inline: Inline
|
10
10
|
- typeahead_multi_kit: Multi Kit Options
|
11
11
|
- typeahead_error_state: Error State
|
12
|
-
- typeahead_with_pills_color: With Pills (Custom Color)
|
13
12
|
|
14
13
|
react:
|
15
14
|
- typeahead_default: Default
|
@@ -24,4 +23,3 @@ examples:
|
|
24
23
|
- typeahead_async_createable: Createable (+ Async Data)
|
25
24
|
- typeahead_error_state: Error State
|
26
25
|
- typeahead_custom_menu_list: Custom MenuList
|
27
|
-
- typeahead_with_pills_color: With Pills (Custom Color)
|
@@ -10,4 +10,3 @@ export { default as TypeaheadCreateable } from './_typeahead_createable.jsx'
|
|
10
10
|
export { default as TypeaheadAsyncCreateable } from './_typeahead_async_createable.jsx'
|
11
11
|
export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
|
12
12
|
export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
|
13
|
-
export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
|
@@ -34,9 +34,6 @@ module Playbook
|
|
34
34
|
prop :search_term_minimum_length, default: 3
|
35
35
|
prop :search_debounce_timeout, default: 250
|
36
36
|
prop :value
|
37
|
-
prop :pill_color, type: Playbook::Props::Enum,
|
38
|
-
values: %w[primary neutral success warning error info data_1 data_2 data_3 data_4 data_5 data_6 data_7 data_8 windows siding roofing doors gutters solar insulation accessories],
|
39
|
-
default: "primary"
|
40
37
|
|
41
38
|
def classname
|
42
39
|
generate_classname("pb_typeahead_kit")
|
@@ -61,7 +58,6 @@ module Playbook
|
|
61
58
|
def typeahead_react_options
|
62
59
|
base_options = {
|
63
60
|
className: classname,
|
64
|
-
pillColor: pill_color,
|
65
61
|
dark: dark,
|
66
62
|
defaultValue: default_options,
|
67
63
|
error: error,
|
@@ -259,7 +259,6 @@ $solar: $product_4_background !default; // deprecated
|
|
259
259
|
$roofing: $product_5_background !default; // deprecated
|
260
260
|
$gutters: $product_6_background !default; // deprecated
|
261
261
|
$insulation: $product_7_background !default; // deprecated
|
262
|
-
$accessories: $product_8_background !default; // added specifically for form_pill product map
|
263
262
|
$product_colors: (
|
264
263
|
windows: $windows,
|
265
264
|
siding: $siding,
|
@@ -268,7 +267,6 @@ $product_colors: (
|
|
268
267
|
roofing: $roofing,
|
269
268
|
gutters: $gutters,
|
270
269
|
insulation: $insulation,
|
271
|
-
accessories: $accessories,
|
272
270
|
product_1_background: $product_1_background,
|
273
271
|
product_1_highlight: $product_1_highlight,
|
274
272
|
product_2_background: $product_2_background,
|