playbook_ui 14.14.0.pre.alpha.revert4339revert4242play1633displaytitle6456 → 14.14.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 (175) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +0 -3
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +5 -6
  5. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.rb +1 -8
  6. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props.html.erb +1 -1
  7. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_rails.md +1 -3
  8. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_react.md +1 -1
  9. data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +0 -2
  10. data/app/pb_kits/playbook/pb_advanced_table/docs/index.js +1 -2
  11. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.scss +66 -0
  12. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +98 -0
  13. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.html.erb +28 -0
  14. data/app/pb_kits/playbook/pb_avatar_action_button/avatar_action_button.rb +42 -0
  15. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.html.erb +19 -0
  16. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_actions.jsx +26 -0
  17. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.html.erb +10 -0
  18. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_default.jsx +17 -0
  19. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_on_click.jsx +19 -0
  20. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_onclick.html.erb +16 -0
  21. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.html.erb +35 -0
  22. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_placement.jsx +42 -0
  23. data/app/pb_kits/playbook/pb_avatar_action_button/docs/_avatar_action_button_tooltip.html.erb +13 -0
  24. data/app/pb_kits/playbook/pb_avatar_action_button/docs/example.yml +15 -0
  25. data/app/pb_kits/playbook/pb_avatar_action_button/docs/index.js +4 -0
  26. data/app/pb_kits/playbook/pb_avatar_action_button/pb_avatar_action_button.test.js +31 -0
  27. data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -1
  28. data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -1
  29. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +8 -17
  30. data/app/pb_kits/playbook/pb_checkbox/checkbox.test.js +0 -16
  31. data/app/pb_kits/playbook/pb_checkbox/docs/example.yml +1 -2
  32. data/app/pb_kits/playbook/pb_checkbox/docs/index.js +0 -1
  33. data/app/pb_kits/playbook/pb_currency/_currency.tsx +31 -46
  34. data/app/pb_kits/playbook/pb_currency/currency.html.erb +8 -15
  35. data/app/pb_kits/playbook/pb_currency/currency.rb +2 -17
  36. data/app/pb_kits/playbook/pb_currency/docs/example.yml +0 -2
  37. data/app/pb_kits/playbook/pb_currency/docs/index.js +1 -2
  38. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
  39. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.html.erb +2 -2
  40. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table.md +1 -4
  41. data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -2
  42. data/app/pb_kits/playbook/pb_draggable/docs/index.js +1 -2
  43. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableContainer.tsx +4 -7
  44. data/app/pb_kits/playbook/pb_draggable/subcomponents/DraggableItem.tsx +3 -6
  45. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +8 -32
  46. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -20
  47. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +0 -5
  48. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -20
  49. data/app/pb_kits/playbook/pb_drawer/drawer.rb +1 -49
  50. data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +0 -1
  51. data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -2
  52. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.html.erb +2 -1
  53. data/app/pb_kits/playbook/pb_icon_button/docs/example.yml +3 -5
  54. data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +1 -1
  55. data/app/pb_kits/playbook/pb_icon_button/icon_button.rb +0 -3
  56. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.html.erb +6 -1
  57. data/app/pb_kits/playbook/pb_nav/item.html.erb +19 -7
  58. data/app/pb_kits/playbook/pb_nav/nav.html.erb +8 -3
  59. data/app/pb_kits/playbook/pb_online_status/online_status.html.erb +6 -1
  60. data/app/pb_kits/playbook/pb_overlay/_overlay.tsx +0 -4
  61. data/app/pb_kits/playbook/pb_overlay/docs/example.yml +0 -2
  62. data/app/pb_kits/playbook/pb_overlay/docs/index.js +0 -1
  63. data/app/pb_kits/playbook/pb_overlay/overlay.html.erb +3 -5
  64. data/app/pb_kits/playbook/pb_overlay/overlay.rb +0 -9
  65. data/app/pb_kits/playbook/pb_overlay/subcomponents/_overlay_token.tsx +10 -48
  66. data/app/pb_kits/playbook/pb_popover/popover.html.erb +6 -1
  67. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.scss +1 -6
  68. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -7
  69. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.html.erb +0 -1
  70. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.jsx +0 -7
  71. data/app/pb_kits/playbook/pb_progress_pills/docs/example.yml +0 -2
  72. data/app/pb_kits/playbook/pb_progress_pills/docs/index.js +0 -1
  73. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.html.erb +7 -2
  74. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.rb +0 -6
  75. data/app/pb_kits/playbook/pb_progress_pills/progress_pills.test.js +1 -26
  76. data/app/pb_kits/playbook/pb_progress_simple/progress_simple.html.erb +5 -1
  77. data/app/pb_kits/playbook/pb_progress_step/progress_step.html.erb +5 -1
  78. data/app/pb_kits/playbook/pb_progress_step/progress_step_item.html.erb +7 -3
  79. data/app/pb_kits/playbook/pb_radio/radio.html.erb +11 -6
  80. data/app/pb_kits/playbook/pb_select/select.rb +0 -8
  81. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible.jsx +1 -1
  82. data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -5
  83. data/app/pb_kits/playbook/pb_table/docs/index.js +1 -3
  84. data/app/pb_kits/playbook/pb_table/index.ts +9 -41
  85. data/app/pb_kits/playbook/pb_table/styles/_collapsible.scss +0 -4
  86. data/app/pb_kits/playbook/pb_table/subcomponents/_table_body.tsx +2 -29
  87. data/app/pb_kits/playbook/pb_table/subcomponents/_table_row.tsx +3 -31
  88. data/app/pb_kits/playbook/pb_table/table_body.html.erb +7 -13
  89. data/app/pb_kits/playbook/pb_table/table_body.rb +0 -2
  90. data/app/pb_kits/playbook/pb_table/table_row.html.erb +7 -14
  91. data/app/pb_kits/playbook/pb_table/table_row.rb +1 -14
  92. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_mask.html.erb +0 -14
  93. data/app/pb_kits/playbook/pb_text_input/index.js +0 -9
  94. data/app/pb_kits/playbook/pb_text_input/text_input.rb +2 -5
  95. data/app/pb_kits/playbook/pb_title/_title.scss +0 -32
  96. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -10
  97. data/app/pb_kits/playbook/pb_title/docs/_title_default.html.erb +2 -1
  98. data/app/pb_kits/playbook/pb_title/docs/_title_default.jsx +1 -1
  99. data/app/pb_kits/playbook/pb_title/docs/example.yml +0 -2
  100. data/app/pb_kits/playbook/pb_title/docs/index.js +0 -1
  101. data/app/pb_kits/playbook/pb_title/title.rb +1 -10
  102. data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +3 -0
  103. data/app/pb_kits/playbook/pb_tooltip/docs/example.yml +0 -2
  104. data/app/pb_kits/playbook/pb_tooltip/index.js +2 -2
  105. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -10
  106. data/dist/chunks/{_typeahead-_d2af7Id.js → _typeahead-btjo1UN5.js} +4 -4
  107. data/dist/chunks/_weekday_stacked-TIh9nTmZ.js +45 -0
  108. data/dist/chunks/{lib-Fr78pbpF.js → lib-DjpLC8uO.js} +2 -2
  109. data/dist/chunks/{pb_form_validation-CN51bfsD.js → pb_form_validation-S56UaHZl.js} +1 -1
  110. data/dist/chunks/vendor.js +1 -1
  111. data/dist/menu.yml +10 -3
  112. data/dist/playbook-doc.js +1 -1
  113. data/dist/playbook-rails-react-bindings.js +1 -1
  114. data/dist/playbook-rails.js +1 -1
  115. data/dist/playbook.css +1 -1
  116. data/lib/playbook/forms/builder.rb +0 -1
  117. data/lib/playbook/version.rb +2 -2
  118. metadata +23 -62
  119. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_custom_cell.jsx +0 -75
  120. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header.html.erb +0 -33
  121. data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_table_props_sticky_header_rails.md +0 -3
  122. data/app/pb_kits/playbook/pb_bar_graph/BarGraphStyles.scss +0 -58
  123. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.jsx +0 -64
  124. data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_pb_styles.md +0 -1
  125. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.jsx +0 -69
  126. data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_react_hook.md +0 -1
  127. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.html.erb +0 -22
  128. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display.jsx +0 -34
  129. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_rails.md +0 -1
  130. data/app/pb_kits/playbook/pb_currency/docs/_currency_null_display_react.md +0 -1
  131. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.jsx +0 -90
  132. data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_table_react.md +0 -5
  133. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_behavior.html.erb +0 -8
  134. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.html.erb +0 -33
  135. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.html.erb +0 -0
  136. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.html.erb +0 -24
  137. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.html.erb +0 -21
  138. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.md +0 -1
  139. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.html.erb +0 -49
  140. data/app/pb_kits/playbook/pb_drawer/index.js +0 -257
  141. data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +0 -71
  142. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_default.jsx +0 -17
  143. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.html.erb +0 -27
  144. data/app/pb_kits/playbook/pb_icon_button/docs/_icon_button_sizes.jsx +0 -61
  145. data/app/pb_kits/playbook/pb_icon_button/docs/index.js +0 -2
  146. data/app/pb_kits/playbook/pb_icon_button/icon_button.test.jsx +0 -39
  147. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.html.erb +0 -11
  148. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.jsx +0 -37
  149. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional.md +0 -1
  150. data/app/pb_kits/playbook/pb_overlay/docs/_overlay_vertical_dynamic_multi_directional_react.md +0 -1
  151. data/app/pb_kits/playbook/pb_overlay/index.js +0 -61
  152. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_default.md +0 -1
  153. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.html.erb +0 -1
  154. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width.jsx +0 -18
  155. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_rails.md +0 -1
  156. data/app/pb_kits/playbook/pb_progress_pills/docs/_progress_pills_full_width_react.md +0 -1
  157. data/app/pb_kits/playbook/pb_select/index.js +0 -38
  158. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.html.erb +0 -47
  159. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.jsx +0 -88
  160. data/app/pb_kits/playbook/pb_table/docs/_table_with_clickable_rows.md +0 -1
  161. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click.html.erb +0 -51
  162. data/app/pb_kits/playbook/pb_table/docs/_table_with_collapsible_with_custom_click_rails.md +0 -2
  163. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.html.erb +0 -96
  164. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.jsx +0 -101
  165. data/app/pb_kits/playbook/pb_table/docs/_table_with_selectable_rows.md +0 -1
  166. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.html.erb +0 -7
  167. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.jsx +0 -54
  168. data/app/pb_kits/playbook/pb_title/docs/_title_display_size.md +0 -1
  169. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.html.erb +0 -39
  170. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_delay_rails.md +0 -3
  171. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_interaction.html.erb +0 -26
  172. data/app/pb_kits/playbook/pb_tooltip/floating_ui.js +0 -282
  173. data/dist/chunks/_weekday_stacked-BZe1DgW-.js +0 -45
  174. data/lib/playbook/forms/builder/time_zone_select_field.rb +0 -19
  175. /data/app/pb_kits/playbook/pb_table/docs/{_table_with_collapsible_with_custom_click_react.md → _table_with_collapsible_with_custom_click.md} +0 -0
@@ -10,4 +10,3 @@ export { default as BarGraphStacked } from './_bar_graph_stacked.jsx'
10
10
  export { default as BarGraphNegativeNumbers } from './_bar_graph_negative_numbers.jsx'
11
11
  export { default as BarGraphSecondaryYAxis } from './_bar_graph_secondary_y_axis.jsx'
12
12
  export { default as BarGraphHorizontal } from './_bar_graph_horizontal.jsx'
13
- export { default as BarGraphPbStyles } from './_bar_graph_pb_styles.jsx'
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef, forwardRef } from 'react'
1
+ import React, { useEffect, useRef } from 'react'
2
2
  import Body from '../pb_body/_body'
3
3
  import Icon from '../pb_icon/_icon'
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
@@ -24,7 +24,7 @@ type CheckboxProps = {
24
24
  value?: string,
25
25
  } & GlobalProps
26
26
 
27
- const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
27
+ const Checkbox = (props: CheckboxProps): React.ReactElement => {
28
28
  const {
29
29
  aria = {},
30
30
  checked = false,
@@ -44,15 +44,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
44
44
  value = '',
45
45
  } = props
46
46
 
47
- const internalRef = useRef<HTMLInputElement>(null)
48
- const setRefs = (el: HTMLInputElement) => {
49
- internalRef.current = el
50
- if (typeof ref === 'function') {
51
- ref(el)
52
- } else if (ref) {
53
- (ref as React.MutableRefObject<HTMLInputElement | null>).current = el
54
- }
55
- }
47
+ const checkRef = useRef(null)
56
48
  const ariaProps = buildAriaProps(aria)
57
49
  const dataProps = buildDataProps(data)
58
50
  const htmlProps = buildHtmlProps(htmlOptions)
@@ -64,9 +56,9 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
64
56
  )
65
57
 
66
58
  useEffect(() => {
67
- if (internalRef.current) {
68
- internalRef.current.checked = checked
69
- internalRef.current.indeterminate = indeterminate
59
+ if (checkRef.current) {
60
+ checkRef.current.checked = checked
61
+ checkRef.current.indeterminate = indeterminate
70
62
  }
71
63
  }, [indeterminate, checked])
72
64
 
@@ -80,7 +72,7 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
80
72
  disabled={disabled}
81
73
  name={name}
82
74
  onChange={onChange}
83
- ref={setRefs}
75
+ ref={checkRef}
84
76
  tabIndex={tabIndex}
85
77
  type="checkbox"
86
78
  value={value}
@@ -127,7 +119,6 @@ const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>((props, ref) => {
127
119
  </Body>
128
120
  </label>
129
121
  )
130
- })
122
+ }
131
123
 
132
- Checkbox.displayName = "Checkbox"
133
124
  export default Checkbox
@@ -106,19 +106,3 @@ test('has disabled attribute', () => {
106
106
  const input = kit.querySelector('input')
107
107
  expect(input).toHaveAttribute('disabled')
108
108
  })
109
-
110
- test('has ref in the input element', () => {
111
- const ref = React.createRef()
112
- render(
113
- <Checkbox
114
- data={{ testid: testId }}
115
- name="checkbox-name"
116
- ref={ref}
117
- text="Checkbox"
118
- value="check-box value"
119
- />
120
- )
121
-
122
- expect(ref.current).not.toBeNull()
123
- expect(ref.current?.tagName).toBe('INPUT')
124
- })
@@ -11,7 +11,6 @@ examples:
11
11
  react:
12
12
  - checkbox_default: Default
13
13
  - checkbox_checked: Load as checked
14
- - checkbox_react_hook: React Hook Form
15
14
  - checkbox_custom: Custom Checkbox
16
15
  - checkbox_error: Default w/ Error
17
16
  - checkbox_indeterminate: Indeterminate Checkbox
@@ -22,4 +21,4 @@ examples:
22
21
  - checkbox_error_swift: Default w/ Error
23
22
  - checkbox_indeterminate_swift: Indeterminate Checkbox
24
23
  - checkbox_props_swift: ""
25
-
24
+
@@ -1,6 +1,5 @@
1
1
  export { default as CheckboxDefault } from './_checkbox_default.jsx'
2
2
  export { default as CheckboxCustom } from './_checkbox_custom.jsx'
3
- export { default as CheckboxReactHook } from './_checkbox_react_hook.jsx'
4
3
  export { default as CheckboxError } from './_checkbox_error.jsx'
5
4
  export { default as CheckboxChecked } from './_checkbox_checked.jsx'
6
5
  export { default as CheckboxIndeterminate } from './_checkbox_indeterminate.jsx'
@@ -21,7 +21,6 @@ type CurrencyProps = {
21
21
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
22
22
  id?: string,
23
23
  label?: string,
24
- nullDisplay?: string,
25
24
  size?: 'sm' | 'md' | 'lg',
26
25
  symbol?: string,
27
26
  variant?: 'default' | 'light' | 'bold',
@@ -50,7 +49,6 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
50
49
  unit,
51
50
  className,
52
51
  label = '',
53
- nullDisplay = '',
54
52
  size = 'sm',
55
53
  symbol = '$',
56
54
  variant = 'default',
@@ -120,57 +118,44 @@ const Currency = (props: CurrencyProps): React.ReactElement => {
120
118
  id={id}
121
119
  >
122
120
  <Caption dark={dark}>{label}</Caption>
121
+
123
122
  <div className={`pb_currency_wrapper${variantClass || emphasizedClass}`}>
124
123
  {unstyled ? (
125
- nullDisplay && !amount ? (
126
- <div>{nullDisplay}</div>
127
- ) : (
128
- <>
129
- <div>{handleNegative}{symbol}</div>
130
- <div>{getAmount}</div>
131
- <div>
132
- {getAbbreviation}
133
- {unit ? unit : getDecimalValue}
134
- </div>
135
- </>
136
- )
124
+ <>
125
+ <div>{handleNegative}{symbol}</div>
126
+ <div>{getAmount}</div>
127
+ <div>
128
+ {getAbbreviation}
129
+ {unit ? unit : getDecimalValue}
130
+ </div>
131
+ </>
137
132
  ) : (
138
- nullDisplay && !amount ? (
133
+ <>
134
+ <Body
135
+ className="dollar_sign"
136
+ color="light"
137
+ dark={dark}
138
+ >
139
+ {handleNegative}{symbol}
140
+ </Body>
141
+
139
142
  <Title
140
143
  className="pb_currency_value"
141
144
  dark={dark}
142
145
  size={sizes[size]}
143
- >
144
- {nullDisplay}
145
- </Title>
146
- ) : (
147
- <>
148
- <Body
149
- className="dollar_sign"
150
- color="light"
151
- dark={dark}
152
- >
153
- {handleNegative}{symbol}
154
- </Body>
155
-
156
- <Title
157
- className="pb_currency_value"
158
- dark={dark}
159
- size={sizes[size]}
160
- >
161
- {getAmount}
162
- </Title>
163
-
164
- <Body
165
- className="unit"
166
- color="light"
167
- dark={dark}
168
- >
169
- {getAbbreviation}
170
- {unit ? unit : getDecimalValue}
171
- </Body>
172
- </>
173
- )
146
+ >
147
+ {getAmount}
148
+ </Title>
149
+
150
+ <Body
151
+ className="unit"
152
+ color="light"
153
+ dark={dark}
154
+ >
155
+ {getAbbreviation}
156
+ {unit ? unit : getDecimalValue}
157
+ </Body>
158
+ </>
174
159
  )}
175
160
  </div>
176
161
  </div>
@@ -1,24 +1,17 @@
1
1
  <%= pb_content_tag do %>
2
2
  <%= pb_rails("caption", props: object.caption_props) %>
3
+
3
4
  <div class=<%= "pb_currency_wrapper#{object.variant_class || object.emphasized_class}" %>>
4
5
  <% if object.unstyled %>
5
- <% if object.null_display && object.amount.blank? %>
6
- <div><%= object.null_display %></div>
7
- <% else %>
8
- <div><%= object.negative_sign %><%= object.symbol %></div>
9
- <div><%= object.title_props[:text] %></div>
10
- <div><%= object.body_props[:text] %></div>
11
- <% end %>
6
+ <div><%= object.negative_sign %><%= object.symbol %></div>
7
+ <div><%= object.title_props[:text] %></div>
8
+ <div><%= object.body_props[:text] %></div>
12
9
  <% else %>
13
- <% if object.null_display && object.amount.blank? %>
14
- <%= pb_rails("title", props: object.title_props) %>
15
- <% else %>
16
- <%= pb_rails("body", props: object.currency_wrapper_props) do %>
17
- <%= object.negative_sign %><%= object.symbol %>
18
- <% end %>
19
- <%= pb_rails("title", props: object.title_props) %>
20
- <%= pb_rails("body", props: object.body_props) %>
10
+ <%= pb_rails("body", props: object.currency_wrapper_props) do %>
11
+ <%= object.negative_sign %><%= object.symbol %>
21
12
  <% end %>
13
+ <%= pb_rails("title", props: object.title_props) %>
14
+ <%= pb_rails("body", props: object.body_props) %>
22
15
  <% end %>
23
16
  </div>
24
17
  <% end %>
@@ -46,9 +46,6 @@ module Playbook
46
46
  prop :comma_separator, type: Playbook::Props::Boolean,
47
47
  default: false
48
48
 
49
- prop :null_display, type: Playbook::Props::String,
50
- required: false
51
-
52
49
  def classname
53
50
  generate_classname("pb_currency_kit", align, size, dark_class)
54
51
  end
@@ -68,20 +65,10 @@ module Playbook
68
65
  }
69
66
  end
70
67
 
71
- def title_text
72
- if null_display
73
- null_display
74
- elsif swap_negative
75
- absolute_amount(abbr_or_format_amount)
76
- else
77
- abbr_or_format_amount
78
- end
79
- end
80
-
81
68
  def title_props
82
69
  {
83
70
  size: size_value,
84
- text: title_text,
71
+ text: swap_negative ? absolute_amount(abbr_or_format_amount) : abbr_or_format_amount,
85
72
  classname: "pb_currency_value",
86
73
  dark: dark,
87
74
  }
@@ -158,10 +145,8 @@ module Playbook
158
145
  1
159
146
  when "md"
160
147
  3
161
- when "sm"
162
- 4
163
148
  else
164
- 3
149
+ 4
165
150
  end
166
151
  end
167
152
 
@@ -10,7 +10,6 @@ examples:
10
10
  - currency_unstyled: Unstyled
11
11
  - currency_comma_separator: Comma Separator
12
12
  - currency_negative: Negative
13
- - currency_null_display: Null Display
14
13
 
15
14
  react:
16
15
  - currency_variants: Variants
@@ -22,7 +21,6 @@ examples:
22
21
  - currency_unstyled: Unstyled
23
22
  - currency_comma_separator: Comma Separator
24
23
  - currency_negative: Negative
25
- - currency_null_display: Null Display
26
24
 
27
25
  swift:
28
26
  - currency_size_swift: Size
@@ -6,5 +6,4 @@ export { default as CurrencyAbbreviated } from './_currency_abbreviated.jsx'
6
6
  export { default as CurrencyMatchingDecimals } from './_currency_matching_decimals.jsx'
7
7
  export { default as CurrencyUnstyled } from './_currency_unstyled.jsx'
8
8
  export { default as CurrencyCommaSeparator } from './_currency_comma_separator.jsx'
9
- export { default as CurrencyNegative } from './_currency_negative.jsx'
10
- export { default as CurrencyNullDisplay } from './_currency_null_display.jsx'
9
+ export { default as CurrencyNegative } from './_currency_negative.jsx'
@@ -29,7 +29,6 @@ type DatePickerProps = {
29
29
  hideLabel?: boolean,
30
30
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
31
31
  id?: string,
32
- initializeOnce?: boolean,
33
32
  inLine?: boolean,
34
33
  inputAria?: { [key: string]: string },
35
34
  inputData?: { [key: string]: string },
@@ -74,7 +73,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
74
73
  hideLabel = false,
75
74
  htmlOptions = {},
76
75
  id,
77
- initializeOnce = false,
78
76
  inLine = false,
79
77
  inputAria = {},
80
78
  inputData = {},
@@ -136,7 +134,7 @@ useEffect(() => {
136
134
  yearRange,
137
135
  required: false,
138
136
  }, scrollContainer)
139
- }, initializeOnce ? [] : undefined)
137
+ })
140
138
  const filteredProps = {...props}
141
139
  if (filteredProps.marginBottom === undefined) {
142
140
  filteredProps.marginBottom = "sm"
@@ -43,9 +43,9 @@
43
43
  <% end %>
44
44
  <% end %>
45
45
 
46
- <%= pb_rails("table/table_body", props: {draggable_container: true}) do %>
46
+ <%= pb_rails("draggable/draggable_container", props: {tag:"tbody"}) do %>
47
47
  <% initial_items.each do |item| %>
48
- <%= pb_rails("table/table_row", props:{drag_id: item[:id], draggable_item: true}) do %>
48
+ <%= pb_rails("draggable/draggable_item", props:{drag_id: item[:id], tag:"tr"}) do %>
49
49
  <%= pb_rails("table/table_cell", props: { text: item[:id]}) %>
50
50
  <%= pb_rails("table/table_cell") do %>
51
51
  <%= pb_rails("flex", props:{align:"center"}) do %>
@@ -1,4 +1 @@
1
- The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this:
2
-
3
- - use the `draggable_container` prop on the table/table_body to designate it as the Draggable Container
4
- - use the `draggable_item` prop on the table/table_row to designate it as the Draggable Item. Make sure to also pass id to the `drag_id` prop here.
1
+ The draggable kit can also be used in conjunction with the table kit to create draggable table rows. To do this, make use of the `tag` prop on the draggable_container to set it to 'tbody' and the same prop on the draggable_item to set that to 'tr'. This will create the functionality seen here.
@@ -4,9 +4,7 @@ examples:
4
4
  - draggable_with_list: Draggable with List Kit
5
5
  - draggable_with_selectable_list: Draggable with SelectableList Kit
6
6
  - draggable_with_cards: Draggable with Cards
7
- - draggable_with_table_react: Draggable with Table
8
7
  - draggable_multiple_containers: Dragging Across Multiple Containers
9
-
10
8
  rails:
11
9
  - draggable_default_rails: Default
12
10
  - draggable_with_list_rails: Draggable with List Kit
@@ -2,5 +2,4 @@ export { default as DraggableDefault } from './_draggable_default.jsx'
2
2
  export { default as DraggableWithCards } from './_draggable_with_cards.jsx'
3
3
  export { default as DraggableWithList } from './_draggable_with_list.jsx'
4
4
  export { default as DraggableWithSelectableList } from './_draggable_with_selectable_list.jsx'
5
- export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
6
- export { default as DraggableWithTableReact } from './_draggable_with_table_react.jsx'
5
+ export { default as DraggableMultipleContainers } from './_draggable_multiple_containers.jsx'
@@ -17,11 +17,10 @@ type DraggableContainerProps = {
17
17
  data?: { [key: string]: string };
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string;
20
- tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
21
20
  };
22
21
 
23
22
  const DraggableContainer = (props: DraggableContainerProps) => {
24
- const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, tag="div" } = props;
23
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id } = props;
25
24
 
26
25
  const { handleDragOver, handleDrop, activeContainer } = DraggableContext();
27
26
 
@@ -29,8 +28,6 @@ const DraggableContainer = (props: DraggableContainerProps) => {
29
28
  const dataProps = buildDataProps(data);
30
29
  const htmlProps = buildHtmlProps(htmlOptions);
31
30
 
32
- const Tag: React.ReactElement | any = `${tag}`;
33
-
34
31
  const classes = classnames(
35
32
  buildCss("pb_draggable_container"),
36
33
  `${activeContainer === container ? "active" : ""}`,
@@ -39,18 +36,18 @@ const DraggableContainer = (props: DraggableContainerProps) => {
39
36
  );
40
37
 
41
38
  return (
42
- <Tag
39
+ <div
43
40
  {...ariaProps}
44
41
  {...dataProps}
45
42
  {...htmlProps}
46
43
  className={classes}
47
44
  id={id}
48
45
  key={container}
49
- onDragOver={(e: Event) => handleDragOver(e, container)}
46
+ onDragOver={(e) => handleDragOver(e, container)}
50
47
  onDrop={() => handleDrop(container)}
51
48
  >
52
49
  {children}
53
- </Tag>
50
+ </div>
54
51
  );
55
52
  };
56
53
 
@@ -18,11 +18,10 @@ type DraggableItemProps = {
18
18
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string;
20
20
  dragId?: string;
21
- tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div' | 'tr' | 'th' | 'td' | 'thead' | 'col' | 'tbody',
22
21
  };
23
22
 
24
23
  const DraggableItem = (props: DraggableItemProps) => {
25
- const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId, tag="div" } = props;
24
+ const { aria = {}, children, className, container, data = {}, htmlOptions = {}, id, dragId } = props;
26
25
 
27
26
  const { isDragging, handleDragStart, handleDragEnter, handleDragEnd } =
28
27
  DraggableContext();
@@ -31,8 +30,6 @@ const DraggableItem = (props: DraggableItemProps) => {
31
30
  const dataProps = buildDataProps(data);
32
31
  const htmlProps = buildHtmlProps(htmlOptions);
33
32
 
34
- const Tag: React.ReactElement | any = `${tag}`;
35
-
36
33
  const classes = classnames(
37
34
  buildCss("pb_draggable_item"),
38
35
  `${isDragging === dragId ? "is_dragging" : ""}`,
@@ -41,7 +38,7 @@ const DraggableItem = (props: DraggableItemProps) => {
41
38
  );
42
39
 
43
40
  return (
44
- <Tag
41
+ <div
45
42
  {...ariaProps}
46
43
  {...dataProps}
47
44
  {...htmlProps}
@@ -54,7 +51,7 @@ const DraggableItem = (props: DraggableItemProps) => {
54
51
  onDragStart={() => handleDragStart(dragId, container)}
55
52
  >
56
53
  {children}
57
- </Tag>
54
+ </div>
58
55
  );
59
56
  };
60
57
 
@@ -134,6 +134,14 @@ body.PBDrawer__Body--close {
134
134
  transition: margin-left $animation-duration ease-out, margin-right $animation-duration ease-out;
135
135
  }
136
136
 
137
+ .pb_drawer_lg_left.pb_drawer {
138
+ transform: translateX(-100%);
139
+ }
140
+
141
+ .pb_drawer_lg_right.pb_drawer {
142
+ transform: translateX(100%);
143
+ }
144
+
137
145
  .pb_drawer.pb_drawer_after_open {
138
146
  pointer-events: auto;
139
147
  transform: translate3d(0, 0, 0);
@@ -149,34 +157,6 @@ body.PBDrawer__Body--close {
149
157
  animation-duration: $animation-duration;
150
158
  outline: none;
151
159
 
152
- &.pb_drawer_within_element_rails {
153
- position: relative;
154
- width: 100%;
155
- display: block;
156
- background-color: $white;
157
- overflow: hidden;
158
-
159
- // Use max-height for a smooth accordion-like animation
160
- max-height: 0;
161
- transition: max-height $animation-duration ease-in-out;
162
- z-index: 1;
163
-
164
- &.open {
165
- max-height: 1000px;
166
- }
167
-
168
- &::before {
169
- content: '';
170
- position: absolute;
171
- top: 0;
172
- left: 0;
173
- right: 0;
174
- bottom: 0;
175
- background-color: inherit;
176
- z-index: -1;
177
- }
178
- }
179
-
180
160
  &.pb_drawer_within_element {
181
161
  position: relative;
182
162
  width: 100%;
@@ -349,10 +329,6 @@ body.PBDrawer__Body--close {
349
329
  opacity: 1;
350
330
  pointer-events: none;
351
331
 
352
- & .pb_drawer {
353
- pointer-events: auto;
354
- }
355
-
356
332
  &_before_close {
357
333
  height: 0;
358
334
  }
@@ -1,20 +1 @@
1
- <%= pb_rails("flex") do %>
2
- <%= pb_rails("button", props: { text: "Left Drawer", margin_right: "sm", data: {"open-drawer": "drawer-1"} }) %>
3
-
4
- <%= pb_rails("drawer", props: {
5
- id:"drawer-1",
6
- }) do %>
7
- Test me (Left Drawer)
8
- <% end %>
9
-
10
-
11
- <%= pb_rails("button", props: { text: "Right Drawer", data: {"open-drawer": "drawer-2"} }) %>
12
-
13
- <%= pb_rails("drawer", props: {
14
- id:"drawer-2",
15
- placement: "right"
16
- }) do %>
17
- Test me (Right Drawer)
18
- <% end %>
19
- <% end %>
20
-
1
+ <%= pb_rails("drawer") %>
@@ -2,11 +2,6 @@ examples:
2
2
 
3
3
  rails:
4
4
  - drawer_default: Default
5
- - drawer_behavior: Push Behavior
6
- - drawer_menu: Within Element
7
- - drawer_sizes: Sizes
8
- - drawer_overlay: Overlay
9
- - drawer_borders: Borders
10
5
 
11
6
 
12
7
  react:
@@ -1,20 +1,12 @@
1
- <% if within_element %>
2
- <%= pb_content_tag(:div, data: {breakpoint: object.breakpoint} ) do %>
3
- <%= content %>
4
- <% end %>
5
- <% else %>
6
- <div class="pb_drawer_wrapper"
7
- id="drawer-wrapper-<%= object.id %>"
8
- style="display:none;"
9
- data-behavior="<%= object.behavior %>"
10
- data-size="<%= object.size %>"
11
- data-placement="<%= object.placement %>"
12
- data-breakpoint="<%= object.breakpoint %>"
13
- >
14
- <div class="<%= overlay_classes %>" style="display:none;" id="drawer-overlay-<%= object.id %>">
15
- <%= pb_content_tag do %>
16
- <%= content %>
17
- <% end %>
18
- </div>
19
- </div>
20
- <% end %>
1
+ <!-- Go to pb_content_tag definition in kit_base.rb for usage information. Commented out options are default (showing the default shape), and each can be deleted if not customizing that param. -->
2
+ <!-- If using nonstandard params please un-comment out and replace with your custom params. -->
3
+ <%= pb_content_tag(
4
+ # :div,
5
+ # aria: object.aria,
6
+ # class: object.classname,
7
+ # data: object.data,
8
+ # id: object.id,
9
+ # **combined_html_options
10
+ ) do %>
11
+ <span>DRAWER CONTENT</span>
12
+ <% end %>
@@ -2,55 +2,7 @@
2
2
 
3
3
  module Playbook
4
4
  module PbDrawer
5
- class Drawer < Playbook::KitBase
6
- prop :size, type: Playbook::Props::Enum,
7
- values: %w[xs sm md lg xl full],
8
- default: "md"
9
- prop :placement, type: Playbook::Props::Enum,
10
- values: %w[left right bottom],
11
- default: "left"
12
- prop :behavior, type: Playbook::Props::Enum,
13
- values: %w[floating push],
14
- default: "floating"
15
- prop :overlay, type: Playbook::Props::Boolean,
16
- default: true
17
- prop :within_element, type: Playbook::Props::Boolean,
18
- default: false
19
- prop :border, type: Playbook::Props::Enum,
20
- values: %w[full none right left],
21
- default: "none"
22
- prop :breakpoint, type: Playbook::Props::Enum,
23
- values: %w[none xs sm md lg xl],
24
- default: "none"
25
-
26
- def classname
27
- generate_classname("pb_drawer pb_drawer_#{size}_#{placement} #{within_class} #{border_classes}")
28
- end
29
-
30
- def border_classes
31
- case border
32
- when "full"
33
- "drawer_border-full"
34
- when "right"
35
- "drawer_border-right"
36
- when "left"
37
- "drawer_border-left"
38
- else
39
- ""
40
- end
41
- end
42
-
43
- def overlay_close
44
- !should_close_on_overlay_click ? "overlay_close" : ""
45
- end
46
-
47
- def within_class
48
- within_element ? "pb_drawer_within_element_rails" : ""
49
- end
50
-
51
- def overlay_classes
52
- "pb_drawer_#{overlay ? '' : 'no_'}overlay drawer_content_#{placement} pb_drawer_overlay_after_open #{overlay ? '' : 'no-background'}"
53
- end
5
+ class Drawer < ::Playbook::KitBase
54
6
  end
55
7
  end
56
8
  end
@@ -46,7 +46,6 @@
46
46
  %>
47
47
  <%= form.date_picker :example_date_picker_1, props: { label: true } %>
48
48
  <%= form.star_rating_field :example_star_rating, props: { variant: "interactive", label: true } %>
49
- <%= form.time_zone_select_field :example_time_zone_select, ActiveSupport::TimeZone.us_zones, { default: "Eastern Time (US & Canada)" }, props: { label: true } %>
50
49
 
51
50
  <%= form.actions do |action| %>
52
51
  <%= action.submit %>