playbook_ui 9.3.0.alpha.inline3 → 9.3.1.pre.alpha2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 354862f897edc053e27311b331ef01bb927323b9006af47752f1e51ae5e6eeca
4
- data.tar.gz: 38946538f1a04c0c2df4b5e0d7e5cfeeeecf3bea46e3af26abb4852456429553
3
+ metadata.gz: 76b05713c20d439c9cf190dbe2886c18c91c0d928cacc1f1d144b661bc252c5b
4
+ data.tar.gz: f901248e28de4081688cbe230ad247a1e8c50a73b59f92d4e035022205b32898
5
5
  SHA512:
6
- metadata.gz: fd7e15aab84fd9ac50f52bee181437b79d7d67c3df141c2c40d1349b1c568e9e235aa42308455cb18bd0073131786323182853ef2fe046040efb16c5bd93cb46
7
- data.tar.gz: d0619331fbaec43977d07d10f9f6aa3ed89b3de0ac5f9a8e1572844b8696c4ae4fbd55513f087d830c1f6ef092f2be24f2c757ae95d88f16dec0555741ff7580
6
+ metadata.gz: '097d05cd4d878abb596d6a6990152267a26c9ad54d50622209842ff66a13f49cdaf12dedb18b3ee681e36ab8deb943abdc2e29e87f5ee998a7462ff7abb5a581'
7
+ data.tar.gz: 7d83fa036724ec01a9e67cb9e06d6cf74b271b3a29fa9637b29682a7646b9115d354dbc00e5afe06dbe1a9dbc7f34c7229e5a6faa4cdee3c6585147af97e1b1d
@@ -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, { forwardRef } from '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, ref: React.ElementRef<"div">) => {
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 forwardRef(Flex)
79
+ export default Flex
@@ -1,6 +1,6 @@
1
1
  /* @flow */
2
2
 
3
- import React, { forwardRef, useEffect, useRef } from '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, ref: React.ElementRef<"input">) => {
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 forwardRef(RichTextEditor)
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
- 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') {
@@ -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 { Badge, FormPill } from '../../'
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={badges}>
33
- <Badge
31
+ <If condition={imageUrl}>
32
+ <FormPill
33
+ avatarUrl={imageUrl}
34
34
  closeProps={removeProps}
35
- removeIcon
36
- text={label}
37
- variant="primary"
35
+ marginRight="xs"
36
+ name={label}
38
37
  />
39
38
  <Else />
40
- <If condition={imageUrl}>
41
- <FormPill
42
- avatarUrl={imageUrl}
43
- closeProps={removeProps}
44
- marginRight="xs"
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
- <Flex
10
- align="center"
11
- className="placeholder"
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
@@ -13,7 +13,6 @@ const options = [
13
13
  const TypeaheadDefault = (props) => {
14
14
  return (
15
15
  <Typeahead
16
- // badges
17
16
  label="Colors"
18
17
  options={options}
19
18
  {...props}
@@ -3,7 +3,7 @@
3
3
  import React from 'react'
4
4
  import { Typeahead } from '../..'
5
5
 
6
- const initOptions = [
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
- // onChange={(value) => console.log(value)}
23
- options={initOptions}
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
- # - typeahead_default: Default
10
+ - typeahead_default: Default
11
11
  - typeahead_with_pills: With Pills
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)
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)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- VERSION = "9.3.0.alpha.inline3"
4
+ VERSION = "9.3.1.pre.alpha2"
5
5
  end
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.0.alpha.inline3
4
+ version: 9.3.1.pre.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -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
- rubygems_version: 3.1.4
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