playbook_ui 14.3.0 → 14.3.1.pre.alpha.PBNTR515typeaheadmarginbottomredux3747
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 +4 -4
- data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +4 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_children.jsx +1 -4
- data/app/pb_kits/playbook/pb_text_input/_text_input.scss +1 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +0 -1
- data/app/pb_kits/playbook/pb_textarea/textarea.html.erb +0 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +2 -1
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -6
- data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +3 -3
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +1 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +1 -2
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -6
- data/dist/chunks/{_typeahead-es44Ih6G.js → _typeahead-BOTSVWKl.js} +2 -2
- data/dist/chunks/{_weekday_stacked-uQb5bGYo.js → _weekday_stacked-C9XGqbdf.js} +2 -2
- data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +2 -2
- metadata +8 -9
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +0 -88
- data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e51693286c99e9ba35ead99c19a2901cb27b9f229683f88217dc34de7f18a7b
|
4
|
+
data.tar.gz: 2dc4818138b9e67c4c825031da74bef3757ed72fbb91ff1e96761a748a09e5b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e498d8ca21f944b1efe6e288bdd02d85bb95b0971df18663da160cf7f03f4e0529c38326a74ca6a7843c396bee867b75482dfa4659a7c66ef95af550854e4e9
|
7
|
+
data.tar.gz: 4b3cc3370f6924a0cf974a7222701885ca40770f373f9019b816321765a3e9e31c19b244378199a3a8dcbcb8bb02587700bed068a545e43277fe6d4fa96da514
|
@@ -6,6 +6,10 @@ export const showElement = (elem: HTMLElement) => {
|
|
6
6
|
elem.style.overflow = "hidden"
|
7
7
|
// Once the transition is complete, remove the inline max-height so the content can scale responsively
|
8
8
|
window.setTimeout(() => {
|
9
|
+
// If a user toggles multiple times quickly in a row, 'is-visible' can be removed by hideElement's timeout
|
10
|
+
if (!elem.classList.contains('is-visible')) {
|
11
|
+
elem.classList.add('is-visible')
|
12
|
+
}
|
9
13
|
elem.style.height = '';
|
10
14
|
elem.style.overflow = "visible"
|
11
15
|
}, 300);
|
@@ -18,32 +18,29 @@ const RadioChildren = (props) => {
|
|
18
18
|
<div>
|
19
19
|
<Radio
|
20
20
|
label="Select"
|
21
|
-
marginBottom="sm"
|
22
21
|
name="Group1"
|
23
22
|
tabIndex={0}
|
24
23
|
value="Select"
|
25
24
|
{...props}
|
26
25
|
>
|
27
26
|
<Select
|
28
|
-
marginBottom="none"
|
29
27
|
minWidth="xs"
|
30
28
|
options={options}
|
31
29
|
/>
|
32
30
|
</Radio>
|
33
31
|
<Radio
|
34
32
|
label="Typeahead"
|
35
|
-
marginBottom="sm"
|
36
33
|
name="Group1"
|
37
34
|
tabIndex={0}
|
38
35
|
value="Typeahead"
|
39
36
|
{...props}
|
40
37
|
>
|
41
38
|
<Typeahead
|
42
|
-
marginBottom="none"
|
43
39
|
minWidth="xs"
|
44
40
|
options={options}
|
45
41
|
/>
|
46
42
|
</Radio>
|
43
|
+
<br />
|
47
44
|
<Radio
|
48
45
|
defaultChecked={false}
|
49
46
|
label="Typography"
|
@@ -118,6 +118,7 @@ test('typeahead textinput has mb_sm class by default', () => {
|
|
118
118
|
)
|
119
119
|
|
120
120
|
const kit = screen.getByTestId('default-mb-test')
|
121
|
+
expect(kit).toHaveClass("pb_typeahead_kit mb_sm")
|
121
122
|
const textInput = kit.querySelector(".pb_text_input_kit")
|
122
|
-
expect(textInput).toHaveClass("
|
123
|
+
expect(textInput).toHaveClass("mb_none")
|
123
124
|
})
|
@@ -83,12 +83,7 @@ const Typeahead = ({
|
|
83
83
|
const selectProps = {
|
84
84
|
cacheOptions: true,
|
85
85
|
components: {
|
86
|
-
Control
|
87
|
-
<Control
|
88
|
-
{...controlProps}
|
89
|
-
marginBottom={marginBottom}
|
90
|
-
/>
|
91
|
-
),
|
86
|
+
Control,
|
92
87
|
ClearIndicator,
|
93
88
|
IndicatorsContainer,
|
94
89
|
IndicatorSeparator: null as null,
|
@@ -141,6 +136,7 @@ const Typeahead = ({
|
|
141
136
|
const htmlProps = buildHtmlProps(htmlOptions)
|
142
137
|
const classes = classnames(
|
143
138
|
'pb_typeahead_kit react-select',
|
139
|
+
`mb_${marginBottom}`,
|
144
140
|
globalProps(props),
|
145
141
|
className
|
146
142
|
)
|
@@ -4,13 +4,13 @@ import { components } from 'react-select'
|
|
4
4
|
import Flex from '../../pb_flex/_flex'
|
5
5
|
import TextInput from '../../pb_text_input/_text_input'
|
6
6
|
|
7
|
+
|
7
8
|
type Props = {
|
8
9
|
selectProps: any,
|
9
|
-
marginBottom?: string,
|
10
10
|
}
|
11
11
|
|
12
12
|
const TypeaheadControl = (props: Props) => {
|
13
|
-
const { selectProps
|
13
|
+
const { selectProps } = props
|
14
14
|
const { dark, error, label } = selectProps
|
15
15
|
|
16
16
|
return (
|
@@ -19,7 +19,7 @@ const TypeaheadControl = (props: Props) => {
|
|
19
19
|
dark={dark}
|
20
20
|
error={error}
|
21
21
|
label={label}
|
22
|
-
marginBottom=
|
22
|
+
marginBottom="none"
|
23
23
|
>
|
24
24
|
<Flex>
|
25
25
|
<components.Control
|
@@ -20,8 +20,7 @@
|
|
20
20
|
label: object.label,
|
21
21
|
name: object.name,
|
22
22
|
value: object.value,
|
23
|
-
placeholder: object.placeholder
|
24
|
-
margin_bottom: "none",
|
23
|
+
placeholder: object.placeholder
|
25
24
|
}) %>
|
26
25
|
<%= pb_rails("list", props: { ordered: false, borderless: false, xpadding: true, role: "status", aria: { live: "polite" }, data: { pb_typeahead_kit_results: true } }) do %>
|
27
26
|
<% end %>
|
@@ -14,9 +14,6 @@ module Playbook
|
|
14
14
|
default: false
|
15
15
|
prop :label
|
16
16
|
prop :load_options
|
17
|
-
prop :margin_bottom, type: Playbook::Props::Enum,
|
18
|
-
values: %w[none xxs xs sm md lg xl],
|
19
|
-
default: "sm"
|
20
17
|
prop :multi_kit, type: Playbook::Props::String,
|
21
18
|
default: ""
|
22
19
|
prop :name
|
@@ -39,8 +36,7 @@ module Playbook
|
|
39
36
|
prop :value
|
40
37
|
|
41
38
|
def classname
|
42
|
-
|
43
|
-
generate_classname("pb_typeahead_kit") + default_margin_bottom
|
39
|
+
generate_classname("pb_typeahead_kit")
|
44
40
|
end
|
45
41
|
|
46
42
|
def inline_class
|
@@ -69,7 +65,6 @@ module Playbook
|
|
69
65
|
inline: inline,
|
70
66
|
isMulti: is_multi,
|
71
67
|
label: label,
|
72
|
-
marginBottom: margin_bottom,
|
73
68
|
multiKit: multi_kit,
|
74
69
|
name: name,
|
75
70
|
options: options,
|