playbook_ui_docs 13.15.0.pre.alpha.1132globalpropdatepickerspacing1929 → 13.16.0.pre.alpha.PLAY11641991

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: 33a914c4ad1301173a99d43f6a05979142c547bdf26762d267a5013aab570dbf
4
- data.tar.gz: 67c200972726532ce4654974f52f3207f5425e3e4609f2f4202a0e9d748ea593
3
+ metadata.gz: 3125b3ce3a546d8b9b99c229f6e08ecf0a79aeca2a8fb38441a97681f7b7bf02
4
+ data.tar.gz: 7205570b0b740c53edbc12b2de5fbcff89dfd08744d389a63af037403f06d81c
5
5
  SHA512:
6
- metadata.gz: 3848b5a6f509e1a59628b59ec09a5b63b86da8ccd0bc87edbc5b5a7424c947a6aa998d7d3b09bd312bd795ba658650ae76c4f9fc97a912274406d51f35dd51e6
7
- data.tar.gz: ea815627b8446dfa435b0807986a9d9a5791602710d129b59b07cb89b52305e1d51df0a20c7e226cefd9cc5bf5b3e42d75805b094f803b943fe1ca7e57517a9e
6
+ metadata.gz: fedc053d72eceae7183d9ecf9358bbfb38ce6f44e6df7d09f19dd29a6c17c1f659065d33ba3dac3c7cfbde4174ff583170d4b9768224dabb416af5497acf5832
7
+ data.tar.gz: 4cc759514e53459de46209401e148cbba2701d6feff5e9ab5fb5b75fa7e5ab14cef1f97fa39d062c0716a9f53bbe6e4eae186da2cec7ca083762af9a4bc1c95a
@@ -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
 
@@ -1,19 +1,14 @@
1
1
  # Tips for Custom Icons
2
2
 
3
- When using custom icons it is important to introduce a "clean" SVG. In order to ensure these custom icons perform as intended within your kit(s), ensure these things have been modified from the original SVG markup:
4
-
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
-
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
-
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
-
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
3
  ### React
14
4
 
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.
5
+ - Providing a valid React `<SVG>` element to the `icon` prop results in an `<SVG>` node within the working view.
6
+ - Sending the absolute path to your SVG (e.g. `/my/path/to/icon.svg`) results in an `img` node with the `src` attribute set to the provided path:
7
+
8
+ ```html
9
+ <img src="host.com/my/path/to/icon.svg" />
10
+ ```
16
11
 
17
12
  ### Rails
18
13
 
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.
14
+ Sending the absolute path to the `icon` prop results in an `<SVG>` tag within the working view.
@@ -0,0 +1,24 @@
1
+ <%= pb_rails("select", props: {
2
+ label: "Favorite Food",
3
+ name: "food",
4
+ inline: true,
5
+ options: [
6
+ {
7
+ value: "1",
8
+ value_text: "Burgers",
9
+ },
10
+ {
11
+ value: "2",
12
+ value_text: "Pizza",
13
+ },
14
+ {
15
+ value: "3",
16
+ value_text: "Tacos",
17
+ },
18
+ {
19
+ value: "4",
20
+ value_text: "BBQ",
21
+ },
22
+ ],
23
+ show_arrow: true
24
+ }) %>
@@ -0,0 +1,38 @@
1
+ import React from 'react'
2
+ import { Body, Select } from '../..'
3
+
4
+ const SelectInlineShowArrow = (props) => {
5
+ const options = [
6
+ {
7
+ value: '1',
8
+ text: 'Burgers',
9
+ },
10
+ {
11
+ value: '2',
12
+ text: 'Pizza',
13
+ },
14
+ {
15
+ value: '3',
16
+ text: 'Tacos',
17
+ },
18
+ ]
19
+
20
+ return (
21
+ <div>
22
+ <Select
23
+ inline
24
+ label="Favorite Food"
25
+ name="food"
26
+ options={options}
27
+ showArrow
28
+ {...props}
29
+ />
30
+ <Body
31
+ status="negative"
32
+ {...props}
33
+ />
34
+ </div>
35
+ )
36
+ }
37
+
38
+ export default SelectInlineShowArrow
@@ -10,6 +10,7 @@ examples:
10
10
  - select_custom_select: Custom Select
11
11
  - select_error: Select w/ Error
12
12
  - select_inline: Select Inline
13
+ - select_inline_show_arrow: Select Inline (Always Show Arrow)
13
14
  - select_inline_compact: Select Inline Compact
14
15
  - select_attributes: Select W/ Attributes
15
16
  - select_multiple: Select Multiple
@@ -26,6 +27,7 @@ examples:
26
27
  - select_custom_select: Custom Select
27
28
  - select_error: Select w/ Error
28
29
  - select_inline: Select Inline
30
+ - select_inline_show_arrow: Select Inline (Always Show Arrow)
29
31
  - select_inline_compact: Select Inline Compact
30
32
  - select_multiple: Select Multiple
31
33
 
@@ -7,5 +7,6 @@ export { default as SelectCustomSelect } from './_select_custom_select.jsx'
7
7
  export { default as SelectValueTextSame } from './_select_value_text_same.jsx'
8
8
  export { default as SelectError } from './_select_error.jsx'
9
9
  export { default as SelectInline } from './_select_inline.jsx'
10
+ export { default as SelectInlineShowArrow } from './_select_inline_show_arrow.jsx'
10
11
  export { default as SelectInlineCompact } from './_select_inline_compact.jsx'
11
12
  export { default as SelectMultiple } from './_select_multiple.jsx'