playbook_ui 14.5.0 → 14.6.0.pre.alpha.PBNTR5554223

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +25 -7
  3. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +72 -0
  4. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.md +5 -0
  5. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +2 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -0
  7. data/app/pb_kits/playbook/pb_advanced_table/index.js +60 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -9
  9. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -9
  10. data/app/pb_kits/playbook/pb_currency/_currency.tsx +16 -6
  11. data/app/pb_kits/playbook/pb_currency/currency.rb +38 -11
  12. data/app/pb_kits/playbook/pb_currency/currency.test.js +35 -0
  13. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +7 -0
  14. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +18 -0
  15. data/app/pb_kits/playbook/pb_currency/docs/example.yml +3 -1
  16. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -0
  17. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.html.erb +30 -7
  18. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_loading.md +0 -2
  19. data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +84 -3
  20. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +28 -5
  21. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +45 -0
  22. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +1 -0
  23. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.html.erb +9 -0
  24. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_separators_hidden.jsx +33 -0
  25. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.html.erb +10 -0
  26. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.jsx +34 -0
  27. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -0
  28. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +5 -0
  29. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +3 -0
  30. data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +10 -1
  31. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
  32. data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
  33. data/app/pb_kits/playbook/pb_filter/Filter/FilterDouble.tsx +2 -0
  34. data/app/pb_kits/playbook/pb_filter/Filter/FilterSingle.tsx +2 -0
  35. data/app/pb_kits/playbook/pb_filter/Filter/FiltersPopover.tsx +4 -1
  36. data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +4 -2
  37. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
  38. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.html.erb +41 -0
  39. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props.jsx +71 -0
  40. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_rails.md +1 -0
  41. data/app/pb_kits/playbook/pb_filter/docs/_filter_popover_props_react.md +1 -0
  42. data/app/pb_kits/playbook/pb_filter/docs/example.yml +3 -0
  43. data/app/pb_kits/playbook/pb_filter/docs/index.js +1 -0
  44. data/app/pb_kits/playbook/pb_filter/filter.html.erb +2 -2
  45. data/app/pb_kits/playbook/pb_filter/filter.rb +2 -0
  46. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.html.erb +39 -0
  47. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_loading.md +1 -0
  48. data/app/pb_kits/playbook/pb_form/docs/example.yml +1 -0
  49. data/app/pb_kits/playbook/pb_form/form.rb +2 -0
  50. data/app/pb_kits/playbook/pb_form/formHelper.js +27 -0
  51. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +9 -1
  52. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +19 -0
  53. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +27 -0
  54. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
  55. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  56. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  57. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +211 -227
  58. data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +5 -0
  59. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
  60. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +93 -0
  61. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +1 -0
  62. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +105 -0
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +1 -0
  64. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +106 -0
  65. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +1 -0
  66. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +4 -0
  67. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -0
  68. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +149 -0
  69. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.scss +169 -65
  70. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.test.js +5 -5
  71. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +15 -9
  72. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.html.erb +336 -0
  73. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_size.jsx +97 -0
  74. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +2 -0
  75. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/index.js +1 -0
  76. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.html.erb +28 -6
  77. data/app/pb_kits/playbook/pb_multiple_users_stacked/multiple_users_stacked.rb +31 -1
  78. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.scss +86 -18
  79. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +15 -6
  80. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_preferred_countries.md +1 -1
  81. data/app/pb_kits/playbook/pb_phone_number_input/intlTelInput.scss +849 -931
  82. data/app/pb_kits/playbook/pb_phone_number_input/types.d.ts +4 -1
  83. data/app/pb_kits/playbook/pb_popover/_popover.tsx +5 -1
  84. data/app/pb_kits/playbook/pb_popover/docs/_popover_default.html.erb +1 -1
  85. data/app/pb_kits/playbook/pb_popover/popover.rb +3 -1
  86. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +4 -1
  87. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +3 -1
  88. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +3 -1
  89. data/dist/chunks/{_typeahead-BYw0HEgO.js → _typeahead-BV_n6U5W.js} +2 -2
  90. data/dist/chunks/_weekday_stacked-DTjG8w_B.js +45 -0
  91. data/dist/chunks/{lib-CEpcaI8y.js → lib-D-mTv-kp.js} +1 -1
  92. data/dist/chunks/{pb_form_validation-D9zkwt2b.js → pb_form_validation-BkWGwJsl.js} +1 -1
  93. data/dist/chunks/vendor.js +1 -1
  94. data/dist/playbook-doc.js +1 -1
  95. data/dist/playbook-rails-react-bindings.js +1 -1
  96. data/dist/playbook-rails.js +1 -1
  97. data/dist/playbook.css +1 -1
  98. data/lib/playbook/pb_doc_helper.rb +5 -5
  99. data/lib/playbook/pb_forms_helper.rb +3 -1
  100. data/lib/playbook/version.rb +2 -2
  101. metadata +40 -9
  102. data/dist/chunks/_weekday_stacked-DumiyWjh.js +0 -45
@@ -0,0 +1,27 @@
1
+ const formHelper = () => {
2
+ const loadingForm = document.querySelector(".pb_form_loading")
3
+ if (loadingForm) {
4
+ loadingForm.addEventListener("submit", function(event) {
5
+ const submitButton = event['submitter'];
6
+ const cancelButton = event['target'].querySelector('button[type="reset"]');
7
+
8
+ if (submitButton) {
9
+ let currentClass = submitButton.className;
10
+ let newClass = currentClass.replace("_enabled", "_disabled_loading");
11
+
12
+ let cancelClass = cancelButton ? cancelButton.className : "";
13
+ let newCancelClass = cancelClass.replace("_enabled", "_disabled");
14
+
15
+ submitButton.disabled = true;
16
+ submitButton.className = newClass;
17
+
18
+ if (cancelButton) {
19
+ cancelButton.disabled = true;
20
+ cancelButton.className = newCancelClass;
21
+ }
22
+ }
23
+ });
24
+ }
25
+ };
26
+
27
+ export default formHelper;
@@ -47,9 +47,13 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
47
47
 
48
48
  const iconClass = icon ? "_icon" : ""
49
49
  const closeIconSize = size === "small" ? "xs" : "sm"
50
+
51
+ const filteredProps: FormPillProps = {...props}
52
+ delete filteredProps.truncate
53
+
50
54
  const css = classnames(
51
55
  `pb_form_pill_kit_${color}${iconClass}`,
52
- globalProps(props),
56
+ globalProps(filteredProps),
53
57
  className,
54
58
  size === 'small' ? 'small' : null,
55
59
  textTransform,
@@ -77,6 +81,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
77
81
  className="pb_form_pill_text"
78
82
  size={4}
79
83
  text={name}
84
+ truncate={props.truncate}
80
85
  />
81
86
  </>
82
87
  )}
@@ -92,6 +97,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
92
97
  className="pb_form_pill_text"
93
98
  size={4}
94
99
  text={name}
100
+ truncate={props.truncate}
95
101
  />
96
102
  <Icon
97
103
  className="pb_form_pill_icon"
@@ -111,6 +117,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
111
117
  className="pb_form_pill_tag"
112
118
  size={4}
113
119
  text={text}
120
+ truncate={props.truncate}
114
121
  />
115
122
  </>
116
123
  )}
@@ -119,6 +126,7 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
119
126
  className="pb_form_pill_tag"
120
127
  size={4}
121
128
  text={text}
129
+ truncate={props.truncate}
122
130
  />
123
131
  )}
124
132
  <div
@@ -0,0 +1,19 @@
1
+ <%
2
+ names = [
3
+ { label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
4
+ { label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
5
+ { label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
6
+ { label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
7
+ { label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
8
+ ]
9
+ %>
10
+
11
+ <%= pb_rails("typeahead", props: {
12
+ html_options: { style: { maxWidth: "240px" }},
13
+ id: "typeahead-form-pill",
14
+ is_multi: true,
15
+ options: names,
16
+ label: "Names",
17
+ pills: true,
18
+ truncate: 1,
19
+ }) %>
@@ -0,0 +1,27 @@
1
+ import React from 'react'
2
+ import Typeahead from '../../pb_typeahead/_typeahead'
3
+
4
+ const names = [
5
+ { label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
6
+ { label: 'Isabella Anastasia Wellington', value: 'Isabella Anastasia Wellington' },
7
+ { label: 'Christopher Maximilian Harrington', value: 'Christopher Maximilian Harrington' },
8
+ { label: 'Elizabeth Seraphina Kensington', value: 'Elizabeth Seraphina Kensington' },
9
+ { label: 'Theodore Jonathan Abernathy', value: 'Theodore Jonathan Abernathy' },
10
+ ]
11
+
12
+ const FormPillTruncatedText = (props) => {
13
+ return (
14
+ <>
15
+ <Typeahead
16
+ htmlOptions={{ style: { maxWidth: "240px" }}}
17
+ isMulti
18
+ label="Names"
19
+ options={names}
20
+ truncate={1}
21
+ {...props}
22
+ />
23
+ </>
24
+ )
25
+ }
26
+
27
+ export default FormPillTruncatedText
@@ -0,0 +1 @@
1
+ For pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
@@ -3,6 +3,7 @@ examples:
3
3
  rails:
4
4
  - form_pill_user: Form Pill User
5
5
  - form_pill_size: Form Pill Size
6
+ - form_pill_truncated_text: Truncated Text
6
7
  - form_pill_tag: Form Pill Tag
7
8
  - form_pill_example: Example
8
9
  - form_pill_icon: Form Pill Icon
@@ -11,6 +12,7 @@ examples:
11
12
  react:
12
13
  - form_pill_user: Form Pill User
13
14
  - form_pill_size: Form Pill Size
15
+ - form_pill_truncated_text: Truncated Text
14
16
  - form_pill_tag: Form Pill Tag
15
17
  - form_pill_example: Example
16
18
  - form_pill_icon: Form Pill Icon
@@ -4,3 +4,4 @@ export { default as FormPillTag } from './_form_pill_tag.jsx'
4
4
  export { default as FormPillExample } from './_form_pill_example.jsx'
5
5
  export { default as FormPillIcon } from './_form_pill_icon.jsx'
6
6
  export { default as FormPillColors } from './_form_pill_colors.jsx'
7
+ export { default as FormPillTruncatedText } from './_form_pill_truncated_text.jsx'