playbook_ui 11.0.0.pre.alpha.2 → 11.1.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/pb_background/_background.scss +8 -1
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -1
- data/app/pb_kits/playbook/pb_background/background.rb +76 -16
- data/app/pb_kits/playbook/pb_background/docs/_background_status.html.erb +14 -2
- data/app/pb_kits/playbook/pb_background/docs/_background_status.jsx +43 -2
- data/app/pb_kits/playbook/pb_background/docs/_background_status.md +1 -1
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -2
- data/app/pb_kits/playbook/pb_body/_body.scss +4 -4
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -4
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +7 -3
- data/app/pb_kits/playbook/pb_body/body.rb +4 -3
- data/app/pb_kits/playbook/pb_body/body.test.js +12 -9
- data/app/pb_kits/playbook/pb_body/docs/_body_light.html.erb +4 -4
- data/app/pb_kits/playbook/pb_body/docs/_body_light.jsx +4 -4
- data/app/pb_kits/playbook/pb_body/docs/_description.md +2 -2
- data/app/pb_kits/playbook/pb_body/docs/_footer.md +1 -1
- data/app/pb_kits/playbook/pb_button/button.rb +5 -5
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +3 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.html.erb +2 -1
- data/app/pb_kits/playbook/pb_caption/docs/_caption_colors.jsx +5 -0
- data/app/pb_kits/playbook/pb_card/_card.tsx +5 -5
- data/app/pb_kits/playbook/pb_checkbox/{_checkbox.jsx → _checkbox.tsx} +33 -29
- data/app/pb_kits/playbook/pb_currency/_currency.jsx +7 -2
- data/app/pb_kits/playbook/pb_currency/currency.rb +8 -0
- data/app/pb_kits/playbook/pb_currency/currency.test.js +28 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals.html.erb +24 -0
- data/app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals.jsx +38 -0
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +30 -18
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +3 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +12 -1
- data/app/pb_kits/playbook/pb_date_picker/date_picker.test.js +160 -0
- data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +37 -11
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default.html.erb +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.html.erb +2 -2
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.jsx +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_month_and_year.md +1 -1
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.html.erb +6 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.jsx +21 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_time.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_week.html.erb +5 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_week.jsx +18 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_week.md +1 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_date_picker/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_date_picker/plugins/timeSelect.js +137 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss +27 -2
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +1 -5
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_time_selection_styles.scss +63 -0
- data/app/pb_kits/playbook/pb_date_picker/sass_partials/_week_styles.scss +127 -0
- data/app/pb_kits/playbook/pb_form_pill/{_form_pill.jsx → _form_pill.tsx} +16 -12
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_example.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_size.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx +1 -1
- data/app/pb_kits/playbook/pb_hashtag/{_hashtag.jsx → _hashtag.tsx} +3 -4
- data/app/pb_kits/playbook/pb_home_address_street/{_city_emphasis.html.erb → city_emphasis.html.erb} +0 -0
- data/app/pb_kits/playbook/pb_home_address_street/city_emphasis.rb +16 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.html.erb +3 -2
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +23 -2
- data/app/pb_kits/playbook/pb_home_address_street/{_street_emphasis.html.erb → street_emphasis.html.erb} +0 -0
- data/app/pb_kits/playbook/pb_home_address_street/street_emphasis.rb +15 -0
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +86 -0
- data/app/pb_kits/playbook/pb_select/{_select.jsx → _select.tsx} +34 -38
- data/app/pb_kits/playbook/pb_text_input/{_text_input.jsx → _text_input.tsx} +42 -43
- data/app/pb_kits/playbook/tokens/_colors.scss +17 -1
- data/app/pb_kits/playbook/utilities/props.ts +2 -2
- data/lib/playbook/props.rb +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +26 -12
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +0 -78
@@ -1,16 +1,15 @@
|
|
1
|
-
/* @flow */
|
2
1
|
/* eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
3
2
|
|
4
3
|
import React from 'react'
|
5
4
|
import classnames from 'classnames'
|
6
5
|
|
7
6
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
8
|
-
import { globalProps } from '../utilities/globalProps'
|
7
|
+
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
9
8
|
|
10
9
|
import Badge from '../pb_badge/_badge'
|
11
10
|
|
12
11
|
type HashtagProps = {
|
13
|
-
aria?:
|
12
|
+
aria?: {[key: string]: string},
|
14
13
|
className?: string,
|
15
14
|
dark?: boolean,
|
16
15
|
data?: string,
|
@@ -18,7 +17,7 @@ type HashtagProps = {
|
|
18
17
|
text?: string,
|
19
18
|
type: "default" | "home" | "project" | "appointment",
|
20
19
|
url?: string,
|
21
|
-
}
|
20
|
+
} & GlobalProps
|
22
21
|
|
23
22
|
const typeMap = {
|
24
23
|
home: 'H#',
|
data/app/pb_kits/playbook/pb_home_address_street/{_city_emphasis.html.erb → city_emphasis.html.erb}
RENAMED
File without changes
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbHomeAddressStreet
|
5
|
+
class CityEmphasis < Playbook::KitBase
|
6
|
+
prop :address_house_style
|
7
|
+
prop :address_house_style2
|
8
|
+
prop :city_state
|
9
|
+
prop :home_id, type: Playbook::Props::Number
|
10
|
+
prop :home_url
|
11
|
+
prop :territory
|
12
|
+
prop :zip
|
13
|
+
prop :dark, type: Playbook::Props::Boolean, default: false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -2,5 +2,6 @@
|
|
2
2
|
id: object.id,
|
3
3
|
data: object.data,
|
4
4
|
class: object.classname) do %>
|
5
|
-
<%=
|
6
|
-
<% end %>
|
5
|
+
<%= pb_rails("home_address_street/#{emphasis}_emphasis", props: object.send("#{emphasis}_emphasis_props")) %>
|
6
|
+
<% end %>
|
7
|
+
|
@@ -45,8 +45,29 @@ module Playbook
|
|
45
45
|
house_style ? " \u00b7 " : ""
|
46
46
|
end
|
47
47
|
|
48
|
-
def
|
49
|
-
|
48
|
+
def city_emphasis_props
|
49
|
+
{
|
50
|
+
address_house_style: address_house_style,
|
51
|
+
address_house_style2: address_house_style2,
|
52
|
+
city_state: city_state,
|
53
|
+
dark: dark,
|
54
|
+
home_id: home_id,
|
55
|
+
home_url: home_url,
|
56
|
+
territory: territory,
|
57
|
+
zip: zip,
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def street_emphasis_props
|
62
|
+
{
|
63
|
+
address_house_style: address_house_style,
|
64
|
+
address_house_style2: address_house_style2,
|
65
|
+
city_state_zip: city_state_zip,
|
66
|
+
dark: dark,
|
67
|
+
home_id: home_id,
|
68
|
+
home_url: home_url,
|
69
|
+
territory: territory,
|
70
|
+
}
|
50
71
|
end
|
51
72
|
|
52
73
|
private
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Playbook
|
4
|
+
module PbHomeAddressStreet
|
5
|
+
class StreetEmphasis < Playbook::KitBase
|
6
|
+
prop :address_house_style
|
7
|
+
prop :address_house_style2
|
8
|
+
prop :city_state_zip
|
9
|
+
prop :home_id, type: Playbook::Props::Number
|
10
|
+
prop :home_url
|
11
|
+
prop :territory
|
12
|
+
prop :dark, type: Playbook::Props::Boolean, default: false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
/*eslint-disable react/no-multi-comp, flowtype/space-before-type-colon */
|
2
|
+
|
3
|
+
import React, { forwardRef } from 'react'
|
4
|
+
import Body from '../pb_body/_body'
|
5
|
+
import classnames from 'classnames'
|
6
|
+
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
|
+
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
8
|
+
|
9
|
+
type RadioProps = {
|
10
|
+
aria?: {[key: string]: string},
|
11
|
+
alignment?: string,
|
12
|
+
checked?: boolean,
|
13
|
+
children?: Node,
|
14
|
+
className?: string,
|
15
|
+
dark?: boolean,
|
16
|
+
data?: {[key: string]: string},
|
17
|
+
error?: boolean,
|
18
|
+
id?: string,
|
19
|
+
label: string,
|
20
|
+
name: string,
|
21
|
+
value: string,
|
22
|
+
text: string,
|
23
|
+
onChange: (event: React.FormEvent<HTMLInputElement>)=>void,
|
24
|
+
} & GlobalProps
|
25
|
+
|
26
|
+
const Radio = ({
|
27
|
+
aria = {},
|
28
|
+
alignment,
|
29
|
+
children,
|
30
|
+
className,
|
31
|
+
dark = false,
|
32
|
+
data = {},
|
33
|
+
error = false,
|
34
|
+
id,
|
35
|
+
label,
|
36
|
+
name = 'radio_name',
|
37
|
+
text = 'Radio Text',
|
38
|
+
value = 'radio_text',
|
39
|
+
onChange = () => {},
|
40
|
+
...props
|
41
|
+
}: RadioProps, ref: any) => {
|
42
|
+
const ariaProps = buildAriaProps(aria)
|
43
|
+
const dataProps = buildDataProps(data)
|
44
|
+
const classes = classnames(
|
45
|
+
buildCss('pb_radio_kit', alignment ),
|
46
|
+
dark ? 'dark': null, error ? 'error': null,
|
47
|
+
globalProps(props),
|
48
|
+
className)
|
49
|
+
|
50
|
+
const displayRadio = (props: RadioProps) => {
|
51
|
+
if (children)
|
52
|
+
return (children)
|
53
|
+
else
|
54
|
+
return (
|
55
|
+
<input
|
56
|
+
id={id}
|
57
|
+
name={name}
|
58
|
+
onChange={onChange}
|
59
|
+
ref={ref}
|
60
|
+
text={text}
|
61
|
+
type="radio"
|
62
|
+
value={value}
|
63
|
+
{...props}
|
64
|
+
/>
|
65
|
+
)}
|
66
|
+
|
67
|
+
return (
|
68
|
+
<label
|
69
|
+
{...ariaProps}
|
70
|
+
{...dataProps}
|
71
|
+
className={classes}
|
72
|
+
htmlFor={id}
|
73
|
+
>
|
74
|
+
<>{displayRadio(null)}</>
|
75
|
+
<span className="pb_radio_button" />
|
76
|
+
<Body
|
77
|
+
dark={dark}
|
78
|
+
status={error ? 'negative' : null}
|
79
|
+
text={label}
|
80
|
+
variant={null}
|
81
|
+
/>
|
82
|
+
</label>
|
83
|
+
)
|
84
|
+
}
|
85
|
+
|
86
|
+
export default forwardRef(Radio)
|
@@ -1,10 +1,8 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
1
|
import React, { forwardRef } from 'react'
|
4
2
|
import classnames from 'classnames'
|
5
3
|
|
6
4
|
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
|
-
import { globalProps, domSafeProps } from '../utilities/globalProps'
|
5
|
+
import { globalProps, GlobalProps, domSafeProps } from '../utilities/globalProps'
|
8
6
|
import type { InputCallback } from '../types'
|
9
7
|
|
10
8
|
import Body from '../pb_body/_body'
|
@@ -18,16 +16,14 @@ type SelectOption = {
|
|
18
16
|
}
|
19
17
|
|
20
18
|
type SelectProps = {
|
21
|
-
aria?:
|
19
|
+
aria?: { [key: string]: string },
|
22
20
|
blankSelection?: string,
|
23
|
-
children?:
|
24
|
-
compact?: boolean,
|
21
|
+
children?: Node,
|
25
22
|
className?: string,
|
26
|
-
|
23
|
+
compact?: boolean,
|
24
|
+
data?: { [key: string]: string },
|
27
25
|
disabled?: boolean,
|
28
26
|
error?: string,
|
29
|
-
onChange: InputCallback<HTMLSelectElement>,
|
30
|
-
options: SelectOption[],
|
31
27
|
id?: string,
|
32
28
|
includeBlank?: string,
|
33
29
|
inline?: boolean,
|
@@ -36,9 +32,11 @@ type SelectProps = {
|
|
36
32
|
marginBottom: string,
|
37
33
|
multiple?: boolean,
|
38
34
|
name?: string,
|
35
|
+
onChange: InputCallback<HTMLSelectElement>,
|
36
|
+
options: SelectOption[],
|
39
37
|
required?: boolean,
|
40
38
|
value?: string,
|
41
|
-
}
|
39
|
+
} & GlobalProps
|
42
40
|
|
43
41
|
const createOptions = (options: SelectOption[]) => options.map((option, index) => (
|
44
42
|
<option
|
@@ -68,7 +66,7 @@ const Select = ({
|
|
68
66
|
required = false,
|
69
67
|
value,
|
70
68
|
...props
|
71
|
-
}: SelectProps, ref: React.
|
69
|
+
}: SelectProps, ref: React.LegacyRef<HTMLSelectElement>) => {
|
72
70
|
const ariaProps = buildAriaProps(aria)
|
73
71
|
const dataProps = buildDataProps(data)
|
74
72
|
const optionsList = createOptions(options)
|
@@ -87,6 +85,25 @@ const Select = ({
|
|
87
85
|
)
|
88
86
|
|
89
87
|
const selectWrapperClass = classnames(buildCss('pb_select_kit_wrapper'), { error }, className)
|
88
|
+
const selectBody =(() =>{
|
89
|
+
if (children) return children
|
90
|
+
return (
|
91
|
+
<select
|
92
|
+
{...domSafeProps(props)}
|
93
|
+
disabled={disabled}
|
94
|
+
id={name}
|
95
|
+
multiple={multiple}
|
96
|
+
name={name}
|
97
|
+
onChange={onChange}
|
98
|
+
ref={ref}
|
99
|
+
required={required}
|
100
|
+
value={value}
|
101
|
+
>
|
102
|
+
{blankSelection && <option value="">{blankSelection}</option>}
|
103
|
+
{optionsList}
|
104
|
+
</select>
|
105
|
+
)
|
106
|
+
})()
|
90
107
|
|
91
108
|
return (
|
92
109
|
<div
|
@@ -94,51 +111,30 @@ const Select = ({
|
|
94
111
|
{...dataProps}
|
95
112
|
className={classes}
|
96
113
|
>
|
97
|
-
|
114
|
+
{label &&
|
98
115
|
<label
|
99
116
|
className="pb_select_kit_label"
|
100
117
|
htmlFor={name}
|
101
118
|
>
|
102
|
-
<Caption
|
103
|
-
text={label}
|
104
|
-
/>
|
119
|
+
<Caption text={label} />
|
105
120
|
</label>
|
106
|
-
|
121
|
+
}
|
107
122
|
<label
|
108
123
|
className={selectWrapperClass}
|
109
124
|
htmlFor={name}
|
110
125
|
>
|
111
|
-
|
112
|
-
{children}
|
113
|
-
<Else />
|
114
|
-
<select
|
115
|
-
{...domSafeProps(props)}
|
116
|
-
disabled={disabled}
|
117
|
-
id={name}
|
118
|
-
multiple={multiple}
|
119
|
-
name={name}
|
120
|
-
onChange={onChange}
|
121
|
-
ref={ref}
|
122
|
-
required={required}
|
123
|
-
value={value}
|
124
|
-
>
|
125
|
-
<If condition={blankSelection}>
|
126
|
-
<option value="">{blankSelection}</option>
|
127
|
-
</If>
|
128
|
-
{optionsList}
|
129
|
-
</select>
|
130
|
-
</If>
|
126
|
+
{selectBody}
|
131
127
|
<Icon
|
132
128
|
className="pb_select_kit_caret"
|
133
129
|
fixedWidth
|
134
130
|
icon="angle-down"
|
135
131
|
/>
|
136
|
-
|
132
|
+
{error &&
|
137
133
|
<Body
|
138
134
|
status="negative"
|
139
135
|
text={error}
|
140
136
|
/>
|
141
|
-
|
137
|
+
}
|
142
138
|
</label>
|
143
139
|
</div>
|
144
140
|
)
|
@@ -1,8 +1,7 @@
|
|
1
|
-
/* @flow */
|
2
1
|
import React, { forwardRef } from 'react'
|
3
2
|
import classnames from 'classnames'
|
4
3
|
|
5
|
-
import { globalProps, domSafeProps } from '../utilities/globalProps'
|
4
|
+
import { globalProps, GlobalProps, domSafeProps } from '../utilities/globalProps'
|
6
5
|
import { buildAriaProps, buildDataProps } from '../utilities/props'
|
7
6
|
|
8
7
|
import Flex from '../pb_flex/_flex'
|
@@ -12,9 +11,9 @@ import Body from '../pb_body/_body'
|
|
12
11
|
import Icon from '../pb_icon/_icon'
|
13
12
|
|
14
13
|
type TextInputProps = {
|
15
|
-
aria?:
|
16
|
-
className
|
17
|
-
data?:
|
14
|
+
aria?: { [key: string]: string },
|
15
|
+
className?: string,
|
16
|
+
data?: { [key: string]: string },
|
18
17
|
dark?: boolean,
|
19
18
|
disabled?: boolean,
|
20
19
|
error?: string,
|
@@ -22,7 +21,7 @@ type TextInputProps = {
|
|
22
21
|
inline?: boolean,
|
23
22
|
name: string,
|
24
23
|
label: string,
|
25
|
-
onChange: (
|
24
|
+
onChange: (e: React.FormEvent<HTMLInputElement>) => void,
|
26
25
|
placeholder: string,
|
27
26
|
required?: boolean,
|
28
27
|
type: string,
|
@@ -33,9 +32,9 @@ type TextInputProps = {
|
|
33
32
|
alignment?: "right" | "left",
|
34
33
|
border?: boolean,
|
35
34
|
},
|
36
|
-
}
|
35
|
+
} & GlobalProps
|
37
36
|
|
38
|
-
const TextInput = (props: TextInputProps, ref: React.
|
37
|
+
const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>) => {
|
39
38
|
const {
|
40
39
|
addOn = { icon: null, alignment: 'right', border: true },
|
41
40
|
aria = {},
|
@@ -48,7 +47,7 @@ const TextInput = (props: TextInputProps, ref: React.ElementRef<"input">) => {
|
|
48
47
|
inline = false,
|
49
48
|
name,
|
50
49
|
label,
|
51
|
-
onChange = () => {},
|
50
|
+
onChange = () => { void 0 },
|
52
51
|
placeholder,
|
53
52
|
required,
|
54
53
|
type = 'text',
|
@@ -104,34 +103,38 @@ const TextInput = (props: TextInputProps, ref: React.ElementRef<"input">) => {
|
|
104
103
|
<React.Fragment>
|
105
104
|
<Flex
|
106
105
|
className={`add-on-${addOnAlignment} ${borderCss}`}
|
107
|
-
inline
|
106
|
+
inline
|
108
107
|
vertical="center"
|
109
108
|
>
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
</Card>
|
129
|
-
</>
|
130
|
-
</If>
|
109
|
+
{addOnAlignment == 'left' && <>
|
110
|
+
<Card
|
111
|
+
className={`${addOnDarkModeCardCss} add-on-card card-left-aligned`}
|
112
|
+
dark={dark}
|
113
|
+
>
|
114
|
+
{addOnIcon}
|
115
|
+
</Card>
|
116
|
+
{textInput}
|
117
|
+
</> }
|
118
|
+
{addOnAlignment != 'left' && <>
|
119
|
+
{textInput}
|
120
|
+
<Card
|
121
|
+
className={`${addOnDarkModeCardCss} add-on-card card-right-aligned`}
|
122
|
+
dark={dark}
|
123
|
+
>
|
124
|
+
{addOnIcon}
|
125
|
+
</Card>
|
126
|
+
</> }
|
131
127
|
</Flex>
|
132
128
|
</React.Fragment>
|
133
129
|
)
|
134
130
|
|
131
|
+
const render = (() => {
|
132
|
+
if(children) return children
|
133
|
+
if (shouldShowAddOn) return addOnInput
|
134
|
+
|
135
|
+
return textInput
|
136
|
+
})()
|
137
|
+
|
135
138
|
return (
|
136
139
|
<div
|
137
140
|
{...ariaProps}
|
@@ -140,21 +143,17 @@ const TextInput = (props: TextInputProps, ref: React.ElementRef<"input">) => {
|
|
140
143
|
>
|
141
144
|
<Caption
|
142
145
|
className="pb_text_input_kit_label"
|
143
|
-
dark={dark}
|
144
146
|
text={label}
|
145
147
|
/>
|
146
148
|
<div className={`${addOnCss} text_input_wrapper`}>
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
text={error}
|
156
|
-
/>
|
157
|
-
</If>
|
149
|
+
{render}
|
150
|
+
|
151
|
+
{error && <Body
|
152
|
+
status="negative"
|
153
|
+
text={error}
|
154
|
+
variant={null}
|
155
|
+
/>
|
156
|
+
}
|
158
157
|
</div>
|
159
158
|
</div>
|
160
159
|
)
|
@@ -153,21 +153,37 @@ $data_colors: (
|
|
153
153
|
|
154
154
|
/* Status colors ----------------------*/
|
155
155
|
$success: $green;
|
156
|
+
$success_secondary: lighten($success, 10%);
|
156
157
|
$warning: $yellow;
|
158
|
+
$warning_secondary: lighten($warning, 10%);
|
157
159
|
$error: $red;
|
158
160
|
$error_dark: $red_dark;
|
159
161
|
$error_dark_body: lighten($error_dark, 2%);
|
162
|
+
$error_secondary: lighten($error, 10%);
|
160
163
|
$info: $teal;
|
164
|
+
$info_secondary : lighten($info, 10%);
|
161
165
|
$neutral: $slate;
|
166
|
+
$neutral_secondary: lighten($neutral, 10%);
|
167
|
+
$primary: $primary;
|
168
|
+
$primary_secondary: lighten($primary, 10%);
|
169
|
+
|
162
170
|
$status_colors: (
|
163
171
|
success: $success,
|
172
|
+
success_secondary: $success_secondary,
|
164
173
|
warning: $warning,
|
174
|
+
warning_secondary: $warning_secondary,
|
165
175
|
error: $error,
|
176
|
+
error_secondary: $error_secondary,
|
166
177
|
info: $info,
|
178
|
+
info_secondary: $info_secondary,
|
167
179
|
neutral: $neutral,
|
168
|
-
|
180
|
+
neutral_secondary: $neutral_secondary,
|
181
|
+
primary: $primary,
|
182
|
+
primary_secondary: $primary_secondary
|
169
183
|
);
|
170
184
|
|
185
|
+
|
186
|
+
|
171
187
|
$status_color_text: (
|
172
188
|
success: $success,
|
173
189
|
warning: darken($warning, 10%),
|
@@ -22,7 +22,7 @@ const buildPrefixedProps = (prefix: string, data: {[key: string]: any}) =>
|
|
22
22
|
*
|
23
23
|
* @returns {() => {}} the noop function.
|
24
24
|
*/
|
25
|
-
export const noop = () => {}
|
25
|
+
export const noop = (): void => { void 0 }
|
26
26
|
|
27
27
|
/**
|
28
28
|
* Maps a given aria object into HTML valid aria attribtues and their values.
|
@@ -47,5 +47,5 @@ export const buildDataProps = (data: {[key: string]: any}) => buildPrefixedProps
|
|
47
47
|
* @param {Object} rules a 'classnames' compliant rules object, used to derive the root className.
|
48
48
|
* @returns {String} the derived root className value.
|
49
49
|
*/
|
50
|
-
export const buildCss = (...rules: string[]) => classnames(rules).replace(/\s/g, '_')
|
50
|
+
export const buildCss = (...rules: (string | { [x: string]: string; })[]): string => classnames(rules).replace(/\s/g, '_')
|
51
51
|
|
data/lib/playbook/props.rb
CHANGED
data/lib/playbook/version.rb
CHANGED