playbook_ui_docs 12.36.0 → 12.37.0.pre.alpha.PLAYaddingdatapropselectkit1071
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 +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_icons.jsx +15 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_date/docs/_date_alignment.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_default.jsx +29 -5
- data/app/pb_kits/playbook/pb_date/docs/_date_unstyled.jsx +2 -2
- data/app/pb_kits/playbook/pb_date/docs/_date_variants.jsx +5 -5
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +59 -79
- data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +4 -6
- data/app/pb_kits/playbook/pb_nav/docs/example.yml +1 -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_select/docs/_select_data_attributes.html.erb +24 -0
- data/app/pb_kits/playbook/pb_select/docs/_select_data_attributes.md +1 -0
- data/app/pb_kits/playbook/pb_select/docs/example.yml +1 -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 +10 -15
- metadata +33 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 07d96e66096935be57e79f420aaf89d1cc9c21950f6d37a8318efb9954f90d4b
|
|
4
|
+
data.tar.gz: d10d6102fd9f8fd01a3ace6fc774fe107d20527093ba44e96a59d584353d7f90
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d00b5600928314488dfd4c22cf67ada2264e70a3c5b93c6c484b6037310d6ca4d5e2a859a487fa4a7d41183937c4ff47dec826fb51f6b3dcabf24d827feb669a
|
|
7
|
+
data.tar.gz: a24856ae2b17528c04b506e7f6a18739d8702f6dda09eb54772154d326e4bcc1ecf567ffc96f3544187676c0a71c6f0cfd8eeff876762b0d66b48d4c3e5850aa
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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,8 +1,17 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Collapsible } from '../..'
|
|
2
|
+
import { Collapsible, useCollapsible, Button } from '../..'
|
|
3
3
|
|
|
4
|
-
const CollapsibleIcons = () =>
|
|
5
|
-
|
|
4
|
+
const CollapsibleIcons = () => {
|
|
5
|
+
const [isCollapsed, setIsCollapsed] = useCollapsible(true)
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<>
|
|
9
|
+
<Button onClick={()=> setIsCollapsed(!isCollapsed)}>
|
|
10
|
+
{isCollapsed ? "Expand" : "Collapse"}
|
|
11
|
+
</Button>
|
|
12
|
+
<Collapsible collapsed={isCollapsed}
|
|
13
|
+
icon={['plus','minus']}
|
|
14
|
+
>
|
|
6
15
|
<Collapsible.Main>
|
|
7
16
|
<div>{'Main Section'}</div>
|
|
8
17
|
</Collapsible.Main>
|
|
@@ -14,6 +23,8 @@ const CollapsibleIcons = () => (
|
|
|
14
23
|
</div>
|
|
15
24
|
</Collapsible.Content>
|
|
16
25
|
</Collapsible>
|
|
17
|
-
|
|
26
|
+
</>
|
|
27
|
+
)
|
|
28
|
+
}
|
|
18
29
|
|
|
19
30
|
export default CollapsibleIcons
|
|
@@ -7,7 +7,7 @@ const DateAlignment = (props) => {
|
|
|
7
7
|
<FormattedDate
|
|
8
8
|
dayOfWeek
|
|
9
9
|
icon
|
|
10
|
-
value=
|
|
10
|
+
value={new Date('25 Dec 1995')}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
13
|
|
|
@@ -17,7 +17,7 @@ const DateAlignment = (props) => {
|
|
|
17
17
|
alignment="center"
|
|
18
18
|
dayOfWeek
|
|
19
19
|
icon
|
|
20
|
-
value=
|
|
20
|
+
value={new Date('25 Dec 2020')}
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
23
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Date as FormattedDate } from '../../'
|
|
2
|
+
import { Date as FormattedDate, Caption, Title } from '../../'
|
|
3
3
|
|
|
4
4
|
const DateDefault = (props) => {
|
|
5
5
|
return (
|
|
@@ -12,9 +12,20 @@ const DateDefault = (props) => {
|
|
|
12
12
|
|
|
13
13
|
<br />
|
|
14
14
|
|
|
15
|
+
<div style={{display: "flex", columnGap: 4}}>
|
|
16
|
+
<FormattedDate
|
|
17
|
+
size="sm"
|
|
18
|
+
value={"2012-08-03"}
|
|
19
|
+
{...props}
|
|
20
|
+
/>
|
|
21
|
+
<Caption>{"(Hyphenated Date)"}</Caption>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<br />
|
|
25
|
+
|
|
15
26
|
<FormattedDate
|
|
16
27
|
size="sm"
|
|
17
|
-
value=
|
|
28
|
+
value={new Date('03 Aug 2012')}
|
|
18
29
|
{...props}
|
|
19
30
|
/>
|
|
20
31
|
|
|
@@ -23,7 +34,7 @@ const DateDefault = (props) => {
|
|
|
23
34
|
<FormattedDate
|
|
24
35
|
showDayOfWeek
|
|
25
36
|
size="sm"
|
|
26
|
-
value=
|
|
37
|
+
value={new Date('03 Dec 2017')}
|
|
27
38
|
{...props}
|
|
28
39
|
/>
|
|
29
40
|
|
|
@@ -37,8 +48,21 @@ const DateDefault = (props) => {
|
|
|
37
48
|
|
|
38
49
|
<br />
|
|
39
50
|
|
|
51
|
+
<div style={{display: "flex", columnGap: 4}}>
|
|
52
|
+
<FormattedDate
|
|
53
|
+
value={"2012-08-03"}
|
|
54
|
+
{...props}
|
|
55
|
+
/>
|
|
56
|
+
<Title
|
|
57
|
+
size={4}
|
|
58
|
+
text={"(Hyphenated Date)"}
|
|
59
|
+
/>
|
|
60
|
+
</div>
|
|
61
|
+
|
|
62
|
+
<br />
|
|
63
|
+
|
|
40
64
|
<FormattedDate
|
|
41
|
-
value=
|
|
65
|
+
value={new Date('03 Aug 2012')}
|
|
42
66
|
{...props}
|
|
43
67
|
/>
|
|
44
68
|
|
|
@@ -46,7 +70,7 @@ const DateDefault = (props) => {
|
|
|
46
70
|
|
|
47
71
|
<FormattedDate
|
|
48
72
|
showDayOfWeek
|
|
49
|
-
value=
|
|
73
|
+
value={new Date('03 Dec 2017')}
|
|
50
74
|
{...props}
|
|
51
75
|
/>
|
|
52
76
|
</>
|
|
@@ -21,7 +21,7 @@ const DateUnstyled = (props) => {
|
|
|
21
21
|
<Title size={1}>
|
|
22
22
|
<FormattedDate
|
|
23
23
|
unstyled
|
|
24
|
-
value=
|
|
24
|
+
value={new Date('25 Dec 1995')}
|
|
25
25
|
{...props}
|
|
26
26
|
/>
|
|
27
27
|
</Title>
|
|
@@ -36,7 +36,7 @@ const DateUnstyled = (props) => {
|
|
|
36
36
|
showDayOfWeek
|
|
37
37
|
showIcon
|
|
38
38
|
unstyled
|
|
39
|
-
value=
|
|
39
|
+
value={new Date('25 Dec 1995')}
|
|
40
40
|
{...props}
|
|
41
41
|
/>
|
|
42
42
|
</Caption>
|
|
@@ -7,7 +7,7 @@ const DateVariants = (props) => {
|
|
|
7
7
|
<FormattedDate
|
|
8
8
|
showIcon
|
|
9
9
|
size="sm"
|
|
10
|
-
value=
|
|
10
|
+
value={new Date('25 Dec 1995')}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ const DateVariants = (props) => {
|
|
|
15
15
|
<br />
|
|
16
16
|
|
|
17
17
|
<FormattedDate
|
|
18
|
-
value=
|
|
18
|
+
value={new Date('25 Dec 1995')}
|
|
19
19
|
{...props}
|
|
20
20
|
/>
|
|
21
21
|
|
|
@@ -24,7 +24,7 @@ const DateVariants = (props) => {
|
|
|
24
24
|
|
|
25
25
|
<FormattedDate
|
|
26
26
|
showIcon
|
|
27
|
-
value=
|
|
27
|
+
value={new Date('25 Dec 1995')}
|
|
28
28
|
{...props}
|
|
29
29
|
/>
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ const DateVariants = (props) => {
|
|
|
33
33
|
|
|
34
34
|
<FormattedDate
|
|
35
35
|
showDayOfWeek
|
|
36
|
-
value=
|
|
36
|
+
value={new Date('25 Dec 1995')}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
39
|
|
|
@@ -43,7 +43,7 @@ const DateVariants = (props) => {
|
|
|
43
43
|
<FormattedDate
|
|
44
44
|
showDayOfWeek
|
|
45
45
|
showIcon
|
|
46
|
-
value=
|
|
46
|
+
value={new Date('25 Dec 1995')}
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
49
|
</div>
|
|
@@ -1,83 +1,63 @@
|
|
|
1
|
-
import React from "react"
|
|
2
|
-
|
|
3
|
-
import Nav from "../_nav";
|
|
4
|
-
import NavItem from "../_item";
|
|
1
|
+
import React from "react"
|
|
2
|
+
import { Nav, NavItem, useCollapsible } from "../.."
|
|
5
3
|
|
|
6
4
|
const CollapsibleNav = (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
|
+
|
|
20
|
+
const handleIconRightClick = (index) => {
|
|
21
|
+
const [isCollapsed, setCollapsed] = collapsibles[index]
|
|
22
|
+
setCollapsed(!isCollapsed)
|
|
23
|
+
}
|
|
24
|
+
|
|
7
25
|
return (
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/>
|
|
45
|
-
<NavItem
|
|
46
|
-
link="#"
|
|
47
|
-
text="Food"
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
<NavItem
|
|
51
|
-
link="#"
|
|
52
|
-
text="Style"
|
|
53
|
-
{...props}
|
|
54
|
-
/>
|
|
55
|
-
</NavItem>
|
|
56
|
-
<NavItem
|
|
57
|
-
collapsible
|
|
58
|
-
iconLeft="city"
|
|
59
|
-
link="#"
|
|
60
|
-
text="Similar Artists"
|
|
61
|
-
{...props}
|
|
62
|
-
>
|
|
63
|
-
<NavItem
|
|
64
|
-
link="#"
|
|
65
|
-
text="City"
|
|
66
|
-
{...props}
|
|
67
|
-
/>
|
|
68
|
-
<NavItem
|
|
69
|
-
link="#"
|
|
70
|
-
text="People"
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
<NavItem
|
|
74
|
-
link="#"
|
|
75
|
-
text="Business"
|
|
76
|
-
{...props}
|
|
77
|
-
/>
|
|
78
|
-
</NavItem>
|
|
79
|
-
</Nav>
|
|
80
|
-
);
|
|
81
|
-
};
|
|
26
|
+
<>
|
|
27
|
+
<Nav variant='subtle'>
|
|
28
|
+
{navItems.map((text, index) => {
|
|
29
|
+
const [collapsed] = collapsibles[index]
|
|
30
|
+
return (
|
|
31
|
+
<NavItem
|
|
32
|
+
collapsible
|
|
33
|
+
collapsibleClick={() => handleMainClick(index)}
|
|
34
|
+
iconLeft="chevron-down"
|
|
35
|
+
iconRightClick={() => handleIconRightClick(index)}
|
|
36
|
+
id={`collapsible-nav-item-${index + 1}`}
|
|
37
|
+
key={index}
|
|
38
|
+
link="#"
|
|
39
|
+
text={text}
|
|
40
|
+
toggleCollapsed={collapsed}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<NavItem link="#"
|
|
44
|
+
text="City"
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
<NavItem link="#"
|
|
48
|
+
text="People"
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
<NavItem link="#"
|
|
52
|
+
text="Business"
|
|
53
|
+
{...props}
|
|
54
|
+
/>
|
|
55
|
+
</NavItem>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
</Nav>
|
|
59
|
+
</>
|
|
60
|
+
)
|
|
61
|
+
}
|
|
82
62
|
|
|
83
|
-
export default CollapsibleNav
|
|
63
|
+
export default CollapsibleNav
|
|
@@ -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 CollapsibleNavCustomIcons = (props) => {
|
|
7
5
|
return (
|
|
@@ -9,7 +7,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
|
9
7
|
<NavItem
|
|
10
8
|
collapsible
|
|
11
9
|
iconLeft="city"
|
|
12
|
-
iconRight={["
|
|
10
|
+
iconRight={["plus", "minus"]}
|
|
13
11
|
link="#"
|
|
14
12
|
text="Overview"
|
|
15
13
|
{...props}
|
|
@@ -34,7 +32,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
|
34
32
|
active
|
|
35
33
|
collapsible
|
|
36
34
|
iconLeft="theater-masks"
|
|
37
|
-
iconRight={["
|
|
35
|
+
iconRight={["plus", "minus"]}
|
|
38
36
|
link="#"
|
|
39
37
|
text="Albums"
|
|
40
38
|
{...props}
|
|
@@ -58,7 +56,7 @@ const CollapsibleNavCustomIcons = (props) => {
|
|
|
58
56
|
<NavItem
|
|
59
57
|
collapsible
|
|
60
58
|
iconLeft="city"
|
|
61
|
-
iconRight={["
|
|
59
|
+
iconRight={["plus", "minus"]}
|
|
62
60
|
link="#"
|
|
63
61
|
text="Similar Artists"
|
|
64
62
|
{...props}
|
|
@@ -26,7 +26,7 @@ examples:
|
|
|
26
26
|
- subtle_nav: Subtle Variant
|
|
27
27
|
- subtle_with_icons_nav: Subtle With Icons
|
|
28
28
|
# - collapsible_nav: Subtle With Collapsible
|
|
29
|
-
# - collapsible_nav_custom_icons: Subtle With Collapsible (
|
|
29
|
+
# - collapsible_nav_custom_icons: Subtle With Collapsible (No custom toggling)
|
|
30
30
|
- subtle_no_highlight_nav: Subtle No Highlight
|
|
31
31
|
- bold_vertical_nav: Bold Variant
|
|
32
32
|
- horizontal_nav: Horizontal Nav
|
|
@@ -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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+

|
|
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
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
```swift
|
|
4
|
+
VStack(alignment: .leading) {
|
|
5
|
+
PBRadio(
|
|
6
|
+
items: [
|
|
7
|
+
PBRadioItem("Small")
|
|
8
|
+
],
|
|
9
|
+
orientation: .vertical,
|
|
10
|
+
padding: Spacing.small,
|
|
11
|
+
selected: $selectedPadding
|
|
12
|
+
)
|
|
13
|
+
PBRadio(
|
|
14
|
+
items: [
|
|
15
|
+
PBRadioItem("Medium")
|
|
16
|
+
],
|
|
17
|
+
orientation: .vertical,
|
|
18
|
+
padding: Spacing.medium,
|
|
19
|
+
selected: $selectedPadding
|
|
20
|
+
)
|
|
21
|
+
PBRadio(
|
|
22
|
+
items: [
|
|
23
|
+
PBRadioItem("Large")
|
|
24
|
+
],
|
|
25
|
+
orientation: .vertical,
|
|
26
|
+
padding: Spacing.large,
|
|
27
|
+
selected: $selectedPadding
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
### Props
|
|
2
|
+
| Name | Type | Description | Default | Values |
|
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
|
4
|
+
| **items** | `PBRadioItem` | Specifies the value of the Radio buttons | | |
|
|
5
|
+
| **orientation** | `Orientation` | Changes between stacked or inline Radio items | `.vertical` | |
|
|
6
|
+
| **textAlignment** | `Orientation` | Changes lable position | `.horizontal` | |
|
|
7
|
+
| **spacing** | `CGFloat` | Applies padding around Radio and lable | `Spacing.xSmall` | `Spacing.none` `Spacing.xxSmall` `Spacing.xSmall` `Spacing.small` `Spacing.medium` `Spacing.large` `Spacing.xLarge` |
|
|
8
|
+
| **padding** | `CGFloat` | Applies padding between Radio and lable | `Spacing.xSmall` | `Spacing.none` `Spacing.xxSmall` `Spacing.xSmall` `Spacing.small` `Spacing.medium` `Spacing.large` `Spacing.xLarge` |
|
|
9
|
+
| **errorState** | `Bool` | Changes Radio to error styling | | |
|
|
10
|
+
| **selected** | `PBRadioItem?` | Sets selected Radio item | | |
|