playbook_ui_docs 14.17.0.pre.alpha.PLAY1597tiptapupgrade7304 → 14.17.0.pre.alpha.PLAY1823maskedsanitizedtextinput7271

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.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui_docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.17.0.pre.alpha.PLAY1597tiptapupgrade7304
4
+ version: 14.17.0.pre.alpha.PLAY1823maskedsanitizedtextinput7271
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-04-21 00:00:00.000000000 Z
12
+ date: 2025-04-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: playbook_ui
@@ -459,8 +459,6 @@ files:
459
459
  - app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb
460
460
  - app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.jsx
461
461
  - app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.md
462
- - app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.jsx
463
- - app/pb_kits/playbook/pb_copy_button/docs/_copy_button_hook.md
464
462
  - app/pb_kits/playbook/pb_copy_button/docs/example.yml
465
463
  - app/pb_kits/playbook/pb_copy_button/docs/index.js
466
464
  - app/pb_kits/playbook/pb_currency/docs/_currency_abbreviated.html.erb
@@ -1,54 +0,0 @@
1
- import React, { useEffect, useState } from 'react'
2
- import usePBCopy from '../../pb_copy_button/usePBCopy'
3
- import Body from '../../pb_body/_body'
4
- import Textarea from '../../pb_textarea/_textarea'
5
- import Tooltip from '../../pb_tooltip/_tooltip'
6
-
7
- const CopyButtonHook = ({...props}) => {
8
- // This is how you can use the copy button hook to copy text to the clipboard
9
- // eslint-disable-next-line no-unused-vars
10
- const [copied, copyToClipboard] = usePBCopy({ from: 'hookbody' })
11
- // I added a tooltip so it looks better in the ui
12
- const [showTooltip, setShowTooltip] = useState(false)
13
-
14
- const handleCopy = () => {
15
- copyToClipboard()
16
- setShowTooltip(true)
17
- setTimeout(() => setShowTooltip(false), 1500)
18
- }
19
-
20
- useEffect(() => {
21
- const el = document.getElementById('hookbody')
22
- if (!el) return
23
-
24
- el.addEventListener('click', handleCopy)
25
- return () => {
26
- el.removeEventListener('click', handleCopy)
27
- }
28
- }, [copyToClipboard])
29
-
30
- return (
31
- <div>
32
- <Tooltip
33
- delay={{ close: 1000 }}
34
- forceOpenTooltip={showTooltip}
35
- placement="top"
36
- showTooltip={false}
37
- text="Copied!"
38
- >
39
- <Body
40
- cursor="pointer"
41
- id="hookbody"
42
- text="I'm a custom copy hook! Click this body to copy this text!"
43
- />
44
- </Tooltip>
45
-
46
- <Textarea
47
- {...props}
48
- placeholder="Paste here"
49
- />
50
- </div>
51
- )
52
- }
53
-
54
- export default CopyButtonHook
@@ -1,3 +0,0 @@
1
- We provide a `usePBCopy` hook that you can import to your project. This hook will return a function that you can call to copy the text to the clipboard.
2
-
3
- `usePBCopy({ from: 'your_id' })` will grab the `innerText` from `your_id` element, or `value` if it is an input element.