playbook_ui 9.3.0.alpha.inline2 → 9.3.1.pre.alpha1
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_badge/_badge.jsx +1 -26
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +1 -6
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +0 -3
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +3 -6
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +3 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +0 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -9
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -13
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +11 -21
- data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.jsx +4 -17
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +0 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +3 -8
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +4 -4
- data/lib/playbook/version.rb +1 -1
- metadata +4 -4
- data/app/pb_kits/playbook/pb_typeahead/components/Input.jsx +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 512f86e708f55fe0762f6042e620543ad57c4e5f196899085f8e9ee350e404fa
|
4
|
+
data.tar.gz: 01526570d512f3225b3cc575d3bfdd8793f98e2a31f68455dc79f3b0eaea8f08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c788b2ea6aa401f969b45be86ad893e6db69ca4aab6cd68dc00839c5d88fb2c660129f7010730654d50a0f575af84b3971241dc494c5d03284cb015be74977f
|
7
|
+
data.tar.gz: 1b5eb9bb049b233f12e8590d82bc1c29d2dc84995d05f6d7123ee959abea2c3937fd6212cdb38d656ee74069aa1ae266476fcb20e23d6b80fff25033af6ca2e2
|
@@ -3,7 +3,6 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { globalProps } from '../utilities/globalProps.js'
|
6
|
-
import { Icon } from '../'
|
7
6
|
|
8
7
|
import {
|
9
8
|
buildAriaProps,
|
@@ -14,15 +13,8 @@ import {
|
|
14
13
|
type BadgeProps = {
|
15
14
|
aria?: object,
|
16
15
|
className?: string,
|
17
|
-
closeProps?: {
|
18
|
-
onClick?: EventHandler,
|
19
|
-
onMouseDown?: EventHandler,
|
20
|
-
onTouchEnd?: EventHandler,
|
21
|
-
},
|
22
16
|
data?: object,
|
23
17
|
id?: string,
|
24
|
-
removeIcon?: Boolean,
|
25
|
-
removeOnClick?: EventHandler,
|
26
18
|
rounded?: boolean,
|
27
19
|
text?: string,
|
28
20
|
variant?: "error" | "info" | "neutral" | "primary" | "success" | "warning",
|
@@ -31,11 +23,8 @@ const Badge = (props: BadgeProps) => {
|
|
31
23
|
const {
|
32
24
|
aria = {},
|
33
25
|
className,
|
34
|
-
closeProps = {},
|
35
26
|
data = {},
|
36
27
|
id,
|
37
|
-
removeIcon = false,
|
38
|
-
removeOnClick = () => {},
|
39
28
|
rounded = false,
|
40
29
|
text,
|
41
30
|
variant = 'neutral',
|
@@ -55,21 +44,7 @@ const Badge = (props: BadgeProps) => {
|
|
55
44
|
className={css}
|
56
45
|
id={id}
|
57
46
|
>
|
58
|
-
<span>
|
59
|
-
{text}
|
60
|
-
<If condition={removeIcon}>
|
61
|
-
<span
|
62
|
-
onClick={removeOnClick}
|
63
|
-
style={{ cursor: 'pointer' }}
|
64
|
-
{...closeProps}
|
65
|
-
>
|
66
|
-
<Icon
|
67
|
-
fixedWidth
|
68
|
-
icon="times"
|
69
|
-
/>
|
70
|
-
</span>
|
71
|
-
</If>
|
72
|
-
</span>
|
47
|
+
<span>{text}</span>
|
73
48
|
</div>
|
74
49
|
)
|
75
50
|
}
|
@@ -25,8 +25,6 @@ type DatePickerProps = {
|
|
25
25
|
id?: String,
|
26
26
|
inputAria?: object,
|
27
27
|
inputData?: object,
|
28
|
-
inputOnChange?: (String) => void,
|
29
|
-
inputValue?: any,
|
30
28
|
label?: String,
|
31
29
|
maxDate: String,
|
32
30
|
minDate: String,
|
@@ -57,8 +55,6 @@ const DatePicker = (props: DatePickerProps) => {
|
|
57
55
|
id,
|
58
56
|
inputAria,
|
59
57
|
inputData,
|
60
|
-
inputOnChange,
|
61
|
-
inputValue,
|
62
58
|
label = 'Date Picker',
|
63
59
|
maxDate,
|
64
60
|
minDate,
|
@@ -118,6 +114,7 @@ const DatePicker = (props: DatePickerProps) => {
|
|
118
114
|
className={classes}
|
119
115
|
id={id}
|
120
116
|
>
|
117
|
+
{className}
|
121
118
|
<div className="input_wrapper">
|
122
119
|
<TextInput
|
123
120
|
aria={inputAria}
|
@@ -129,9 +126,7 @@ const DatePicker = (props: DatePickerProps) => {
|
|
129
126
|
id={pickerId}
|
130
127
|
label={hideLabel ? null : label}
|
131
128
|
name={name}
|
132
|
-
onChange={inputOnChange}
|
133
129
|
placeholder={placeholder}
|
134
|
-
value={inputValue}
|
135
130
|
/>
|
136
131
|
<If condition={!hideIcon}>
|
137
132
|
<div
|
@@ -166,9 +166,6 @@ 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())
|
172
169
|
}
|
173
170
|
|
174
171
|
export default datePickerHelper
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
|
-
import React
|
3
|
+
import React from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import { buildCss } from '../utilities/props'
|
6
6
|
import { globalProps } from '../utilities/globalProps.js'
|
@@ -22,12 +22,11 @@ type FlexProps = {
|
|
22
22
|
wrap?: boolean,
|
23
23
|
}
|
24
24
|
|
25
|
-
const Flex = (props: FlexProps
|
25
|
+
const Flex = (props: FlexProps) => {
|
26
26
|
const {
|
27
27
|
align = 'none',
|
28
28
|
children,
|
29
29
|
className,
|
30
|
-
id,
|
31
30
|
inline = false,
|
32
31
|
horizontal = 'left',
|
33
32
|
justify = 'none',
|
@@ -71,12 +70,10 @@ const Flex = (props: FlexProps, ref: React.ElementRef<"div">) => {
|
|
71
70
|
globalProps(props),
|
72
71
|
className
|
73
72
|
)}
|
74
|
-
id={id}
|
75
|
-
ref={ref}
|
76
73
|
>
|
77
74
|
{children}
|
78
75
|
</div>
|
79
76
|
)
|
80
77
|
}
|
81
78
|
|
82
|
-
export default
|
79
|
+
export default Flex
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
|
-
import React, {
|
3
|
+
import React, { useEffect, useRef } from 'react'
|
4
4
|
import classnames from 'classnames'
|
5
5
|
import useFocus from './useFocus.js'
|
6
6
|
import Trix from 'trix'
|
@@ -22,7 +22,7 @@ type RichTextEditorProps = {
|
|
22
22
|
value?: string,
|
23
23
|
}
|
24
24
|
|
25
|
-
const RichTextEditor = (props: RichTextEditorProps
|
25
|
+
const RichTextEditor = (props: RichTextEditorProps) => {
|
26
26
|
const {
|
27
27
|
aria = {},
|
28
28
|
className,
|
@@ -120,7 +120,6 @@ const RichTextEditor = (props: RichTextEditorProps, ref: React.ElementRef<"input
|
|
120
120
|
<input
|
121
121
|
id={id}
|
122
122
|
name={name}
|
123
|
-
ref={ref}
|
124
123
|
type="hidden"
|
125
124
|
value={value}
|
126
125
|
/>
|
@@ -134,4 +133,4 @@ const RichTextEditor = (props: RichTextEditorProps, ref: React.ElementRef<"input
|
|
134
133
|
)
|
135
134
|
}
|
136
135
|
|
137
|
-
export default
|
136
|
+
export default RichTextEditor
|
@@ -19,7 +19,6 @@ type TextInputProps = {
|
|
19
19
|
id?: string,
|
20
20
|
name: string,
|
21
21
|
label: string,
|
22
|
-
onBlur: (String) => void,
|
23
22
|
onChange: (String) => void,
|
24
23
|
placeholder: string,
|
25
24
|
required?: boolean,
|
@@ -42,7 +41,6 @@ const TextInput = (
|
|
42
41
|
id,
|
43
42
|
name,
|
44
43
|
label,
|
45
|
-
onBlur = () => {},
|
46
44
|
onChange = () => {},
|
47
45
|
placeholder,
|
48
46
|
required,
|
@@ -81,7 +79,6 @@ const TextInput = (
|
|
81
79
|
disabled={disabled}
|
82
80
|
id={id}
|
83
81
|
name={name}
|
84
|
-
onBlur={onBlur}
|
85
82
|
onChange={onChange}
|
86
83
|
placeholder={placeholder}
|
87
84
|
ref={ref}
|
@@ -24,7 +24,6 @@ type TextareaProps = {
|
|
24
24
|
required?: boolean,
|
25
25
|
rows?: number,
|
26
26
|
resize: 'none' | 'both' | 'horizontal' | 'vertical' | 'auto',
|
27
|
-
onBlur?: InputCallback<HTMLTextAreaElement>,
|
28
27
|
onChange?: InputCallback<HTMLTextAreaElement>,
|
29
28
|
}
|
30
29
|
|
@@ -38,7 +37,6 @@ const Textarea = ({
|
|
38
37
|
label,
|
39
38
|
maxCharacters,
|
40
39
|
name,
|
41
|
-
onBlur = () => {},
|
42
40
|
onChange = () => {},
|
43
41
|
placeholder,
|
44
42
|
required,
|
@@ -77,7 +75,6 @@ const Textarea = ({
|
|
77
75
|
className="pb_textarea_kit"
|
78
76
|
disabled={disabled}
|
79
77
|
name={name}
|
80
|
-
onBlur={onBlur}
|
81
78
|
onChange={onChange}
|
82
79
|
placeholder={placeholder}
|
83
80
|
ref={ref}
|
@@ -3,14 +3,12 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import Select from 'react-select'
|
5
5
|
import AsyncSelect from 'react-select/async'
|
6
|
-
import CreateableSelect from 'react-select/creatable'
|
7
6
|
import { get } from 'lodash'
|
8
7
|
import { globalProps } from '../utilities/globalProps.js'
|
9
8
|
|
10
9
|
import Control from './components/Control'
|
11
10
|
import ClearIndicator from './components/ClearIndicator'
|
12
11
|
import IndicatorsContainer from './components/IndicatorsContainer'
|
13
|
-
// import Input from './components/Input'
|
14
12
|
import MenuList from './components/MenuList'
|
15
13
|
import MultiValue from './components/MultiValue'
|
16
14
|
import Option from './components/Option'
|
@@ -28,7 +26,6 @@ import { noop } from '../utilities/props'
|
|
28
26
|
|
29
27
|
type Props = {
|
30
28
|
async?: boolean,
|
31
|
-
createable?: boolean,
|
32
29
|
dark?: boolean,
|
33
30
|
label?: string,
|
34
31
|
loadOptions?: noop | string,
|
@@ -44,14 +41,12 @@ type Props = {
|
|
44
41
|
|
45
42
|
const Typeahead = (props: Props) => {
|
46
43
|
const selectProps = {
|
47
|
-
badges: false,
|
48
44
|
cacheOptions: true,
|
49
45
|
components: {
|
50
46
|
Control,
|
51
47
|
ClearIndicator,
|
52
48
|
IndicatorsContainer,
|
53
49
|
IndicatorSeparator: null,
|
54
|
-
// Input,
|
55
50
|
MenuList,
|
56
51
|
MultiValue,
|
57
52
|
Option,
|
@@ -63,8 +58,6 @@ const Typeahead = (props: Props) => {
|
|
63
58
|
isClearable: true,
|
64
59
|
isSearchable: true,
|
65
60
|
name,
|
66
|
-
onCreate: () => {},
|
67
|
-
plusIcon: false,
|
68
61
|
...props,
|
69
62
|
}
|
70
63
|
|
@@ -72,8 +65,7 @@ const Typeahead = (props: Props) => {
|
|
72
65
|
if (typeof(props.getOptionLabel) === 'string') selectProps.getOptionLabel = get(window, props.getOptionLabel)
|
73
66
|
if (typeof(props.getOptionValue) === 'string') selectProps.getOptionValue = get(window, props.getOptionValue)
|
74
67
|
|
75
|
-
|
76
|
-
if (props.createable) Tag = CreateableSelect
|
68
|
+
const Tag = props.async ? AsyncSelect : Select
|
77
69
|
|
78
70
|
const handleOnChange = (data, { action, option, removedValue }) => {
|
79
71
|
if (action === 'select-option') {
|
@@ -154,17 +154,4 @@
|
|
154
154
|
box-sizing: border-box;
|
155
155
|
}
|
156
156
|
}
|
157
|
-
.placeholder+.input-wrapper .typeahead-plus-icon {
|
158
|
-
display: none;
|
159
|
-
}
|
160
|
-
.typeahead-kit-select__control--is-focused .typeahead-plus-icon {
|
161
|
-
display: none;
|
162
|
-
}
|
163
|
-
.typeahead-plus-icon {
|
164
|
-
color: $text_lt_lighter;
|
165
|
-
}
|
166
|
-
[class^=pb_badge_kit] span {
|
167
|
-
line-height: 16.5px;
|
168
|
-
letter-spacing: normal;
|
169
|
-
}
|
170
157
|
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import { components } from 'react-select'
|
5
5
|
|
6
|
-
import {
|
6
|
+
import { FormPill } from '../../'
|
7
7
|
|
8
8
|
type Props = {
|
9
9
|
data: object,
|
@@ -15,7 +15,6 @@ type Props = {
|
|
15
15
|
const MultiValue = (props: Props) => {
|
16
16
|
const { removeProps } = props
|
17
17
|
const { imageUrl, label } = props.data
|
18
|
-
const { badges } = props.selectProps
|
19
18
|
|
20
19
|
const formPillProps = {
|
21
20
|
marginRight: 'xs',
|
@@ -29,28 +28,19 @@ const MultiValue = (props: Props) => {
|
|
29
28
|
className="text_input_multivalue_container"
|
30
29
|
{...props}
|
31
30
|
>
|
32
|
-
<If condition={
|
33
|
-
<
|
31
|
+
<If condition={imageUrl}>
|
32
|
+
<FormPill
|
33
|
+
avatarUrl={imageUrl}
|
34
34
|
closeProps={removeProps}
|
35
|
-
|
36
|
-
|
37
|
-
variant="primary"
|
35
|
+
marginRight="xs"
|
36
|
+
name={label}
|
38
37
|
/>
|
39
38
|
<Else />
|
40
|
-
<
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
name={label}
|
46
|
-
/>
|
47
|
-
<Else />
|
48
|
-
<FormPill
|
49
|
-
closeProps={removeProps}
|
50
|
-
marginRight="xs"
|
51
|
-
text={label}
|
52
|
-
/>
|
53
|
-
</If>
|
39
|
+
<FormPill
|
40
|
+
closeProps={removeProps}
|
41
|
+
marginRight="xs"
|
42
|
+
text={label}
|
43
|
+
/>
|
54
44
|
</If>
|
55
45
|
</components.MultiValueContainer>
|
56
46
|
)
|
@@ -1,26 +1,13 @@
|
|
1
1
|
/* @flow */
|
2
2
|
|
3
3
|
import React from 'react'
|
4
|
-
import { Flex, Icon } from '../../'
|
5
4
|
import { components } from 'react-select'
|
6
5
|
|
7
6
|
const Placeholder = (props: any) => (
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
>
|
13
|
-
<components.IndicatorsContainer
|
14
|
-
{...props}
|
15
|
-
/>
|
16
|
-
<If condition={props.selectProps.plusIcon}>
|
17
|
-
<Icon
|
18
|
-
className="typeahead-plus-icon"
|
19
|
-
icon="plus"
|
20
|
-
/>
|
21
|
-
</If>
|
22
|
-
</Flex>
|
23
|
-
</>
|
7
|
+
<components.IndicatorsContainer
|
8
|
+
className="placeholder"
|
9
|
+
{...props}
|
10
|
+
/>
|
24
11
|
)
|
25
12
|
|
26
13
|
export default Placeholder
|
@@ -3,7 +3,7 @@
|
|
3
3
|
import React from 'react'
|
4
4
|
import { Typeahead } from '../..'
|
5
5
|
|
6
|
-
const
|
6
|
+
const options = [
|
7
7
|
{ label: 'Windows', value: '#FFA500' },
|
8
8
|
{ label: 'Siding', value: '#FF0000' },
|
9
9
|
{ label: 'Doors', value: '#00FF00' },
|
@@ -11,18 +11,13 @@ const initOptions = [
|
|
11
11
|
]
|
12
12
|
|
13
13
|
const TypeaheadWithPills = (props) => {
|
14
|
-
// const [values, setValues] = useState([])
|
15
14
|
return (
|
16
15
|
<>
|
17
16
|
<Typeahead
|
18
|
-
badges
|
19
|
-
createable
|
20
17
|
isMulti
|
21
18
|
label="Colors"
|
22
|
-
|
23
|
-
|
24
|
-
placeholder="Placeholder"
|
25
|
-
plusIcon
|
19
|
+
options={options}
|
20
|
+
placeholder=""
|
26
21
|
{...props}
|
27
22
|
/>
|
28
23
|
</>
|
@@ -7,8 +7,8 @@ examples:
|
|
7
7
|
- typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
|
8
8
|
|
9
9
|
react:
|
10
|
-
|
10
|
+
- typeahead_default: Default
|
11
11
|
- typeahead_with_pills: With Pills
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
- typeahead_with_pills_async: With Pills (Async Data)
|
13
|
+
- typeahead_with_pills_async_users: With Pills (Async Data w/ Users)
|
14
|
+
- typeahead_with_pills_async_custom_options: With Pills (Async Data w/ Custom Options)
|
data/lib/playbook/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playbook_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.3.
|
4
|
+
version: 9.3.1.pre.alpha1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Power UX
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-04-
|
12
|
+
date: 2021-04-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -1940,7 +1940,6 @@ files:
|
|
1940
1940
|
- app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.jsx
|
1941
1941
|
- app/pb_kits/playbook/pb_typeahead/components/Control.jsx
|
1942
1942
|
- app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.jsx
|
1943
|
-
- app/pb_kits/playbook/pb_typeahead/components/Input.jsx
|
1944
1943
|
- app/pb_kits/playbook/pb_typeahead/components/MenuList.jsx
|
1945
1944
|
- app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx
|
1946
1945
|
- app/pb_kits/playbook/pb_typeahead/components/Option.jsx
|
@@ -2108,7 +2107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2108
2107
|
- !ruby/object:Gem::Version
|
2109
2108
|
version: 1.3.1
|
2110
2109
|
requirements: []
|
2111
|
-
|
2110
|
+
rubyforge_project:
|
2111
|
+
rubygems_version: 2.7.3
|
2112
2112
|
signing_key:
|
2113
2113
|
specification_version: 4
|
2114
2114
|
summary: Playbook Design System
|
@@ -1,27 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import React from 'react'
|
4
|
-
import { components } from 'react-select'
|
5
|
-
import { Flex, Icon } from '../../'
|
6
|
-
|
7
|
-
const Input = (props: any) => (
|
8
|
-
<>
|
9
|
-
<Flex
|
10
|
-
align="center"
|
11
|
-
className="input-wrapper"
|
12
|
-
>
|
13
|
-
<If condition={props.selectProps.plusIcon}>
|
14
|
-
<Icon
|
15
|
-
className="typeahead-plus-icon"
|
16
|
-
icon="plus"
|
17
|
-
/>
|
18
|
-
</If>
|
19
|
-
<components.Input
|
20
|
-
className="input"
|
21
|
-
{...props}
|
22
|
-
/>
|
23
|
-
</Flex>
|
24
|
-
</>
|
25
|
-
)
|
26
|
-
|
27
|
-
export default Input
|