playbook_ui 14.7.0.pre.alpha.spacingquickchange4482 → 14.7.0.pre.rc.0
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 -3
- data/app/pb_kits/playbook/pb_advanced_table/Components/CustomCell.tsx +1 -8
- data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +28 -21
- data/app/pb_kits/playbook/pb_advanced_table/advanced_table.test.jsx +1 -37
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_custom_cell.jsx +2 -13
- data/app/pb_kits/playbook/pb_card/_card.tsx +5 -8
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_light.md +1 -1
- data/app/pb_kits/playbook/pb_currency/_currency.tsx +6 -16
- data/app/pb_kits/playbook/pb_currency/currency.rb +11 -38
- data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -35
- data/app/pb_kits/playbook/pb_currency/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_date/_date.scss +0 -3
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +0 -6
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +4 -4
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +10 -9
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +2 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -6
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +26 -30
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +1 -24
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +2 -25
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
- data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +8 -46
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -67
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +0 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -5
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +23 -59
- data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +0 -8
- data/app/pb_kits/playbook/pb_timeline/docs/example.yml +1 -2
- data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_timeline/item.html.erb +21 -17
- data/app/pb_kits/playbook/pb_timeline/item.rb +0 -4
- data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -84
- data/app/pb_kits/playbook/tokens/_typography.scss +0 -35
- data/app/pb_kits/playbook/utilities/_hover.scss +43 -46
- data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -1
- data/app/pb_kits/playbook/utilities/globalProps.ts +0 -5
- data/dist/chunks/_typeahead-BhHnXJjy.js +22 -0
- data/dist/chunks/_weekday_stacked-C_QAqbqJ.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +2 -8
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +1 -4
- data/lib/playbook/kit_base.rb +15 -33
- data/lib/playbook/version.rb +2 -2
- metadata +5 -69
- data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +0 -7
- data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +0 -18
- data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md +0 -3
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.html.erb +0 -26
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_default_rails.md +0 -7
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.html.erb +0 -38
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards_rails.md +0 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_list_rails.html.erb +0 -19
- data/app/pb_kits/playbook/pb_draggable/draggable.html.erb +0 -3
- data/app/pb_kits/playbook/pb_draggable/draggable.rb +0 -18
- data/app/pb_kits/playbook/pb_draggable/draggable_container.html.erb +0 -3
- data/app/pb_kits/playbook/pb_draggable/draggable_container.rb +0 -15
- data/app/pb_kits/playbook/pb_draggable/draggable_item.html.erb +0 -7
- data/app/pb_kits/playbook/pb_draggable/draggable_item.rb +0 -18
- data/app/pb_kits/playbook/pb_draggable/index.js +0 -125
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +0 -3
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +0 -1
- data/app/pb_kits/playbook/pb_link/_link.scss +0 -66
- data/app/pb_kits/playbook/pb_link/_link.tsx +0 -107
- data/app/pb_kits/playbook/pb_link/docs/_link_color.html.erb +0 -30
- data/app/pb_kits/playbook/pb_link/docs/_link_color.jsx +0 -40
- data/app/pb_kits/playbook/pb_link/docs/_link_disabled.html.erb +0 -5
- data/app/pb_kits/playbook/pb_link/docs/_link_disabled.jsx +0 -15
- data/app/pb_kits/playbook/pb_link/docs/_link_icon.html.erb +0 -15
- data/app/pb_kits/playbook/pb_link/docs/_link_icon.jsx +0 -25
- data/app/pb_kits/playbook/pb_link/docs/_link_tag.html.erb +0 -35
- data/app/pb_kits/playbook/pb_link/docs/_link_tag.jsx +0 -45
- data/app/pb_kits/playbook/pb_link/docs/_link_underline.html.erb +0 -5
- data/app/pb_kits/playbook/pb_link/docs/_link_underline.jsx +0 -15
- data/app/pb_kits/playbook/pb_link/docs/example.yml +0 -16
- data/app/pb_kits/playbook/pb_link/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_link/link.html.erb +0 -21
- data/app/pb_kits/playbook/pb_link/link.rb +0 -44
- data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -92
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.scss +0 -37
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading.tsx +0 -67
- data/app/pb_kits/playbook/pb_skeleton_loading/_skeleton_loading_mixins.scss +0 -40
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.jsx +0 -51
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_border_radius.md +0 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.jsx +0 -26
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_color.md +0 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.html.erb +0 -1
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_default.jsx +0 -11
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.jsx +0 -59
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_height_width.md +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.jsx +0 -20
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/_skeleton_loading_layout.md +0 -3
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/example.yml +0 -13
- data/app/pb_kits/playbook/pb_skeleton_loading/docs/index.js +0 -5
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.html.erb +0 -12
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.rb +0 -8
- data/app/pb_kits/playbook/pb_skeleton_loading/skeleton_loading.test.jsx +0 -81
- data/app/pb_kits/playbook/pb_timeline/detail.html.erb +0 -3
- data/app/pb_kits/playbook/pb_timeline/detail.rb +0 -11
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -43
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -68
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md +0 -2
- data/app/pb_kits/playbook/pb_timeline/label.html.erb +0 -12
- data/app/pb_kits/playbook/pb_timeline/label.rb +0 -13
- data/app/pb_kits/playbook/pb_timeline/step.html.erb +0 -14
- data/app/pb_kits/playbook/pb_timeline/step.rb +0 -16
- data/app/pb_kits/playbook/pb_timeline/subcomponents/Detail.tsx +0 -29
- data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -38
- data/app/pb_kits/playbook/pb_timeline/subcomponents/Step.tsx +0 -42
- data/app/pb_kits/playbook/pb_timeline/subcomponents/index.tsx +0 -3
- data/dist/chunks/_typeahead-DhLic2Fe.js +0 -22
- data/dist/chunks/_weekday_stacked-Mx8TYP5I.js +0 -45
@@ -3,7 +3,6 @@ import classnames from 'classnames'
|
|
3
3
|
import Title from '../pb_title/_title'
|
4
4
|
import Icon from '../pb_icon/_icon'
|
5
5
|
import Avatar from '../pb_avatar/_avatar'
|
6
|
-
import Tooltip from '../pb_tooltip/_tooltip'
|
7
6
|
import { globalProps, GlobalProps } from '../utilities/globalProps'
|
8
7
|
import { buildDataProps, buildHtmlProps } from '../utilities/props'
|
9
8
|
|
@@ -63,30 +62,6 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
|
|
63
62
|
const dataProps = buildDataProps(data)
|
64
63
|
const htmlProps = buildHtmlProps(htmlOptions)
|
65
64
|
|
66
|
-
const renderTitle = (content: string, className: string) => {
|
67
|
-
const titleComponent = (
|
68
|
-
<Title
|
69
|
-
className={className}
|
70
|
-
size={4}
|
71
|
-
text={content}
|
72
|
-
truncate={props.truncate}
|
73
|
-
/>
|
74
|
-
)
|
75
|
-
if (props.truncate) {
|
76
|
-
return (
|
77
|
-
<Tooltip
|
78
|
-
interaction
|
79
|
-
placement="top"
|
80
|
-
position="fixed"
|
81
|
-
text={content}
|
82
|
-
>
|
83
|
-
{titleComponent}
|
84
|
-
</Tooltip>
|
85
|
-
)
|
86
|
-
}
|
87
|
-
return titleComponent
|
88
|
-
}
|
89
|
-
|
90
65
|
return (
|
91
66
|
<div className={css}
|
92
67
|
id={id}
|
@@ -102,7 +77,12 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
|
|
102
77
|
size="xxs"
|
103
78
|
status={null}
|
104
79
|
/>
|
105
|
-
|
80
|
+
<Title
|
81
|
+
className="pb_form_pill_text"
|
82
|
+
size={4}
|
83
|
+
text={name}
|
84
|
+
truncate={props.truncate}
|
85
|
+
/>
|
106
86
|
</>
|
107
87
|
)}
|
108
88
|
{((name && icon && !text) || (name && icon && text)) && (
|
@@ -113,7 +93,12 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
|
|
113
93
|
size="xxs"
|
114
94
|
status={null}
|
115
95
|
/>
|
116
|
-
|
96
|
+
<Title
|
97
|
+
className="pb_form_pill_text"
|
98
|
+
size={4}
|
99
|
+
text={name}
|
100
|
+
truncate={props.truncate}
|
101
|
+
/>
|
117
102
|
<Icon
|
118
103
|
className="pb_form_pill_icon"
|
119
104
|
color={color}
|
@@ -128,10 +113,22 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
|
|
128
113
|
color={color}
|
129
114
|
icon={icon}
|
130
115
|
/>
|
131
|
-
|
116
|
+
<Title
|
117
|
+
className="pb_form_pill_tag"
|
118
|
+
size={4}
|
119
|
+
text={text}
|
120
|
+
truncate={props.truncate}
|
121
|
+
/>
|
132
122
|
</>
|
133
123
|
)}
|
134
|
-
{(!name && !icon && text) &&
|
124
|
+
{(!name && !icon && text) && (
|
125
|
+
<Title
|
126
|
+
className="pb_form_pill_tag"
|
127
|
+
size={4}
|
128
|
+
text={text}
|
129
|
+
truncate={props.truncate}
|
130
|
+
/>
|
131
|
+
)}
|
135
132
|
<div
|
136
133
|
className="pb_form_pill_close"
|
137
134
|
onClick={onClick}
|
@@ -146,5 +143,4 @@ const FormPill = (props: FormPillProps): React.ReactElement => {
|
|
146
143
|
</div>
|
147
144
|
)
|
148
145
|
}
|
149
|
-
|
150
146
|
export default FormPill
|
@@ -13,30 +13,7 @@
|
|
13
13
|
id: "typeahead-form-pill",
|
14
14
|
is_multi: true,
|
15
15
|
options: names,
|
16
|
-
label: "
|
16
|
+
label: "Names",
|
17
17
|
pills: true,
|
18
18
|
truncate: 1,
|
19
19
|
}) %>
|
20
|
-
|
21
|
-
<%= pb_rails("caption", props: { text: "Form Pill Truncation" }) %>
|
22
|
-
<%= pb_rails("card", props: { max_width: "xs" }) do %>
|
23
|
-
<%= pb_rails("form_pill", props: {
|
24
|
-
name: "Princess Amelia Mignonette Grimaldi Thermopolis Renaldo",
|
25
|
-
avatar_url: "https://randomuser.me/api/portraits/women/44.jpg",
|
26
|
-
tabindex: 0,
|
27
|
-
truncate: 1,
|
28
|
-
id: "truncation-1"
|
29
|
-
}) %>
|
30
|
-
<%= pb_rails("form_pill", props: {
|
31
|
-
icon: "badge-check",
|
32
|
-
text: "icon and a very long tag to show truncation",
|
33
|
-
tabindex: 0,
|
34
|
-
truncate: 1,
|
35
|
-
id: "truncation-2"
|
36
|
-
}) %>
|
37
|
-
<%= pb_rails("form_pill", props: {
|
38
|
-
text: "form pill long tag no tooltip show truncation",
|
39
|
-
tabindex: 0,
|
40
|
-
truncate: 1,
|
41
|
-
}) %>
|
42
|
-
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react'
|
2
|
-
import
|
2
|
+
import Typeahead from '../../pb_typeahead/_typeahead'
|
3
3
|
|
4
4
|
const names = [
|
5
5
|
{ label: 'Alexander Nathaniel Montgomery', value: 'Alexander Nathaniel Montgomery' },
|
@@ -15,34 +15,11 @@ const FormPillTruncatedText = (props) => {
|
|
15
15
|
<Typeahead
|
16
16
|
htmlOptions={{ style: { maxWidth: "240px" }}}
|
17
17
|
isMulti
|
18
|
-
label="
|
18
|
+
label="Names"
|
19
19
|
options={names}
|
20
20
|
truncate={1}
|
21
21
|
{...props}
|
22
22
|
/>
|
23
|
-
<Caption text="Form Pill Truncation"/>
|
24
|
-
<Card maxWidth="xs">
|
25
|
-
<FormPill
|
26
|
-
avatarUrl="https://randomuser.me/api/portraits/women/44.jpg"
|
27
|
-
name="Princess Amelia Mignonette Grimaldi Thermopolis Renaldo"
|
28
|
-
onClick={() => alert('Click!')}
|
29
|
-
tabIndex={0}
|
30
|
-
truncate={1}
|
31
|
-
/>
|
32
|
-
<FormPill
|
33
|
-
icon="badge-check"
|
34
|
-
onClick={() => {alert('Click!')}}
|
35
|
-
tabIndex={0}
|
36
|
-
text="icon and a very long tag to show truncation"
|
37
|
-
truncate={1}
|
38
|
-
/>
|
39
|
-
<FormPill
|
40
|
-
onClick={() => {alert('Click!')}}
|
41
|
-
tabIndex={0}
|
42
|
-
text="form pill with a very long tag to show truncation"
|
43
|
-
truncate={1}
|
44
|
-
/>
|
45
|
-
</Card>
|
46
23
|
</>
|
47
24
|
)
|
48
25
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
For pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
|
@@ -1,57 +1,19 @@
|
|
1
1
|
<%= content_tag(:div, id: object.id, data: object.data, class: object.classname + object.size_class, tabindex: object.tabindex, **combined_html_options) do %>
|
2
2
|
<% if object.name.present? %>
|
3
3
|
<%= pb_rails("avatar", props: { name: object.name, image_url: object.avatar_url, size: "xxs" }) %>
|
4
|
-
|
5
|
-
<div>
|
6
|
-
<%= pb_rails("title", props: {
|
7
|
-
classname: "pb_form_pill_text truncate_#{object.truncate}",
|
8
|
-
id: object.id,
|
9
|
-
size: 4,
|
10
|
-
text: object.name,
|
11
|
-
}) %>
|
12
|
-
<% if object.id.present? %>
|
13
|
-
<%= pb_rails("tooltip", props: {
|
14
|
-
position: "top",
|
15
|
-
tooltip_id: "tooltip-#{object.id}",
|
16
|
-
trigger_element_selector: "##{object.id}"
|
17
|
-
}) do %>
|
18
|
-
<%= object.name %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
21
|
-
</div>
|
22
|
-
<% else %>
|
23
|
-
<%= pb_rails("title", props: { classname: "pb_form_pill_text", id: object.id, size: 4, text: object.name }) %>
|
24
|
-
<% end %>
|
4
|
+
<%= pb_rails("title", props: { text: object.name, size: 4, classname: "pb_form_pill_text" }) %>
|
25
5
|
<% if object.icon.present? %>
|
26
6
|
<%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
|
27
7
|
<% end %>
|
28
8
|
<% elsif object.text.present? %>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
classname: "pb_form_pill_tag truncate_#{object.truncate}",
|
36
|
-
id: object.id,
|
37
|
-
size: 4,
|
38
|
-
text: object.text,
|
39
|
-
}) %>
|
40
|
-
<% if object.id.present? %>
|
41
|
-
<%= pb_rails("tooltip", props: {
|
42
|
-
position: "top",
|
43
|
-
tooltip_id: "tooltip-#{object.id}",
|
44
|
-
trigger_element_selector: "##{object.id}"
|
45
|
-
}) do %>
|
46
|
-
<%= object.text %>
|
47
|
-
<% end %>
|
48
|
-
<% end %>
|
49
|
-
</div>
|
50
|
-
<% else %>
|
51
|
-
<%= pb_rails("title", props: { classname: "pb_form_pill_tag", id: object.id, size: 4, text: object.text, }) %>
|
52
|
-
<% end %>
|
9
|
+
<% if object.icon.present? %>
|
10
|
+
<%= pb_rails("icon", props: { classname: "pb_form_pill_icon", color: object.color, icon: object.icon }) %>
|
11
|
+
<% end %>
|
12
|
+
<% if object.text.present? %>
|
13
|
+
<%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_form_pill_tag" }) %>
|
14
|
+
<% end %>
|
53
15
|
<% end %>
|
54
16
|
<%= pb_rails("body", props: { classname: "pb_form_pill_close" }) do %>
|
55
17
|
<%= pb_rails("icon", props: { icon: 'times', fixed_width: true, size: object.close_icon_size }) %>
|
56
18
|
<% end %>
|
57
|
-
<% end %>
|
19
|
+
<% end %>
|
@@ -10,24 +10,6 @@
|
|
10
10
|
$pb_selectable_card_indicator_size: 22px;
|
11
11
|
$pb_selectable_card_border: 2px;
|
12
12
|
|
13
|
-
$pb_selectable_space_classes: (
|
14
|
-
xxs: $space_xxs,
|
15
|
-
xs: $space_xs,
|
16
|
-
sm: $space_sm,
|
17
|
-
md: $space_md,
|
18
|
-
lg: $space_lg,
|
19
|
-
xl: $space_xl,
|
20
|
-
);
|
21
|
-
$pb_selectable_paddings: (
|
22
|
-
p: "padding",
|
23
|
-
pr: "padding-right",
|
24
|
-
pl: "padding-left",
|
25
|
-
pt: "padding-top",
|
26
|
-
pb: "padding-bottom",
|
27
|
-
px: ("padding-left", "padding-right"),
|
28
|
-
py: ("padding-top", "padding-bottom")
|
29
|
-
);
|
30
|
-
|
31
13
|
[class^=pb_selectable_card_kit] {
|
32
14
|
display: block;
|
33
15
|
margin-bottom: 0;
|
@@ -46,6 +28,7 @@ $pb_selectable_paddings: (
|
|
46
28
|
padding: $space_sm;
|
47
29
|
margin-bottom: $space_sm;
|
48
30
|
cursor: pointer;
|
31
|
+
outline: 1px solid transparent;
|
49
32
|
|
50
33
|
@media (hover:hover) {
|
51
34
|
&:hover {
|
@@ -91,7 +74,6 @@ $pb_selectable_paddings: (
|
|
91
74
|
|
92
75
|
position: relative;
|
93
76
|
@include pb_card_selected;
|
94
|
-
padding: calc(#{$space_sm} - 1px);
|
95
77
|
transition-property: none;
|
96
78
|
transition-duration: 0s;
|
97
79
|
|
@@ -106,54 +88,6 @@ $pb_selectable_paddings: (
|
|
106
88
|
background-color: $royal;
|
107
89
|
}
|
108
90
|
}
|
109
|
-
|
110
|
-
// Selected card has 1px more border
|
111
|
-
// Remove 1px so content does not "jump"
|
112
|
-
@each $position_name,
|
113
|
-
$position in $pb_selectable_paddings {
|
114
|
-
@each $space_name,
|
115
|
-
$space in $pb_selectable_space_classes {
|
116
|
-
~ label.#{$position_name}_#{$space_name} {
|
117
|
-
@if type-of($position)=="list" {
|
118
|
-
@each $coordinate in $position {
|
119
|
-
#{$coordinate}: calc(#{$space} - 1px) !important;
|
120
|
-
}
|
121
|
-
}
|
122
|
-
|
123
|
-
@else {
|
124
|
-
#{$position}: calc(#{$space} - 1px) !important;
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
}
|
129
|
-
}
|
130
|
-
}
|
131
|
-
|
132
|
-
&.display_input {
|
133
|
-
input[type="checkbox"],
|
134
|
-
input[type="radio"] {
|
135
|
-
&:checked {
|
136
|
-
~label {
|
137
|
-
border-width: $pb_card_border_width;
|
138
|
-
outline: 1px solid $primary;
|
139
|
-
}
|
140
|
-
|
141
|
-
}
|
142
|
-
}
|
143
|
-
|
144
|
-
> label {
|
145
|
-
outline: 1px solid transparent;
|
146
|
-
padding: $space_sm;
|
147
|
-
}
|
148
|
-
|
149
|
-
&.dark {
|
150
|
-
input[type="checkbox"],
|
151
|
-
input[type="radio"] {
|
152
|
-
&:checked ~ label {
|
153
|
-
border-width: $pb_card_border_width;
|
154
|
-
outline: 1px solid $primary;
|
155
|
-
}
|
156
|
-
}
|
157
91
|
}
|
158
92
|
}
|
159
93
|
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<% end %>
|
26
26
|
<div class="separator"></div>
|
27
27
|
<div class="psuedo_separator"></div>
|
28
|
-
<%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true
|
28
|
+
<%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true }) do %>
|
29
29
|
<% if content.nil? %>
|
30
30
|
<%= pb_rails("body", props: { text: object.text }) %>
|
31
31
|
<% else %>
|
@@ -25,7 +25,7 @@ module Playbook
|
|
25
25
|
|
26
26
|
def classname
|
27
27
|
[
|
28
|
-
generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class)
|
28
|
+
generate_classname_without_spacing("pb_selectable_card_kit", checked_class, enable_disabled_class),
|
29
29
|
error_class,
|
30
30
|
dark_props,
|
31
31
|
].compact.join(" ")
|
@@ -79,10 +79,6 @@ module Playbook
|
|
79
79
|
def error_class
|
80
80
|
error ? "error" : nil
|
81
81
|
end
|
82
|
-
|
83
|
-
def display_input_class
|
84
|
-
variant == "display_input" ? " display_input" : ""
|
85
|
-
end
|
86
82
|
end
|
87
83
|
end
|
88
84
|
end
|
@@ -1,15 +1,12 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import classnames from 'classnames'
|
3
|
+
|
3
4
|
import { buildCss, buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps, GlobalProps } from "../utilities/globalProps"
|
5
|
+
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
5
6
|
|
6
7
|
import DateStacked from '../pb_date_stacked/_date_stacked'
|
7
8
|
import IconCircle from '../pb_icon_circle/_icon_circle'
|
8
9
|
|
9
|
-
import TimelineLabel from './subcomponents/Label'
|
10
|
-
import TimelineStep from './subcomponents/Step'
|
11
|
-
import TimelineDetail from './subcomponents/Detail'
|
12
|
-
|
13
10
|
type ItemProps = {
|
14
11
|
className?: string,
|
15
12
|
children?: React.ReactNode[] | React.ReactNode,
|
@@ -20,13 +17,6 @@ type ItemProps = {
|
|
20
17
|
lineStyle?: 'solid' | 'dotted',
|
21
18
|
} & GlobalProps
|
22
19
|
|
23
|
-
function isElementOfType<P>(
|
24
|
-
element: React.ReactNode,
|
25
|
-
component: React.ComponentType<P>
|
26
|
-
): element is React.ReactElement<P> {
|
27
|
-
return React.isValidElement<P>(element) && element.type === component
|
28
|
-
}
|
29
|
-
|
30
20
|
const TimelineItem = ({
|
31
21
|
className,
|
32
22
|
children,
|
@@ -41,57 +31,31 @@ const TimelineItem = ({
|
|
41
31
|
|
42
32
|
const htmlProps = buildHtmlProps(htmlOptions)
|
43
33
|
|
44
|
-
const childrenArray = React.Children.toArray(children)
|
45
|
-
|
46
|
-
const labelChild = childrenArray.find(
|
47
|
-
(child): child is React.ReactElement => isElementOfType(child, TimelineLabel)
|
48
|
-
)
|
49
|
-
|
50
|
-
const stepChild = childrenArray.find(
|
51
|
-
(child): child is React.ReactElement => isElementOfType(child, TimelineStep)
|
52
|
-
)
|
53
|
-
|
54
|
-
const detailChild = childrenArray.find(
|
55
|
-
(child): child is React.ReactElement => isElementOfType(child, TimelineDetail)
|
56
|
-
)
|
57
|
-
|
58
|
-
const otherChildren = childrenArray.filter(
|
59
|
-
(child) =>
|
60
|
-
!isElementOfType(child, TimelineLabel) &&
|
61
|
-
!isElementOfType(child, TimelineStep) &&
|
62
|
-
!isElementOfType(child, TimelineDetail)
|
63
|
-
)
|
64
|
-
|
65
34
|
return (
|
66
|
-
<div
|
35
|
+
<div
|
67
36
|
{...htmlProps}
|
68
37
|
className={classnames(timelineItemCss, globalProps(props), className)}
|
69
38
|
>
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
{detailChild || (
|
91
|
-
<div className="pb_timeline_item_right_block">
|
92
|
-
{ otherChildren }
|
93
|
-
</div>
|
94
|
-
)}
|
39
|
+
<div className="pb_timeline_item_left_block">
|
40
|
+
{date &&
|
41
|
+
<DateStacked
|
42
|
+
align="center"
|
43
|
+
date={date}
|
44
|
+
size="sm"
|
45
|
+
/>
|
46
|
+
}
|
47
|
+
</div>
|
48
|
+
<div className="pb_timeline_item_step">
|
49
|
+
<IconCircle
|
50
|
+
icon={icon}
|
51
|
+
size="xs"
|
52
|
+
variant={iconColor}
|
53
|
+
/>
|
54
|
+
<div className="pb_timeline_item_connector" />
|
55
|
+
</div>
|
56
|
+
<div className="pb_timeline_item_right_block">
|
57
|
+
{children}
|
58
|
+
</div>
|
95
59
|
</div>
|
96
60
|
)
|
97
61
|
}
|
@@ -5,11 +5,6 @@ import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../uti
|
|
5
5
|
import { GlobalProps, globalProps } from '../utilities/globalProps'
|
6
6
|
|
7
7
|
import TimelineItem from './_item'
|
8
|
-
import {
|
9
|
-
TimelineStep,
|
10
|
-
TimelineLabel,
|
11
|
-
TimelineDetail,
|
12
|
-
} from './subcomponents'
|
13
8
|
|
14
9
|
type TimelineProps = {
|
15
10
|
aria?: { [key: string]: string },
|
@@ -52,8 +47,5 @@ const Timeline = ({
|
|
52
47
|
}
|
53
48
|
|
54
49
|
Timeline.Item = TimelineItem
|
55
|
-
Timeline.Step = TimelineStep
|
56
|
-
Timeline.Label = TimelineLabel
|
57
|
-
Timeline.Detail = TimelineDetail
|
58
50
|
|
59
51
|
export default Timeline
|
@@ -4,11 +4,10 @@ examples:
|
|
4
4
|
- timeline_default: Default
|
5
5
|
- timeline_vertical: Vertical
|
6
6
|
- timeline_with_date: With Date
|
7
|
-
- timeline_with_children: With Children
|
8
7
|
|
9
8
|
|
10
9
|
react:
|
11
10
|
- timeline_default: Default
|
12
11
|
- timeline_vertical: Vertical
|
13
12
|
- timeline_with_date: With Date
|
14
|
-
|
13
|
+
|
@@ -1,4 +1,3 @@
|
|
1
1
|
export { default as TimelineDefault } from './_timeline_default.jsx'
|
2
2
|
export { default as TimelineVertical } from './_timeline_vertical.jsx'
|
3
3
|
export { default as TimelineWithDate } from './_timeline_with_date.jsx'
|
4
|
-
export { default as TimelineWithChildren } from './_timeline_with_children.jsx'
|
@@ -1,21 +1,25 @@
|
|
1
1
|
<%= pb_content_tag do %>
|
2
|
-
<% if label %>
|
3
|
-
<%= label %>
|
4
|
-
<% else %>
|
5
|
-
<%= pb_rails("timeline/label", props: { date: date }) %>
|
6
|
-
<% end %>
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<%= detail%>
|
16
|
-
<% else %>
|
17
|
-
<%= pb_rails("timeline/detail") do %>
|
18
|
-
<%= content %>
|
3
|
+
<div class="pb_timeline_item_left_block">
|
4
|
+
<% if object.date.present? %>
|
5
|
+
<%= pb_rails("date_stacked", props: {
|
6
|
+
date: object.date,
|
7
|
+
size: "sm",
|
8
|
+
align: "center"
|
9
|
+
}) %>
|
19
10
|
<% end %>
|
20
|
-
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="pb_timeline_item_step">
|
14
|
+
<%= pb_rails("icon_circle", props: {
|
15
|
+
icon: object.icon,
|
16
|
+
variant: object.icon_color,
|
17
|
+
size: "xs"
|
18
|
+
}) %>
|
19
|
+
<div class="pb_timeline_item_connector"></div>
|
20
|
+
</div>
|
21
|
+
|
22
|
+
<div class="pb_timeline_item_right_block">
|
23
|
+
<%= content.presence %>
|
24
|
+
</div>
|
21
25
|
<% end %>
|