playbook_ui 14.4.0 → 14.5.0.pre.alpha.PBNTR568dropdowncleaning4041

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) 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/SortIconButton.tsx +23 -4
  4. data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -1
  5. data/app/pb_kits/playbook/pb_advanced_table/index.js +60 -0
  6. data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +1 -9
  7. data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +1 -9
  8. data/app/pb_kits/playbook/pb_button/_button.tsx +6 -2
  9. data/app/pb_kits/playbook/pb_contact/_contact.tsx +17 -5
  10. data/app/pb_kits/playbook/pb_contact/contact.html.erb +14 -6
  11. data/app/pb_kits/playbook/pb_contact/contact.rb +4 -0
  12. data/app/pb_kits/playbook/pb_contact/contact.test.js +1 -1
  13. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +2 -6
  14. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +2 -7
  15. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +4 -3
  16. data/app/pb_kits/playbook/pb_date_picker/date_picker.html.erb +1 -1
  17. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +4 -0
  18. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +6 -3
  19. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_inline.html.erb +1 -1
  20. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +6 -2
  21. data/app/pb_kits/playbook/pb_dialog/_dialog.scss +2 -0
  22. data/app/pb_kits/playbook/pb_dialog/dialog_header.html.erb +1 -1
  23. data/app/pb_kits/playbook/pb_drawer/_close_icon.tsx +25 -0
  24. data/app/pb_kits/playbook/pb_drawer/_drawer.scss +465 -0
  25. data/app/pb_kits/playbook/pb_drawer/_drawer.tsx +195 -0
  26. data/app/pb_kits/playbook/pb_drawer/_drawer_context.tsx +3 -0
  27. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_borders.jsx +117 -0
  28. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +43 -0
  29. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.html.erb +1 -0
  30. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_default.jsx +63 -0
  31. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_overlay.jsx +55 -0
  32. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_sizes.jsx +113 -0
  33. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +12 -0
  34. data/app/pb_kits/playbook/pb_drawer/docs/index.js +5 -0
  35. data/app/pb_kits/playbook/pb_drawer/drawer.html.erb +12 -0
  36. data/app/pb_kits/playbook/pb_drawer/drawer.rb +8 -0
  37. data/app/pb_kits/playbook/pb_drawer/drawer.test.jsx +77 -0
  38. data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +20 -4
  39. data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +45 -0
  40. data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +1 -0
  41. data/app/pb_kits/playbook/pb_dropdown/docs/index.js +1 -0
  42. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.html.erb +10 -2
  43. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_height.html.erb +5 -1
  44. data/app/pb_kits/playbook/pb_filter/docs/_filter_max_width.html.erb +5 -1
  45. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_background.html.erb +5 -1
  46. data/app/pb_kits/playbook/pb_filter/docs/_filter_no_sort.html.erb +5 -1
  47. data/app/pb_kits/playbook/pb_filter/docs/_filter_only.html.erb +5 -1
  48. data/app/pb_kits/playbook/pb_filter/docs/_filter_placement.html.erb +5 -1
  49. data/app/pb_kits/playbook/pb_filter/docs/_filter_single.html.erb +5 -1
  50. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +9 -1
  51. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +19 -0
  52. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +27 -0
  53. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
  54. data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +2 -0
  55. data/app/pb_kits/playbook/pb_form_pill/docs/index.js +1 -0
  56. data/app/pb_kits/playbook/pb_map/_map_controls.tsx +7 -1
  57. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +210 -232
  58. data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +5 -0
  59. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
  60. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +105 -0
  61. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +1 -0
  62. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +106 -0
  63. data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +1 -0
  64. data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +3 -0
  65. data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -0
  66. data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +149 -0
  67. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change.jsx +12 -1
  68. data/app/pb_kits/playbook/pb_pagination/docs/_pagination_page_change_react.md +3 -1
  69. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +10 -2
  70. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.html.erb +14 -13
  71. data/app/pb_kits/playbook/pb_popover/docs/_popover_list.jsx +4 -4
  72. data/app/pb_kits/playbook/pb_radio/_radio.tsx +92 -33
  73. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.html.erb +2 -0
  74. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_children.jsx +62 -0
  75. data/app/pb_kits/playbook/pb_radio/docs/example.yml +1 -0
  76. data/app/pb_kits/playbook/pb_radio/docs/index.js +1 -0
  77. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +12 -5
  78. data/app/pb_kits/playbook/pb_select/_select.tsx +5 -2
  79. data/app/pb_kits/playbook/pb_select/select.html.erb +1 -1
  80. data/app/pb_kits/playbook/pb_select/select.rb +4 -0
  81. data/app/pb_kits/playbook/pb_text_input/_text_input.scss +0 -1
  82. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +17 -13
  83. data/app/pb_kits/playbook/pb_typeahead/_typeahead.scss +0 -1
  84. data/app/pb_kits/playbook/pb_typeahead/_typeahead.test.jsx +14 -0
  85. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -1
  86. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +6 -5
  87. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +3 -1
  88. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.html.erb +88 -0
  89. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_margin_bottom.jsx +60 -0
  90. data/app/pb_kits/playbook/pb_typeahead/docs/example.yml +2 -0
  91. data/app/pb_kits/playbook/pb_typeahead/docs/index.js +1 -0
  92. data/app/pb_kits/playbook/pb_typeahead/typeahead.html.erb +2 -1
  93. data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +9 -2
  94. data/app/pb_kits/playbook/utilities/icons/allicons.tsx +136 -13
  95. data/app/pb_kits/playbook/utilities/icons/angle-down.svg +3 -0
  96. data/app/pb_kits/playbook/utilities/icons/envelope.svg +3 -0
  97. data/dist/chunks/_typeahead-CT2ByCBK.js +22 -0
  98. data/dist/chunks/_weekday_stacked-CwIBeloD.js +45 -0
  99. data/dist/chunks/lazysizes-B7xYodB-.js +1 -0
  100. data/dist/chunks/lib-CEpcaI8y.js +29 -0
  101. data/dist/chunks/{pb_form_validation-zV9OpdSt.js → pb_form_validation-D9zkwt2b.js} +1 -1
  102. data/dist/chunks/vendor.js +1 -1
  103. data/dist/menu.yml +3 -1
  104. data/dist/playbook-doc.js +1 -1
  105. data/dist/playbook-rails-react-bindings.js +1 -1
  106. data/dist/playbook-rails.js +1 -1
  107. data/dist/playbook.css +1 -1
  108. data/lib/playbook/pagination_renderer.rb +10 -2
  109. data/lib/playbook/pb_doc_helper.rb +5 -5
  110. data/lib/playbook/version.rb +2 -2
  111. metadata +40 -10
  112. data/dist/chunks/_typeahead-B2zRxReA.js +0 -22
  113. data/dist/chunks/_weekday_stacked-BIfZDNDm.js +0 -45
  114. data/dist/chunks/lazysizes-DHz07jlL.js +0 -1
  115. data/dist/chunks/lib-D2U4I1U6.js +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b055334412deb6b6b304df09ff7405b6ca7b07a4bdc663cd1ce30e7651e8686d
4
- data.tar.gz: 4c0e0936783ecea0c757ae724174f41b5592866dd857eed6ed08742581475949
3
+ metadata.gz: 7276cf8a18d6ba899d40091f3a8cee38bc28a154cecf9f7390da283daac0e44a
4
+ data.tar.gz: f99c6b2f4ad8580b33b64b91888f20dafdd7df7603cd44a26c6803f6f2bf505a
5
5
  SHA512:
6
- metadata.gz: 4403d2e0605fe7beb30750f9b2b9a78a42b43de30a4120a01dd6f207c67e63c4752f8c691f5943d6bce83a456ec668a1aeb521f4c11eb7a6174cb9ac563238b1
7
- data.tar.gz: 5c3108aec55e046fefbac7318df7bb3a180988924896a498c4da87dc72e49ba7afe5bd965ecfcd2a562c6d922bc6cd083c02ced994deb046b803148f9aa6ef70
6
+ metadata.gz: a5dcbd59b747abf89a5959410e6fe2cf8feab4032ef31cff0b19a46c3ceaf27bb4fbec97882ed421ddf4069bbcaeeb668a56b343b635372d70bf07376d4d473f
7
+ data.tar.gz: 44bf8232614c890c34d265cd1bee21eed7967aadaede86121c594ad3d7531dd29647c2c6c72c6bc67d743fb5c9b8f613c6f38185883c0c5fb3c8f6e0e1607928
@@ -1,3 +1,4 @@
1
+
1
2
  @import 'pb_advanced_table/advanced_table';
2
3
  @import 'pb_avatar/avatar';
3
4
  @import 'pb_avatar_action_button/avatar_action_button';
@@ -105,6 +106,7 @@
105
106
  @import 'pb_user_badge/user_badge';
106
107
  @import 'pb_walkthrough/walkthrough';
107
108
  @import 'pb_weekday_stacked/weekday_stacked';
109
+ @import 'pb_drawer/drawer';
108
110
  @import 'utilities/mixins';
109
111
  @import 'utilities/spacing';
110
112
  @import 'utilities/cursor';
@@ -4,6 +4,7 @@ import { Header } from "@tanstack/react-table"
4
4
  import { GenericObject } from "../../types"
5
5
 
6
6
  import Icon from "../../pb_icon/_icon"
7
+ import { getAllIcons } from "../../utilities/icons/allicons"
7
8
 
8
9
  import { displayIcon } from "../Utilities/IconHelpers"
9
10
 
@@ -11,21 +12,39 @@ type SortIconButtonProps = {
11
12
  header: Header<GenericObject, unknown>
12
13
  sortIcon?: string | string[]
13
14
  }
15
+
14
16
  export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => {
15
17
 
18
+ const firstIcon = displayIcon(sortIcon)[0]
19
+ const secondIcon = displayIcon(sortIcon)[1]
20
+ const upIcon = getAllIcons()["arrowUpShortWide"].icon as unknown as { [key: string]: SVGElement }
21
+ const downIcon = getAllIcons()["arrowDownShortWide"].icon as unknown as { [key: string]: SVGElement }
22
+
16
23
  return (
17
24
  <>
18
25
  {header.column.getIsSorted() === "desc" ? (
19
26
  <div className="sort-button-icon"
20
- key={displayIcon(sortIcon)[0]}
27
+ key={firstIcon}
21
28
  >
22
- <Icon icon={displayIcon(sortIcon)[0]} />
29
+ { firstIcon === "arrow-up-short-wide" ? (
30
+ <Icon
31
+ className="svg-inline--fa"
32
+ customIcon={upIcon}
33
+ /> ) : (
34
+ <Icon icon={firstIcon} />
35
+ )}
23
36
  </div>
24
37
  ) : (
25
38
  <div className="sort-button-icon"
26
- key={displayIcon(sortIcon)[1]}
39
+ key={secondIcon}
27
40
  >
28
- <Icon icon={displayIcon(sortIcon)[1]} />
41
+ { secondIcon === "arrow-down-short-wide" ? (
42
+ <Icon
43
+ className="svg-inline--fa"
44
+ customIcon={downIcon}
45
+ /> ) : (
46
+ <Icon icon={secondIcon} />
47
+ )}
29
48
  </div>
30
49
  )}
31
50
  </>
@@ -462,4 +462,4 @@ test("responsive none prop functions as expected", () => {
462
462
 
463
463
  const kit = screen.getByTestId(testId)
464
464
  expect(kit).toHaveClass("pb_advanced_table table-responsive-none")
465
- })
465
+ })
@@ -13,9 +13,20 @@ export default class PbAdvancedTable extends PbEnhancedElement {
13
13
  get target() {
14
14
  return document.querySelector(CONTENT_SELECTOR.replace("id", this.element.id))
15
15
  }
16
+
17
+ static expandedRows = new Set()
18
+ static isCollapsing = false
16
19
 
17
20
  connect() {
18
21
  this.element.addEventListener('click', () => {
22
+ if (!PbAdvancedTable.isCollapsing) {
23
+ const isExpanded = this.element.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
24
+ if (!isExpanded) {
25
+ PbAdvancedTable.expandedRows.add(this.element.id)
26
+ } else {
27
+ PbAdvancedTable.expandedRows.delete(this.element.id)
28
+ }
29
+ }
19
30
  this.toggleElement(this.target)
20
31
  })
21
32
  }
@@ -75,4 +86,53 @@ export default class PbAdvancedTable extends PbEnhancedElement {
75
86
  this.element.querySelector(UP_ARROW_SELECTOR).style.display = 'inline-block'
76
87
  this.element.querySelector(DOWN_ARROW_SELECTOR).style.display = 'none'
77
88
  }
89
+
90
+ static handleToggleAllHeaders(element) {
91
+ const table = element.closest('.pb_table')
92
+ const firstLevelButtons = table.querySelectorAll('.pb_advanced_table_body > .pb_table_tr [data-advanced-table]')
93
+
94
+ const expandedRows = Array.from(firstLevelButtons).filter(button =>
95
+ button.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
96
+ )
97
+
98
+ if (expandedRows.length === firstLevelButtons.length) {
99
+ expandedRows.forEach(button => {
100
+ button.click()
101
+ })
102
+ this.expandedRows.clear()
103
+ } else {
104
+ firstLevelButtons.forEach(button => {
105
+ if (!this.expandedRows.has(button.id)) {
106
+ button.click()
107
+ }
108
+ })
109
+ }
110
+ }
111
+ static handleToggleAllSubRows(element, rowDepth) {
112
+ const parentElement = element.closest(".toggle-content")
113
+ const subrowButtons = parentElement.querySelectorAll('.depth-sub-row-' + rowDepth + ' [data-advanced-table]')
114
+
115
+ const expandedSubRows = Array.from(subrowButtons).filter(button =>
116
+ button.querySelector(UP_ARROW_SELECTOR).style.display === 'inline-block'
117
+ )
118
+
119
+ if (expandedSubRows.length === subrowButtons.length) {
120
+ expandedSubRows.forEach(button => {
121
+ button.click()
122
+ })
123
+ } else {
124
+ subrowButtons.forEach(button => {
125
+ if (!this.expandedRows.has(button.id)) {
126
+ button.click()
127
+ }
128
+ })
129
+ }
130
+ }
131
+ }
132
+
133
+ window.expandAllRows = (element) => {
134
+ PbAdvancedTable.handleToggleAllHeaders(element)
78
135
  }
136
+ window.expandAllSubRows = (element, rowDepth) => {
137
+ PbAdvancedTable.handleToggleAllSubRows(element, rowDepth)
138
+ }
@@ -13,12 +13,4 @@
13
13
  <% end %>
14
14
  <% end %>
15
15
  <% end %>
16
- <% end %>
17
-
18
- <script type="text/javascript">
19
- var expandAllRows = (element) => {
20
- element.closest('.pb_table').querySelectorAll('.pb_advanced_table_body > .pb_table_tr [data-advanced-table]').forEach((button) => {
21
- button.dispatchEvent(new Event('click'));
22
- });
23
- };
24
- </script>
16
+ <% end %>
@@ -23,12 +23,4 @@
23
23
  <% end %>
24
24
  <% end %>
25
25
  <% end %>
26
- <% end %>
27
-
28
- <script type="text/javascript">
29
- var expandAllSubRows = (element, rowDepth) => {
30
- element.closest(".toggle-content").querySelectorAll('.depth-sub-row-' + rowDepth + ' [data-advanced-table]').forEach((button) => {
31
- button.dispatchEvent(new Event('click'));
32
- });
33
- };
34
- </script>
26
+ <% end %>
@@ -116,11 +116,15 @@ const Button = (props: ButtonPropTypes): React.ReactElement => {
116
116
  const content = (
117
117
  <span className="pb_button_content">
118
118
  {icon && !iconRight && (
119
- <i className={`pb_icon_kit far fa-${icon} fa-fw button_with_icon`} />
119
+ <Icon className='button_with_icon'
120
+ icon={icon}
121
+ />
120
122
  )}
121
123
  <span>{text || children}</span>
122
124
  {icon && iconRight && (
123
- <i className={`pb_icon_kit far fa-${icon} fa-fw button_with_icon_right`} />
125
+ <Icon className='button_with_icon_right'
126
+ icon={icon}
127
+ />
124
128
  )}
125
129
  </span>
126
130
  )
@@ -7,6 +7,7 @@ import { globalProps } from '../utilities/globalProps'
7
7
  import Body from '../pb_body/_body'
8
8
  import Caption from '../pb_caption/_caption'
9
9
  import Icon from '../pb_icon/_icon'
10
+ import { getAllIcons } from "../utilities/icons/allicons"
10
11
 
11
12
  const contactTypeMap: { [key: string]: string } = {
12
13
  'cell': 'mobile',
@@ -18,6 +19,8 @@ const contactTypeMap: { [key: string]: string } = {
18
19
  'wrong-phone': 'phone-slash',
19
20
  }
20
21
 
22
+ const envelopeIcon = getAllIcons()["envelope"].icon as unknown as { [key: string]: SVGElement }
23
+
21
24
  const formatContact = (contactString: string, contactType: string) => {
22
25
  if (contactType === 'email') return contactString
23
26
 
@@ -91,11 +94,20 @@ const Contact = (props: ContactProps): React.ReactElement => {
91
94
  dark={dark}
92
95
  tag="span"
93
96
  >
94
- <Icon
95
- dark={dark}
96
- fixedWidth
97
- icon={contactTypeMap[contactType] || 'phone'}
98
- />
97
+ {contactType === 'email' ? (
98
+ <Icon
99
+ className="svg-inline--fa envelope"
100
+ customIcon={envelopeIcon}
101
+ dark={dark}
102
+ fixedWidth
103
+ />
104
+ ) : (
105
+ <Icon
106
+ dark={dark}
107
+ fixedWidth
108
+ icon={contactTypeMap[contactType] || 'phone'}
109
+ />
110
+ )}
99
111
  {` ${formatContact(contactValue, contactType)} `}
100
112
  {contactDetail && (
101
113
  <Caption
@@ -4,12 +4,20 @@
4
4
  classname: "pb_contact_kit",
5
5
  color: "light",
6
6
  dark: object.dark
7
- }) do %>
8
- <%= pb_rails("icon", props: {
9
- icon: object.contact_icon,
10
- fixed_width: true,
11
- dark: object.dark
12
- }) %>
7
+ }) do %>
8
+ <% if contact_type == "email" %>
9
+ <%= pb_rails("icon", props: {
10
+ custom_icon: Playbook::Engine::root.join(envelope_path),
11
+ fixed_width: true,
12
+ dark: object.dark
13
+ }) %>
14
+ <% else %>
15
+ <%= pb_rails("icon", props: {
16
+ icon: object.contact_icon,
17
+ fixed_width: true,
18
+ dark: object.dark
19
+ }) %>
20
+ <% end %>
13
21
  <%= object.formatted_contact_value if object.contact_value %>
14
22
 
15
23
  <%= pb_rails("caption", props: {
@@ -44,6 +44,10 @@ module Playbook
44
44
  end
45
45
  end
46
46
 
47
+ def envelope_path
48
+ "app/pb_kits/playbook/utilities/icons/envelope.svg"
49
+ end
50
+
47
51
  private
48
52
 
49
53
  def formatted_value
@@ -79,7 +79,7 @@ test('returns correct icon', () => {
79
79
  expect(screen.getByTestId('test-home').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
80
80
  expect(screen.getByTestId('test-work').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-office')
81
81
  expect(screen.getByTestId('test-work-cell').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-laptop')
82
- expect(screen.getByTestId('test-email').querySelector('.pb_icon_kit')).toHaveClass('fa-envelope')
82
+ expect(screen.getByTestId('test-email').querySelector('.pb_custom_icon')).toHaveClass('envelope')
83
83
  expect(screen.getByTestId('test-wrong-phone').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-slash')
84
84
  expect(screen.getByTestId('test-wrong-type').querySelector('.pb_icon_kit')).toHaveClass('fa-phone')
85
85
  expect(screen.getByTestId('test-extension').querySelector('.pb_icon_kit')).toHaveClass('fa-phone-plus')
@@ -3,11 +3,7 @@ import typography from '../tokens/exports/_typography.module.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
7
- traverseUpButton?: {
8
- position: { y: number };
9
- };
10
- }
6
+ import { PlotTreemapOptions } from "highcharts";
11
7
 
12
8
  const highchartsDarkTheme: ThemeProps = {
13
9
  lang: {
@@ -206,7 +202,7 @@ const highchartsDarkTheme: ThemeProps = {
206
202
  traverseUpButton: {
207
203
  position: { y: -50 },
208
204
  },
209
- } as CustomTreemapOptions,
205
+ } as PlotTreemapOptions,
210
206
  },
211
207
  credits: {
212
208
  enabled: false
@@ -3,12 +3,7 @@ import typography from '../tokens/exports/_typography.module.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- interface CustomTreemapOptions extends Highcharts.SeriesTreemapOptions {
7
- traverseUpButton?: {
8
- position: { y: number };
9
- };
10
- }
11
-
6
+ import { PlotTreemapOptions } from "highcharts";
12
7
 
13
8
  const highchartsTheme: ThemeProps = {
14
9
  lang: {
@@ -206,7 +201,7 @@ const highchartsTheme: ThemeProps = {
206
201
  traverseUpButton: {
207
202
  position: { y: -50 },
208
203
  },
209
- } as CustomTreemapOptions,
204
+ } as PlotTreemapOptions,
210
205
  },
211
206
  credits: {
212
207
  enabled: false
@@ -3,6 +3,7 @@ import classnames from 'classnames'
3
3
 
4
4
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
6
+ import { getAllIcons } from "../utilities/icons/allicons"
6
7
 
7
8
  import datePickerHelper from './date_picker_helper'
8
9
  import Icon from '../pb_icon/_icon'
@@ -161,7 +162,7 @@ useEffect(() => {
161
162
  }
162
163
  return base
163
164
  }
164
-
165
+ const angleDown = getAllIcons()["angleDown"].icon as unknown as { [key: string]: SVGElement }
165
166
 
166
167
  return (
167
168
  <div
@@ -231,8 +232,8 @@ useEffect(() => {
231
232
  id={`${pickerId}-angle-down`}
232
233
  >
233
234
  <Icon
234
- className="angle_down_icon"
235
- icon="angle-down"
235
+ className="angle_down_icon svg-inline--fa"
236
+ customIcon={angleDown}
236
237
  />
237
238
  </div>
238
239
  </div>
@@ -61,7 +61,7 @@
61
61
  >
62
62
  <%= pb_rails("icon", props: {
63
63
  classname: "angle_down_icon",
64
- icon: "angle-down"
64
+ custom_icon: Playbook::Engine::root.join(angle_down_path)
65
65
  }) %>
66
66
  </div>
67
67
  <% end %>
@@ -118,6 +118,10 @@ module Playbook
118
118
  class_string += error_class
119
119
  class_string
120
120
  end
121
+
122
+ def angle_down_path
123
+ "app/pb_kits/playbook/utilities/icons/angle-down.svg"
124
+ end
121
125
  end
122
126
  end
123
127
  end
@@ -5,6 +5,9 @@ import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect'
5
5
  import weekSelect from "flatpickr/dist/plugins/weekSelect/weekSelect"
6
6
  import timeSelectPlugin from './plugins/timeSelect'
7
7
  import quickPickPlugin from './plugins/quickPick'
8
+ import { getAllIcons } from '../utilities/icons/allicons';
9
+
10
+ const angleDown = getAllIcons().angleDown.string
8
11
 
9
12
  const getPositionElement = (element: string | Element) => {
10
13
  return (typeof element === 'string') ? document.querySelectorAll(element)[0] : element
@@ -256,10 +259,10 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
256
259
  })
257
260
  }
258
261
 
259
- // Adding dropdown icons to year and month selects
260
- dropdown.insertAdjacentHTML('afterend', '<i class="far fa-angle-down year-dropdown-icon" id="test-id"></i>')
262
+ // Adding dropdown icons to year and month select
263
+ dropdown.insertAdjacentHTML('afterend', `<i class="year-dropdown-icon">${angleDown}</i>`)
261
264
  if (picker.monthElements[0].parentElement) {
262
- return picker.monthElements[0].insertAdjacentHTML('afterend', '<i class="far fa-angle-down month-dropdown-icon"></i>')}
265
+ return picker.monthElements[0].insertAdjacentHTML('afterend', `<i class="month-dropdown-icon">${angleDown}</i>`)}
263
266
  // if (picker.weekElements[0].parentElement){
264
267
  // return picker.weekElements[0].insertAdjacentHTML('afterend', '<i class="far fa-angle-down year-dropdown-icon" id="test-id"></i>')
265
268
  // }
@@ -14,4 +14,4 @@
14
14
  }
15
15
  fpInline.config.onChange.push(showAngleDownHandler)
16
16
  })
17
- <% end %>
17
+ <% end %>
@@ -76,7 +76,11 @@
76
76
  pointer-events: none;
77
77
  color: $text_lt_light;
78
78
  }
79
-
79
+ .year-dropdown-icon svg, .month-dropdown-icon svg {
80
+ width: 16px;
81
+ margin-top: 6px;
82
+ margin-left: -2px;
83
+ }
80
84
  // Left - Right Arrow Styling
81
85
  .flatpickr-prev-month {
82
86
  display: flex;
@@ -113,4 +117,4 @@
113
117
  }
114
118
  }
115
119
  }
116
- }
120
+ }
@@ -187,6 +187,8 @@
187
187
 
188
188
  &_close_icon {
189
189
  cursor: pointer;
190
+ font-size: $font_base;
191
+ line-height: $lh_normal;
190
192
  }
191
193
 
192
194
  &_overlay {
@@ -2,7 +2,7 @@
2
2
  <%= pb_rails("flex", props: {classname:object.classname, spacing:"between", padding:"sm", align:"center"}) do %>
3
3
  <%= content.presence || object.title %>
4
4
 
5
- <button class="dialog-button-class" type="button" data-close-dialog= <%= object.id %> >
5
+ <button class="dialog-button-class pb_dialog_close_icon" type="button" data-close-dialog= <%= object.id %> >
6
6
  <%= pb_rails("icon", props: { custom_icon: Playbook::Engine::root.join(times_icon) }) %>
7
7
  </button>
8
8
  <% end %>
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import Icon from '../pb_icon/_icon'
3
+
4
+ import { getAllIcons } from "../utilities/icons/allicons"
5
+
6
+ type CloseIconProps = {
7
+ onClose: () => void,
8
+ }
9
+
10
+ export const CloseIcon = (props: CloseIconProps): React.ReactElement => {
11
+ const { onClose } = props
12
+ const timesIcon = getAllIcons()["times"]
13
+ return (
14
+ <div
15
+ className="pb_dialog_close_icon"
16
+ onClick={onClose}
17
+ >
18
+ <Icon
19
+ className="svg-inline--fa"
20
+ customIcon={timesIcon.icon as unknown as { [key: string]: SVGElement }}
21
+ fixedWidth
22
+ />
23
+ </div>
24
+ )
25
+ }