playbook_ui 13.12.0 → 13.13.0.pre.alpha.PLAY1090csstokens1675

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/index.js +13 -1
  3. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -1
  4. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +6 -2
  5. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -5
  6. data/app/pb_kits/playbook/pb_badge/_badge.tsx +5 -1
  7. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +6 -2
  8. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -1
  9. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +5 -1
  10. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +5 -2
  11. data/app/pb_kits/playbook/pb_button/_button.tsx +8 -1
  12. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +5 -1
  13. data/app/pb_kits/playbook/pb_caption/_caption.tsx +6 -1
  14. data/app/pb_kits/playbook/pb_card/_card.tsx +5 -1
  15. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +7 -2
  16. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +7 -2
  17. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +5 -3
  18. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -1
  19. data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -1
  20. data/app/pb_kits/playbook/pb_currency/_currency.tsx +5 -1
  21. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +5 -1
  22. data/app/pb_kits/playbook/pb_date/_date.tsx +12 -7
  23. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -1
  24. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +5 -1
  25. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +15 -4
  26. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +12 -5
  27. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +5 -1
  28. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +5 -1
  29. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +15 -4
  30. data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -1
  31. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +11 -3
  32. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +8 -3
  33. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +5 -1
  34. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +8 -1
  35. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +6 -2
  36. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.md +1 -0
  37. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +6 -1
  38. data/app/pb_kits/playbook/pb_flex/_flex.tsx +6 -1
  39. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +6 -1
  40. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +5 -1
  41. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -1
  42. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +6 -2
  43. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +5 -1
  44. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +5 -0
  45. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -3
  46. data/app/pb_kits/playbook/pb_icon/_icon.tsx +7 -1
  47. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +5 -1
  48. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -1
  49. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +5 -1
  50. data/app/pb_kits/playbook/pb_image/_image.tsx +6 -1
  51. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +5 -1
  52. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +6 -2
  53. data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -1
  54. data/app/pb_kits/playbook/pb_legend/_legend.tsx +5 -1
  55. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +6 -1
  56. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -1
  57. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +9 -3
  58. data/app/pb_kits/playbook/pb_list/_list.tsx +7 -2
  59. data/app/pb_kits/playbook/pb_list/_list_item.tsx +5 -1
  60. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +5 -1
  61. data/app/pb_kits/playbook/pb_map/_map.tsx +6 -1
  62. data/app/pb_kits/playbook/pb_message/_message.tsx +5 -1
  63. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +5 -1
  64. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
  65. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +5 -1
  66. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
  67. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
  68. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
  69. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
  70. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
  71. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +5 -1
  72. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
  73. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
  74. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
  75. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
  76. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
  77. data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -2
  78. data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -1
  79. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +5 -1
  80. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +6 -2
  81. data/app/pb_kits/playbook/pb_person/_person.tsx +5 -0
  82. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +5 -1
  83. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +8 -2
  84. data/app/pb_kits/playbook/pb_pill/_pill.tsx +5 -1
  85. data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -1
  86. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -1
  87. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +9 -3
  88. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +5 -1
  89. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +6 -2
  90. data/app/pb_kits/playbook/pb_radio/_radio.tsx +5 -1
  91. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +7 -1
  92. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +5 -1
  93. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children_swift.md +14 -0
  94. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed_swift.md +7 -0
  95. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line_swift.md +8 -0
  96. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_props_swift.md +8 -0
  97. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_swift.md +7 -0
  98. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical_swift.md +18 -0
  99. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +8 -0
  100. data/app/pb_kits/playbook/pb_select/_select.tsx +6 -1
  101. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +6 -2
  102. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +5 -0
  103. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +5 -0
  104. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +11 -3
  105. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +5 -1
  106. data/app/pb_kits/playbook/pb_source/_source.tsx +5 -1
  107. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +5 -1
  108. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +14 -2
  109. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +6 -0
  110. data/app/pb_kits/playbook/pb_table/_table.tsx +5 -1
  111. data/app/pb_kits/playbook/pb_table/_table_row.tsx +5 -1
  112. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
  113. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
  114. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
  115. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
  116. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
  117. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
  118. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
  119. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +5 -2
  120. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md +27 -0
  121. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error_swift.md +11 -0
  122. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_props_swift.md +9 -0
  123. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -0
  124. data/app/pb_kits/playbook/pb_time/_time.tsx +9 -2
  125. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +5 -1
  126. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -2
  127. data/app/pb_kits/playbook/pb_timeline/_item.tsx +9 -2
  128. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -1
  129. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +5 -1
  130. data/app/pb_kits/playbook/pb_title/_title.tsx +5 -1
  131. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +5 -1
  132. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +16 -3
  133. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +5 -0
  134. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
  135. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
  136. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
  137. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
  138. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +5 -1
  139. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -3
  140. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -2
  141. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -2
  142. data/app/pb_kits/playbook/pb_user/_user.tsx +5 -1
  143. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +5 -1
  144. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +5 -1
  145. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +5 -1
  146. data/app/pb_kits/playbook/utilities/props.ts +16 -0
  147. data/dist/playbook-rails.js +6 -6
  148. data/lib/playbook/version.rb +2 -2
  149. metadata +33 -7
@@ -1,11 +1,13 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { globalProps } from '../utilities/globalProps'
4
+ import { buildHtmlProps } from '../utilities/props'
4
5
 
5
6
  type DistributionBarProps = {
6
7
  className?: string,
7
8
  colors: [],
8
9
  data?: string,
10
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
9
11
  id?: string,
10
12
  size?: "lg" | "sm",
11
13
  widths?: number[],
@@ -33,14 +35,19 @@ const barValues = (normalizedValues: number[], colors: []) => {
33
35
 
34
36
  const DistributionBar = (props: DistributionBarProps) => {
35
37
  const {
38
+ htmlOptions = {},
36
39
  size = 'lg',
37
40
  widths = [1],
38
41
  colors = [],
39
42
  } = props
40
43
  const normalizedValues = normalizeCharacters(widths)
44
+ const htmlProps = buildHtmlProps(htmlOptions)
41
45
 
42
46
  return (
43
- <div className={classnames(`pb_distribution_bar_${size}`, globalProps(props))}>
47
+ <div
48
+ className={classnames(`pb_distribution_bar_${size}`, globalProps(props))}
49
+ {...htmlProps}
50
+ >
44
51
  {barValues(normalizedValues, colors)}
45
52
  </div>
46
53
  )
@@ -2,7 +2,7 @@ import React, { useEffect, useCallback, useRef } from 'react'
2
2
  import { useDropzone, DropzoneInputProps, DropzoneRootProps } from 'react-dropzone'
3
3
  import classnames from 'classnames'
4
4
 
5
- import { buildCss, buildDataProps, noop } from '../utilities/props'
5
+ import { buildCss, buildDataProps, noop, buildHtmlProps } from '../utilities/props'
6
6
  import { globalProps } from '../utilities/globalProps'
7
7
  import type { Callback } from '../types'
8
8
 
@@ -14,6 +14,7 @@ type FileUploadProps = {
14
14
  className?: string,
15
15
  customMessage?: string,
16
16
  data?: {[key: string]: string | number},
17
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
17
18
  acceptedFilesDescription?: string,
18
19
  maxSize?: number,
19
20
  onFilesAccepted: Callback<File, File>,
@@ -31,6 +32,7 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
31
32
  className,
32
33
  customMessage,
33
34
  data = {},
35
+ htmlOptions = {},
34
36
  maxSize,
35
37
  onFilesAccepted = noop,
36
38
  onFilesRejected = noop,
@@ -76,7 +78,8 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
76
78
  })
77
79
  }
78
80
 
79
- const dataProps = buildDataProps(data)
81
+ const dataProps = buildDataProps(data)
82
+ const htmlProps = buildHtmlProps(htmlOptions)
80
83
 
81
84
  const getDescription = () => {
82
85
  return customMessage
@@ -88,6 +91,7 @@ const FileUpload = (props: FileUploadProps): React.ReactElement => {
88
91
  <div
89
92
  className={classnames(buildCss('pb_file_upload_kit'), globalProps(props), className)}
90
93
  {...dataProps}
94
+ {...htmlProps}
91
95
  {...getRootProps()}
92
96
  >
93
97
  <Card>
@@ -0,0 +1 @@
1
+ To display the "No Filters Selected" text, the `filters` prop must be `null`. As a suggestion, check the values of each key in your filters object. If they are all falsy, return `null`.
@@ -2,6 +2,7 @@ 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
6
 
6
7
  import Icon from "../pb_icon/_icon";
7
8
  import Title from "../pb_title/_title";
@@ -20,6 +21,7 @@ type FixedConfirmationToastProps = {
20
21
  closeable?: boolean,
21
22
  data?: string,
22
23
  horizontal?: "right" | "left" | "center",
24
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
23
25
  id?: string,
24
26
  multiLine?: boolean,
25
27
  onClose?: () => void,
@@ -37,6 +39,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
37
39
  className,
38
40
  closeable = false,
39
41
  horizontal,
42
+ htmlOptions = {},
40
43
  multiLine = false,
41
44
  onClose = () => { },
42
45
  open = true,
@@ -53,6 +56,8 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
53
56
  );
54
57
  const icon = iconMap[status];
55
58
 
59
+ const htmlProps = buildHtmlProps(htmlOptions);
60
+
56
61
  const autoCloseToast = () => {
57
62
  if (autoClose && open) {
58
63
  setTimeout(() => {
@@ -75,7 +80,7 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
75
80
  return (
76
81
  <>
77
82
  {showToast && (
78
- <div className={css} onClick={handleClick}>
83
+ <div className={css} onClick={handleClick} {...htmlProps}>
79
84
  {icon && <Icon className="pb_icon" fixedWidth icon={icon} />}
80
85
 
81
86
  {
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildCss, buildDataProps } from '../utilities/props'
3
+ import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { GlobalProps, globalProps } from '../utilities/globalProps'
5
5
  import { Sizes } from '../types'
6
6
 
@@ -10,6 +10,7 @@ type FlexProps = {
10
10
  data?: object,
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
14
  id?: string,
14
15
  inline?: boolean,
15
16
  orientation?: "row" | "column",
@@ -32,6 +33,7 @@ const Flex = (props: FlexProps) => {
32
33
  data = {},
33
34
  inline = false,
34
35
  horizontal = 'left',
36
+ htmlOptions = {},
35
37
  justify = 'none',
36
38
  orientation = 'row',
37
39
  spacing = 'none',
@@ -58,6 +60,8 @@ const Flex = (props: FlexProps) => {
58
60
  const reverseClass = reverse === true ? 'reverse' : ''
59
61
  const alignSelfClass = alignSelf !== 'none' ? `align_self_${alignSelf}` : ''
60
62
  const dataProps = buildDataProps(data)
63
+ const htmlProps = buildHtmlProps(htmlOptions)
64
+
61
65
 
62
66
  return (
63
67
  <div
@@ -80,6 +84,7 @@ const Flex = (props: FlexProps) => {
80
84
  className
81
85
  )}
82
86
  {...dataProps}
87
+ {...htmlProps}
83
88
  >
84
89
  {children}
85
90
  </div>
@@ -1,11 +1,12 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildCss } from '../utilities/props'
3
+ import { buildCss, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps, GlobalProps } from '../utilities/globalProps'
5
5
  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
10
  shrink?: boolean,
10
11
  className?: string,
11
12
  order?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 'first' | 'none',
@@ -19,6 +20,7 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
19
20
  className,
20
21
  fixedSize,
21
22
  grow,
23
+ htmlOptions = {},
22
24
  shrink,
23
25
  flex = 'none',
24
26
  order = 'none',
@@ -34,8 +36,11 @@ const FlexItem = (props: FlexItemPropTypes): React.ReactElement => {
34
36
  fixedSize !== undefined ? { flexBasis: `${fixedSize}` } : null
35
37
  const orderClass = order !== 'none' ? `order_${order}` : null
36
38
 
39
+ const htmlProps = buildHtmlProps(htmlOptions)
40
+
37
41
  return (
38
42
  <div
43
+ {...htmlProps}
39
44
  className={classnames(buildCss('pb_flex_item_kit', growClass, shrinkClass, flexClass, displayFlexClass), orderClass, alignSelfClass, globalProps(props), className)}
40
45
  style={fixedStyle}
41
46
  >
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
3
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
5
 
6
6
  type FormGroupProps = {
@@ -9,6 +9,7 @@ type FormGroupProps = {
9
9
  className?: string,
10
10
  data?: object,
11
11
  fullWidth?: boolean,
12
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
12
13
  id?: string,
13
14
  }
14
15
 
@@ -18,17 +19,20 @@ const FormGroup = (props: FormGroupProps) => {
18
19
  className,
19
20
  data = {},
20
21
  fullWidth = false,
22
+ htmlOptions = {},
21
23
  id,
22
24
  children,
23
25
  } = props
24
26
 
25
27
  const ariaProps = buildAriaProps(aria)
26
28
  const dataProps = buildDataProps(data)
29
+ const htmlProps = buildHtmlProps(htmlOptions)
27
30
  const classes = classnames(buildCss('pb_form_group_kit', { full: fullWidth }), globalProps(props), className)
28
31
  return (
29
32
  <div
30
33
  {...ariaProps}
31
34
  {...dataProps}
35
+ {...htmlProps}
32
36
  className={classes}
33
37
  id={id}
34
38
  >
@@ -5,9 +5,11 @@ import Title from '../pb_title/_title'
5
5
  import Icon from '../pb_icon/_icon'
6
6
  import Avatar from '../pb_avatar/_avatar'
7
7
  import { globalProps, GlobalProps } from '../utilities/globalProps'
8
+ import { buildHtmlProps } from '../utilities/props'
8
9
 
9
10
  type FormPillProps = {
10
11
  className?: string,
12
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
11
13
  id?: string,
12
14
  text: string,
13
15
  name?: string,
@@ -25,6 +27,7 @@ type FormPillProps = {
25
27
  const FormPill = (props: FormPillProps) => {
26
28
  const {
27
29
  className,
30
+ htmlOptions = {},
28
31
  id,
29
32
  text,
30
33
  name,
@@ -41,8 +44,11 @@ const FormPill = (props: FormPillProps) => {
41
44
  size === 'small' ? 'small' : null,
42
45
  textTransform,
43
46
  )
47
+
48
+ const htmlProps = buildHtmlProps(htmlOptions)
49
+
44
50
  return (
45
- <div className={css} id={id}>
51
+ <div className={css} id={id} {...htmlProps}>
46
52
  {name &&
47
53
  <>
48
54
  <Avatar
@@ -10,7 +10,7 @@ import solidGauge from "highcharts/modules/solid-gauge";
10
10
  import defaultColors from "../tokens/exports/_colors.scss";
11
11
  import typography from "../tokens/exports/_typography.scss";
12
12
 
13
- import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
13
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
14
14
  import { globalProps } from "../utilities/globalProps";
15
15
 
16
16
  type GaugeProps = {
@@ -22,6 +22,7 @@ type GaugeProps = {
22
22
  disableAnimation?: boolean;
23
23
  fullCircle?: boolean;
24
24
  height?: string;
25
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
25
26
  id?: string;
26
27
  max?: number;
27
28
  min?: number;
@@ -45,6 +46,7 @@ const Gauge = ({
45
46
  disableAnimation = false,
46
47
  fullCircle = false,
47
48
  height = null,
49
+ htmlOptions = {},
48
50
  id,
49
51
  max = 100,
50
52
  min = 0,
@@ -61,7 +63,8 @@ const Gauge = ({
61
63
  ...props
62
64
  }: GaugeProps) => {
63
65
  const ariaProps = buildAriaProps(aria);
64
- const dataProps = buildDataProps(data);
66
+ const dataProps = buildDataProps(data)
67
+ const htmlProps = buildHtmlProps(htmlOptions);
65
68
  highchartsMore(Highcharts);
66
69
  solidGauge(Highcharts);
67
70
  const setupTheme = () => {
@@ -192,6 +195,7 @@ const Gauge = ({
192
195
  id: id,
193
196
  ...ariaProps,
194
197
  ...dataProps,
198
+ ...htmlProps,
195
199
  }}
196
200
  highcharts={Highcharts}
197
201
  options={options}
@@ -4,7 +4,7 @@
4
4
  import React from 'react'
5
5
  import classnames from 'classnames'
6
6
 
7
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
7
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
8
8
  import { globalProps, GlobalProps } from '../utilities/globalProps'
9
9
 
10
10
  import Badge from '../pb_badge/_badge'
@@ -14,6 +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
18
  id?: string,
18
19
  newWindow?: boolean,
19
20
  rel?: string,
@@ -35,6 +36,7 @@ const Hashtag = (props: HashtagProps) => {
35
36
  className,
36
37
  dark = false,
37
38
  data = {},
39
+ htmlOptions = {},
38
40
  id,
39
41
  newWindow,
40
42
  rel,
@@ -45,12 +47,14 @@ const Hashtag = (props: HashtagProps) => {
45
47
 
46
48
  const ariaProps = buildAriaProps(aria)
47
49
  const dataProps = buildDataProps(data)
50
+ const htmlProps = buildHtmlProps(htmlOptions)
48
51
  const classes = classnames(buildCss('pb_hashtag_kit'), globalProps(props), className)
49
52
 
50
53
  return (
51
54
  <span
52
55
  {...ariaProps}
53
56
  {...dataProps}
57
+ {...htmlProps}
54
58
  className={classes}
55
59
  id={id}
56
60
  >
@@ -3,10 +3,12 @@ import Highlighter from 'react-highlight-words'
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { globalProps, GlobalProps } from '../utilities/globalProps'
6
+ import { buildHtmlProps } from '../utilities/props'
6
7
 
7
8
  type HighlightProps = {
8
9
  className?: string,
9
10
  data?: {[key: string]: string},
11
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
10
12
  id?: string,
11
13
  children?: React.ReactChild[] | React.ReactChild | string,
12
14
  text?: string,
@@ -19,10 +21,12 @@ const Highlight = (props: HighlightProps): React.ReactElement => {
19
21
  className = 'pb_highlight_kit',
20
22
  data = {},
21
23
  highlightedText = ['highlight'],
24
+ htmlOptions = {},
22
25
  id = '',
23
26
  text = '',
24
27
  } = props
25
28
 
29
+ const htmlProps = buildHtmlProps(htmlOptions)
26
30
  const highlightContent: any = text || children;
27
31
 
28
32
  return (
@@ -34,6 +38,7 @@ const Highlight = (props: HighlightProps): React.ReactElement => {
34
38
  id={id}
35
39
  searchWords={highlightedText}
36
40
  textToHighlight={highlightContent}
41
+ {...htmlProps}
37
42
  />
38
43
  )
39
44
  }
@@ -7,7 +7,7 @@ import { globalProps } from '../utilities/globalProps'
7
7
  import Body from '../pb_body/_body'
8
8
  import Hashtag from '../pb_hashtag/_hashtag'
9
9
  import Title from '../pb_title/_title'
10
- import { buildAriaProps, buildDataProps } from '../utilities/props'
10
+ import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
11
11
 
12
12
  type HomeAddressStreetProps = {
13
13
  aria?: { [key: string]: string },
@@ -18,6 +18,7 @@ type HomeAddressStreetProps = {
18
18
  data?: { [key: string]: string },
19
19
  dark?: boolean,
20
20
  emphasis: "street" | "city",
21
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
21
22
  homeId: string,
22
23
  houseStyle: string,
23
24
  homeUrl: string,
@@ -37,6 +38,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
37
38
  data = {},
38
39
  dark = false,
39
40
  emphasis = 'street',
41
+ htmlOptions = {},
40
42
  homeId,
41
43
  homeUrl,
42
44
  newWindow,
@@ -58,9 +60,14 @@ const HomeAddressStreet = (props: HomeAddressStreetProps) => {
58
60
 
59
61
  const dataProps: { [key: string]: any } = buildDataProps(data)
60
62
  const ariaProps: { [key: string]: any } = buildAriaProps(aria)
61
-
63
+ const htmlProps = buildHtmlProps(htmlOptions)
62
64
  return (
63
- <div className={classes(className, dark)} {...ariaProps} {...dataProps}>
65
+ <div
66
+ className={classes(className, dark)}
67
+ {...ariaProps}
68
+ {...dataProps}
69
+ {...htmlProps}
70
+ >
64
71
  {emphasis == 'street' &&
65
72
  <div>
66
73
  <Title
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildAriaProps, buildDataProps } from '../utilities/props'
3
+ import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { GlobalProps, globalProps } from '../utilities/globalProps'
5
5
  import { isValidEmoji } from '../utilities/validEmojiChecker'
6
6
 
@@ -28,6 +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
32
  id?: string,
32
33
  inverse?: boolean,
33
34
  listItem?: boolean,
@@ -55,6 +56,7 @@ const Icon = (props: IconProps) => {
55
56
  data = {},
56
57
  fixedWidth = true,
57
58
  flip = "none",
59
+ htmlOptions = {},
58
60
  icon,
59
61
  id,
60
62
  inverse = false,
@@ -104,6 +106,7 @@ const Icon = (props: IconProps) => {
104
106
  aria.label ? null : aria.label = `${icon} icon`
105
107
  const ariaProps: {[key: string]: any} = buildAriaProps(aria)
106
108
  const dataProps: {[key: string]: any} = buildDataProps(data)
109
+ const htmlProps = buildHtmlProps(htmlOptions)
107
110
 
108
111
  // Add a conditional here to show only the SVG if custom
109
112
  const displaySVG = (customIcon: any) => {
@@ -113,6 +116,7 @@ const Icon = (props: IconProps) => {
113
116
  {
114
117
  React.cloneElement(customIcon, {
115
118
  ...dataProps,
119
+ ...htmlProps,
116
120
  className: classes,
117
121
  id,
118
122
  })
@@ -124,6 +128,7 @@ const Icon = (props: IconProps) => {
124
128
  <>
125
129
  <span
126
130
  {...dataProps}
131
+ {...htmlProps}
127
132
  className={classesEmoji}
128
133
  id={id}
129
134
  >
@@ -137,6 +142,7 @@ const Icon = (props: IconProps) => {
137
142
  <>
138
143
  <i
139
144
  {...dataProps}
145
+ {...htmlProps}
140
146
  className={classes}
141
147
  id={id}
142
148
  />
@@ -2,7 +2,7 @@ import React from 'react'
2
2
 
3
3
  import classnames from 'classnames'
4
4
 
5
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
6
  import { globalProps } from '../utilities/globalProps'
7
7
 
8
8
  import Icon from '../pb_icon/_icon'
@@ -13,6 +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
17
  id?: string,
17
18
  size?: "base" | "xs" | "sm" | "md" | "lg" | "xl",
18
19
  variant?: | "default"
@@ -32,6 +33,7 @@ const IconCircle = (props: IconCircleProps) => {
32
33
  className,
33
34
  dark = false,
34
35
  data = {},
36
+ htmlOptions = {},
35
37
  icon,
36
38
  id,
37
39
  size = 'md',
@@ -40,6 +42,7 @@ const IconCircle = (props: IconCircleProps) => {
40
42
 
41
43
  const ariaProps = buildAriaProps(aria)
42
44
  const dataProps = buildDataProps(data)
45
+ const htmlProps = buildHtmlProps(htmlOptions)
43
46
  const classes = classnames(buildCss('pb_icon_circle_kit', size, variant), globalProps(props), className)
44
47
 
45
48
 
@@ -47,6 +50,7 @@ const IconCircle = (props: IconCircleProps) => {
47
50
  <div
48
51
  {...ariaProps}
49
52
  {...dataProps}
53
+ {...htmlProps}
50
54
  className={classes}
51
55
  id={id}
52
56
  >
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
@@ -16,6 +16,7 @@ type IconStatValueProps = {
16
16
  data?: object,
17
17
  dark?: boolean,
18
18
  icon: string,
19
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
19
20
  id?: string,
20
21
  orientation?: "vertical" | "horizontal",
21
22
  size?: "sm" | "md" | "lg",
@@ -39,6 +40,7 @@ const IconStatValue = (props: IconStatValueProps) => {
39
40
  className,
40
41
  data = {},
41
42
  dark = false,
43
+ htmlOptions = {},
42
44
  icon,
43
45
  id,
44
46
  orientation = 'horizontal',
@@ -50,6 +52,7 @@ const IconStatValue = (props: IconStatValueProps) => {
50
52
  } = props
51
53
  const ariaProps = buildAriaProps(aria)
52
54
  const dataProps = buildDataProps(data)
55
+ const htmlProps = buildHtmlProps(htmlOptions)
53
56
  const classes = classnames(
54
57
  buildCss('pb_icon_stat_value_kit', orientation, size, variant), globalProps(props),
55
58
  className
@@ -89,6 +92,7 @@ const IconStatValue = (props: IconStatValueProps) => {
89
92
  <div
90
93
  {...ariaProps}
91
94
  {...dataProps}
95
+ {...htmlProps}
92
96
  className={classes}
93
97
  id={id}
94
98
  >
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
@@ -14,6 +14,7 @@ type IconValueProps = {
14
14
  dark?: boolean,
15
15
  data?: object,
16
16
  icon: string,
17
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
17
18
  id?: string,
18
19
  text: string,
19
20
  }
@@ -25,12 +26,14 @@ const IconValue = (props: IconValueProps) => {
25
26
  className,
26
27
  dark,
27
28
  data = {},
29
+ htmlOptions = {},
28
30
  icon,
29
31
  id,
30
32
  text,
31
33
  } = props
32
34
  const ariaProps = buildAriaProps(aria)
33
35
  const dataProps = buildDataProps(data)
36
+ const htmlProps = buildHtmlProps(htmlOptions)
34
37
  const classes = classnames(
35
38
  buildCss('pb_icon_value_kit', align),
36
39
  globalProps(props),
@@ -41,6 +44,7 @@ const IconValue = (props: IconValueProps) => {
41
44
  <div
42
45
  {...ariaProps}
43
46
  {...dataProps}
47
+ {...htmlProps}
44
48
  className={classes}
45
49
  id={id}
46
50
  >
@@ -1,13 +1,14 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { GlobalProps, globalProps } from '../utilities/globalProps'
4
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
 
6
6
  type ImageType = {
7
7
  alt?: string,
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
12
  id?: string,
12
13
  onError?: () => void,
13
14
  size?: "xs" | "sm" | "md" | "lg" | "xl",
@@ -22,6 +23,7 @@ const Image = (props: ImageType): React.ReactElement => {
22
23
  aria = {},
23
24
  className,
24
25
  data = {},
26
+ htmlOptions = {},
25
27
  id,
26
28
  onError = null,
27
29
  rounded = false,
@@ -40,11 +42,14 @@ const Image = (props: ImageType): React.ReactElement => {
40
42
  className
41
43
  )
42
44
  const dataProps = buildDataProps(data)
45
+ const htmlProps = buildHtmlProps(htmlOptions)
46
+
43
47
 
44
48
  return (
45
49
  <img
46
50
  {...ariaProps}
47
51
  {...dataProps}
52
+ {...htmlProps}
48
53
  alt={alt}
49
54
  className={classes}
50
55
  data-src={url}
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
  import { globalProps } from '../utilities/globalProps'
4
4
 
5
- import { buildAriaProps, buildDataProps } from '../utilities/props'
5
+ import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
6
6
 
7
7
  import Pill from '../pb_pill/_pill'
8
8
  import Caption from '../pb_caption/_caption'
@@ -11,6 +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
15
  id?: string,
15
16
  label?: string,
16
17
  pillValue?: string,
@@ -22,6 +23,7 @@ const LabelPill = (props: LabelPillProps) => {
22
23
  aria = {},
23
24
  className,
24
25
  data = {},
26
+ htmlOptions = {},
25
27
  id,
26
28
  label,
27
29
  pillValue,
@@ -29,6 +31,7 @@ const LabelPill = (props: LabelPillProps) => {
29
31
  } = props
30
32
  const ariaProps = buildAriaProps(aria)
31
33
  const dataProps = buildDataProps(data)
34
+ const htmlProps = buildHtmlProps(htmlOptions)
32
35
  const css = classnames(
33
36
  'pb_label_pill_kit',
34
37
  globalProps(props),
@@ -39,6 +42,7 @@ const LabelPill = (props: LabelPillProps) => {
39
42
  <div
40
43
  {...ariaProps}
41
44
  {...dataProps}
45
+ {...htmlProps}
42
46
  className={css}
43
47
  id={id}
44
48
  >