playbook_ui_docs 15.0.0.pre.alpha.PLAY2425textinputaccessibility10328 → 15.0.0.pre.alpha.PLAY2453formtextfieldtextinputprops10419

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: d133dd1215fb77cc3a237ccc8ca06838a4843d3d0b2f847cd2b9b68c378c76d5
4
- data.tar.gz: 2e86c8996875d50fc37b2d7850cc10779214f81d55716a1a51e4b5225efb1844
3
+ metadata.gz: 04cdf95124b3174deb3af4cee4ce8960ccafc0da4961da20aa27fc629fc759b1
4
+ data.tar.gz: 0fa3cf1ba4e1ee5031b27de6d8ca29205b42965d9c2eb042e9bccfd1ad4d935b
5
5
  SHA512:
6
- metadata.gz: 544ae39548af3a914962c1ab15dfdeacacac08ab62cd349d2359df4c74f691a3230bf417e79917b7f2322de905b7ba293c74fbd30d3069164ddda0638c7b6183
7
- data.tar.gz: 802b92b326d05eece7b3236f6f7ef07dfd3dcd22567697627a5c61381df6c5cb85a02566f2d8d5fc1b4356438dc6d54efefc2927ceaef10254cd91b45e83b040
6
+ metadata.gz: 839f196f996001e791df32006d801bf9dfbb68f3b930a9206b9e9036a30c65a084ade4340c250829f78a50e2073061f24a8ae7158fca35803e930da1bcf91c28
7
+ data.tar.gz: 0eaf3cc425ec9a697a763bcec8feaa2837ec1f5471a3490d18ad8a2abc78e1e9f598c0a87a1fa2c12a3c6a8dfc3463962827f57cd28c6ea5d4527373ab56f1ae
@@ -0,0 +1,5 @@
1
+ <%= pb_rails("loading_inline", props: {text: "Dotted Spinner", variant: "dotted"}) %>
2
+
3
+ <br/>
4
+
5
+ <%= pb_rails("loading_inline", props: {text: "Solid Spinner", variant: "solid"}) %>
@@ -0,0 +1,24 @@
1
+ import React from 'react'
2
+ import { LoadingInline } from 'playbook-ui'
3
+
4
+ const LoadingInlineVariant = (props) => {
5
+ return (
6
+ <div>
7
+ <LoadingInline
8
+ text=" Dotted Spinner"
9
+ variant="dotted"
10
+ {...props}
11
+ />
12
+
13
+ <br />
14
+
15
+ <LoadingInline
16
+ text=" Solid Spinner"
17
+ variant="solid"
18
+ {...props}
19
+ />
20
+ </div>
21
+ )
22
+ }
23
+
24
+ export default LoadingInlineVariant
@@ -3,9 +3,11 @@ examples:
3
3
  rails:
4
4
  - loading_inline_default: Default
5
5
  - loading_inline_custom: Custom Text
6
+ - loading_inline_variant: Variant
6
7
 
7
8
 
8
9
 
9
10
  react:
10
11
  - loading_inline_default: Default
11
12
  - loading_inline_custom: Custom Text
13
+ - loading_inline_variant: Variant
@@ -1,2 +1,3 @@
1
1
  export { default as LoadingInlineDefault } from './_loading_inline_default.jsx'
2
2
  export { default as LoadingInlineCustom } from './_loading_inline_custom.jsx'
3
+ export { default as LoadingInlineVariant } from './_loading_inline_variant.jsx'
@@ -0,0 +1,41 @@
1
+ <%= pb_rails("text_input", props: {
2
+ autocomplete: false,
3
+ label: "autocomplete='off'",
4
+ name: "firstName",
5
+ placeholder: "Enter first name",
6
+ }) %>
7
+
8
+ <%= pb_rails("text_input", props: {
9
+ label: "no autocomplete attribute (let browser decide- basically 'on')",
10
+ name: "lastName",
11
+ placeholder: "Enter last name"
12
+ }) %>
13
+
14
+ <%= pb_rails("text_input", props: {
15
+ autocomplete: true,
16
+ label: "autocomplete='on'",
17
+ name: "phone",
18
+ type: "phone",
19
+ placeholder: "Enter phone number"
20
+ }) %>
21
+
22
+ <%= pb_rails("body", props: { margin_bottom: "sm" }) do %>
23
+ The following have the same autocomplete attributes (email), but have
24
+ different name attributes (email and emailAlt). Many browsers will
25
+ open autocomplete based on name attributes instead of autocomplete:
26
+ <% end %>
27
+
28
+ <%= pb_rails("text_input", props: {
29
+ autocomplete: "email",
30
+ label: "autocomplete='email' name='email'",
31
+ name: "email",
32
+ placeholder: "Enter email address"
33
+ }) %>
34
+
35
+ <%= pb_rails("text_input", props: {
36
+ autocomplete: "email",
37
+ label: "autocomplete='email' name='emailAlt'",
38
+ name: "emailAlt",
39
+ type: "email",
40
+ placeholder: "Enter email address"
41
+ }) %>
@@ -0,0 +1,80 @@
1
+ import React, { useState } from 'react'
2
+
3
+ import TextInput from '../../pb_text_input/_text_input'
4
+ import Body from '../../pb_body/_body'
5
+
6
+
7
+ const TextInputAutocomplete = (props) => {
8
+ const [formFields, setFormFields] = useState({
9
+ firstName: "",
10
+ lastName: "",
11
+ phone: "",
12
+ emailTest: "",
13
+ email: "",
14
+ });
15
+
16
+ const handleOnChangeFormField = ({ target }) => {
17
+ const { name, value } = target;
18
+ setFormFields({ ...formFields, [name]: value });
19
+ };
20
+
21
+ return (
22
+ <div>
23
+ <TextInput
24
+ autoComplete={false}
25
+ label="autocomplete='off'"
26
+ name="firstName"
27
+ onChange={handleOnChangeFormField}
28
+ placeholder="Enter first name"
29
+ value={formFields.firstName}
30
+ {...props}
31
+ />
32
+ <TextInput
33
+ label="no autocomplete attribute (let browser decide- basically 'on')"
34
+ name="lastName"
35
+ onChange={handleOnChangeFormField}
36
+ placeholder="Enter last name"
37
+ value={formFields.lastName}
38
+ {...props}
39
+ />
40
+ <TextInput
41
+ autoComplete
42
+ label="autocomplete='on'"
43
+ name="phone"
44
+ onChange={handleOnChangeFormField}
45
+ placeholder="Enter phone number"
46
+ type="phone"
47
+ value={formFields.phone}
48
+ {...props}
49
+ />
50
+ <Body marginBottom="sm">
51
+ The following have the same autocomplete attributes (email), but have
52
+ different name attributes (email and emailAlt). Many browsers will
53
+ open autocomplete based on name attributes instead of autocomplete:
54
+ </Body>
55
+ <TextInput
56
+ autoComplete="email"
57
+ label="autocomplete='email' name='email'"
58
+ name="email"
59
+ onChange={handleOnChangeFormField}
60
+ placeholder="Enter email address"
61
+ type="email"
62
+ value={formFields.email}
63
+ {...props}
64
+ />
65
+ <TextInput
66
+ autoComplete="email"
67
+ label="autocomplete='email' name='emailAlt'"
68
+ marginTop="sm"
69
+ name="emailTest"
70
+ onChange={handleOnChangeFormField}
71
+ placeholder="Enter email address"
72
+ type="email"
73
+ value={formFields.emailTest}
74
+ {...props}
75
+ />
76
+ </div>
77
+ );
78
+ };
79
+
80
+ export default TextInputAutocomplete;
@@ -0,0 +1 @@
1
+ Set this prop to `false` or `"off"` to remove autocomplete from text inputs. You can also set it to a string, but browsers will often defer to other attributes like `name`.
@@ -9,27 +9,23 @@
9
9
 
10
10
  <%= pb_rails("text_input", props: {
11
11
  label: "Last Name",
12
- placeholder: "Enter last name",
13
- id: "last-name"
12
+ placeholder: "Enter last name"
14
13
  }) %>
15
14
 
16
15
  <%= pb_rails("text_input", props: {
17
16
  label: "Phone Number",
18
17
  type: "phone",
19
- placeholder: "Enter phone number",
20
- id: "phone"
18
+ placeholder: "Enter phone number"
21
19
  }) %>
22
20
 
23
21
  <%= pb_rails("text_input", props: {
24
22
  label: "Email Address",
25
23
  type: "email",
26
- placeholder: "Enter email address",
27
- id: "email"
24
+ placeholder: "Enter email address"
28
25
  }) %>
29
26
 
30
27
  <%= pb_rails("text_input", props: {
31
28
  label: "Zip Code",
32
29
  type: "number",
33
- placeholder: "Enter zip code",
34
- id: "zip"
30
+ placeholder: "Enter zip code"
35
31
  }) %>
@@ -38,7 +38,6 @@ const TextInputDefault = (props) => {
38
38
  {...props}
39
39
  />
40
40
  <TextInput
41
- id="last-name"
42
41
  label="Last Name"
43
42
  name="lastName"
44
43
  onChange={handleOnChangeFormField}
@@ -47,7 +46,6 @@ const TextInputDefault = (props) => {
47
46
  {...props}
48
47
  />
49
48
  <TextInput
50
- id="phone"
51
49
  label="Phone Number"
52
50
  name="phone"
53
51
  onChange={handleOnChangeFormField}
@@ -57,7 +55,6 @@ const TextInputDefault = (props) => {
57
55
  {...props}
58
56
  />
59
57
  <TextInput
60
- id="email"
61
58
  label="Email Address"
62
59
  name="email"
63
60
  onChange={handleOnChangeFormField}
@@ -67,7 +64,6 @@ const TextInputDefault = (props) => {
67
64
  {...props}
68
65
  />
69
66
  <TextInput
70
- id="zip"
71
67
  label="Zip Code"
72
68
  name="zip"
73
69
  onChange={handleOnChangeFormField}
@@ -88,7 +84,6 @@ const TextInputDefault = (props) => {
88
84
  <br />
89
85
 
90
86
  <TextInput
91
- id="first-name"
92
87
  label="First Name"
93
88
  onChange={handleOnChangeFirstName}
94
89
  placeholder="Enter first name"
@@ -9,6 +9,8 @@ examples:
9
9
  - text_input_no_label: No Label
10
10
  - text_input_options: Input Options
11
11
  - text_input_mask: Mask
12
+ - text_input_autocomplete: Autocomplete
13
+
12
14
  react:
13
15
  - text_input_default: Default
14
16
  - text_input_error: With Error
@@ -19,6 +21,7 @@ examples:
19
21
  - text_input_no_label: No Label
20
22
  - text_input_mask: Mask
21
23
  - text_input_sanitize: Sanitized Masked Input
24
+ - text_input_autocomplete: Autocomplete
22
25
 
23
26
 
24
27
  swift:
@@ -7,3 +7,4 @@ export { default as TextInputInline } from './_text_input_inline.jsx'
7
7
  export { default as TextInputNoLabel } from './_text_input_no_label.jsx'
8
8
  export { default as TextInputMask } from './_text_input_mask.jsx'
9
9
  export { default as TextInputSanitize } from './_text_input_sanitize.jsx'
10
+ export { default as TextInputAutocomplete } from './_text_input_autocomplete.jsx'