playbook_ui 13.14.0 → 13.15.0.pre.alpha.PLAY10831873

Sign up to get free protection for your applications and to get access to all the features.
Files changed (183) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
  4. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
  5. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
  6. data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
  7. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
  8. data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
  9. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
  10. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
  11. data/app/pb_kits/playbook/pb_body/body.rb +1 -8
  12. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
  13. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
  14. data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
  15. data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
  16. data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
  17. data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
  19. data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
  20. data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
  21. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
  22. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
  23. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
  24. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
  25. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
  26. data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
  27. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
  28. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
  29. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_colors_swift.md +27 -0
  30. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default_swift.md +22 -0
  31. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_props_table.md +8 -0
  32. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_sizes_swift.md +26 -0
  33. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -0
  34. data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
  35. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
  36. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
  37. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -57
  38. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +4 -57
  39. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
  40. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
  41. data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
  42. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
  43. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
  44. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
  45. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
  46. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
  47. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
  48. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
  49. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
  50. data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
  51. data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -5
  52. data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
  53. data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
  54. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
  55. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
  56. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
  57. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
  58. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
  59. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
  60. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
  61. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
  62. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
  63. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
  64. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
  65. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
  66. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
  67. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
  68. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
  69. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
  70. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +44 -30
  71. data/app/pb_kits/playbook/pb_flex/_flex.tsx +5 -5
  72. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
  73. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +4 -3
  74. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +8 -5
  75. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +11 -11
  76. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
  77. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
  78. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +11 -10
  79. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  80. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
  81. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +4 -3
  82. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +4 -3
  83. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  84. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
  85. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  86. data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
  87. data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
  88. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
  89. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
  90. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  91. data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
  92. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  93. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  94. data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
  95. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  96. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
  97. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
  98. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
  99. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
  100. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
  101. data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
  102. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_bold_swift.md +17 -0
  103. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_default_swift.md +17 -0
  104. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_no_highlight_swift.md +18 -0
  105. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_swift.md +18 -0
  106. data/app/pb_kits/playbook/pb_nav/docs/_nav_props_swift.md +11 -0
  107. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_bold_swift.md +18 -0
  108. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_default_swift.md +18 -0
  109. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_no_highlight_swift.md +19 -0
  110. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_swift.md +17 -0
  111. data/app/pb_kits/playbook/pb_nav/docs/example.yml +17 -0
  112. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
  113. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
  114. data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
  115. data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
  116. data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
  117. data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
  118. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
  119. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
  120. data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
  121. data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
  122. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
  123. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
  124. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
  125. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
  126. data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
  127. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
  128. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
  129. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -1
  130. data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
  131. data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
  132. data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
  133. data/app/pb_kits/playbook/pb_select/docs/example.yml +5 -0
  134. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
  135. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
  136. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
  137. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
  138. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
  139. data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
  140. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
  141. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
  142. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
  143. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  144. data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
  145. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  146. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
  147. data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
  148. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  149. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
  150. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  151. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  152. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
  153. data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
  154. data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
  155. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
  156. data/app/pb_kits/playbook/pb_title/title.rb +2 -9
  157. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
  158. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
  159. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  160. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
  161. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  162. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
  163. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  164. data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
  165. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
  166. data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
  167. data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
  168. data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
  169. data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
  170. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
  171. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
  172. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  173. data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
  174. data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
  175. data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
  176. data/app/pb_kits/playbook/utilities/props.ts +2 -2
  177. data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
  178. data/dist/playbook-rails.js +4 -4
  179. data/lib/playbook/classnames.rb +1 -0
  180. data/lib/playbook/kit_base.rb +2 -0
  181. data/lib/playbook/truncate.rb +29 -0
  182. data/lib/playbook/version.rb +2 -2
  183. metadata +39 -7
@@ -2,7 +2,8 @@ import React, { useEffect, useState } from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import { globalProps } from "../utilities/globalProps";
5
- import { buildHtmlProps } from '../utilities/props'
5
+ import { buildHtmlProps } from "../utilities/props";
6
+ import { VoidCallback } from "../types";
6
7
 
7
8
  import Icon from "../pb_icon/_icon";
8
9
  import Title from "../pb_title/_title";
@@ -15,23 +16,23 @@ const iconMap = {
15
16
  };
16
17
 
17
18
  type FixedConfirmationToastProps = {
18
- autoClose?: number,
19
- children?: React.ReactChild[] | React.ReactChild,
20
- className?: string,
21
- closeable?: boolean,
22
- data?: string,
23
- horizontal?: "right" | "left" | "center",
24
- htmlOptions?: {[key: string]: string | number | boolean | Function},
25
- id?: string,
26
- multiLine?: boolean,
27
- onClose?: () => void,
28
- open?: boolean,
29
- status?: "success" | "error" | "neutral" | "tip",
30
- text?: string,
31
- vertical?: "top" | "bottom",
32
- }
19
+ autoClose?: number;
20
+ children?: React.ReactChild[] | React.ReactChild;
21
+ className?: string;
22
+ closeable?: boolean;
23
+ data?: string;
24
+ horizontal?: "right" | "left" | "center";
25
+ htmlOptions?: { [key: string]: string | number | boolean | (VoidCallback) };
26
+ id?: string;
27
+ multiLine?: boolean;
28
+ onClose?: VoidCallback;
29
+ open?: boolean;
30
+ status?: "success" | "error" | "neutral" | "tip";
31
+ text?: string;
32
+ vertical?: "top" | "bottom";
33
+ };
33
34
 
34
- const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
35
+ const FixedConfirmationToast = (props: FixedConfirmationToastProps): React.ReactElement => {
35
36
  const [showToast, toggleToast] = useState(true);
36
37
  const {
37
38
  autoClose = 0,
@@ -41,7 +42,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
41
42
  horizontal,
42
43
  htmlOptions = {},
43
44
  multiLine = false,
44
- onClose = () => { },
45
+ onClose = () => undefined,
45
46
  open = true,
46
47
  status = "neutral",
47
48
  text,
@@ -65,7 +66,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
65
66
  onClose();
66
67
  }, autoClose);
67
68
  }
68
- }
69
+ };
69
70
 
70
71
  useEffect(() => {
71
72
  toggleToast(open);
@@ -80,22 +81,35 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
80
81
  return (
81
82
  <>
82
83
  {showToast && (
83
- <div className={css} onClick={handleClick} {...htmlProps}>
84
- {icon && <Icon className="pb_icon" fixedWidth icon={icon} />}
84
+ <div
85
+ className={css}
86
+ onClick={handleClick}
87
+ {...htmlProps}
88
+ >
89
+ {icon && (
90
+ <Icon
91
+ className="pb_icon"
92
+ fixedWidth
93
+ icon={icon}
94
+ />
95
+ )}
85
96
 
86
- {
87
- children && children ||
88
- text && (
97
+ {(children && children) ||
98
+ (text && (
89
99
  <Title
90
- className="pb_fixed_confirmation_toast_text"
91
- size={4}
92
- text={text}
100
+ className="pb_fixed_confirmation_toast_text"
101
+ size={4}
102
+ text={text}
93
103
  />
94
- )
95
- }
104
+ ))}
96
105
 
97
106
  {closeable && (
98
- <Icon className="pb_icon" cursor="pointer" fixedWidth={false} icon="times" />
107
+ <Icon
108
+ className="pb_icon"
109
+ cursor="pointer"
110
+ fixedWidth={false}
111
+ icon="times"
112
+ />
99
113
  )}
100
114
  </div>
101
115
  )}
@@ -2,15 +2,15 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { GlobalProps, globalProps } from '../utilities/globalProps'
5
- import { Sizes } from '../types'
5
+ import { GenericObject, Sizes } from '../types'
6
6
 
7
7
  type FlexProps = {
8
8
  children: React.ReactChild[] | React.ReactNode,
9
9
  className?: string,
10
- data?: object,
10
+ data?: GenericObject,
11
11
  horizontal?: "left" | "center" | "right" | "stretch" | "none",
12
12
  justify?: "start" | "center" | "end" | "around" | "between" | "evenly" | "none",
13
- htmlOptions?: {[key: string]: string | number | boolean | Function},
13
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  id?: string,
15
15
  inline?: boolean,
16
16
  orientation?: "row" | "column",
@@ -25,7 +25,7 @@ type FlexProps = {
25
25
  alignSelf?: "start" | "end" | "center" | "stretch" | "none"
26
26
  } & GlobalProps
27
27
 
28
- const Flex = (props: FlexProps) => {
28
+ const Flex = (props: FlexProps): React.ReactElement => {
29
29
  const {
30
30
  align = 'none',
31
31
  children,
@@ -45,7 +45,7 @@ const Flex = (props: FlexProps) => {
45
45
  wrap = false,
46
46
  alignSelf = 'none',
47
47
  } = props
48
-
48
+
49
49
  const orientationClass =
50
50
  orientation !== undefined ? `orientation_${orientation}` : ''
51
51
  const justifyClass =
@@ -6,7 +6,7 @@ type FlexItemPropTypes = {
6
6
  children: React.ReactNode[] | React.ReactNode,
7
7
  fixedSize?: string,
8
8
  grow?: boolean,
9
- htmlOptions?: { [key: string]: string | number | boolean | Function },
9
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) },
10
10
  shrink?: boolean,
11
11
  className?: string,
12
12
  order?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'first' | 'none',
@@ -2,18 +2,19 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
+ import { GenericObject } from '../types'
5
6
 
6
7
  type FormGroupProps = {
7
8
  aria?: {[key: string]: string},
8
9
  children?: Node,
9
10
  className?: string,
10
- data?: object,
11
+ data?: GenericObject,
11
12
  fullWidth?: boolean,
12
- htmlOptions?: {[key: string]: string | number | boolean | Function},
13
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
13
14
  id?: string,
14
15
  }
15
16
 
16
- const FormGroup = (props: FormGroupProps) => {
17
+ const FormGroup = (props: FormGroupProps): React.ReactElement => {
17
18
  const {
18
19
  aria = {},
19
20
  className,
@@ -9,7 +9,7 @@ import { buildHtmlProps } from '../utilities/props'
9
9
 
10
10
  type FormPillProps = {
11
11
  className?: string,
12
- htmlOptions?: {[key: string]: string | number | boolean | Function},
12
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
13
13
  id?: string,
14
14
  text: string,
15
15
  name?: string,
@@ -22,16 +22,16 @@ type FormPillProps = {
22
22
  onClick?: React.MouseEventHandler<HTMLSpanElement>,
23
23
  onMouseDown?: React.MouseEventHandler<HTMLSpanElement>,
24
24
  onTouchEnd?: React.TouchEventHandler<HTMLSpanElement>,
25
- },
25
+ },
26
26
  } & GlobalProps
27
- const FormPill = (props: FormPillProps) => {
27
+ const FormPill = (props: FormPillProps): React.ReactElement => {
28
28
  const {
29
29
  className,
30
30
  htmlOptions = {},
31
31
  id,
32
32
  text,
33
33
  name,
34
- onClick = () => {},
34
+ onClick = () => undefined,
35
35
  avatarUrl,
36
36
  closeProps = {},
37
37
  size = '',
@@ -48,7 +48,10 @@ const FormPill = (props: FormPillProps) => {
48
48
  const htmlProps = buildHtmlProps(htmlOptions)
49
49
 
50
50
  return (
51
- <div className={css} id={id} {...htmlProps}>
51
+ <div className={css}
52
+ id={id}
53
+ {...htmlProps}
54
+ >
52
55
  {name &&
53
56
  <>
54
57
  <Avatar
@@ -12,17 +12,18 @@ import typography from "../tokens/exports/_typography.scss";
12
12
 
13
13
  import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
14
14
  import { globalProps } from "../utilities/globalProps";
15
+ import { GenericObject } from "../types";
15
16
 
16
17
  type GaugeProps = {
17
18
  aria: { [key: string]: string };
18
19
  className?: string;
19
20
  chartData?: { name: string; value: number[] | number }[];
20
- dark?: Boolean;
21
+ dark?: boolean;
21
22
  data?: { [key: string]: string };
22
23
  disableAnimation?: boolean;
23
24
  fullCircle?: boolean;
24
25
  height?: string;
25
- htmlOptions?: {[key: string]: string | number | boolean | Function},
26
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
26
27
  id?: string;
27
28
  max?: number;
28
29
  min?: number;
@@ -33,13 +34,12 @@ type GaugeProps = {
33
34
  title?: string;
34
35
  tooltipHtml?: string;
35
36
  colors: string[];
36
- minorTickInterval: any;
37
+ minorTickInterval?: number;
37
38
  circumference: number[];
38
39
  };
39
40
 
40
41
  const Gauge = ({
41
42
  aria = {},
42
- className,
43
43
  chartData,
44
44
  dark = false,
45
45
  data = {},
@@ -61,9 +61,9 @@ const Gauge = ({
61
61
  minorTickInterval = null,
62
62
  circumference = fullCircle ? [0, 360] : [-100, 100],
63
63
  ...props
64
- }: GaugeProps) => {
64
+ }: GaugeProps): React.ReactElement => {
65
65
  const ariaProps = buildAriaProps(aria);
66
- const dataProps = buildDataProps(data)
66
+ const dataProps = buildDataProps(data)
67
67
  const htmlProps = buildHtmlProps(htmlOptions);
68
68
  highchartsMore(Highcharts);
69
69
  solidGauge(Highcharts);
@@ -89,7 +89,7 @@ const Gauge = ({
89
89
  const [options, setOptions] = useState({});
90
90
 
91
91
  useEffect(() => {
92
- const formattedChartData = chartData.map((obj: any) => {
92
+ const formattedChartData = chartData.map((obj: GenericObject) => {
93
93
  obj.y = obj.value;
94
94
  delete obj.value;
95
95
  return obj;
@@ -185,20 +185,20 @@ const Gauge = ({
185
185
  .querySelectorAll(".fix")
186
186
  .forEach((fix) => fix.setAttribute("y", "38"));
187
187
  }
188
-
188
+ // eslint-disable-next-line react-hooks/exhaustive-deps
189
189
  }, [chartData]);
190
190
 
191
191
  return (
192
192
  <HighchartsReact
193
- containerProps={{
193
+ containerProps={{
194
194
  className: classnames(css, globalProps(props)),
195
195
  id: id,
196
196
  ...ariaProps,
197
197
  ...dataProps,
198
198
  ...htmlProps,
199
199
  }}
200
- highcharts={Highcharts}
201
- options={options}
200
+ highcharts={Highcharts}
201
+ options={options}
202
202
  />
203
203
  );
204
204
  };
@@ -14,7 +14,7 @@ type HashtagProps = {
14
14
  className?: string,
15
15
  dark?: boolean,
16
16
  data?: string,
17
- htmlOptions?: {[key: string]: string | number | boolean | Function},
17
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  id?: string,
19
19
  newWindow?: boolean,
20
20
  rel?: string,
@@ -8,7 +8,7 @@ import { buildHtmlProps } from '../utilities/props'
8
8
  type HighlightProps = {
9
9
  className?: string,
10
10
  data?: {[key: string]: string},
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  children?: React.ReactChild[] | React.ReactChild | string,
14
14
  text?: string,
@@ -8,6 +8,7 @@ import Body from '../pb_body/_body'
8
8
  import Hashtag from '../pb_hashtag/_hashtag'
9
9
  import Title from '../pb_title/_title'
10
10
  import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
11
+ import { GenericObject } from '../types'
11
12
 
12
13
  type HomeAddressStreetProps = {
13
14
  aria?: { [key: string]: string },
@@ -18,7 +19,7 @@ type HomeAddressStreetProps = {
18
19
  data?: { [key: string]: string },
19
20
  dark?: boolean,
20
21
  emphasis: "street" | "city",
21
- htmlOptions?: {[key: string]: string | number | boolean | Function},
22
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
22
23
  homeId: string,
23
24
  houseStyle: string,
24
25
  homeUrl: string,
@@ -28,7 +29,7 @@ type HomeAddressStreetProps = {
28
29
  territory: string,
29
30
  }
30
31
 
31
- const HomeAddressStreet = (props: HomeAddressStreetProps) => {
32
+ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement => {
32
33
  const {
33
34
  address,
34
35
  addressCont,
@@ -58,17 +59,17 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
58
59
  className
59
60
  )
60
61
 
61
- const dataProps: { [key: string]: any } = buildDataProps(data)
62
- const ariaProps: { [key: string]: any } = buildAriaProps(aria)
62
+ const dataProps: GenericObject = buildDataProps(data)
63
+ const ariaProps: GenericObject = buildAriaProps(aria)
63
64
  const htmlProps = buildHtmlProps(htmlOptions)
64
65
  return (
65
- <div
66
- className={classes(className, dark)}
67
- {...ariaProps}
68
- {...dataProps}
69
- {...htmlProps}
66
+ <div
67
+ className={classes(className, dark)}
68
+ {...ariaProps}
69
+ {...dataProps}
70
+ {...htmlProps}
70
71
  >
71
- {emphasis == 'street' &&
72
+ {emphasis == 'street' &&
72
73
  <div>
73
74
  <Title
74
75
  className="pb_home_address_street_address"
@@ -28,7 +28,7 @@ type IconProps = {
28
28
  fixedWidth?: boolean,
29
29
  flip?: "horizontal" | "vertical" | "both" | "none",
30
30
  icon: string,
31
- htmlOptions?: {[key: string]: string | number | boolean | Function},
31
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
32
32
  id?: string,
33
33
  inverse?: boolean,
34
34
  listItem?: boolean,
@@ -13,7 +13,7 @@ type IconCircleProps = {
13
13
  dark?: boolean,
14
14
  data?: {[key:string]: string},
15
15
  icon: string,
16
- htmlOptions?: {[key: string]: string | number | boolean | Function},
16
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  size?: "base" | "xs" | "sm" | "md" | "lg" | "xl",
19
19
  variant?: | "default"
@@ -9,14 +9,15 @@ import Caption from '../pb_caption/_caption'
9
9
  import Flex from '../pb_flex/_flex'
10
10
  import IconCircle from '../pb_icon_circle/_icon_circle'
11
11
  import Title from '../pb_title/_title'
12
+ import { GenericObject } from '../types'
12
13
 
13
14
  type IconStatValueProps = {
14
15
  aria?: { [key: string]: string },
15
16
  className?: string,
16
- data?: object,
17
+ data?: GenericObject,
17
18
  dark?: boolean,
18
19
  icon: string,
19
- htmlOptions?: {[key: string]: string | number | boolean | Function},
20
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
20
21
  id?: string,
21
22
  orientation?: "vertical" | "horizontal",
22
23
  size?: "sm" | "md" | "lg",
@@ -34,7 +35,7 @@ type IconStatValueProps = {
34
35
  | "green",
35
36
  }
36
37
 
37
- const IconStatValue = (props: IconStatValueProps) => {
38
+ const IconStatValue = (props: IconStatValueProps): React.ReactElement => {
38
39
  const {
39
40
  aria = {},
40
41
  className,
@@ -6,20 +6,21 @@ import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
8
8
  import Icon from '../pb_icon/_icon'
9
+ import { GenericObject } from '../types'
9
10
 
10
11
  type IconValueProps = {
11
12
  align?: "left" | "center" | "right",
12
13
  aria?: { [key: string]: string; },
13
14
  className?: string,
14
15
  dark?: boolean,
15
- data?: object,
16
+ data?: GenericObject,
16
17
  icon: string,
17
- htmlOptions?: {[key: string]: string | number | boolean | Function},
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
19
  id?: string,
19
20
  text: string,
20
21
  }
21
22
 
22
- const IconValue = (props: IconValueProps) => {
23
+ const IconValue = (props: IconValueProps): React.ReactElement => {
23
24
  const {
24
25
  align = 'left',
25
26
  aria = {},
@@ -8,7 +8,7 @@ type ImageType = {
8
8
  aria?: {[key: string]: string},
9
9
  className?: string,
10
10
  data?: {[key: string]: string},
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  onError?: () => void,
14
14
  size?: "xs" | "sm" | "md" | "lg" | "xl",
@@ -11,7 +11,7 @@ type LabelPillProps = {
11
11
  aria?: {[key: string]:string},
12
12
  className?: string,
13
13
  data?: {[key: string]:string},
14
- htmlOptions?: {[key: string]: string | number | boolean | Function},
14
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
15
15
  id?: string,
16
16
  label?: string,
17
17
  pillValue?: string,
@@ -17,7 +17,7 @@ type LabelValueProps = {
17
17
  dark?: boolean;
18
18
  data?: object;
19
19
  date?: Date;
20
- htmlOptions?: {[key: string]: string | number | boolean | Function};
20
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
21
21
  id?: string;
22
22
  label: string;
23
23
  value?: string;
@@ -12,7 +12,7 @@ type LayoutPropTypes = {
12
12
  dark?: boolean,
13
13
  data?: object,
14
14
  full?: boolean,
15
- htmlOptions?: {[key: string]: string | number | boolean | Function},
15
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  position?: "left" | "right",
17
17
  responsive?: boolean,
18
18
  size?: "xs" | "sm" | "md" | "base" | "lg" | "xl",
@@ -13,7 +13,7 @@ type LegendProps = {
13
13
  color?: string,
14
14
  dark?: boolean,
15
15
  data?: object,
16
- htmlOptions?: {[key: string]: string | number | boolean | Function},
16
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  prefixText?: string,
19
19
  text: string,
@@ -24,7 +24,7 @@ type LightboxHeaderProps = {
24
24
  className?: string;
25
25
  closeable?: boolean;
26
26
  data?: { [key: string]: string | number };
27
- htmlOptions?: { [key: string]: string | number | boolean | Function };
27
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
28
28
  icon?: string;
29
29
  id?: string;
30
30
  onClickRight?: () => void;
@@ -15,7 +15,7 @@ type LightboxType = {
15
15
  currentPhotoIndex?: number,
16
16
  data?: {[key: string]: string | number},
17
17
  description?: string | any,
18
- htmlOptions?: {[key: string]: string | number | boolean | Function},
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string,
20
20
  photos: [],
21
21
  initialPhoto?: number,
@@ -22,7 +22,7 @@ type LineGraphProps = {
22
22
  data: number[];
23
23
  }[];
24
24
  gradient?: boolean;
25
- htmlOptions?: {[key: string]: string | number | boolean | Function};
25
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
26
26
  id: string;
27
27
  pointStart: number;
28
28
  subTitle?: string;
@@ -10,7 +10,7 @@ type ListProps = {
10
10
  children: React.ReactNode[] | React.ReactNode;
11
11
  dark?: boolean;
12
12
  data?: object;
13
- htmlOptions?: {[key: string]: string | number | boolean | Function};
13
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  id?: string;
15
15
  layout?: "" | "left" | "right";
16
16
  ordered?: boolean;
@@ -8,7 +8,7 @@ type ListItemProps = {
8
8
  children: React.ReactNode[] | React.ReactNode,
9
9
  className?: string,
10
10
  data?: object,
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  tabIndex?: number,
14
14
  }
@@ -12,7 +12,7 @@ type LoadingInlineProps = {
12
12
  aria?: { [key: string]: string },
13
13
  className?: string,
14
14
  data?: { [key: string]: string },
15
- htmlOptions?: {[key: string]: string | number | boolean | Function},
15
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  id?: string,
17
17
  }
18
18
 
@@ -10,7 +10,7 @@ type MapProps = {
10
10
  children?: React.ReactChild[] | React.ReactNode,
11
11
  className?: string,
12
12
  data?: { [key: string]: string },
13
- htmlOptions?: {[key: string]: string | number | boolean | Function},
13
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  id?: string,
15
15
  zoomBtns?: boolean,
16
16
  flyTo?: boolean,
@@ -21,7 +21,7 @@ type MessageProps = {
21
21
  children?: React.ReactChild[] | React.ReactChild,
22
22
  className?: string,
23
23
  data?: object,
24
- htmlOptions?: {[key: string]: string | number | boolean | Function},
24
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
25
25
  id?: string,
26
26
  label?: string,
27
27
  message: string,
@@ -8,7 +8,7 @@ type MessageMentionProps = {
8
8
  children?: React.ReactChild[] | React.ReactChild,
9
9
  className?: string,
10
10
  data?: object,
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  variant: 'user' | 'self',
14
14
  }
@@ -24,7 +24,7 @@ type MultiLevelSelectProps = {
24
24
  aria?: { [key: string]: string }
25
25
  className?: string
26
26
  data?: { [key: string]: string }
27
- htmlOptions?: {[key: string]: string | number | boolean | Function}
27
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
28
28
  id?: string
29
29
  inputDisplay?: "pills" | "none"
30
30
  inputName?: string
@@ -13,7 +13,7 @@ type MultipleUsersProps = {
13
13
  className?: string,
14
14
  dark?: boolean,
15
15
  data?: { [key: string]: string },
16
- htmlOptions?: {[key: string]: string | number | boolean | Function},
16
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  maxDisplayedUsers?: number,
19
19
  reverse?: boolean,
@@ -12,7 +12,7 @@ type MultipleUsersStackedProps = {
12
12
  className?: string,
13
13
  dark?: boolean,
14
14
  data?: { [key: string]: string },
15
- htmlOptions?: {[key: string]: string | number | boolean | Function},
15
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  id?: string,
17
17
  users: Array<{ [key: string]: string }>,
18
18
  }
@@ -21,7 +21,7 @@ type NavItemProps = {
21
21
  data?: object;
22
22
  dark?: boolean;
23
23
  fontSize?: "normal" | "small";
24
- htmlOptions?: {[key: string]: string | number | boolean | Function},
24
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
25
25
  iconLeft?: string;
26
26
  iconRight?: string | string[];
27
27
  onIconRightClick?: () => void;
@@ -15,7 +15,7 @@ type NavProps = {
15
15
  data?: object,
16
16
  dark?: boolean,
17
17
  highlight?: boolean,
18
- htmlOptions?: {[key: string]: string | number | boolean | Function},
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string,
20
20
  onClick?: React.MouseEventHandler<HTMLElement>,
21
21
  orientation?: "vertical" | "horizontal",