playbook_ui_docs 12.36.0 → 12.37.0.pre.alpha.PLAY951collapsiblenav31062
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_badge/docs/_badge_colors_swift.md +33 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_default_swift.md +9 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_notification_swift.md +9 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_props_swift.md +6 -0
- data/app/pb_kits/playbook/pb_badge/docs/_badge_rounded_swift.md +9 -0
- data/app/pb_kits/playbook/pb_badge/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_color.jsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_default.jsx +2 -2
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +11 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_size.jsx +5 -5
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.jsx +75 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_state.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +7 -6
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +5 -4
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.jsx +57 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.html.erb +23 -0
- data/app/pb_kits/playbook/pb_nav/docs/{_collapsible_nav_custom_icons.jsx → _collapsible_nav_emphasize.jsx} +9 -9
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_emphasize.md +1 -0
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +5 -3
- data/app/pb_kits/playbook/pb_nav/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_pill/docs/_pill_default_swift.md +5 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_props_swift.md +5 -0
- data/app/pb_kits/playbook/pb_pill/docs/_pill_variants_swift.md +10 -0
- data/app/pb_kits/playbook/pb_pill/docs/example.yml +5 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment_swift.md +16 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_swift.md +18 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_default_swift.md +15 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_error_swift.md +14 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_orientation_swift.md +15 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_padding_swift.md +31 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_props_swift.md +10 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_spacing_swift.md +36 -0
- data/app/pb_kits/playbook/pb_radio/docs/_radio_subtitle_swift.md +13 -0
- data/app/pb_kits/playbook/pb_radio/docs/example.yml +11 -0
- data/app/pb_kits/playbook/pb_text_input/docs/_text_input_options.html.erb +12 -0
- data/app/pb_kits/playbook/pb_text_input/docs/example.yml +1 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align_swift.md +45 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default_swift.md +26 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed_swift.md +25 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_props_swift.md +10 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones_swift.md +67 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_swift.md +19 -0
- data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +8 -0
- data/dist/playbook-doc.js +9 -9
- metadata +39 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0be5520fa28bfc41a99c493eb7dd8685b34536124de75e0e6384bad94a052819
|
4
|
+
data.tar.gz: 127d7fcbbe8660549e07bced2edba82786174b291d3999b454149a5135cc5a29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7596c47d39fac8af0476254757fd363f18d2a96922e3da3f2d4d214f03ffba449df97870ed29d30215a1527114b16150b7d14a21541e5f9b3ad147af930c847
|
7
|
+
data.tar.gz: 9315e4ab92780fe5aba4ad99272ba112060b47fb05e2cb789c91e28e8dc55f38d5b4bac94e7545489a44f62e39a844c0d5ffb9d72d0405a1d776c30ff01142ae
|
@@ -0,0 +1,33 @@
|
|
1
|
+
![badge-colors](https://github.com/powerhome/playbook/assets/92755007/52ce34ef-eb0d-48c0-9232-89edfff60cef)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
HStack {
|
5
|
+
PBBadge(text: "1", rounded: true, variant: .chat)
|
6
|
+
PBBadge(text: "4", variant: .chat)
|
7
|
+
PBBadge(text: "1000", variant: .chat)
|
8
|
+
|
9
|
+
PBBadge(text: "1", rounded: true, variant: .error)
|
10
|
+
PBBadge(text: "4", variant: .error)
|
11
|
+
PBBadge(text: "1000", variant: .error)
|
12
|
+
|
13
|
+
PBBadge(text: "1", rounded: true, variant: .info)
|
14
|
+
PBBadge(text: "4", variant: .info)
|
15
|
+
PBBadge(text: "1000", variant: .info)
|
16
|
+
|
17
|
+
PBBadge(text: "1", rounded: true, variant: .neutral)
|
18
|
+
PBBadge(text: "4", variant: .neutral)
|
19
|
+
PBBadge(text: "1000", variant: .neutral)
|
20
|
+
|
21
|
+
PBBadge(text: "1", rounded: true, variant: .primary)
|
22
|
+
PBBadge(text: "4", variant: .primary)
|
23
|
+
PBBadge(text: "1000", variant: .primary)
|
24
|
+
|
25
|
+
PBBadge(text: "1", rounded: true, variant: .success)
|
26
|
+
PBBadge(text: "4", variant: .success)
|
27
|
+
PBBadge(text: "1000", variant: .success)
|
28
|
+
|
29
|
+
PBBadge(text: "1", rounded: true, variant: .warning)
|
30
|
+
PBBadge(text: "4", variant: .warning)
|
31
|
+
PBBadge(text: "1000", variant: .warning)
|
32
|
+
}
|
33
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
![badge-rectangle](https://github.com/powerhome/playbook/assets/92755007/04188c68-84f0-475b-9764-7b9a325f73da)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
HStack {
|
5
|
+
PBBadge(text: "+1", variant: .primary)
|
6
|
+
PBBadge(text: "+4", variant: .primary)
|
7
|
+
PBBadge(text: "+1000", variant: .primary)
|
8
|
+
}
|
9
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
![badge-chat-notification](https://github.com/powerhome/playbook/assets/92755007/f769c3bc-6a63-465d-8538-3efb5f3ec0d3)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
HStack {
|
5
|
+
PBBadge(text: "1", rounded: true, variant: .chat)
|
6
|
+
PBBadge(text: "4", variant: .chat)
|
7
|
+
PBBadge(text: "1000", variant: .chat)
|
8
|
+
}
|
9
|
+
```
|
@@ -0,0 +1,6 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **text** | `String` | Specifies the value of the Badge | | |
|
5
|
+
| **rounded** | `Bool` | Displays the rounded variant | `false` | |
|
6
|
+
| **variant** | `Variant` | Changes the color of the Badge | `.primary` | `.chat` `.error` `.info` `.neutral` `.primary` `.success` `.warning` |
|
@@ -0,0 +1,9 @@
|
|
1
|
+
![badge-rounded](https://github.com/powerhome/playbook/assets/92755007/775a906f-0108-4ee1-a277-e7b9f2715a2b)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
HStack {
|
5
|
+
PBBadge(text: "+1", rounded: true, variant: .primary)
|
6
|
+
PBBadge(text: "+4", rounded: true, variant: .primary)
|
7
|
+
PBBadge(text: "+1000", rounded: true, variant: .primary)
|
8
|
+
}
|
9
|
+
```
|
@@ -10,3 +10,10 @@ examples:
|
|
10
10
|
- badge_rounded: Rounded
|
11
11
|
- badge_colors: Colors
|
12
12
|
- badge_notification: Notification
|
13
|
+
|
14
|
+
swift:
|
15
|
+
- badge_default_swift: Rectangle
|
16
|
+
- badge_rounded_swift: Rounded
|
17
|
+
- badge_colors_swift: Colors
|
18
|
+
- badge_notification_swift: Notification
|
19
|
+
- badge_props_swift: ""
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Collapsible } from '../..'
|
3
3
|
|
4
|
-
const CollapsibleColor = () => (
|
4
|
+
const CollapsibleColor = (props) => (
|
5
5
|
<div>
|
6
6
|
<Collapsible
|
7
7
|
iconColor='default'
|
8
8
|
marginBottom="xs"
|
9
9
|
>
|
10
|
-
<Collapsible.Main>
|
10
|
+
<Collapsible.Main {...props}>
|
11
11
|
<div>{'Default Section'}</div>
|
12
12
|
</Collapsible.Main>
|
13
13
|
<Collapsible.Content>
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Collapsible } from '../..'
|
3
3
|
|
4
|
-
const CollapsibleDefault = () => (
|
4
|
+
const CollapsibleDefault = (props) => (
|
5
5
|
<Collapsible >
|
6
|
-
<Collapsible.Main>
|
6
|
+
<Collapsible.Main {...props}>
|
7
7
|
<div>{'Main Section'}</div>
|
8
8
|
</Collapsible.Main>
|
9
9
|
<Collapsible.Content>
|
@@ -1,9 +1,14 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Collapsible } from '../..'
|
3
3
|
|
4
|
-
const CollapsibleIcons = () =>
|
5
|
-
|
6
|
-
|
4
|
+
const CollapsibleIcons = (props) => {
|
5
|
+
|
6
|
+
return (
|
7
|
+
<>
|
8
|
+
<Collapsible
|
9
|
+
icon={['plus','minus']}
|
10
|
+
>
|
11
|
+
<Collapsible.Main {...props}>
|
7
12
|
<div>{'Main Section'}</div>
|
8
13
|
</Collapsible.Main>
|
9
14
|
<Collapsible.Content>
|
@@ -14,6 +19,8 @@ const CollapsibleIcons = () => (
|
|
14
19
|
</div>
|
15
20
|
</Collapsible.Content>
|
16
21
|
</Collapsible>
|
17
|
-
|
22
|
+
</>
|
23
|
+
)
|
24
|
+
}
|
18
25
|
|
19
26
|
export default CollapsibleIcons
|
@@ -1,2 +1,2 @@
|
|
1
1
|
##### Prop
|
2
|
-
|
2
|
+
The `icon` prop allows you to customize your icon sets by passing it an array of any comma-separated pair of icon values. The first icon value will replace the kit's default icon when collapsed (chevron-down), and the second value will replace the default icon when expanded (chevron-up). `icon` also allows you to pass it a single icon as a string, in which case the icon will not toggle with the collapsible state.
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import React from 'react'
|
2
2
|
import { Collapsible } from '../..'
|
3
3
|
|
4
|
-
const CollapsibleSize = () => (
|
4
|
+
const CollapsibleSize = (props) => (
|
5
5
|
<div>
|
6
6
|
<Collapsible
|
7
7
|
iconSize="xs"
|
8
8
|
marginBottom="xs"
|
9
9
|
>
|
10
|
-
<Collapsible.Main>
|
10
|
+
<Collapsible.Main {...props}>
|
11
11
|
<div>{'Extra Small Section'}</div>
|
12
12
|
</Collapsible.Main>
|
13
13
|
<Collapsible.Content>
|
@@ -22,7 +22,7 @@ const CollapsibleSize = () => (
|
|
22
22
|
iconSize="sm"
|
23
23
|
marginBottom="xs"
|
24
24
|
>
|
25
|
-
<Collapsible.Main>
|
25
|
+
<Collapsible.Main {...props}>
|
26
26
|
<div>{'Small Section'}</div>
|
27
27
|
</Collapsible.Main>
|
28
28
|
<Collapsible.Content>
|
@@ -36,7 +36,7 @@ const CollapsibleSize = () => (
|
|
36
36
|
<Collapsible
|
37
37
|
marginBottom="xs"
|
38
38
|
>
|
39
|
-
<Collapsible.Main>
|
39
|
+
<Collapsible.Main {...props}>
|
40
40
|
<div>{'Default Section'}</div>
|
41
41
|
</Collapsible.Main>
|
42
42
|
<Collapsible.Content>
|
@@ -51,7 +51,7 @@ const CollapsibleSize = () => (
|
|
51
51
|
iconSize="lg"
|
52
52
|
marginBottom="xs"
|
53
53
|
>
|
54
|
-
<Collapsible.Main>
|
54
|
+
<Collapsible.Main {...props}>
|
55
55
|
<div>{'Large Section'}</div>
|
56
56
|
</Collapsible.Main>
|
57
57
|
<Collapsible.Content>
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import { Collapsible, useCollapsible, Button } from '../..'
|
3
|
+
|
4
|
+
const CollapsibleState = (props) => {
|
5
|
+
const [isCollapsed, setIsCollapsed] = useCollapsible(true)
|
6
|
+
|
7
|
+
return (
|
8
|
+
<>
|
9
|
+
<Button
|
10
|
+
onClick={() => setIsCollapsed(!isCollapsed)}
|
11
|
+
padding="none"
|
12
|
+
variant="link"
|
13
|
+
>
|
14
|
+
{isCollapsed ? "Expand All" : "Collapse All"}
|
15
|
+
</Button>
|
16
|
+
|
17
|
+
<Collapsible
|
18
|
+
collapsed={isCollapsed}
|
19
|
+
icon={["plus", "minus"]}
|
20
|
+
padding="none"
|
21
|
+
>
|
22
|
+
<Collapsible.Main padding="sm"
|
23
|
+
{...props}
|
24
|
+
>
|
25
|
+
<div>{"Main Section"}</div>
|
26
|
+
</Collapsible.Main>
|
27
|
+
<Collapsible.Content>
|
28
|
+
<div>
|
29
|
+
{
|
30
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
|
31
|
+
}
|
32
|
+
</div>
|
33
|
+
</Collapsible.Content>
|
34
|
+
</Collapsible>
|
35
|
+
<Collapsible
|
36
|
+
collapsed={isCollapsed}
|
37
|
+
icon={["plus", "minus"]}
|
38
|
+
padding="none"
|
39
|
+
>
|
40
|
+
<Collapsible.Main padding="sm"
|
41
|
+
{...props}
|
42
|
+
>
|
43
|
+
<div>{"Main Section"}</div>
|
44
|
+
</Collapsible.Main>
|
45
|
+
<Collapsible.Content>
|
46
|
+
<div>
|
47
|
+
{
|
48
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
|
49
|
+
}
|
50
|
+
</div>
|
51
|
+
</Collapsible.Content>
|
52
|
+
</Collapsible>
|
53
|
+
<Collapsible
|
54
|
+
collapsed={isCollapsed}
|
55
|
+
icon={["plus", "minus"]}
|
56
|
+
padding="none"
|
57
|
+
>
|
58
|
+
<Collapsible.Main padding="sm"
|
59
|
+
{...props}
|
60
|
+
>
|
61
|
+
<div>{"Main Section"}</div>
|
62
|
+
</Collapsible.Main>
|
63
|
+
<Collapsible.Content>
|
64
|
+
<div>
|
65
|
+
{
|
66
|
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. In vel erat sed purus hendrerit viverra. Duis et vestibulum metus. Sed consequat ut ante non vehicula. Etiam nunc massa, pharetra vel quam id, posuere rhoncus quam. Quisque imperdiet arcu enim, nec aliquet justo auctor eget. Curabitur in metus nec nunc rhoncus faucibus vitae ac elit."
|
67
|
+
}
|
68
|
+
</div>
|
69
|
+
</Collapsible.Content>
|
70
|
+
</Collapsible>
|
71
|
+
</>
|
72
|
+
)
|
73
|
+
}
|
74
|
+
|
75
|
+
export default CollapsibleState
|
@@ -0,0 +1,3 @@
|
|
1
|
+
The `collapsed` prop allows you to toggle the collapsible with external controls (like buttons) when used in conjunction with our `useCollapsible` hook.
|
2
|
+
|
3
|
+
NOTE: you must import and declare the `useCollapsible` hook then pass its state to the collapsed prop of any Collapsible you wish to manage with the external control. See our code example for details.
|
@@ -2,12 +2,13 @@ examples:
|
|
2
2
|
|
3
3
|
rails:
|
4
4
|
- collapsible_default: Default
|
5
|
-
- collapsible_size: Size
|
6
|
-
- collapsible_color: Color
|
7
|
-
|
5
|
+
- collapsible_size: Icon Size
|
6
|
+
- collapsible_color: Icon Color
|
7
|
+
- collapsible_icons: Custom Icons
|
8
8
|
|
9
9
|
react:
|
10
10
|
- collapsible_default: Default
|
11
|
-
- collapsible_size: Size
|
12
|
-
- collapsible_color: Color
|
13
|
-
|
11
|
+
- collapsible_size: Icon Size
|
12
|
+
- collapsible_color: Icon Color
|
13
|
+
- collapsible_icons: Custom Icons
|
14
|
+
- collapsible_state: useCollapsible Hook
|
@@ -1,4 +1,5 @@
|
|
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'
|
4
|
+
export { default as CollapsibleIcons } from './_collapsible_icons.jsx'
|
5
|
+
export {default as CollapsibleState } from './_collapsible_state.jsx'
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import React from "react";
|
2
|
-
|
3
|
-
import Nav from "../_nav";
|
4
|
-
import NavItem from "../_item";
|
2
|
+
import { Nav, NavItem } from '../..'
|
5
3
|
|
6
4
|
const CollapsibleNav = (props) => {
|
7
5
|
return (
|
@@ -9,6 +7,7 @@ const CollapsibleNav = (props) => {
|
|
9
7
|
<NavItem
|
10
8
|
collapsible
|
11
9
|
iconLeft="city"
|
10
|
+
iconRight={["plus", "minus"]}
|
12
11
|
link="#"
|
13
12
|
text="Overview"
|
14
13
|
{...props}
|
@@ -33,6 +32,7 @@ const CollapsibleNav = (props) => {
|
|
33
32
|
active
|
34
33
|
collapsible
|
35
34
|
iconLeft="theater-masks"
|
35
|
+
iconRight={["plus", "minus"]}
|
36
36
|
link="#"
|
37
37
|
text="Albums"
|
38
38
|
{...props}
|
@@ -56,6 +56,7 @@ const CollapsibleNav = (props) => {
|
|
56
56
|
<NavItem
|
57
57
|
collapsible
|
58
58
|
iconLeft="city"
|
59
|
+
iconRight={["plus", "minus"]}
|
59
60
|
link="#"
|
60
61
|
text="Similar Artists"
|
61
62
|
{...props}
|
@@ -80,4 +81,4 @@ const CollapsibleNav = (props) => {
|
|
80
81
|
);
|
81
82
|
};
|
82
83
|
|
83
|
-
export default CollapsibleNav
|
84
|
+
export default CollapsibleNav
|
@@ -0,0 +1 @@
|
|
1
|
+
The `collapsible` prop allows users to create a nested, collapsible nav. Pass `collapsible` to NavItem and nest as many more NavItems as needed as children for that NavItem to see this in action.
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import React from "react"
|
2
|
+
import { Nav, NavItem, useCollapsible } from "../.."
|
3
|
+
|
4
|
+
const CollapsibleNavCustom = (props) => {
|
5
|
+
const navItems = ["Overview", "Albums", "Similar Artists"]
|
6
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
7
|
+
const collapsibles = navItems.map(() => useCollapsible(true))
|
8
|
+
|
9
|
+
const handleMainClick = (index) => {
|
10
|
+
collapsibles.forEach(([, , setCollapsed], idx) => {
|
11
|
+
if (idx === index) {
|
12
|
+
setCollapsed(false)
|
13
|
+
} else {
|
14
|
+
setCollapsed(true)
|
15
|
+
}
|
16
|
+
})
|
17
|
+
}
|
18
|
+
|
19
|
+
return (
|
20
|
+
<>
|
21
|
+
<Nav variant='subtle'>
|
22
|
+
{navItems.map((text, index) => {
|
23
|
+
const [collapsed] = collapsibles[index]
|
24
|
+
return (
|
25
|
+
<NavItem
|
26
|
+
collapsed={collapsed}
|
27
|
+
collapsible
|
28
|
+
emphasized
|
29
|
+
iconLeft="chevron-down"
|
30
|
+
id={`collapsible-nav-item-${index + 1}`}
|
31
|
+
key={index}
|
32
|
+
link="#"
|
33
|
+
onClick={() => handleMainClick(index)}
|
34
|
+
text={text}
|
35
|
+
{...props}
|
36
|
+
>
|
37
|
+
<NavItem link="#"
|
38
|
+
text="City"
|
39
|
+
{...props}
|
40
|
+
/>
|
41
|
+
<NavItem link="#"
|
42
|
+
text="People"
|
43
|
+
{...props}
|
44
|
+
/>
|
45
|
+
<NavItem link="#"
|
46
|
+
text="Business"
|
47
|
+
{...props}
|
48
|
+
/>
|
49
|
+
</NavItem>
|
50
|
+
);
|
51
|
+
})}
|
52
|
+
</Nav>
|
53
|
+
</>
|
54
|
+
)
|
55
|
+
}
|
56
|
+
|
57
|
+
export default CollapsibleNavCustom
|
@@ -0,0 +1 @@
|
|
1
|
+
The collapsible nav kit uses our Collapsible kit under the hood and as such the `useCollapsible` hook can be used to achieve custom toggling of the collapsible nav. To do this, you must import and declare the `useCollapsible` hook and pass it's state to the `collapsed` prop. See our code example below to see how this can be done.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
2
|
+
<%= pb_rails("nav/item", props: { text: "Overview", link: "#", emphasized: true, collapsible: true, icon_left:"city" }) do %>
|
3
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
4
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
5
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
6
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
9
|
+
<%= pb_rails("nav/item", props: { text: "Albums", link: "#", emphasized: true, collapsible: true, icon_left: "theater-masks" }) do %>
|
10
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
11
|
+
<%= pb_rails("nav/item", props: { text: "Entertainment", link: "#" }) %>
|
12
|
+
<%= pb_rails("nav/item", props: { text: "Food", link: "#" }) %>
|
13
|
+
<%= pb_rails("nav/item", props: { text: "Style", link: "#" }) %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<%= pb_rails("nav/item", props: { text: "Similar Artists", link: "#", emphasized: true, collapsible: true, icon_left: "city" }) do %>
|
17
|
+
<%= pb_rails("nav", props: { variant: "subtle" }) do %>
|
18
|
+
<%= pb_rails("nav/item", props: { text: "City", link: "#" }) %>
|
19
|
+
<%= pb_rails("nav/item", props: { text: "People", link: "#" }) %>
|
20
|
+
<%= pb_rails("nav/item", props: { text: "Business", link: "#" }) %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import React from "react";
|
2
|
+
import { Nav, NavItem } from '../..'
|
2
3
|
|
3
|
-
|
4
|
-
import NavItem from "../_item";
|
5
|
-
|
6
|
-
const CollapsibleNavCustomIcons = (props) => {
|
4
|
+
const CollapsibleNavEmphasize = (props) => {
|
7
5
|
return (
|
8
6
|
<Nav variant="subtle">
|
9
7
|
<NavItem
|
10
8
|
collapsible
|
9
|
+
emphasized
|
11
10
|
iconLeft="city"
|
12
|
-
iconRight={["
|
11
|
+
iconRight={["plus", "minus"]}
|
13
12
|
link="#"
|
14
13
|
text="Overview"
|
15
14
|
{...props}
|
@@ -31,10 +30,10 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
31
30
|
/>
|
32
31
|
</NavItem>
|
33
32
|
<NavItem
|
34
|
-
active
|
35
33
|
collapsible
|
34
|
+
emphasized
|
36
35
|
iconLeft="theater-masks"
|
37
|
-
iconRight={["
|
36
|
+
iconRight={["plus", "minus"]}
|
38
37
|
link="#"
|
39
38
|
text="Albums"
|
40
39
|
{...props}
|
@@ -57,8 +56,9 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
57
56
|
</NavItem>
|
58
57
|
<NavItem
|
59
58
|
collapsible
|
59
|
+
emphasized
|
60
60
|
iconLeft="city"
|
61
|
-
iconRight={["
|
61
|
+
iconRight={["plus", "minus"]}
|
62
62
|
link="#"
|
63
63
|
text="Similar Artists"
|
64
64
|
{...props}
|
@@ -83,4 +83,4 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
83
83
|
);
|
84
84
|
};
|
85
85
|
|
86
|
-
export default
|
86
|
+
export default CollapsibleNavEmphasize;
|
@@ -0,0 +1 @@
|
|
1
|
+
The `emphasized` prop can be passed to NavItem for a more emphasized look for the collapsible Nav.
|
@@ -7,7 +7,8 @@ examples:
|
|
7
7
|
- borderless_nav: No Borders
|
8
8
|
- subtle_nav: Subtle Variant
|
9
9
|
- subtle_with_icons_nav: Subtle With Icons
|
10
|
-
|
10
|
+
- collapsible_nav: Collapsible Nav
|
11
|
+
- collapsible_nav_emphasize: Collapsible Nav with Emphasize Styling
|
11
12
|
- subtle_no_highlight_nav: Subtle No Highlight
|
12
13
|
- bold_vertical_nav: Bold Variant
|
13
14
|
- horizontal_nav: Horizontal Nav
|
@@ -25,8 +26,9 @@ examples:
|
|
25
26
|
- borderless_nav: No Borders
|
26
27
|
- subtle_nav: Subtle Variant
|
27
28
|
- subtle_with_icons_nav: Subtle With Icons
|
28
|
-
|
29
|
-
|
29
|
+
- collapsible_nav: Collapsible Nav
|
30
|
+
- collapsible_nav_emphasize: Collapsible Nav with Emphasize Styling
|
31
|
+
- collapsible_nav_custom: Collapsible Nav With Custom Toggling
|
30
32
|
- subtle_no_highlight_nav: Subtle No Highlight
|
31
33
|
- bold_vertical_nav: Bold Variant
|
32
34
|
- horizontal_nav: Horizontal Nav
|
@@ -14,4 +14,5 @@ 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
16
|
export { default as CollapsibleNav } from './_collapsible_nav.jsx'
|
17
|
-
export { default as
|
17
|
+
export { default as CollapsibleNavCustom } from './_collapsible_nav_custom.jsx'
|
18
|
+
export { default as CollapsibleNavEmphasize } from "./_collapsible_nav_emphasize.jsx"
|
@@ -0,0 +1,5 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **title** | `String` | Specifies the value of the Pill | | |
|
5
|
+
| **variant** | `Variant` | Changes the color of the Pill | `.neutral` | `.error` `.info` `.neutral` `.primary` `.success` `.warning` |
|
@@ -0,0 +1,10 @@
|
|
1
|
+
![pill-variants](https://github.com/powerhome/playbook/assets/92755007/79ac4260-633e-4429-8b1f-0a97b8178a86)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
PBPill("success", variant: .success)
|
5
|
+
PBPill("error", variant: .error)
|
6
|
+
PBPill("warning", variant: .warning)
|
7
|
+
PBPill("info", variant: .info)
|
8
|
+
PBPill("neutral", variant: .neutral)
|
9
|
+
PBPill("primary", variant: .primary)
|
10
|
+
```
|
@@ -0,0 +1,16 @@
|
|
1
|
+
![radio-alignment](https://github.com/powerhome/playbook/assets/92755007/04b84035-8391-4de1-a33e-8964999d5c0f)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBRadio(
|
6
|
+
items: [
|
7
|
+
PBRadioItem("Power"),
|
8
|
+
.init("Nitro"),
|
9
|
+
.init("Google")
|
10
|
+
],
|
11
|
+
orientation: .horizontal,
|
12
|
+
textAlignment: .vertical,
|
13
|
+
selected: $selectedAlignment
|
14
|
+
)
|
15
|
+
}
|
16
|
+
```
|
@@ -0,0 +1,18 @@
|
|
1
|
+
![radio-custom](https://github.com/powerhome/playbook/assets/92755007/3eab180b-0550-4d7e-b562-84a007690218)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
if let selectedCustom = selectedCustom {
|
6
|
+
Text("Your choice is: \(selectedCustom.title)")
|
7
|
+
}
|
8
|
+
PBRadio(
|
9
|
+
items: [
|
10
|
+
PBRadioItem("Custom Power"),
|
11
|
+
.init("Custom Nitro"),
|
12
|
+
.init("Custom Google")
|
13
|
+
],
|
14
|
+
orientation: .vertical,
|
15
|
+
selected: $selectedCustom
|
16
|
+
)
|
17
|
+
}
|
18
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
![radio-default](https://github.com/powerhome/playbook/assets/92755007/be32852e-de70-4ae0-b8bb-c091f8cfa34b)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBRadio(
|
6
|
+
items: [
|
7
|
+
PBRadioItem("Power"),
|
8
|
+
.init("Nitro"),
|
9
|
+
.init("Google")
|
10
|
+
],
|
11
|
+
orientation: .vertical,
|
12
|
+
selected: $selectedDefault
|
13
|
+
)
|
14
|
+
}
|
15
|
+
```
|
@@ -0,0 +1,14 @@
|
|
1
|
+
![radio-error](https://github.com/powerhome/playbook/assets/92755007/425f499b-4daf-4093-82a7-230b01723287)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBRadio(
|
6
|
+
items: [
|
7
|
+
PBRadioItem("Power")
|
8
|
+
],
|
9
|
+
orientation: .vertical,
|
10
|
+
selected: $selectedError,
|
11
|
+
errorState: true
|
12
|
+
)
|
13
|
+
}
|
14
|
+
```
|
@@ -0,0 +1,15 @@
|
|
1
|
+
![radio-orientation](https://github.com/powerhome/playbook/assets/92755007/f1f8dac7-a7d5-43cf-ba93-92bd624a1016)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBRadio(
|
6
|
+
items: [
|
7
|
+
PBRadioItem("Power"),
|
8
|
+
.init("Nitro"),
|
9
|
+
.init("Google")
|
10
|
+
],
|
11
|
+
orientation: .horizontal,
|
12
|
+
selected: $selectedOrientation
|
13
|
+
)
|
14
|
+
}
|
15
|
+
```
|