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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_avatar/_avatar.tsx +5 -1
- data/app/pb_kits/playbook/pb_avatar_action_button/_avatar_action_button.tsx +6 -2
- data/app/pb_kits/playbook/pb_background/_background.tsx +9 -5
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +5 -1
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +6 -2
- data/app/pb_kits/playbook/pb_body/_body.tsx +5 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumb_item.tsx +5 -1
- data/app/pb_kits/playbook/pb_bread_crumbs/_bread_crumbs.tsx +5 -2
- data/app/pb_kits/playbook/pb_button/_button.tsx +8 -1
- data/app/pb_kits/playbook/pb_button_toolbar/_button_toolbar.tsx +5 -1
- data/app/pb_kits/playbook/pb_caption/_caption.tsx +6 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +5 -1
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.tsx +7 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +7 -2
- data/app/pb_kits/playbook/pb_circle_icon_button/_circle_icon_button.tsx +5 -3
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +5 -1
- data/app/pb_kits/playbook/pb_contact/_contact.tsx +5 -1
- data/app/pb_kits/playbook/pb_contact/docs/_contact_default_swift.md +14 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_contact/docs/_contact_with_detail_swift.md +14 -0
- data/app/pb_kits/playbook/pb_contact/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +5 -1
- data/app/pb_kits/playbook/pb_dashboard_value/_dashboard_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +12 -7
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_default_swift.md +16 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date/docs/_date_variants_swift.md +14 -0
- data/app/pb_kits/playbook/pb_date/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +15 -4
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +12 -5
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +5 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +15 -4
- data/app/pb_kits/playbook/pb_detail/_detail.tsx +5 -1
- data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +11 -3
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +8 -3
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +5 -1
- data/app/pb_kits/playbook/pb_distribution_bar/_distribution_bar.tsx +8 -1
- data/app/pb_kits/playbook/pb_enhanced_element/element_observer.ts +1 -1
- data/app/pb_kits/playbook/pb_enhanced_element/index.ts +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +6 -2
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.md +1 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/_fixed_confirmation_toast.tsx +6 -1
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +6 -1
- data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +6 -1
- data/app/pb_kits/playbook/pb_form_group/_form_group.tsx +5 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +7 -1
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +6 -2
- data/app/pb_kits/playbook/pb_hashtag/_hashtag.tsx +5 -1
- data/app/pb_kits/playbook/pb_highlight/_highlight.tsx +5 -0
- data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +10 -3
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_default_swift.md +18 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_emphasis_swift.md +34 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_link_swift.md +18 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_modified_swift.md +13 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_props_swift.md +14 -0
- data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_icon/_icon.tsx +7 -1
- data/app/pb_kits/playbook/pb_icon_circle/_icon_circle.tsx +5 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/_icon_stat_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_icon_value/_icon_value.tsx +5 -1
- data/app/pb_kits/playbook/pb_image/_image.tsx +6 -1
- data/app/pb_kits/playbook/pb_label_pill/_label_pill.tsx +5 -1
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +6 -2
- data/app/pb_kits/playbook/pb_layout/_layout.tsx +6 -1
- data/app/pb_kits/playbook/pb_legend/_legend.tsx +5 -1
- data/app/pb_kits/playbook/pb_lightbox/Header/_lightbox_header.tsx +6 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +5 -1
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +9 -3
- data/app/pb_kits/playbook/pb_list/_list.tsx +7 -2
- data/app/pb_kits/playbook/pb_list/_list_item.tsx +5 -1
- data/app/pb_kits/playbook/pb_loading_inline/_loading_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_map/_map.tsx +6 -1
- data/app/pb_kits/playbook/pb_message/_message.tsx +5 -1
- data/app/pb_kits/playbook/pb_message/_message_mention.tsx +5 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/_multiple_users.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_props_swift.md +7 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_reverse_swift.md +13 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/_multiple_users_size_swift.md +11 -0
- data/app/pb_kits/playbook/pb_multiple_users/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/_multiple_users_stacked.tsx +5 -1
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_small_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_multiple_users_stacked_xsmall_swift.md +15 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_nav/_item.tsx +7 -2
- data/app/pb_kits/playbook/pb_nav/_nav.tsx +5 -1
- data/app/pb_kits/playbook/pb_online_status/_online_status.tsx +5 -1
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +6 -2
- data/app/pb_kits/playbook/pb_person/_person.tsx +5 -0
- data/app/pb_kits/playbook/pb_person_contact/_person_contact.tsx +5 -1
- data/app/pb_kits/playbook/pb_phone_number_input/_phone_number_input.tsx +8 -2
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +5 -1
- data/app/pb_kits/playbook/pb_popover/_popover.tsx +6 -1
- data/app/pb_kits/playbook/pb_progress_pills/_progress_pills.tsx +5 -1
- data/app/pb_kits/playbook/pb_progress_simple/_progress_simple.tsx +9 -3
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.tsx +5 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +6 -2
- data/app/pb_kits/playbook/pb_radio/_radio.tsx +5 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/_rich_text_editor.tsx +7 -1
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +5 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children_swift.md +14 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed_swift.md +7 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line_swift.md +8 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_swift.md +7 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical_swift.md +18 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +8 -0
- data/app/pb_kits/playbook/pb_select/_select.tsx +6 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +6 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/_selectable_card_icon.tsx +5 -0
- data/app/pb_kits/playbook/pb_selectable_icon/_selectable_icon.tsx +5 -0
- data/app/pb_kits/playbook/pb_selectable_list/_item.tsx +11 -3
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.tsx +5 -1
- data/app/pb_kits/playbook/pb_source/_source.tsx +5 -1
- data/app/pb_kits/playbook/pb_star_rating/_star_rating.tsx +5 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +14 -2
- data/app/pb_kits/playbook/pb_stat_value/_stat_value.tsx +6 -0
- data/app/pb_kits/playbook/pb_table/_table.tsx +5 -1
- data/app/pb_kits/playbook/pb_table/_table_row.tsx +5 -1
- data/app/pb_kits/playbook/pb_text_input/_text_input.tsx +5 -1
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_add_on_swift.md +35 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_default_swift.md +29 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_disabled_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_error_swift.md +24 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_props_swift.md +13 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_textarea/_textarea.tsx +5 -2
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_default_swift.md +27 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_error_swift.md +11 -0
- data/app/pb_kits/playbook/pb_textarea/docs/_textarea_props_swift.md +9 -0
- data/app/pb_kits/playbook/pb_textarea/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_time/_time.tsx +9 -2
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +5 -1
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +6 -2
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +9 -2
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +5 -1
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +5 -1
- data/app/pb_kits/playbook/pb_title/_title.tsx +5 -1
- data/app/pb_kits/playbook/pb_title_count/_title_count.tsx +5 -1
- data/app/pb_kits/playbook/pb_title_detail/_title_detail.tsx +16 -3
- data/app/pb_kits/playbook/pb_toggle/_toggle.tsx +5 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_default_swift.md +11 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_name_swift.md +10 -0
- data/app/pb_kits/playbook/pb_toggle/docs/_toggle_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_toggle/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.tsx +5 -1
- data/app/pb_kits/playbook/pb_treemap_chart/_treemap_chart.tsx +9 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.tsx +7 -2
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_highlight.jsx +2 -2
- data/app/pb_kits/playbook/pb_user/_user.tsx +5 -1
- data/app/pb_kits/playbook/pb_user_badge/_user_badge.tsx +5 -1
- data/app/pb_kits/playbook/pb_walkthrough/_walkthrough.tsx +5 -1
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +5 -1
- data/app/pb_kits/playbook/utilities/props.ts +16 -0
- data/dist/menu.yml +240 -168
- data/dist/playbook-rails.js +5 -5
- data/lib/playbook/version.rb +2 -2
- 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
|
+
```
|
@@ -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
|
57
|
-
|
58
|
-
|
59
|
-
|
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 {
|
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
|
-
|
37
|
+
const dataProps = buildDataProps(data)
|
38
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
30
39
|
|
31
40
|
return (
|
32
|
-
<div
|
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
|
56
|
-
|
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
|
70
|
-
|
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 {
|
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
|
-
|
35
|
+
const dataProps = buildDataProps(data)
|
36
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
28
37
|
|
29
38
|
return (
|
30
|
-
<div
|
39
|
+
<div
|
40
|
+
{...dataProps}
|
41
|
+
{...htmlProps}
|
31
42
|
className={css}
|
32
43
|
>
|
33
44
|
<Title
|