playbook_ui 14.12.0.pre.alpha.testingwithfas5689 → 14.12.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 (179) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +0 -2
  3. data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +2 -18
  4. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +5 -27
  5. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableBody.tsx +2 -17
  6. data/app/pb_kits/playbook/pb_advanced_table/SubKits/TableHeader.tsx +1 -23
  7. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -29
  8. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +4 -61
  9. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.html.erb +8 -13
  10. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -3
  11. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination.jsx +0 -1
  12. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_pagination_with_props.jsx +0 -1
  13. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_sort_control.md +2 -2
  14. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -7
  15. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -6
  16. data/app/pb_kits/playbook/pb_advanced_table/table_body.rb +3 -15
  17. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +11 -11
  18. data/app/pb_kits/playbook/pb_advanced_table/table_header.rb +3 -12
  19. data/app/pb_kits/playbook/pb_advanced_table/table_row.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_advanced_table/table_row.rb +1 -7
  21. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -1
  22. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.rb +0 -9
  23. data/app/pb_kits/playbook/pb_button/button.html.erb +3 -2
  24. data/app/pb_kits/playbook/pb_button/button.rb +1 -1
  25. data/app/pb_kits/playbook/pb_card/card.html.erb +2 -21
  26. data/app/pb_kits/playbook/pb_card/card.rb +0 -7
  27. data/app/pb_kits/playbook/pb_checkbox/checkbox.html.erb +6 -1
  28. data/app/pb_kits/playbook/pb_collapsible/__snapshots__/collapsible.test.js.snap +1 -1
  29. data/app/pb_kits/playbook/pb_collapsible/collapsible.html.erb +1 -3
  30. data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +0 -3
  31. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +16 -24
  32. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -2
  33. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +2 -2
  34. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_default_date.md +1 -1
  35. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -1
  36. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +3 -1
  37. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -7
  38. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +9 -3
  39. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -1
  40. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +183 -145
  41. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +268 -158
  42. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +45 -3
  43. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +1 -0
  44. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +16 -9
  45. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +19 -44
  46. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.md +3 -21
  47. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +21 -16
  48. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +19 -2
  49. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -2
  50. data/app/pb_kits/playbook/pb_drawer/docs/index.js +0 -1
  51. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +5 -5
  52. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subtle_variant.md +1 -1
  53. data/app/pb_kits/playbook/pb_dropdown/dropdown.html.erb +12 -7
  54. data/app/pb_kits/playbook/pb_dropdown/dropdown_container.html.erb +14 -9
  55. data/app/pb_kits/playbook/pb_dropdown/dropdown_option.html.erb +11 -6
  56. data/app/pb_kits/playbook/pb_dropdown/dropdown_trigger.html.erb +14 -8
  57. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  58. data/app/pb_kits/playbook/pb_icon/icon.rb +2 -2
  59. data/app/pb_kits/playbook/pb_icon/icon.test.js +8 -8
  60. data/app/pb_kits/playbook/pb_list/item.html.erb +8 -30
  61. data/app/pb_kits/playbook/pb_list/item.rb +0 -7
  62. data/app/pb_kits/playbook/pb_list/list.html.erb +11 -31
  63. data/app/pb_kits/playbook/pb_list/list.rb +0 -4
  64. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -6
  65. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.scss +0 -4
  66. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +0 -1
  67. data/app/pb_kits/playbook/pb_multiple_users/multiple_users.html.erb +1 -1
  68. data/app/pb_kits/playbook/pb_nav/_nav_item.test.js +2 -2
  69. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +12 -30
  70. data/app/pb_kits/playbook/pb_phone_number_input/docs/example.yml +1 -3
  71. data/app/pb_kits/playbook/pb_phone_number_input/docs/index.js +0 -1
  72. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.rb +0 -3
  73. data/app/pb_kits/playbook/pb_phone_number_input/phone_number_input.test.js +1 -20
  74. data/app/pb_kits/playbook/pb_radio/_radio.scss +8 -12
  75. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +3 -8
  76. data/app/pb_kits/playbook/pb_select/_select.scss +5 -3
  77. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -5
  78. data/app/pb_kits/playbook/pb_select/select.html.erb +2 -2
  79. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -9
  80. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_default.jsx +1 -4
  81. data/app/pb_kits/playbook/pb_selectable_icon/docs/_selectable_icon_single_select.jsx +1 -4
  82. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.html.erb +3 -17
  83. data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +0 -3
  84. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.html.erb +4 -11
  85. data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +0 -3
  86. data/app/pb_kits/playbook/pb_table/_table.tsx +3 -2
  87. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_rails.md +2 -2
  88. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content.jsx +8 -12
  89. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -6
  90. data/app/pb_kits/playbook/pb_table/index.ts +88 -187
  91. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -12
  92. data/app/pb_kits/playbook/pb_table/styles/_scroll.scss +5 -6
  93. data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
  94. data/app/pb_kits/playbook/pb_table/table.rb +2 -17
  95. data/app/pb_kits/playbook/pb_table/table_row.html.erb +1 -20
  96. data/app/pb_kits/playbook/pb_table/table_row.rb +0 -5
  97. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -2
  98. data/app/pb_kits/playbook/pb_text_input/text_input.html.erb +0 -4
  99. data/app/pb_kits/playbook/pb_text_input/text_input.rb +3 -33
  100. data/app/pb_kits/playbook/pb_timeline/_timeline.scss +30 -30
  101. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +2 -3
  102. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +4 -12
  103. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +1 -5
  104. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +3 -8
  105. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +1 -6
  106. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +6 -21
  107. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +6 -13
  108. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +3 -7
  109. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_custom_menu_list.jsx +0 -2
  110. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async.jsx +2 -4
  111. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills_async_custom_options.jsx +5 -5
  112. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +0 -2
  113. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +0 -1
  114. data/dist/chunks/_typeahead-C2iCBqxQ.js +36 -0
  115. data/dist/chunks/_weekday_stacked-CWnbnW7m.js +45 -0
  116. data/dist/chunks/{lib-RmkltInK.js → lib-B7sgJtGS.js} +2 -2
  117. data/dist/chunks/{pb_form_validation-Bu-zi4X-.js → pb_form_validation-C5Cc0-1v.js} +1 -1
  118. data/dist/chunks/vendor.js +1 -1
  119. data/dist/menu.yml +0 -6
  120. data/dist/playbook-doc.js +1 -1
  121. data/dist/playbook-rails-react-bindings.js +1 -1
  122. data/dist/playbook-rails.js +1 -1
  123. data/dist/playbook.css +1 -1
  124. data/lib/playbook/version.rb +2 -2
  125. metadata +11 -75
  126. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_no_subrows.jsx +0 -50
  127. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_responsive.html.erb +0 -38
  128. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.jsx +0 -60
  129. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows.md +0 -5
  130. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.jsx +0 -78
  131. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_actions.md +0 -1
  132. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.jsx +0 -53
  133. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_header.md +0 -1
  134. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.jsx +0 -52
  135. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_selectable_rows_no_subrows.md +0 -1
  136. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +0 -33
  137. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +0 -1
  138. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_no_subrows.json +0 -42
  139. data/app/pb_kits/playbook/pb_advanced_table/docs/advanced_table_mock_data_with_id.json +0 -299
  140. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames.html.erb +0 -13
  141. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_turbo_frames_rails.md +0 -3
  142. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.md +0 -5
  143. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.html.erb +0 -38
  144. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_selectable_list_rails.md +0 -3
  145. data/app/pb_kits/playbook/pb_drawer/context.ts +0 -11
  146. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.jsx +0 -38
  147. data/app/pb_kits/playbook/pb_drawer/hooks/useBreakpoint.tsx +0 -60
  148. data/app/pb_kits/playbook/pb_drawer/hooks/useDrawerAnimation.tsx +0 -21
  149. data/app/pb_kits/playbook/pb_icon_button/_icon_button.scss +0 -78
  150. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +0 -3
  151. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +0 -7
  152. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +0 -16
  153. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +0 -22
  154. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.html.erb +0 -15
  155. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.jsx +0 -24
  156. data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_format.md +0 -1
  157. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns.html.erb +0 -74
  158. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_columns_rails.md +0 -3
  159. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns.html.erb +0 -74
  160. data/app/pb_kits/playbook/pb_table/docs/_table_sticky_right_columns_rails.md +0 -3
  161. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.html.erb +0 -47
  162. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_rails.md +0 -2
  163. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.html.erb +0 -52
  164. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_content_rails.md +0 -0
  165. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.html.erb +0 -52
  166. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_rows_rails.md +0 -3
  167. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.html.erb +0 -80
  168. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_nested_table_rails.md +0 -1
  169. data/app/pb_kits/playbook/pb_table/utilities/addDataTitle.ts +0 -22
  170. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -46
  171. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask_rails.md +0 -3
  172. data/app/pb_kits/playbook/pb_text_input/index.js +0 -103
  173. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.html.erb +0 -19
  174. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.jsx +0 -27
  175. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_truncated_text.md +0 -1
  176. data/dist/chunks/_typeahead-BDhvNf6A.js +0 -36
  177. data/dist/chunks/_weekday_stacked-BhU_44Uo.js +0 -45
  178. /data/app/pb_kits/playbook/pb_advanced_table/docs/{_advanced_table_table_props_react.md → _advanced_table_table_props.md} +0 -0
  179. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_react.md → _table_with_collapsible.md} +0 -0
@@ -12,7 +12,6 @@ type LoadingInlineProps = {
12
12
  aria?: { [key: string]: string },
13
13
  className?: string,
14
14
  data?: { [key: string]: string },
15
- dark?: boolean,
16
15
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
16
  id?: string,
18
17
  text?: string,
@@ -24,7 +23,6 @@ const LoadingInline = (props: LoadingInlineProps) => {
24
23
  aria = {},
25
24
  className,
26
25
  data = {},
27
- dark = false,
28
26
  htmlOptions = {},
29
27
  id,
30
28
  text = ' Loading',
@@ -47,10 +45,7 @@ const LoadingInline = (props: LoadingInlineProps) => {
47
45
  className={classes}
48
46
  id={id}
49
47
  >
50
- <Body
51
- color="light"
52
- dark={dark}
53
- >
48
+ <Body color="light">
54
49
  <Icon
55
50
  aria={{ label: 'loading icon' }}
56
51
  fixedWidth
@@ -24,10 +24,6 @@ $pb_multiple_users_size_xxs: map-get($avatar-sizes, "xxs");
24
24
  color: $primary;
25
25
  font-weight: $bold;
26
26
  font-size: $font_smallest - 1;
27
-
28
- &.dark {
29
- border: $pb_multiple_users_border_size solid $bg_dark;
30
- }
31
27
  }
32
28
 
33
29
  .multiple_users_badge_xxs {
@@ -50,7 +50,6 @@ const MultipleUsers = (props: MultipleUsersProps): React.ReactElement => {
50
50
 
51
51
  const itemClasses = classnames(
52
52
  'pb_multiple_users_item',
53
- dark && 'dark',
54
53
  buildCss('multiple_users_badge', avatarSizeClass)
55
54
  )
56
55
 
@@ -4,7 +4,7 @@
4
4
  <% end %>
5
5
 
6
6
  <% if object.more_than_four %>
7
- <div class="pb_multiple_users_item multiple_users_badge_<%= object.size %><%= object.dark ? " dark" : "" %>">
7
+ <div class="pb_multiple_users_item multiple_users_badge_<%= object.size %>">
8
8
  <%= "+#{object.users.count - object.display_count}" %>
9
9
  </div>
10
10
  <% end %>
@@ -95,11 +95,11 @@ test('should not have a left border', () => {
95
95
  test('should have a right icon', () => {
96
96
  render(<NavDefault iconRight="angle-down" />)
97
97
  const kit = screen.getByTestId(itemTestId)
98
- expect(kit).toContainHTML('<i class="pb_icon_kit fas pb_nav_list_item_icon_right fa-fw fa-angle-down" />')
98
+ expect(kit).toContainHTML('<i class="pb_icon_kit far pb_nav_list_item_icon_right fa-fw fa-angle-down" />')
99
99
  })
100
100
 
101
101
  test('should have a left icon', () => {
102
102
  render(<NavDefault iconLeft="users-class" />)
103
103
  const kit = screen.getByTestId(itemTestId)
104
- expect(kit).toContainHTML('<i class="pb_icon_kit fas pb_nav_list_item_icon_left fa-fw fa-users-class" />')
104
+ expect(kit).toContainHTML('<i class="pb_icon_kit far pb_nav_list_item_icon_left fa-fw fa-users-class" />')
105
105
  })
@@ -35,7 +35,6 @@ type PhoneNumberInputProps = {
35
35
  preferredCountries?: string[],
36
36
  required?: boolean,
37
37
  value?: string,
38
- formatAsYouType?: boolean,
39
38
  }
40
39
 
41
40
  enum ValidationError {
@@ -88,7 +87,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
88
87
  required = false,
89
88
  preferredCountries = [],
90
89
  value = "",
91
- formatAsYouType = false,
92
90
  } = props
93
91
 
94
92
  const ariaProps = buildAriaProps(aria)
@@ -101,8 +99,8 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
101
99
  )
102
100
 
103
101
  const inputRef = useRef<HTMLInputElement>()
104
- const itiRef = useRef<any>(null);
105
102
  const [inputValue, setInputValue] = useState(value)
103
+ const [itiInit, setItiInit] = useState<any>()
106
104
  const [error, setError] = useState(props.error)
107
105
  const [dropDownIsOpen, setDropDownIsOpen] = useState(false)
108
106
  const [selectedData, setSelectedData] = useState()
@@ -132,12 +130,8 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
132
130
  }
133
131
  })
134
132
 
135
- const unformatNumber = (formattedNumber: any) => {
136
- return formattedNumber.replace(/\D/g, "")
137
- }
138
-
139
133
  const showFormattedError = (reason = '') => {
140
- const countryName = itiRef.current.getSelectedCountryData().name
134
+ const countryName = itiInit.getSelectedCountryData().name
141
135
  const reasonText = reason.length > 0 ? ` (${reason})` : ''
142
136
  setError(`Invalid ${countryName} phone number${reasonText}`)
143
137
  return true
@@ -195,12 +189,12 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
195
189
  }
196
190
 
197
191
  const validateErrors = () => {
198
- if (itiRef.current) isValid(itiRef.current.isValidNumber())
199
- if (validateOnlyNumbers(itiRef.current)) return
200
- if (validateTooLongNumber(itiRef.current)) return
201
- if (validateTooShortNumber(itiRef.current)) return
202
- if (validateUnhandledError(itiRef.current)) return
203
- if (validateMissingAreaCode(itiRef.current)) return
192
+ if (itiInit) isValid(itiInit.isValidNumber())
193
+ if (validateOnlyNumbers(itiInit)) return
194
+ if (validateTooLongNumber(itiInit)) return
195
+ if (validateTooShortNumber(itiInit)) return
196
+ if (validateUnhandledError(itiInit)) return
197
+ if (validateMissingAreaCode(itiInit)) return
204
198
  }
205
199
 
206
200
  const getCurrentSelectedData = (itiInit: any, inputValue: string) => {
@@ -209,16 +203,10 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
209
203
 
210
204
  const handleOnChange = (evt: React.ChangeEvent<HTMLInputElement>) => {
211
205
  setInputValue(evt.target.value)
212
- let phoneNumberData
213
- if (formatAsYouType) {
214
- const formattedPhoneNumberData = getCurrentSelectedData(itiRef.current, evt.target.value)
215
- phoneNumberData = {...formattedPhoneNumberData, number: unformatNumber(formattedPhoneNumberData.number)}
216
- } else {
217
- phoneNumberData = getCurrentSelectedData(itiRef.current, evt.target.value)
218
- }
206
+ const phoneNumberData = getCurrentSelectedData(itiInit, evt.target.value)
219
207
  setSelectedData(phoneNumberData)
220
208
  onChange(phoneNumberData)
221
- isValid(itiRef.current.isValidNumber())
209
+ isValid(itiInit.isValidNumber())
222
210
  }
223
211
 
224
212
  // Separating Concerns as React Docs Recommend
@@ -242,11 +230,9 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
242
230
  onlyCountries,
243
231
  countrySearch: false,
244
232
  fixDropdownWidth: false,
245
- formatAsYouType: formatAsYouType,
233
+ formatAsYouType: false,
246
234
  })
247
235
 
248
- itiRef.current = telInputInit;
249
-
250
236
  inputRef.current.addEventListener("countrychange", (evt: Event) => {
251
237
  const phoneNumberData = getCurrentSelectedData(telInputInit, (evt.target as HTMLInputElement).value)
252
238
  setSelectedData(phoneNumberData)
@@ -257,11 +243,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
257
243
  inputRef.current.addEventListener("open:countrydropdown", () => setDropDownIsOpen(true))
258
244
  inputRef.current.addEventListener("close:countrydropdown", () => setDropDownIsOpen(false))
259
245
 
260
- if (formatAsYouType) {
261
- inputRef.current?.addEventListener("input", (evt) => {
262
- handleOnChange(evt as unknown as React.ChangeEvent<HTMLInputElement>);
263
- });
264
- }
246
+ setItiInit(telInputInit)
265
247
  }, [])
266
248
 
267
249
  let textInputProps: {[key: string]: any} = {
@@ -8,12 +8,10 @@ examples:
8
8
  - phone_number_input_validation: Form Validation
9
9
  - phone_number_input_clear_field: Clearing the Input Field
10
10
  - phone_number_input_access_input_element: Accessing the Input Element
11
- - phone_number_input_format: Format as You Type
12
11
 
13
12
  rails:
14
13
  - phone_number_input_default: Default
15
14
  - phone_number_input_preferred_countries: Preferred Countries
16
15
  - phone_number_input_initial_country: Initial Country
17
16
  - phone_number_input_only_countries: Limited Countries
18
- - phone_number_input_validation: Form Validation
19
- - phone_number_input_format: Format as You Type
17
+ - phone_number_input_validation: Form Validation
@@ -5,4 +5,3 @@ export { default as PhoneNumberInputOnlyCountries } from './_phone_number_input_
5
5
  export { default as PhoneNumberInputValidation } from './_phone_number_input_validation'
6
6
  export { default as PhoneNumberInputClearField } from './_phone_number_input_clear_field'
7
7
  export { default as PhoneNumberInputAccessInputElement } from './_phone_number_input_access_input_element'
8
- export { default as PhoneNumberInputFormat } from './_phone_number_input_format'
@@ -21,8 +21,6 @@ module Playbook
21
21
  default: ""
22
22
  prop :value, type: Playbook::Props::String,
23
23
  default: ""
24
- prop :format_as_you_type, type: Playbook::Props::Boolean,
25
- default: false
26
24
 
27
25
  def classname
28
26
  generate_classname("pb_phone_number_input")
@@ -34,7 +32,6 @@ module Playbook
34
32
  dark: dark,
35
33
  disabled: disabled,
36
34
  error: error,
37
- formatAsYouType: format_as_you_type,
38
35
  initialCountry: initial_country,
39
36
  label: label,
40
37
  name: name,
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { render, screen, act } from "../utilities/test-utils";
2
+ import { render, screen } from "../utilities/test-utils";
3
3
  import PhoneNumberInput from "./_phone_number_input";
4
4
 
5
5
  const testId = "phoneNumberInput";
@@ -120,22 +120,3 @@ test("should trigger callback", () => {
120
120
 
121
121
  expect(handleOnValidate).toBeCalledWith(true)
122
122
  });
123
-
124
- test("should format phone number as '555-555-5555' with formatAsYouType and 'us' country", () => {
125
- const props = {
126
- initialCountry: 'us',
127
- formatAsYouType: true,
128
- id: testId,
129
- };
130
-
131
- render(<PhoneNumberInput {...props} />);
132
-
133
- const input = screen.getByRole("textbox");
134
-
135
- act(() => {
136
- input.value = "5555555555";
137
- input.dispatchEvent(new Event('input', { bubbles: true }));
138
- });
139
-
140
- expect(input.value).toBe("555-555-5555");
141
- });
@@ -4,7 +4,7 @@
4
4
  @import "../pb_body/body";
5
5
  @import "../tokens/transition";
6
6
 
7
- [class^="pb_radio_kit"] {
7
+ [class^=pb_radio_kit] {
8
8
  display: inline-flex;
9
9
  cursor: pointer;
10
10
 
@@ -16,11 +16,10 @@
16
16
  border-radius: 1000px;
17
17
  border: 2px solid $border_light;
18
18
  margin-right: $space_xs;
19
- transition: background $transition_default ease,
20
- box-shadow $transition_default ease, border-color $transition_default ease;
19
+ transition: background $transition_default ease, box-shadow $transition_default ease, border-color $transition_default ease;
21
20
  }
22
21
 
23
- @media (hover: hover) {
22
+ @media (hover:hover) {
24
23
  &:hover .pb_radio_button {
25
24
  background-color: $bg_light;
26
25
  border-color: $border_light;
@@ -53,14 +52,14 @@
53
52
  }
54
53
  }
55
54
 
56
- &:disabled:checked + .pb_radio_button {
55
+ &:disabled:checked + .pb_radio_button{
57
56
  cursor: not-allowed;
58
57
  background-color: $white;
59
58
  border: 6px solid $neutral;
60
59
  }
61
60
  }
62
61
 
63
- &[class*="vertical"] {
62
+ &[class*=vertical] {
64
63
  flex-direction: column;
65
64
  align-items: center;
66
65
  .pb_radio_button {
@@ -81,7 +80,7 @@
81
80
  }
82
81
  &:checked {
83
82
  & ~ .pb_radio_button {
84
- border: 6px solid $active_dark;
83
+ border: 6px solid $primary;
85
84
  }
86
85
  }
87
86
 
@@ -104,10 +103,10 @@
104
103
  }
105
104
  }
106
105
 
107
- @media (hover: hover) {
106
+ @media (hover:hover) {
108
107
  &:hover {
109
108
  .pb_radio_button {
110
- background-color: rgba($white, 0.1);
109
+ background-color: rgba($white,.10);
111
110
  border-color: $border_dark;
112
111
  }
113
112
  }
@@ -116,9 +115,6 @@
116
115
  > .pb_radio_button {
117
116
  border-color: $error_dark;
118
117
  }
119
- > .pb_body_kit_negative {
120
- color: $error_dark;
121
- }
122
118
  }
123
119
  }
124
120
  &.error {
@@ -29,7 +29,6 @@ const RadioChildren = (props) => {
29
29
  marginBottom="none"
30
30
  minWidth="xs"
31
31
  options={options}
32
- {...props}
33
32
  />
34
33
  </Radio>
35
34
  <Radio
@@ -41,11 +40,10 @@ const RadioChildren = (props) => {
41
40
  value="Typeahead"
42
41
  {...props}
43
42
  >
44
- <Typeahead
43
+ <Typeahead
45
44
  marginBottom="none"
46
45
  minWidth="xs"
47
46
  options={options}
48
- {...props}
49
47
  />
50
48
  </Radio>
51
49
  <Radio
@@ -56,12 +54,9 @@ const RadioChildren = (props) => {
56
54
  value="Typography"
57
55
  {...props}
58
56
  >
59
- <Title
60
- text="Custom Typography"
61
- {...props}
62
- />
57
+ <Title text="Custom Typography" />
63
58
  </Radio>
64
59
  </div>
65
60
  )
66
61
  }
67
- export default RadioChildren
62
+ export default RadioChildren
@@ -209,8 +209,10 @@
209
209
  }
210
210
  .pb_select_kit_wrapper {
211
211
  &.error {
212
- > select {
213
- border-color: $error_dark;
212
+ .pb_select_kit_wrapper {
213
+ > select:first-child {
214
+ border-color: $error_dark;
215
+ }
214
216
  }
215
217
  }
216
218
  }
@@ -226,7 +228,7 @@
226
228
  &:hover {
227
229
  select {
228
230
  color: $white !important;
229
- background: $focus_input_dark;
231
+ background: rgba(0,130,255,0.1);
230
232
  }
231
233
  svg {
232
234
  color: $primary !important;
@@ -127,10 +127,7 @@ const Select = ({
127
127
  className="pb_select_kit_label"
128
128
  htmlFor={name}
129
129
  >
130
- <Caption
131
- dark={props.dark}
132
- text={label}
133
- />
130
+ <Caption text={label} />
134
131
  </label>
135
132
  }
136
133
  <label
@@ -149,7 +146,6 @@ const Select = ({
149
146
  }
150
147
  {error &&
151
148
  <Body
152
- dark={props.dark}
153
149
  status="negative"
154
150
  text={error}
155
151
  />
@@ -5,7 +5,7 @@
5
5
  **combined_html_options) do %>
6
6
  <% if object.label %>
7
7
  <label class="pb_select_kit_label" for="<%= object.name %>">
8
- <%= pb_rails("caption", props: { text: object.label, dark: object.dark }) %>
8
+ <%= pb_rails("caption", props: { text: object.label }) %>
9
9
  </label>
10
10
  <% end %>
11
11
  <label class="<%= object.select_wrapper_class %>" for="<%= object.name %>">
@@ -23,7 +23,7 @@
23
23
  object.all_attributes
24
24
  )
25
25
  %>
26
- <%= pb_rails("body", props: { status: "negative", text: object.error, dark: object.dark }) %>
26
+ <%= pb_rails("body", props: { status: "negative", text: object.error }) %>
27
27
  <% end %>
28
28
  <% if object.multiple != true %>
29
29
  <%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(angle_down_path), fixed_width: true, classname: "pb_select_kit_caret"}) %>
@@ -16,7 +16,6 @@ type SelectableIconProps = {
16
16
  checked?: boolean,
17
17
  className?: string,
18
18
  customIcon?: {[key: string] :SVGElement},
19
- dark?: boolean,
20
19
  disabled?: boolean,
21
20
  data?: GenericObject,
22
21
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
@@ -34,7 +33,6 @@ const SelectableIcon = ({
34
33
  className,
35
34
  checked = false,
36
35
  customIcon,
37
- dark = false,
38
36
  data = {},
39
37
  disabled = false,
40
38
  htmlOptions = {},
@@ -54,12 +52,10 @@ const SelectableIcon = ({
54
52
  const classes = classnames(
55
53
  buildCss('pb_selectable_icon_kit', {
56
54
  checked: checked,
57
- dark: dark,
58
55
  disabled: disabled,
59
56
  enabled: !disabled,
60
57
  }),
61
58
  globalProps(props),
62
- dark ? 'dark' : '',
63
59
  className
64
60
  )
65
61
 
@@ -77,19 +73,17 @@ const SelectableIcon = ({
77
73
  <>
78
74
  <Icon
79
75
  customIcon={customIcon}
80
- dark={dark}
81
76
  icon={icon}
82
77
  size="2x"
83
78
  />
84
79
  <Title
85
- dark={dark}
86
80
  size={4}
87
81
  tag="h4"
88
82
  text={text}
89
83
  />
90
84
  </>
91
85
  )}
92
-
86
+
93
87
  {inputs === 'enabled' && (
94
88
  <>
95
89
  <input
@@ -104,12 +98,10 @@ const SelectableIcon = ({
104
98
  <label htmlFor={inputIdPresent}>
105
99
  <Icon
106
100
  customIcon={customIcon}
107
- dark={dark}
108
101
  icon={icon}
109
102
  size="2x"
110
103
  />
111
104
  <Title
112
- dark={dark}
113
105
  size={4}
114
106
  tag="h4"
115
107
  text={text}
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react'
2
2
  import SelectableIcon from '../_selectable_icon'
3
3
 
4
- const SelectableIconDefault = (props) => {
4
+ const SelectableIconDefault = () => {
5
5
  const [ checkSelected, toggleSelected ] = useState(true)
6
6
  const [ checkUnselected, toggleUnselected ] = useState(false)
7
7
  const [ checkDisabled, toggleDisabled ] = useState(false)
@@ -15,7 +15,6 @@ const SelectableIconDefault = (props) => {
15
15
  inputId={10}
16
16
  onChange={() => toggleSelected(!checkSelected)}
17
17
  text="US Dollar"
18
- {...props}
19
18
  />
20
19
 
21
20
  <SelectableIcon
@@ -24,7 +23,6 @@ const SelectableIconDefault = (props) => {
24
23
  inputId={11}
25
24
  onChange={() => toggleUnselected(!checkUnselected)}
26
25
  text="Euro"
27
- {...props}
28
26
  />
29
27
 
30
28
  <SelectableIcon
@@ -34,7 +32,6 @@ const SelectableIconDefault = (props) => {
34
32
  inputId={12}
35
33
  onChange={() => toggleDisabled(!checkDisabled)}
36
34
  text="Yen"
37
- {...props}
38
35
  />
39
36
  </div>
40
37
  )
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
 
3
3
  import SelectableIcon from '../_selectable_icon'
4
4
 
5
- const SelectableIconSingleSelect = (props) => {
5
+ const SelectableIconSingleSelect = () => {
6
6
  const [ selectedFormat, toggleFormat ] = useState(null)
7
7
 
8
8
  return (
@@ -17,7 +17,6 @@ const SelectableIconSingleSelect = (props) => {
17
17
  onChange={() => toggleFormat('Cassette')}
18
18
  text="Cassette"
19
19
  value="Cassette"
20
- {...props}
21
20
  />
22
21
 
23
22
  <SelectableIcon
@@ -29,7 +28,6 @@ const SelectableIconSingleSelect = (props) => {
29
28
  onChange={() => toggleFormat('CD')}
30
29
  text="CD"
31
30
  value="CD"
32
- {...props}
33
31
  />
34
32
 
35
33
  <SelectableIcon
@@ -41,7 +39,6 @@ const SelectableIconSingleSelect = (props) => {
41
39
  onChange={() => toggleFormat('Vinyl')}
42
40
  text="Vinyl"
43
41
  value="Vinyl"
44
- {...props}
45
42
  />
46
43
  </div>
47
44
  )
@@ -4,23 +4,9 @@
4
4
  data: object.data,
5
5
  id: object.id,
6
6
  **combined_html_options) do %>
7
- <% if enable_drag %>
8
- <%= pb_rails("draggable", props: {initial_items: object.items}) do %>
9
- <%= pb_rails("draggable/draggable_container") do %>
10
- <%= pb_rails("list", props: {ordered: false}) do %>
11
- <% object.items.each do |item| %>
12
- <%= pb_rails("draggable/draggable_item", props: {drag_id: item[:drag_id]}) do %>
13
- <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item), drag_id: item[:drag_id]) )%>
14
- <% end %>
15
- <% end %>
16
- <% end %>
17
- <% end %>
18
- <% end %>
19
- <% else %>
20
- <%= pb_rails("list") do %>
21
- <% object.items.each do |item| %>
22
- <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
23
- <% end %>
7
+ <%= pb_rails("list") do %>
8
+ <% object.items.each do |item| %>
9
+ <%= pb_rails("selectable_list/selectable_list_item", props: item.merge(variant: object.variant, id: object.get_id(item)) )%>
24
10
  <% end %>
25
11
  <% end %>
26
12
  <% end %>
@@ -14,9 +14,6 @@ module Playbook
14
14
  prop :items, type: Playbook::Props::Array,
15
15
  default: []
16
16
 
17
- prop :enable_drag, type: Playbook::Props::Boolean,
18
- default: false
19
-
20
17
  def classname
21
18
  generate_classname("pb_selectable_list_kit")
22
19
  end
@@ -4,13 +4,6 @@
4
4
  data: object.data,
5
5
  id: object.id,
6
6
  **combined_html_options) do %>
7
- <% if object.drag_id && object.drag_handle %>
8
- <span style="vertical-align: middle;">
9
- <%= pb_rails("body") do %>
10
- <svg width="auto" height="auto" viewBox="0 0 31 25" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="pb_custom_icon svg-inline--fa vertical_align_middle svg_fw"><path d="M12.904 6.355a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm0 7.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.656-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm4.5-13.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5zm1.5 6c0 .844-.703 1.5-1.5 1.5a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5zm-1.5 9a1.48 1.48 0 01-1.5-1.5c0-.796.657-1.5 1.5-1.5.797 0 1.5.704 1.5 1.5 0 .844-.703 1.5-1.5 1.5z" fill="#242B42"></path></svg>
11
- <% end %>
12
- </span>
13
- <% end %>
14
7
  <% if object.variant == "radio"%>
15
8
  <%= pb_rails("radio", props: { text: object.text, checked: object.checked, input_options: object.input_options } ) %>
16
9
  <% if content.present? %>
@@ -26,10 +19,10 @@
26
19
  <% if object.variant == "checkbox"%>
27
20
  <script>
28
21
  var checkboxElement = document.querySelector("#<%=object.id%> input[type=checkbox]")
29
-
22
+
30
23
  checkboxElement.addEventListener("change", (evt) => {
31
24
  var listItemElement = document.querySelector("#<%=object.id%>")
32
-
25
+
33
26
  if (evt.target.checked) {
34
27
  listItemElement.classList.add("checked_item");
35
28
  } else {
@@ -41,9 +34,9 @@
41
34
  <script>
42
35
  var radioElement = document.querySelector("#<%=object.id%> input[type=radio]")
43
36
 
44
- radioElement.addEventListener("change", () => {
37
+ radioElement.addEventListener("change", () => {
45
38
  var radios = radioElement.closest("ul").querySelectorAll("input[type=radio]")
46
-
39
+
47
40
  radios.forEach((radio) => {
48
41
  if (radio.checked) {
49
42
  radio.closest("li").classList.add("checked_item");
@@ -6,9 +6,6 @@ module Playbook
6
6
  prop :tabindex
7
7
  prop :checked, type: Playbook::Props::Boolean,
8
8
  default: false
9
- prop :drag_handle, type: Playbook::Props::Boolean,
10
- default: true
11
- prop :drag_id, type: Playbook::Props::String
12
9
  prop :name, type: Playbook::Props::String
13
10
  prop :text, type: Playbook::Props::String
14
11
  prop :value, type: Playbook::Props::String
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps, globalInlineProps } from '../utilities/globalProps'
5
+ import PbTable from '.'
5
6
  import {
6
7
  TableHead,
7
8
  TableHeader,
@@ -9,7 +10,6 @@ import {
9
10
  TableRow,
10
11
  TableCell,
11
12
  } from "./subcomponents";
12
- import { addDataTitle } from './utilities/addDataTitle'
13
13
 
14
14
  type TableProps = {
15
15
  aria?: { [key: string]: string },
@@ -196,7 +196,8 @@ const Table = (props: TableProps): React.ReactElement => {
196
196
  }, [stickyRightColumn]);
197
197
 
198
198
  useEffect(() => {
199
- addDataTitle()
199
+ const instance = new PbTable()
200
+ instance.connect()
200
201
  }, [])
201
202
 
202
203
  return (
@@ -1,3 +1,3 @@
1
- The `sticky_left_column` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
1
+ The `stickyLeftColumn` prop expects an array of the column ids you want to be sticky. Make sure to add the corresponding id to the `<th>` and `<td>`.
2
2
 
3
- Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `sticky_left_column`.
3
+ Please ensure that unique ids are used for all columns across multiple tables. Using the same columns ids on multiple tables can lead to issues when using the `stickyLeftColumn`.