playbook_ui 14.11.1.pre.alpha.responsivetablerails5364 → 14.12.0.pre.alpha.PLAY1602lightboxoverlapnitrobug5646

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +2 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +18 -2
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +27 -5
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +17 -2
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +23 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +29 -0
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +61 -4
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +50 -0
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +1 -0
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +1 -0
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +60 -0
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +5 -0
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +78 -0
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +1 -0
  16. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +53 -0
  17. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +1 -0
  18. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +52 -0
  19. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +1 -0
  20. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  21. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +42 -0
  22. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +299 -0
  23. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +5 -0
  24. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +6 -1
  25. data/app/pb_kits/playbook/pb_button/button.html.erb +2 -3
  26. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +1 -6
  27. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +3 -1
  28. data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +3 -0
  29. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +24 -16
  30. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +2 -0
  31. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  32. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +13 -0
  33. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +3 -0
  34. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +1 -0
  35. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +3 -9
  36. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +5 -0
  37. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +38 -0
  38. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +3 -0
  39. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +1 -0
  40. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +145 -183
  41. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +158 -268
  42. data/app/pb_kits/playbook/pb_drawer/context.ts +11 -0
  43. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +38 -0
  44. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +3 -45
  45. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +0 -1
  46. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +9 -16
  47. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +44 -19
  48. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +21 -3
  49. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +16 -21
  50. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +2 -19
  51. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +2 -1
  52. data/app/pb_kits/playbook/pb_drawer/docs/index.js +1 -0
  53. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
  54. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +60 -0
  55. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +21 -0
  56. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  57. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +7 -12
  58. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +9 -14
  59. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +6 -11
  60. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +8 -14
  61. data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +78 -0
  62. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +3 -0
  63. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +7 -0
  64. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +16 -0
  65. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +22 -0
  66. data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +5 -5
  67. data/app/pb_kits/playbook/pb_list/item.html.erb +30 -8
  68. data/app/pb_kits/playbook/pb_list/item.rb +7 -0
  69. data/app/pb_kits/playbook/pb_list/list.html.erb +31 -11
  70. data/app/pb_kits/playbook/pb_list/list.rb +4 -0
  71. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +6 -1
  72. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +4 -0
  73. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -0
  74. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
  75. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +30 -12
  76. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +15 -0
  77. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +24 -0
  78. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +1 -0
  79. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +3 -1
  80. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +1 -0
  81. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +3 -0
  82. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +20 -1
  83. data/app/pb_kits/playbook/pb_radio/_radio.scss +12 -8
  84. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +8 -3
  85. data/app/pb_kits/playbook/pb_select/_select.scss +3 -5
  86. data/app/pb_kits/playbook/pb_select/_select.tsx +5 -1
  87. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  88. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +9 -1
  89. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +4 -1
  90. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +4 -1
  91. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +17 -3
  92. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +3 -0
  93. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +11 -4
  94. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +3 -0
  95. data/app/pb_kits/playbook/pb_table/_table.tsx +2 -3
  96. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +74 -0
  97. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +3 -0
  98. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  99. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +74 -0
  100. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +3 -0
  101. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +47 -0
  102. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +2 -0
  103. data/app/pb_kits/playbook/pb_table/docs/example.yml +3 -0
  104. data/app/pb_kits/playbook/pb_table/index.ts +187 -88
  105. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +12 -0
  106. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +2 -1
  107. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  108. data/app/pb_kits/playbook/pb_table/table.rb +17 -2
  109. data/app/pb_kits/playbook/pb_table/table_row.html.erb +20 -1
  110. data/app/pb_kits/playbook/pb_table/table_row.rb +5 -0
  111. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +22 -0
  112. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +46 -0
  113. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +3 -0
  114. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +2 -1
  115. data/app/pb_kits/playbook/pb_text_input/index.js +103 -0
  116. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +4 -0
  117. data/app/pb_kits/playbook/pb_text_input/text_input.rb +33 -3
  118. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  119. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +19 -0
  120. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +27 -0
  121. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +1 -0
  122. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  123. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  124. data/dist/chunks/_typeahead-BWwaAo_0.js +36 -0
  125. data/dist/chunks/_weekday_stacked-zyBCd1s8.js +45 -0
  126. data/dist/chunks/{lib-B7sgJtGS.js → lib-kMuhBuU7.js} +2 -2
  127. data/dist/chunks/{pb_form_validation-C5Cc0-1v.js → pb_form_validation-DBJ0wZuS.js} +1 -1
  128. data/dist/chunks/vendor.js +1 -1
  129. data/dist/menu.yml +6 -0
  130. data/dist/playbook-doc.js +1 -1
  131. data/dist/playbook-rails-react-bindings.js +1 -1
  132. data/dist/playbook-rails.js +1 -1
  133. data/dist/playbook.css +1 -1
  134. data/lib/playbook/version.rb +2 -2
  135. metadata +62 -7
  136. data/dist/chunks/_typeahead-BNULwihE.js +0 -36
  137. data/dist/chunks/_weekday_stacked-BKWemDAe.js +0 -45
  138. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible.md → _table_with_collapsible_react.md} +0 -0
@@ -4,6 +4,15 @@
4
4
  module Playbook
5
5
  module PbTextInput
6
6
  class TextInput < Playbook::KitBase
7
+ VALID_MASKS = %w[currency zipCode postalCode ssn].freeze
8
+
9
+ MASK_PATTERNS = {
10
+ "currency" => '^\$\d{1,3}(?:,\d{3})*(?:\.\d{2})?$',
11
+ "zip_code" => '\d{5}',
12
+ "postal_code" => '\d{5}-\d{4}',
13
+ "ssn" => '\d{3}-\d{2}-\d{4}',
14
+ }.freeze
15
+
7
16
  prop :autocomplete, type: Playbook::Props::Boolean,
8
17
  default: true
9
18
  prop :disabled, type: Playbook::Props::Boolean,
@@ -25,6 +34,9 @@ module Playbook
25
34
  prop :add_on, type: Playbook::Props::NestedProps,
26
35
  nested_kit: Playbook::PbTextInput::AddOn
27
36
 
37
+ prop :mask, type: Playbook::Props::String,
38
+ default: nil
39
+
28
40
  def classname
29
41
  default_margin_bottom = margin_bottom.present? ? "" : " mb_sm"
30
42
  generate_classname("pb_text_input_kit") + default_margin_bottom + error_class + inline_class
@@ -46,6 +58,10 @@ module Playbook
46
58
  { dark: dark }.merge(add_on || {})
47
59
  end
48
60
 
61
+ def sanitized_id
62
+ "#{object.id}-sanitized" if id.present?
63
+ end
64
+
49
65
  private
50
66
 
51
67
  def all_input_options
@@ -55,12 +71,13 @@ module Playbook
55
71
  data: validation_data,
56
72
  disabled: disabled,
57
73
  id: input_options.dig(:id) || id,
58
- name: name,
59
- pattern: validation_pattern,
74
+ name: mask.present? ? "" : name,
75
+ pattern: validation_pattern || mask_pattern,
60
76
  placeholder: placeholder,
61
77
  required: required,
62
78
  type: type,
63
79
  value: value,
80
+ mask: mask,
64
81
  }.merge(input_options)
65
82
  end
66
83
 
@@ -75,7 +92,7 @@ module Playbook
75
92
  def validation_data
76
93
  fields = input_options.dig(:data) || {}
77
94
  fields[:message] = validation_message unless validation_message.blank?
78
- fields
95
+ mask ? fields.merge(pb_input_mask: true) : fields
79
96
  end
80
97
 
81
98
  def error_class
@@ -85,6 +102,19 @@ module Playbook
85
102
  def inline_class
86
103
  inline ? " inline" : ""
87
104
  end
105
+
106
+ def mask_data
107
+ return {} unless mask
108
+ raise ArgumentError, "mask must be one of: #{VALID_MASKS.join(', ')}" unless VALID_MASKS.include?(mask)
109
+
110
+ { mask: mask }
111
+ end
112
+
113
+ def mask_pattern
114
+ return nil unless mask
115
+
116
+ MASK_PATTERNS[mask]
117
+ end
88
118
  end
89
119
  end
90
120
  end
@@ -50,7 +50,7 @@ $gap_lg: $height_from_top + $space_lg;
50
50
  >div {
51
51
  &:last-child {
52
52
  flex-basis: auto !important;
53
- [class=pb_timeline_item_step] {
53
+ [class^=pb_timeline_item_step] {
54
54
  [class=pb_timeline_item_connector] {
55
55
  opacity: 0;
56
56
  }
@@ -66,29 +66,25 @@ $gap_lg: $height_from_top + $space_lg;
66
66
  [class*=pb_timeline_item_kit] {
67
67
  &[class*=_solid] {
68
68
  flex-basis: 100%;
69
- [class=pb_timeline_item_left_block] {
70
- height: 0px;
71
- }
72
- [class=pb_timeline_item_step] {
69
+ [class^=pb_timeline_item_step] {
73
70
  @include flex_wrapper(row);
71
+ align-items: center;
74
72
  margin-top: $space_xs;
75
73
  margin-bottom: $space_xs;
76
74
  [class=pb_timeline_item_connector] {
77
- @include pb_timeline_line_solid($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
75
+ @include pb_timeline_line_solid($connector_width, $connector_width, 0 $icon_margin 0 $icon_margin );
78
76
  }
79
77
  }
80
78
  }
81
79
  &[class*=_dotted] {
82
80
  flex-basis: 100%;
83
- [class=pb_timeline_item_left_block] {
84
- height: 0;
85
- }
86
- [class=pb_timeline_item_step] {
81
+ [class^=pb_timeline_item_step] {
87
82
  @include flex_wrapper(row);
83
+ align-items: center;
88
84
  margin-top: $space_xs;
89
85
  margin-bottom: $space_xs;
90
86
  [class=pb_timeline_item_connector] {
91
- @include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
87
+ @include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, 0 $icon_margin 0 $icon_margin );
92
88
  }
93
89
  }
94
90
  }
@@ -99,7 +95,7 @@ $gap_lg: $height_from_top + $space_lg;
99
95
  >div {
100
96
  &:last-child {
101
97
  flex-basis: auto !important;
102
- [class=pb_timeline_item_step] {
98
+ [class^=pb_timeline_item_step] {
103
99
  [class=pb_timeline_item_connector] {
104
100
  opacity: 0;
105
101
  }
@@ -129,12 +125,12 @@ $gap_lg: $height_from_top + $space_lg;
129
125
  }
130
126
  }
131
127
  }
132
- [class=pb_timeline_item_step] {
128
+ [class^=pb_timeline_item_step] {
133
129
  @include flex_wrapper(row);
134
130
  margin-top: $space_xs;
135
131
  margin-bottom: $space_xs;
136
132
  [class=pb_timeline_item_connector] {
137
- @include pb_timeline_line_solid($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
133
+ @include pb_timeline_line_solid($connector_width, $connector_width, 0 $icon_margin 0 $icon_margin );
138
134
  }
139
135
  }
140
136
  }
@@ -153,12 +149,12 @@ $gap_lg: $height_from_top + $space_lg;
153
149
  }
154
150
  }
155
151
  }
156
- [class=pb_timeline_item_step] {
152
+ [class^=pb_timeline_item_step] {
157
153
  @include flex_wrapper(row);
158
154
  margin-top: $space_xs;
159
155
  margin-bottom: $space_xs;
160
156
  [class=pb_timeline_item_connector] {
161
- @include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, $height_from_top $icon_margin 0 $icon_margin );
157
+ @include pb_timeline_line_dotted_horizontal($connector_width, $connector_width, 0 $icon_margin 0 $icon_margin );
162
158
  }
163
159
  }
164
160
  }
@@ -170,7 +166,7 @@ $gap_lg: $height_from_top + $space_lg;
170
166
  align-items: flex-start;
171
167
  align-self: auto;
172
168
  >div:last-child {
173
- [class=pb_timeline_item_step] {
169
+ [class^=pb_timeline_item_step] {
174
170
  [class=pb_timeline_item_connector] {
175
171
  opacity: 0;
176
172
  }
@@ -180,13 +176,14 @@ $gap_lg: $height_from_top + $space_lg;
180
176
  @include flex_wrapper(row);
181
177
  &[class*=_solid] {
182
178
  flex-basis: 100%;
183
- [class=pb_timeline_item_step] {
179
+ [class^=pb_timeline_item_step] {
184
180
  @include flex_wrapper(column);
181
+ align-items: center;
185
182
  align-content: flex-start;
186
183
  margin-right: $space_sm;
187
184
  margin-left: $space_sm;
188
185
  [class=pb_timeline_item_connector] {
189
- @include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
186
+ @include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin 0);
190
187
  }
191
188
  }
192
189
  [class=pb_timeline_item_left_block] {
@@ -200,12 +197,13 @@ $gap_lg: $height_from_top + $space_lg;
200
197
  }
201
198
  &[class*=_dotted] {
202
199
  flex-basis: 100%;
203
- [class=pb_timeline_item_step] {
200
+ [class^=pb_timeline_item_step] {
204
201
  @include flex_wrapper(column);
202
+ align-items: center;
205
203
  margin-right: $space_sm;
206
204
  margin-left: $space_sm;
207
205
  [class=pb_timeline_item_connector] {
208
- @include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
206
+ @include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin 0);
209
207
  }
210
208
  }
211
209
  [class=pb_timeline_item_left_block] {
@@ -223,7 +221,7 @@ $gap_lg: $height_from_top + $space_lg;
223
221
  align-items: flex-start;
224
222
  align-self: auto;
225
223
  >div:last-child {
226
- [class=pb_timeline_item_step] {
224
+ [class^=pb_timeline_item_step] {
227
225
  [class=pb_timeline_item_connector] {
228
226
  opacity: 0;
229
227
  }
@@ -233,13 +231,14 @@ $gap_lg: $height_from_top + $space_lg;
233
231
  @include flex_wrapper(row);
234
232
  &[class*=_solid] {
235
233
  flex-basis: 100%;
236
- [class=pb_timeline_item_step] {
234
+ [class^=pb_timeline_item_step] {
237
235
  @include flex_wrapper(column);
236
+ align-items: center;
238
237
  align-content: flex-start;
239
238
  margin-right: $space_sm;
240
239
  margin-left: $space_sm;
241
240
  [class=pb_timeline_item_connector] {
242
- @include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
241
+ @include pb_timeline_line_solid($connector_width, $connector_width, $icon_margin 0 $icon_margin 0);
243
242
  }
244
243
  }
245
244
  [class=pb_timeline_item_left_block] {
@@ -253,12 +252,13 @@ $gap_lg: $height_from_top + $space_lg;
253
252
  }
254
253
  &[class*=_dotted] {
255
254
  flex-basis: 100%;
256
- [class=pb_timeline_item_step] {
255
+ [class^=pb_timeline_item_step] {
257
256
  @include flex_wrapper(column);
257
+ align-items: center;
258
258
  margin-right: $space_sm;
259
259
  margin-left: $space_sm;
260
260
  [class=pb_timeline_item_connector] {
261
- @include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin $height_from_top);
261
+ @include pb_timeline_line_dotted_vertical($connector_width, $connector_width, $icon_margin 0 $icon_margin 0);
262
262
  }
263
263
  }
264
264
  [class=pb_timeline_item_left_block] {
@@ -274,7 +274,7 @@ $gap_lg: $height_from_top + $space_lg;
274
274
  }
275
275
  &[class*=_gap_xs] {
276
276
  [class*=pb_timeline_item_kit] {
277
- [class=pb_timeline_item_step] {
277
+ [class^=pb_timeline_item_step] {
278
278
  [class=pb_timeline_item_connector] {
279
279
  height: $gap_xs !important;
280
280
  }
@@ -283,7 +283,7 @@ $gap_lg: $height_from_top + $space_lg;
283
283
  }
284
284
  &[class*=_gap_sm] {
285
285
  [class*=pb_timeline_item_kit] {
286
- [class=pb_timeline_item_step] {
286
+ [class^=pb_timeline_item_step] {
287
287
  [class=pb_timeline_item_connector] {
288
288
  height: $gap_sm !important;
289
289
  }
@@ -292,7 +292,7 @@ $gap_lg: $height_from_top + $space_lg;
292
292
  }
293
293
  &[class*=_gap_md] {
294
294
  [class*=pb_timeline_item_kit] {
295
- [class=pb_timeline_item_step] {
295
+ [class^=pb_timeline_item_step] {
296
296
  [class=pb_timeline_item_connector] {
297
297
  height: $gap_md !important;
298
298
  }
@@ -301,7 +301,7 @@ $gap_lg: $height_from_top + $space_lg;
301
301
  }
302
302
  &[class*=_gap_lg] {
303
303
  [class*=pb_timeline_item_kit] {
304
- [class=pb_timeline_item_step] {
304
+ [class^=pb_timeline_item_step] {
305
305
  [class=pb_timeline_item_connector] {
306
306
  height: $gap_lg !important;
307
307
  }
@@ -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: "Truncation Within Typeahead",
17
+ pills: true,
18
+ truncate: 1,
19
+ }) %>
@@ -0,0 +1,27 @@
1
+ import React from 'react'
2
+ import { Typeahead } from 'playbook-ui'
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 TypeaheadTruncatedText = (props) => {
13
+ return (
14
+ <>
15
+ <Typeahead
16
+ htmlOptions={{ style: { maxWidth: "240px" }}}
17
+ isMulti
18
+ label="Truncation Within Typeahead"
19
+ options={names}
20
+ truncate={1}
21
+ {...props}
22
+ />
23
+ </>
24
+ )
25
+ }
26
+
27
+ export default TypeaheadTruncatedText
@@ -0,0 +1 @@
1
+ For Form Pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. Hover over the truncated Form Pill and a Tooltip containing the text or tag section of the Form Pill will appear. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
@@ -11,6 +11,7 @@ examples:
11
11
  - typeahead_error_state: Error State
12
12
  - typeahead_margin_bottom: Margin Bottom
13
13
  - typeahead_with_pills_color: With Pills (Custom Color)
14
+ - typeahead_truncated_text: Truncated Text
14
15
 
15
16
  react:
16
17
  - typeahead_default: Default
@@ -27,3 +28,4 @@ examples:
27
28
  - typeahead_custom_menu_list: Custom MenuList
28
29
  - typeahead_margin_bottom: Margin Bottom
29
30
  - typeahead_with_pills_color: With Pills (Custom Color)
31
+ - typeahead_truncated_text: Truncated Text
@@ -12,3 +12,4 @@ export { default as TypeaheadErrorState } from './_typeahead_error_state.jsx'
12
12
  export { default as TypeaheadCustomMenuList } from './_typeahead_custom_menu_list.jsx'
13
13
  export { default as TypeaheadMarginBottom } from './_typeahead_margin_bottom.jsx'
14
14
  export { default as TypeaheadWithPillsColor } from './_typeahead_with_pills_color.jsx'
15
+ export { default as TypeaheadTruncatedText } from './_typeahead_truncated_text.jsx'