playbook_ui 13.14.0 → 13.15.0.pre.alpha.PLAY10851907

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -0
  3. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
  4. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
  5. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
  6. data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
  7. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
  8. data/app/pb_kits/playbook/pb_body/_body.scss +0 -5
  9. data/app/pb_kits/playbook/pb_body/_body.tsx +5 -9
  10. data/app/pb_kits/playbook/pb_body/_body_mixins.scss +0 -20
  11. data/app/pb_kits/playbook/pb_body/body.rb +1 -8
  12. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
  13. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
  14. data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
  15. data/app/pb_kits/playbook/pb_button/docs/_button_props_swift.md +11 -0
  16. data/app/pb_kits/playbook/pb_button/docs/_button_reaction_swift.md +26 -0
  17. data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
  18. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
  19. data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
  20. data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
  21. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
  22. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
  23. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
  24. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
  25. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
  26. data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
  27. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
  28. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
  29. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_colors_swift.md +27 -0
  30. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default_swift.md +22 -0
  31. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_props_table.md +8 -0
  32. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_sizes_swift.md +26 -0
  33. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +6 -0
  34. data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
  35. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
  36. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
  37. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -55
  38. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +5 -56
  39. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
  40. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
  41. data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
  42. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -1
  43. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
  44. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
  45. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
  46. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
  47. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
  48. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
  49. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
  50. data/app/pb_kits/playbook/pb_detail/_detail.scss +2 -2
  51. data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -5
  52. data/app/pb_kits/playbook/pb_detail/detail.rb +1 -1
  53. data/app/pb_kits/playbook/pb_detail/detail.test.jsx +2 -2
  54. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
  55. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
  56. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
  57. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
  58. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
  59. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_default_swift.md +11 -0
  60. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height.jsx +8 -4
  61. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_full_height_placement.jsx +8 -4
  62. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_props_table.md +13 -0
  63. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_scrollable.jsx +4 -2
  64. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_sizes_swift.md +18 -0
  65. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
  66. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status_swift.md +14 -0
  67. data/app/pb_kits/playbook/pb_dialog/docs/example.yml +7 -0
  68. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
  69. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
  70. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
  71. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
  72. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
  73. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
  74. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
  75. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
  76. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
  77. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
  78. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
  79. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  80. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
  81. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
  82. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
  83. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  84. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
  85. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  86. data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
  87. data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
  88. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
  89. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
  90. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  91. data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
  92. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  93. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  94. data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
  95. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  96. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
  97. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
  98. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
  99. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
  100. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
  101. data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
  102. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_bold_swift.md +17 -0
  103. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_default_swift.md +17 -0
  104. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_no_highlight_swift.md +18 -0
  105. data/app/pb_kits/playbook/pb_nav/docs/_nav_horizontal_subtle_swift.md +18 -0
  106. data/app/pb_kits/playbook/pb_nav/docs/_nav_props_swift.md +11 -0
  107. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_bold_swift.md +18 -0
  108. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_default_swift.md +18 -0
  109. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_no_highlight_swift.md +19 -0
  110. data/app/pb_kits/playbook/pb_nav/docs/_nav_vertical_subtle_swift.md +17 -0
  111. data/app/pb_kits/playbook/pb_nav/docs/example.yml +17 -0
  112. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
  113. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +52 -51
  114. data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
  115. data/app/pb_kits/playbook/pb_person/docs/_person_default_swift.md +8 -0
  116. data/app/pb_kits/playbook/pb_person/docs/_person_props_swift.md +5 -0
  117. data/app/pb_kits/playbook/pb_person/docs/example.yml +4 -0
  118. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +21 -20
  119. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +5 -4
  120. data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
  121. data/app/pb_kits/playbook/pb_popover/_popover.tsx +7 -5
  122. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +21 -21
  123. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +5 -5
  124. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
  125. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
  126. data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
  127. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorButton.tsx +19 -17
  128. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/EditorTypes.ts +1 -1
  129. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/MoreExtensionsDropdown.tsx +23 -21
  130. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/Toolbar.tsx +18 -10
  131. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarDropdown.tsx +46 -23
  132. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarHistory.tsx +8 -8
  133. data/app/pb_kits/playbook/pb_rich_text_editor/TipTap/ToolbarNodes.tsx +7 -7
  134. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +18 -16
  135. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +10 -8
  136. data/app/pb_kits/playbook/pb_select/_select.tsx +2 -2
  137. data/app/pb_kits/playbook/pb_select/docs/_select_default_swift.md +15 -0
  138. data/app/pb_kits/playbook/pb_select/docs/_select_error_swift.md +18 -0
  139. data/app/pb_kits/playbook/pb_select/docs/_select_props_table.md +8 -0
  140. data/app/pb_kits/playbook/pb_select/docs/example.yml +5 -0
  141. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
  142. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +26 -25
  143. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +28 -27
  144. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
  145. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +3 -2
  146. data/app/pb_kits/playbook/pb_source/_source.tsx +16 -16
  147. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
  148. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
  149. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
  150. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  151. data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
  152. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  153. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
  154. data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
  155. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  156. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
  157. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  158. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  159. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
  160. data/app/pb_kits/playbook/pb_title/_title.scss +0 -5
  161. data/app/pb_kits/playbook/pb_title/_title.tsx +2 -5
  162. data/app/pb_kits/playbook/pb_title/_title_mixin.scss +0 -19
  163. data/app/pb_kits/playbook/pb_title/title.rb +2 -9
  164. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
  165. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
  166. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  167. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
  168. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  169. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
  170. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  171. data/app/pb_kits/playbook/pb_user/docs/_user_horizontal_swift.md +37 -0
  172. data/app/pb_kits/playbook/pb_user/docs/_user_props_table.md +10 -0
  173. data/app/pb_kits/playbook/pb_user/docs/_user_size_swift.md +35 -0
  174. data/app/pb_kits/playbook/pb_user/docs/_user_text_only_swift.md +27 -0
  175. data/app/pb_kits/playbook/pb_user/docs/_user_vertical_size_swift.md +35 -0
  176. data/app/pb_kits/playbook/pb_user/docs/example.yml +7 -0
  177. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
  178. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
  179. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  180. data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
  181. data/app/pb_kits/playbook/utilities/_truncate.scss +20 -0
  182. data/app/pb_kits/playbook/utilities/globalProps.ts +13 -2
  183. data/app/pb_kits/playbook/utilities/props.ts +2 -2
  184. data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +21 -0
  185. data/dist/playbook-rails.js +4 -4
  186. data/lib/playbook/classnames.rb +1 -0
  187. data/lib/playbook/kit_base.rb +2 -0
  188. data/lib/playbook/truncate.rb +29 -0
  189. data/lib/playbook/version.rb +2 -2
  190. metadata +39 -7
@@ -13,25 +13,26 @@ import Flex from '../pb_flex/_flex'
13
13
  import Icon from '../pb_icon/_icon'
14
14
  import PbReactPopover from '../pb_popover/_popover'
15
15
  import TextInput from '../pb_text_input/_text_input'
16
+ import { GenericObject } from "../types"
16
17
 
17
18
  type PassphraseProps = {
18
19
  aria?: { [key: string]: string },
19
20
  confirmation?: boolean,
20
21
  className?: string,
21
- data?: object,
22
+ data?: GenericObject,
22
23
  dark?: boolean,
23
- htmlOptions?: {[key: string]: string | number | boolean | Function},
24
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
24
25
  id?: string,
25
- inputProps?: {},
26
+ inputProps?: GenericObject,
26
27
  label?: string,
27
- onChange: (inputValue: String) => void,
28
+ onChange: (inputValue: string) => void,
28
29
  showTipsBelow?: "always" | "xs" | "sm" | "md" | "lg" | "xl",
29
30
  tips?: Array<string>,
30
31
  uncontrolled?: boolean,
31
32
  value: string,
32
33
  }
33
34
 
34
- const Passphrase = (props: PassphraseProps) => {
35
+ const Passphrase = (props: PassphraseProps): React.ReactElement => {
35
36
  const {
36
37
  aria = {},
37
38
  className,
@@ -42,7 +43,7 @@ const Passphrase = (props: PassphraseProps) => {
42
43
  id,
43
44
  inputProps = {},
44
45
  label = confirmation ? "Confirm Passphrase" : "Passphrase",
45
- onChange = () => { },
46
+ onChange = () => undefined,
46
47
  showTipsBelow = "always",
47
48
  tips = [],
48
49
  uncontrolled = false,
@@ -84,60 +85,60 @@ const Passphrase = (props: PassphraseProps) => {
84
85
  globalProps(props),
85
86
  className
86
87
  )
87
- const dataProps = buildDataProps(data)
88
- const htmlProps = buildHtmlProps(htmlOptions)
88
+ const dataProps = buildDataProps(data)
89
+ const htmlProps = buildHtmlProps(htmlOptions)
89
90
 
90
91
  const popoverReference = (
91
92
  <CircleIconButton
92
- className={tipClass}
93
- dark={dark}
94
- icon="info-circle"
95
- onClick={toggleShowPopover}
96
- variant="link"
93
+ className={tipClass}
94
+ dark={dark}
95
+ icon="info-circle"
96
+ onClick={toggleShowPopover}
97
+ variant="link"
97
98
  />
98
99
  )
99
100
 
100
101
  return (
101
102
  <div
102
- {...ariaProps}
103
- {...dataProps}
104
- {...htmlProps}
105
- className={classes}
106
- id={id}
103
+ {...ariaProps}
104
+ {...dataProps}
105
+ {...htmlProps}
106
+ className={classes}
107
+ id={id}
107
108
  >
108
109
  <label>
109
110
  <Flex align="baseline">
110
111
  <Caption
111
- className="passphrase-label"
112
- text={label}
112
+ className="passphrase-label"
113
+ text={label}
113
114
  />
114
115
  {tips.length > 0 && !confirmation &&
115
116
  <PbReactPopover
116
- className="passphrase-tips"
117
- closeOnClick="outside"
118
- placement="right"
119
- reference={popoverReference}
120
- shouldClosePopover={handleShouldClosePopover}
121
- show={showPopover}
117
+ className="passphrase-tips"
118
+ closeOnClick="outside"
119
+ placement="right"
120
+ reference={popoverReference}
121
+ shouldClosePopover={handleShouldClosePopover}
122
+ show={showPopover}
122
123
  >
123
124
  <Flex
124
- align="center"
125
- orientation="column"
125
+ align="center"
126
+ orientation="column"
126
127
  >
127
128
  <Caption
128
- marginBottom="xs"
129
- text="Tips for a good passphrase"
129
+ marginBottom="xs"
130
+ text="Tips for a good passphrase"
130
131
  />
131
132
  <div>
132
133
  {tips.map((tip, i) => (
133
134
  <Caption
134
- key={i}
135
- marginBottom="xs"
136
- size="xs"
135
+ key={i}
136
+ marginBottom="xs"
137
+ size="xs"
137
138
  >
138
139
  <Icon
139
- icon="shield-check"
140
- marginRight="xs"
140
+ icon="shield-check"
141
+ marginRight="xs"
141
142
  />
142
143
  {tip}
143
144
  </Caption>
@@ -149,30 +150,30 @@ const Passphrase = (props: PassphraseProps) => {
149
150
  </Flex>
150
151
  <div className="passphrase-text-input-wrapper">
151
152
  <TextInput
152
- className="passphrase-text-input"
153
- dark={dark}
154
- marginBottom="xs"
155
- onChange={handleChange}
156
- placeholder="Enter a passphrase..."
157
- type={showPassphrase ? "text" : "password"}
158
- value={displayValue}
159
- {...inputProps}
153
+ className="passphrase-text-input"
154
+ dark={dark}
155
+ marginBottom="xs"
156
+ onChange={handleChange}
157
+ placeholder="Enter a passphrase..."
158
+ type={showPassphrase ? "text" : "password"}
159
+ value={displayValue}
160
+ {...inputProps}
160
161
  />
161
162
  <span
162
- className="show-passphrase-icon"
163
- onClick={toggleShowPassphrase}
163
+ className="show-passphrase-icon"
164
+ onClick={toggleShowPassphrase}
164
165
  >
165
166
  <Body
166
- className={showPassphrase ? "hide-icon" : ""}
167
- color="light"
168
- dark={dark}
167
+ className={showPassphrase ? "hide-icon" : ""}
168
+ color="light"
169
+ dark={dark}
169
170
  >
170
171
  <Icon icon="eye-slash" />
171
172
  </Body>
172
173
  <Body
173
- className={showPassphrase ? "" : "hide-icon"}
174
- color="light"
175
- dark={dark}
174
+ className={showPassphrase ? "" : "hide-icon"}
175
+ color="light"
176
+ dark={dark}
176
177
  >
177
178
  <Icon icon="eye" />
178
179
  </Body>
@@ -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
  }
@@ -0,0 +1,8 @@
1
+ ![PBIOS-227](https://github.com/powerhome/playbook/assets/92755007/e43f94bd-2d2e-46cc-a848-6ac7425f89f9)
2
+
3
+
4
+ ```swift
5
+
6
+ PBPerson(firstName: "Timothy", lastName: "Wenhold")
7
+
8
+ ```
@@ -0,0 +1,5 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **firstName** | `String` | Sets the first name | | |
5
+ | **lastName** | `String` | Sets the last name | | |
@@ -7,3 +7,7 @@ examples:
7
7
  react:
8
8
  - person_default: Default
9
9
 
10
+ swift:
11
+ - person_default_swift: Default
12
+ - person_props_swift: ""
13
+
@@ -7,6 +7,7 @@ import { globalProps } from '../utilities/globalProps'
7
7
  import Caption from '../pb_caption/_caption'
8
8
  import Contact from '../pb_contact/_contact'
9
9
  import Person from '../pb_person/_person'
10
+ import { GenericObject } from '../types'
10
11
 
11
12
  type ContactItem = {
12
13
  contactType: string,
@@ -17,15 +18,15 @@ type ContactItem = {
17
18
  type PersonContactProps = {
18
19
  aria?: { [key: string]: string },
19
20
  className?: string | string[],
20
- data?: object,
21
+ data?: GenericObject,
21
22
  firstName: string,
22
- htmlOptions?: {[key: string]: string | number | boolean | Function},
23
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
23
24
  id?: string,
24
25
  lastName: string,
25
26
  contacts?: ContactItem[],
26
27
  }
27
28
 
28
- const PersonContact = (props: PersonContactProps) => {
29
+ const PersonContact = (props: PersonContactProps): React.ReactElement => {
29
30
  const {
30
31
  aria = {},
31
32
  className,
@@ -60,35 +61,35 @@ const PersonContact = (props: PersonContactProps) => {
60
61
 
61
62
  return (
62
63
  <div
63
- {...ariaProps}
64
- {...dataProps}
65
- {...htmlProps}
66
- className={classes}
67
- id={id}
64
+ {...ariaProps}
65
+ {...dataProps}
66
+ {...htmlProps}
67
+ className={classes}
68
+ id={id}
68
69
  >
69
70
  <Person
70
- firstName={firstName}
71
- lastName={lastName}
71
+ firstName={firstName}
72
+ lastName={lastName}
72
73
  />
73
74
  {validContacts().map((contactObject, index) => (
74
75
  <Contact
75
- contactDetail={contactObject.contactDetail}
76
- contactType={contactObject.contactType}
77
- contactValue={contactObject.contactValue}
78
- key={`valid-contact-${index}`}
76
+ contactDetail={contactObject.contactDetail}
77
+ contactType={contactObject.contactType}
78
+ contactValue={contactObject.contactValue}
79
+ key={`valid-contact-${index}`}
79
80
  />
80
81
  ))}
81
82
  {wrongContacts().map((contactObject, index) => (
82
83
  <div key={`wrong-contact-caption-wrapper-${index}`}>
83
84
  <Caption
84
- className="wrong_numbers"
85
- key={`wrong-contact-caption-${index}`}
86
- text="wrong number"
85
+ className="wrong_numbers"
86
+ key={`wrong-contact-caption-${index}`}
87
+ text="wrong number"
87
88
  />
88
89
  <Contact
89
- contactType={contactObject.contactType}
90
- contactValue={contactObject.contactValue}
91
- key={`wrong-contact-${index}`}
90
+ contactType={contactObject.contactType}
91
+ contactValue={contactObject.contactValue}
92
+ key={`wrong-contact-${index}`}
92
93
  />
93
94
  </div>
94
95
  ))}
@@ -25,7 +25,7 @@ type PhoneNumberInputProps = {
25
25
  data?: { [key: string]: string },
26
26
  disabled?: boolean,
27
27
  error?: string,
28
- htmlOptions?: {[key: string]: string | number | boolean | Function},
28
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
29
29
  id?: string,
30
30
  initialCountry?: string,
31
31
  isValid?: (valid: boolean) => void,
@@ -62,6 +62,7 @@ const formatAllCountries = () => {
62
62
  formatAllCountries()
63
63
 
64
64
  const containOnlyNumbers = (value: string) => {
65
+ // eslint-disable-next-line no-useless-escape
65
66
  return /^[()+\-\ .\d]*$/g.test(value)
66
67
  }
67
68
 
@@ -259,9 +260,9 @@ const PhoneNumberInput = (props: PhoneNumberInputProps, ref?: React.MutableRefOb
259
260
  if (required) textInputProps.required = true
260
261
 
261
262
  return (
262
- <div
263
- {...wrapperProps}
264
- {...htmlProps}
263
+ <div
264
+ {...wrapperProps}
265
+ {...htmlProps}
265
266
  >
266
267
  <TextInput
267
268
  ref={
@@ -9,7 +9,7 @@ type PillProps = {
9
9
  aria?: {[key: string]: string},
10
10
  className?: string,
11
11
  data?: {[key: string]: 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
  variant?: "success" | "warning" | "error" | "info" | "neutral" | "primary",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable react/no-multi-comp */
1
2
  import React, { useEffect, useState } from "react";
2
3
  import ReactDOM from "react-dom";
3
4
  import {
@@ -25,7 +26,7 @@ type PbPopoverProps = {
25
26
  className?: string;
26
27
  closeOnClick?: "outside" | "inside" | "any";
27
28
  data?: { [key: string]: string },
28
- htmlOptions?: {[key: string]: string | number | boolean | Function},
29
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
29
30
  id?: string;
30
31
  offset?: boolean;
31
32
  reference: PopperReference & any;
@@ -54,7 +55,7 @@ const popoverModifiers = ({
54
55
  offset,
55
56
  }: {
56
57
  modifiers: Modifier<any> & any;
57
- offset: {};
58
+ offset: boolean;
58
59
  }) => {
59
60
  return offset ? modifiers.concat([POPOVER_MODIFIERS.offset]) : modifiers;
60
61
  };
@@ -143,7 +144,7 @@ const Popover = (props: PbPopoverProps) => {
143
144
  );
144
145
  };
145
146
 
146
- const PbReactPopover = (props: PbPopoverProps) => {
147
+ const PbReactPopover = (props: PbPopoverProps): React.ReactElement => {
147
148
  const [targetId] = useState(_uniqueId('id-'))
148
149
  const {
149
150
  className,
@@ -226,9 +227,10 @@ const PbReactPopover = (props: PbPopoverProps) => {
226
227
  <PopperReference>
227
228
  {({ ref }) => (
228
229
  <span
229
- id={"reference-" + targetId}
230
230
  className="pb_popover_reference_wrapper"
231
- ref={ref}>
231
+ id={"reference-" + targetId}
232
+ ref={ref}
233
+ >
232
234
  <reference.type {...reference.props} />
233
235
  </span>
234
236
  )}
@@ -13,13 +13,21 @@ type ProgressPillsProps = {
13
13
  className?: string,
14
14
  data?: { [key: string]: string },
15
15
  dark?: boolean,
16
- htmlOptions?: {[key: string]: string | number | boolean | Function},
16
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
17
17
  id?: string,
18
18
  steps?: number,
19
19
  title?: string,
20
20
  value?: string,
21
21
  }
22
22
 
23
+ const ProgressPill = ({ active, dark, steps: step }: ProgressPillsProps) => (
24
+ <div
25
+ className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? ' dark' : ''
26
+ }`}
27
+ key={step}
28
+ />
29
+ )
30
+
23
31
  const showSteps = (steps: number, active: number, dark: boolean) => {
24
32
  const items = []
25
33
 
@@ -30,14 +38,6 @@ const showSteps = (steps: number, active: number, dark: boolean) => {
30
38
  return items
31
39
  }
32
40
 
33
- const ProgressPill = ({ active, dark, steps: step }: ProgressPillsProps) => (
34
- <div
35
- className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? ' dark' : ''
36
- }`}
37
- key={step}
38
- />
39
- )
40
-
41
41
  const ProgressPills = (props: ProgressPillsProps) => {
42
42
  const {
43
43
  active = 0,
@@ -59,24 +59,24 @@ const ProgressPills = (props: ProgressPillsProps) => {
59
59
 
60
60
  return (
61
61
  <div
62
- {...ariaProps}
63
- {...dataProps}
64
- {...htmlProps}
65
- className={classes}
66
- id={id}
62
+ {...ariaProps}
63
+ {...dataProps}
64
+ {...htmlProps}
65
+ className={classes}
66
+ id={id}
67
67
  >
68
68
  {title &&
69
69
  <div className="progress_pills_status">
70
70
  <Title
71
- dark={dark}
72
- size={4}
73
- tag="h4"
74
- text={title}
71
+ dark={dark}
72
+ size={4}
73
+ tag="h4"
74
+ text={title}
75
75
  />
76
76
  <Body
77
- color="light"
78
- dark={dark}
79
- text={value}
77
+ color="light"
78
+ dark={dark}
79
+ text={value}
80
80
  />
81
81
  </div>}
82
82
  <div className="progress_pills">{showSteps(steps, active, dark)}</div>
@@ -8,7 +8,7 @@ type ProgressSimpleProps = {
8
8
  className?: string | string[],
9
9
  dark?: boolean,
10
10
  data?: string,
11
- htmlOptions?: {[key: string]: string | number | boolean | Function},
11
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
12
12
  id?: string,
13
13
  max?: number,
14
14
  muted: boolean,
@@ -18,7 +18,7 @@ type ProgressSimpleProps = {
18
18
  width: string,
19
19
  }
20
20
 
21
- const ProgressSimple = (props: ProgressSimpleProps) => {
21
+ const ProgressSimple = (props: ProgressSimpleProps): React.ReactElement => {
22
22
  const {
23
23
  align,
24
24
  className,
@@ -57,9 +57,9 @@ const ProgressSimple = (props: ProgressSimpleProps) => {
57
57
 
58
58
  return (
59
59
  <div
60
- {...dataProps}
61
- {...htmlProps}
62
- className={wrapperClass}
60
+ {...dataProps}
61
+ {...htmlProps}
62
+ className={wrapperClass}
63
63
  >
64
64
  <div
65
65
  className={kitClass}
@@ -7,7 +7,7 @@ type ProgressStepProps = {
7
7
  aria?: { [key: string]: string },
8
8
  className?: string,
9
9
  data?: { [key: string]: string },
10
- htmlOptions?: {[key: string]: string | number | boolean | Function},
10
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
11
11
  id?: string,
12
12
  children?: React.ReactChild[] | React.ReactChild,
13
13
  orientation?: "horizontal" | "vertical",
@@ -10,7 +10,7 @@ type ProgressStepItemProps = {
10
10
  data?: { [key: string]: string },
11
11
  status?: "complete" | "active" | "inactive" | "hidden",
12
12
  children?: React.ReactNode | React.ReactNode[],
13
- htmlOptions?: {[key: string]: string | number | boolean | Function},
13
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
14
14
  icon?: string,
15
15
  }
16
16
 
@@ -15,7 +15,7 @@ type RadioProps = {
15
15
  dark?: boolean,
16
16
  data?: {[key: string]: string},
17
17
  error?: boolean,
18
- htmlOptions?: {[key: string]: string | number | boolean | Function},
18
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
19
19
  id?: string,
20
20
  label: string,
21
21
  name?: string,
@@ -7,7 +7,7 @@ import Tooltip from "../../pb_tooltip/_tooltip";
7
7
 
8
8
  type EditorButtonProps = {
9
9
  classname?: string,
10
- onclick?: () => {} | void,
10
+ onclick?: () => undefined | void,
11
11
  icon?: string;
12
12
  text?: string;
13
13
  disable?: boolean
@@ -19,29 +19,31 @@ const EditorButton = ({
19
19
  onclick,
20
20
  icon,
21
21
  text,
22
- }: EditorButtonProps) => {
22
+ }: EditorButtonProps): React.ReactElement => {
23
23
  return (
24
- <Tooltip
25
- delay={{
24
+ <Tooltip
25
+ delay={{
26
26
  open: 2000
27
27
  }}
28
- interaction
29
- placement="top"
30
- text={text}
28
+ interaction
29
+ placement="top"
30
+ text={text}
31
31
  >
32
32
  <button
33
- className={classname}
34
- disabled={disable}
35
- onClick={onclick}
36
- role="button"
37
- type="button"
33
+ className={classname}
34
+ disabled={disable}
35
+ onClick={onclick}
36
+ role="button"
37
+ type="button"
38
38
  >
39
- <Flex
40
- align="center"
41
- className="toolbar_button_icon"
42
- justify="center"
39
+ <Flex
40
+ align="center"
41
+ className="toolbar_button_icon"
42
+ justify="center"
43
43
  >
44
- <Icon icon={icon} size="lg" />
44
+ <Icon icon={icon}
45
+ size="lg"
46
+ />
45
47
  </Flex>
46
48
  </button>
47
49
  </Tooltip>
@@ -3,7 +3,7 @@ export type ToolbarTypes = {
3
3
  icon?: string,
4
4
  isActive?: string | null,
5
5
  text?: string,
6
- onclick?: () => {}
6
+ onclick?: () => undefined
7
7
  classname?: string
8
8
  disable?: boolean
9
9
  }
@@ -20,17 +20,19 @@ const MoreExtensionsDropdown = ({extensions}: any) => {
20
20
 
21
21
  const popoverReference = (
22
22
  <button
23
- className="toolbar_button"
24
- onClick={handleTogglePopover}
25
- role="button"
26
- type="button"
23
+ className="toolbar_button"
24
+ onClick={handleTogglePopover}
25
+ role="button"
26
+ type="button"
27
27
  >
28
28
  <Flex
29
- align="center"
30
- className="toolbar_button_icon"
31
- justify="center"
29
+ align="center"
30
+ className="toolbar_button_icon"
31
+ justify="center"
32
32
  >
33
- <Icon icon="ellipsis" size="lg" />
33
+ <Icon icon="ellipsis"
34
+ size="lg"
35
+ />
34
36
  </Flex>
35
37
  </button>
36
38
 
@@ -46,21 +48,21 @@ const popoverReference = (
46
48
  show={showPopover}
47
49
  >
48
50
  <Nav
49
- paddingTop={extensions.length > 1 ? "xs" : "none"}
50
- paddingBottom={extensions.length > 1 ? "xs" : "none"}
51
- variant="subtle"
51
+ paddingBottom={extensions.length > 1 ? "xs" : "none"}
52
+ paddingTop={extensions.length > 1 ? "xs" : "none"}
53
+ variant="subtle"
52
54
  >
53
- {extensions && extensions.map(({ icon, text, onclick, isActive}:any, index:number) => (
55
+ {extensions && extensions.map(({ icon, text, onclick, isActive}: any, index: number) => (
54
56
  <NavItem
55
- cursor="pointer"
56
- className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
57
- iconLeft={icon}
58
- key={`${text}_${index}`}
59
- margin='none'
60
- onClick={()=> {onclick(); setShowPopover(false)}}
61
- text={text}
62
- paddingTop='xxs'
63
- paddingBottom='xxs'
57
+ className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
58
+ cursor="pointer"
59
+ iconLeft={icon}
60
+ key={`${text}_${index}`}
61
+ margin='none'
62
+ onClick={()=> {onclick(); setShowPopover(false)}}
63
+ paddingBottom='xxs'
64
+ paddingTop='xxs'
65
+ text={text}
64
66
  />
65
67
  ))}
66
68
  </Nav>