playbook_ui 8.2.1.pre.alpha4 → 8.3.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/data/menu.yml +2 -3
- 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.scss +7 -0
- 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_rich_text_editor/_rich_text_editor.scss +63 -54
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +2 -1
- data/app/pb_kits/playbook/pb_select/_select.scss +15 -5
- data/app/pb_kits/playbook/pb_select/docs/_select_custom_select.jsx +4 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_input.jsx +145 -135
- data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +0 -3
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -18
- data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -3
- data/app/pb_kits/playbook/pb_textarea/_textarea.scss +29 -19
- data/app/pb_kits/playbook/pb_textarea/_textarea_mixin.scss +9 -4
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_character_counter.jsx +5 -1
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_custom.jsx +4 -2
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -9
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +17 -24
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +11 -21
- 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/_typeahead_with_pills_async_users.jsx +1 -0
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +4 -4
- data/app/pb_kits/playbook/tokens/_colors.scss +1 -1
- data/lib/playbook/version.rb +1 -2
- metadata +6 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Input.jsx +0 -43
@@ -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}
|
@@ -5,28 +5,30 @@
|
|
5
5
|
|
6
6
|
[class^=pb_textarea_kit] {
|
7
7
|
margin-bottom: $space_sm;
|
8
|
+
|
8
9
|
[class^=pb_caption_kit] {
|
9
10
|
margin-bottom: $space_xs;
|
10
11
|
display: block;
|
11
12
|
}
|
12
|
-
textarea::placeholder
|
13
|
+
textarea::placeholder,
|
14
|
+
.pb_text_area_kit::placeholder {
|
13
15
|
@include pb_body_light;
|
14
16
|
}
|
15
|
-
|
17
|
+
textarea,
|
18
|
+
.pb_text_area_kit {
|
16
19
|
@include pb_textarea_light;
|
17
20
|
}
|
18
|
-
textarea:focus
|
21
|
+
textarea:focus,
|
22
|
+
.pb_text_area_kit:focus {
|
23
|
+
border-color: $primary;
|
19
24
|
@include pb_textarea_focus_light;
|
25
|
+
@include transition_default;
|
20
26
|
}
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
margin-top: $space_xs / 2;
|
25
|
-
}
|
26
|
-
> textarea {
|
27
|
-
border-color: $error;
|
28
|
-
}
|
27
|
+
textarea:hover,
|
28
|
+
.pb_text_area_kit:hover {
|
29
|
+
background-color: rgba($focus_input_light,$opacity_5);
|
29
30
|
}
|
31
|
+
|
30
32
|
&.resize_both > textarea {
|
31
33
|
resize: both;
|
32
34
|
overflow: auto;
|
@@ -44,16 +46,24 @@
|
|
44
46
|
textarea::placeholder {
|
45
47
|
@include pb_body_light_dark;
|
46
48
|
}
|
47
|
-
|
48
|
-
|
49
|
+
textarea,
|
50
|
+
.pb_text_area_kit {
|
51
|
+
@include pb_body_dark;
|
52
|
+
background-color: rgba($white, $opacity_1);
|
53
|
+
border-color: rgba($white, 0.15);
|
49
54
|
}
|
50
|
-
textarea:focus {
|
51
|
-
|
55
|
+
textarea:focus, .pb_text_area_kit:focus {
|
56
|
+
border-color: $active_dark;
|
57
|
+
background-color: rgba($white, 0.025);
|
52
58
|
}
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
59
|
+
}
|
60
|
+
|
61
|
+
&.error {
|
62
|
+
[class*=pb_body_kit] {
|
63
|
+
margin-top: $space_xs / 2;
|
64
|
+
}
|
65
|
+
textarea {
|
66
|
+
border-color: $error;
|
57
67
|
}
|
58
68
|
}
|
59
69
|
|
@@ -22,7 +22,7 @@
|
|
22
22
|
overflow-wrap: break-word;
|
23
23
|
resize: none;
|
24
24
|
transition-property: box-shadow, color, background-color;
|
25
|
-
transition-duration: .
|
25
|
+
transition-duration: .3s;
|
26
26
|
transition-timing-function: $bezier;
|
27
27
|
&[type=number] {
|
28
28
|
-moz-appearance:textfield;
|
@@ -40,9 +40,9 @@
|
|
40
40
|
&:-webkit-autofill,
|
41
41
|
&:-webkit-autofill:hover,
|
42
42
|
&:-internal-autofill-selected {
|
43
|
-
|
44
|
-
-
|
45
|
-
transition: background-color
|
43
|
+
color: $text_color;
|
44
|
+
background-color: rgba($focus_input_light, $opacity_5);
|
45
|
+
transition: background-color 0.3s ease-in-out 0s;
|
46
46
|
font-family: $font_family_base;
|
47
47
|
}
|
48
48
|
}
|
@@ -68,3 +68,8 @@
|
|
68
68
|
@mixin pb_textarea_focus_dark {
|
69
69
|
@include pb_textarea_focus($focus_input_dark);
|
70
70
|
}
|
71
|
+
|
72
|
+
// Transitions ======================
|
73
|
+
@mixin transition_default{
|
74
|
+
transition: background-color 0.3s ease-in-out 0s, border-color 0.3s ease-in-out 0s;
|
75
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import React, { useState } from 'react'
|
2
2
|
import { Textarea } from '../../'
|
3
3
|
|
4
|
-
const TextareaCharacterCounter = () => {
|
4
|
+
const TextareaCharacterCounter = (props) => {
|
5
5
|
const [value1, setValue1] = useState('Counting characters!')
|
6
6
|
const [value2, setValue2] = useState('This counter prevents the user from exceeding the maximum number of allowed characters. Just try it!')
|
7
7
|
const [value3, setValue3] = useState('This counter alerts the user that they have exceeded the maximum number of allowed characters.')
|
@@ -41,6 +41,7 @@ const TextareaCharacterCounter = () => {
|
|
41
41
|
label="Count Only"
|
42
42
|
onChange={(event) => setCount1(event.target.value.length)}
|
43
43
|
rows={4}
|
44
|
+
{...props}
|
44
45
|
/>
|
45
46
|
|
46
47
|
<br />
|
@@ -52,6 +53,7 @@ const TextareaCharacterCounter = () => {
|
|
52
53
|
onChange={() => handleMaxCount(event)}
|
53
54
|
rows={4}
|
54
55
|
value={value1}
|
56
|
+
{...props}
|
55
57
|
/>
|
56
58
|
|
57
59
|
<br />
|
@@ -63,6 +65,7 @@ const TextareaCharacterCounter = () => {
|
|
63
65
|
onChange={() => handleMaxCountWithBlocker(event, 100)}
|
64
66
|
rows={4}
|
65
67
|
value={value2}
|
68
|
+
{...props}
|
66
69
|
/>
|
67
70
|
|
68
71
|
<br />
|
@@ -75,6 +78,7 @@ const TextareaCharacterCounter = () => {
|
|
75
78
|
onChange={() => handleMaxCountWithError(event, 75)}
|
76
79
|
rows={4}
|
77
80
|
value={value3}
|
81
|
+
{...props}
|
78
82
|
/>
|
79
83
|
</>
|
80
84
|
)
|
@@ -4,12 +4,14 @@ import { Textarea } from '../../'
|
|
4
4
|
const TextareaCustom = (props) => {
|
5
5
|
return (
|
6
6
|
<div>
|
7
|
-
<Textarea
|
7
|
+
<Textarea
|
8
|
+
label="Label"
|
9
|
+
{...props}
|
10
|
+
>
|
8
11
|
<textarea
|
9
12
|
className="my_custom_class"
|
10
13
|
name="custom_textarea"
|
11
14
|
rows={4}
|
12
|
-
{...props}
|
13
15
|
>
|
14
16
|
{'Content goes here.'}
|
15
17
|
</textarea>
|
@@ -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') {
|
@@ -4,9 +4,18 @@
|
|
4
4
|
@import "../tokens/shadows";
|
5
5
|
|
6
6
|
[class^=pb_typeahead_kit] {
|
7
|
+
.typeahead-kit-select__option {
|
8
|
+
cursor: pointer;
|
9
|
+
}
|
7
10
|
.pb_typeahead_wrapper {
|
8
11
|
position: relative;
|
9
|
-
|
12
|
+
.text_input_value_container{
|
13
|
+
cursor: text;
|
14
|
+
}
|
15
|
+
.text_input_indicators,
|
16
|
+
.pb_list_kit {
|
17
|
+
cursor: pointer;
|
18
|
+
}
|
10
19
|
.pb_typeahead_loading_indicator {
|
11
20
|
position: absolute;
|
12
21
|
width: min-content;
|
@@ -17,7 +26,6 @@
|
|
17
26
|
transition: opacity .15s ease-in-out;
|
18
27
|
}
|
19
28
|
}
|
20
|
-
|
21
29
|
[class^=pb_text_input_kit] {
|
22
30
|
.text_input_wrapper {
|
23
31
|
& > input:first-child {
|
@@ -25,7 +33,6 @@
|
|
25
33
|
}
|
26
34
|
}
|
27
35
|
}
|
28
|
-
|
29
36
|
.pb_item_kit {
|
30
37
|
padding: ($space_xs + 2) 0;
|
31
38
|
|
@@ -35,7 +42,6 @@
|
|
35
42
|
}
|
36
43
|
}
|
37
44
|
}
|
38
|
-
|
39
45
|
[class^=pb_list_kit] {
|
40
46
|
max-height: 18em;
|
41
47
|
overflow-y: auto;
|
@@ -49,17 +55,14 @@
|
|
49
55
|
border-radius: $border_rad_heavier;
|
50
56
|
transition: opacity .25s ease-in-out;
|
51
57
|
}
|
52
|
-
|
53
58
|
&:focus-within [class^=pb_list_kit] {
|
54
59
|
display: block;
|
55
60
|
opacity: 1;
|
56
61
|
}
|
57
|
-
|
58
62
|
&:not(:focus-within) [class^=pb_list_kit] {
|
59
63
|
display: none;
|
60
64
|
opacity: 0;
|
61
65
|
}
|
62
|
-
|
63
66
|
[class^=pb_list_kit] {
|
64
67
|
margin-top: -$space-sm;
|
65
68
|
li {
|
@@ -69,7 +72,6 @@
|
|
69
72
|
&:focus-within {
|
70
73
|
background-color: $active_light;
|
71
74
|
}
|
72
|
-
|
73
75
|
> button {
|
74
76
|
background: none;
|
75
77
|
color: $text_lt_default;
|
@@ -84,7 +86,6 @@
|
|
84
86
|
}
|
85
87
|
}
|
86
88
|
}
|
87
|
-
|
88
89
|
&[class*=dark] {
|
89
90
|
.pb_typeahead_wrapper .pb_typeahead_loading_indicator {
|
90
91
|
color: $text_dk_light;
|
@@ -97,7 +98,10 @@
|
|
97
98
|
color: $white;
|
98
99
|
}
|
99
100
|
.typeahead-kit-select__option:hover {
|
100
|
-
background-color:
|
101
|
+
background-color: $active_dark;
|
102
|
+
}
|
103
|
+
.typeahead-kit-select__indicator:hover {
|
104
|
+
color: $white;
|
101
105
|
}
|
102
106
|
.typeahead-kit-select__input {
|
103
107
|
color: white;
|
@@ -105,13 +109,12 @@
|
|
105
109
|
box-shadow: none;
|
106
110
|
}
|
107
111
|
}
|
108
|
-
.typeahead-kit-select__single-value{
|
112
|
+
.typeahead-kit-select__single-value {
|
109
113
|
color: white;
|
110
114
|
}
|
111
115
|
.typeahead-kit-select__option--is-focused {
|
112
|
-
background-color:
|
116
|
+
background-color: $active_dark;
|
113
117
|
}
|
114
|
-
|
115
118
|
[class^=pb_list_kit] {
|
116
119
|
background-color: $bg_dark;
|
117
120
|
}
|
@@ -121,12 +124,11 @@
|
|
121
124
|
}
|
122
125
|
@media (hover:hover) {
|
123
126
|
&:hover {
|
124
|
-
background-color:
|
127
|
+
background-color: rgba($white,.1);
|
125
128
|
}
|
126
129
|
}
|
127
130
|
}
|
128
131
|
}
|
129
|
-
|
130
132
|
&.react-select, &.react-select .dark {
|
131
133
|
.text_input {
|
132
134
|
display: inherit;
|
@@ -148,13 +150,4 @@
|
|
148
150
|
box-sizing: border-box;
|
149
151
|
}
|
150
152
|
}
|
151
|
-
|
152
|
-
.typeahead-plus-icon {
|
153
|
-
color: $neutral;
|
154
|
-
}
|
155
|
-
|
156
|
-
[class^=pb_badge_kit] span {
|
157
|
-
line-height: 16.5px;
|
158
|
-
letter-spacing: normal;
|
159
|
-
}
|
160
153
|
}
|
@@ -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
|
)
|
@@ -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
|
</>
|