playbook_ui 13.14.0.pre.alpha.PLAY1109bugdisplaypropblocksfontcolor1784 → 13.14.0.pre.alpha.play1101betaicons1825

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/index.js +2 -1
  4. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
  5. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
  6. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
  7. data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
  8. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
  9. data/app/pb_kits/playbook/pb_beta_icon/_icon.scss +12 -0
  10. data/app/pb_kits/playbook/pb_beta_icon/_icon.tsx +164 -0
  11. data/app/pb_kits/playbook/pb_beta_icon/docs/_description.md +1 -0
  12. data/app/pb_kits/playbook/pb_beta_icon/docs/_footer.md +2 -0
  13. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.html.erb +3 -0
  14. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.jsx +35 -0
  15. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_animate.md +1 -0
  16. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border.html.erb +1 -0
  17. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border.jsx +19 -0
  18. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_border_swift.md +7 -0
  19. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.html.erb +16 -0
  20. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.jsx +34 -0
  21. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_custom.md +19 -0
  22. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default.html.erb +1 -0
  23. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default.jsx +17 -0
  24. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_default_swift.md +7 -0
  25. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.html.erb +1 -0
  26. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.jsx +21 -0
  27. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_fa_kit.md +7 -0
  28. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip.html.erb +3 -0
  29. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip.jsx +33 -0
  30. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_flip_swift.md +11 -0
  31. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_props_swift.md +8 -0
  32. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.html.erb +2 -0
  33. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.jsx +26 -0
  34. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_pull.md +1 -0
  35. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate.html.erb +3 -0
  36. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate.jsx +33 -0
  37. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_rotate_swift.md +11 -0
  38. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes.html.erb +16 -0
  39. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes.jsx +133 -0
  40. data/app/pb_kits/playbook/pb_beta_icon/docs/_icon_sizes_swift.md +46 -0
  41. data/app/pb_kits/playbook/pb_beta_icon/docs/example.yml +30 -0
  42. data/app/pb_kits/playbook/pb_beta_icon/docs/index.js +9 -0
  43. data/app/pb_kits/playbook/pb_beta_icon/icon.html.erb +15 -0
  44. data/app/pb_kits/playbook/pb_beta_icon/icon.rb +153 -0
  45. data/app/pb_kits/playbook/pb_beta_icon/icon.test.js +155 -0
  46. data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
  47. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
  48. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
  49. data/app/pb_kits/playbook/pb_body/body.rb +1 -8
  50. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
  51. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
  52. data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
  53. data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
  54. data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
  55. data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
  56. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
  57. data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
  58. data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
  59. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
  60. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
  61. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
  62. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
  63. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
  64. data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
  65. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
  66. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
  67. data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
  68. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
  69. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
  70. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -57
  71. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +4 -57
  72. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
  73. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
  74. data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
  75. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
  76. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
  77. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
  78. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
  79. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
  80. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
  81. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
  82. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
  83. data/app/pb_kits/playbook/pb_detail/_detail.tsx +3 -3
  84. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
  85. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
  86. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
  87. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
  88. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
  89. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
  90. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
  91. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
  92. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
  93. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
  94. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
  95. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
  96. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
  97. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
  98. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
  99. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
  100. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
  101. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
  102. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
  103. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
  104. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
  105. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
  106. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
  107. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
  108. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
  109. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  110. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
  111. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
  112. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
  113. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  114. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
  115. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  116. data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
  117. data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
  118. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
  119. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
  120. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  121. data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
  122. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  123. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  124. data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
  125. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  126. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
  127. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
  128. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
  129. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
  130. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
  131. data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
  132. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
  133. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
  134. data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
  135. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
  136. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
  137. data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
  138. data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
  139. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
  140. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
  141. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
  142. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
  143. data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
  144. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
  145. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
  146. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -1
  147. data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
  148. data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
  149. data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
  150. data/app/pb_kits/playbook/pb_select/docs/example.yml +5 -0
  151. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
  152. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
  153. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
  154. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
  155. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
  156. data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
  157. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
  158. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
  159. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
  160. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  161. data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
  162. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  163. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
  164. data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
  165. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  166. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
  167. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  168. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  169. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
  170. data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
  171. data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
  172. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
  173. data/app/pb_kits/playbook/pb_title/title.rb +2 -9
  174. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
  175. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
  176. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  177. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
  178. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  179. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
  180. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  181. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
  182. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
  183. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  184. data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
  185. data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
  186. data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
  187. data/app/pb_kits/playbook/utilities/props.ts +2 -2
  188. data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
  189. data/dist/playbook-rails.js +5 -5
  190. data/lib/playbook/classnames.rb +1 -0
  191. data/lib/playbook/kit_base.rb +2 -0
  192. data/lib/playbook/truncate.rb +29 -0
  193. data/lib/playbook/version.rb +1 -1
  194. metadata +51 -2
@@ -13,7 +13,7 @@ type DialogFooterProps = {
13
13
  children: React.ReactChild[] | React.ReactChild | string,
14
14
  className?: string,
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
  padding?: string,
19
19
  paddingBottom?: string,
@@ -23,7 +23,7 @@ type DialogFooterProps = {
23
23
  } & GlobalProps
24
24
 
25
25
  // Footer component
26
- const DialogFooter = (props: DialogFooterProps) => {
26
+ const DialogFooter = (props: DialogFooterProps): React.ReactElement => {
27
27
  const {
28
28
  children,
29
29
  className,
@@ -38,13 +38,12 @@ const DialogFooter = (props: DialogFooterProps) => {
38
38
 
39
39
  return (
40
40
  <div
41
- {...htmlProps}
41
+ {...htmlProps}
42
42
  >
43
43
  {separator &&
44
44
  <SectionSeparator />
45
45
  }
46
- <div className="dialog-pseudo-footer">
47
- </div>
46
+ <div className="dialog-pseudo-footer" />
48
47
  <Flex
49
48
  className={classnames(footerCSS, footerSpacing, className)}
50
49
  spacing={spacing}
@@ -13,8 +13,8 @@ type DialogHeaderProps = {
13
13
  children: React.ReactNode[] | React.ReactNode | string,
14
14
  className?: string,
15
15
  closeable?: boolean,
16
- data?: object,
17
- htmlOptions?: {[key: string]: string | number | boolean | Function},
16
+ data?: {[key: string]: string},
17
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  id?: string,
19
19
  padding?: string,
20
20
  separator?: boolean,
@@ -23,7 +23,7 @@ type DialogHeaderProps = {
23
23
  title?: string,
24
24
  } & GlobalProps
25
25
 
26
- const DialogHeader = (props: DialogHeaderProps) => {
26
+ const DialogHeader = (props: DialogHeaderProps): React.ReactElement => {
27
27
  const {
28
28
  aria = {},
29
29
  children,
@@ -56,7 +56,7 @@ const DialogHeader = (props: DialogHeaderProps) => {
56
56
  {children}
57
57
  {closeable &&
58
58
  <CloseIcon
59
- onClose={api.onClose}
59
+ onClose={api.onClose}
60
60
  />
61
61
  }
62
62
 
@@ -0,0 +1,11 @@
1
+ ![user-default](https://github.com/powerhome/playbook/assets/54749071/f9b593d5-a688-49bf-a282-8fb70058b539)
2
+
3
+ ```swift
4
+ PBDialog(
5
+ title: "This is some informative text",
6
+ message: infoMessage,
7
+ cancelButton: ("Cancel", closeToast),
8
+ confirmButton: ("Okay", closeToast)
9
+ )
10
+ ```
11
+
@@ -49,15 +49,18 @@ const DialogFullHeight = () => {
49
49
  <Flex wrap>
50
50
  <Button id="sm"
51
51
  marginRight="md"
52
- onClick={toggleHeaderSeparatorDialog}>
52
+ onClick={toggleHeaderSeparatorDialog}
53
+ >
53
54
  {"Small Dialog"}
54
55
  </Button>
55
56
  <Button marginRight="md"
56
- onClick={toggleFooterSeparatorDialog}>
57
+ onClick={toggleFooterSeparatorDialog}
58
+ >
57
59
  {"Medium Dialog"}
58
60
  </Button>
59
61
  <Button marginRight="md"
60
- onClick={toggleBothSeparatorsDialog}>
62
+ onClick={toggleBothSeparatorsDialog}
63
+ >
61
64
  {"Large Dialog"}
62
65
  </Button>
63
66
  </Flex>
@@ -89,7 +92,8 @@ const DialogFullHeight = () => {
89
92
  <Dialog.Footer>
90
93
  <Button onClick={toggle}>{"Send My Issue"}</Button>
91
94
  <Button onClick={toggle}
92
- variant="link">
95
+ variant="link"
96
+ >
93
97
  {"Back"}
94
98
  </Button>
95
99
  </Dialog.Footer>
@@ -48,15 +48,18 @@ const DialogFullHeightPlacement = () => {
48
48
  <Flex wrap>
49
49
  <Button id="sm"
50
50
  marginRight="md"
51
- onClick={toggleHeaderSeparatorDialog}>
51
+ onClick={toggleHeaderSeparatorDialog}
52
+ >
52
53
  {"Left Dialog"}
53
54
  </Button>
54
55
  <Button marginRight="xl"
55
- onClick={toggleFooterSeparatorDialog}>
56
+ onClick={toggleFooterSeparatorDialog}
57
+ >
56
58
  {"Center Dialog"}
57
59
  </Button>
58
60
  <Button marginRight="xl"
59
- onClick={toggleBothSeparatorsDialog}>
61
+ onClick={toggleBothSeparatorsDialog}
62
+ >
60
63
  {"Right Dialog"}
61
64
  </Button>
62
65
  </Flex>
@@ -88,7 +91,8 @@ const DialogFullHeightPlacement = () => {
88
91
  <Dialog.Footer>
89
92
  <Button onClick={toggle}>{"Send My Issue"}</Button>
90
93
  <Button onClick={toggle}
91
- variant="link">
94
+ variant="link"
95
+ >
92
96
  {"Back"}
93
97
  </Button>
94
98
  </Dialog.Footer>
@@ -0,0 +1,13 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **content** | `Content` | Sets the View content | | |
5
+ | **title** | `String` | Sets title for dialog header | | |
6
+ | **message** | `String` | Sets dialog message| | |
7
+ | **variant** | `DialogVariant` | Changes variant of dialog | `.default` | `.default` `.status()` |
8
+ | **isStacked** | `isStacked` | Changes whether the dialog buttons are stacked or inline | `false` | `true` `false` |
9
+ | **cancelButton** | `Action` | Dismisses the dialog | | |
10
+ | **confirmButton** | `Action` | Confirms dialog message was received | | |
11
+ | **onClose** | `Action` | Starts action when dialog is closed | | |
12
+ | **size** | `DialogSize` | Determines size of dialog | `.medium`| `.small` `.medium` `large` |
13
+ | **shouldCloseOnOverlay** | `Bool` | Determines if overlay should close | `false` | `true` `false` |
@@ -16,10 +16,12 @@ const DialogScrollable = () => {
16
16
  return (
17
17
  <>
18
18
  <Button marginRight="md"
19
- onClick={toggleDialog1}>{'Open Dialog'}
19
+ onClick={toggleDialog1}
20
+ >{'Open Dialog'}
20
21
  </Button>
21
22
  <Button marginRight="md"
22
- onClick={toggleDialog2}>{'Open Full Height Dialog'}
23
+ onClick={toggleDialog2}
24
+ >{'Open Full Height Dialog'}
23
25
  </Button>
24
26
  <Dialog
25
27
  cancelButton="Cancel"
@@ -0,0 +1,18 @@
1
+ ![dialog-large](https://github.com/powerhome/playbook/assets/54749071/41ea273d-3f85-4514-88d7-21f49499f9a2)
2
+
3
+ ```swift
4
+ @State private var presentSmallDialog: Bool = false
5
+ @State private var presentMediumDialog: Bool = false
6
+ @State private var presentLargeDialog: Bool = false
7
+ let infoMessage = "This is a message for informational purposes only and requires no action."
8
+
9
+ PBDialog(
10
+ title: "Large",
11
+ message: infoMessage,
12
+ variant: .default,
13
+ isStacked: false,
14
+ cancelButton: ("Cancel", {}),
15
+ confirmButton: ("Okay", {}),
16
+ size: .large
17
+ )
18
+ ```
@@ -84,7 +84,7 @@ const DialogStatus = () => {
84
84
  <Flex
85
85
  rowGap="xs"
86
86
  wrap
87
- >
87
+ >
88
88
  <Button
89
89
  marginRight="md"
90
90
  onClick={toggleDefaultAlert}
@@ -0,0 +1,14 @@
1
+ ![success](https://github.com/powerhome/playbook/assets/54749071/a3605f4f-ea77-4377-a1bd-977bb3c26a03)
2
+
3
+ ```swift
4
+
5
+ PBDialog(
6
+ title: "Success!",
7
+ message: infoMessage,
8
+ variant: .status(.success),
9
+ isStacked: true,
10
+ cancelButton: ("Cancel", closeToast),
11
+ confirmButton: ("Okay", closeToast),
12
+ size: .small
13
+ )
14
+ ```
@@ -22,3 +22,10 @@ examples:
22
22
  - dialog_stacked_alert: Stacked Button Alert
23
23
  - dialog_full_height: Full Height
24
24
  - dialog_full_height_placement: Full Height Placement
25
+
26
+ swift:
27
+ - dialog_default_swift: Simple
28
+ - dialog_sizes_swift: Sizes
29
+ - dialog_status_swift: Status
30
+ - dialog_props_table: ""
31
+
@@ -7,13 +7,13 @@ type DistributionBarProps = {
7
7
  className?: string,
8
8
  colors: [],
9
9
  data?: string,
10
- htmlOptions?: {[key: string]: string | number | boolean | Function},
10
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
11
11
  id?: string,
12
12
  size?: "lg" | "sm",
13
13
  widths?: number[],
14
14
  }
15
15
 
16
- const normalizeCharacters = (widths: number[]) => {
16
+ const normalizeCharacters = (widths: number[]) => {
17
17
  return widths.map((width) => {
18
18
  return parseInt(width.toString().replace(/[^0-9.]/gi, ''))
19
19
  })
@@ -33,7 +33,7 @@ const barValues = (normalizedValues: number[], colors: []) => {
33
33
  })
34
34
  }
35
35
 
36
- const DistributionBar = (props: DistributionBarProps) => {
36
+ const DistributionBar = (props: DistributionBarProps): React.ReactElement => {
37
37
  const {
38
38
  htmlOptions = {},
39
39
  size = 'lg',
@@ -45,8 +45,8 @@ const DistributionBar = (props: DistributionBarProps) => {
45
45
 
46
46
  return (
47
47
  <div
48
- className={classnames(`pb_distribution_bar_${size}`, globalProps(props))}
49
- {...htmlProps}
48
+ className={classnames(`pb_distribution_bar_${size}`, globalProps(props))}
49
+ {...htmlProps}
50
50
  >
51
51
  {barValues(normalizedValues, colors)}
52
52
  </div>
@@ -14,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  acceptedFilesDescription?: string,
19
19
  maxSize?: number,
20
20
  onFilesAccepted: Callback<File, File>,
@@ -21,7 +21,7 @@ type FixedConfirmationToastProps = {
21
21
  closeable?: boolean,
22
22
  data?: string,
23
23
  horizontal?: "right" | "left" | "center",
24
- htmlOptions?: {[key: string]: string | number | boolean | Function},
24
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
25
25
  id?: string,
26
26
  multiLine?: boolean,
27
27
  onClose?: () => void,
@@ -10,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  id?: string,
15
15
  inline?: boolean,
16
16
  orientation?: "row" | "column",
@@ -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',
@@ -9,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
13
13
  id?: string,
14
14
  }
15
15
 
@@ -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,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
26
26
  id?: string;
27
27
  max?: number;
28
28
  min?: number;
@@ -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,
@@ -18,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
22
22
  homeId: string,
23
23
  houseStyle: string,
24
24
  homeUrl: string,
@@ -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"
@@ -16,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
20
20
  id?: string,
21
21
  orientation?: "vertical" | "horizontal",
22
22
  size?: "sm" | "md" | "lg",
@@ -14,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
18
18
  id?: string,
19
19
  text: string,
20
20
  }
@@ -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",
@@ -8,7 +8,7 @@ type OnlineStatusProps = {
8
8
  aria?: {[key: string]: string},
9
9
  className?: string,
10
10
  data?: {[key: string]: string | number},
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  status?: "online" | "offline" | "away",
14
14
  } & GlobalProps
@@ -20,7 +20,7 @@ type PassphraseProps = {
20
20
  className?: string,
21
21
  data?: object,
22
22
  dark?: boolean,
23
- htmlOptions?: {[key: string]: string | number | boolean | Function},
23
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
24
24
  id?: string,
25
25
  inputProps?: {},
26
26
  label?: string,
@@ -17,7 +17,7 @@ type PersonProps = {
17
17
  className?: string | string[],
18
18
  data?: { [key: string]: string },
19
19
  firstName: string,
20
- htmlOptions?: {[key: string]: string | number | boolean | Function},
20
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
21
21
  id?: string,
22
22
  lastName: string,
23
23
  }
@@ -19,7 +19,7 @@ type PersonContactProps = {
19
19
  className?: string | string[],
20
20
  data?: object,
21
21
  firstName: string,
22
- htmlOptions?: {[key: string]: string | number | boolean | Function},
22
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
23
23
  id?: string,
24
24
  lastName: string,
25
25
  contacts?: ContactItem[],