playbook_ui 13.13.0.pre.alpha.play10221678 → 13.13.0.pre.alpha.play10821727

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -5
  3. data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +3 -3
  4. data/app/pb_kits/playbook/pb_background/_background.tsx +9 -9
  5. data/app/pb_kits/playbook/pb_badge/_badge.tsx +2 -2
  6. data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +3 -3
  7. data/app/pb_kits/playbook/pb_body/_body.tsx +4 -5
  8. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +3 -4
  9. data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +3 -3
  10. data/app/pb_kits/playbook/pb_button/_button.tsx +40 -37
  11. data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +3 -3
  12. data/app/pb_kits/playbook/pb_caption/_caption.tsx +1 -1
  13. data/app/pb_kits/playbook/pb_card/_card.tsx +2 -2
  14. data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +5 -4
  15. data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +3 -3
  16. data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +9 -9
  17. data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +1 -1
  18. data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -7
  19. data/app/pb_kits/playbook/pb_collapsible/_helper_functions.ts +2 -2
  20. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +5 -4
  21. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +16 -12
  22. data/app/pb_kits/playbook/pb_contact/_contact.tsx +3 -3
  23. data/app/pb_kits/playbook/pb_contact/docs/_contact_default_swift.md +14 -0
  24. data/app/pb_kits/playbook/pb_contact/docs/_contact_props_swift.md +6 -0
  25. data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail_swift.md +14 -0
  26. data/app/pb_kits/playbook/pb_contact/docs/example.yml +6 -0
  27. data/app/pb_kits/playbook/pb_currency/_currency.tsx +2 -2
  28. data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +1 -1
  29. data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +4 -57
  30. data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +4 -57
  31. data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +20 -16
  32. data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +1 -1
  33. data/app/pb_kits/playbook/pb_date/_date.tsx +7 -7
  34. data/app/pb_kits/playbook/pb_date/docs/_date_alignment_swift.md +11 -0
  35. data/app/pb_kits/playbook/pb_date/docs/_date_default_swift.md +16 -0
  36. data/app/pb_kits/playbook/pb_date/docs/_date_props_swift.md +8 -0
  37. data/app/pb_kits/playbook/pb_date/docs/_date_unstyled_swift.md +11 -0
  38. data/app/pb_kits/playbook/pb_date/docs/_date_variants_swift.md +14 -0
  39. data/app/pb_kits/playbook/pb_date/docs/example.yml +7 -0
  40. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -4
  41. data/app/pb_kits/playbook/pb_date_picker/date_picker.rb +0 -3
  42. data/app/pb_kits/playbook/pb_date_picker/date_picker_helper.ts +10 -11
  43. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_react.jsx +2 -2
  44. data/app/pb_kits/playbook/pb_date_picker/docs/example.yml +0 -4
  45. data/app/pb_kits/playbook/pb_date_picker/docs/index.js +0 -2
  46. data/app/pb_kits/playbook/pb_date_picker/plugins/quickPick.tsx +3 -69
  47. data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +2 -2
  48. data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +2 -2
  49. data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +8 -8
  50. data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +2 -2
  51. data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +1 -1
  52. data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +2 -2
  53. data/app/pb_kits/playbook/pb_date_year_stacked/date_year_stacked.test.js +6 -3
  54. data/app/pb_kits/playbook/pb_detail/_detail.tsx +4 -4
  55. data/app/pb_kits/playbook/pb_dialog/_close_icon.tsx +2 -2
  56. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +42 -34
  57. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +1 -1
  58. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -5
  59. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +4 -4
  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_scrollable.jsx +4 -2
  63. data/app/pb_kits/playbook/pb_dialog/docs/_dialog_status.jsx +1 -1
  64. data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +5 -5
  65. data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +1 -1
  66. data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +1 -1
  67. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -1
  68. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +1 -1
  69. data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +1 -1
  70. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -1
  71. data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +1 -1
  72. data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +1 -1
  73. data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +1 -1
  74. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +1 -1
  75. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default_swift.md +18 -0
  76. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis_swift.md +34 -0
  77. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link_swift.md +18 -0
  78. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified_swift.md +13 -0
  79. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_props_swift.md +14 -0
  80. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +6 -0
  81. data/app/pb_kits/playbook/pb_icon/_icon.tsx +1 -1
  82. data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +1 -1
  83. data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +1 -1
  84. data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +1 -1
  85. data/app/pb_kits/playbook/pb_image/_image.tsx +1 -1
  86. data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +1 -1
  87. data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +1 -1
  88. data/app/pb_kits/playbook/pb_layout/_layout.tsx +1 -1
  89. data/app/pb_kits/playbook/pb_legend/_legend.tsx +1 -1
  90. data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +1 -1
  91. data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +1 -1
  92. data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +1 -1
  93. data/app/pb_kits/playbook/pb_list/_list.tsx +1 -1
  94. data/app/pb_kits/playbook/pb_list/_list_item.tsx +1 -1
  95. data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +1 -1
  96. data/app/pb_kits/playbook/pb_map/_map.tsx +1 -1
  97. data/app/pb_kits/playbook/pb_message/_message.tsx +1 -1
  98. data/app/pb_kits/playbook/pb_message/_message_mention.tsx +1 -1
  99. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +1 -1
  100. data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +1 -1
  101. data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +1 -1
  102. data/app/pb_kits/playbook/pb_nav/_item.tsx +1 -1
  103. data/app/pb_kits/playbook/pb_nav/_nav.tsx +1 -1
  104. data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +1 -1
  105. data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -1
  106. data/app/pb_kits/playbook/pb_person/_person.tsx +1 -1
  107. data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +1 -1
  108. data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +1 -1
  109. data/app/pb_kits/playbook/pb_pill/_pill.tsx +1 -1
  110. data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
  111. data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +1 -1
  112. data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +1 -1
  113. data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +1 -1
  114. data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -1
  115. data/app/pb_kits/playbook/pb_radio/_radio.tsx +1 -1
  116. data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +1 -1
  117. data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +1 -1
  118. data/app/pb_kits/playbook/pb_select/_select.tsx +1 -1
  119. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +1 -1
  120. data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +1 -1
  121. data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +1 -1
  122. data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +1 -1
  123. data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +1 -1
  124. data/app/pb_kits/playbook/pb_source/_source.tsx +1 -1
  125. data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +1 -1
  126. data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +1 -1
  127. data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +1 -1
  128. data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
  129. data/app/pb_kits/playbook/pb_table/_table_row.tsx +1 -1
  130. data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +1 -1
  131. data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +1 -1
  132. data/app/pb_kits/playbook/pb_time/_time.tsx +1 -1
  133. data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +1 -1
  134. data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +1 -1
  135. data/app/pb_kits/playbook/pb_timeline/_item.tsx +1 -1
  136. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +1 -1
  137. data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +1 -1
  138. data/app/pb_kits/playbook/pb_title/_title.tsx +1 -1
  139. data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +1 -1
  140. data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +1 -1
  141. data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +1 -1
  142. data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +1 -1
  143. data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +1 -1
  144. data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +1 -1
  145. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  146. data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +1 -1
  147. data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +1 -1
  148. data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +1 -1
  149. data/app/pb_kits/playbook/tokens/exports/exports.d.ts +1 -0
  150. data/app/pb_kits/playbook/utilities/props.ts +2 -2
  151. data/dist/menu.yml +240 -168
  152. data/dist/playbook-rails.js +4 -4
  153. data/lib/playbook/version.rb +1 -1
  154. metadata +16 -8
  155. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.html.erb +0 -29
  156. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.jsx +0 -34
  157. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom.md +0 -7
  158. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.html.erb +0 -28
  159. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.jsx +0 -34
  160. data/app/pb_kits/playbook/pb_date_picker/docs/_date_picker_quick_pick_custom_override.md +0 -1
@@ -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: ""
@@ -18,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
22
22
  id?: string,
23
23
  label?: string,
24
24
  size?: 'sm' | 'md' | 'lg',
@@ -34,7 +34,7 @@ const sizes: {lg: 1, md: 3, sm: 4} = {
34
34
  sm: 4,
35
35
  }
36
36
 
37
- const Currency = (props: CurrencyProps) => {
37
+ const Currency = (props: CurrencyProps): React.ReactElement => {
38
38
  const {
39
39
  abbreviate = false,
40
40
  align = 'left',
@@ -2,7 +2,7 @@ import colors from "../tokens/exports/_colors.scss";
2
2
 
3
3
 
4
4
  // Map Data Color String Props to our SCSS Variables
5
- const mapColors = (array: string[]) => {
5
+ const mapColors = (array: string[]): string[] => {
6
6
  const regex = /(data)\-[1-8]/; //eslint-disable-line
7
7
 
8
8
  const newArray = array.map((item) => {
@@ -3,9 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- import Highcharts from 'highcharts'
7
-
8
- const pbButtonHoverColor = '#004ebb'
9
6
  const highchartsDarkTheme: ThemeProps = {
10
7
  lang: {
11
8
  thousandsSep: ',',
@@ -22,7 +19,7 @@ const highchartsDarkTheme: ThemeProps = {
22
19
  chart: {
23
20
  borderWidth: 0,
24
21
  borderRadius: 0,
25
- plotBackgroundColor: null,
22
+ plotBackgroundColor: undefined,
26
23
  plotShadow: false,
27
24
  plotBorderWidth: 0,
28
25
  },
@@ -64,7 +61,7 @@ const highchartsDarkTheme: ThemeProps = {
64
61
  },
65
62
  },
66
63
  yAxis: {
67
- alternateGridColor: null,
64
+ alternateGridColor: undefined,
68
65
  minorTickInterval: null,
69
66
  gridLineColor: colors.border_dark,
70
67
  minorGridLineColor: colors.border_dark,
@@ -104,11 +101,6 @@ const highchartsDarkTheme: ThemeProps = {
104
101
  color: colors.text_dk_lighter,
105
102
  },
106
103
  },
107
- labels: {
108
- style: {
109
- color: colors.primary,
110
- },
111
- },
112
104
  tooltip: {
113
105
  backgroundColor: {
114
106
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
@@ -130,29 +122,15 @@ const highchartsDarkTheme: ThemeProps = {
130
122
  // specific to gauge
131
123
  // unfilled gauge color
132
124
  pane: {
133
- background: {
125
+ background: [{
134
126
  borderColor: colors.border_dark,
135
- },
127
+ }],
136
128
  },
137
129
 
138
130
  plotOptions: {
139
131
  series: {
140
132
  borderColor: colors.bg_dark_card,
141
133
  borderWidth: 2,
142
- type: 'area',
143
- nullColor: colors.text_dk_lighter,
144
- fillColor: {
145
- linearGradient: {
146
- x1: 0,
147
- y1: 0,
148
- x2: 0,
149
- y2: 1,
150
- },
151
- stops: [
152
- [0, Highcharts.getOptions().colors[0]],
153
- [1, 'white'],
154
- ],
155
- },
156
134
  threshold: null,
157
135
  },
158
136
  // PIE STYLES
@@ -184,15 +162,6 @@ const highchartsDarkTheme: ThemeProps = {
184
162
  marker: {
185
163
  lineColor: colors.border_dark,
186
164
  },
187
- area: {
188
- shadow: false,
189
- states: {
190
- hover: {
191
- lineWidth: 1,
192
- },
193
- },
194
- threshold: null,
195
- },
196
165
  },
197
166
 
198
167
  //TREEMAP CHART STYLES
@@ -210,7 +179,6 @@ const highchartsDarkTheme: ThemeProps = {
210
179
  colors.data_7,
211
180
  colors.data_8,
212
181
  ],
213
- colorByPoint: true,
214
182
  dataLabels: {
215
183
  enabled: true,
216
184
  style: {
@@ -229,27 +197,6 @@ const highchartsDarkTheme: ThemeProps = {
229
197
  ],
230
198
  traverseUpButton: {
231
199
  position: { y: -50 },
232
- text: '< Back',
233
- theme: {
234
- r: 4,
235
- states: {
236
- hover: {
237
- style: {
238
- fill: pbButtonHoverColor,
239
- },
240
- },
241
- },
242
- style: {
243
- fill: colors.royal,
244
- color: colors.white,
245
- fontSize: `${typography.text_small}`,
246
- fontWeight: typography.bold,
247
- fontFamily: `${typography.font_family_base}`,
248
- },
249
- stroke: colors.royal,
250
- height: 24,
251
- width: 90,
252
- },
253
200
  },
254
201
  },
255
202
  },
@@ -3,9 +3,6 @@ import typography from '../tokens/exports/_typography.scss'
3
3
 
4
4
  import { ThemeProps } from './themeTypes'
5
5
 
6
- import Highcharts from 'highcharts'
7
-
8
- const pbButtonHoverColor = '#004ebb'
9
6
  const highchartsTheme: ThemeProps = {
10
7
  lang: {
11
8
  thousandsSep: ',',
@@ -22,7 +19,7 @@ const highchartsTheme: ThemeProps = {
22
19
  chart: {
23
20
  borderWidth: 0,
24
21
  borderRadius: 0,
25
- plotBackgroundColor: null,
22
+ plotBackgroundColor: undefined,
26
23
  plotShadow: false,
27
24
  plotBorderWidth: 0,
28
25
  },
@@ -64,7 +61,7 @@ const highchartsTheme: ThemeProps = {
64
61
  },
65
62
  },
66
63
  yAxis: {
67
- alternateGridColor: null,
64
+ alternateGridColor: undefined,
68
65
  minorTickInterval: null,
69
66
  gridLineColor: colors.border_light,
70
67
  minorGridLineColor: colors.border_light,
@@ -104,11 +101,6 @@ const highchartsTheme: ThemeProps = {
104
101
  color: colors.text_lt_lighter,
105
102
  },
106
103
  },
107
- labels: {
108
- style: {
109
- color: colors.primary,
110
- },
111
- },
112
104
  tooltip: {
113
105
  backgroundColor: {
114
106
  linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
@@ -130,27 +122,13 @@ const highchartsTheme: ThemeProps = {
130
122
  // specific to gauge
131
123
  // unfilled gauge color
132
124
  pane: {
133
- background: {
125
+ background: [{
134
126
  borderColor: colors.border_light,
135
- },
127
+ }],
136
128
  },
137
129
 
138
130
  plotOptions: {
139
131
  series: {
140
- type: 'area',
141
- nullColor: colors.text_lt_lighter,
142
- fillColor: {
143
- linearGradient: {
144
- x1: 0,
145
- y1: 0,
146
- x2: 0,
147
- y2: 1,
148
- },
149
- stops: [
150
- [0, Highcharts.getOptions().colors[0]],
151
- [1, 'white'],
152
- ],
153
- },
154
132
  threshold: null,
155
133
  },
156
134
  // PIE STYLES
@@ -182,15 +160,6 @@ const highchartsTheme: ThemeProps = {
182
160
  marker: {
183
161
  lineColor: '#333',
184
162
  },
185
- area: {
186
- shadow: false,
187
- states: {
188
- hover: {
189
- lineWidth: 1,
190
- },
191
- },
192
- threshold: null,
193
- },
194
163
  },
195
164
 
196
165
  //TREEMAP CHART STYLES
@@ -208,7 +177,6 @@ const highchartsTheme: ThemeProps = {
208
177
  colors.data_7,
209
178
  colors.data_8,
210
179
  ],
211
- colorByPoint: true,
212
180
  dataLabels: {
213
181
  enabled: true,
214
182
  style: {
@@ -227,27 +195,6 @@ const highchartsTheme: ThemeProps = {
227
195
  ],
228
196
  traverseUpButton: {
229
197
  position: { y: -50 },
230
- text: '< Back',
231
- theme: {
232
- r: 4,
233
- states: {
234
- hover: {
235
- style: {
236
- fill: pbButtonHoverColor,
237
- },
238
- },
239
- },
240
- style: {
241
- fill: colors.royal,
242
- color: colors.white,
243
- fontSize: `${typography.text_small}`,
244
- fontWeight: typography.bold,
245
- fontFamily: `${typography.font_family_base}`,
246
- },
247
- stroke: colors.royal,
248
- height: 24,
249
- width: 90,
250
- },
251
198
  },
252
199
  },
253
200
  },
@@ -1,16 +1,20 @@
1
- export type ThemeProps = {
2
- lang?: {[key: string]: string}
3
- credits?: {[key: string]: boolean}
4
- colors?: string[]
5
- chart?: {[key: string]: any}
6
- title?: {[key: string]: string | {}}
7
- subtitle?: {[key: string]: string | {};}
8
- xAxis?: {[key: string]: any;}
9
- yAxis?: {[key: string]: any;}
10
- legend?: {[key: string]: string | {};}
11
- labels?: {[key: string]: {};}
12
- tooltip?: {[key: string]: any;}
13
- pane?: {[key: string]: {};}
14
- plotOptions?: {[key: string]: any;}
15
- colorKey?: string
16
- }
1
+ import { Options, LegendOptions } from "highcharts";
2
+ export interface ThemeProps
3
+ extends Pick<
4
+ Options,
5
+ | "credits"
6
+ | "chart"
7
+ | "colors"
8
+ | "lang"
9
+ | "title"
10
+ | "subtitle"
11
+ | "xAxis"
12
+ | "yAxis"
13
+ | "legend"
14
+ | "tooltip"
15
+ | "pane"
16
+ | "plotOptions"
17
+ > {
18
+ colorKey?: string;
19
+ legend?: LegendOptions;
20
+ }
@@ -12,7 +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
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
16
16
  id?: string,
17
17
  statChange?: {
18
18
  change? : 'increase' | 'decrease' | 'neutral',
@@ -15,7 +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
+ htmlOptions?: { [key: string]: string | number | boolean | (() => void) };
19
19
  id?: string;
20
20
  showDayOfWeek?: boolean;
21
21
  showIcon?: boolean;
@@ -24,7 +24,7 @@ type PbDateProps = {
24
24
  value: Date;
25
25
  };
26
26
 
27
- const PbDate = (props: PbDateProps) => {
27
+ const PbDate = (props: PbDateProps): React.ReactElement => {
28
28
  const {
29
29
  aria = {},
30
30
  alignment = "left",
@@ -57,11 +57,11 @@ const PbDate = (props: PbDateProps) => {
57
57
 
58
58
  return (
59
59
  <div
60
- {...ariaProps}
61
- {...dataProps}
62
- {...htmlProps}
63
- className={classes}
64
- id={id}
60
+ {...ariaProps}
61
+ {...dataProps}
62
+ {...htmlProps}
63
+ className={classes}
64
+ id={id}
65
65
  >
66
66
  {unstyled
67
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: ""
@@ -13,7 +13,6 @@ type DatePickerProps = {
13
13
  allowInput?: boolean,
14
14
  aria?: { [key: string]: string },
15
15
  className?: string,
16
- customQuickPickDates: { override: boolean, dates: any[] },
17
16
  dark?: boolean,
18
17
  data?: { [key: string]: string },
19
18
  defaultDate?: string,
@@ -26,7 +25,7 @@ type DatePickerProps = {
26
25
  format?: string,
27
26
  hideIcon?: boolean,
28
27
  hideLabel?: boolean,
29
- htmlOptions?: {[key: string]: string | number | boolean | Function},
28
+ htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
30
29
  id?: string,
31
30
  inLine?: boolean,
32
31
  inputAria?: { [key: string]: string },
@@ -57,7 +56,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
57
56
  allowInput = false,
58
57
  aria = {},
59
58
  className,
60
- customQuickPickDates,
61
59
  dark = false,
62
60
  data = {},
63
61
  defaultDate = '',
@@ -106,7 +104,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
106
104
  useEffect(() => {
107
105
  datePickerHelper({
108
106
  allowInput,
109
- customQuickPickDates,
110
107
  defaultDate,
111
108
  disableDate,
112
109
  disableRange,
@@ -5,8 +5,6 @@ module Playbook
5
5
  class DatePicker < Playbook::KitBase
6
6
  prop :allow_input, type: Playbook::Props::Boolean,
7
7
  default: false
8
- prop :custom_quick_pick_dates, type: Playbook::Props::HashProp,
9
- default: {}
10
8
  prop :dark, type: Playbook::Props::Boolean,
11
9
  default: false
12
10
  prop :default_date, type: Playbook::Props::String,
@@ -81,7 +79,6 @@ module Playbook
81
79
  def date_picker_config
82
80
  {
83
81
  allowInput: allow_input,
84
- customQuickPickDates: custom_quick_pick_dates,
85
82
  defaultDate: default_date,
86
83
  disableDate: disable_date,
87
84
  disableRange: disable_range,
@@ -11,7 +11,6 @@ const getPositionElement = (element: string | Element) => {
11
11
 
12
12
  type DatePickerConfig = {
13
13
  closeOnSelect?: boolean,
14
- customQuickPickDates: { override: boolean, dates: any[] },
15
14
  disableDate?: number[],
16
15
  disableRange?: number[],
17
16
  disableWeekdays?: number[],
@@ -35,7 +34,6 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
35
34
  const {
36
35
  allowInput,
37
36
  closeOnSelect = true,
38
- customQuickPickDates = { override: true, dates: [] },
39
37
  defaultDate,
40
38
  disableDate,
41
39
  disableRange,
@@ -123,26 +121,27 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
123
121
  }
124
122
  }
125
123
 
126
- const setPlugins = (thisRangesEndToday: boolean, customQuickPickDates: any) => {
124
+ const setPlugins = (thisRangesEndToday: boolean) => {
127
125
  const pluginList = []
128
-
126
+
129
127
  // month and week selection
130
128
  if (selectionType === "month" || plugins.length > 0) {
131
129
  pluginList.push(monthSelectPlugin({ shorthand: true, dateFormat: 'F Y', altFormat: 'F Y' }))
132
130
  } else if ( selectionType === "week") {
133
131
  pluginList.push(weekSelect())
134
-
132
+
135
133
  } else if (selectionType === "quickpick") {
136
- //------- QUICKPICK VARIANT PLUGIN -------------//
137
- pluginList.push(quickPickPlugin(thisRangesEndToday, customQuickPickDates))
134
+ //------- QUICKPICK VARIANT PLUGIN -------------//
135
+ pluginList.push(quickPickPlugin(thisRangesEndToday))
138
136
  }
139
-
137
+
140
138
  // time selection
141
139
  if (enableTime) pluginList.push(timeSelectPlugin({ caption: timeCaption, showTimezone: showTimezone}))
142
-
140
+
141
+
143
142
  return pluginList
144
143
  }
145
-
144
+
146
145
  const getDateFormat = () => {
147
146
  return enableTime ? `${format} ${timeFormat}` : format
148
147
  }
@@ -182,7 +181,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
182
181
  onYearChange: [() => {
183
182
  yearChangeHook()
184
183
  }],
185
- plugins: setPlugins(thisRangesEndToday, customQuickPickDates),
184
+ plugins: setPlugins(thisRangesEndToday),
186
185
  position,
187
186
  positionElement: getPositionElement(positionElement),
188
187
  prevArrow: '<i class="far fa-angle-left"></i>',
@@ -1,5 +1,5 @@
1
- import React from "react"
2
- import DatePicker from "../_date_picker"
1
+ import React from 'react'
2
+ import DatePicker from '../_date_picker'
3
3
 
4
4
  const DatePickerQuickPickReact = (props) => (
5
5
  <>
@@ -10,8 +10,6 @@ examples:
10
10
  - date_picker_range: Range
11
11
  - date_picker_quick_pick_rails: Range (Quick Pick)
12
12
  - date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
13
- - date_picker_quick_pick_custom: Custom Quick Pick Dates
14
- - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
15
13
  - date_picker_format: Format
16
14
  - date_picker_disabled: Disabled Dates
17
15
  - date_picker_min_max: Min Max
@@ -39,8 +37,6 @@ examples:
39
37
  - date_picker_range: Range
40
38
  - date_picker_quick_pick_react: Range (Quick Pick)
41
39
  - date_picker_quick_pick_range_limit: Range (Quick Pick w/ “This” Range limit)
42
- - date_picker_quick_pick_custom: Custom Quick Pick Dates
43
- - date_picker_quick_pick_custom_override: Custom Quick Pick Dates (append to defaults)
44
40
  - date_picker_format: Format
45
41
  - date_picker_disabled: Disabled Dates
46
42
  - date_picker_min_max: Min Max
@@ -22,5 +22,3 @@ export { default as DatePickerAllowInput } from './_date_picker_allow_input'
22
22
  export { default as DatePickerQuickPickReact } from './_date_picker_quick_pick_react'
23
23
  export { default as DatePickerQuickPickRangeLimit } from './_date_picker_quick_pick_range_limit'
24
24
  export { default as DatePickerOnClose } from './_date_picker_on_close.jsx'
25
- export { default as DatePickerQuickPickCustom } from './_date_picker_quick_pick_custom'
26
- export { default as DatePickerQuickPickCustomOverride } from './_date_picker_quick_pick_custom_override'