playbook_ui 13.15.0.pre.alpha.1132globalpropdatepickerspacing1929 → 13.16.0.pre.alpha.PLAY11641991
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_date_picker/_date_picker.scss +3 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -43
- data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -2
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +1 -15
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +40 -33
- data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +4 -4
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +2 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +44 -30
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +4 -4
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +3 -2
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -4
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +10 -10
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -9
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +28 -16
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +5 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +44 -18
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +7 -12
- data/app/pb_kits/playbook/pb_icon/icon.html.erb +6 -4
- data/app/pb_kits/playbook/pb_icon/icon.rb +10 -10
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +3 -2
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +3 -2
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +51 -50
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +20 -19
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +4 -3
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -4
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +20 -20
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +4 -4
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +19 -17
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +23 -21
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +18 -10
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +46 -23
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx +8 -8
- data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx +7 -7
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +17 -15
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +9 -7
- data/app/pb_kits/playbook/pb_select/_select.scss +13 -4
- data/app/pb_kits/playbook/pb_select/_select.tsx +7 -4
- 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/example.yml +2 -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_icon/_selectable_card_icon.tsx +25 -24
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +27 -26
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +2 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +15 -15
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -0
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -4
- data/app/pb_kits/playbook/pb_text_input/text_input.rb +1 -5
- data/dist/playbook-rails.js +4 -4
- data/lib/playbook/version.rb +2 -2
- metadata +4 -2
@@ -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
|
@@ -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,6 +27,7 @@ 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
|
31
33
|
|
@@ -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
|
@@ -33,7 +33,7 @@ type SelectableCardIconProps = {
|
|
33
33
|
onChange?: (event: React.FormEvent<HTMLInputElement>) => void,
|
34
34
|
}
|
35
35
|
|
36
|
-
const SelectableCardIcon = (props: SelectableCardIconProps) => {
|
36
|
+
const SelectableCardIcon = (props: SelectableCardIconProps): React.ReactElement => {
|
37
37
|
const {
|
38
38
|
aria = {},
|
39
39
|
checkmark = false,
|
@@ -70,36 +70,37 @@ const SelectableCardIcon = (props: SelectableCardIconProps) => {
|
|
70
70
|
|
71
71
|
return (
|
72
72
|
<div
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
73
|
+
{...ariaProps}
|
74
|
+
{...dataProps}
|
75
|
+
{...htmlProps}
|
76
|
+
className={classes}
|
77
77
|
>
|
78
78
|
<SelectableCard
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
79
|
+
checked={checked}
|
80
|
+
customIcon={customIcon}
|
81
|
+
dark={dark}
|
82
|
+
disabled={disabled}
|
83
|
+
icon={checkmark}
|
84
|
+
inputId={inputId}
|
85
|
+
multi={multi}
|
86
|
+
name={name}
|
87
|
+
onChange={onChange}
|
88
|
+
value={value}
|
89
89
|
>
|
90
90
|
{
|
91
91
|
<>
|
92
92
|
<SelectableIcon
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
93
|
+
customIcon={customIcon}
|
94
|
+
icon={icon}
|
95
|
+
inputId={''}
|
96
|
+
inputs="disabled"
|
97
|
+
name={''}
|
98
|
+
text={titleText}
|
99
|
+
/>
|
99
100
|
<Body
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
color="light"
|
102
|
+
dark={dark}
|
103
|
+
text={bodyText}
|
103
104
|
/>
|
104
105
|
</>
|
105
106
|
}
|
@@ -6,10 +6,11 @@ import {
|
|
6
6
|
buildAriaProps,
|
7
7
|
buildCss,
|
8
8
|
buildDataProps,
|
9
|
-
buildHtmlProps
|
9
|
+
buildHtmlProps
|
10
10
|
} from '../utilities/props'
|
11
11
|
import Icon from '../pb_icon/_icon'
|
12
12
|
import Title from '../pb_title/_title'
|
13
|
+
import { GenericObject } from '../types'
|
13
14
|
|
14
15
|
type SelectableIconProps = {
|
15
16
|
aria?: {[key: string]: string},
|
@@ -17,7 +18,7 @@ type SelectableIconProps = {
|
|
17
18
|
className?: string,
|
18
19
|
customIcon?: {[key: string] :SVGElement},
|
19
20
|
disabled?: boolean,
|
20
|
-
data?:
|
21
|
+
data?: GenericObject,
|
21
22
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
22
23
|
icon: string,
|
23
24
|
inputId: string,
|
@@ -44,7 +45,7 @@ const SelectableIcon = ({
|
|
44
45
|
text,
|
45
46
|
value,
|
46
47
|
...props
|
47
|
-
}: SelectableIconProps) => {
|
48
|
+
}: SelectableIconProps): React.ReactElement => {
|
48
49
|
const ariaProps = buildAriaProps(aria)
|
49
50
|
const dataProps = buildDataProps(data)
|
50
51
|
const htmlProps = buildHtmlProps(htmlOptions)
|
@@ -64,22 +65,22 @@ const SelectableIcon = ({
|
|
64
65
|
|
65
66
|
return (
|
66
67
|
<div
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
{...ariaProps}
|
69
|
+
{...dataProps}
|
70
|
+
{...htmlProps}
|
71
|
+
className={classes}
|
71
72
|
>
|
72
73
|
{inputs === 'disabled' && (
|
73
74
|
<>
|
74
75
|
<Icon
|
75
|
-
|
76
|
-
|
77
|
-
|
76
|
+
customIcon={customIcon}
|
77
|
+
icon={icon}
|
78
|
+
size="2x"
|
78
79
|
/>
|
79
80
|
<Title
|
80
|
-
|
81
|
-
|
82
|
-
|
81
|
+
size={4}
|
82
|
+
tag="h4"
|
83
|
+
text={text}
|
83
84
|
/>
|
84
85
|
</>
|
85
86
|
)}
|
@@ -87,24 +88,24 @@ const SelectableIcon = ({
|
|
87
88
|
{inputs === 'enabled' && (
|
88
89
|
<>
|
89
90
|
<input
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
91
|
+
{...props}
|
92
|
+
checked={checked}
|
93
|
+
disabled={disabled}
|
94
|
+
id={inputIdPresent}
|
95
|
+
name={name}
|
96
|
+
type={inputType}
|
97
|
+
value={value}
|
97
98
|
/>
|
98
99
|
<label htmlFor={inputIdPresent}>
|
99
100
|
<Icon
|
100
|
-
|
101
|
-
|
102
|
-
|
101
|
+
customIcon={customIcon}
|
102
|
+
icon={icon}
|
103
|
+
size="2x"
|
103
104
|
/>
|
104
105
|
<Title
|
105
|
-
|
106
|
-
|
107
|
-
|
106
|
+
size={4}
|
107
|
+
tag="h4"
|
108
|
+
text={text}
|
108
109
|
/>
|
109
110
|
</label>
|
110
111
|
</>
|
@@ -7,12 +7,13 @@ import { SelectableListItemProps } from './_item.js'
|
|
7
7
|
|
8
8
|
import List from '../pb_list/_list'
|
9
9
|
import SelectableListItem from './_item'
|
10
|
+
import { GenericObject } from '../types'
|
10
11
|
|
11
12
|
type SelectableListProps = {
|
12
13
|
aria?: {[key: string]: string },
|
13
14
|
children?: React.ReactElement[],
|
14
15
|
className?: string,
|
15
|
-
data?:
|
16
|
+
data?: GenericObject,
|
16
17
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
17
18
|
id?: string,
|
18
19
|
variant?: 'checkbox' | 'radio',
|
@@ -32,7 +32,7 @@ const Source = ({
|
|
32
32
|
source,
|
33
33
|
type = 'inbound',
|
34
34
|
user = {},
|
35
|
-
}: SourceProps) => {
|
35
|
+
}: SourceProps): React.ReactElement => {
|
36
36
|
const dataProps = buildDataProps(data)
|
37
37
|
const htmlProps = buildHtmlProps(htmlOptions)
|
38
38
|
const ariaProps = buildAriaProps(aria)
|
@@ -72,11 +72,11 @@ const Source = ({
|
|
72
72
|
|
73
73
|
return (
|
74
74
|
<div
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
75
|
+
{...ariaProps}
|
76
|
+
{...dataProps}
|
77
|
+
{...htmlProps}
|
78
|
+
className={css}
|
79
|
+
id={id}
|
80
80
|
>
|
81
81
|
|
82
82
|
<div className="pb__source_layout">
|
@@ -84,13 +84,13 @@ const Source = ({
|
|
84
84
|
<>
|
85
85
|
{showIcon() &&
|
86
86
|
<IconCircle
|
87
|
-
|
88
|
-
|
87
|
+
icon={typeIconNames[type]}
|
88
|
+
size="sm"
|
89
89
|
/>
|
90
90
|
}
|
91
91
|
{!showIcon() &&
|
92
92
|
<Avatar
|
93
|
-
|
93
|
+
{...avatar()}
|
94
94
|
/>
|
95
95
|
}
|
96
96
|
</>
|
@@ -98,20 +98,20 @@ const Source = ({
|
|
98
98
|
|
99
99
|
<div className="pb__source_content">
|
100
100
|
<Title
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
size={4}
|
102
|
+
tag="h4"
|
103
|
+
text={source}
|
104
104
|
/>
|
105
105
|
|
106
106
|
<div className="pb__source_value">
|
107
107
|
<Body
|
108
|
-
|
109
|
-
|
108
|
+
color="light"
|
109
|
+
text={typeText()}
|
110
110
|
/>
|
111
111
|
|
112
112
|
{user.userId &&
|
113
113
|
<Caption
|
114
|
-
|
114
|
+
text={user.userId}
|
115
115
|
/>
|
116
116
|
}
|
117
117
|
</div>
|
@@ -70,15 +70,12 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
70
70
|
const shouldShowAddOn = icon !== null
|
71
71
|
const addOnCss = shouldShowAddOn ? 'text_input_wrapper_add_on' : ""
|
72
72
|
const addOnDarkModeCardCss = (shouldShowAddOn && dark) ? 'add-on-card-dark' : ""
|
73
|
-
const defaultMarginBottom = props.marginBottom ?? "mb_sm"
|
74
|
-
|
75
73
|
const css = classnames([
|
76
74
|
'pb_text_input_kit',
|
77
75
|
inline ? 'inline' : "",
|
78
76
|
error ? 'error' : "",
|
79
77
|
globalProps(props),
|
80
78
|
className,
|
81
|
-
defaultMarginBottom
|
82
79
|
])
|
83
80
|
const addOnIcon = (
|
84
81
|
<Icon
|
@@ -147,7 +144,7 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
|
|
147
144
|
{...htmlProps}
|
148
145
|
className={css}
|
149
146
|
>
|
150
|
-
{label &&
|
147
|
+
{label &&
|
151
148
|
<Caption
|
152
149
|
className="pb_text_input_kit_label"
|
153
150
|
text={label}
|
@@ -25,12 +25,8 @@ module Playbook
|
|
25
25
|
prop :add_on, type: Playbook::Props::NestedProps,
|
26
26
|
nested_kit: Playbook::PbTextInput::AddOn
|
27
27
|
|
28
|
-
def default_margin_bottom
|
29
|
-
object.margin_bottom.present? ? "" : " mb_sm"
|
30
|
-
end
|
31
|
-
|
32
28
|
def classname
|
33
|
-
generate_classname("pb_text_input_kit") + error_class + inline_class
|
29
|
+
generate_classname("pb_text_input_kit") + error_class + inline_class
|
34
30
|
end
|
35
31
|
|
36
32
|
def input_tag
|