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
@@ -3,7 +3,7 @@ import classnames from 'classnames'
3
3
  import inlineFocus from './inlineFocus'
4
4
  import useFocus from './useFocus'
5
5
  import { globalProps, GlobalProps } from '../utilities/globalProps'
6
- import { buildAriaProps, buildDataProps, noop } from '../utilities/props'
6
+ import { buildAriaProps, buildDataProps, noop, buildHtmlProps } from '../utilities/props'
7
7
 
8
8
  try {
9
9
  const Trix = require('trix')
@@ -35,6 +35,7 @@ type RichTextEditorProps = {
35
35
  className?: string,
36
36
  data?: { [key: string]: string },
37
37
  focus?: boolean,
38
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
38
39
  id?: string,
39
40
  inline?: boolean,
40
41
  extensions?: { [key: string]: string }[],
@@ -58,6 +59,7 @@ const RichTextEditor = (props: RichTextEditorProps) => {
58
59
  className,
59
60
  data = {},
60
61
  focus = false,
62
+ htmlOptions = {},
61
63
  inline = false,
62
64
  extensions,
63
65
  name,
@@ -74,9 +76,12 @@ const RichTextEditor = (props: RichTextEditorProps) => {
74
76
  dataProps = buildDataProps(data),
75
77
  [editor, setEditor] = useState<Editor>()
76
78
 
79
+ const htmlProps = buildHtmlProps(htmlOptions)
80
+
77
81
  const handleOnEditorReady = (editorInstance: Editor) => setEditor(editorInstance),
78
82
  element = editor?.element
79
83
 
84
+
80
85
  // DOM manipulation must wait for editor to be ready
81
86
  if (editor) {
82
87
  const toolbarElement = element.parentElement.querySelector('trix-toolbar') as HTMLElement,
@@ -161,6 +166,7 @@ const RichTextEditor = (props: RichTextEditorProps) => {
161
166
  <div
162
167
  {...ariaProps}
163
168
  {...dataProps}
169
+ {...htmlProps}
164
170
  className={css}
165
171
  >
166
172
  {
@@ -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 Caption from '../pb_caption/_caption'
@@ -12,6 +12,7 @@ type SectionSeparatorProps = {
12
12
  className?: string,
13
13
  dark?: boolean,
14
14
  data?: { [key: string]: string; },
15
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
15
16
  id?: string,
16
17
  lineStyle?: "solid" | "dashed",
17
18
  orientation?: "horizontal" | "vertical",
@@ -25,6 +26,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
25
26
  children,
26
27
  className,
27
28
  data = {},
29
+ htmlOptions = {},
28
30
  id,
29
31
  lineStyle = 'solid',
30
32
  orientation = 'horizontal',
@@ -34,6 +36,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
34
36
  } = props
35
37
  const ariaProps = buildAriaProps(aria)
36
38
  const dataProps = buildDataProps(data)
39
+ const htmlProps = buildHtmlProps(htmlOptions)
37
40
  const classes = classnames(buildCss('pb_section_separator_kit', variant, orientation, lineStyle === "dashed" ? lineStyle : ""), globalProps(props), className)
38
41
 
39
42
  return (
@@ -41,6 +44,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
41
44
  <div
42
45
  {...ariaProps}
43
46
  {...dataProps}
47
+ {...htmlProps}
44
48
  className={classes}
45
49
  id={id}
46
50
  >
@@ -0,0 +1,14 @@
1
+
2
+ ![section-separator-children](https://github.com/powerhome/playbook/assets/92755007/acd6a8eb-d034-4efd-b2e6-afabe739e678)
3
+
4
+ ```swift
5
+
6
+ PBSectionSeparator(variant: .dashed) {
7
+ PBCard(alignment: .center, borderRadius: BorderRadius.rounded, padding: Spacing.xxSmall, width: 70) {
8
+ Text("Today")
9
+ .pbFont(.caption)
10
+ .frame(maxWidth: .infinity, alignment: .center)
11
+ }
12
+ }
13
+
14
+ ```
@@ -0,0 +1,7 @@
1
+ ![section-separator-dashed](https://github.com/powerhome/playbook/assets/92755007/e4f01870-3d90-4655-9136-5c7565711e1f)
2
+
3
+ ```swift
4
+
5
+ PBSectionSeparator(variant: .dashed)
6
+
7
+ ```
@@ -0,0 +1,8 @@
1
+
2
+ ![section-separator-default](https://github.com/powerhome/playbook/assets/92755007/2560d5e2-f345-42d2-bad9-2a2e031b3e08)
3
+
4
+ ```swift
5
+
6
+ PBSectionSeparator()
7
+
8
+ ```
@@ -0,0 +1,8 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **text** | `String` | Adds text to the Section Separator | `nil` | |
5
+ | **orientation** | `Orientation` | Changes the orientation | `.horizontal` | `.horizontal` `.vertical` |
6
+ | **variant** | `Variant` | Changes the style of the Section Separator | `.card` | `.dashed` `.card` |
7
+ | **dividerOpacity** | `CGFloat` | Adjusts the opacity of the divider | `1` | |
8
+ | **margin** | `CGFloat` | Adds margin between text and the divider | `Spacing.xSmall` | `Spacing.none` `Spacing.xxSmall` `Spacing.xSmall` `Spacing.small` `Spacing.medium` `Spacing.large` `Spacing.xLarge` |
@@ -0,0 +1,7 @@
1
+ ![section-separator-text](https://github.com/powerhome/playbook/assets/92755007/4b481a7d-d001-43b6-b779-cfdc6fffc15f)
2
+
3
+ ```swift
4
+
5
+ PBSectionSeparator("Text separator")
6
+
7
+ ```
@@ -0,0 +1,18 @@
1
+ ![section-separator-verticle](https://github.com/powerhome/playbook/assets/92755007/21ca54a5-6b8a-459f-91ad-4e9b68258f68)
2
+
3
+ ```swift
4
+
5
+ let loremIpsum: some View = Text(
6
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididt labore et dolore"
7
+ )
8
+
9
+ HStack(spacing: Spacing.none) {
10
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididt labore et dolore"
11
+ PBSectionSeparator(orientation: .vertical)
12
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididt labore et dolore"
13
+ }
14
+ .frame(maxWidth: .infinity)
15
+ .frame(height: 120, alignment: .center)
16
+ .listRowSeparator(.hidden)
17
+
18
+ ```
@@ -13,3 +13,11 @@ examples:
13
13
  - section_separator_text: Text Separator
14
14
  - section_separator_vertical: Vertical
15
15
  - section_separator_children: Children
16
+
17
+ swift:
18
+ - section_separator_line_swift: Line Separator
19
+ - section_separator_dashed_swift: Dashed Separator
20
+ - section_separator_text_swift: Text Separator
21
+ - section_separator_vertical_swift: Vertical
22
+ - section_separator_children_swift: Children
23
+ - section_separator_props_swift: ""
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef } 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, domSafeProps } from '../utilities/globalProps'
6
6
  import type { InputCallback } from '../types'
7
7
 
@@ -24,6 +24,7 @@ type SelectProps = {
24
24
  data?: { [key: string]: string },
25
25
  disabled?: boolean,
26
26
  error?: string,
27
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
27
28
  id?: string,
28
29
  includeBlank?: string,
29
30
  inline?: boolean,
@@ -58,6 +59,7 @@ const Select = ({
58
59
  disabled = false,
59
60
  error,
60
61
  label,
62
+ htmlOptions = {},
61
63
  inline = false,
62
64
  multiple = false,
63
65
  name,
@@ -69,6 +71,7 @@ const Select = ({
69
71
  }: SelectProps, ref: React.LegacyRef<HTMLSelectElement>) => {
70
72
  const ariaProps = buildAriaProps(aria)
71
73
  const dataProps = buildDataProps(data)
74
+ const htmlProps = buildHtmlProps(htmlOptions)
72
75
  const optionsList = createOptions(options)
73
76
 
74
77
  const inlineClass = inline ? 'inline' : null
@@ -89,6 +92,7 @@ const Select = ({
89
92
  if (children) return children
90
93
  return (
91
94
  <select
95
+ {...htmlOptions}
92
96
  {...domSafeProps(props)}
93
97
  disabled={disabled}
94
98
  id={name}
@@ -109,6 +113,7 @@ const Select = ({
109
113
  <div
110
114
  {...ariaProps}
111
115
  {...dataProps}
116
+ {...htmlProps}
112
117
  className={classes}
113
118
  >
114
119
  {label &&
@@ -9,7 +9,7 @@ import {
9
9
  buildCss,
10
10
  buildDataProps,
11
11
  noop,
12
- } from '../utilities/props'
12
+ buildHtmlProps } from '../utilities/props'
13
13
 
14
14
  import Icon from '../pb_icon/_icon'
15
15
  import Checkbox from '../pb_checkbox/_checkbox'
@@ -28,8 +28,9 @@ type SelectableCardProps = {
28
28
  disabled?: boolean,
29
29
  error?: boolean,
30
30
  icon?: boolean,
31
- id?: string,
31
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
32
32
  inputId?: string,
33
+ id?: string,
33
34
  multi?: boolean,
34
35
  name?: string,
35
36
  onChange: (event: React.FormEvent<HTMLInputElement>) => void,
@@ -48,6 +49,7 @@ const SelectableCard = (props: SelectableCardProps) => {
48
49
  data = {},
49
50
  disabled = false,
50
51
  error = false,
52
+ htmlOptions = {},
51
53
  icon = false,
52
54
  inputId = null,
53
55
  multi = true,
@@ -59,6 +61,7 @@ const SelectableCard = (props: SelectableCardProps) => {
59
61
  } = props
60
62
  const ariaProps = buildAriaProps(aria)
61
63
  const dataProps = buildDataProps(data)
64
+ const htmlProps = buildHtmlProps(htmlOptions)
62
65
 
63
66
  const classes = classnames(buildCss('pb_selectable_card_kit',
64
67
  {
@@ -109,6 +112,7 @@ const SelectableCard = (props: SelectableCardProps) => {
109
112
  <div
110
113
  {...ariaProps}
111
114
  {...dataProps}
115
+ {...htmlProps}
112
116
  className={classes}
113
117
  >
114
118
  <input
@@ -6,6 +6,7 @@ import {
6
6
  buildAriaProps,
7
7
  buildCss,
8
8
  buildDataProps,
9
+ buildHtmlProps,
9
10
  } from '../utilities/props'
10
11
 
11
12
  import Body from '../pb_body/_body'
@@ -21,6 +22,7 @@ type SelectableCardIconProps = {
21
22
  dark?: boolean,
22
23
  data?: { [key: string]: string },
23
24
  disabled?: boolean,
25
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
24
26
  icon?: string,
25
27
  inputId?: string,
26
28
  multi?: boolean,
@@ -41,6 +43,7 @@ const SelectableCardIcon = (props: SelectableCardIconProps) => {
41
43
  dark = false,
42
44
  data = {},
43
45
  disabled = false,
46
+ htmlOptions = {},
44
47
  icon,
45
48
  inputId,
46
49
  multi = true,
@@ -53,6 +56,7 @@ const SelectableCardIcon = (props: SelectableCardIconProps) => {
53
56
 
54
57
  const ariaProps = buildAriaProps(aria)
55
58
  const dataProps = buildDataProps(data)
59
+ const htmlProps = buildHtmlProps(htmlOptions)
56
60
 
57
61
  const classes = classnames(
58
62
  buildCss('pb_selectable_card_icon_kit', {
@@ -68,6 +72,7 @@ const SelectableCardIcon = (props: SelectableCardIconProps) => {
68
72
  <div
69
73
  {...ariaProps}
70
74
  {...dataProps}
75
+ {...htmlProps}
71
76
  className={classes}
72
77
  >
73
78
  <SelectableCard
@@ -6,6 +6,7 @@ import {
6
6
  buildAriaProps,
7
7
  buildCss,
8
8
  buildDataProps,
9
+ buildHtmlProps
9
10
  } from '../utilities/props'
10
11
  import Icon from '../pb_icon/_icon'
11
12
  import Title from '../pb_title/_title'
@@ -17,6 +18,7 @@ type SelectableIconProps = {
17
18
  customIcon?: {[key: string] :SVGElement},
18
19
  disabled?: boolean,
19
20
  data?: Object,
21
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
20
22
  icon: string,
21
23
  inputId: string,
22
24
  inputs: string,
@@ -33,6 +35,7 @@ const SelectableIcon = ({
33
35
  customIcon,
34
36
  data = {},
35
37
  disabled = false,
38
+ htmlOptions = {},
36
39
  icon,
37
40
  inputId,
38
41
  inputs = 'enabled',
@@ -44,6 +47,7 @@ const SelectableIcon = ({
44
47
  }: SelectableIconProps) => {
45
48
  const ariaProps = buildAriaProps(aria)
46
49
  const dataProps = buildDataProps(data)
50
+ const htmlProps = buildHtmlProps(htmlOptions)
47
51
 
48
52
  const classes = classnames(
49
53
  buildCss('pb_selectable_icon_kit', {
@@ -62,6 +66,7 @@ const SelectableIcon = ({
62
66
  <div
63
67
  {...ariaProps}
64
68
  {...dataProps}
69
+ {...htmlProps}
65
70
  className={classes}
66
71
  >
67
72
  {inputs === 'disabled' && (
@@ -1,7 +1,7 @@
1
1
  import React, { useState } 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 Checkbox from "../pb_checkbox/_checkbox";
@@ -15,6 +15,7 @@ export type SelectableListItemProps = {
15
15
  className?: string;
16
16
  data?: object;
17
17
  defaultChecked?: boolean;
18
+ htmlOptions?: { [key: string]: string | number | boolean | Function };
18
19
  id?: string;
19
20
  label?: string;
20
21
  text?: string;
@@ -31,6 +32,7 @@ const SelectableListItem = ({
31
32
  className,
32
33
  data = {},
33
34
  defaultChecked,
35
+ htmlOptions = {},
34
36
  id,
35
37
  label,
36
38
  text = "",
@@ -41,7 +43,8 @@ const SelectableListItem = ({
41
43
  ...props
42
44
  }: SelectableListItemProps) => {
43
45
  const ariaProps = buildAriaProps(aria);
44
- const dataProps = buildDataProps(data);
46
+ const dataProps = buildDataProps(data)
47
+ const htmlProps = buildHtmlProps(htmlOptions);
45
48
  const classes = classnames(
46
49
  buildCss("pb_selectable_list_item_kit"),
47
50
  globalProps(props),
@@ -61,7 +64,12 @@ const SelectableListItem = ({
61
64
  {...props}
62
65
  className={classnames(checkedState ? "checked_item" : "", className)}
63
66
  >
64
- <div {...ariaProps} {...dataProps} className={classes}>
67
+ <div
68
+ {...ariaProps}
69
+ {...dataProps}
70
+ {...htmlProps}
71
+ className={classes}
72
+ >
65
73
  {variant == "checkbox" && (
66
74
  <>
67
75
  <Checkbox
@@ -1,7 +1,7 @@
1
1
  import React, { useState } 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
  import { SelectableListItemProps } from './_item.js'
7
7
 
@@ -13,6 +13,7 @@ type SelectableListProps = {
13
13
  children?: React.ReactElement[],
14
14
  className?: string,
15
15
  data?: object,
16
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
16
17
  id?: string,
17
18
  variant?: 'checkbox' | 'radio',
18
19
  }
@@ -23,12 +24,14 @@ const SelectableList = (props: SelectableListProps) => {
23
24
  children,
24
25
  className,
25
26
  data = {},
27
+ htmlOptions = {},
26
28
  id,
27
29
  } = props
28
30
 
29
31
  const ariaProps = buildAriaProps(aria)
30
32
  const classes = classnames(buildCss('pb_selectable_list_kit'), globalProps(props), className)
31
33
  const dataProps = buildDataProps(data)
34
+ const htmlProps = buildHtmlProps(htmlOptions)
32
35
  const isRadio = props.variant === "radio"
33
36
  const defaultCheckedRadioValue = children.filter((item: {props:SelectableListItemProps} ) => item.props.defaultChecked)[0]?.props?.value
34
37
 
@@ -58,6 +61,7 @@ const SelectableList = (props: SelectableListProps) => {
58
61
  <div
59
62
  {...ariaProps}
60
63
  {...dataProps}
64
+ {...htmlProps}
61
65
  className={classes}
62
66
  id={id}
63
67
  >
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildDataProps, buildAriaProps } from '../utilities/props'
4
+ import { buildDataProps, buildAriaProps, buildHtmlProps } from '../utilities/props'
5
5
  import { titleize } from '../utilities/text'
6
6
 
7
7
  import Avatar, { AvatarProps } from '../pb_avatar/_avatar'
@@ -15,6 +15,7 @@ type SourceProps = {
15
15
  className?: string,
16
16
  data?: { [key: string]: string },
17
17
  hideIcon: boolean,
18
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
18
19
  id?: string,
19
20
  source?: string,
20
21
  type: "events" | "inbound" | "outbound" | "prospecting" | "referral" | "retail" | "user",
@@ -26,12 +27,14 @@ const Source = ({
26
27
  className,
27
28
  data = {},
28
29
  hideIcon = false,
30
+ htmlOptions = {},
29
31
  id,
30
32
  source,
31
33
  type = 'inbound',
32
34
  user = {},
33
35
  }: SourceProps) => {
34
36
  const dataProps = buildDataProps(data)
37
+ const htmlProps = buildHtmlProps(htmlOptions)
35
38
  const ariaProps = buildAriaProps(aria)
36
39
 
37
40
  const css = classnames([
@@ -71,6 +74,7 @@ const Source = ({
71
74
  <div
72
75
  {...ariaProps}
73
76
  {...dataProps}
77
+ {...htmlProps}
74
78
  className={css}
75
79
  id={id}
76
80
  >
@@ -2,61 +2,113 @@
2
2
  @import "../tokens/opacity";
3
3
  @import "../tokens/spacing";
4
4
 
5
- $pb_star_rating_number_width: 30px;
6
- $pb_star_rating_wrapper_width: 90px;
7
- $pb_star_rating_height: 26px;
8
5
 
9
- [class^=pb_star_rating_kit] {
10
- position: relative;
11
- display: inline-flex;
6
+ [class*=pb_star_rating_kit] {
7
+ display: flex;
8
+ align-items: flex-end;
12
9
  justify-content: flex-start;
13
- align-items: flex-start;
14
-
15
- .pb_star_rating_number {
16
- flex-shrink: 0;
17
- flex-grow: 0;
18
- flex-basis: $pb_star_rating_number_width;
19
- width: $pb_star_rating_number_width;
20
- min-height: $pb_star_rating_height;
21
- padding: 0 $space-xs 0;
22
- color: $text_lt_light;
23
- font-size: $text-small;
24
- display: flex;
25
- justify-content: center;
26
- align-items: center;
27
- }
28
-
29
- .pb_star_rating_wrapper {
30
- position: relative;
31
- width: $pb_star_rating_wrapper_width;
32
- flex-basis: $pb_star_rating_wrapper_width;
33
- flex-shrink: 0;
34
- flex-grow: 1;
35
- min-height: $pb_star_rating_height;
36
-
37
- .pb_star_rating_highlight {
38
- display: flex;
39
- position: absolute;
40
- top: 5px;
41
- left: 0;
42
- z-index: 5;
43
- color: $yellow;
44
- line-height: $pb_star_rating_height;
45
- }
46
- .pb_star_rating_base {
47
- display: flex;
48
- position: absolute;
49
- top: 5px;
50
- left: 0;
51
- z-index: 0;
52
- color: rgba($slate, $opacity-4);
53
- line-height: $pb_star_rating_height;
54
- }
55
- }
56
-
57
- &[class*=_hide_rating] {
58
- .pb_star_rating_number {
59
- display: none;
10
+
11
+ path {
12
+ &.suble_star_dark {
13
+ fill: $text_dk_default;
14
+ }
15
+ &.suble_star_light {
16
+ fill: $text_lt_default;
17
+ }
18
+ &.outline_star_dark {
19
+ stroke: $text_dk_lighter;
20
+ }
21
+ &.outline_star_light {
22
+ stroke: $text_lt_lighter;
23
+ }
24
+ &.empty_star_dark {
25
+ fill: $border_dark;
26
+ }
27
+ &.empty_star_light {
28
+ fill: $border_light;
29
+ }
30
+ }
31
+
32
+ .pb_star_rating_number_xs {
33
+ max-height: 14px;
34
+ }
35
+
36
+ .pb_star_rating_number_sm {
37
+ max-height: 14px;
38
+ }
39
+
40
+ .pb_star_rating_number_md {
41
+ max-height: 24px;
42
+ }
43
+
44
+ .pb_star_rating_number_lg {
45
+ max-height: 40px;
46
+ height: 29px;
47
+ }
48
+
49
+
50
+ $star-styles: (
51
+ yellow_star: (color: #F9BB00),
52
+ primary_star: (color: #0056CF),
53
+ suble_star_light: (color: $text_lt_default),
54
+ suble_star_dark: (color: $text_dk_default),
55
+ empty_star_dark: (color: $border_dark),
56
+ empty_star_light: (color: $border_light),
57
+ outline_empty_star_dark: (color: transparent),
58
+ outline_empty_star_light: (color: transparent)
59
+ );
60
+
61
+ @each $class, $styles in $star-styles {
62
+ .#{$class} {
63
+ @each $property, $value in $styles {
64
+ #{$property}: $value;
65
+ }
66
+ }
67
+ }
68
+
69
+
70
+ $star-styles: (
71
+ pb_star_react_xs: (font-size: $text_small, ),
72
+ pb_star_react_sm: (font-size: $text_base, ),
73
+ pb_star_react_md: (font-size: 24px, ),
74
+ pb_star_react_lg: (font-size: 48px, )
75
+ );
76
+
77
+ @each $class, $styles in $star-styles {
78
+ .#{$class} {
79
+ @each $property, $value in $styles {
80
+ #{$property}: $value;
81
+ }
82
+ }
83
+ }
84
+
85
+ $star-styles: (
86
+ pb_star_xs: (font-size: $text_small, width: 1em, margin-right: 4px),
87
+ pb_star_sm: (font-size: $text_base, width: 1em, margin-right: 4px),
88
+ pb_star_md: (font-size: 24px, width: 1em, margin-right: 6px),
89
+ pb_star_lg: (font-size: 48px, width: 1em, margin-right: 12px)
90
+ );
91
+
92
+ @each $class, $styles in $star-styles {
93
+ .#{$class} {
94
+ @each $property, $value in $styles {
95
+ #{$property}: $value;
96
+ }
97
+ }
98
+ }
99
+
100
+ $star-padding: (
101
+ pb_star_padding_xs: (margin-right: 4px),
102
+ pb_star_padding_sm: (margin-right: 4px),
103
+ pb_star_padding_md: (margin-right: 6px),
104
+ pb_star_padding_lg: (margin-right: 12px)
105
+ );
106
+
107
+ @each $class, $styles in $star-padding {
108
+ .#{$class} {
109
+ @each $property, $value in $styles {
110
+ #{$property}: $value;
111
+ }
60
112
  }
61
113
  }
62
114
  }