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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 371298dc24bb6261c47235a1a1fc96535f40895bf2e367d2c74a0a2f2194856b
4
- data.tar.gz: 27af54cb4a1555edd946811c6a9d790f9d15a12ffb83755bde53a51814147ad6
3
+ metadata.gz: a2cb8ae9eee907fd4eccb8287903a2602711f15004f09cde0bc868d28644c04e
4
+ data.tar.gz: a1da2d366768b65dfb07fd6c09f936fd8b3a7c3741300815bec884dceb656c8c
5
5
  SHA512:
6
- metadata.gz: af4a307e32b77ee025b590b0c8e4c050b85c56a828d79ebdc526687503be7eaf3f609f766a7e6111294fb01d166433123de1a7481f84b9baf5eb11632fe74849
7
- data.tar.gz: 00d49100858c5b291a86fb2bfe30be7bbbebaf5c7c447d07b31c8077036bf9694ee7881b4092cc23e2487a6e97b5131780515f32a1d2ff7fe5612437966cf5ac
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: "Scan to Assign Selected Items. Click here to generate report",
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>
@@ -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 FixedConfirmationToastMultiLine = (props) => {
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="Scan to Assign Selected Items. Click here to generate report"
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 FixedConfirmationToastMultiLine
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: { custom_icon: svg_url } ) %></p>
6
- <p><%= pb_rails("icon", props: { rotation: 90, custom_icon: svg_url, size: "2x" } ) %></p>
7
- <p><%= pb_rails("icon", props: { spin: true, custom_icon: svg_url, size: "3x" } ) %></p>
8
- <p><%= pb_rails("icon", props: { size: "5x", custom_icon: svg_url } ) %></p>
9
- <p><%= pb_rails("icon", props: { flip: "horizontal", size: "5x", custom_icon: svg_url } ) %></p>
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
- moon: (
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
- <path
15
- d="M448 0H64C28.7 0 0 28.7 0 64v288c0 35.3 28.7 64 64 64h96v84c0 7.1 5.8 12 12 12 2.4 0 4.9-.7 7.1-2.4L304 416h144c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64zm16 352c0 8.8-7.2 16-16 16H288l-12.8 9.6L208 428v-60H64c-8.8 0-16-7.2-16-16V64c0-8.8 7.2-16 16-16h384c8.8 0 16 7.2 16 16v288zM336 184h-56v-56c0-8.8-7.2-16-16-16h-16c-8.8 0-16 7.2-16 16v56h-56c-8.8 0-16 7.2-16 16v16c0 8.8 7.2 16 16 16h56v56c0 8.8 7.2 16 16 16h16c8.8 0 16-7.2 16-16v-56h56c8.8 0 16-7.2 16-16v-16c0-8.8-7.2-16-16-16z"
16
- fill="currentColor"
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
- <div>
25
- <Icon
26
- customIcon={config.moon}
27
- size="7x"
28
- {...props}
29
- />
30
- </div>
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 <code>currentColor</code> ala <code>fill="currentColor"</code>. Your mileage may vary depending on the complexity of your SVG.
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 __when designing instead of trying to retrofit the viewbox afterwards__!
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 *your own SVG into component/view* you are working on. This can easily be done in programmatic and maintainable ways.
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
- Some Rails applications use only webpack(er) which means using `image_url` will be successful over `image_path` in most cases especially development where Webpack Dev Server is serving assets over HTTP. Rails applications still using Asset Pipeline may use `image_path` or `image_url`. Of course, YMMV depending on any custom configurations in your Rails application.
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