playbook_ui_docs 15.0.0 → 15.1.0.pre.alpha.PLAY2425textinputaccessibility10907

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 (128) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +2 -2
  3. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -1
  4. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +3 -0
  5. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +8 -0
  6. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +16 -1
  7. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +15 -0
  8. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +5 -0
  9. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +6 -0
  10. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +6 -0
  11. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -0
  12. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.html.erb +5 -0
  13. data/app/pb_kits/playbook/pb_loading_inline/docs/_loading_inline_variant.jsx +24 -0
  14. data/app/pb_kits/playbook/pb_loading_inline/docs/example.yml +2 -0
  15. data/app/pb_kits/playbook/pb_loading_inline/docs/index.js +1 -0
  16. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.html.erb +6 -0
  17. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.jsx +39 -0
  18. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.md +1 -0
  19. data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -0
  20. data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -1
  21. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
  22. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
  23. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
  24. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
  25. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
  26. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +35 -0
  27. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +49 -0
  28. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +1 -0
  29. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +2 -0
  30. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +38 -0
  31. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +51 -0
  32. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +46 -0
  33. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +62 -0
  34. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +3 -0
  35. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +47 -0
  36. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +60 -0
  37. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +25 -0
  38. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +36 -0
  39. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +44 -0
  40. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +100 -0
  41. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +126 -0
  42. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +32 -0
  43. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +48 -0
  44. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +68 -0
  45. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +81 -0
  46. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +31 -0
  47. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +42 -0
  48. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +2 -0
  49. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +35 -0
  50. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +51 -0
  51. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +27 -0
  52. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +11 -0
  53. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +31 -0
  54. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +81 -0
  55. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +25 -0
  56. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +40 -0
  57. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +5 -0
  58. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +27 -0
  59. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +39 -0
  60. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +5 -0
  61. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +93 -0
  62. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +131 -0
  63. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +14 -0
  64. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +42 -0
  65. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +58 -0
  66. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +24 -0
  67. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +38 -0
  68. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +22 -0
  69. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +33 -0
  70. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +118 -0
  71. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +144 -0
  72. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +60 -0
  73. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +24 -0
  74. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +42 -0
  75. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +38 -0
  76. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +52 -0
  77. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +29 -0
  78. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +11 -0
  79. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
  80. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +23 -0
  81. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +45 -7
  82. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.html.erb +41 -0
  83. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.jsx +80 -0
  84. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_autocomplete.md +1 -0
  85. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +8 -4
  86. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +5 -0
  87. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +1 -0
  88. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +3 -0
  89. data/app/pb_kits/playbook/pb_text_input/docs/index.js +1 -0
  90. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +0 -10
  91. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +0 -9
  92. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +1 -0
  93. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +3 -17
  94. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +0 -15
  95. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +1 -0
  96. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +0 -2
  97. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +0 -2
  98. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +5 -0
  99. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +12 -0
  100. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +25 -0
  101. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +1 -0
  102. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +4 -0
  103. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +17 -0
  104. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +1 -0
  105. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +18 -0
  106. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +44 -0
  107. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +1 -0
  108. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +0 -14
  109. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +0 -14
  110. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +1 -0
  111. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +0 -4
  112. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +0 -4
  113. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +0 -1
  114. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +5 -0
  115. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +16 -0
  116. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +30 -0
  117. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +1 -0
  118. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +16 -0
  119. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +30 -0
  120. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +1 -0
  121. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +26 -0
  122. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +41 -0
  123. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +1 -0
  124. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +18 -6
  125. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +6 -0
  126. data/dist/playbook-doc.js +2 -2
  127. metadata +88 -3
  128. data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +0 -1
@@ -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'
@@ -13,8 +13,8 @@
13
13
  <script>
14
14
  document.addEventListener('DOMContentLoaded', () => {
15
15
  function handleButtonClick() {
16
- const editorContainer = [...document.querySelectorAll('[data-react-props]')]
17
- .find(element => element.getAttribute('data-react-props')?.includes('"id":"content-preview-editor"'))
16
+ const editorContainer = [...document.querySelectorAll('[data-pb-react-props]')]
17
+ .find(element => element.getAttribute('data-pb-react-props')?.includes('"id":"content-preview-editor"'))
18
18
 
19
19
  const editorElement = editorContainer?.querySelector('trix-editor')
20
20
  const inputId = editorElement?.getAttribute('input')
@@ -11,4 +11,27 @@
11
11
  padding_right: "xs"
12
12
  }) %>
13
13
  <% end %>
14
+ <% end %>
15
+
16
+ <%= pb_rails("flex", props: { classname: "flex-container", margin_top: "lg", vertical: "stretch" }) do %>
17
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
19
+ <% end %>
20
+ <%= pb_rails("section_separator", props: { orientation: "vertical" }) do %>
21
+ <%= pb_rails("card", props: {
22
+ border_radius: "rounded",
23
+ justify_content: "center",
24
+ padding: "none"
25
+ }) do %>
26
+ <%= pb_rails("caption", props: {
27
+ text: "TODAY",
28
+ size: "xs",
29
+ padding_left: "xs",
30
+ padding_right: "xs"
31
+ }) %>
32
+ <% end %>
33
+ <% end %>
34
+ <%= pb_rails("body", props: { classname: "flex-item" }) do %>
35
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua
36
+ <% end %>
14
37
  <% end %>
@@ -2,8 +2,25 @@ import React from 'react'
2
2
  import Card from '../../pb_card/_card'
3
3
  import Caption from '../../pb_caption/_caption'
4
4
  import SectionSeparator from '../../pb_section_separator/_section_separator'
5
+ import Flex from '../../pb_flex/_flex'
6
+ import FlexItem from '../../pb_flex/_flex_item'
5
7
 
6
- const children = (
8
+ const childrenHorizontal = (
9
+ <Card
10
+ borderRadius="rounded"
11
+ justifyContent="center"
12
+ padding="none"
13
+ >
14
+ <Caption
15
+ paddingLeft="xs"
16
+ paddingRight="xs"
17
+ size="xs"
18
+ text="TODAY"
19
+ />
20
+ </Card>
21
+ )
22
+
23
+ const childrenVertical = (
7
24
  <Card
8
25
  borderRadius="rounded"
9
26
  justifyContent="center"
@@ -20,12 +37,33 @@ const children = (
20
37
 
21
38
  const SectionSeparatorChildren = (props) => {
22
39
  return (
23
- <SectionSeparator
24
- {...props}
25
- lineStyle='dashed'
26
- >
27
- {children}
28
- </SectionSeparator>
40
+ <>
41
+ <SectionSeparator
42
+ {...props}
43
+ lineStyle='dashed'
44
+ >
45
+ {childrenHorizontal}
46
+ </SectionSeparator>
47
+ <Flex
48
+ inline="flex-container"
49
+ marginTop="lg"
50
+ vertical="stretch"
51
+ >
52
+ <FlexItem>
53
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
54
+ </FlexItem>
55
+ <SectionSeparator
56
+ orientation="vertical"
57
+ {...props}
58
+ >
59
+ {childrenVertical}
60
+ </SectionSeparator>
61
+ <FlexItem>
62
+ {'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua'}
63
+ </FlexItem>
64
+ </Flex>
65
+ </>
66
+
29
67
  )
30
68
  }
31
69
 
@@ -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,23 +9,27 @@
9
9
 
10
10
  <%= pb_rails("text_input", props: {
11
11
  label: "Last Name",
12
- placeholder: "Enter last name"
12
+ placeholder: "Enter last name",
13
+ id: "last-name"
13
14
  }) %>
14
15
 
15
16
  <%= pb_rails("text_input", props: {
16
17
  label: "Phone Number",
17
18
  type: "phone",
18
- placeholder: "Enter phone number"
19
+ placeholder: "Enter phone number",
20
+ id: "phone"
19
21
  }) %>
20
22
 
21
23
  <%= pb_rails("text_input", props: {
22
24
  label: "Email Address",
23
25
  type: "email",
24
- placeholder: "Enter email address"
26
+ placeholder: "Enter email address",
27
+ id: "email"
25
28
  }) %>
26
29
 
27
30
  <%= pb_rails("text_input", props: {
28
31
  label: "Zip Code",
29
32
  type: "number",
30
- placeholder: "Enter zip code"
33
+ placeholder: "Enter zip code",
34
+ id: "zip"
31
35
  }) %>
@@ -38,6 +38,7 @@ const TextInputDefault = (props) => {
38
38
  {...props}
39
39
  />
40
40
  <TextInput
41
+ id="last-name"
41
42
  label="Last Name"
42
43
  name="lastName"
43
44
  onChange={handleOnChangeFormField}
@@ -46,6 +47,7 @@ const TextInputDefault = (props) => {
46
47
  {...props}
47
48
  />
48
49
  <TextInput
50
+ id="phone"
49
51
  label="Phone Number"
50
52
  name="phone"
51
53
  onChange={handleOnChangeFormField}
@@ -55,6 +57,7 @@ const TextInputDefault = (props) => {
55
57
  {...props}
56
58
  />
57
59
  <TextInput
60
+ id="email"
58
61
  label="Email Address"
59
62
  name="email"
60
63
  onChange={handleOnChangeFormField}
@@ -64,6 +67,7 @@ const TextInputDefault = (props) => {
64
67
  {...props}
65
68
  />
66
69
  <TextInput
70
+ id="zip"
67
71
  label="Zip Code"
68
72
  name="zip"
69
73
  onChange={handleOnChangeFormField}
@@ -84,6 +88,7 @@ const TextInputDefault = (props) => {
84
88
  <br />
85
89
 
86
90
  <TextInput
91
+ id="first-name"
87
92
  label="First Name"
88
93
  onChange={handleOnChangeFirstName}
89
94
  placeholder="Enter first name"
@@ -0,0 +1 @@
1
+ Add an `id` to your Text Input so that clicking the label will move focus directly to the input.
@@ -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'
@@ -8,7 +8,6 @@
8
8
 
9
9
  <%= pb_rails("timestamp", props: {
10
10
  timestamp: DateTime.now,
11
- show_date: true,
12
11
  align: "left"
13
12
  }) %>
14
13
 
@@ -16,7 +15,6 @@
16
15
 
17
16
  <%= pb_rails("timestamp", props: {
18
17
  timestamp: DateTime.now + 4.years,
19
- show_date: true,
20
18
  align: "left"
21
19
  }) %>
22
20
 
@@ -24,7 +22,6 @@
24
22
 
25
23
  <%= pb_rails("timestamp", props: {
26
24
  timestamp: DateTime.now - 1.year,
27
- show_date: true,
28
25
  align: "left"
29
26
  }) %>
30
27
 
@@ -40,7 +37,6 @@
40
37
 
41
38
  <%= pb_rails("timestamp", props: {
42
39
  timestamp: DateTime.now,
43
- show_date: true,
44
40
  align: "center"
45
41
  }) %>
46
42
 
@@ -48,7 +44,6 @@
48
44
 
49
45
  <%= pb_rails("timestamp", props: {
50
46
  timestamp: DateTime.now + 4.years,
51
- show_date: true,
52
47
  align: "center"
53
48
  }) %>
54
49
 
@@ -56,7 +51,6 @@
56
51
 
57
52
  <%= pb_rails("timestamp", props: {
58
53
  timestamp: DateTime.now - 1.year,
59
- show_date: true,
60
54
  align: "center"
61
55
  }) %>
62
56
 
@@ -64,7 +58,6 @@
64
58
 
65
59
  <%= pb_rails("timestamp", props: {
66
60
  timestamp: DateTime.now,
67
- show_date: false,
68
61
  align: "right"
69
62
  }) %>
70
63
 
@@ -72,7 +65,6 @@
72
65
 
73
66
  <%= pb_rails("timestamp", props: {
74
67
  timestamp: DateTime.now,
75
- show_date: true,
76
68
  align: "right"
77
69
  }) %>
78
70
 
@@ -80,7 +72,6 @@
80
72
 
81
73
  <%= pb_rails("timestamp", props: {
82
74
  timestamp: DateTime.now + 4.years,
83
- show_date: true,
84
75
  align: "right"
85
76
  }) %>
86
77
 
@@ -88,6 +79,5 @@
88
79
 
89
80
  <%= pb_rails("timestamp", props: {
90
81
  timestamp: DateTime.now - 1.year,
91
- show_date: true,
92
82
  align: "right"
93
83
  }) %>
@@ -25,7 +25,6 @@ const TimestampAlign = (props) => {
25
25
 
26
26
  <Timestamp
27
27
  align="left"
28
- showDate
29
28
  timestamp={todaysDate}
30
29
  {...props}
31
30
  />
@@ -34,7 +33,6 @@ const TimestampAlign = (props) => {
34
33
 
35
34
  <Timestamp
36
35
  align="left"
37
- showDate
38
36
  timestamp={futureDate}
39
37
  {...props}
40
38
  />
@@ -43,7 +41,6 @@ const TimestampAlign = (props) => {
43
41
 
44
42
  <Timestamp
45
43
  align="left"
46
- showDate
47
44
  timestamp={pastDate}
48
45
  {...props}
49
46
  />
@@ -62,7 +59,6 @@ const TimestampAlign = (props) => {
62
59
 
63
60
  <Timestamp
64
61
  align="center"
65
- showDate
66
62
  timestamp={todaysDate}
67
63
  {...props}
68
64
  />
@@ -71,7 +67,6 @@ const TimestampAlign = (props) => {
71
67
 
72
68
  <Timestamp
73
69
  align="center"
74
- showDate
75
70
  timestamp={futureDate}
76
71
  {...props}
77
72
  />
@@ -80,7 +75,6 @@ const TimestampAlign = (props) => {
80
75
 
81
76
  <Timestamp
82
77
  align="center"
83
- showDate
84
78
  timestamp={pastDate}
85
79
  {...props}
86
80
  />
@@ -99,7 +93,6 @@ const TimestampAlign = (props) => {
99
93
 
100
94
  <Timestamp
101
95
  align="right"
102
- showDate
103
96
  timestamp={todaysDate}
104
97
  {...props}
105
98
  />
@@ -108,7 +101,6 @@ const TimestampAlign = (props) => {
108
101
 
109
102
  <Timestamp
110
103
  align="right"
111
- showDate
112
104
  timestamp={futureDate}
113
105
  {...props}
114
106
  />
@@ -117,7 +109,6 @@ const TimestampAlign = (props) => {
117
109
 
118
110
  <Timestamp
119
111
  align="right"
120
- showDate
121
112
  timestamp={pastDate}
122
113
  {...props}
123
114
  />
@@ -0,0 +1 @@
1
+ The `align` prop can be used to set alignment. This prop is set to 'left' by default.
@@ -1,29 +1,15 @@
1
1
  <%= pb_rails("timestamp", props: {
2
- timestamp: DateTime.now,
3
- show_date: false,
4
- align: "left"
2
+ timestamp: DateTime.now
5
3
  }) %>
6
4
 
7
5
  <br>
8
6
 
9
7
  <%= pb_rails("timestamp", props: {
10
- timestamp: DateTime.now,
11
- show_date: true,
12
- align: "left"
8
+ timestamp: DateTime.now + 4.years
13
9
  }) %>
14
10
 
15
11
  <br>
16
12
 
17
13
  <%= pb_rails("timestamp", props: {
18
- timestamp: DateTime.now + 4.years,
19
- show_date: true,
20
- align: "left"
21
- }) %>
22
-
23
- <br>
24
-
25
- <%= pb_rails("timestamp", props: {
26
- timestamp: DateTime.now - 1.year,
27
- show_date: true,
28
- align: "left"
14
+ timestamp: DateTime.now - 1.year
29
15
  }) %>
@@ -15,8 +15,6 @@ const TimestampDefault = (props) => {
15
15
  return (
16
16
  <div>
17
17
  <Timestamp
18
- align="left"
19
- showDate={false}
20
18
  timestamp={todaysDate}
21
19
  {...props}
22
20
  />
@@ -24,17 +22,6 @@ const TimestampDefault = (props) => {
24
22
  <br />
25
23
 
26
24
  <Timestamp
27
- align="left"
28
- showDate
29
- timestamp={todaysDate}
30
- {...props}
31
- />
32
-
33
- <br />
34
-
35
- <Timestamp
36
- align="left"
37
- showDate
38
25
  timestamp={futureDate}
39
26
  {...props}
40
27
  />
@@ -42,8 +29,6 @@ const TimestampDefault = (props) => {
42
29
  <br />
43
30
 
44
31
  <Timestamp
45
- align="left"
46
- showDate
47
32
  timestamp={pastDate}
48
33
  {...props}
49
34
  />
@@ -0,0 +1 @@
1
+ By default, the timestamp kit will display the date and time as shown here. If the date is NOT within the current year, the year will also be shown while dates in the current year will not show the year.
@@ -10,7 +10,6 @@
10
10
  <%= pb_rails("timestamp", props: {
11
11
  timestamp: DateTime.now - 3.months,
12
12
  variant: "elapsed",
13
- show_user: false
14
13
  }) %>
15
14
 
16
15
  <br>
@@ -18,6 +17,5 @@
18
17
  <%= pb_rails("timestamp", props: {
19
18
  timestamp: DateTime.now - 320.days,
20
19
  variant: "elapsed",
21
- show_user: false,
22
20
  hide_updated: true
23
21
  }) %>
@@ -23,7 +23,6 @@ const TimestampElapsed = (props) => {
23
23
  <br />
24
24
 
25
25
  <Timestamp
26
- showUser={false}
27
26
  timestamp={customDate}
28
27
  variant="elapsed"
29
28
  {...props}
@@ -33,7 +32,6 @@ const TimestampElapsed = (props) => {
33
32
 
34
33
  <Timestamp
35
34
  hideUpdated
36
- showUser={false}
37
35
  timestamp={customDate}
38
36
  variant="elapsed"
39
37
  {...props}
@@ -0,0 +1,5 @@
1
+ Use variant `elapsed` to show time ago. This variant can be customized in several ways:
2
+
3
+ Use the optional `showUser`/`show_user` prop to show user as part of the text. When showing the user, pass in the user name using the `text` prop as shown. `showUser`/`show_user` is set to false by default.
4
+
5
+ Use the optional `hideUpdated`/`hide_updated` prop to hide the 'Last updated' text if needed.
@@ -0,0 +1,12 @@
1
+ <%= pb_rails("timestamp", props: {
2
+ timestamp: DateTime.now,
3
+ show_current_year: true
4
+ }) %>
5
+
6
+ <br>
7
+
8
+ <%= pb_rails("timestamp", props: {
9
+ timestamp: DateTime.now,
10
+ show_time: false,
11
+ show_current_year: true
12
+ }) %>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import Timestamp from '../_timestamp'
3
+
4
+
5
+ const TimestampShowCurrentYear = (props) => {
6
+ return (
7
+ <div>
8
+ <Timestamp
9
+ showCurrentYear
10
+ timestamp={new Date()}
11
+ {...props}
12
+ />
13
+ <br />
14
+ <Timestamp
15
+ showCurrentYear
16
+ showTime={false}
17
+ timestamp={new Date()}
18
+ {...props}
19
+ />
20
+
21
+ </div>
22
+ )
23
+ }
24
+
25
+ export default TimestampShowCurrentYear
@@ -0,0 +1 @@
1
+ Use the `showCurrentYear`/`show_current_year` prop to show the year even if it is the current year. This is set to false by default.