playbook_ui_docs 12.33.1.pre.alpha.PLAY933navkitcollapsible994 → 12.34.0.pre.alpha.fixdialogcloseevents1003
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_button/docs/_button_reaction.html.erb +30 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.jsx +47 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_reaction.md +3 -0
- data/app/pb_kits/playbook/pb_button/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_button/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +1 -3
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +0 -3
- data/app/pb_kits/playbook/pb_nav/docs/index.js +0 -2
- data/dist/playbook-doc.js +9 -9
- metadata +5 -8
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.html.erb +0 -10
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +0 -19
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +0 -2
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.html.erb +0 -24
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +0 -83
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +0 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f8a98703bf4c4759db54528b99c10c17c144ab3352749e77305b3faadd1d54c
|
4
|
+
data.tar.gz: d649b3df0a66fa20d99eea928fe64ccd230b0e19033511764d090e2537cd1f34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d27f1dedae73861086b7f21d8ba301efe1129d630fa6e7a076661d369cfd2aab3cc74aefee6be706c1100dd681fc39b2591e0b6ca0bcf060bd2d18cfd681d881
|
7
|
+
data.tar.gz: a039fd3ab369c3230b925ead002431749e3da15191d8f7b9ec24d1ad3093ac29455f269b52dccf72121897f8d46c55542429424754d45d9b3a9cfe12837d800c
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%= pb_rails("button", props: { count: 153, highlight: false, icon: "🎉", classname: "count", id: "reaction-button-highlight", variant: "reaction" }) %>
|
2
|
+
<%= pb_rails("button", props: { count: 5, icon: "😍", variant: "reaction", margin_left: "lg" }) %>
|
3
|
+
<%= pb_rails("button", props: { variant: "reaction", margin_left: "lg" }) %>
|
4
|
+
<%= pb_rails("button", props: { icon: "user", variant: "reaction", margin_left: "lg" }) %>
|
5
|
+
|
6
|
+
|
7
|
+
<script>
|
8
|
+
function renderButtonReaction() {
|
9
|
+
|
10
|
+
let highlightActive = false;
|
11
|
+
|
12
|
+
function toggleHighlight() {
|
13
|
+
let reactionCount = 153;
|
14
|
+
console.log("toggleHighlight", highlightActive)
|
15
|
+
highlightActive = !highlightActive;
|
16
|
+
const innerCountElement = document.querySelector(".count .pb_caption_kit_xs.pl_xxs")
|
17
|
+
const firstButton = document.getElementById("reaction-button-highlight")
|
18
|
+
firstButton.classList.add(highlightActive && "active")
|
19
|
+
firstButton.classList.remove(!highlightActive && "active")
|
20
|
+
innerCountElement.innerHTML = highlightActive ? reactionCount + 1 : reactionCount;
|
21
|
+
console.log("element", innerCountElement)
|
22
|
+
}
|
23
|
+
|
24
|
+
const button1 = document.getElementById("reaction-button-highlight")
|
25
|
+
button1.addEventListener("click", toggleHighlight);
|
26
|
+
|
27
|
+
}
|
28
|
+
renderButtonReaction();
|
29
|
+
</script>
|
30
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import React, {useState} from "react"
|
2
|
+
import { Button } from "../../"
|
3
|
+
|
4
|
+
const ButtonReaction = (props) => {
|
5
|
+
|
6
|
+
const [highlightActive, setHighlightActive] =useState(false)
|
7
|
+
const reactionCount = 153
|
8
|
+
|
9
|
+
return (
|
10
|
+
<div>
|
11
|
+
<Button
|
12
|
+
count={highlightActive ? (reactionCount + 1) : reactionCount}
|
13
|
+
highlight = {highlightActive}
|
14
|
+
icon="🎉"
|
15
|
+
onClick={()=> setHighlightActive(!highlightActive)}
|
16
|
+
tabIndex={0}
|
17
|
+
variant="reaction"
|
18
|
+
{...props}
|
19
|
+
/>
|
20
|
+
<Button
|
21
|
+
count={5}
|
22
|
+
icon="😍"
|
23
|
+
marginLeft='lg'
|
24
|
+
tabIndex={0}
|
25
|
+
variant="reaction"
|
26
|
+
{...props}
|
27
|
+
/>
|
28
|
+
<Button
|
29
|
+
marginLeft='lg'
|
30
|
+
tabIndex={0}
|
31
|
+
variant="reaction"
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
<Button
|
35
|
+
icon="user"
|
36
|
+
marginLeft='lg'
|
37
|
+
tabIndex={0}
|
38
|
+
variant="reaction"
|
39
|
+
{...props}
|
40
|
+
/>
|
41
|
+
|
42
|
+
|
43
|
+
</div>
|
44
|
+
)
|
45
|
+
}
|
46
|
+
|
47
|
+
export default ButtonReaction
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The `reaction` variant accepts any HTML Emoji or it's hexa/decimal ref (see [here](https://www.w3schools.com/charsets/ref_emoji.asp)) as a string within the `icon` prop. If nothing is passed to the icon prop, the default reaction button will be displayed as seen in the third example. The default reaction button will also be rendered if a Fontawesome icon (not an Emoji) is passed to the `icon` prop of a `reaction` variant, but the default "smiley +" icon will be replaced with the named icon.
|
2
|
+
|
3
|
+
Reaction buttons also accept two additional (optional) props: `count`, which accepts a number (i.e., a count of reactions) to be displayed next to the Emoji; and `highlight`, which is a boolean that if true, displays the 'active' state for the button. Click the first reaction button to see this in action!
|
@@ -1,6 +1,7 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
3
|
- button_default: Button Variants
|
4
|
+
- button_reaction: Reaction Button
|
4
5
|
- button_full_width: Button Full Width
|
5
6
|
- button_link: Button Links
|
6
7
|
- button_loading: Button Loading
|
@@ -13,6 +14,7 @@ examples:
|
|
13
14
|
|
14
15
|
react:
|
15
16
|
- button_default: Button Variants
|
17
|
+
- button_reaction: Reaction Button
|
16
18
|
- button_full_width: Button Full Width
|
17
19
|
- button_link: Button Links
|
18
20
|
- button_loading: Button Loading
|
@@ -8,4 +8,5 @@ export { default as ButtonAccessibility } from './_button_accessibility.jsx'
|
|
8
8
|
export { default as ButtonOptions } from './_button_options.jsx'
|
9
9
|
export { default as ButtonSize } from './_button_size.jsx'
|
10
10
|
export { default as ButtonForm } from './_button_form.jsx'
|
11
|
-
export { default as ButtonHover } from './_button_hover.jsx'
|
11
|
+
export { default as ButtonHover } from './_button_hover.jsx'
|
12
|
+
export {default as ButtonReaction } from './_button_reaction.jsx'
|
@@ -1,4 +1,4 @@
|
|
1
1
|
##### Prop
|
2
|
-
This kit uses `icon` sizes. If you don't give it a size, it will default to medium.
|
2
|
+
This kit uses `icon` sizes. If you don't give it a size, it will default to medium. You can be replaced with the sizes below:
|
3
3
|
|
4
4
|
* `lg` `xs` `sm` `1x` `2x` `3x` `4x` `5x` `6x` `7x` `8x` `9x` `10x`
|
@@ -4,10 +4,8 @@ examples:
|
|
4
4
|
- collapsible_default: Default
|
5
5
|
- collapsible_size: Size
|
6
6
|
- collapsible_color: Color
|
7
|
-
- collapsible_icons: Custom Icons
|
8
7
|
|
9
8
|
react:
|
10
9
|
- collapsible_default: Default
|
11
10
|
- collapsible_size: Size
|
12
|
-
- collapsible_color: Color
|
13
|
-
- collapsible_icons: Custom Icons
|
11
|
+
- collapsible_color: Color
|
@@ -1,4 +1,3 @@
|
|
1
1
|
export { default as CollapsibleDefault } from './_collapsible_default.jsx'
|
2
2
|
export { default as CollapsibleSize } from './_collapsible_size.jsx'
|
3
3
|
export { default as CollapsibleColor } from './_collapsible_color.jsx'
|
4
|
-
export { default as CollapsibleIcons } from './_collapsible_icons.jsx'
|
@@ -7,7 +7,6 @@ examples:
|
|
7
7
|
- borderless_nav: No Borders
|
8
8
|
- subtle_nav: Subtle Variant
|
9
9
|
- subtle_with_icons_nav: Subtle With Icons
|
10
|
-
- collapsible_nav: Subtle With Collapsible
|
11
10
|
- subtle_no_highlight_nav: Subtle No Highlight
|
12
11
|
- bold_vertical_nav: Bold Variant
|
13
12
|
- horizontal_nav: Horizontal Nav
|
@@ -25,8 +24,6 @@ examples:
|
|
25
24
|
- borderless_nav: No Borders
|
26
25
|
- subtle_nav: Subtle Variant
|
27
26
|
- subtle_with_icons_nav: Subtle With Icons
|
28
|
-
- collapsible_nav: Subtle With Collapsible
|
29
|
-
- collapsible_nav_custom_icons: Subtle With Collapsible (Custom Toggle Icons)
|
30
27
|
- subtle_no_highlight_nav: Subtle No Highlight
|
31
28
|
- bold_vertical_nav: Bold Variant
|
32
29
|
- horizontal_nav: Horizontal Nav
|
@@ -13,5 +13,3 @@ export { default as WithImgNav } from './_with_img_nav.jsx'
|
|
13
13
|
export { default as NewTab } from './_new_tab.jsx'
|
14
14
|
export { default as BoldHorizontalNav } from './_bold_horizontal_nav.jsx'
|
15
15
|
export { default as BoldVerticalNav } from './_bold_vertical_nav.jsx'
|
16
|
-
export { default as CollapsibleNav } from './_collapsible_nav.jsx'
|
17
|
-
export { default as CollapsibleNavCustomIcons } from './_collapsible_nav_custom_icons.jsx'
|