playbook_ui 12.30.1.pre.alpha.play846responsivespacingglobalpropsneedsdefault924 → 12.31.0.pre.alpha.PLAY814removemomentjs933
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/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_badge/_badge.scss +5 -0
- data/app/pb_kits/playbook/pb_badge/_badge.tsx +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.rb +1 -1
- data/app/pb_kits/playbook/pb_badge/badge.test.js +13 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.html.erb +12 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification.jsx +25 -0
- data/app/pb_kits/playbook/pb_badge/docs/example.yml +2 -1
- data/app/pb_kits/playbook/pb_badge/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_hover.jsx +40 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +0 -3
- data/app/pb_kits/playbook/pb_card/_card.tsx +6 -5
- data/app/pb_kits/playbook/pb_card/card.html.erb +3 -1
- data/app/pb_kits/playbook/pb_card/card.rb +96 -0
- data/app/pb_kits/playbook/pb_card/card_body.rb +1 -93
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +0 -11
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +3 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_date/_date.tsx +7 -8
- data/app/pb_kits/playbook/pb_date_range_inline/_date_range_inline.tsx +45 -31
- data/app/pb_kits/playbook/pb_date_range_stacked/_date_range_stacked.tsx +5 -3
- data/app/pb_kits/playbook/pb_date_stacked/_date_stacked.tsx +24 -21
- data/app/pb_kits/playbook/pb_date_time/_date_time.tsx +1 -1
- data/app/pb_kits/playbook/pb_date_time/dateTime.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +2 -2
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +1 -1
- data/app/pb_kits/playbook/pb_date_year_stacked/_date_year_stacked.tsx +6 -8
- data/app/pb_kits/playbook/pb_dialog/_dialog.scss +0 -12
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +2 -2
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +4 -1
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +2 -1
- data/app/pb_kits/playbook/pb_kit/dateTime.ts +139 -67
- data/app/pb_kits/playbook/pb_label_value/_label_value.tsx +52 -31
- data/app/pb_kits/playbook/pb_message/_message.tsx +25 -25
- data/app/pb_kits/playbook/pb_message/docs/_message_default.jsx +33 -45
- data/app/pb_kits/playbook/pb_message/docs/_message_hover.jsx +41 -0
- data/app/pb_kits/playbook/pb_message/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_message/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +4 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +8 -3
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.html.erb +76 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.jsx +88 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_selected_ids.md +5 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.rb +3 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.scss +7 -0
- data/app/pb_kits/playbook/pb_section_separator/_section_separator.tsx +12 -7
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.html.erb +14 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.jsx +30 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_children.md +3 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed.html.erb +1 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_dashed.jsx +13 -0
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.html.erb +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx +1 -1
- data/app/pb_kits/playbook/pb_section_separator/docs/example.yml +6 -3
- data/app/pb_kits/playbook/pb_section_separator/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_section_separator/section_separator.html.erb +4 -2
- data/app/pb_kits/playbook/pb_section_separator/section_separator.rb +4 -1
- data/app/pb_kits/playbook/pb_time/_time.tsx +9 -11
- data/app/pb_kits/playbook/pb_time_range_inline/_time_range_inline.tsx +46 -49
- data/app/pb_kits/playbook/pb_time_stacked/_time_stacked.tsx +4 -6
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.tsx +13 -12
- data/app/pb_kits/playbook/pb_title/_title.scss +18 -0
- data/app/pb_kits/playbook/pb_title/_title.tsx +20 -2
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.html.erb +1 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.jsx +16 -0
- data/app/pb_kits/playbook/pb_title/docs/_title_responsive.md +1 -0
- data/app/pb_kits/playbook/pb_title/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_title/docs/index.js +1 -0
- data/app/pb_kits/playbook/pb_title/title.rb +21 -4
- data/app/pb_kits/playbook/pb_title/title.test.js +42 -29
- data/app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx +8 -11
- data/app/pb_kits/playbook/tokens/_scale.scss +9 -0
- data/app/pb_kits/playbook/tokens/exports/_scale.scss +13 -0
- data/app/pb_kits/playbook/utilities/_border_radius.scss +31 -0
- data/app/pb_kits/playbook/utilities/_colors.scss +3 -0
- data/app/pb_kits/playbook/utilities/_hover.scss +47 -0
- data/app/pb_kits/playbook/utilities/globalProps.ts +22 -2
- data/dist/playbook-rails.js +7 -7
- data/lib/playbook/version.rb +2 -2
- metadata +21 -3
- data/app/pb_kits/playbook/pb_logistic/_logistic.jsx +0 -120
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea30ab1eb68b157b59551e983c188dc54b84a10e9298dd872177400ab2d5a1f
|
4
|
+
data.tar.gz: 4f29ee0e00f034cbfa461400630bb81162fb1af25f9898151fbf1c232039de17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22232422c782273e028e8f89ab1a1443dbcc1e3007c67510d8571adee8bc5011f204e4f59e069659ae680e418713b4bed55832c2bb08f879ce4d8d9c7d2b2f23
|
7
|
+
data.tar.gz: 327b369dbe832a1b307c475988368a4b0611d29198a8bb42f77104dc1bf02e17eb2e2cbe75e373702e5206c05a21f8cf5f8e6d1d641b2f91451214450635cffd
|
@@ -24,7 +24,7 @@ type BadgeProps = {
|
|
24
24
|
removeOnClick?: React.MouseEventHandler<HTMLSpanElement>,
|
25
25
|
rounded?: boolean,
|
26
26
|
text?: string,
|
27
|
-
variant?: "error" | "info" | "neutral" | "primary" | "success" | "warning",
|
27
|
+
variant?: "error" | "info" | "neutral" | "notification" | "primary" | "success" | "warning",
|
28
28
|
} & GlobalProps
|
29
29
|
const Badge = (props: BadgeProps) => {
|
30
30
|
const {
|
@@ -6,7 +6,7 @@ module Playbook
|
|
6
6
|
prop :rounded, type: Playbook::Props::Boolean, default: false
|
7
7
|
prop :text
|
8
8
|
prop :variant, type: Playbook::Props::Enum,
|
9
|
-
values: %w[success warning error info neutral primary],
|
9
|
+
values: %w[success warning error info neutral notification primary],
|
10
10
|
default: "neutral"
|
11
11
|
|
12
12
|
def classname
|
@@ -93,3 +93,16 @@ test('displays success variant', () => {
|
|
93
93
|
cleanup()
|
94
94
|
|
95
95
|
})
|
96
|
+
|
97
|
+
test('displays notification variant', () => {
|
98
|
+
render(
|
99
|
+
<Badge
|
100
|
+
data={{ testid: testId }}
|
101
|
+
text="1"
|
102
|
+
variant="notification"
|
103
|
+
/>
|
104
|
+
)
|
105
|
+
const kit = screen.getByTestId(testId)
|
106
|
+
expect(kit).toHaveClass(`pb_badge_kit_notification`)
|
107
|
+
cleanup()
|
108
|
+
})
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import Badge from '../_badge'
|
3
|
+
|
4
|
+
const BadgeNotification = (props) => {
|
5
|
+
return (
|
6
|
+
<>
|
7
|
+
<Badge
|
8
|
+
rounded
|
9
|
+
text="1"
|
10
|
+
variant="notification"
|
11
|
+
{...props}
|
12
|
+
/>
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
<Badge
|
17
|
+
text="4"
|
18
|
+
variant="notification"
|
19
|
+
{...props}
|
20
|
+
/>
|
21
|
+
</>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
export default BadgeNotification
|
@@ -3,9 +3,10 @@ examples:
|
|
3
3
|
- badge_default: Rectangle
|
4
4
|
- badge_rounded: Rounded
|
5
5
|
- badge_colors: Colors
|
6
|
-
|
6
|
+
- badge_notification: Notification
|
7
7
|
|
8
8
|
react:
|
9
9
|
- badge_default: Rectangle
|
10
10
|
- badge_rounded: Rounded
|
11
11
|
- badge_colors: Colors
|
12
|
+
- badge_notification: Notification
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { Button } from "../../"
|
3
|
+
|
4
|
+
const ButtonHover = (props) => (
|
5
|
+
<div>
|
6
|
+
<div>
|
7
|
+
<Button
|
8
|
+
hover={{ shadow: "deep" }}
|
9
|
+
marginRight='lg'
|
10
|
+
marginTop='xl'
|
11
|
+
onClick={() => alert("button clicked!")}
|
12
|
+
tabIndex={0}
|
13
|
+
text='Shadow Deep'
|
14
|
+
{...props}
|
15
|
+
/>{" "}
|
16
|
+
<Button
|
17
|
+
hover={{ shadow: "deeper" }}
|
18
|
+
marginRight='lg'
|
19
|
+
marginTop='xl'
|
20
|
+
onClick={() => alert("button clicked!")}
|
21
|
+
tabIndex={0}
|
22
|
+
text='Shadow Deeper'
|
23
|
+
variant='secondary'
|
24
|
+
{...props}
|
25
|
+
/>{" "}
|
26
|
+
<Button
|
27
|
+
hover={{ shadow: "deepest" }}
|
28
|
+
marginRight='lg'
|
29
|
+
marginTop='xl'
|
30
|
+
onClick={() => alert("button clicked!")}
|
31
|
+
tabIndex={0}
|
32
|
+
text='Shadow Deepest'
|
33
|
+
variant='link'
|
34
|
+
{...props}
|
35
|
+
/>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
)
|
39
|
+
|
40
|
+
export default ButtonHover
|
@@ -8,3 +8,4 @@ export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
|
8
8
|
export { default as ButtonOptions } from './_button_options.jsx'
|
9
9
|
export { default as ButtonSize } from './_button_size.jsx'
|
10
10
|
export { default as ButtonForm } from './_button_form.jsx'
|
11
|
+
export { default as ButtonHover } from './_button_hover.jsx'
|
@@ -3,7 +3,6 @@
|
|
3
3
|
|
4
4
|
[class^=pb_card_kit] {
|
5
5
|
@include pb_card;
|
6
|
-
padding: $space_md;
|
7
6
|
|
8
7
|
&[class*=_selected] {
|
9
8
|
@include pb_card_selected;
|
@@ -26,7 +25,6 @@
|
|
26
25
|
flex-shrink: 0;
|
27
26
|
flex-basis: auto;
|
28
27
|
min-height: 1px;
|
29
|
-
padding: $space_sm;
|
30
28
|
border: 0;
|
31
29
|
border-radius: $pb_card_header_border_radius $pb_card_header_border_radius 0px 0px;
|
32
30
|
@each $color_name, $color_value in $pb_card_header_colors {
|
@@ -59,7 +57,6 @@
|
|
59
57
|
flex-basis: auto;
|
60
58
|
min-height: 1px;
|
61
59
|
border: 0;
|
62
|
-
padding: $space_md;
|
63
60
|
}
|
64
61
|
|
65
62
|
&[class*=_highlight] {
|
@@ -42,10 +42,10 @@ type CardBodyProps = {
|
|
42
42
|
|
43
43
|
// Header component
|
44
44
|
const Header = (props: CardHeaderProps) => {
|
45
|
-
const { children, className, headerColor = 'category_1', headerColorStriped = false } = props
|
45
|
+
const { children, className, headerColor = 'category_1', headerColorStriped = false, padding = 'sm' } = props
|
46
46
|
const headerCSS = buildCss('pb_card_header_kit', `${headerColor}`, headerColorStriped ? 'striped' : '')
|
47
47
|
|
48
|
-
const headerSpacing = globalProps(props)
|
48
|
+
const headerSpacing = globalProps(props, { padding })
|
49
49
|
|
50
50
|
return (
|
51
51
|
<div className={classnames(headerCSS, headerSpacing, className)}>
|
@@ -57,9 +57,9 @@ const Header = (props: CardHeaderProps) => {
|
|
57
57
|
|
58
58
|
// Body component
|
59
59
|
const Body = (props: CardBodyProps) => {
|
60
|
-
const { children, className } = props
|
60
|
+
const { children, padding = 'md', className } = props
|
61
61
|
const bodyCSS = buildCss('pb_card_body_kit')
|
62
|
-
const bodySpacing = globalProps(props)
|
62
|
+
const bodySpacing = globalProps(props, { padding })
|
63
63
|
|
64
64
|
return (
|
65
65
|
<div className={classnames(bodyCSS, bodySpacing, className)}>
|
@@ -80,6 +80,7 @@ const Card = (props: CardPropTypes) => {
|
|
80
80
|
highlight = {},
|
81
81
|
selected = false,
|
82
82
|
tag = 'div',
|
83
|
+
padding = 'md',
|
83
84
|
} = props
|
84
85
|
const borderCSS = borderNone == true ? 'border_none' : ''
|
85
86
|
const selectedCSS = selected == true ? 'selected' : 'deselected'
|
@@ -113,7 +114,7 @@ const Card = (props: CardPropTypes) => {
|
|
113
114
|
<Tag
|
114
115
|
{...ariaProps}
|
115
116
|
{...dataProps}
|
116
|
-
className={classnames(cardCss, globalProps(props), className)}
|
117
|
+
className={classnames(cardCss, globalProps(props, { padding }), className)}
|
117
118
|
>
|
118
119
|
{subComponentTags('Header')}
|
119
120
|
{nonHeaderChildren}
|
@@ -4,7 +4,9 @@
|
|
4
4
|
class: object.classname,
|
5
5
|
aria: object.aria,
|
6
6
|
dark: object.dark) do %>
|
7
|
-
|
7
|
+
<%= pb_rails("card/card_body", props: { padding: object.body_padding, flex_direction: object.body_flex_direction, flex_wrap: object.body_flex_wrap, justify_content: object.body_justify_content, justify_self: object.body_justify_self, align_items: object.body_align_items, align_content: object.body_align_content, align_self: object.body_align_self, flex: object.body_flex, flex_grow: object.body_flex_grow, flex_shrink: object.body_flex_shrink, order: object.body_order }) do %>
|
8
|
+
<%= content %>
|
9
|
+
<% end if content.present? %>
|
8
10
|
<% end %>
|
9
11
|
|
10
12
|
|
@@ -28,6 +28,102 @@ module Playbook
|
|
28
28
|
highlight_color_class)
|
29
29
|
end
|
30
30
|
|
31
|
+
def body_padding
|
32
|
+
if padding.present?
|
33
|
+
""
|
34
|
+
else
|
35
|
+
"p_md"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def body_flex_direction
|
40
|
+
if flex_direction.present?
|
41
|
+
"flex_direction_#{flex_direction}"
|
42
|
+
else
|
43
|
+
""
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def body_flex_wrap
|
48
|
+
if flex_wrap.present?
|
49
|
+
"flex_wrap_#{flex_wrap}"
|
50
|
+
else
|
51
|
+
""
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def body_justify_content
|
56
|
+
if justify_content.present?
|
57
|
+
"justify_content_#{justify_content}"
|
58
|
+
else
|
59
|
+
""
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def body_justify_self
|
64
|
+
if justify_self.present?
|
65
|
+
"justify_self_#{justify_self}"
|
66
|
+
else
|
67
|
+
""
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def body_align_items
|
72
|
+
if align_items.present?
|
73
|
+
"align_items_#{align_items}"
|
74
|
+
else
|
75
|
+
""
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
def body_align_content
|
80
|
+
if align_content.present?
|
81
|
+
"align_content_#{align_content}"
|
82
|
+
else
|
83
|
+
""
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def body_align_self
|
88
|
+
if align_self.present?
|
89
|
+
"align_self_#{align_self}"
|
90
|
+
else
|
91
|
+
""
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
def body_flex
|
96
|
+
if flex.present?
|
97
|
+
"flex_#{flex}"
|
98
|
+
else
|
99
|
+
""
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
def body_flex_grow
|
104
|
+
if flex_grow.present?
|
105
|
+
"flex_grow_#{flex_grow}"
|
106
|
+
else
|
107
|
+
""
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def body_flex_shrink
|
112
|
+
if flex_shrink.present?
|
113
|
+
"flex_shrink_#{flex_shrink}"
|
114
|
+
else
|
115
|
+
""
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
def body_order
|
120
|
+
if order.present?
|
121
|
+
"order_#{order}"
|
122
|
+
else
|
123
|
+
""
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
31
127
|
private
|
32
128
|
|
33
129
|
def selected_class
|
@@ -4,99 +4,7 @@ module Playbook
|
|
4
4
|
module PbCard
|
5
5
|
class CardBody < Playbook::KitBase
|
6
6
|
def classname
|
7
|
-
generate_classname("pb_card_body_kit", flex_direction, justify_content, flex_wrap, justify_self, align_items, align_content, align_self, flex, flex_grow, flex_shrink, order, separator: " ")
|
8
|
-
end
|
9
|
-
|
10
|
-
def body_padding
|
11
|
-
"" if padding.present?
|
12
|
-
end
|
13
|
-
|
14
|
-
def body_flex_direction
|
15
|
-
if flex_direction.present?
|
16
|
-
"flex_direction_#{flex_direction}"
|
17
|
-
else
|
18
|
-
""
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def body_flex_wrap
|
23
|
-
if flex_wrap.present?
|
24
|
-
"flex_wrap_#{flex_wrap}"
|
25
|
-
else
|
26
|
-
""
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def body_justify_content
|
31
|
-
if justify_content.present?
|
32
|
-
"justify_content_#{justify_content}"
|
33
|
-
else
|
34
|
-
""
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
def body_justify_self
|
39
|
-
if justify_self.present?
|
40
|
-
"justify_self_#{justify_self}"
|
41
|
-
else
|
42
|
-
""
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def body_align_items
|
47
|
-
if align_items.present?
|
48
|
-
"align_items_#{align_items}"
|
49
|
-
else
|
50
|
-
""
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def body_align_content
|
55
|
-
if align_content.present?
|
56
|
-
"align_content_#{align_content}"
|
57
|
-
else
|
58
|
-
""
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def body_align_self
|
63
|
-
if align_self.present?
|
64
|
-
"align_self_#{align_self}"
|
65
|
-
else
|
66
|
-
""
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
def body_flex
|
71
|
-
if flex.present?
|
72
|
-
"flex_#{flex}"
|
73
|
-
else
|
74
|
-
""
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def body_flex_grow
|
79
|
-
if flex_grow.present?
|
80
|
-
"flex_grow_#{flex_grow}"
|
81
|
-
else
|
82
|
-
""
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
def body_flex_shrink
|
87
|
-
if flex_shrink.present?
|
88
|
-
"flex_shrink_#{flex_shrink}"
|
89
|
-
else
|
90
|
-
""
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def body_order
|
95
|
-
if order.present?
|
96
|
-
"order_#{order}"
|
97
|
-
else
|
98
|
-
""
|
99
|
-
end
|
7
|
+
generate_classname("pb_card_body_kit", padding, flex_direction, justify_content, flex_wrap, justify_self, align_items, align_content, align_self, flex, flex_grow, flex_shrink, order, separator: " ")
|
100
8
|
end
|
101
9
|
end
|
102
10
|
end
|
@@ -1,9 +1,6 @@
|
|
1
1
|
@import "./tokens/colors";
|
2
|
-
@import "./tokens/spacing";
|
3
2
|
|
4
3
|
[class^=pb_collapsible_kit] {
|
5
|
-
padding: $space_md;
|
6
|
-
|
7
4
|
.toggle-content {
|
8
5
|
display: none;
|
9
6
|
height: 0;
|
@@ -21,11 +18,3 @@
|
|
21
18
|
color: $primary
|
22
19
|
}
|
23
20
|
}
|
24
|
-
|
25
|
-
[class^=pb_collapsible_main_kit] {
|
26
|
-
padding: $space_md;
|
27
|
-
}
|
28
|
-
|
29
|
-
[class^=pb_collapsible_content_kit] {
|
30
|
-
padding: $space_md;
|
31
|
-
}
|
@@ -19,6 +19,7 @@ type CollapsibleProps = {
|
|
19
19
|
iconColor?: 'default' | 'light' | 'lighter' | 'link' | 'error' | 'success',
|
20
20
|
iconSize?: typeof IconSizes
|
21
21
|
id?: string,
|
22
|
+
padding?: string,
|
22
23
|
}
|
23
24
|
|
24
25
|
const useCollapsible = (initial = false) => {
|
@@ -39,6 +40,7 @@ const Collapsible = ({
|
|
39
40
|
iconColor = 'default',
|
40
41
|
iconSize,
|
41
42
|
id,
|
43
|
+
padding = 'md',
|
42
44
|
...props
|
43
45
|
}: CollapsibleProps) => {
|
44
46
|
const [isCollapsed, collapse] = useCollapsible(collapsed)
|
@@ -57,7 +59,7 @@ const Collapsible = ({
|
|
57
59
|
const dataProps = buildDataProps(data)
|
58
60
|
const classes = classnames(
|
59
61
|
buildCss('pb_collapsible_kit'),
|
60
|
-
globalProps(props),
|
62
|
+
globalProps(props, { padding }),
|
61
63
|
className
|
62
64
|
)
|
63
65
|
|
@@ -9,16 +9,18 @@ import CollapsibleContext from '../context'
|
|
9
9
|
export type CollapsibleContentProps = {
|
10
10
|
children?: React.ReactNode[] | React.ReactNode | string,
|
11
11
|
className?: string,
|
12
|
+
padding?: string,
|
12
13
|
}
|
13
14
|
|
14
15
|
const CollapsibleContent = ({
|
15
16
|
children,
|
16
17
|
className,
|
18
|
+
padding = 'md',
|
17
19
|
...props
|
18
20
|
}: CollapsibleContentProps) => {
|
19
21
|
const context: {[key: string]: boolean | string} = useContext(CollapsibleContext)
|
20
22
|
const contentCSS = buildCss('pb_collapsible_content_kit')
|
21
|
-
const contentSpacing = globalProps(props)
|
23
|
+
const contentSpacing = globalProps(props, { padding })
|
22
24
|
|
23
25
|
return (
|
24
26
|
<AnimateHeight
|
@@ -31,6 +31,7 @@ const colorMap = {
|
|
31
31
|
type CollapsibleMainProps = {
|
32
32
|
children: React.ReactNode[] | React.ReactNode,
|
33
33
|
className?: string,
|
34
|
+
padding?: string,
|
34
35
|
cursor?: string,
|
35
36
|
|
36
37
|
}
|
@@ -62,11 +63,12 @@ const CollapsibleMain = ({
|
|
62
63
|
children,
|
63
64
|
className,
|
64
65
|
cursor = 'pointer',
|
66
|
+
padding = 'md',
|
65
67
|
...props
|
66
68
|
}: CollapsibleMainProps): React.ReactElement=> {
|
67
69
|
const context: {[key: string]: IconColors | (() => void)} | boolean = useContext(CollapsibleContext)
|
68
70
|
const mainCSS = buildCss('pb_collapsible_main_kit')
|
69
|
-
const mainSpacing = globalProps(props, { cursor })
|
71
|
+
const mainSpacing = globalProps(props, { cursor, padding })
|
70
72
|
|
71
73
|
return (
|
72
74
|
<div className={classnames(mainCSS, className, mainSpacing)}>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import classnames from "classnames";
|
3
3
|
|
4
|
-
import DateTime from "../pb_kit/dateTime";
|
5
4
|
import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
|
6
5
|
import { globalProps } from "../utilities/globalProps";
|
6
|
+
import DateTime from '../pb_kit/dateTime';
|
7
7
|
|
8
8
|
import Body from "../pb_body/_body";
|
9
9
|
import Caption from "../pb_caption/_caption";
|
@@ -20,7 +20,7 @@ type PbDateProps = {
|
|
20
20
|
showIcon?: boolean;
|
21
21
|
size?: "sm" | "md" | "lg";
|
22
22
|
unstyled?: boolean;
|
23
|
-
value:
|
23
|
+
value: Date;
|
24
24
|
};
|
25
25
|
|
26
26
|
const PbDate = (props: PbDateProps) => {
|
@@ -37,12 +37,11 @@ const PbDate = (props: PbDateProps) => {
|
|
37
37
|
value,
|
38
38
|
} = props;
|
39
39
|
|
40
|
-
const
|
41
|
-
const
|
42
|
-
const
|
43
|
-
const
|
44
|
-
const
|
45
|
-
const currentYear = new Date().getFullYear().toString();
|
40
|
+
const weekday = DateTime.toWeekday(value);
|
41
|
+
const month = DateTime.toMonth(value);
|
42
|
+
const day = DateTime.toDay(value);
|
43
|
+
const year = DateTime.toYear(value);
|
44
|
+
const currentYear = new Date().getFullYear();
|
46
45
|
|
47
46
|
const ariaProps = buildAriaProps(aria);
|
48
47
|
const dataProps = buildDataProps(data);
|