playbook_ui 13.12.0 → 13.13.0.pre.alpha.PLAY1097linterenhancedelement1728

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) 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_contact/docs/_contact_default_swift.md +14 -0
  20. data/app/pb_kits/playbook/pb_contact/docs/_contact_props_swift.md +6 -0
  21. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail_swift.md +14 -0
  22. data/app/pb_kits/playbook/pb_contact/docs/example.yml +6 -0
  23. data/app/pb_kits/playbook/pb_currency/_currency.tsx +5 -1
  24. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +5 -1
  25. data/app/pb_kits/playbook/pb_date/_date.tsx +12 -7
  26. data/app/pb_kits/playbook/pb_date/docs/_date_alignment_swift.md +11 -0
  27. data/app/pb_kits/playbook/pb_date/docs/_date_default_swift.md +16 -0
  28. data/app/pb_kits/playbook/pb_date/docs/_date_props_swift.md +8 -0
  29. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled_swift.md +11 -0
  30. data/app/pb_kits/playbook/pb_date/docs/_date_variants_swift.md +14 -0
  31. data/app/pb_kits/playbook/pb_date/docs/example.yml +7 -0
  32. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -1
  33. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +5 -1
  34. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +15 -4
  35. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +12 -5
  36. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +5 -1
  37. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +5 -1
  38. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +15 -4
  39. data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -1
  40. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +11 -3
  41. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +8 -3
  42. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +5 -1
  43. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +8 -1
  44. data/app/pb_kits/playbook/pb_enhanced_element/element_observer.ts +1 -1
  45. data/app/pb_kits/playbook/pb_enhanced_element/index.ts +1 -1
  46. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +6 -2
  47. data/app/pb_kits/playbook/pb_filter/docs/_filter_default.md +1 -0
  48. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +6 -1
  49. data/app/pb_kits/playbook/pb_flex/_flex.tsx +6 -1
  50. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +6 -1
  51. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +5 -1
  52. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -1
  53. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +6 -2
  54. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +5 -1
  55. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +5 -0
  56. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -3
  57. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default_swift.md +18 -0
  58. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis_swift.md +34 -0
  59. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link_swift.md +18 -0
  60. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified_swift.md +13 -0
  61. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_props_swift.md +14 -0
  62. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +6 -0
  63. data/app/pb_kits/playbook/pb_icon/_icon.tsx +7 -1
  64. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +5 -1
  65. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -1
  66. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +5 -1
  67. data/app/pb_kits/playbook/pb_image/_image.tsx +6 -1
  68. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +5 -1
  69. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +6 -2
  70. data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -1
  71. data/app/pb_kits/playbook/pb_legend/_legend.tsx +5 -1
  72. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +6 -1
  73. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -1
  74. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +9 -3
  75. data/app/pb_kits/playbook/pb_list/_list.tsx +7 -2
  76. data/app/pb_kits/playbook/pb_list/_list_item.tsx +5 -1
  77. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +5 -1
  78. data/app/pb_kits/playbook/pb_map/_map.tsx +6 -1
  79. data/app/pb_kits/playbook/pb_message/_message.tsx +5 -1
  80. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +5 -1
  81. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
  82. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +5 -1
  83. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
  84. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
  85. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
  86. data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
  87. data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
  88. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +5 -1
  89. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
  90. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
  91. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
  92. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
  93. data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
  94. data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -2
  95. data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -1
  96. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +5 -1
  97. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +6 -2
  98. data/app/pb_kits/playbook/pb_person/_person.tsx +5 -0
  99. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +5 -1
  100. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +8 -2
  101. data/app/pb_kits/playbook/pb_pill/_pill.tsx +5 -1
  102. data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -1
  103. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -1
  104. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +9 -3
  105. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +5 -1
  106. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +6 -2
  107. data/app/pb_kits/playbook/pb_radio/_radio.tsx +5 -1
  108. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +7 -1
  109. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +5 -1
  110. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children_swift.md +14 -0
  111. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed_swift.md +7 -0
  112. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line_swift.md +8 -0
  113. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_props_swift.md +8 -0
  114. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_swift.md +7 -0
  115. data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical_swift.md +18 -0
  116. data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +8 -0
  117. data/app/pb_kits/playbook/pb_select/_select.tsx +6 -1
  118. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +6 -2
  119. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +5 -0
  120. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +5 -0
  121. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +11 -3
  122. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +5 -1
  123. data/app/pb_kits/playbook/pb_source/_source.tsx +5 -1
  124. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +5 -1
  125. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +14 -2
  126. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +6 -0
  127. data/app/pb_kits/playbook/pb_table/_table.tsx +5 -1
  128. data/app/pb_kits/playbook/pb_table/_table_row.tsx +5 -1
  129. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
  130. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
  131. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
  132. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
  133. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
  134. data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
  135. data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
  136. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +5 -2
  137. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md +27 -0
  138. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error_swift.md +11 -0
  139. data/app/pb_kits/playbook/pb_textarea/docs/_textarea_props_swift.md +9 -0
  140. data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -0
  141. data/app/pb_kits/playbook/pb_time/_time.tsx +9 -2
  142. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +5 -1
  143. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -2
  144. data/app/pb_kits/playbook/pb_timeline/_item.tsx +9 -2
  145. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -1
  146. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +5 -1
  147. data/app/pb_kits/playbook/pb_title/_title.tsx +5 -1
  148. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +5 -1
  149. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +16 -3
  150. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +5 -0
  151. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
  152. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
  153. data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
  154. data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
  155. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +5 -1
  156. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -3
  157. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -2
  158. data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -2
  159. data/app/pb_kits/playbook/pb_user/_user.tsx +5 -1
  160. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +5 -1
  161. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +5 -1
  162. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +5 -1
  163. data/app/pb_kits/playbook/utilities/props.ts +16 -0
  164. data/dist/menu.yml +240 -168
  165. data/dist/playbook-rails.js +5 -5
  166. data/lib/playbook/version.rb +2 -2
  167. metadata +46 -7
@@ -3,7 +3,7 @@ import classnames from 'classnames'
3
3
  import useCollapsible from './useCollapsible'
4
4
 
5
5
  import { globalProps } from '../utilities/globalProps'
6
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
6
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
7
7
 
8
8
  import CollapsibleContent from './child_kits/CollapsibleContent'
9
9
  import CollapsibleMain from './child_kits/CollapsibleMain'
@@ -22,6 +22,7 @@ type CollapsibleProps = {
22
22
  iconSize?: IconSizes,
23
23
  onIconClick?: ()=> void,
24
24
  onClick?: ()=> void,
25
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
25
26
  id?: string,
26
27
  }
27
28
 
@@ -33,6 +34,7 @@ const Collapsible = ({
33
34
  children = [],
34
35
  collapsed = true,
35
36
  data = {},
37
+ htmlOptions = {},
36
38
  icon,
37
39
  iconColor = 'default',
38
40
  iconSize,
@@ -60,6 +62,7 @@ const Collapsible = ({
60
62
  const { children: contentChildren, ...contentProps } = Content.props
61
63
  const ariaProps = buildAriaProps(aria)
62
64
  const dataProps = buildDataProps(data)
65
+ const htmlProps = buildHtmlProps(htmlOptions)
63
66
  const classes = classnames(
64
67
  buildCss('pb_collapsible_kit'),
65
68
  globalProps(props),
@@ -70,6 +73,7 @@ const Collapsible = ({
70
73
  <div
71
74
  {...ariaProps}
72
75
  {...dataProps}
76
+ {...htmlProps}
73
77
  className={classes}
74
78
  id={id}
75
79
  >
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
@@ -51,6 +51,7 @@ type ContactProps = {
51
51
  contactType?: string,
52
52
  contactValue: string,
53
53
  data?: object,
54
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
54
55
  id?: string,
55
56
  }
56
57
 
@@ -62,9 +63,11 @@ const Contact = (props: ContactProps) => {
62
63
  contactType,
63
64
  contactValue,
64
65
  data = {},
66
+ htmlOptions = {},
65
67
  id } = props
66
68
  const ariaProps = buildAriaProps(aria)
67
69
  const dataProps = buildDataProps(data)
70
+ const htmlProps = buildHtmlProps(htmlOptions)
68
71
  const classes = classnames(
69
72
  buildCss('pb_contact_kit'),
70
73
  globalProps(props),
@@ -74,6 +77,7 @@ const Contact = (props: ContactProps) => {
74
77
  <div
75
78
  {...ariaProps}
76
79
  {...dataProps}
80
+ {...htmlProps}
77
81
  className={classes}
78
82
  id={id}
79
83
  >
@@ -0,0 +1,14 @@
1
+ ![contact-default](https://github.com/powerhome/playbook/assets/92755007/4226a1e0-5f31-4445-a536-57e95b83768a)
2
+
3
+ ```swift
4
+
5
+ VStack(alignment: .leading, spacing: Spacing.small) {
6
+ PBContact(type: .cell, value: "3491859988")
7
+ PBContact(value: "5555555555")
8
+ PBContact(type: .email, value: "email@example.com")
9
+ PBContact(type: .work, value: "3245627482")
10
+ PBContact(type: .workCell, value: "3245627482")
11
+ }
12
+
13
+
14
+ ```
@@ -0,0 +1,6 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **detail** | `Bool` | Displays text describing the Contact's type | `false` | `true` `false` |
5
+ | **contactValue** | `String` | Sets the Contact's text value | | |
6
+ | **type** | `ContactType` | Sets the icon | `.home` | `cell` `email` `home` `work` `workCell` `wrongPhone` `ext` `custom` |
@@ -0,0 +1,14 @@
1
+ ![contact-detail-indicator](https://github.com/powerhome/playbook/assets/92755007/2a29d4b5-6e7b-43ff-8e7c-0dbeec11627e)
2
+
3
+ ```swift
4
+
5
+ VStack(alignment: .leading, spacing: Spacing.small) {
6
+ PBContact(type: .cell, value: "3491859988", detail: true)
7
+ PBContact(value: "5555555555", detail: true)
8
+ PBContact(type: .email, value: "email@example.com", detail: true)
9
+ PBContact(type: .work, value: "3245627482", detail: true)
10
+ PBContact(type: .ext, value: "1234", detail: true)
11
+ }
12
+
13
+
14
+ ```
@@ -8,3 +8,9 @@ examples:
8
8
  react:
9
9
  - contact_default: Default
10
10
  - contact_with_detail: Detail Indicator
11
+
12
+
13
+ swift:
14
+ - contact_default_swift: Default
15
+ - contact_with_detail_swift: Detail Indicator
16
+ - contact_props_swift: ""
@@ -2,7 +2,7 @@ import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
4
  import { globalProps } from '../utilities/globalProps'
5
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
6
6
 
7
7
  import Body from '../pb_body/_body'
8
8
  import Caption from '../pb_caption/_caption'
@@ -18,6 +18,7 @@ type CurrencyProps = {
18
18
  data?: {[key:string]:string},
19
19
  decimals?: 'default' | 'matching',
20
20
  emphasized?: boolean,
21
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
21
22
  id?: string,
22
23
  label?: string,
23
24
  size?: 'sm' | 'md' | 'lg',
@@ -42,6 +43,7 @@ const Currency = (props: CurrencyProps) => {
42
43
  data = {},
43
44
  decimals = 'default',
44
45
  emphasized = true,
46
+ htmlOptions = {},
45
47
  id,
46
48
  unit,
47
49
  className,
@@ -65,6 +67,7 @@ const Currency = (props: CurrencyProps) => {
65
67
  const [whole, decimal = '00'] = amount.split('.')
66
68
  const ariaProps = buildAriaProps(aria)
67
69
  const dataProps = buildDataProps(data)
70
+ const htmlProps = buildHtmlProps(htmlOptions)
68
71
  const classes = classnames(
69
72
  buildCss('pb_currency_kit', align, size),
70
73
  globalProps(props),
@@ -96,6 +99,7 @@ const Currency = (props: CurrencyProps) => {
96
99
  <div
97
100
  {...ariaProps}
98
101
  {...dataProps}
102
+ {...htmlProps}
99
103
  className={classes}
100
104
  id={id}
101
105
  >
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
3
+ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
4
4
  import { globalProps } from '../utilities/globalProps'
5
5
 
6
6
  import Body from '../pb_body/_body'
@@ -12,6 +12,7 @@ type DashboardValueProps = {
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
16
  id?: string,
16
17
  statChange?: {
17
18
  change? : 'increase' | 'decrease' | 'neutral',
@@ -30,6 +31,7 @@ const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
30
31
  aria = {},
31
32
  className,
32
33
  data = {},
34
+ htmlOptions = {},
33
35
  id,
34
36
  statChange = {},
35
37
  statLabel,
@@ -38,6 +40,7 @@ const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
38
40
 
39
41
  const ariaProps = buildAriaProps(aria)
40
42
  const dataProps = buildDataProps(data)
43
+ const htmlProps = buildHtmlProps(htmlOptions)
41
44
  const classes = classnames(
42
45
  buildCss('pb_dashboard_value_kit', align),
43
46
  globalProps(props),
@@ -48,6 +51,7 @@ const DashboardValue = (props: DashboardValueProps): React.ReactElement => {
48
51
  <div
49
52
  {...ariaProps}
50
53
  {...dataProps}
54
+ {...htmlProps}
51
55
  className={classes}
52
56
  id={id}
53
57
  >
@@ -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
  import DateTime from '../pb_kit/dateTime';
7
7
 
@@ -15,6 +15,7 @@ type PbDateProps = {
15
15
  aria?: { [key: string]: string };
16
16
  className?: string;
17
17
  data?: { [key: string]: string };
18
+ htmlOptions?: { [key: string]: string | number | boolean | Function };
18
19
  id?: string;
19
20
  showDayOfWeek?: boolean;
20
21
  showIcon?: boolean;
@@ -29,6 +30,7 @@ const PbDate = (props: PbDateProps) => {
29
30
  alignment = "left",
30
31
  className,
31
32
  data = {},
33
+ htmlOptions = {},
32
34
  id,
33
35
  showDayOfWeek = false,
34
36
  showIcon = false,
@@ -43,8 +45,9 @@ const PbDate = (props: PbDateProps) => {
43
45
  const year = DateTime.toYear(value);
44
46
  const currentYear = new Date().getFullYear();
45
47
 
46
- const ariaProps = buildAriaProps(aria);
47
- const dataProps = buildDataProps(data);
48
+ const ariaProps = buildAriaProps(aria)
49
+ const dataProps = buildDataProps(data)
50
+ const htmlProps = buildHtmlProps(htmlOptions)
48
51
 
49
52
  const classes = classnames(
50
53
  buildCss("pb_date_kit", alignment),
@@ -53,10 +56,12 @@ const PbDate = (props: PbDateProps) => {
53
56
  );
54
57
 
55
58
  return (
56
- <div {...ariaProps}
57
- {...dataProps}
58
- className={classes}
59
- id={id}
59
+ <div
60
+ {...ariaProps}
61
+ {...dataProps}
62
+ {...htmlProps}
63
+ className={classes}
64
+ id={id}
60
65
  >
61
66
  {unstyled
62
67
  ? <>
@@ -0,0 +1,11 @@
1
+ ![date-alignment](https://github.com/powerhome/playbook/assets/92755007/094761cb-5151-4de5-a8e1-f905455c2aca)
2
+
3
+ ```swift
4
+
5
+ VStack(spacing: Spacing.small) {
6
+ PBDate(Date(), variant: .standard, typography: .title4, alignment: .leading)
7
+ PBDate(Date(), variant: .withIcon(isStandard: true), typography: .title4, iconSize: .x1, alignment: .center)
8
+ PBDate(Date(), variant: .short, typography: .title4, alignment: .trailing)
9
+ }
10
+
11
+ ```
@@ -0,0 +1,16 @@
1
+ ![date-default](https://github.com/powerhome/playbook/assets/92755007/0d9f151d-2a18-445c-add3-8194c343bfea)
2
+
3
+
4
+ ```swift
5
+
6
+ VStack(alignment: .leading, spacing: Spacing.small) {
7
+ PBDate(Date(), variant: .short)
8
+ PBDate(Date(), variant: .dayDate)
9
+ PBDate(Date(), variant: .standard)
10
+ Spacer()
11
+ PBDate(Date(), variant: .short, typography: .title4)
12
+ PBDate(Date(), variant: .dayDate, typography: .title4)
13
+ PBDate(Date(), variant: .standard, typography: .title4)
14
+ }
15
+
16
+ ```
@@ -0,0 +1,8 @@
1
+ ### Props
2
+ | Name | Type | Description | Default | Values |
3
+ | --- | ----------- | --------- | --------- | --------- |
4
+ | **datestamp** | `Date` | Sets the date | | |
5
+ | **variant** | `Variant` | Changes the style | `.short` | `.short` `.dayDate` `.standard` `.withIcon(isStandard: true)` `withIcon(isStandard: false)` |
6
+ | **typography** | `PBFont` | Sets the font | `.caption` | `.title1` `.title2` `.title3` `.title4` `.body` `.buttonText` `.largeCaption` `.caption` `.subcaption` `.monogram` `.badgeText` `.detail` |
7
+ | **iconSize** | `PBIcon.IconSize` | Chances the icon's size | `.x1` | `xSmall` `small` `large` `x1` `x2` `x3` `x4` `x5` `x6` `x7` `x8` `x9` `x10` |
8
+ | **alignment** | `Alignment` | Changes the alignment | `.leading` | `.leading` `.trailing` |
@@ -0,0 +1,11 @@
1
+ ![date-unstyled](https://github.com/powerhome/playbook/assets/92755007/dc0ab7cf-0d97-407c-9aac-f53645eb6ee2)
2
+
3
+ ```swift
4
+
5
+ VStack(alignment: .leading, spacing: Spacing.small) {
6
+ PBDate(Date(), variant: .short, typography: .body)
7
+ PBDate(Date(), variant: .standard, typography: .title1)
8
+ PBDate(Date(), variant: .withIcon(isStandard: false), typography: .subcaption, iconSize: .xSmall)
9
+ }
10
+
11
+ ```
@@ -0,0 +1,14 @@
1
+ ![date-varients](https://github.com/powerhome/playbook/assets/92755007/bb240082-afb9-4802-af5f-7aaccec37aae)
2
+
3
+
4
+ ```swift
5
+
6
+ VStack(alignment: .leading, spacing: Spacing.small) {
7
+ PBDate(Date(), variant: .withIcon(isStandard: true), typography: .caption, iconSize: .xSmall)
8
+ PBDate(Date(), variant: .standard, typography: .title4)
9
+ PBDate(Date(), variant: .withIcon(isStandard: true), typography: .title4, iconSize: .x1)
10
+ PBDate(Date(), variant: .dayDate, typography: .title4)
11
+ PBDate(Date(), variant: .withIcon(isStandard: false), typography: .title4, iconSize: .x1)
12
+ }
13
+
14
+ ```
@@ -12,3 +12,10 @@ examples:
12
12
  - date_variants: Variants
13
13
  - date_alignment: Alignment
14
14
  - date_unstyled: Unstyled
15
+
16
+ swift:
17
+ - date_default_swift: Default
18
+ - date_variants_swift: Variants
19
+ - date_alignment_swift: Alignment
20
+ - date_unstyled_swift: Unstyled
21
+ - date_props_swift: ""
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect } 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 { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
6
6
 
7
7
  import datePickerHelper from './date_picker_helper'
@@ -25,6 +25,7 @@ type DatePickerProps = {
25
25
  format?: string,
26
26
  hideIcon?: boolean,
27
27
  hideLabel?: boolean,
28
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
28
29
  id?: string,
29
30
  inLine?: boolean,
30
31
  inputAria?: { [key: string]: string },
@@ -67,6 +68,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
67
68
  format = 'm/d/Y',
68
69
  hideIcon = false,
69
70
  hideLabel = false,
71
+ htmlOptions = {},
70
72
  id,
71
73
  inLine = false,
72
74
  inputAria = {},
@@ -95,6 +97,7 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
95
97
 
96
98
  const ariaProps = buildAriaProps(aria)
97
99
  const dataProps = buildDataProps(data)
100
+ const htmlProps = buildHtmlProps(htmlOptions)
98
101
  const inputAriaProps = buildAriaProps(inputAria)
99
102
  const inputDataProps = buildDataProps(inputData)
100
103
 
@@ -158,6 +161,7 @@ useEffect(() => {
158
161
  <div
159
162
  {...ariaProps}
160
163
  {...dataProps}
164
+ {...htmlProps}
161
165
  className={classes}
162
166
  id={id}
163
167
  >
@@ -2,7 +2,7 @@ import React from "react";
2
2
  import classnames from "classnames";
3
3
 
4
4
  import { globalProps } from "../utilities/globalProps";
5
- import { buildCss, buildDataProps } from "../utilities/props";
5
+ import { buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
6
6
  import DateTime from '../pb_kit/dateTime';
7
7
 
8
8
  import Body from "../pb_body/_body";
@@ -16,6 +16,7 @@ type DateRangeInlineProps = {
16
16
  align?: "left" | "center" | "vertical";
17
17
  size?: "sm" | "xs";
18
18
  dark?: boolean;
19
+ htmlOptions?: {[key: string]: string | number | boolean | Function};
19
20
  icon?: boolean;
20
21
  startDate?: Date;
21
22
  endDate?: Date;
@@ -40,6 +41,7 @@ const DateRangeInline = (props: DateRangeInlineProps) => {
40
41
  size = "sm",
41
42
  align = "left",
42
43
  data = {},
44
+ htmlOptions = {},
43
45
  startDate,
44
46
  endDate,
45
47
  className,
@@ -79,6 +81,7 @@ const DateRangeInline = (props: DateRangeInlineProps) => {
79
81
 
80
82
  const dateRangeClasses = buildCss("pb_date_range_inline_kit", align);
81
83
  const dataProps = buildDataProps(data)
84
+ const htmlProps = buildHtmlProps(htmlOptions)
82
85
  const renderTime = (date: Date) => {
83
86
  return (
84
87
  <time dateTime={dateTimeIso(date)}>
@@ -94,6 +97,7 @@ const DateRangeInline = (props: DateRangeInlineProps) => {
94
97
  return (
95
98
  <div
96
99
  {...dataProps}
100
+ {...htmlProps}
97
101
  className={classnames(dateRangeClasses, globalProps(props), className)}
98
102
  >
99
103
  <div className="pb_date_range_inline_wrapper">
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Body from '../pb_body/_body'
@@ -15,21 +15,32 @@ type DateRangeStackedProps = {
15
15
  data?: string,
16
16
  dark?: boolean,
17
17
  endDate: Date,
18
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
18
19
  id?: string,
19
20
  startDate: Date,
20
21
  }
21
22
 
22
23
  const DateRangeStacked = (props: DateRangeStackedProps) => {
23
- const { className, dark = false, endDate, startDate, data={} } = props
24
+ const {
25
+ className,
26
+ dark = false,
27
+ endDate,
28
+ htmlOptions={},
29
+ startDate,
30
+ data={},
31
+ } = props
24
32
  const css = classnames(
25
33
  buildCss('pb_date_range_stacked'),
26
34
  globalProps(props),
27
35
  className
28
36
  )
29
- const dataProps = buildDataProps(data)
37
+ const dataProps = buildDataProps(data)
38
+ const htmlProps = buildHtmlProps(htmlOptions)
30
39
 
31
40
  return (
32
- <div {...dataProps}
41
+ <div
42
+ {...dataProps}
43
+ {...htmlProps}
33
44
  className={css}
34
45
  >
35
46
  <Flex vertical="center">
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
 
3
3
  import classnames from "classnames";
4
- import { buildCss, buildDataProps } from "../utilities/props";
4
+ import { buildCss, buildDataProps, buildHtmlProps } from "../utilities/props";
5
5
  import { globalProps } from "../utilities/globalProps";
6
6
  import DateTime from '../pb_kit/dateTime';
7
7
 
@@ -15,6 +15,7 @@ type DateStackedProps = {
15
15
  dark?: boolean;
16
16
  data?: string;
17
17
  date: Date;
18
+ htmlOptions?: { [key: string]: string | number | boolean | Function };
18
19
  size?: "sm" | "md";
19
20
  id?: string;
20
21
  reverse?: boolean;
@@ -34,6 +35,7 @@ const DateStacked = (props: DateStackedProps) => {
34
35
  dark = false,
35
36
  date,
36
37
  data={},
38
+ htmlOptions={},
37
39
  size = "sm",
38
40
  } = props;
39
41
  const classes = classnames(
@@ -48,12 +50,15 @@ const DateStacked = (props: DateStackedProps) => {
48
50
  const currentYear = new Date().getFullYear()
49
51
  const inputYear = DateTime.toYear(date);
50
52
  const dataProps = buildDataProps(data)
53
+ const htmlProps = buildHtmlProps(htmlOptions)
51
54
 
52
55
  return (
53
56
  <>
54
57
  {bold == false ? (
55
- <div {...dataProps}
56
- className={classes}
58
+ <div
59
+ {...dataProps}
60
+ {...htmlProps}
61
+ className={classes}
57
62
  >
58
63
  <div className="pb_date_stacked_day_month">
59
64
  <Caption text={DateTime.toMonth(date).toUpperCase()} />
@@ -66,8 +71,10 @@ const DateStacked = (props: DateStackedProps) => {
66
71
  {currentYear != inputYear && <Caption size="xs">{inputYear}</Caption>}
67
72
  </div>
68
73
  ) : (
69
- <div {...dataProps}
70
- className={classes}
74
+ <div
75
+ {...dataProps}
76
+ {...htmlProps}
77
+ className={classes}
71
78
  >
72
79
  <div className="pb_date_stacked_day_month">
73
80
  <Title
@@ -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 Flex from '../pb_flex/_flex'
@@ -14,6 +14,7 @@ type DateTimeProps = {
14
14
  className?: string,
15
15
  data?: { [key: string]: string; },
16
16
  datetime: Date,
17
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
17
18
  id?: string,
18
19
  size?: "sm" | "md",
19
20
  showDayOfWeek: boolean,
@@ -27,6 +28,7 @@ const DateTime = (props: DateTimeProps) => {
27
28
  aria = {},
28
29
  className,
29
30
  data = {},
31
+ htmlOptions = {},
30
32
  showDayOfWeek = false,
31
33
  datetime,
32
34
  id,
@@ -37,6 +39,7 @@ const DateTime = (props: DateTimeProps) => {
37
39
 
38
40
  const ariaProps = buildAriaProps(aria)
39
41
  const dataProps = buildDataProps(data)
42
+ const htmlProps = buildHtmlProps(htmlOptions)
40
43
  const classes = classnames(
41
44
  buildCss('pb_date_time', size),
42
45
  globalProps(props),
@@ -47,6 +50,7 @@ const DateTime = (props: DateTimeProps) => {
47
50
  <div
48
51
  {...ariaProps}
49
52
  {...dataProps}
53
+ {...htmlProps}
50
54
  className={classes}
51
55
  id={id}
52
56
  >
@@ -1,7 +1,7 @@
1
1
 
2
2
  import React from 'react'
3
3
 
4
- import { buildCss } from '../utilities/props'
4
+ import { buildCss, buildHtmlProps } from '../utilities/props'
5
5
  import { deprecatedProps, globalProps } from '../utilities/globalProps'
6
6
 
7
7
  import Flex from '../pb_flex/_flex'
@@ -11,6 +11,7 @@ import TimeStacked from '../pb_time_stacked/_time_stacked'
11
11
  import DateStacked from '../pb_date_stacked/_date_stacked'
12
12
 
13
13
  type DateTimeStackedProps = {
14
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
14
15
  id?: string,
15
16
  date: Date,
16
17
  datetime: Date,
@@ -25,15 +26,18 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
25
26
  date,
26
27
  datetime,
27
28
  dark,
29
+ htmlOptions = {},
28
30
  timeZone = 'America/New_York',
29
31
  } = props
30
32
 
31
33
  const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
34
+ const htmlProps = buildHtmlProps(htmlOptions)
32
35
 
33
36
  return (
34
37
  <Flex
35
38
  inline={false}
36
39
  vertical="stretch"
40
+ {...htmlProps}
37
41
  {...props}
38
42
  >
39
43
  <FlexItem>
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
2
  import classnames from 'classnames'
3
3
 
4
- import { buildCss, buildDataProps } from '../utilities/props'
4
+ import { buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
5
  import { globalProps } from '../utilities/globalProps'
6
6
  import DateTime from '../pb_kit/dateTime';
7
7
 
@@ -14,20 +14,31 @@ type DateYearStackedProps = {
14
14
  dark?: boolean,
15
15
  data?: string,
16
16
  date: Date,
17
+ htmlOptions?: {[key: string]: string | number | boolean | Function},
17
18
  id?: string,
18
19
  }
19
20
 
20
21
  const DateYearStacked = (props: DateYearStackedProps) => {
21
- const { align = 'left', className, dark = false, date, data={} } = props
22
+ const {
23
+ align = 'left',
24
+ className,
25
+ dark = false,
26
+ date,
27
+ data={},
28
+ htmlOptions = {},
29
+ } = props
22
30
  const css = classnames(
23
31
  buildCss('pb_date_year_stacked', align),
24
32
  globalProps(props),
25
33
  className
26
34
  )
27
- const dataProps = buildDataProps(data)
35
+ const dataProps = buildDataProps(data)
36
+ const htmlProps = buildHtmlProps(htmlOptions)
28
37
 
29
38
  return (
30
- <div {...dataProps}
39
+ <div
40
+ {...dataProps}
41
+ {...htmlProps}
31
42
  className={css}
32
43
  >
33
44
  <Title