playbook_ui_docs 14.13.0.pre.rc.0 → 14.13.0.pre.rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88a341c6e6ae51adfb0dec544b38d4bb8c806281a76f92e17058171e30f73e2d
4
- data.tar.gz: 5b4d578bae393381fba64df268915ab03479b603d8d7b3ea96beedabf516dc21
3
+ metadata.gz: d01bc6df04543fbd309e6a36e2a8ebe28bc7513e4fe41da74ae86db2de39e74f
4
+ data.tar.gz: 55c308df3152cc25b59976f3a25e9396edd6759e3628584b0b00a355935d2b6a
5
5
  SHA512:
6
- metadata.gz: c3273abc90e1edc65827ad1e84b7876702ce0bf1a27509c4d91f7df1ffd569d900eefcdb17f465b5fbe9ad8f792e120f76a842a9262cc13157a4a4611f79e301
7
- data.tar.gz: 0b9b154b6c2f17f849a7178b8f6a683234b12e4f8fa89c253777fc88edbeb1d65b4fef555bfa9369d0fb031eae1486106e9d1585e9a1f9b2adffafa1a9b22986
6
+ metadata.gz: 39bf3ff42cabed311bd7d48bf5587a374a4d185bc2775b28cccc49b41e54b636c611e4f5205cc99793a717efab51c6b34ee1a8ab927540cf08e8b1b11a7d219b
7
+ data.tar.gz: 54b989b42293344a09a6b19ec8f6fe29896131860ae1e7eee1963b90b7864c3b69aa49ea59602a0e5c4a663fb1ee1ce758c612f4837ebbd01f2e72738aef5a88
@@ -0,0 +1,21 @@
1
+ import React from 'react'
2
+ import { CopyButton, Textarea } from 'playbook-ui'
3
+
4
+ const CopyButtonDefault = (props) => (
5
+ <div>
6
+ <CopyButton
7
+ {...props}
8
+ text="Copy Text"
9
+ tooltipPlacement="right"
10
+ tooltipText="Text copied!"
11
+ value="Playbook makes it easy to support bleeding edge, or legacy systems. Use Playbook’s 200+ components and end-to-end design language to create simple, intuitive and beautiful experiences with ease."
12
+ />
13
+
14
+ <Textarea
15
+ {...props}
16
+ placeholder="Copy and paste here"
17
+ />
18
+ </div>
19
+ )
20
+
21
+ export default CopyButtonDefault
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react'
2
+ import { CopyButton, Body, TextInput, Textarea } from 'playbook-ui'
3
+
4
+ const CopyButtonFrom = (props) => {
5
+ const [text, setText] = useState("Copy this text input text")
6
+
7
+ const handleChange = (event) => {
8
+ setText(event.target.value);
9
+ }
10
+
11
+ return (<div>
12
+ <Body id="body">Copy this body text!</Body>
13
+ <CopyButton
14
+ {...props}
15
+ from="body"
16
+ marginBottom="sm"
17
+ text="Copy Body text"
18
+ tooltipPlacement="right"
19
+ tooltipText="Body text copied!"
20
+ />
21
+
22
+ <TextInput
23
+ {...props}
24
+ id="textinput"
25
+ onChange={handleChange}
26
+ value={text}
27
+ />
28
+ <CopyButton
29
+ {...props}
30
+ from="textinput"
31
+ marginBottom="sm"
32
+ text="Copy Text Input"
33
+ tooltipPlacement="right"
34
+ tooltipText="Text input copied!"
35
+ />
36
+
37
+ <Textarea
38
+ {...props}
39
+ placeholder="Copy and paste here"
40
+ />
41
+ </div>
42
+ )
43
+ }
44
+
45
+ export default CopyButtonFrom
@@ -0,0 +1 @@
1
+ Provide an element's ID as the `from` parameter, and its text will be copied. If the element is an input, its `value` will be copied; otherwise, the `innerText` will be used. Additionally, if a `value` prop is provided, it will override the content from the `from` element and be copied instead.
@@ -0,0 +1,8 @@
1
+ examples:
2
+
3
+
4
+ react:
5
+ - copy_button_default: Default
6
+ - copy_button_from: Copy From
7
+
8
+
@@ -0,0 +1,2 @@
1
+ export { default as CopyButtonDefault } from './_copy_button_default.jsx'
2
+ export { default as CopyButtonFrom } from './_copy_button_from.jsx'