playbook_ui 7.0.1.pre.alpha14 → 7.1.1.pre.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/playbook/application_controller.rb +0 -2
  3. data/app/pb_kits/playbook/_playbook.scss +1 -0
  4. data/app/pb_kits/playbook/data/menu.yml +4 -3
  5. data/app/pb_kits/playbook/index.js +4 -0
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.html.erb +1 -12
  7. data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +1 -1
  8. data/app/pb_kits/playbook/pb_button/_button_mixins.scss +1 -0
  9. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.jsx +3 -3
  10. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.scss +82 -90
  11. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_dark.scss +57 -0
  12. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar_mixins.scss +27 -0
  13. data/app/pb_kits/playbook/pb_button_toolbar/button_toolbar.rb +4 -2
  14. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.html.erb +17 -7
  15. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_default.jsx +32 -9
  16. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.html.erb +18 -7
  17. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_secondary.jsx +37 -9
  18. data/app/pb_kits/playbook/pb_button_toolbar/docs/example.yml +3 -7
  19. data/app/pb_kits/playbook/pb_button_toolbar/docs/index.js +0 -2
  20. data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +1 -2
  21. data/app/pb_kits/playbook/pb_date_picker/_date_picker.jsx +1 -3
  22. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +3 -2
  23. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.js +34 -32
  24. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.html.erb +1 -2
  25. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.jsx +1 -2
  26. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -0
  27. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.html.erb +4 -0
  28. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_format.jsx +4 -0
  29. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.html.erb +9 -9
  30. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.jsx +8 -8
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_input.md +3 -1
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.html.erb +1 -0
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_range.jsx +1 -0
  34. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -4
  35. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -2
  36. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.html.erb +8 -14
  37. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.jsx +122 -39
  38. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.scss +33 -2
  39. data/app/pb_kits/playbook/pb_date_range_inline/date_range_inline.rb +44 -9
  40. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.html.erb +14 -1
  41. data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default.jsx +45 -1
  42. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.html.erb +1 -8
  43. data/app/pb_kits/playbook/pb_distribution_bar/distribution_bar.rb +7 -0
  44. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.html.erb +3 -2
  45. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.jsx +29 -15
  46. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.scss +10 -0
  47. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.html.erb +21 -0
  48. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close.jsx +38 -0
  49. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.html.erb +2 -1
  50. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default.jsx +1 -2
  51. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +1 -1
  52. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +1 -1
  53. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.html.erb +1 -1
  54. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_dark.jsx +1 -1
  55. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +2 -0
  56. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/index.js +1 -0
  57. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/fixed_confirmation_toast.rb +7 -1
  58. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/index.js +18 -0
  59. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +9 -6
  60. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
  61. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +3 -3
  62. data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +3 -3
  63. data/app/pb_kits/playbook/pb_form/form_builder/checkbox_field.rb +7 -2
  64. data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +1 -0
  65. data/app/pb_kits/playbook/pb_line_graph/_line_graph.html.erb +1 -13
  66. data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +1 -1
  67. data/app/pb_kits/playbook/pb_person_contact/_person_contact.jsx +7 -6
  68. data/app/pb_kits/playbook/pb_person_contact/docs/_person_contact_with_wrong_numbers.jsx +1 -0
  69. data/app/pb_kits/playbook/pb_popover/_popover.scss +6 -4
  70. data/app/pb_kits/playbook/pb_popover/index.js +3 -1
  71. data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +3 -0
  72. data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +168 -33
  73. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +3 -1
  74. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.jsx +10 -8
  75. data/app/pb_kits/playbook/pb_progress_step/docs/_description.md +1 -1
  76. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.html.erb +14 -16
  77. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_default.jsx +6 -3
  78. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.html.erb +17 -1
  79. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker.jsx +17 -1
  80. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_vertical.jsx +10 -3
  81. data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +11 -1
  82. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +1 -1
  83. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.html.erb +34 -0
  84. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.jsx +68 -0
  85. data/app/pb_kits/playbook/pb_table/docs/_table_action_middle.md +2 -0
  86. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.html.erb +61 -0
  87. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.jsx +89 -0
  88. data/app/pb_kits/playbook/pb_table/docs/_table_icon_buttons.md +1 -0
  89. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.html.erb +34 -0
  90. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.jsx +68 -0
  91. data/app/pb_kits/playbook/pb_table/docs/_table_one_action.md +2 -0
  92. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.html.erb +43 -0
  93. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.jsx +80 -0
  94. data/app/pb_kits/playbook/pb_table/docs/_table_two_actions.md +1 -0
  95. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.html.erb +34 -0
  96. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.jsx +63 -0
  97. data/app/pb_kits/playbook/pb_table/docs/_table_two_plus_actions.md +1 -0
  98. data/app/pb_kits/playbook/pb_table/docs/example.yml +12 -0
  99. data/app/pb_kits/playbook/pb_table/docs/index.js +6 -0
  100. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.scss +5 -5
  101. data/app/pb_kits/playbook/pb_title_detail/_title_detail.jsx +4 -4
  102. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_options.html.erb +10 -0
  103. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +1 -0
  104. data/app/pb_kits/playbook/pb_toggle/toggle.rb +5 -2
  105. data/app/pb_kits/playbook/pb_typeahead/_typeahead.html.erb +24 -20
  106. data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +19 -1
  107. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +8 -1
  108. data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +21 -13
  109. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_default.html.erb +1 -1
  110. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_context_dark.html.erb +1 -1
  111. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.html.erb +25 -0
  112. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.jsx +0 -3
  113. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.md +8 -0
  114. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.html.erb +30 -0
  115. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.md +11 -0
  116. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.html.erb +25 -0
  117. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.jsx +0 -3
  118. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_users.md +1 -0
  119. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +3 -0
  120. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +24 -1
  121. data/app/pb_kits/playbook/react_rails_kits.js +6 -0
  122. data/app/pb_kits/playbook/tokens/_colors.scss +22 -23
  123. data/app/pb_kits/playbook/tokens/_typography.scss +4 -4
  124. data/app/pb_kits/playbook/tokens/index.scss +11 -0
  125. data/app/pb_kits/playbook/vendor.js +8 -0
  126. data/lib/playbook/engine.rb +1 -0
  127. data/lib/playbook/version.rb +1 -1
  128. metadata +32 -86
  129. data/app/controllers/playbook/guides_controller.rb +0 -11
  130. data/app/controllers/playbook/pages_controller.rb +0 -99
  131. data/app/controllers/playbook/samples_controller.rb +0 -40
  132. data/app/pb_kits/playbook/packs/application.js +0 -55
  133. data/app/pb_kits/playbook/packs/examples.js +0 -182
  134. data/app/pb_kits/playbook/packs/main.scss +0 -12
  135. data/app/pb_kits/playbook/packs/samples.js +0 -21
  136. data/app/pb_kits/playbook/packs/site_styles/_samples.scss +0 -72
  137. data/app/pb_kits/playbook/packs/site_styles/_scaffold.scss +0 -43
  138. data/app/pb_kits/playbook/packs/site_styles/_site-style.scss +0 -146
  139. data/app/pb_kits/playbook/packs/site_styles/docs/_all.scss +0 -10
  140. data/app/pb_kits/playbook/packs/site_styles/docs/_bg_light_doc_example.scss +0 -7
  141. data/app/pb_kits/playbook/packs/site_styles/docs/_code_snippet.scss +0 -531
  142. data/app/pb_kits/playbook/packs/site_styles/docs/_color_utilities.scss +0 -92
  143. data/app/pb_kits/playbook/packs/site_styles/docs/_flex_examples.scss +0 -15
  144. data/app/pb_kits/playbook/packs/site_styles/docs/_kit_doc.scss +0 -148
  145. data/app/pb_kits/playbook/packs/site_styles/docs/_kits_examples.scss +0 -15
  146. data/app/pb_kits/playbook/packs/site_styles/docs/_markdown.scss +0 -88
  147. data/app/pb_kits/playbook/packs/site_styles/docs/_spacing_tokens.scss +0 -72
  148. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.html.erb +0 -11
  149. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical.jsx +0 -29
  150. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.html.erb +0 -11
  151. data/app/pb_kits/playbook/pb_button_toolbar/docs/_button_toolbar_vertical_secondary.jsx +0 -34
  152. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.html.erb +0 -4
  153. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.jsx +0 -13
  154. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_allow_input.md +0 -1
  155. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.html.erb +0 -4
  156. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_dark.jsx +0 -13
  157. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_summary.jsx +0 -45
  158. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_summary.jsx +0 -27
  159. data/app/views/layouts/playbook/_mobile_hamburger.html.erb +0 -2
  160. data/app/views/layouts/playbook/_nav.html.erb +0 -37
  161. data/app/views/layouts/playbook/_sidebar.html.erb +0 -51
  162. data/app/views/layouts/playbook/application.html.erb +0 -26
  163. data/app/views/layouts/playbook/fullscreen.html.slim +0 -10
  164. data/app/views/layouts/playbook/grid.html.slim +0 -10
  165. data/app/views/layouts/playbook/samples.html.erb +0 -19
  166. data/app/views/playbook/guides/create_kit.html.slim +0 -16
  167. data/app/views/playbook/guides/create_kit/_file_naming.html.md +0 -2
  168. data/app/views/playbook/guides/create_kit/_generator.html.md +0 -6
  169. data/app/views/playbook/guides/create_kit/_kit_examples.html.md +0 -2
  170. data/app/views/playbook/guides/create_kit/_kit_rails.html.md +0 -2
  171. data/app/views/playbook/guides/create_kit/_kit_react.html.md +0 -2
  172. data/app/views/playbook/guides/create_kit/_layout.html.md +0 -2
  173. data/app/views/playbook/guides/create_kit/_view_objects.html.md +0 -2
  174. data/app/views/playbook/guides/create_kit/_writing_sass.md +0 -10
  175. data/app/views/playbook/guides/use_nitro.html.slim +0 -6
  176. data/app/views/playbook/guides/use_nitro/_local.html.md +0 -2
  177. data/app/views/playbook/guides/use_nitro/_nitro_components.html.md +0 -2
  178. data/app/views/playbook/guides/use_nitro/_versions.html.md +0 -2
  179. data/app/views/playbook/pages/fullscreen.html.slim +0 -10
  180. data/app/views/playbook/pages/grid.html.slim +0 -2
  181. data/app/views/playbook/pages/home.html.slim +0 -4
  182. data/app/views/playbook/pages/kit_category_show.html.erb +0 -14
  183. data/app/views/playbook/pages/kit_show.html.erb +0 -33
  184. data/app/views/playbook/pages/kits.html.erb +0 -12
  185. data/app/views/playbook/pages/principals/_getting_started.html.md +0 -30
  186. data/app/views/playbook/pages/principles.html.slim +0 -3
  187. data/app/views/playbook/pages/tokens.html.slim +0 -15
  188. data/app/views/playbook/pages/tokens/_pb_doc_spacing.html.slim +0 -61
  189. data/app/views/playbook/pages/utilities.html.slim +0 -116
  190. data/app/views/playbook/pages/utilities/_pb_doc_color.html.slim +0 -15
  191. data/app/views/playbook/samples/collection_detail/index.html.erb +0 -169
  192. data/app/views/playbook/samples/collection_detail/index.jsx +0 -372
  193. data/app/views/playbook/samples/dashboards/index.html.erb +0 -81
  194. data/app/views/playbook/samples/dashboards/index.jsx +0 -130
  195. data/app/views/playbook/samples/filter_table/index.html.erb +0 -348
  196. data/app/views/playbook/samples/filter_table/index.jsx +0 -433
  197. data/app/views/playbook/samples/registration/index.html.erb +0 -316
  198. data/app/views/playbook/samples/registration/index.jsx +0 -476
  199. data/app/views/playbook/samples/sample_show.html.erb +0 -36
  200. data/lib/generators/kit/USAGE +0 -5
  201. data/lib/generators/kit/kit_generator.rb +0 -95
  202. data/lib/generators/kit/templates/kit_example_rails.erb.tt +0 -1
  203. data/lib/generators/kit/templates/kit_example_react.erb.tt +0 -10
  204. data/lib/generators/kit/templates/kit_example_yml.erb.tt +0 -9
  205. data/lib/generators/kit/templates/kit_html.erb.tt +0 -7
  206. data/lib/generators/kit/templates/kit_js.erb.tt +0 -1
  207. data/lib/generators/kit/templates/kit_jsx.erb.tt +0 -68
  208. data/lib/generators/kit/templates/kit_ruby.erb.tt +0 -11
  209. data/lib/generators/kit/templates/kit_ruby_spec.erb.tt +0 -11
  210. data/lib/generators/kit/templates/kit_scss.erb +0 -3
  211. data/lib/tasks/pb_release.rake +0 -77
  212. data/lib/tasks/playbook_tasks.rake +0 -26
@@ -3,6 +3,7 @@
3
3
  id: object.id,
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
- <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon" }) %>
7
- <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_fixed_confirmation_toast_text" }) if object.show_text?%>
6
+ <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
7
+ <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_fixed_confirmation_toast_text" }) if object.show_text? %>
8
+ <%= pb_rails("icon", props: { icon: "times", classname: "pb_icon" }) if object.closeable %>
8
9
  <% end %>
@@ -1,6 +1,6 @@
1
1
  /* @flow */
2
2
 
3
- import React from 'react'
3
+ import React, { useState } from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { Icon, Title } from '../'
6
6
  import { globalProps } from '../utilities/globalProps.js'
@@ -14,6 +14,7 @@ const iconMap = {
14
14
 
15
15
  type FixedConfirmationToastProps = {
16
16
  className?: string,
17
+ closeable?: boolean,
17
18
  data?: string,
18
19
  id?: string,
19
20
  status?: "success" | "error" | "neutral" | "tip",
@@ -21,7 +22,8 @@ type FixedConfirmationToastProps = {
21
22
  }
22
23
 
23
24
  const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
24
- const { className, status = 'neutral', text } = props
25
+ const [showToast, toggleToast] = useState(true)
26
+ const { className, closeable = false, status = 'neutral', text } = props
25
27
  const css = classnames(
26
28
  `pb_fixed_confirmation_toast_kit_${status}`,
27
29
  globalProps(props),
@@ -30,20 +32,32 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
30
32
  const icon = iconMap[status]
31
33
 
32
34
  return (
33
- <div className={css}>
34
- <If condition={icon}>
35
- <Icon
36
- className="pb_icon"
37
- fixed_width
38
- icon={icon}
35
+ <If condition={showToast}>
36
+ <div
37
+ className={css}
38
+ onClick={closeable && (() => toggleToast(false))}
39
+ >
40
+ <If condition={icon}>
41
+ <Icon
42
+ className="pb_icon"
43
+ fixedWidth
44
+ icon={icon}
45
+ />
46
+ </If>
47
+ <Title
48
+ className="pb_fixed_confirmation_toast_text"
49
+ size={4}
50
+ text={text}
39
51
  />
40
- </If>
41
- <Title
42
- className="pb_fixed_confirmation_toast_text"
43
- size={4}
44
- text={text}
45
- />
46
- </div>
52
+ <If condition={closeable}>
53
+ <Icon
54
+ className="pb_icon"
55
+ fixedWidth={false}
56
+ icon="times"
57
+ />
58
+ </If>
59
+ </div>
60
+ </If>
47
61
  )
48
62
  }
49
63
 
@@ -20,6 +20,16 @@ $confirmation_toast_colors: (
20
20
  border-radius: $border_rad_mega;
21
21
  box-shadow: $shadow_deeper;
22
22
 
23
+ .fa-times {
24
+ cursor: pointer;
25
+ opacity: 0.5;
26
+ position: relative;
27
+ right: -8px;
28
+ }
29
+ &:hover .fa-times {
30
+ opacity: 1;
31
+ }
32
+
23
33
  @each $color_name, $color_value in $confirmation_toast_colors {
24
34
  &[class*=_#{$color_name}] {
25
35
  background: $color_value;
@@ -0,0 +1,21 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ text: "Error Message",
3
+ status: "error",
4
+ closeable: true
5
+ })%>
6
+
7
+ <br><br>
8
+
9
+ <%= pb_rails("fixed_confirmation_toast", props: {
10
+ text: "Items Successfully Moved",
11
+ status: "success",
12
+ closeable: true
13
+ })%>
14
+
15
+ <br><br>
16
+
17
+ <%= pb_rails("fixed_confirmation_toast", props: {
18
+ text: "Scan to Assign Selected Items",
19
+ status: "neutral",
20
+ closeable: true
21
+ })%>
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import { FixedConfirmationToast } from '../../'
3
+
4
+ const FixedConfirmationToastClose = () => {
5
+ return (
6
+ <div>
7
+ <div>
8
+ <FixedConfirmationToast
9
+ closeable
10
+ status="error"
11
+ text="Error Message"
12
+ />
13
+ </div>
14
+
15
+ <br />
16
+
17
+ <div>
18
+ <FixedConfirmationToast
19
+ closeable
20
+ status="success"
21
+ text="Items Successfully Moved"
22
+ />
23
+ </div>
24
+
25
+ <br />
26
+
27
+ <div>
28
+ <FixedConfirmationToast
29
+ closeable
30
+ status="neutral"
31
+ text="Scan to Assign Selected Items"
32
+ />
33
+ </div>
34
+ </div>
35
+ )
36
+ }
37
+
38
+ export default FixedConfirmationToastClose
@@ -1,6 +1,7 @@
1
1
  <%= pb_rails("fixed_confirmation_toast", props: {
2
2
  text: "Error Message",
3
- status: "error"
3
+ status: "error",
4
+ closeable: true
4
5
  })%>
5
6
 
6
7
  <br><br>
@@ -6,12 +6,12 @@ const FixedConfirmationToastDefault = () => {
6
6
  <div>
7
7
  <div>
8
8
  <FixedConfirmationToast
9
+ closeable
9
10
  status="error"
10
11
  text="Error Message"
11
12
  />
12
13
  </div>
13
14
 
14
- <br />
15
15
  <br />
16
16
 
17
17
  <div>
@@ -21,7 +21,6 @@ const FixedConfirmationToastDefault = () => {
21
21
  />
22
22
  </div>
23
23
 
24
- <br />
25
24
  <br />
26
25
 
27
26
  <div>
@@ -1,4 +1,4 @@
1
1
  <%= pb_rails("fixed_confirmation_toast", props: {
2
- text: "Scan to Assign Selected Items.\nClick X to close at any time",
2
+ text: "Scan to Assign Selected Items.\nClick here to generate report",
3
3
  status: "tip",
4
4
  }) %>
@@ -6,7 +6,7 @@ const FixedConfirmationToastMultiLine = () => {
6
6
  <div>
7
7
  <FixedConfirmationToast
8
8
  status="tip"
9
- text={'Scan to Assign Selected Items.\n Click X to close at any time'}
9
+ text={'Scan to Assign Selected Items.\n Click here to generate report'}
10
10
  />
11
11
  </div>
12
12
  )
@@ -1,5 +1,5 @@
1
1
  <%= pb_rails("fixed_confirmation_toast", props: {
2
2
  dark: true,
3
- text: "Scan to Assign Selected Items.\nClick X to close at any time",
3
+ text: "Scan to Assign Selected Items.\nClick here to generate report.",
4
4
  status: "tip",
5
5
  }) %>
@@ -7,7 +7,7 @@ const FixedConfirmationToastMultiLineDark = () => {
7
7
  <FixedConfirmationToast
8
8
  dark
9
9
  status="tip"
10
- text={'Scan to Assign Selected Items.\n Click X to close at any time'}
10
+ text={'Scan to Assign Selected Items.\n Click here to generate report'}
11
11
  />
12
12
  </div>
13
13
  )
@@ -3,12 +3,14 @@ examples:
3
3
  rails:
4
4
  - fixed_confirmation_toast_default: Default
5
5
  - fixed_confirmation_toast_multi_line: Multi Line
6
+ - fixed_confirmation_toast_close: Click to Close
6
7
  - fixed_confirmation_toast_dark: Dark
7
8
  - fixed_confirmation_toast_multi_line_dark: Multi Line Dark
8
9
 
9
10
  react:
10
11
  - fixed_confirmation_toast_default: Default
11
12
  - fixed_confirmation_toast_multi_line: Multi Line
13
+ - fixed_confirmation_toast_close: Click to Close
12
14
  - fixed_confirmation_toast_dark: Dark
13
15
  - fixed_confirmation_toast_multi_line_dark: Multi Line Dark
14
16
 
@@ -1,4 +1,5 @@
1
1
  export { default as FixedConfirmationToastDefault } from './_fixed_confirmation_toast_default.jsx'
2
2
  export { default as FixedConfirmationToastMultiLine } from './_fixed_confirmation_toast_multi_line.jsx'
3
+ export { default as FixedConfirmationToastClose } from './_fixed_confirmation_toast_close.jsx'
3
4
  export { default as FixedConfirmationToastDark } from './_fixed_confirmation_toast_dark.jsx'
4
5
  export { default as FixedConfirmationToastMultiLineDark } from './_fixed_confirmation_toast_multi_line_dark.jsx'
@@ -11,11 +11,17 @@ module Playbook
11
11
  values: %w[success error neutral tip],
12
12
  default: "neutral"
13
13
  prop :text, type: Playbook::Props::String
14
+ prop :closeable, type: Playbook::Props::Boolean,
15
+ default: false
14
16
 
15
17
  def show_text?
16
18
  text.present?
17
19
  end
18
20
 
21
+ def close_class
22
+ closeable.present? ? " remove_toast" : ""
23
+ end
24
+
19
25
  def icon_value
20
26
  case status
21
27
  when "success"
@@ -30,7 +36,7 @@ module Playbook
30
36
  end
31
37
 
32
38
  def classname
33
- generate_classname("pb_fixed_confirmation_toast_kit", status)
39
+ generate_classname("pb_fixed_confirmation_toast_kit", status) + close_class
34
40
  end
35
41
  end
36
42
  end
@@ -0,0 +1,18 @@
1
+ import PbEnhancedElement from '../pb_enhanced_element'
2
+
3
+ export default class PbFixedConfirmationToast extends PbEnhancedElement {
4
+ static get selector() {
5
+ return '.remove_toast'
6
+ }
7
+
8
+ connect() {
9
+ this.self = this.element
10
+ this.self.addEventListener('click', () => {
11
+ this.removeToast(this.self)
12
+ })
13
+ }
14
+
15
+ removeToast(elem) {
16
+ elem.parentNode.removeChild(elem)
17
+ }
18
+ }
@@ -25,12 +25,15 @@
25
25
  <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
26
26
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
27
27
  <%= form.check_box :example_checkbox,
28
- data: { field1: "value1", field2: "value2" },
29
- props: { text: "Example Checkbox", label: true },
30
- id: "checkbox-id",
31
- name: "checkbox-name",
32
- class: "checkbox-class" %>
33
- <%= form.date_picker :example_date_picker1, props: { default_date: "blank" } %>
28
+ data: { field1: "value1", field2: "value2" },
29
+ props: { text: "Example Checkbox", label: true },
30
+ checked_value: "yes",
31
+ unchecked_value: "no",
32
+ id: "checkbox-id",
33
+ name: "checkbox-name",
34
+ class: "checkbox-class"
35
+ %>
36
+ <%= form.date_picker :example_date_picker_1, props: { default_date: "blank", label: true } %>
34
37
 
35
38
  <%= form.actions do |action| %>
36
39
  <%= action.submit %>
@@ -28,7 +28,7 @@
28
28
  <%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true, blank_selection: "Select One...", required: true } %>
29
29
  <%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true, blank_selection: "Select One...", required: true } %>
30
30
  <%= form.check_box :example_checkbox, props: { text: "Example Checkbox", label: true, required: true } %>
31
- <%= form.date_picker :example_date_picker2, props: { default_date: 'blank', required: true } %>
31
+ <%= form.date_picker :example_date_picker_2, props: { default_date: 'blank', label: true, required: true } %>
32
32
 
33
33
  <%= form.actions do |action| %>
34
34
  <%= action.submit %>
@@ -14,8 +14,8 @@
14
14
  :example_text_area,
15
15
  :example_select_field,
16
16
  :example_collection_select_field,
17
- :example_checkbox_field
18
- :example_date_picker_field1
17
+ :example_checkbox_field,
18
+ :example_date_picker_field_1
19
19
 
20
20
 
21
21
  def self.model_name
@@ -52,7 +52,7 @@
52
52
  <%= form.select :example_select_field, [["Yes", 1], ["No", 2]], props: { label: true } %>
53
53
  <%= form.collection_select :example_collection_select_field, example_collection, :value, :name, props: { label: true } %>
54
54
  <%= form.check_box :example_checkbox_field, props: { text: "Example Checkbox", label: true } %>
55
- <%= form.date_picker :example_date_picker_field1, props: { default_date: 'blank' } %>
55
+ <%= form.date_picker :example_date_picker_field_1, props: { default_date: 'blank', label: true } %>
56
56
 
57
57
  <%= form.actions do |action| %>
58
58
  <%= action.submit %>
@@ -14,8 +14,8 @@
14
14
  :example_text_area,
15
15
  :example_select_field,
16
16
  :example_collection_select_field,
17
- :example_checkbox_field
18
- :example_date_picker_field2
17
+ :example_checkbox_field,
18
+ :example_date_picker_field_2
19
19
 
20
20
 
21
21
  def self.model_name
@@ -52,7 +52,7 @@
52
52
  <%= form.select :example_select_field, [["Yes", 1], ["No", 2]], props: { required: true, blank_selection: "Select One...", label: true } %>
53
53
  <%= form.collection_select :example_collection_select_field, example_collection, :value, :name, props: { required: true, blank_selection: "Select One...", label: true } %>
54
54
  <%= form.check_box :example_checkbox_field, props: { text: "Example Checkbox", label: true, required: true } %>
55
- <%= form.date_picker :example_date_picker_field2, props: { default_date: 'blank', required: true } %>
55
+ <%= form.date_picker :example_date_picker_field_2, props: { default_date: 'blank', label: true, required: true } %>
56
56
 
57
57
  <%= form.actions do |action| %>
58
58
  <%= action.submit %>
@@ -4,13 +4,18 @@ module Playbook
4
4
  module PbForm
5
5
  module FormBuilder
6
6
  module CheckboxField
7
- def check_box(name, props: {}, **options, &block)
7
+ def check_box(name, props: {}, **options)
8
8
  label_text = @template.label(@object_name, name) if props[:label] == true
9
9
  options[:required] = true if props[:required]
10
10
  props[:margin_bottom] = "sm"
11
11
  props[:form_spacing] = true
12
12
 
13
- input = super(name, **options, &block)
13
+ checked_value = options[:checked_value]
14
+ unchecked_value = options[:unchecked_value]
15
+ options.delete(:checked_value)
16
+ options.delete(:unchecked_value)
17
+
18
+ input = super(name, options, checked_value, unchecked_value)
14
19
 
15
20
  if props[:label]
16
21
  @template.pb_rails("caption", props: { text: label_text, margin_bottom: "xs" }) +
@@ -8,6 +8,7 @@ module Playbook
8
8
  prefix = @object_name
9
9
  html_attribute_name = "#{prefix}[#{name}]"
10
10
  html_id = "#{prefix}_#{name}"
11
+ props[:label] = @template.label(@object_name, name) if props[:label] == true
11
12
 
12
13
  props[:name] = html_attribute_name
13
14
  props[:picker_id] = html_id
@@ -1,13 +1 @@
1
- <%= content_tag(:div, "",
2
- aria: object.aria,
3
- id: object.id,
4
- data: object.data,
5
- class: object.classname
6
- ) %>
7
- <% content_for :pb_js do %>
8
- <%= javascript_tag do %>
9
- window.addEventListener('DOMContentLoaded', function() {
10
- new pbChart('.selector', <%= object.chart_options %>)
11
- })
12
- <% end %>
13
- <% end %>
1
+ <%= react_component('LineGraph', object.chart_options) %>
@@ -44,7 +44,7 @@ module Playbook
44
44
  legend: legend,
45
45
  toggleLegendClick: toggle_legend_click,
46
46
  height: height,
47
- }.to_json.html_safe
47
+ }
48
48
  end
49
49
 
50
50
  def classname
@@ -77,22 +77,23 @@ const PersonContact = (props: PersonContactProps) => {
77
77
  contactDetail={contactObject.contactDetail}
78
78
  contactType={contactObject.contactType}
79
79
  contactValue={contactObject.contactValue}
80
- key={index}
80
+ key={`valid-contact-${index}`}
81
81
  />
82
- ))}
82
+ ))}
83
83
  {wrongContacts().map((contactObject, index) => (
84
- <>
84
+ <div key={`wrong-contact-caption-wrapper-${index}`}>
85
85
  <Caption
86
86
  className="wrong_numbers"
87
+ key={`wrong-contact-caption-${index}`}
87
88
  text="wrong number"
88
89
  />
89
90
  <Contact
90
91
  contactType={contactObject.contactType}
91
92
  contactValue={contactObject.contactValue}
92
- key={index}
93
+ key={`wrong-contact-${index}`}
93
94
  />
94
- </>
95
- ))}
95
+ </div>
96
+ ))}
96
97
  </div>
97
98
  )
98
99
  }