playbook_ui 7.4.0.pre.alpha5 → 7.4.0.pre.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/images/clark.jpg +0 -0
- data/app/assets/images/giant.jpg +0 -0
- data/app/assets/images/{pb-logo.svg → pb.logo.svg} +2 -2
- data/app/pb_kits/playbook/_playbook.scss +1 -4
- data/app/pb_kits/playbook/data/menu.yml +2 -3
- data/app/pb_kits/playbook/index.js +2 -3
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.html.erb +3 -2
- data/app/pb_kits/playbook/pb_checkbox/_checkbox.jsx +2 -1
- data/app/pb_kits/playbook/pb_checkbox/checkbox.rb +4 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_checkbox_default.html.erb +5 -2
- data/app/pb_kits/playbook/pb_date/_date.html.erb +8 -64
- data/app/pb_kits/playbook/pb_date/_date.jsx +66 -115
- data/app/pb_kits/playbook/pb_date/_date.scss +0 -30
- data/app/pb_kits/playbook/pb_date/date.rb +9 -20
- data/app/pb_kits/playbook/pb_date/docs/_date_default.html.erb +6 -21
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +12 -43
- data/app/pb_kits/playbook/pb_date/docs/example.yml +0 -4
- data/app/pb_kits/playbook/pb_date/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_date_picker/_date_picker.html.erb +14 -19
- data/app/pb_kits/playbook/pb_flex/_flex.jsx +1 -1
- data/app/pb_kits/playbook/pb_flex/_flex.scss +0 -4
- data/app/pb_kits/playbook/pb_flex/flex.rb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +1 -52
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_simple_form_validate.html.erb +1 -1
- data/app/pb_kits/playbook/pb_form/form_builder/date_picker_field.rb +1 -19
- data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +1 -1
- data/app/pb_kits/playbook/pb_list/_list.jsx +9 -2
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.jsx +1 -3
- data/app/pb_kits/playbook/pb_progress_step/_progress_step.scss +4 -13
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.html.erb +1 -1
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.jsx +7 -5
- data/app/pb_kits/playbook/pb_progress_step/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_progress_step/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_progress_step/progress_step.rb +3 -5
- data/app/pb_kits/playbook/pb_progress_step/progress_step_item.rb +0 -6
- data/app/pb_kits/playbook/pb_radio/_radio.jsx +0 -3
- data/app/pb_kits/playbook/pb_selectable_list/_item.jsx +90 -0
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.html.erb +11 -0
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.jsx +47 -0
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list.scss +17 -0
- data/app/pb_kits/playbook/pb_selectable_list/_selectable_list_item.html.erb +18 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_description.md +3 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_selectable_list_checkbox.html.erb +30 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_selectable_list_checkbox.jsx +32 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_selectable_list_radio.html.erb +30 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/_selectable_list_radio.jsx +32 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/example.yml +12 -0
- data/app/pb_kits/playbook/pb_selectable_list/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list.rb +24 -0
- data/app/pb_kits/playbook/pb_selectable_list/selectable_list_item.rb +28 -0
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.html.erb +1 -13
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.jsx +20 -96
- data/app/pb_kits/playbook/pb_timestamp/_timestamp.scss +1 -12
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.html.erb +1 -21
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default.jsx +4 -31
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +0 -14
- data/app/pb_kits/playbook/pb_timestamp/docs/index.js +0 -7
- data/app/pb_kits/playbook/pb_timestamp/timestamp.rb +1 -67
- data/app/pb_kits/playbook/pb_tooltip/_tooltip.scss +19 -46
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +10 -46
- data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_white.html.erb +4 -4
- data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +2 -3
- data/app/pb_kits/playbook/pb_typeahead/_typeahead.jsx +2 -14
- data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.jsx +15 -8
- data/app/pb_kits/playbook/pb_typeahead/components/Option.jsx +6 -1
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.html.erb +4 -10
- data/app/pb_kits/playbook/pb_typeahead/docs/_typeahead_with_pills.md +4 -20
- data/app/pb_kits/playbook/pb_typeahead/typeahead.rb +0 -4
- data/app/pb_kits/playbook/vendor.js +0 -3
- data/lib/playbook/version.rb +1 -1
- metadata +20 -75
- data/app/assets/images/github-brands.svg +0 -1
- data/app/assets/images/landing-background.svg +0 -36
- data/app/assets/images/landing-image.svg +0 -203
- data/app/assets/images/pb-white-logo.svg +0 -15
- data/app/pb_kits/playbook/pb_background/_background.html.erb +0 -14
- data/app/pb_kits/playbook/pb_background/_background.jsx +0 -63
- data/app/pb_kits/playbook/pb_background/_background.scss +0 -35
- data/app/pb_kits/playbook/pb_background/background.rb +0 -35
- data/app/pb_kits/playbook/pb_background/docs/_background_dark.html.erb +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_dark.jsx +0 -13
- data/app/pb_kits/playbook/pb_background/docs/_background_gradient.html.erb +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_gradient.jsx +0 -13
- data/app/pb_kits/playbook/pb_background/docs/_background_image.html.erb +0 -13
- data/app/pb_kits/playbook/pb_background/docs/_background_image.jsx +0 -30
- data/app/pb_kits/playbook/pb_background/docs/_background_light.html.erb +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_light.jsx +0 -13
- data/app/pb_kits/playbook/pb_background/docs/_background_white.html.erb +0 -3
- data/app/pb_kits/playbook/pb_background/docs/_background_white.jsx +0 -14
- data/app/pb_kits/playbook/pb_background/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_background/docs/example.yml +0 -15
- data/app/pb_kits/playbook/pb_background/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.html.erb +0 -9
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.jsx +0 -77
- data/app/pb_kits/playbook/pb_collapsible/_collapsible.scss +0 -17
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.jsx +0 -40
- data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.jsx +0 -58
- data/app/pb_kits/playbook/pb_collapsible/child_kits/_collapsible_content.html.erb +0 -7
- data/app/pb_kits/playbook/pb_collapsible/child_kits/_collapsible_main.html.erb +0 -16
- data/app/pb_kits/playbook/pb_collapsible/collapsible.rb +0 -15
- data/app/pb_kits/playbook/pb_collapsible/collapsible_content.rb +0 -21
- data/app/pb_kits/playbook/pb_collapsible/collapsible_main.rb +0 -24
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_dark.html.erb +0 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_dark.jsx +0 -17
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.html.erb +0 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +0 -19
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +0 -9
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_collapsible/index.js +0 -82
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.html.erb +0 -24
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +0 -35
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.html.erb +0 -27
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +0 -43
- data/app/pb_kits/playbook/pb_date_time/_date_time.html.erb +0 -31
- data/app/pb_kits/playbook/pb_date_time/_date_time.jsx +0 -73
- data/app/pb_kits/playbook/pb_date_time/_date_time.scss +0 -26
- data/app/pb_kits/playbook/pb_date_time/date_time.rb +0 -29
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_align.html.erb +0 -17
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_align.jsx +0 -35
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default.html.erb +0 -20
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default.jsx +0 -38
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size.html.erb +0 -26
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size.jsx +0 -75
- data/app/pb_kits/playbook/pb_date_time/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +0 -11
- data/app/pb_kits/playbook/pb_date_time/docs/index.js +0 -3
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_custom_icon.html.erb +0 -12
- data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tracker_click_events.jsx +0 -48
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.html.erb +0 -69
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align.jsx +0 -91
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.html.erb +0 -14
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed.jsx +0 -27
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed_align.html.erb +0 -54
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed_align.jsx +0 -73
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.html.erb +0 -59
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones.jsx +0 -74
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones_align.html.erb +0 -177
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones_align.jsx +0 -209
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.html.erb +0 -35
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated.jsx +0 -51
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_align.html.erb +0 -123
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_align.jsx +0 -146
- data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.jsx +0 -20
@@ -1,13 +0,0 @@
|
|
1
|
-
<%= pb_rails("background", props: { image_url: "https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80", padding: "lg" }) do %>
|
2
|
-
<%= pb_rails("flex", props: { horizontal: "center", orientation: "column" }) do %>
|
3
|
-
<%= pb_rails("flex/flex_item") do %>
|
4
|
-
<%= pb_rails("title", props: { dark: true, size: 1, text: "Background Kit Image" })%>
|
5
|
-
<% end %>
|
6
|
-
<%= pb_rails("flex/flex_item", props: { padding: "lg" }) do %>
|
7
|
-
<%= pb_rails("card", props: { shadow: "deepest" }) do %>
|
8
|
-
We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own.
|
9
|
-
-Cesar Chavez
|
10
|
-
<% end %>
|
11
|
-
<% end %>
|
12
|
-
<% end %>
|
13
|
-
<% end %>
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Background } from '../..'
|
3
|
-
import { Card, Flex, FlexItem, Title } from '../..'
|
4
|
-
|
5
|
-
const BackgroundImage = () => (
|
6
|
-
<div>
|
7
|
-
<Background imageUrl="https://images.unsplash.com/photo-1528459801416-a9e53bbf4e17?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1000&q=80">
|
8
|
-
<Flex
|
9
|
-
orientation="column"
|
10
|
-
vertical="center"
|
11
|
-
>
|
12
|
-
<FlexItem>
|
13
|
-
<Title
|
14
|
-
dark
|
15
|
-
padding="lg"
|
16
|
-
size={1}
|
17
|
-
text="Background Kit Image"
|
18
|
-
/>
|
19
|
-
</FlexItem>
|
20
|
-
<FlexItem padding="lg">
|
21
|
-
<Card shadow="deepest">
|
22
|
-
{'We cannot seek achievement for ourselves and forget about progress and prosperity for our community... Our ambitions must be broad enough to include the aspirations and needs of others, for their sakes and for our own. - Cesar Chavez'}
|
23
|
-
</Card>
|
24
|
-
</FlexItem>
|
25
|
-
</Flex>
|
26
|
-
</Background>
|
27
|
-
</div>
|
28
|
-
)
|
29
|
-
|
30
|
-
export default BackgroundImage
|
@@ -1 +0,0 @@
|
|
1
|
-
The background kit is used for adding a background to a page or to any container. Instead of adding a custom class to give something a background, you can now wrap the elements in the background kit and use the `background_color` prop to assign its color. The colors that you can choose from for the `background_color` prop are: gradient, dark, light, and white.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
examples:
|
2
|
-
|
3
|
-
rails:
|
4
|
-
- background_light: Light
|
5
|
-
- background_white: White
|
6
|
-
- background_dark: Dark
|
7
|
-
- background_gradient: Gradient
|
8
|
-
- background_image: Image
|
9
|
-
|
10
|
-
react:
|
11
|
-
- background_light: Light
|
12
|
-
- background_white: White
|
13
|
-
- background_dark: Dark
|
14
|
-
- background_gradient: Gradient
|
15
|
-
- background_image: Image
|
@@ -1,6 +0,0 @@
|
|
1
|
-
export { default as BackgroundLight } from './_background_light.jsx'
|
2
|
-
export { default as BackgroundWhite } from './_background_white.jsx'
|
3
|
-
export { default as BackgroundDark } from './_background_dark.jsx'
|
4
|
-
export { default as BackgroundGradient } from './_background_gradient.jsx'
|
5
|
-
export { default as BackgroundImage } from './_background_image.jsx'
|
6
|
-
|
@@ -1,77 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import classnames from 'classnames'
|
4
|
-
import React, { useState } from 'react'
|
5
|
-
import { globalProps } from '../utilities/globalProps.js'
|
6
|
-
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
7
|
-
import CollapsibleContent from './child_kits/CollapsibleContent'
|
8
|
-
import CollapsibleMain from './child_kits/CollapsibleMain'
|
9
|
-
|
10
|
-
export const CollapsibleContext = React.createContext({})
|
11
|
-
|
12
|
-
type CollapsibleProps = {
|
13
|
-
children: React.ChildrenArray<React.Element<typeof Main | Content>>,
|
14
|
-
aria?: object,
|
15
|
-
className?: string,
|
16
|
-
collapsed?: boolean,
|
17
|
-
data?: object,
|
18
|
-
id?: string,
|
19
|
-
padding?: string,
|
20
|
-
}
|
21
|
-
|
22
|
-
const useCollapsible = (initial = false) => {
|
23
|
-
const [collapsed, setCollapsed] = useState(initial)
|
24
|
-
|
25
|
-
return [
|
26
|
-
collapsed,
|
27
|
-
() => setCollapsed((t) => !t),
|
28
|
-
]
|
29
|
-
}
|
30
|
-
|
31
|
-
const Collapsible = ({
|
32
|
-
aria = {},
|
33
|
-
className,
|
34
|
-
children = [],
|
35
|
-
collapsed = true,
|
36
|
-
data = {},
|
37
|
-
id,
|
38
|
-
padding = 'md',
|
39
|
-
...props
|
40
|
-
}: CollapsibleProps) => {
|
41
|
-
const [isCollapsed, collapse] = useCollapsible(collapsed)
|
42
|
-
const Main = React.Children.toArray(children).find((child) => child.type === CollapsibleMain)
|
43
|
-
const Content = React.Children.toArray(children).find((child) => child.type === CollapsibleContent)
|
44
|
-
const { children: mainChildren, ...mainProps } = Main.props
|
45
|
-
const { children: contentChildren, ...contentProps } = Content.props
|
46
|
-
const ariaProps = buildAriaProps(aria)
|
47
|
-
const dataProps = buildDataProps(data)
|
48
|
-
const classes = classnames(
|
49
|
-
buildCss('pb_collapsible'),
|
50
|
-
className,
|
51
|
-
globalProps(props, { padding })
|
52
|
-
)
|
53
|
-
|
54
|
-
return (
|
55
|
-
<CollapsibleContext.Provider value={{ collapsed: isCollapsed, collapse }}>
|
56
|
-
<div
|
57
|
-
{...ariaProps}
|
58
|
-
{...dataProps}
|
59
|
-
className={classes}
|
60
|
-
id={id}
|
61
|
-
>
|
62
|
-
<CollapsibleMain {...mainProps}>
|
63
|
-
{mainChildren}
|
64
|
-
</CollapsibleMain>
|
65
|
-
|
66
|
-
<CollapsibleContent {...contentProps}>
|
67
|
-
{contentChildren}
|
68
|
-
</CollapsibleContent>
|
69
|
-
</div>
|
70
|
-
</CollapsibleContext.Provider>
|
71
|
-
)
|
72
|
-
}
|
73
|
-
|
74
|
-
Collapsible.Main = CollapsibleMain
|
75
|
-
Collapsible.Content = CollapsibleContent
|
76
|
-
|
77
|
-
export default Collapsible
|
@@ -1,17 +0,0 @@
|
|
1
|
-
|
2
|
-
[class^=pb_collapsible_kit] {
|
3
|
-
|
4
|
-
.toggle-content {
|
5
|
-
display: none;
|
6
|
-
height: 0;
|
7
|
-
padding-bottom: 0 !important;
|
8
|
-
padding-top: 0 !important;
|
9
|
-
overflow: hidden;
|
10
|
-
transition: height 300ms, padding 300ms ease-in-out;
|
11
|
-
}
|
12
|
-
|
13
|
-
.toggle-content.is-visible {
|
14
|
-
display: block;
|
15
|
-
height: auto;
|
16
|
-
}
|
17
|
-
}
|
@@ -1,40 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import classnames from 'classnames'
|
4
|
-
import React, { useContext } from 'react'
|
5
|
-
import AnimateHeight from 'react-animate-height'
|
6
|
-
import { buildCss } from '../../utilities/props'
|
7
|
-
import { globalProps } from '../../utilities/globalProps.js'
|
8
|
-
|
9
|
-
import { CollapsibleContext } from '../_collapsible.jsx'
|
10
|
-
|
11
|
-
type CollapsibleContentProps = {
|
12
|
-
children: array<React.ReactNode> | React.ReactNode | string,
|
13
|
-
className?: string,
|
14
|
-
padding?: string,
|
15
|
-
}
|
16
|
-
|
17
|
-
const CollapsibleContent = ({
|
18
|
-
children,
|
19
|
-
className,
|
20
|
-
padding = 'md',
|
21
|
-
...props
|
22
|
-
}: CollapsibleContentProps) => {
|
23
|
-
const context = useContext(CollapsibleContext)
|
24
|
-
const contentCSS = buildCss('pb_collapsible_content_kit')
|
25
|
-
const contentSpacing = globalProps(props, { padding })
|
26
|
-
|
27
|
-
return (
|
28
|
-
<div className={classnames(contentCSS, className, contentSpacing)}>
|
29
|
-
<AnimateHeight
|
30
|
-
duration={300}
|
31
|
-
height={context.collapsed ? 0 : 'auto'}
|
32
|
-
id="bottom-section"
|
33
|
-
>
|
34
|
-
{children}
|
35
|
-
</AnimateHeight>
|
36
|
-
</div>
|
37
|
-
)
|
38
|
-
}
|
39
|
-
|
40
|
-
export default CollapsibleContent
|
@@ -1,58 +0,0 @@
|
|
1
|
-
/* @flow */
|
2
|
-
|
3
|
-
import classnames from 'classnames'
|
4
|
-
import { Flex, FlexItem } from '../../'
|
5
|
-
import React, { useContext } from 'react'
|
6
|
-
import { buildCss } from '../../utilities/props'
|
7
|
-
import { globalProps } from '../../utilities/globalProps.js'
|
8
|
-
import { CollapsibleContext } from '../_collapsible.jsx'
|
9
|
-
|
10
|
-
type CollapsibleMainProps = {
|
11
|
-
children: array<React.ReactNode> | React.ReactNode,
|
12
|
-
className?: string,
|
13
|
-
padding?: string,
|
14
|
-
}
|
15
|
-
|
16
|
-
type IconProps = {
|
17
|
-
collapsed: boolean
|
18
|
-
}
|
19
|
-
|
20
|
-
const Icon = ({ collapsed }: IconProps) => {
|
21
|
-
const direction = collapsed ? 'down' : 'up'
|
22
|
-
|
23
|
-
return (
|
24
|
-
<div
|
25
|
-
key={direction}
|
26
|
-
style={{ verticalAlign: 'middle' }}
|
27
|
-
>
|
28
|
-
<i className={`far fa-chevron-${direction} fa-fw`} />
|
29
|
-
</div>
|
30
|
-
)
|
31
|
-
}
|
32
|
-
|
33
|
-
const CollapsibleMain = ({
|
34
|
-
children,
|
35
|
-
className,
|
36
|
-
padding = 'md',
|
37
|
-
...props
|
38
|
-
}: CollapsibleMainProps) => {
|
39
|
-
const context = useContext(CollapsibleContext)
|
40
|
-
const mainCSS = buildCss('pb_collapsible_main_kit')
|
41
|
-
const mainSpacing = globalProps(props, { padding })
|
42
|
-
|
43
|
-
return (
|
44
|
-
<div className={classnames(mainCSS, className, mainSpacing)}>
|
45
|
-
<div onClick={() => context.collapse()}>
|
46
|
-
<Flex
|
47
|
-
spacing="between"
|
48
|
-
vertical="center"
|
49
|
-
>
|
50
|
-
<FlexItem>{children}</FlexItem>
|
51
|
-
<FlexItem><Icon collapsed={context.collapsed} /></FlexItem>
|
52
|
-
</Flex>
|
53
|
-
</div>
|
54
|
-
</div>
|
55
|
-
)
|
56
|
-
}
|
57
|
-
|
58
|
-
export default CollapsibleMain
|
@@ -1,16 +0,0 @@
|
|
1
|
-
<%= content_tag(:div,
|
2
|
-
id: object.id,
|
3
|
-
data: object.data,
|
4
|
-
class: object.classname,
|
5
|
-
aria: object.aria) do %>
|
6
|
-
|
7
|
-
<%= pb_rails("flex", props: {vertical: "center", spacing: "between"}) do %>
|
8
|
-
<%= pb_rails("flex/flex_item") do %>
|
9
|
-
<%= capture(&object.children) %>
|
10
|
-
<% end %>
|
11
|
-
<%= pb_rails("flex/flex_item") do %>
|
12
|
-
<i class="far fa-chevron-down"></i>
|
13
|
-
<i class="far fa-chevron-up" style="display: none"></i>
|
14
|
-
<% end %>
|
15
|
-
<% end %>
|
16
|
-
<% end %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbCollapsible
|
5
|
-
class CollapsibleContent
|
6
|
-
include Playbook::Props
|
7
|
-
|
8
|
-
partial "pb_collapsible/child_kits/collapsible_content"
|
9
|
-
|
10
|
-
def data
|
11
|
-
Hash(values[:data]).merge(
|
12
|
-
collapsible_content: true
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
|
-
def classname
|
17
|
-
generate_classname("pb_collapsible_content_kit", "toggle-content", padding, separator: " ")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Playbook
|
4
|
-
module PbCollapsible
|
5
|
-
class CollapsibleMain
|
6
|
-
include Playbook::Props
|
7
|
-
|
8
|
-
partial "pb_collapsible/child_kits/collapsible_main"
|
9
|
-
|
10
|
-
def data
|
11
|
-
Hash(values[:data]).merge(
|
12
|
-
collapsible_main: true
|
13
|
-
)
|
14
|
-
end
|
15
|
-
|
16
|
-
def classname
|
17
|
-
generate_classname("pb_collapsible_main_kit", padding, separator: " ")
|
18
|
-
end
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<%= pb_rails("collapsible", props: { dark: true }) do %>
|
2
|
-
<%= pb_rails("collapsible/collapsible_main", props: { padding: "md", name: "dark-example" }) do %>
|
3
|
-
<%= pb_rails("body", props: { text: "Main Section", dark: true}) %>
|
4
|
-
<% end %>
|
5
|
-
<%= pb_rails("collapsible/collapsible_content", props: { padding: "md" }) do %>
|
6
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at.
|
7
|
-
<br><br>
|
8
|
-
Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.
|
9
|
-
<% end %>
|
10
|
-
<% end %>
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { Collapsible } from '../..'
|
3
|
-
|
4
|
-
const CollapsibleDark = () => (
|
5
|
-
<div>
|
6
|
-
<Collapsible>
|
7
|
-
<Collapsible.Main>
|
8
|
-
<div>{'Main Section'}</div>
|
9
|
-
</Collapsible.Main>
|
10
|
-
<Collapsible.Content>
|
11
|
-
<div>{'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit. Nulla facilisi. Vestibulum quis pretium nulla. Nulla ut accumsan velit. Duis varius urna sed sem tempor, sit amet fermentum nibh auctor. Praesent lorem arcu, egestas non ante quis, placerat pellentesque lectus.Vestibulum lacinia ipsum quis venenatis tristique. Vivamus suscipit, libero eu fringilla egestas, orci urna commodo arcu, vel gravida turpis ipsum molestie nibh. Donec cursus eu ante sagittis ultrices. Phasellus id sagittis risus. Mauris dapibus neque faucibus, tempor ligula vel, cursus ante. Donec faucibus gravida porta. Nullam egestas est quis aliquam feugiat. Sed eget metus diam. Cras eget placerat libero.'}</div>
|
12
|
-
</Collapsible.Content>
|
13
|
-
</Collapsible>
|
14
|
-
</div>
|
15
|
-
)
|
16
|
-
|
17
|
-
export default CollapsibleDark
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<%= pb_rails("collapsible", props: { name: "default-example" }) do %>
|
2
|
-
<%= pb_rails("collapsible/collapsible_main", props: { padding: "md", name: "default-main" }) do %>
|
3
|
-
<%= pb_rails("body", props: { text: "Main Section"}) %>
|
4
|
-
<% end %>
|
5
|
-
<%= pb_rails("collapsible/collapsible_content", props: { padding: "md" }) do %>
|
6
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis, risus a fringilla luctus, sapien eros sodales ex, quis molestie est nulla non turpis. Vestibulum aliquet at ipsum eget posuere. Morbi sed laoreet erat. Sed commodo posuere lectus, at porta nulla ornare a. Suspendisse quam est, sollicitudin ut enim sit amet, commodo placerat enim. Donec laoreet metus ac mauris pellentesque mattis. Pellentesque luctus vel mauris non aliquam. Mauris hendrerit mattis porttitor. Curabitur vehicula justo non ex consectetur commodo. Quisque posuere aliquet quam. Maecenas malesuada magna mauris, ac tempor metus euismod at.
|
7
|
-
<br><br>
|
8
|
-
Cras ornare fermentum magna mollis efficitur. Sed vitae nulla vel purus ultrices mollis. Maecenas id nulla id libero faucibus feugiat quis sit amet turpis. In commodo pellentesque risus at fringilla. Integer non interdum leo, non commodo ante. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mi augue, dignissim at orci vel, egestas aliquam mi. Proin finibus aliquet tempor. Integer cursus, ex quis gravida rhoncus, nisi elit viverra ipsum, non efficitur est ex ac tortor. Praesent vitae odio massa.
|
9
|
-
<% end %>
|
10
|
-
<% end %>
|