playbook_ui_docs 15.0.0.pre.alpha.PLAY2419dialogaccessibility10324 → 15.0.0.pre.alpha.PLAY2420atfirstcolumnborderfix10588

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.html.erb +4 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +13 -8
  4. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -1
  5. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +3 -0
  6. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +8 -0
  7. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  8. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.html.erb +5 -0
  9. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +24 -0
  10. data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
  11. data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
  12. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +35 -0
  13. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +49 -0
  14. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +1 -0
  15. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +2 -0
  16. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +38 -0
  17. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +51 -0
  18. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +46 -0
  19. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +62 -0
  20. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +3 -0
  21. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +47 -0
  22. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +60 -0
  23. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +25 -0
  24. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +36 -0
  25. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +44 -0
  26. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +100 -0
  27. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +126 -0
  28. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +32 -0
  29. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +48 -0
  30. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +68 -0
  31. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +81 -0
  32. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +31 -0
  33. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +42 -0
  34. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +2 -0
  35. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +35 -0
  36. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +51 -0
  37. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +27 -0
  38. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +11 -0
  39. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +31 -0
  40. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +81 -0
  41. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +25 -0
  42. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +40 -0
  43. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +5 -0
  44. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +27 -0
  45. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +39 -0
  46. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +5 -0
  47. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +93 -0
  48. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +131 -0
  49. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +14 -0
  50. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +42 -0
  51. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +58 -0
  52. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +24 -0
  53. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +38 -0
  54. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +22 -0
  55. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +33 -0
  56. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +118 -0
  57. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +144 -0
  58. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +60 -0
  59. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +24 -0
  60. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +42 -0
  61. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +38 -0
  62. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +52 -0
  63. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +29 -0
  64. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +11 -0
  65. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.html.erb +41 -0
  66. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.jsx +80 -0
  67. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.md +1 -0
  68. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +3 -0
  69. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  70. data/dist/playbook-doc.js +2 -2
  71. metadata +60 -2
@@ -0,0 +1,118 @@
1
+ <% data_first = [
2
+ {
3
+ name: 'Bugs',
4
+ y: 8,
5
+ },
6
+ {
7
+ name: 'Chores',
8
+ y: 1,
9
+ },
10
+ {
11
+ name: 'Stories',
12
+ y: 12,
13
+ },
14
+ ] %>
15
+
16
+ <% data_second = [
17
+ {
18
+ name: 'Queued',
19
+ y: 7,
20
+ },
21
+ {
22
+ name: 'In Progress',
23
+ y: 6,
24
+ },
25
+ {
26
+ name: 'Validation',
27
+ y: 3,
28
+ },
29
+ {
30
+ name: 'Done',
31
+ y: 6,
32
+ },
33
+ ] %>
34
+
35
+ <% data_third = [
36
+ {
37
+ name: '1 Point Tickets',
38
+ y: 2,
39
+ },
40
+ {
41
+ name: '3 Point Tickets',
42
+ y: 5,
43
+ },
44
+ {
45
+ name: '5 Point Tickets',
46
+ y: 6,
47
+ },
48
+ {
49
+ name: '8 Point Tickets',
50
+ y: 3,
51
+ },
52
+ {
53
+ name: '13 Point Tickets',
54
+ y: 1,
55
+ },
56
+ ] %>
57
+
58
+ <% data_fourth = [
59
+ {
60
+ name: 'Facebook',
61
+ y: 2498,
62
+ },
63
+ {
64
+ name: 'YouTube',
65
+ y: 2000,
66
+ },
67
+ {
68
+ name: 'WhatsApp',
69
+ y: 2000,
70
+ },
71
+ {
72
+ name: 'Facebook Messenger',
73
+ y: 1300,
74
+ },
75
+ {
76
+ name: 'WeChat',
77
+ y: 1165,
78
+ },
79
+ {
80
+ name: 'Instagram',
81
+ y: 1000,
82
+ },
83
+ {
84
+ name: 'Tik Tok',
85
+ y: 800,
86
+ },
87
+ ] %>
88
+
89
+ <% chart_options_small = {
90
+ series: [{
91
+ data: data_first,
92
+ innerSize: '35%'
93
+ }], } %>
94
+
95
+ <% chart_options_md = {
96
+ series: [{
97
+ data: data_second,
98
+ innerSize: '50%'
99
+ }], } %>
100
+
101
+ <% chart_options_lg = {
102
+ series: [{
103
+ data: data_third,
104
+ innerSize: '85%'
105
+ }], } %>
106
+
107
+ <% chart_options_xl = {
108
+ series: [{
109
+ data: data_fourth,
110
+ innerSize: '0%'
111
+ }], } %>
112
+
113
+
114
+
115
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options_small }) %>
116
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options_md }) %>
117
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options_lg }) %>
118
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options_xl }) %>
@@ -0,0 +1,144 @@
1
+ import React from "react";
2
+ import { PbCircleChart } from "playbook-ui";
3
+
4
+ const dataFirst = [
5
+ {
6
+ name: 'Bugs',
7
+ y: 8,
8
+ },
9
+ {
10
+ name: 'Chores',
11
+ y: 1,
12
+ },
13
+ {
14
+ name: 'Stories',
15
+ y: 12,
16
+ },
17
+ ]
18
+
19
+ const dataSecond = [
20
+ {
21
+ name: 'Queued',
22
+ y: 7,
23
+ },
24
+ {
25
+ name: 'In Progress',
26
+ y: 6,
27
+ },
28
+ {
29
+ name: 'Validation',
30
+ y: 3,
31
+ },
32
+ {
33
+ name: 'Done',
34
+ y: 6,
35
+ },
36
+ ]
37
+
38
+ const dataThird = [
39
+ {
40
+ name: '1 Point Tickets',
41
+ y: 2,
42
+ },
43
+ {
44
+ name: '3 Point Tickets',
45
+ y: 5,
46
+ },
47
+ {
48
+ name: '5 Point Tickets',
49
+ y: 6,
50
+ },
51
+ {
52
+ name: '8 Point Tickets',
53
+ y: 3,
54
+ },
55
+ {
56
+ name: '13 Point Tickets',
57
+ y: 1,
58
+ },
59
+ ]
60
+
61
+ const dataFourth = [
62
+ {
63
+ name: 'Facebook',
64
+ y: 2498,
65
+ },
66
+ {
67
+ name: 'YouTube',
68
+ y: 2000,
69
+ },
70
+ {
71
+ name: 'WhatsApp',
72
+ y: 2000,
73
+ },
74
+ {
75
+ name: 'Facebook Messenger',
76
+ y: 1300,
77
+ },
78
+ {
79
+ name: 'WeChat',
80
+ y: 1165,
81
+ },
82
+ {
83
+ name: 'Instagram',
84
+ y: 1000,
85
+ },
86
+ {
87
+ name: 'Tik Tok',
88
+ y: 800,
89
+ },
90
+ ]
91
+
92
+ const PbCircleChartInnerSizes= (props) => {
93
+ const chartOptionsSmall = {
94
+ series: [{
95
+ data: dataFirst,
96
+ innerSize: '35%'
97
+ }],
98
+ }
99
+
100
+ const chartOptionsMedium = {
101
+ series: [{
102
+ data: dataSecond,
103
+ innerSize: '50%'
104
+ }],
105
+ }
106
+
107
+ const chartOptionsLarge = {
108
+ series: [{
109
+ data: dataThird,
110
+ innerSize: '85%'
111
+ }],
112
+ }
113
+
114
+ const chartOptionsNone = {
115
+ series: [{
116
+ data: dataFourth,
117
+ innerSize: '0%'
118
+ }],
119
+ }
120
+
121
+ return (
122
+ <div>
123
+ <PbCircleChart
124
+ options={chartOptionsSmall}
125
+ {...props}
126
+ />
127
+ <PbCircleChart
128
+ options={chartOptionsMedium}
129
+ {...props}
130
+ />
131
+ <PbCircleChart
132
+ options={chartOptionsLarge}
133
+ {...props}
134
+ />
135
+ <PbCircleChart
136
+ options={chartOptionsNone}
137
+ {...props}
138
+ />
139
+ </div>
140
+ );
141
+ };
142
+
143
+
144
+ export default PbCircleChartInnerSizes;
@@ -0,0 +1,60 @@
1
+ import React, { useState } from "react";
2
+ import { PbCircleChart, Button } from "playbook-ui";
3
+
4
+ const chartData = [
5
+ {
6
+ name: "Waiting for Calls",
7
+ y: 41,
8
+ },
9
+ {
10
+ name: "On Call",
11
+ y: 49,
12
+ },
13
+ {
14
+ name: "After Call",
15
+ y: 10,
16
+ },
17
+ ];
18
+
19
+ const chartData2 = [
20
+ {
21
+ name: "Waiting for Calls",
22
+ y: 48,
23
+ },
24
+ {
25
+ name: "On Call",
26
+ y: 12,
27
+ },
28
+ {
29
+ name: "After Call",
30
+ y: 140,
31
+ },
32
+ ];
33
+
34
+
35
+ const PbCircleChartLiveData = (props) => {
36
+
37
+ const [data, setData] = useState(chartData);
38
+
39
+ const updateValue = () => {
40
+ setData(chartData2)
41
+ }
42
+ const chartOptions = {
43
+ series: [{ data: data }],
44
+ }
45
+
46
+ return (
47
+ <div>
48
+ <Button
49
+ onClick={updateValue}
50
+ text="Update Value"
51
+ />
52
+ <PbCircleChart
53
+ options={chartOptions}
54
+ {...props}
55
+ />
56
+ </div>
57
+ );
58
+ };
59
+
60
+ export default PbCircleChartLiveData;
@@ -0,0 +1,24 @@
1
+ <% data = [
2
+ {
3
+ name: "Waiting for Calls",
4
+ y: 41,
5
+ },
6
+ {
7
+ name: "On Call",
8
+ y: 49,
9
+ },
10
+ {
11
+ name: "After Call",
12
+ y: 10,
13
+ },
14
+ ] %>
15
+
16
+ <% chart_options = {
17
+ series: [{
18
+ data: data,
19
+ innerSize: '100%',
20
+ borderWidth: '20',
21
+ }],
22
+ } %>
23
+
24
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { PbCircleChart } from "playbook-ui";
3
+
4
+ const data= [
5
+ {
6
+ name: "Waiting for Calls",
7
+ y: 41,
8
+ },
9
+ {
10
+ name: "On Call",
11
+ y: 49,
12
+ },
13
+ {
14
+ name: "After Call",
15
+ y: 10,
16
+ },
17
+ ]
18
+
19
+
20
+ const PbCircleChartRounded = (props) => {
21
+ const chartOptions = {
22
+ series: [{ data: data }],
23
+ plotOptions: {
24
+ pie: {
25
+ borderColor: null,
26
+ borderWidth: 20,
27
+ innerSize: '100%',
28
+ },
29
+ },
30
+ };
31
+
32
+ return (
33
+ <div>
34
+ <PbCircleChart
35
+ options={chartOptions}
36
+ {...props}
37
+ />
38
+ </div>
39
+ );
40
+ };
41
+
42
+ export default PbCircleChartRounded;
@@ -0,0 +1,38 @@
1
+ <% data = [
2
+ {
3
+ name: 'Facebook',
4
+ y: 2498,
5
+ },
6
+ {
7
+ name: 'YouTube',
8
+ y: 2000,
9
+ },
10
+ {
11
+ name: 'WhatsApp',
12
+ y: 2000,
13
+ },
14
+ {
15
+ name: 'Facebook Messenger',
16
+ y: 1300,
17
+ },
18
+ {
19
+ name: 'WeChat',
20
+ y: 1165,
21
+ },
22
+ {
23
+ name: 'Instagram',
24
+ y: 1000,
25
+ },
26
+ {
27
+ name: 'Tik Tok',
28
+ y: 800,
29
+ },
30
+ ] %>
31
+
32
+ <% chart_options = {
33
+ series: [{ data: data }],
34
+ title: { text: "Active Users on Social Media" },
35
+ } %>
36
+
37
+
38
+ <%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
@@ -0,0 +1,52 @@
1
+ import React from "react";
2
+ import { PbCircleChart } from "playbook-ui";
3
+
4
+ const data= [
5
+ {
6
+ name: 'Facebook',
7
+ y: 2498,
8
+ },
9
+ {
10
+ name: 'YouTube',
11
+ y: 2000,
12
+ },
13
+ {
14
+ name: 'WhatsApp',
15
+ y: 2000,
16
+ },
17
+ {
18
+ name: 'Facebook Messenger',
19
+ y: 1300,
20
+ },
21
+ {
22
+ name: 'WeChat',
23
+ y: 1165,
24
+ },
25
+ {
26
+ name: 'Instagram',
27
+ y: 1000,
28
+ },
29
+ {
30
+ name: 'Tik Tok',
31
+ y: 800,
32
+ },
33
+ ]
34
+
35
+
36
+ const PbCircleChartWithTitle = (props) => {
37
+ const chartOptions = {
38
+ title: { text: "Active Users on Social Media" },
39
+ series: [{ data: data }],
40
+ };
41
+
42
+ return (
43
+ <div>
44
+ <PbCircleChart
45
+ options={chartOptions}
46
+ {...props}
47
+ />
48
+ </div>
49
+ );
50
+ };
51
+
52
+ export default PbCircleChartWithTitle;
@@ -0,0 +1,29 @@
1
+ examples:
2
+
3
+ rails:
4
+ - pb_circle_chart_default: Default
5
+ - pb_circle_chart_rounded: Rounded Corners
6
+ - pb_circle_chart_block_content: Accepts Any Block
7
+ - pb_circle_chart_color_overrides: Color Overrides
8
+ - pb_circle_chart_data_with_labels: Data with Labels
9
+ - pb_circle_chart_data_with_legend: Data with Legend
10
+ - pb_circle_chart_data_legend_position: Legend Position
11
+ - pb_circle_chart_with_title: With Title
12
+ - pb_circle_chart_inner_sizes: Inner Circle Size Options
13
+ - pb_circle_chart_custom_tooltip: Tooltip Customization
14
+
15
+
16
+ react:
17
+ - pb_circle_chart_default: Default
18
+ - pb_circle_chart_live_data: Live Data
19
+ - pb_circle_chart_rounded: Rounded Corners
20
+ - pb_circle_chart_block_content: Accepts Any Block
21
+ - pb_circle_chart_color_overrides: Color Overrides
22
+ - pb_circle_chart_data_with_labels: Data with Labels
23
+ - pb_circle_chart_data_with_legend: Data with Legend
24
+ - pb_circle_chart_data_legend_position: Legend Position
25
+ - pb_circle_chart_with_title: With Title
26
+ - pb_circle_chart_inner_sizes: Inner Circle Size Options
27
+ - pb_circle_chart_custom_tooltip: Tooltip Customization
28
+
29
+
@@ -0,0 +1,11 @@
1
+ export { default as PbCircleChartDefault } from './_pb_circle_chart_default.jsx'
2
+ export { default as PbCircleChartLiveData } from './_pb_circle_chart_live_data.jsx'
3
+ export { default as PbCircleChartRounded } from './_pb_circle_chart_rounded.jsx'
4
+ export { default as PbCircleChartBlockContent } from './_pb_circle_chart_block_content.jsx'
5
+ export { default as PbCircleChartColorOverrides } from './_pb_circle_chart_color_overrides.jsx'
6
+ export { default as PbCircleChartDataWithLabels } from './_pb_circle_chart_data_with_labels.jsx'
7
+ export { default as PbCircleChartDataWithLegend } from './_pb_circle_chart_data_with_legend.jsx'
8
+ export { default as PbCircleChartDataLegendPosition } from './_pb_circle_chart_data_legend_position.jsx'
9
+ export { default as PbCircleChartWithTitle } from './_pb_circle_chart_with_title.jsx'
10
+ export { default as PbCircleChartInnerSizes } from './_pb_circle_chart_inner_sizes.jsx'
11
+ export { default as PbCircleChartCustomTooltip } from './_pb_circle_chart_custom_tooltip.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,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'