playbook_ui 15.1.0.pre.alpha.typeaheadscss11143 → 15.1.0.pre.rc.0

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 (207) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -3
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/RegularTableView.tsx +11 -24
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/VirtualizedTableView.tsx +7 -7
  5. data/app/pb_kits/playbook/pb_advanced_table/Hooks/useTableState.ts +2 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/Utilities/RowUtils.ts +2 -7
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +13 -67
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_vertical_border.jsx +2 -2
  9. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -0
  10. data/app/pb_kits/playbook/pb_button/docs/example.yml +0 -2
  11. data/app/pb_kits/playbook/pb_card/_card.scss +4 -12
  12. data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
  13. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +0 -10
  14. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +0 -3
  15. data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +0 -8
  16. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +0 -2
  17. data/app/pb_kits/playbook/pb_circle_icon_button/circle_icon_button.html.erb +0 -1
  18. data/app/pb_kits/playbook/pb_contact/_contact.tsx +0 -5
  19. data/app/pb_kits/playbook/pb_contact/contact.rb +0 -4
  20. data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -21
  21. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.html.erb +1 -16
  22. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.jsx +0 -15
  23. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.html.erb +0 -6
  24. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail.jsx +0 -6
  25. data/app/pb_kits/playbook/pb_date_picker/_date_picker.scss +0 -4
  26. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -6
  27. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +4 -48
  28. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +7 -5
  29. data/app/pb_kits/playbook/pb_dialog/dialogHelper.js +65 -0
  30. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.html.erb +16 -16
  31. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_stacked_alert.jsx +1 -2
  32. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.html.erb +31 -31
  33. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +3 -4
  34. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +0 -9
  35. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.html.erb +3 -3
  36. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
  37. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +0 -11
  38. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -1
  39. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -2
  40. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +2 -2
  41. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.scss +21 -15
  42. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -6
  43. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.html.erb +0 -2
  44. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.rb +3 -11
  45. data/app/pb_kits/playbook/pb_icon_stat_value/icon_stat_value.test.js +8 -9
  46. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  47. data/app/pb_kits/playbook/pb_loading_inline/loading_inline.rb +1 -1
  48. data/app/pb_kits/playbook/pb_nav/_item.tsx +5 -19
  49. data/app/pb_kits/playbook/pb_nav/_nav.scss +0 -27
  50. data/app/pb_kits/playbook/pb_nav/_nav.test.js +0 -16
  51. data/app/pb_kits/playbook/pb_nav/_nav.tsx +0 -5
  52. data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -2
  53. data/app/pb_kits/playbook/pb_nav/docs/index.js +1 -2
  54. data/app/pb_kits/playbook/pb_nav/item.html.erb +2 -6
  55. data/app/pb_kits/playbook/pb_nav/nav.rb +1 -6
  56. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_breached.html.erb +3 -3
  57. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_common.html.erb +3 -3
  58. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_confirmation.html.erb +3 -3
  59. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_meter_settings.html.erb +3 -3
  60. data/app/pb_kits/playbook/pb_passphrase/docs/_passphrase_strength_change.html.erb +3 -3
  61. data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_preview.html.erb +2 -2
  62. data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +5 -13
  63. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +0 -23
  64. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +7 -45
  65. data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +1 -4
  66. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +6 -14
  67. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.html.erb +4 -8
  68. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.jsx +0 -5
  69. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +1 -3
  70. data/app/pb_kits/playbook/pb_text_input/text_input.rb +0 -6
  71. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +8 -24
  72. data/app/pb_kits/playbook/pb_timestamp/docs/_time_stamp_default.md +1 -0
  73. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +10 -0
  74. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +9 -0
  75. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +17 -3
  76. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +15 -0
  77. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +2 -0
  78. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +2 -0
  79. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +14 -0
  80. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +14 -0
  81. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.html.erb +4 -0
  82. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_unstyled.jsx +4 -0
  83. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +1 -0
  84. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +6 -18
  85. data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -6
  86. data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +7 -29
  87. data/app/pb_kits/playbook/pb_timestamp/timestamp.test.js +4 -69
  88. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +10 -10
  89. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -39
  90. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -2
  91. data/dist/chunks/{_line_graph-B-1uF3pN.js → _line_graph-CnQWoGfx.js} +1 -1
  92. data/dist/chunks/{_typeahead-C8eN5nhR.js → _typeahead-_Pft9jZd.js} +2 -2
  93. data/dist/chunks/_weekday_stacked-D_gm5opl.js +37 -0
  94. data/dist/chunks/{lib-QZuu1ltS.js → lib-CY5ZPzic.js} +1 -1
  95. data/dist/chunks/{pb_form_validation-CleM960_.js → pb_form_validation-D3b0JKHH.js} +1 -1
  96. data/dist/chunks/vendor.js +1 -1
  97. data/dist/menu.yml +2 -16
  98. data/dist/playbook-doc.js +2 -2
  99. data/dist/playbook-rails-react-bindings.js +1 -1
  100. data/dist/playbook-rails.js +1 -1
  101. data/dist/playbook.css +1 -1
  102. data/lib/playbook/engine.rb +1 -0
  103. data/lib/playbook/forms/builder/form_field_builder.rb +2 -37
  104. data/lib/playbook/kit_base.rb +2 -23
  105. data/lib/playbook/version.rb +2 -2
  106. metadata +28 -112
  107. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.html.erb +0 -31
  108. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled.md +0 -7
  109. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.html.erb +0 -21
  110. data/app/pb_kits/playbook/pb_button/docs/_button_managed_disabled_helper.md +0 -7
  111. data/app/pb_kits/playbook/pb_button/index.js +0 -99
  112. data/app/pb_kits/playbook/pb_contact/docs/_contact_default.md +0 -5
  113. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.html.erb +0 -6
  114. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.jsx +0 -39
  115. data/app/pb_kits/playbook/pb_nav/docs/_horizontal_nav_extendedunderline.md +0 -1
  116. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.scss +0 -0
  117. data/app/pb_kits/playbook/pb_pb_bar_graph/_pb_bar_graph.tsx +0 -62
  118. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.html.erb +0 -35
  119. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors.jsx +0 -49
  120. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_rails.md +0 -1
  121. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_colors_react.md +0 -2
  122. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.html.erb +0 -38
  123. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_default.jsx +0 -51
  124. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.html.erb +0 -46
  125. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.jsx +0 -62
  126. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_height.md +0 -3
  127. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.html.erb +0 -47
  128. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_horizontal.jsx +0 -60
  129. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.html.erb +0 -25
  130. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend.jsx +0 -36
  131. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_non_clickable.jsx +0 -44
  132. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.html.erb +0 -100
  133. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_legend_position.jsx +0 -126
  134. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.html.erb +0 -32
  135. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_negative_numbers.jsx +0 -48
  136. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.html.erb +0 -68
  137. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_secondary_y_axis.jsx +0 -81
  138. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.html.erb +0 -31
  139. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.jsx +0 -42
  140. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_spline.md +0 -2
  141. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.html.erb +0 -35
  142. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_pb_bar_graph_stacked.jsx +0 -51
  143. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/example.yml +0 -27
  144. data/app/pb_kits/playbook/pb_pb_bar_graph/docs/index.js +0 -11
  145. data/app/pb_kits/playbook/pb_pb_bar_graph/pbBarGraphTheme.ts +0 -106
  146. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.html.erb +0 -1
  147. data/app/pb_kits/playbook/pb_pb_bar_graph/pb_bar_graph.rb +0 -28
  148. data/app/pb_kits/playbook/pb_pb_bar_graph/pbbargraph.test.jsx +0 -31
  149. data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +0 -3
  150. data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +0 -62
  151. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +0 -31
  152. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +0 -81
  153. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +0 -25
  154. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +0 -40
  155. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +0 -5
  156. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +0 -27
  157. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +0 -39
  158. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +0 -5
  159. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +0 -93
  160. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +0 -131
  161. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +0 -14
  162. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +0 -42
  163. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +0 -58
  164. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +0 -24
  165. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +0 -38
  166. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +0 -22
  167. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +0 -33
  168. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +0 -118
  169. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +0 -144
  170. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +0 -60
  171. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +0 -24
  172. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +0 -42
  173. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +0 -38
  174. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +0 -52
  175. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +0 -29
  176. data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +0 -11
  177. data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +0 -88
  178. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +0 -1
  179. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +0 -28
  180. data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +0 -51
  181. data/app/pb_kits/playbook/pb_section_separator/section_separator.test.js +0 -165
  182. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default.md +0 -1
  183. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.md +0 -1
  184. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.md +0 -1
  185. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.md +0 -5
  186. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.html.erb +0 -12
  187. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.jsx +0 -25
  188. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_current_year.md +0 -1
  189. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.html.erb +0 -4
  190. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.jsx +0 -17
  191. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_date.md +0 -1
  192. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.html.erb +0 -18
  193. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.jsx +0 -44
  194. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_show_time.md +0 -1
  195. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.md +0 -1
  196. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.md +0 -5
  197. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.html.erb +0 -16
  198. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.jsx +0 -30
  199. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_current_year.md +0 -1
  200. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.html.erb +0 -16
  201. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.jsx +0 -30
  202. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_date.md +0 -1
  203. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.html.erb +0 -26
  204. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.jsx +0 -41
  205. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_show_time.md +0 -1
  206. data/dist/chunks/_weekday_stacked-1o7KVL87.js +0 -37
  207. data/dist/chunks/componentRegistry-DzmmLR2x.js +0 -1
@@ -140,14 +140,10 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
140
140
  formattedValue = value
141
141
  }
142
142
 
143
- const errorId = error ? `${id}-error` : undefined
144
-
145
143
  const textInput = (
146
144
  childInput ? React.cloneElement(children, { className: "text_input" }) :
147
145
  (<input
148
146
  {...domSafeProps(props)}
149
- aria-describedby={errorId}
150
- aria-invalid={!!error}
151
147
  autoComplete={typeof autoComplete === "string" ? autoComplete : ( autoComplete ? undefined : "off" )}
152
148
  className="text_input"
153
149
  disabled={disabled}
@@ -206,20 +202,16 @@ const TextInput = (props: TextInputProps, ref: React.LegacyRef<HTMLInputElement>
206
202
  {...htmlProps}
207
203
  className={css}
208
204
  >
209
- {label && (
210
- <label htmlFor={id}>
211
- <Caption className="pb_text_input_kit_label"
212
- text={label}
213
- />
214
- </label>
215
- )}
205
+ {label &&
206
+ <Caption
207
+ className="pb_text_input_kit_label"
208
+ text={label}
209
+ />
210
+ }
216
211
  <div className={`${addOnCss} text_input_wrapper`}>
217
212
  {render}
218
213
 
219
214
  {error && <Body
220
- aria={{ atomic: "true", live: "polite" }}
221
- htmlOptions={{ role: "alert" }}
222
- id={errorId}
223
215
  status="negative"
224
216
  text={error}
225
217
  variant={null}
@@ -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"
@@ -1,8 +1,6 @@
1
1
  <%= pb_content_tag(:div, id: nil ) do %>
2
2
  <% if object.label.present? %>
3
- <label for="<%= object.input_options[:id] || object.id %>" >
4
3
  <%= pb_rails("caption", props: { text: object.label, dark: object.dark, classname: "pb_text_input_kit_label" }) %>
5
- </label>
6
4
  <% end %>
7
5
  <%= content_tag(:div, class: "#{add_on_class} text_input_wrapper") do %>
8
6
  <% if content.present? %>
@@ -17,7 +15,7 @@
17
15
  <% else %>
18
16
  <%= input_tag %>
19
17
  <% end %>
20
- <%= pb_rails("body", props: {dark: object.dark, status: "negative", text: object.error, id: object.error_id, aria: { atomic: "true", live: "polite" }, html_options: { role: "alert" }}) if object.error %>
18
+ <%= pb_rails("body", props: {dark: object.dark, status: "negative", text: object.error}) if object.error %>
21
19
  <% end %>
22
20
  <% end %>
23
21
 
@@ -64,16 +64,10 @@ module Playbook
64
64
  "#{object.id}-sanitized" if id.present?
65
65
  end
66
66
 
67
- def error_id
68
- "#{id}-error" if error.present?
69
- end
70
-
71
67
  private
72
68
 
73
69
  def all_input_options
74
70
  {
75
- 'aria-describedby': error.present? ? error_id : nil,
76
- 'aria-invalid': error.present?,
77
71
  autocomplete: autocomplete == true ? nil : (autocomplete.presence || "off"),
78
72
  class: "text_input #{input_options.dig(:classname) || ''}",
79
73
  data: validation_data,
@@ -18,11 +18,9 @@ type TimestampProps = {
18
18
  timezone: string,
19
19
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
20
20
  id?: string,
21
- showCurrentYear?: boolean,
22
21
  showDate?: boolean,
23
22
  showUser?: boolean,
24
23
  hideUpdated?: boolean,
25
- showTime?: boolean,
26
24
  showTimezone?: boolean,
27
25
  unstyled?: boolean,
28
26
  variant?: "default" | "elapsed" | "updated"
@@ -39,11 +37,9 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
39
37
  text,
40
38
  timezone,
41
39
  timestamp,
42
- showCurrentYear = false,
43
40
  showDate = true,
44
41
  showUser = false,
45
42
  hideUpdated = false,
46
- showTime = true,
47
43
  showTimezone = false,
48
44
  unstyled = false,
49
45
  variant = 'default',
@@ -59,6 +55,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
59
55
  )
60
56
 
61
57
  const currentYear = new Date().getFullYear().toString()
58
+ const dateDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
62
59
  const shouldShowUser = showUser == true && text.length > 0
63
60
  const shouldShowTimezone = showTimezone == true && timezone.length > 0
64
61
  const updatedText = hideUpdated ? "" : "Last updated"
@@ -73,26 +70,16 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
73
70
  return timeDisplay
74
71
  }
75
72
 
76
- const baseDateDisplay = () => {
77
- let display = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
78
- if (DateTime.toYear(timestamp, timezone).toString() !== currentYear || showCurrentYear) {
79
- display = `${display}, ${DateTime.toYear(timestamp, timezone)}`
80
- }
81
- return display
82
- }
83
-
84
73
  const fullDateDisplay = () => {
85
- const fullDisplay = baseDateDisplay()
86
- return showTime ? `${fullDisplay} ${' \u00b7 '} ${fullTimeDisplay()}` : fullDisplay
74
+ let fullDisplay = `${DateTime.toMonth(timestamp, timezone)} ${DateTime.toDay(timestamp, timezone)}`
75
+ if (DateTime.toYear(timestamp, timezone).toString() !== currentYear) {
76
+ fullDisplay = `${fullDisplay}, ${DateTime.toYear(timestamp, timezone)}`
77
+ }
78
+ return `${fullDisplay} ${' \u00b7 '} ${fullTimeDisplay()}`
87
79
  }
88
80
 
89
81
  const formatUpdatedString = () => {
90
- const finalUpdatedString = []
91
- if (shouldShowUser) finalUpdatedString.push(`by ${text}`)
92
- if (showDate && !showTime) finalUpdatedString.push(`on ${baseDateDisplay()}`)
93
- if (showDate && showTime) finalUpdatedString.push(`on ${baseDateDisplay()} at ${timeDisplay}`)
94
- if (showTime && !showDate) finalUpdatedString.push(`at ${timeDisplay}`)
95
- return `Last updated ${finalUpdatedString.join(' ')}`
82
+ return `Last updated ${userDisplay} on ${dateDisplay} at ${timeDisplay}`
96
83
  }
97
84
 
98
85
  const formatElapsedString = () => {
@@ -106,10 +93,7 @@ const Timestamp = (props: TimestampProps): React.ReactElement => {
106
93
  case 'elapsed':
107
94
  return formatElapsedString()
108
95
  default:
109
- if (showDate && showTime) return timestamp ? fullDateDisplay() : text
110
- if (showDate && !showTime) return baseDateDisplay()
111
- if (!showDate && showTime) return fullTimeDisplay()
112
- return text
96
+ return showDate ? timestamp ? fullDateDisplay() : text : fullTimeDisplay()
113
97
  }
114
98
  }
115
99
 
@@ -0,0 +1 @@
1
+ Use these only to display status updates in areas that has a lot of data.
@@ -8,6 +8,7 @@
8
8
 
9
9
  <%= pb_rails("timestamp", props: {
10
10
  timestamp: DateTime.now,
11
+ show_date: true,
11
12
  align: "left"
12
13
  }) %>
13
14
 
@@ -15,6 +16,7 @@
15
16
 
16
17
  <%= pb_rails("timestamp", props: {
17
18
  timestamp: DateTime.now + 4.years,
19
+ show_date: true,
18
20
  align: "left"
19
21
  }) %>
20
22
 
@@ -22,6 +24,7 @@
22
24
 
23
25
  <%= pb_rails("timestamp", props: {
24
26
  timestamp: DateTime.now - 1.year,
27
+ show_date: true,
25
28
  align: "left"
26
29
  }) %>
27
30
 
@@ -37,6 +40,7 @@
37
40
 
38
41
  <%= pb_rails("timestamp", props: {
39
42
  timestamp: DateTime.now,
43
+ show_date: true,
40
44
  align: "center"
41
45
  }) %>
42
46
 
@@ -44,6 +48,7 @@
44
48
 
45
49
  <%= pb_rails("timestamp", props: {
46
50
  timestamp: DateTime.now + 4.years,
51
+ show_date: true,
47
52
  align: "center"
48
53
  }) %>
49
54
 
@@ -51,6 +56,7 @@
51
56
 
52
57
  <%= pb_rails("timestamp", props: {
53
58
  timestamp: DateTime.now - 1.year,
59
+ show_date: true,
54
60
  align: "center"
55
61
  }) %>
56
62
 
@@ -58,6 +64,7 @@
58
64
 
59
65
  <%= pb_rails("timestamp", props: {
60
66
  timestamp: DateTime.now,
67
+ show_date: false,
61
68
  align: "right"
62
69
  }) %>
63
70
 
@@ -65,6 +72,7 @@
65
72
 
66
73
  <%= pb_rails("timestamp", props: {
67
74
  timestamp: DateTime.now,
75
+ show_date: true,
68
76
  align: "right"
69
77
  }) %>
70
78
 
@@ -72,6 +80,7 @@
72
80
 
73
81
  <%= pb_rails("timestamp", props: {
74
82
  timestamp: DateTime.now + 4.years,
83
+ show_date: true,
75
84
  align: "right"
76
85
  }) %>
77
86
 
@@ -79,5 +88,6 @@
79
88
 
80
89
  <%= pb_rails("timestamp", props: {
81
90
  timestamp: DateTime.now - 1.year,
91
+ show_date: true,
82
92
  align: "right"
83
93
  }) %>
@@ -25,6 +25,7 @@ const TimestampAlign = (props) => {
25
25
 
26
26
  <Timestamp
27
27
  align="left"
28
+ showDate
28
29
  timestamp={todaysDate}
29
30
  {...props}
30
31
  />
@@ -33,6 +34,7 @@ const TimestampAlign = (props) => {
33
34
 
34
35
  <Timestamp
35
36
  align="left"
37
+ showDate
36
38
  timestamp={futureDate}
37
39
  {...props}
38
40
  />
@@ -41,6 +43,7 @@ const TimestampAlign = (props) => {
41
43
 
42
44
  <Timestamp
43
45
  align="left"
46
+ showDate
44
47
  timestamp={pastDate}
45
48
  {...props}
46
49
  />
@@ -59,6 +62,7 @@ const TimestampAlign = (props) => {
59
62
 
60
63
  <Timestamp
61
64
  align="center"
65
+ showDate
62
66
  timestamp={todaysDate}
63
67
  {...props}
64
68
  />
@@ -67,6 +71,7 @@ const TimestampAlign = (props) => {
67
71
 
68
72
  <Timestamp
69
73
  align="center"
74
+ showDate
70
75
  timestamp={futureDate}
71
76
  {...props}
72
77
  />
@@ -75,6 +80,7 @@ const TimestampAlign = (props) => {
75
80
 
76
81
  <Timestamp
77
82
  align="center"
83
+ showDate
78
84
  timestamp={pastDate}
79
85
  {...props}
80
86
  />
@@ -93,6 +99,7 @@ const TimestampAlign = (props) => {
93
99
 
94
100
  <Timestamp
95
101
  align="right"
102
+ showDate
96
103
  timestamp={todaysDate}
97
104
  {...props}
98
105
  />
@@ -101,6 +108,7 @@ const TimestampAlign = (props) => {
101
108
 
102
109
  <Timestamp
103
110
  align="right"
111
+ showDate
104
112
  timestamp={futureDate}
105
113
  {...props}
106
114
  />
@@ -109,6 +117,7 @@ const TimestampAlign = (props) => {
109
117
 
110
118
  <Timestamp
111
119
  align="right"
120
+ showDate
112
121
  timestamp={pastDate}
113
122
  {...props}
114
123
  />
@@ -1,15 +1,29 @@
1
1
  <%= pb_rails("timestamp", props: {
2
- timestamp: DateTime.now
2
+ timestamp: DateTime.now,
3
+ show_date: false,
4
+ align: "left"
3
5
  }) %>
4
6
 
5
7
  <br>
6
8
 
7
9
  <%= pb_rails("timestamp", props: {
8
- timestamp: DateTime.now + 4.years
10
+ timestamp: DateTime.now,
11
+ show_date: true,
12
+ align: "left"
9
13
  }) %>
10
14
 
11
15
  <br>
12
16
 
13
17
  <%= pb_rails("timestamp", props: {
14
- timestamp: DateTime.now - 1.year
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"
15
29
  }) %>
@@ -15,6 +15,8 @@ const TimestampDefault = (props) => {
15
15
  return (
16
16
  <div>
17
17
  <Timestamp
18
+ align="left"
19
+ showDate={false}
18
20
  timestamp={todaysDate}
19
21
  {...props}
20
22
  />
@@ -22,6 +24,17 @@ const TimestampDefault = (props) => {
22
24
  <br />
23
25
 
24
26
  <Timestamp
27
+ align="left"
28
+ showDate
29
+ timestamp={todaysDate}
30
+ {...props}
31
+ />
32
+
33
+ <br />
34
+
35
+ <Timestamp
36
+ align="left"
37
+ showDate
25
38
  timestamp={futureDate}
26
39
  {...props}
27
40
  />
@@ -29,6 +42,8 @@ const TimestampDefault = (props) => {
29
42
  <br />
30
43
 
31
44
  <Timestamp
45
+ align="left"
46
+ showDate
32
47
  timestamp={pastDate}
33
48
  {...props}
34
49
  />
@@ -10,6 +10,7 @@
10
10
  <%= pb_rails("timestamp", props: {
11
11
  timestamp: DateTime.now - 3.months,
12
12
  variant: "elapsed",
13
+ show_user: false
13
14
  }) %>
14
15
 
15
16
  <br>
@@ -17,5 +18,6 @@
17
18
  <%= pb_rails("timestamp", props: {
18
19
  timestamp: DateTime.now - 320.days,
19
20
  variant: "elapsed",
21
+ show_user: false,
20
22
  hide_updated: true
21
23
  }) %>
@@ -23,6 +23,7 @@ const TimestampElapsed = (props) => {
23
23
  <br />
24
24
 
25
25
  <Timestamp
26
+ showUser={false}
26
27
  timestamp={customDate}
27
28
  variant="elapsed"
28
29
  {...props}
@@ -32,6 +33,7 @@ const TimestampElapsed = (props) => {
32
33
 
33
34
  <Timestamp
34
35
  hideUpdated
36
+ showUser={false}
35
37
  timestamp={customDate}
36
38
  variant="elapsed"
37
39
  {...props}
@@ -3,30 +3,37 @@
3
3
  show_date: false,
4
4
  show_timezone: true,
5
5
  timezone: "America/New_York",
6
+ align: "left"
6
7
  }) %>
7
8
 
8
9
  <br>
9
10
 
10
11
  <%= pb_rails("timestamp", props: {
11
12
  timestamp: DateTime.now,
13
+ show_date: true,
12
14
  show_timezone: true,
13
15
  timezone: "America/New_York",
16
+ align: "left"
14
17
  }) %>
15
18
 
16
19
  <br>
17
20
 
18
21
  <%= pb_rails("timestamp", props: {
19
22
  timestamp: DateTime.now + 4.years,
23
+ show_date: true,
20
24
  show_timezone: true,
21
25
  timezone: "America/New_York",
26
+ align: "left"
22
27
  }) %>
23
28
 
24
29
  <br>
25
30
 
26
31
  <%= pb_rails("timestamp", props: {
27
32
  timestamp: DateTime.now - 1.year,
33
+ show_date: true,
28
34
  show_timezone: true,
29
35
  timezone: "America/New_York",
36
+ align: "left"
30
37
  }) %>
31
38
 
32
39
  <br>
@@ -36,30 +43,37 @@
36
43
  show_date: false,
37
44
  show_timezone: true,
38
45
  timezone: "Asia/Hong_Kong",
46
+ align: "left"
39
47
  }) %>
40
48
 
41
49
  <br>
42
50
 
43
51
  <%= pb_rails("timestamp", props: {
44
52
  timestamp: DateTime.now,
53
+ show_date: true,
45
54
  show_timezone: true,
46
55
  timezone: "Asia/Hong_Kong",
56
+ align: "left"
47
57
  }) %>
48
58
 
49
59
  <br>
50
60
 
51
61
  <%= pb_rails("timestamp", props: {
52
62
  timestamp: DateTime.now + 4.years,
63
+ show_date: true,
53
64
  show_timezone: true,
54
65
  timezone: "Asia/Hong_Kong",
66
+ align: "left"
55
67
  }) %>
56
68
 
57
69
  <br>
58
70
 
59
71
  <%= pb_rails("timestamp", props: {
60
72
  timestamp: DateTime.now - 1.year,
73
+ show_date: true,
61
74
  show_timezone: true,
62
75
  timezone: "Asia/Hong_Kong",
76
+ align: "left"
63
77
  }) %>
64
78
 
65
79
  <br>
@@ -15,6 +15,7 @@ const TimestampTimezones = (props) => {
15
15
  return (
16
16
  <div>
17
17
  <Timestamp
18
+ align="left"
18
19
  showDate={false}
19
20
  showTimezone
20
21
  timestamp={todaysDate}
@@ -25,6 +26,8 @@ const TimestampTimezones = (props) => {
25
26
  <br />
26
27
 
27
28
  <Timestamp
29
+ align="left"
30
+ showDate
28
31
  showTimezone
29
32
  timestamp={todaysDate}
30
33
  timezone="America/New_York"
@@ -34,6 +37,8 @@ const TimestampTimezones = (props) => {
34
37
  <br />
35
38
 
36
39
  <Timestamp
40
+ align="left"
41
+ showDate
37
42
  showTimezone
38
43
  timestamp={futureDate}
39
44
  timezone="America/New_York"
@@ -43,6 +48,8 @@ const TimestampTimezones = (props) => {
43
48
  <br />
44
49
 
45
50
  <Timestamp
51
+ align="left"
52
+ showDate
46
53
  showTimezone
47
54
  timestamp={pastDate}
48
55
  timezone="America/New_York"
@@ -52,6 +59,7 @@ const TimestampTimezones = (props) => {
52
59
  <br />
53
60
 
54
61
  <Timestamp
62
+ align="left"
55
63
  showDate={false}
56
64
  showTimezone
57
65
  timestamp={todaysDate}
@@ -62,6 +70,8 @@ const TimestampTimezones = (props) => {
62
70
  <br />
63
71
 
64
72
  <Timestamp
73
+ align="left"
74
+ showDate
65
75
  showTimezone
66
76
  timestamp={todaysDate}
67
77
  timezone="Asia/Hong_Kong"
@@ -71,6 +81,8 @@ const TimestampTimezones = (props) => {
71
81
  <br />
72
82
 
73
83
  <Timestamp
84
+ align="left"
85
+ showDate
74
86
  showTimezone
75
87
  timestamp={futureDate}
76
88
  timezone="Asia/Hong_Kong"
@@ -80,6 +92,8 @@ const TimestampTimezones = (props) => {
80
92
  <br />
81
93
 
82
94
  <Timestamp
95
+ align="left"
96
+ showDate
83
97
  showTimezone
84
98
  timestamp={pastDate}
85
99
  timezone="Asia/Hong_Kong"
@@ -2,6 +2,8 @@
2
2
 
3
3
  <%= pb_rails("timestamp", props: {
4
4
  timestamp: DateTime.now,
5
+ show_date: true,
6
+ align: "left",
5
7
  unstyled: true,
6
8
  }) %>
7
9
 
@@ -12,6 +14,8 @@
12
14
  <%= pb_rails("title", props: { size: 1 }) do %>
13
15
  <%= pb_rails("timestamp", props: {
14
16
  timestamp: DateTime.now,
17
+ show_date: true,
18
+ align: "left",
15
19
  unstyled: true,
16
20
  }) %>
17
21
  <% end %>
@@ -10,6 +10,8 @@ const TimestampUnstyled = (props) => {
10
10
  text="Basic unstyled example"
11
11
  />
12
12
  <Timestamp
13
+ align="left"
14
+ showDate
13
15
  timestamp={new Date()}
14
16
  unstyled
15
17
  {...props}
@@ -22,6 +24,8 @@ const TimestampUnstyled = (props) => {
22
24
  />
23
25
  <Title size={1}>
24
26
  <Timestamp
27
+ align="left"
28
+ showDate
25
29
  timestamp={new Date()}
26
30
  unstyled
27
31
  {...props}
@@ -17,6 +17,7 @@ const TimestampUpdated = (props) => {
17
17
  <br />
18
18
 
19
19
  <Timestamp
20
+ showUser={false}
20
21
  timestamp={todaysDate}
21
22
  variant="updated"
22
23
  {...props}