playbook_ui 8.2.1.pre.alpha2 → 8.3.0.alpha.select.pre.margin

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/data/menu.yml +2 -3
  3. data/app/pb_kits/playbook/pb_badge/_badge.jsx +1 -26
  4. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +1 -6
  5. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +7 -0
  6. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +0 -3
  7. data/app/pb_kits/playbook/pb_dialog/dialog_header.rb +23 -24
  8. data/app/pb_kits/playbook/pb_flex/_flex.jsx +3 -6
  9. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.jsx +3 -4
  10. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.scss +63 -54
  11. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.jsx +2 -1
  12. data/app/pb_kits/playbook/pb_select/_select.jsx +10 -1
  13. data/app/pb_kits/playbook/pb_select/_select.scss +35 -28
  14. data/app/pb_kits/playbook/pb_select/docs/_select_custom_select.jsx +4 -1
  15. data/app/pb_kits/playbook/pb_select/select.rb +5 -1
  16. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -1
  17. data/app/pb_kits/playbook/pb_selectable_card/docs/_selectable_card_input.jsx +145 -135
  18. data/app/pb_kits/playbook/pb_text_input/_text_input.jsx +0 -3
  19. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +17 -18
  20. data/app/pb_kits/playbook/pb_textarea/_textarea.jsx +0 -3
  21. data/app/pb_kits/playbook/pb_textarea/_textarea.scss +29 -19
  22. data/app/pb_kits/playbook/pb_textarea/_textarea_mixin.scss +9 -4
  23. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_character_counter.jsx +5 -1
  24. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_custom.jsx +4 -2
  25. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +1 -9
  26. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +17 -24
  27. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +11 -21
  28. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.jsx +0 -1
  29. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +3 -8
  30. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +1 -0
  31. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +4 -4
  32. data/app/pb_kits/playbook/tokens/_colors.scss +1 -1
  33. data/lib/playbook/version.rb +1 -2
  34. metadata +4 -4
  35. data/app/pb_kits/playbook/pb_typeahead/components/Input.jsx +0 -43
@@ -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}
@@ -8,59 +8,59 @@
8
8
  margin-bottom: $space_xs;
9
9
  display: block;
10
10
  }
11
-
12
11
  .text_input_wrapper {
13
12
  margin-bottom: $space_sm;
14
13
  display: block;
15
-
16
14
  input::placeholder,
17
15
  .text_input .placeholder {
18
16
  @include pb_body_light;
19
17
  }
20
-
21
18
  input,
22
19
  .text_input {
20
+ max-height: 45px;
23
21
  @include pb_textarea_light;
24
- @include pb_title_4;
25
22
  overflow: hidden;
26
23
  }
27
-
24
+ input:hover,
25
+ .text_input:hover{
26
+ background-color: rgba($focus_input_light,$opacity_5);
27
+ }
28
28
  input:focus,
29
29
  .text_input:focus,
30
30
  input:-webkit-autofill:focus,
31
31
  .text_input:-webkit-autofill:focus {
32
32
  @include pb_textarea_focus;
33
- -webkit-box-shadow: 0 0 0px 1000px $focus_input_light inset;
34
- transition: background-color 5000s ease-in-out 0s;
33
+ @include transition_default;
34
+ border-color: $primary;
35
+ background-color: rgba($focus_input_light,$opacity_5);
35
36
  }
36
37
  }
37
-
38
38
  &.dark {
39
39
  .text_input_wrapper {
40
40
  margin-bottom: 1rem;
41
-
42
41
  input::placeholder,
43
42
  .text_input .placeholder {
44
43
  @include pb_body_light_dark;
45
44
  }
46
-
47
45
  input, .text_input {
48
46
  @include pb_textarea_dark;
49
- @include pb_title_4;
50
- @include pb_title_dark;
47
+ @include pb_body_dark;
51
48
  overflow: hidden;
49
+ background-color: rgba($white,$opacity_1);
50
+ border-color: rgba($white, 0.15);
51
+ }
52
+ input:hover,
53
+ .text_input:hover{
54
+ background-color: rgba($white, 0.15);
52
55
  }
53
-
54
56
  input:focus,
55
57
  .text_input:focus,
56
58
  input:-webkit-autofill:focus,
57
59
  .text_input:-webkit-autofill:focus {
58
- @include pb_textarea_focus_dark;
59
- -webkit-box-shadow: 0 0 0px 1000px $focus_input_dark inset;
60
- transition: background-color 5000s ease-in-out 0s;
60
+ border-color: $active_dark;
61
+ background-color: rgba($white, 0.025);
61
62
  }
62
63
  }
63
-
64
64
  &.error {
65
65
  .text_input_wrapper {
66
66
  input, .text_input {
@@ -69,7 +69,6 @@
69
69
  }
70
70
  }
71
71
  }
72
-
73
72
  &.error {
74
73
  .text_input_wrapper {
75
74
  [class*=pb_body_kit] {
@@ -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
- > textarea {
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
- &.error {
23
- [class*=pb_body_kit] {
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
- > textarea {
48
- @include pb_textarea_dark;
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
- @include pb_textarea_focus_dark;
55
+ textarea:focus, .pb_text_area_kit:focus {
56
+ border-color: $active_dark;
57
+ background-color: rgba($white, 0.025);
52
58
  }
53
- &.error {
54
- > textarea {
55
- border-color: $error_dark;
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: .24s;
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
- -webkit-text-fill-color: $text_color;
44
- -webkit-box-shadow: 0 0 0px 1000px transparent inset;
45
- transition: background-color 5000s ease-in-out 0s;
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 label="Label">
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
- let Tag = props.async ? AsyncSelect : Select
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: tint($focus_input_dark, 5%);
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: tint($focus_input_dark, 5%);
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: tint($focus_input_dark, 5%);
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
  }