playbook_ui_docs 13.19.0.pre.alpha.PBNTR207tabledivsupport2261 → 13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2305
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_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.html.erb +32 -1
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx +38 -4
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +5 -11
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.jsx +44 -18
- data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.md +4 -8
- data/app/pb_kits/playbook/pb_table/docs/example.yml +2 -2
- data/dist/playbook-doc.js +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2cb8ae9eee907fd4eccb8287903a2602711f15004f09cde0bc868d28644c04e
|
4
|
+
data.tar.gz: a1da2d366768b65dfb07fd6c09f936fd8b3a7c3741300815bec884dceb656c8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 600de23bc1de284e9cf69f654489a4b249095f9613c69fd79b08cbab3e7582c1a519c51c478b8bf94dfdd53d3f140dd6e1673083ca49e1c4994c916c9d7cc026
|
7
|
+
data.tar.gz: e8e5dfe63ee2131a9521a52534ea6e3840b1e8eeb1ad25cb797df17155a56cd1990969d9e91e98910fe8e3a2328653cecf9e1aa3a039ab8d8d50c36ee5df5c6b
|
@@ -1,5 +1,36 @@
|
|
1
|
+
<%= pb_rails("button", props: { text: "Multiline Example", variant: "primary", data: { toast: "#toast-top-center-multi" } }) %>
|
2
|
+
|
1
3
|
<%= pb_rails("fixed_confirmation_toast", props: {
|
4
|
+
classname: "toast-to-hide",
|
5
|
+
closeable: true,
|
6
|
+
id: "toast-top-center-multi",
|
2
7
|
multi_line: true,
|
3
|
-
text: "
|
8
|
+
text: "Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.",
|
4
9
|
status: "tip",
|
10
|
+
vertical: "top",
|
11
|
+
horizontal: "center"
|
5
12
|
}) %>
|
13
|
+
|
14
|
+
<script type="text/javascript">
|
15
|
+
const alltoasts = document.queryselectorall(".toast-to-hide")
|
16
|
+
const allbuttons = document.queryselectorall("button[data-toast]")
|
17
|
+
|
18
|
+
const hidealltoasts = () => {
|
19
|
+
alltoasts.foreach((toast) => {
|
20
|
+
toast.style.display = "none"
|
21
|
+
})
|
22
|
+
}
|
23
|
+
|
24
|
+
hidealltoasts()
|
25
|
+
|
26
|
+
allbuttons.foreach((button) => {
|
27
|
+
button.onclick = () => {
|
28
|
+
hidealltoasts()
|
29
|
+
let toast = document.queryselector(button.getattribute("data-toast"))
|
30
|
+
|
31
|
+
if (toast) {
|
32
|
+
toast.style.display = "flex"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
})
|
36
|
+
</script>
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line.jsx
CHANGED
@@ -1,18 +1,52 @@
|
|
1
|
-
import React from 'react'
|
2
1
|
|
2
|
+
import React, { useState } from 'react'
|
3
|
+
|
4
|
+
import Button from '../../pb_button/_button'
|
3
5
|
import FixedConfirmationToast from '../_fixed_confirmation_toast'
|
4
6
|
|
5
|
-
const
|
7
|
+
const FixedConfirmationToastPositions = (props) => {
|
8
|
+
const [state, setState] = useState({
|
9
|
+
open: false,
|
10
|
+
vertical: 'top',
|
11
|
+
horizontal: 'center',
|
12
|
+
})
|
13
|
+
|
14
|
+
const { vertical, horizontal, open } = state
|
15
|
+
|
16
|
+
const handleClick = (newState) => () => {
|
17
|
+
setState({ open: true, ...newState })
|
18
|
+
}
|
19
|
+
|
20
|
+
const handleClose = () => {
|
21
|
+
setState({ ...state, open: false })
|
22
|
+
}
|
23
|
+
|
6
24
|
return (
|
7
25
|
<div>
|
26
|
+
<Button
|
27
|
+
onClick={handleClick({
|
28
|
+
horizontal: 'center',
|
29
|
+
open: true,
|
30
|
+
vertical: 'top',
|
31
|
+
})}
|
32
|
+
text="Multiline Example"
|
33
|
+
variant="primary"
|
34
|
+
{...props}
|
35
|
+
/>
|
36
|
+
{' '}
|
8
37
|
<FixedConfirmationToast
|
38
|
+
closeable
|
39
|
+
horizontal={horizontal}
|
9
40
|
multiLine
|
41
|
+
onClose={handleClose}
|
42
|
+
open={open}
|
10
43
|
status="tip"
|
11
|
-
text=
|
44
|
+
text={`Multi-line is used when the given text will not fit on one line. Using Multi Line allows the height of the confirmation toast to grow. Simply resize the screen to see the fixed confirmation toast wrap the text.`}
|
45
|
+
vertical={vertical}
|
12
46
|
{...props}
|
13
47
|
/>
|
14
48
|
</div>
|
15
49
|
)
|
16
50
|
}
|
17
51
|
|
18
|
-
export default
|
52
|
+
export default FixedConfirmationToastPositions
|
@@ -2,15 +2,9 @@
|
|
2
2
|
<div class="icon-wrapper">
|
3
3
|
|
4
4
|
<% svg_url = "https://upload.wikimedia.org/wikipedia/commons/3/3b/Wrench_font_awesome.svg" %>
|
5
|
-
<p><%= pb_rails("icon", props: {
|
6
|
-
<p><%= pb_rails("icon", props: { rotation: 90,
|
7
|
-
<p><%= pb_rails("icon", props: { spin: true,
|
8
|
-
<p><%= pb_rails("icon", props: { size: "5x",
|
9
|
-
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x",
|
10
|
-
|
11
|
-
<%= pb_rails("body", props: {
|
12
|
-
text: "Custom icons are compatible with other icon props (size, rotation,
|
13
|
-
spin, flip, etc). Their SVG fill colors will be inherited from
|
14
|
-
parent element's css color properties."
|
15
|
-
} ) %>
|
5
|
+
<p><%= pb_rails("icon", props: { icon: svg_url } ) %></p>
|
6
|
+
<p><%= pb_rails("icon", props: { rotation: 90, icon: svg_url, size: "2x" } ) %></p>
|
7
|
+
<p><%= pb_rails("icon", props: { spin: true, icon: svg_url, size: "3x" } ) %></p>
|
8
|
+
<p><%= pb_rails("icon", props: { size: "5x", icon: svg_url } ) %></p>
|
9
|
+
<p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", icon: svg_url } ) %></p>
|
16
10
|
</div>
|
@@ -1,33 +1,59 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Icon } from '../../'
|
3
3
|
|
4
|
-
// import Icons as config from 'power-icons'
|
5
4
|
const config = {
|
6
|
-
|
7
|
-
<svg
|
8
|
-
ariaHidden="true"
|
9
|
-
focusable="false"
|
10
|
-
role="img"
|
11
|
-
viewBox="0 0 512 512"
|
5
|
+
icon: (
|
6
|
+
<svg viewBox="0 -256 1792 1792"
|
12
7
|
xmlns="http://www.w3.org/2000/svg"
|
13
8
|
>
|
14
|
-
<
|
15
|
-
d="
|
16
|
-
|
17
|
-
/>
|
9
|
+
<g transform="matrix(1,0,0,-1,53.152542,1217.0847)">
|
10
|
+
<path d="m 384,64 q 0,26 -19,45 -19,19 -45,19 -26,0 -45,-19 -19,-19 -19,-45 0,-26 19,-45 19,-19 45,-19 26,0 45,19 19,19 19,45 z m 644,420 -682,-682 q -37,-37 -90,-37 -52,0 -91,37 L 59,-90 Q 21,-54 21,0 21,53 59,91 L 740,772 Q 779,674 854.5,598.5 930,523 1028,484 z m 634,435 q 0,-39 -23,-106 Q 1592,679 1474.5,595.5 1357,512 1216,512 1031,512 899.5,643.5 768,775 768,960 q 0,185 131.5,316.5 131.5,131.5 316.5,131.5 58,0 121.5,-16.5 63.5,-16.5 107.5,-46.5 16,-11 16,-28 0,-17 -16,-28 L 1152,1120 V 896 l 193,-107 q 5,3 79,48.5 74,45.5 135.5,81 61.5,35.5 70.5,35.5 15,0 23.5,-10 8.5,-10 8.5,-25 z" />
|
11
|
+
</g>
|
18
12
|
</svg>
|
19
13
|
),
|
20
14
|
}
|
21
15
|
|
22
16
|
const IconCustom = (props) => {
|
23
17
|
return (
|
24
|
-
<
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
18
|
+
<React.Fragment>
|
19
|
+
<p>
|
20
|
+
<Icon
|
21
|
+
icon={config.icon}
|
22
|
+
{...props}
|
23
|
+
/>
|
24
|
+
</p>
|
25
|
+
<p>
|
26
|
+
<Icon
|
27
|
+
icon={config.icon}
|
28
|
+
rotation={90}
|
29
|
+
size="2x"
|
30
|
+
{...props}
|
31
|
+
/>
|
32
|
+
</p>
|
33
|
+
<p>
|
34
|
+
<Icon
|
35
|
+
icon={config.icon}
|
36
|
+
size="3x"
|
37
|
+
spin
|
38
|
+
{...props}
|
39
|
+
/>
|
40
|
+
</p>
|
41
|
+
<p>
|
42
|
+
<Icon
|
43
|
+
icon={config.icon}
|
44
|
+
size="5x"
|
45
|
+
{...props}
|
46
|
+
/>
|
47
|
+
</p>
|
48
|
+
<p>
|
49
|
+
<Icon
|
50
|
+
flip="horizontal"
|
51
|
+
icon={config.icon}
|
52
|
+
size="5x"
|
53
|
+
{...props}
|
54
|
+
/>
|
55
|
+
</p>
|
56
|
+
</React.Fragment>
|
31
57
|
)
|
32
58
|
}
|
33
59
|
|
@@ -4,16 +4,12 @@ When using custom icons it is important to introduce a "clean" SVG. In order to
|
|
4
4
|
|
5
5
|
Attributes must be React compatible e.g. <code>xmlns:xlink</code> should be <code>xmlnsXlink</code> and so on. <strong>There should be no hyphenated attributes and no semi-colons!.</strong>
|
6
6
|
|
7
|
-
Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with
|
7
|
+
Fill colors with regards to <code>g</code> or <code>path</code> nodes, e.g. <code>fill="black"</code>, should be replaced with <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
|
8
8
|
|
9
|
-
Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point
|
9
|
+
Pay attention to your custom icon's dimensions and `viewBox` attribute. It is best to use a `viewBox="0 0 512 512"` starting point **when designing instead of trying to retrofit the viewbox afterwards**!
|
10
10
|
|
11
|
-
You must source
|
12
|
-
|
13
|
-
### React
|
14
|
-
|
15
|
-
So long as you have a valid React `<SVG>` node, you can send it as the `customIcon` prop and the kit will take care of the rest.
|
11
|
+
You must source _your own SVG into component/view_ you are working on. This can easily be done in programmatic and maintainable ways.
|
16
12
|
|
17
13
|
### Rails
|
18
14
|
|
19
|
-
|
15
|
+
Sending the absolute path to the `icon` prop results in an `<SVG>` tag within the working view.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
|
-
- table_div: Div
|
3
|
+
# - table_div: Div
|
4
4
|
- table_sm: Small
|
5
5
|
- table_md: Medium
|
6
6
|
- table_lg: Large
|
@@ -27,7 +27,7 @@ examples:
|
|
27
27
|
- table_striped: Striped Table
|
28
28
|
|
29
29
|
react:
|
30
|
-
- table_div: Div
|
30
|
+
# - table_div: Div
|
31
31
|
- table_sm: Small
|
32
32
|
- table_md: Medium
|
33
33
|
- table_lg: Large
|