playbook_ui 14.5.0.pre.alpha.play1586datearea4115 → 14.5.0.pre.alpha.psych4support3941
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_advanced_table/index.js +0 -60
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +9 -1
- data/app/pb_kits/playbook/pb_advanced_table/table_subrow_header.html.erb +9 -1
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +4 -20
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownOption.tsx +1 -1
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/DropdownTrigger.tsx +2 -2
- data/app/pb_kits/playbook/pb_filter/Filter/ResultsCount.tsx +2 -4
- data/app/pb_kits/playbook/pb_filter/docs/_filter_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +1 -9
- data/app/pb_kits/playbook/pb_form_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_form_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +227 -211
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_default.jsx +1 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_multi_level_select/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_timeline/_item.tsx +23 -59
- 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/pb_typeahead/_typeahead.tsx +1 -4
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +1 -3
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +1 -3
- data/dist/chunks/{_typeahead-C9g4qCcE.js → _typeahead-BYw0HEgO.js} +1 -1
- data/dist/chunks/_weekday_stacked-DumiyWjh.js +45 -0
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +4 -29
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.jsx +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_clear_selection.md +0 -1
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +0 -19
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +0 -27
- data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/context/index.tsx +0 -5
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.html.erb +0 -93
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_reset.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.jsx +0 -105
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.jsx +0 -106
- data/app/pb_kits/playbook/pb_multi_level_select/docs/_multi_level_select_with_children_with_radios.md +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select_options.tsx +0 -149
- data/app/pb_kits/playbook/pb_timeline/_date_area.tsx +0 -38
- data/app/pb_kits/playbook/pb_timeline/_detail_area.tsx +0 -29
- data/app/pb_kits/playbook/pb_timeline/_node_area.tsx +0 -42
- data/app/pb_kits/playbook/pb_timeline/date_area.html.erb +0 -12
- data/app/pb_kits/playbook/pb_timeline/date_area.rb +0 -13
- data/app/pb_kits/playbook/pb_timeline/detail_area.html.erb +0 -3
- data/app/pb_kits/playbook/pb_timeline/detail_area.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 -72
- data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md +0 -4
- data/app/pb_kits/playbook/pb_timeline/node_area.html.erb +0 -14
- data/app/pb_kits/playbook/pb_timeline/node_area.rb +0 -16
- data/dist/chunks/_weekday_stacked-C2sJArua.js +0 -45
@@ -1 +0,0 @@
|
|
1
|
-
The MultiLevelSelect subcomponent structure is also available in the 'Single Select' variant. In this variant, the children will be rendered to the right of the Radios and their labels.
|
@@ -1,149 +0,0 @@
|
|
1
|
-
import React, {useContext} from "react";
|
2
|
-
import classnames from "classnames";
|
3
|
-
import MultiLevelSelectContext from "./context";
|
4
|
-
import { globalProps, GlobalProps } from "../utilities/globalProps";
|
5
|
-
import {
|
6
|
-
buildAriaProps,
|
7
|
-
buildCss,
|
8
|
-
buildDataProps,
|
9
|
-
buildHtmlProps,
|
10
|
-
} from "../utilities/props";
|
11
|
-
import Checkbox from "../pb_checkbox/_checkbox";
|
12
|
-
import Radio from "../pb_radio/_radio";
|
13
|
-
import CircleIconButton from "../pb_circle_icon_button/_circle_icon_button";
|
14
|
-
import Body from "../pb_body/_body";
|
15
|
-
|
16
|
-
type MultiLevelSelectOptionsProps = {
|
17
|
-
aria?: { [key: string]: string },
|
18
|
-
children?: React.ReactNode | ((item: any) => React.ReactNode),
|
19
|
-
className?: string,
|
20
|
-
dark?: boolean,
|
21
|
-
data?: { [key: string]: string },
|
22
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
23
|
-
} & GlobalProps;
|
24
|
-
|
25
|
-
const MultiLevelSelectOptions = ({
|
26
|
-
children,
|
27
|
-
items,
|
28
|
-
...props
|
29
|
-
}: MultiLevelSelectOptionsProps) => {
|
30
|
-
const {
|
31
|
-
variant,
|
32
|
-
inputName,
|
33
|
-
renderNestedOptions,
|
34
|
-
isTreeRowExpanded,
|
35
|
-
handleToggleClick,
|
36
|
-
handleRadioButtonClick,
|
37
|
-
handledropdownItemClick,
|
38
|
-
filterItem,
|
39
|
-
} = useContext(MultiLevelSelectContext)
|
40
|
-
|
41
|
-
const {
|
42
|
-
aria = {},
|
43
|
-
className,
|
44
|
-
data = {},
|
45
|
-
htmlOptions = {},
|
46
|
-
} = props;
|
47
|
-
|
48
|
-
const ariaProps = buildAriaProps(aria);
|
49
|
-
const dataProps = buildDataProps(data);
|
50
|
-
const htmlProps = buildHtmlProps(htmlOptions);
|
51
|
-
const classes = classnames(
|
52
|
-
buildCss("pb_multi_level_select_options"),
|
53
|
-
globalProps(props),
|
54
|
-
className
|
55
|
-
);
|
56
|
-
|
57
|
-
return (
|
58
|
-
<ul
|
59
|
-
{...ariaProps}
|
60
|
-
{...dataProps}
|
61
|
-
{...htmlProps}
|
62
|
-
className={classes}
|
63
|
-
>
|
64
|
-
{Array.isArray(items) &&
|
65
|
-
items.map((item: { [key: string]: any }) => {
|
66
|
-
return (
|
67
|
-
<div key={item.id}>
|
68
|
-
<li className={"dropdown_item"}
|
69
|
-
data-name={item.id}
|
70
|
-
>
|
71
|
-
<div className="dropdown_item_checkbox_row">
|
72
|
-
{!item.parent_id && !item.children ? null : (
|
73
|
-
<div
|
74
|
-
key={
|
75
|
-
isTreeRowExpanded(item)
|
76
|
-
? "chevron-down"
|
77
|
-
: "chevron-right"
|
78
|
-
}
|
79
|
-
>
|
80
|
-
<CircleIconButton
|
81
|
-
className={
|
82
|
-
item.children && item.children.length > 0
|
83
|
-
? ""
|
84
|
-
: "toggle_icon"
|
85
|
-
}
|
86
|
-
icon={
|
87
|
-
isTreeRowExpanded(item)
|
88
|
-
? "chevron-down"
|
89
|
-
: "chevron-right"
|
90
|
-
}
|
91
|
-
onClick={(event: React.MouseEvent) =>
|
92
|
-
handleToggleClick(item.id, event)
|
93
|
-
}
|
94
|
-
variant="link"
|
95
|
-
/>
|
96
|
-
</div>
|
97
|
-
)}
|
98
|
-
{variant === "single" ? (
|
99
|
-
item.hideRadio ? (
|
100
|
-
<Body>{item.label}</Body>
|
101
|
-
) : (
|
102
|
-
<Radio
|
103
|
-
checked={item.checked}
|
104
|
-
id={`${item.id}-${item.label}`}
|
105
|
-
label={item.label}
|
106
|
-
name={inputName}
|
107
|
-
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
108
|
-
handleRadioButtonClick(e)
|
109
|
-
}
|
110
|
-
padding={item.children ? "none" : "xs"}
|
111
|
-
type="radio"
|
112
|
-
value={item.label}
|
113
|
-
/>
|
114
|
-
)
|
115
|
-
) : (
|
116
|
-
<Checkbox id={item.id}
|
117
|
-
text={item.label}
|
118
|
-
>
|
119
|
-
<input
|
120
|
-
checked={item.checked}
|
121
|
-
name={item.label}
|
122
|
-
onChange={(e) => {
|
123
|
-
handledropdownItemClick(e, !item.checked);
|
124
|
-
}}
|
125
|
-
type="checkbox"
|
126
|
-
value={item.label}
|
127
|
-
/>
|
128
|
-
</Checkbox>
|
129
|
-
)}
|
130
|
-
{/* Render children next to the checkbox */}
|
131
|
-
{children && (
|
132
|
-
typeof children === "function" ? children(item) : children
|
133
|
-
)}
|
134
|
-
</div>
|
135
|
-
{isTreeRowExpanded(item) &&
|
136
|
-
item.children &&
|
137
|
-
item.children.length > 0 &&
|
138
|
-
(variant === "single" || !filterItem) && (
|
139
|
-
<div>{renderNestedOptions(item.children)}</div>
|
140
|
-
)}
|
141
|
-
</li>
|
142
|
-
</div>
|
143
|
-
);
|
144
|
-
})}
|
145
|
-
</ul>
|
146
|
-
);
|
147
|
-
};
|
148
|
-
|
149
|
-
export default MultiLevelSelectOptions;
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
import { buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps, GlobalProps } from "../utilities/globalProps"
|
5
|
-
import DateStacked from '../pb_date_stacked/_date_stacked'
|
6
|
-
|
7
|
-
type TimelineDateAreaProps = {
|
8
|
-
date?: Date,
|
9
|
-
children?: React.ReactNode,
|
10
|
-
className?: string,
|
11
|
-
htmlOptions?: { [key: string]: any },
|
12
|
-
} & GlobalProps
|
13
|
-
|
14
|
-
const TimelineDateArea: React.FC<TimelineDateAreaProps> = ({
|
15
|
-
date,
|
16
|
-
children,
|
17
|
-
className,
|
18
|
-
htmlOptions = {},
|
19
|
-
...props
|
20
|
-
}) => {
|
21
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
22
|
-
return (
|
23
|
-
<div
|
24
|
-
{...htmlProps}
|
25
|
-
className={classnames('pb_timeline_item_left_block', globalProps(props), className)}
|
26
|
-
>
|
27
|
-
{children}
|
28
|
-
{date && (
|
29
|
-
<DateStacked align="center"
|
30
|
-
date={date}
|
31
|
-
size="sm"
|
32
|
-
/>
|
33
|
-
)}
|
34
|
-
</div>
|
35
|
-
)
|
36
|
-
}
|
37
|
-
|
38
|
-
export default TimelineDateArea
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
import { buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps, GlobalProps } from "../utilities/globalProps"
|
5
|
-
|
6
|
-
type TimelineDetailAreaProps = {
|
7
|
-
children?: React.ReactNode,
|
8
|
-
className?: string,
|
9
|
-
htmlOptions?: { [key: string]: any },
|
10
|
-
} & GlobalProps
|
11
|
-
|
12
|
-
const TimelineDetailArea: React.FC<TimelineDetailAreaProps> = ({
|
13
|
-
children,
|
14
|
-
className,
|
15
|
-
htmlOptions = {},
|
16
|
-
...props
|
17
|
-
}) => {
|
18
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
19
|
-
return (
|
20
|
-
<div
|
21
|
-
{...htmlProps}
|
22
|
-
className={classnames('pb_timeline_item_right_block', globalProps(props), className)}
|
23
|
-
>
|
24
|
-
{children}
|
25
|
-
</div>
|
26
|
-
)
|
27
|
-
}
|
28
|
-
|
29
|
-
export default TimelineDetailArea
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import classnames from 'classnames'
|
3
|
-
import { buildHtmlProps } from '../utilities/props'
|
4
|
-
import { globalProps, GlobalProps } from "../utilities/globalProps"
|
5
|
-
import IconCircle from '../pb_icon_circle/_icon_circle'
|
6
|
-
|
7
|
-
type TimelineNodeAreaProps = {
|
8
|
-
icon?: string,
|
9
|
-
iconColor?: 'default' | 'royal' | 'blue' | 'purple' | 'teal' | 'red' | 'yellow' | 'green',
|
10
|
-
children?: React.ReactNode,
|
11
|
-
className?: string,
|
12
|
-
htmlOptions?: { [key: string]: any },
|
13
|
-
} & GlobalProps
|
14
|
-
|
15
|
-
const TimelineNodeArea: React.FC<TimelineNodeAreaProps> = ({
|
16
|
-
icon = 'user',
|
17
|
-
iconColor = 'default',
|
18
|
-
children,
|
19
|
-
className,
|
20
|
-
htmlOptions = {},
|
21
|
-
...props
|
22
|
-
}) => {
|
23
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
24
|
-
return (
|
25
|
-
<div
|
26
|
-
{...htmlProps}
|
27
|
-
className={classnames('pb_timeline_item_step', globalProps(props), className)}
|
28
|
-
>
|
29
|
-
{children ? (
|
30
|
-
children
|
31
|
-
) : (
|
32
|
-
<IconCircle icon={icon}
|
33
|
-
size="xs"
|
34
|
-
variant={iconColor}
|
35
|
-
/>
|
36
|
-
)}
|
37
|
-
<div className="pb_timeline_item_connector" />
|
38
|
-
</div>
|
39
|
-
)
|
40
|
-
}
|
41
|
-
|
42
|
-
export default TimelineNodeArea
|
@@ -1,43 +0,0 @@
|
|
1
|
-
<%= pb_rails("timeline", props: {orientation: "horizontal", show_date: true}) do %>
|
2
|
-
<%= pb_rails("timeline/item", props: { line_style: "solid"}) do |item| %>
|
3
|
-
|
4
|
-
<% item.date_area do %>
|
5
|
-
<%= pb_rails("timeline/date_area") do %>
|
6
|
-
<%= pb_rails("title", props: { text: "Any Kit Here", size: 2 }) %>
|
7
|
-
<% end %>
|
8
|
-
<% end %>
|
9
|
-
|
10
|
-
<% item.node_area do %>
|
11
|
-
<%= pb_rails("timeline/node_area", props: { icon: 'check', icon_color: 'teal' }) %>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<% item.detail_area do %>
|
15
|
-
<%= pb_rails("title_detail", props: {
|
16
|
-
title: "Jackson Heights",
|
17
|
-
detail: "37-27 74th Street"
|
18
|
-
}) %>
|
19
|
-
<% end %>
|
20
|
-
<% end %>
|
21
|
-
<%= pb_rails("timeline/item", props: { line_style: "dotted"}) do |item| %>
|
22
|
-
|
23
|
-
<% item.node_area do %>
|
24
|
-
<%= pb_rails("timeline/node_area") do %>
|
25
|
-
<%= pb_rails("pill", props: { text: "Any Kit" , variant: "success" }) %>
|
26
|
-
<% end %>
|
27
|
-
<% end %>
|
28
|
-
|
29
|
-
<% item.detail_area do %>
|
30
|
-
<%= pb_rails("title_detail", props: {
|
31
|
-
title: "Greenpoint",
|
32
|
-
detail: "81 Gate St Brooklyn"
|
33
|
-
}) %>
|
34
|
-
<% end %>
|
35
|
-
<% end %>
|
36
|
-
|
37
|
-
<%= pb_rails("timeline/item", props: {icon: "map-marker-alt", icon_color: "purple", date: Date.today+1 }) do |item| %>
|
38
|
-
<%= pb_rails("title_detail", props: {
|
39
|
-
title: "Society Hill",
|
40
|
-
detail: "72 E St Astoria"
|
41
|
-
}) %>
|
42
|
-
<% end %>
|
43
|
-
<% end %>
|
@@ -1,72 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import Timeline from '../_timeline'
|
4
|
-
import TimelineItem from '../_item'
|
5
|
-
import TimelineDateArea from '../_date_area'
|
6
|
-
import TimelineNodeArea from '../_node_area'
|
7
|
-
import TimelineDetailArea from '../_detail_area'
|
8
|
-
import Title from '../../pb_title/_title'
|
9
|
-
import Pill from '../../pb_pill/_pill'
|
10
|
-
|
11
|
-
import TitleDetail from '../../pb_title_detail/_title_detail'
|
12
|
-
|
13
|
-
const TimelineWithChildren = (props) => (
|
14
|
-
<div>
|
15
|
-
<Timeline orientation="horizontal"
|
16
|
-
showDate
|
17
|
-
{...props}
|
18
|
-
>
|
19
|
-
<TimelineItem lineStyle="solid"
|
20
|
-
{...props}
|
21
|
-
>
|
22
|
-
<TimelineDateArea>
|
23
|
-
<Title size={2}
|
24
|
-
text='Any Kit Here'
|
25
|
-
/>
|
26
|
-
</TimelineDateArea>
|
27
|
-
<TimelineNodeArea icon="user"
|
28
|
-
iconColor="royal"
|
29
|
-
/>
|
30
|
-
<TimelineDetailArea>
|
31
|
-
<TitleDetail detail="37-27 74th Street"
|
32
|
-
title="Jackson Heights"
|
33
|
-
{...props}
|
34
|
-
/>
|
35
|
-
</TimelineDetailArea>
|
36
|
-
</TimelineItem>
|
37
|
-
|
38
|
-
<TimelineItem lineStyle="dotted"
|
39
|
-
{...props}
|
40
|
-
>
|
41
|
-
<TimelineNodeArea>
|
42
|
-
<Pill text="Any Kit"
|
43
|
-
variant="success"
|
44
|
-
/>
|
45
|
-
</TimelineNodeArea>
|
46
|
-
<TimelineDetailArea>
|
47
|
-
<TitleDetail detail="81 Gate St Brooklyn"
|
48
|
-
title="Greenpoint"
|
49
|
-
{...props}
|
50
|
-
/>
|
51
|
-
</TimelineDetailArea>
|
52
|
-
</TimelineItem>
|
53
|
-
|
54
|
-
<TimelineItem lineStyle="solid"
|
55
|
-
{...props}
|
56
|
-
>
|
57
|
-
<TimelineDateArea date={new Date(new Date().setDate(new Date().getDate() + 1))} />
|
58
|
-
<TimelineNodeArea icon="map-marker-alt"
|
59
|
-
iconColor="purple"
|
60
|
-
/>
|
61
|
-
<TimelineDetailArea>
|
62
|
-
<TitleDetail detail="72 E St Astoria"
|
63
|
-
title="Society Hill"
|
64
|
-
{...props}
|
65
|
-
/>
|
66
|
-
</TimelineDetailArea>
|
67
|
-
</TimelineItem>
|
68
|
-
</Timeline>
|
69
|
-
</div>
|
70
|
-
)
|
71
|
-
|
72
|
-
export default TimelineWithChildren
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<%= pb_content_tag do %>
|
2
|
-
<% if object.icon.present? %>
|
3
|
-
<%= pb_rails("icon_circle", props: {
|
4
|
-
icon: object.icon,
|
5
|
-
variant: object.icon_color,
|
6
|
-
size: "xs"
|
7
|
-
}) %>
|
8
|
-
<% else %>
|
9
|
-
<%= content.presence %>
|
10
|
-
<% end %>
|
11
|
-
<div class="pb_timeline_item_connector"></div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbTimeline
|
5
|
-
class NodeArea < Playbook::KitBase
|
6
|
-
prop :icon, type: Playbook::Props::String
|
7
|
-
prop :icon_color, type: Playbook::Props::Enum,
|
8
|
-
values: %w[default royal blue purple teal red yellow green],
|
9
|
-
default: "default"
|
10
|
-
|
11
|
-
def classname
|
12
|
-
generate_classname("pb_timeline_item_step")
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|