playbook_ui 13.12.0 → 13.13.0.pre.alpha.play900startratingasinput1657

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -1
  3. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +6 -2
  4. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -5
  5. data/app/pb_kits/playbook/pb_badge/_badge.tsx +5 -1
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +6 -2
  7. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -1
  8. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +5 -1
  9. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +5 -2
  10. data/app/pb_kits/playbook/pb_button/_button.tsx +8 -1
  11. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +5 -1
  12. data/app/pb_kits/playbook/pb_caption/_caption.tsx +6 -1
  13. data/app/pb_kits/playbook/pb_card/_card.tsx +5 -1
  14. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +7 -2
  15. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +7 -2
  16. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +5 -3
  17. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -1
  18. data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -1
  19. data/app/pb_kits/playbook/pb_currency/_currency.tsx +5 -1
  20. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +5 -1
  21. data/app/pb_kits/playbook/pb_date/_date.tsx +12 -7
  22. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -1
  23. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +5 -1
  24. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +15 -4
  25. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +12 -5
  26. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +5 -1
  27. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +5 -1
  28. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +15 -4
  29. data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -1
  30. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +11 -3
  31. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +8 -3
  32. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +5 -1
  33. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +8 -1
  34. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +6 -2
  35. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.md +1 -0
  36. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +6 -1
  37. data/app/pb_kits/playbook/pb_flex/_flex.tsx +6 -1
  38. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +6 -1
  39. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +5 -1
  40. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -1
  41. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +6 -2
  42. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +5 -1
  43. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +5 -0
  44. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -3
  45. data/app/pb_kits/playbook/pb_icon/_icon.tsx +7 -1
  46. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +5 -1
  47. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -1
  48. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +5 -1
  49. data/app/pb_kits/playbook/pb_image/_image.tsx +6 -1
  50. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +5 -1
  51. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +6 -2
  52. data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -1
  53. data/app/pb_kits/playbook/pb_legend/_legend.tsx +5 -1
  54. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +6 -1
  55. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -1
  56. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +9 -3
  57. data/app/pb_kits/playbook/pb_list/_list.tsx +7 -2
  58. data/app/pb_kits/playbook/pb_list/_list_item.tsx +5 -1
  59. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +5 -1
  60. data/app/pb_kits/playbook/pb_map/_map.tsx +6 -1
  61. data/app/pb_kits/playbook/pb_message/_message.tsx +5 -1
  62. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +5 -1
  63. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
  64. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +5 -1
  65. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
  66. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
  67. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
  68. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
  69. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
  70. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +5 -1
  71. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
  72. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
  73. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
  74. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
  75. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
  76. data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -2
  77. data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -1
  78. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +5 -1
  79. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +6 -2
  80. data/app/pb_kits/playbook/pb_person/_person.tsx +5 -0
  81. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +5 -1
  82. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +8 -2
  83. data/app/pb_kits/playbook/pb_pill/_pill.tsx +5 -1
  84. data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -1
  85. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -1
  86. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +9 -3
  87. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +5 -1
  88. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +6 -2
  89. data/app/pb_kits/playbook/pb_radio/_radio.tsx +5 -1
  90. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +7 -1
  91. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +5 -1
  92. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children_swift.md +14 -0
  93. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed_swift.md +7 -0
  94. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line_swift.md +8 -0
  95. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_props_swift.md +8 -0
  96. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_swift.md +7 -0
  97. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical_swift.md +18 -0
  98. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +8 -0
  99. data/app/pb_kits/playbook/pb_select/_select.tsx +6 -1
  100. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +6 -2
  101. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +5 -0
  102. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +5 -0
  103. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +11 -3
  104. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +5 -1
  105. data/app/pb_kits/playbook/pb_source/_source.tsx +5 -1
  106. data/app/pb_kits/playbook/pb_star_rating/_star_rating.scss +105 -53
  107. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +183 -62
  108. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.html.erb +2 -0
  109. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_background_options.jsx +25 -0
  110. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.html.erb +3 -0
  111. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_color_options.jsx +31 -0
  112. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.html.erb +6 -8
  113. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_default.jsx +19 -6
  114. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.html.erb +3 -1
  115. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_hide.jsx +22 -5
  116. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.html.erb +6 -0
  117. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_number_config.jsx +58 -0
  118. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.html.erb +16 -0
  119. data/app/pb_kits/playbook/pb_star_rating/docs/_star_rating_size_options.jsx +60 -0
  120. data/app/pb_kits/playbook/pb_star_rating/docs/example.yml +12 -5
  121. data/app/pb_kits/playbook/pb_star_rating/docs/index.js +8 -0
  122. data/app/pb_kits/playbook/pb_star_rating/star_rating.html.erb +48 -26
  123. data/app/pb_kits/playbook/pb_star_rating/star_rating.rb +82 -6
  124. data/app/pb_kits/playbook/pb_star_rating/star_rating.test.js +34 -34
  125. data/app/pb_kits/playbook/pb_star_rating/stars/primary_star.svg +3 -0
  126. data/app/pb_kits/playbook/pb_star_rating/stars/star_outline.svg +3 -0
  127. data/app/pb_kits/playbook/pb_star_rating/stars/subtle_dark_star.svg +3 -0
  128. data/app/pb_kits/playbook/pb_star_rating/stars/subtle_star.svg +3 -0
  129. data/app/pb_kits/playbook/pb_star_rating/stars/yellow_star.svg +3 -0
  130. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +14 -2
  131. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +6 -0
  132. data/app/pb_kits/playbook/pb_table/_table.tsx +5 -1
  133. data/app/pb_kits/playbook/pb_table/_table_row.tsx +5 -1
  134. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
  135. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
  136. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
  137. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
  138. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
  139. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
  140. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
  141. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +5 -2
  142. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md +27 -0
  143. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error_swift.md +11 -0
  144. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_props_swift.md +9 -0
  145. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -0
  146. data/app/pb_kits/playbook/pb_time/_time.tsx +9 -2
  147. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +5 -1
  148. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -2
  149. data/app/pb_kits/playbook/pb_timeline/_item.tsx +9 -2
  150. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -1
  151. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +5 -1
  152. data/app/pb_kits/playbook/pb_title/_title.tsx +5 -1
  153. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +5 -1
  154. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +16 -3
  155. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +5 -0
  156. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
  157. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
  158. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
  159. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
  160. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +5 -1
  161. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -3
  162. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -2
  163. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -2
  164. data/app/pb_kits/playbook/pb_user/_user.tsx +5 -1
  165. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +5 -1
  166. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +5 -1
  167. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +5 -1
  168. data/app/pb_kits/playbook/utilities/props.ts +16 -0
  169. data/dist/playbook-rails.js +6 -6
  170. data/lib/playbook/version.rb +2 -2
  171. metadata +46 -7
@@ -70,8 +70,8 @@ const TypeaheadWithHighlight = (props) => {
70
70
  }
71
71
 
72
72
  const customComponents = {
73
- Option: (props: OptionProps) => (
74
- <components.Option {...props}/>
73
+ Option: (highlightProps: OptionProps) => (
74
+ <components.Option {...highlightProps}/>
75
75
  ),
76
76
  SingleValue: ({ data }: any) => (
77
77
  <span>{data.name}</span>
@@ -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, globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Avatar from '../pb_avatar/_avatar'
@@ -16,6 +16,7 @@ type UserProps = {
16
16
  className?: string,
17
17
  dark?: boolean,
18
18
  data?: {[key: string]: string},
19
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
19
20
  id?: string,
20
21
  name?: string,
21
22
  orientation?: "horizontal" | "vertical",
@@ -34,6 +35,7 @@ const User = (props: UserProps) => {
34
35
  className,
35
36
  dark = false,
36
37
  data = {},
38
+ htmlOptions = {},
37
39
  id,
38
40
  name,
39
41
  orientation = 'horizontal',
@@ -45,6 +47,7 @@ const User = (props: UserProps) => {
45
47
 
46
48
  const dataProps: {[key: string]: string} = buildDataProps(data)
47
49
  const ariaProps: {[key: string]: string} = buildAriaProps(aria)
50
+ const htmlProps = buildHtmlProps(htmlOptions)
48
51
 
49
52
  const classes = classnames(
50
53
  buildCss('pb_user_kit', align, orientation, size),
@@ -58,6 +61,7 @@ const User = (props: UserProps) => {
58
61
  <div
59
62
  {...ariaProps}
60
63
  {...dataProps}
64
+ {...htmlProps}
61
65
  className={classes}
62
66
  id={id}
63
67
  >
@@ -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
  import Veteran from './badges/veteran'
6
6
  import MillionDollar from './badges/million-dollar';
@@ -10,6 +10,7 @@ type UserBadgeProps = {
10
10
  badge?: "million-dollar" | "veteran",
11
11
  className?: string,
12
12
  data?: {[key: string]: string},
13
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
13
14
  id?: string,
14
15
  size?: "sm" | "md" | "lg",
15
16
  }
@@ -20,6 +21,7 @@ const UserBadge = (props: UserBadgeProps) => {
20
21
  badge = 'million-dollar',
21
22
  className,
22
23
  data = {},
24
+ htmlOptions = {},
23
25
  id,
24
26
  size = 'md',
25
27
  } = props
@@ -27,6 +29,7 @@ const UserBadge = (props: UserBadgeProps) => {
27
29
  const image = badge === "million-dollar" ? <MillionDollar /> : <Veteran />
28
30
  const ariaProps = buildAriaProps(aria)
29
31
  const dataProps = buildDataProps(data)
32
+ const htmlProps = buildHtmlProps(htmlOptions)
30
33
  const classes = classnames(
31
34
  buildCss('pb_user_badge_kit', size),
32
35
  globalProps(props),
@@ -37,6 +40,7 @@ const UserBadge = (props: UserBadgeProps) => {
37
40
  <div
38
41
  {...ariaProps}
39
42
  {...dataProps}
43
+ {...htmlProps}
40
44
  className={classes}
41
45
  id={id}
42
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
  import Joyride, { TooltipRenderProps } from 'react-joyride'
6
6
  import Button from '../pb_button/_button'
@@ -14,6 +14,7 @@ type WalkthroughProps = {
14
14
  className?: string,
15
15
  continuous?: boolean,
16
16
  data?: { [key: string]: string },
17
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
17
18
  id?: string,
18
19
  run?: boolean,
19
20
  steps?: [],
@@ -150,6 +151,7 @@ const Walkthrough = (props: WalkthroughProps) => {
150
151
  floaterProps = {
151
152
  offset: 50,
152
153
  },
154
+ htmlOptions = {},
153
155
  id,
154
156
  run = false,
155
157
  steps,
@@ -163,12 +165,14 @@ const Walkthrough = (props: WalkthroughProps) => {
163
165
 
164
166
  const ariaProps = buildAriaProps(aria)
165
167
  const dataProps = buildDataProps(data)
168
+ const htmlProps = buildHtmlProps(htmlOptions)
166
169
  const classes = classnames(buildCss('pb_walkthrough'), globalProps(props), className)
167
170
 
168
171
  return (
169
172
  <div
170
173
  {...ariaProps}
171
174
  {...dataProps}
175
+ {...htmlProps}
172
176
  className={classes}
173
177
  id={id}
174
178
  >
@@ -3,7 +3,7 @@
3
3
  import React from 'react'
4
4
  import classnames from 'classnames'
5
5
  import { globalProps } from '../utilities/globalProps'
6
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
7
7
 
8
8
  import Caption from '../pb_caption/_caption'
9
9
  import Title from '../pb_title/_title'
@@ -16,6 +16,7 @@ type WeekdayStackedProps = {
16
16
  dark?: boolean,
17
17
  data?: object,
18
18
  date: Date,
19
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
19
20
  id?: string,
20
21
  variant?: "day_only" | "month_day" | "expanded",
21
22
  compact?: boolean,
@@ -46,6 +47,7 @@ const WeekdayStacked = (props: WeekdayStackedProps) => {
46
47
  dark = false,
47
48
  data = {},
48
49
  date = new Date(),
50
+ htmlOptions = {},
49
51
  id,
50
52
  variant = 'month_day',
51
53
  compact = false,
@@ -53,6 +55,7 @@ const WeekdayStacked = (props: WeekdayStackedProps) => {
53
55
 
54
56
  const ariaProps = buildAriaProps(aria)
55
57
  const dataProps = buildDataProps(data)
58
+ const htmlProps = buildHtmlProps(htmlOptions)
56
59
  const classes = classnames(
57
60
  buildCss('pb_weekday_stacked_kit', align),
58
61
  globalProps(props),
@@ -63,6 +66,7 @@ const WeekdayStacked = (props: WeekdayStackedProps) => {
63
66
  <div
64
67
  {...ariaProps}
65
68
  {...dataProps}
69
+ {...htmlProps}
66
70
  className={classes}
67
71
  id={id}
68
72
  >
@@ -49,3 +49,19 @@ export const buildDataProps = (data: {[key: string]: any}) => buildPrefixedProps
49
49
  */
50
50
  export const buildCss = (...rules: (string | { [x: string]: string | boolean; })[]): string => classnames(rules).replace(/\s/g, '_')
51
51
 
52
+ /**
53
+ * Maps a given data object into HTML valid attributes and their values.
54
+ * This is a more general version of what buildAriaProps and buildDataProps do.
55
+ * It is used to map any arbitrary prop into a valid HTML attribute.
56
+ *
57
+ * @returns {Object} an object holding the HTML valid props and their values.
58
+ */
59
+
60
+ export const buildHtmlProps = (htmlOptions: { [key: string]: string | number | boolean | Function }) => {
61
+ const htmlProps: { [attr: string]: string | number | boolean | Function } = {}
62
+ Object.keys(htmlOptions).forEach((key) => {
63
+ htmlProps[key] = htmlOptions[key]
64
+ })
65
+ return htmlProps
66
+ }
67
+