playbook_ui_docs 12.36.0.pre.alpha.PLAY942collapsiblenav21035 → 12.36.0.pre.alpha.svgiconmethods1059

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_badge/docs/_badge_colors_swift.md +33 -0
  3. data/app/pb_kits/playbook/pb_badge/docs/_badge_default_swift.md +9 -0
  4. data/app/pb_kits/playbook/pb_badge/docs/_badge_notification_swift.md +9 -0
  5. data/app/pb_kits/playbook/pb_badge/docs/_badge_props_swift.md +6 -0
  6. data/app/pb_kits/playbook/pb_badge/docs/_badge_rounded_swift.md +9 -0
  7. data/app/pb_kits/playbook/pb_badge/docs/example.yml +7 -0
  8. data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_icons.jsx +4 -15
  9. data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +2 -2
  10. data/app/pb_kits/playbook/pb_icon/docs/_icon_animate.html.erb +1 -0
  11. data/app/pb_kits/playbook/pb_icon/docs/_icon_custom.html.erb +2 -0
  12. data/app/pb_kits/playbook/pb_icon/docs/_icon_svg.html.erb +4 -0
  13. data/app/pb_kits/playbook/pb_icon/docs/example.yml +10 -9
  14. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav.jsx +79 -59
  15. data/app/pb_kits/playbook/pb_nav/docs/_collapsible_nav_custom_icons.jsx +6 -4
  16. data/app/pb_kits/playbook/pb_nav/docs/example.yml +2 -2
  17. data/app/pb_kits/playbook/pb_pill/docs/_pill_default_swift.md +5 -0
  18. data/app/pb_kits/playbook/pb_pill/docs/_pill_props_swift.md +5 -0
  19. data/app/pb_kits/playbook/pb_pill/docs/_pill_variants_swift.md +10 -0
  20. data/app/pb_kits/playbook/pb_pill/docs/example.yml +5 -0
  21. data/app/pb_kits/playbook/pb_radio/docs/_radio_alignment_swift.md +16 -0
  22. data/app/pb_kits/playbook/pb_radio/docs/_radio_custom_swift.md +18 -0
  23. data/app/pb_kits/playbook/pb_radio/docs/_radio_default_swift.md +15 -0
  24. data/app/pb_kits/playbook/pb_radio/docs/_radio_error_swift.md +14 -0
  25. data/app/pb_kits/playbook/pb_radio/docs/_radio_orientation_swift.md +15 -0
  26. data/app/pb_kits/playbook/pb_radio/docs/_radio_padding_swift.md +31 -0
  27. data/app/pb_kits/playbook/pb_radio/docs/_radio_props_swift.md +10 -0
  28. data/app/pb_kits/playbook/pb_radio/docs/_radio_spacing_swift.md +36 -0
  29. data/app/pb_kits/playbook/pb_radio/docs/_radio_subtitle_swift.md +13 -0
  30. data/app/pb_kits/playbook/pb_radio/docs/example.yml +11 -0
  31. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_align_swift.md +45 -0
  32. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_default_swift.md +26 -0
  33. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_elapsed_swift.md +25 -0
  34. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_props_swift.md +10 -0
  35. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_timezones_swift.md +67 -0
  36. data/app/pb_kits/playbook/pb_timestamp/docs/_timestamp_updated_swift.md +19 -0
  37. data/app/pb_kits/playbook/pb_timestamp/docs/example.yml +8 -0
  38. data/dist/playbook-doc.js +9 -9
  39. metadata +26 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b453a77a2422494201dd6202d01f9b3aff94e53065d91b29c1b2a8eb27438701
4
- data.tar.gz: 6dd607e3ecf738ad46073dee29bd6a6ba9b1e046d90e88621bae4323cf7b022b
3
+ metadata.gz: 40a0b8b840f08f4f592d810168905fa77f431b2edc0382bb2664b71b177d54cb
4
+ data.tar.gz: 795e80d49d33b384f3864441c858f1c8925153e5a34e6e0b1427f246b02e0059
5
5
  SHA512:
6
- metadata.gz: e09acd61f4b5a6d425ecc37153e673ba42c2ab3dd679426be13626d85641b2ecef53836621e8b37f6277e26d5d09cd27bec0089ddaeca716a153561b5ec2acbc
7
- data.tar.gz: 4109215a81dd5453ad4215537e3b5fe7ed95a0673b36457711588412304fedca1e3df2783cecf79ce30a5311d9590cca062b612657210545eb2ff30742e0d9cb
6
+ metadata.gz: e2555c18b8806ff4bebaf36c50f1da95fa79bc251c14416288593cf7d4e2e051d8596fdc01b1276d3a13d51794132d00d5b834ac917dcd0cecf23c7ff8c514e2
7
+ data.tar.gz: '00823a06c9e4ef61fe0d0b885ce2f3948fb9cbd39c31e7b583560ecdcadaa4f9b69df89d60ea87520a86c08d6cde1a57997c2469c32b6c21245f03539bd04695'
@@ -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,17 +1,8 @@
1
1
  import React from 'react'
2
- import { Collapsible, useCollapsible, Button } from '../..'
2
+ import { Collapsible } from '../..'
3
3
 
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
- >
4
+ const CollapsibleIcons = () => (
5
+ <Collapsible icon={['plus','minus']}>
15
6
  <Collapsible.Main>
16
7
  <div>{'Main Section'}</div>
17
8
  </Collapsible.Main>
@@ -23,8 +14,6 @@ const CollapsibleIcons = () => {
23
14
  </div>
24
15
  </Collapsible.Content>
25
16
  </Collapsible>
26
- </>
27
- )
28
- }
17
+ )
29
18
 
30
19
  export default CollapsibleIcons
@@ -4,10 +4,10 @@ examples:
4
4
  - collapsible_default: Default
5
5
  - collapsible_size: Size
6
6
  - collapsible_color: Color
7
- - collapsible_icons: Custom Icons
7
+ # - collapsible_icons: Custom Icons
8
8
 
9
9
  react:
10
10
  - collapsible_default: Default
11
11
  - collapsible_size: Size
12
12
  - collapsible_color: Color
13
- - collapsible_icons: Custom Icons
13
+ # - collapsible_icons: Custom Icons
@@ -1,3 +1,4 @@
1
1
  <p><%= pb_rails("icon", props: { icon: "spinner", spin: true, fixed_width: true, size: "2x" }) %> <span>Spin</span></p>
2
2
  <br/>
3
3
  <p><%= pb_rails("icon", props: { icon: "spinner", pulse: true, fixed_width: true, size: "2x" }) %> <span>Pulse</span></p>
4
+
@@ -14,3 +14,5 @@
14
14
  parent element's css color properties."
15
15
  } ) %>
16
16
  </div>
17
+
18
+
@@ -0,0 +1,4 @@
1
+ <%= pb_rails("icon", props: { size: "5x", custom_icon: "copilot", padding_left: "xl" } ) %>
2
+ <%= pb_rails("icon", props: { size: "5x", custom_icon: "squirrel" } ) %>
3
+ <%= pb_rails("icon", props: { size: "5x", custom_icon: "star" } ) %>
4
+
@@ -1,14 +1,15 @@
1
1
  examples:
2
2
  rails:
3
- - icon_default: Icon Default
4
- - icon_rotate: Icon Rotate
5
- - icon_flip: Icon Flip
6
- - icon_animate: Icon Animation
7
- - icon_pull: Icon Pull
8
- - icon_border: Icon Border
9
- - icon_sizes: Icon Sizes
10
- - icon_custom: Icon Custom
11
- - icon_fa_kit: Icon with FontAwesome Kit
3
+ # - icon_default: Icon Default
4
+ # - icon_rotate: Icon Rotate
5
+ # - icon_flip: Icon Flip
6
+ # - icon_animate: Icon Animation
7
+ # - icon_pull: Icon Pull
8
+ # - icon_border: Icon Border
9
+ # - icon_sizes: Icon Sizes
10
+ # - icon_custom: Icon Custom
11
+ # - icon_fa_kit: Icon with FontAwesome Kit
12
+ - icon_svg: Icon SVG
12
13
 
13
14
  react:
14
15
  - icon_default: Icon Default
@@ -1,63 +1,83 @@
1
- import React from "react"
2
- import { Nav, NavItem, useCollapsible } from "../.."
3
-
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
- }
1
+ import React from "react";
18
2
 
3
+ import Nav from "../_nav";
4
+ import NavItem from "../_item";
19
5
 
20
- const handleIconRightClick = (index) => {
21
- const [isCollapsed, setCollapsed] = collapsibles[index]
22
- setCollapsed(!isCollapsed)
23
- }
24
-
6
+ const CollapsibleNav = (props) => {
25
7
  return (
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
- }
8
+ <Nav variant="subtle">
9
+ <NavItem
10
+ collapsible
11
+ iconLeft="city"
12
+ link="#"
13
+ text="Overview"
14
+ {...props}
15
+ >
16
+ <NavItem
17
+ link="#"
18
+ text="City"
19
+ {...props}
20
+ />
21
+ <NavItem
22
+ link="#"
23
+ text="People"
24
+ {...props}
25
+ />
26
+ <NavItem
27
+ link="#"
28
+ text="Business"
29
+ {...props}
30
+ />
31
+ </NavItem>
32
+ <NavItem
33
+ active
34
+ collapsible
35
+ iconLeft="theater-masks"
36
+ link="#"
37
+ text="Albums"
38
+ {...props}
39
+ >
40
+ <NavItem
41
+ link="#"
42
+ text="Entertainment"
43
+ {...props}
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
+ };
62
82
 
63
- export default CollapsibleNav
83
+ export default CollapsibleNav;
@@ -1,5 +1,7 @@
1
1
  import React from "react";
2
- import { Nav, NavItem } from '../..'
2
+
3
+ import Nav from "../_nav";
4
+ import NavItem from "../_item";
3
5
 
4
6
  const CollapsibleNavCustomIcons = (props) => {
5
7
  return (
@@ -7,7 +9,7 @@ const CollapsibleNavCustomIcons = (props) => {
7
9
  <NavItem
8
10
  collapsible
9
11
  iconLeft="city"
10
- iconRight={["plus", "minus"]}
12
+ iconRight={["chevron-down", "chevron-up"]}
11
13
  link="#"
12
14
  text="Overview"
13
15
  {...props}
@@ -32,7 +34,7 @@ const CollapsibleNavCustomIcons = (props) => {
32
34
  active
33
35
  collapsible
34
36
  iconLeft="theater-masks"
35
- iconRight={["plus", "minus"]}
37
+ iconRight={["chevron-down", "chevron-up"]}
36
38
  link="#"
37
39
  text="Albums"
38
40
  {...props}
@@ -56,7 +58,7 @@ const CollapsibleNavCustomIcons = (props) => {
56
58
  <NavItem
57
59
  collapsible
58
60
  iconLeft="city"
59
- iconRight={["plus", "minus"]}
61
+ iconRight={["chevron-down", "chevron-up"]}
60
62
  link="#"
61
63
  text="Similar Artists"
62
64
  {...props}
@@ -25,8 +25,8 @@ examples:
25
25
  - borderless_nav: No Borders
26
26
  - subtle_nav: Subtle Variant
27
27
  - subtle_with_icons_nav: Subtle With Icons
28
- - collapsible_nav: Subtle With Collapsible
29
- - collapsible_nav_custom_icons: Subtle With Collapsible (No custom toggling)
28
+ # - collapsible_nav: Subtle With Collapsible
29
+ # - collapsible_nav_custom_icons: Subtle With Collapsible (Custom Toggle Icons)
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
+ ![pill-default](https://github.com/powerhome/playbook/assets/92755007/608cb5dd-9400-45f4-afb2-ac1bbd972c3d)
2
+
3
+ ```swift
4
+ PBPill("default")
5
+ ```
@@ -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
+ ```
@@ -11,3 +11,8 @@ examples:
11
11
  - pill_default: Default
12
12
  - pill_variants: Variants
13
13
  - pill_example: Example
14
+
15
+ swift:
16
+ - pill_default_swift: Default
17
+ - pill_variants_swift: Variants
18
+ - pill_props_swift: ""
@@ -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
+ ```
@@ -0,0 +1,31 @@
1
+ ![radio-padding](https://github.com/powerhome/playbook/assets/92755007/5cb123fb-791b-43f7-a57e-336f93c1bb3a)
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 | | |
@@ -0,0 +1,36 @@
1
+ ![radio-spacing](https://github.com/powerhome/playbook/assets/92755007/58d1bf02-0c79-4526-9e5c-ba2f631d1dfe)
2
+
3
+ ```swift
4
+ HStack(alignment: .top) {
5
+ PBRadio(
6
+ items: [
7
+ PBRadioItem("Small"),
8
+ .init("Small Spacing"),
9
+ .init("Small Power")
10
+ ],
11
+ orientation: .vertical,
12
+ spacing: Spacing.small,
13
+ selected: $selectedSpacing
14
+ )
15
+ PBRadio(
16
+ items: [
17
+ PBRadioItem("Medium"),
18
+ .init("Medium Spacing"),
19
+ .init("Medium Power")
20
+ ],
21
+ orientation: .vertical,
22
+ spacing: Spacing.medium,
23
+ selected: $selectedSpacing
24
+ )
25
+ PBRadio(
26
+ items: [
27
+ PBRadioItem("Large"),
28
+ .init("Large Spacing"),
29
+ .init("Large Power")
30
+ ],
31
+ orientation: .vertical,
32
+ spacing: Spacing.large,
33
+ selected: $selectedSpacing
34
+ )
35
+ }
36
+ ```
@@ -0,0 +1,13 @@
1
+ ![radio-subtitle](https://github.com/powerhome/playbook/assets/92755007/1244f4d4-0e87-4b5a-9b20-ac2223866321)
2
+
3
+ ```swift
4
+ VStack(alignment: .leading) {
5
+ PBRadio(
6
+ items: [
7
+ PBRadioItem("Power", subtitle: "subtitle")
8
+ ],
9
+ selected: $selectedSubtitle
10
+ )
11
+ }
12
+
13
+ ```
@@ -12,3 +12,14 @@ examples:
12
12
  - radio_custom: Custom
13
13
  - radio_error: With Error
14
14
  - radio_alignment: Alignment
15
+
16
+ swift:
17
+ - radio_default_swift: Default
18
+ - radio_custom_swift: Custom
19
+ - radio_error_swift: With Error
20
+ - radio_orientation_swift: Orientation
21
+ - radio_alignment_swift: Alignment
22
+ - radio_spacing_swift: Spacing
23
+ - radio_padding_swift: Padding
24
+ - radio_subtitle_swift: Subtitle
25
+ - radio_props_swift: ""
@@ -0,0 +1,45 @@
1
+ ![timestamp-align](https://github.com/powerhome/playbook/assets/92755007/9107e699-218e-4a15-a0f9-b1a8f4710c37)
2
+
3
+ ```swiftå
4
+ VStack(alignment: .leading, spacing: Spacing.small) {
5
+ Group {
6
+ PBTimestamp(
7
+ Date(),
8
+ showDate: false
9
+ )
10
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .leading)
11
+ PBTimestamp(Date())
12
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .leading)
13
+ PBTimestamp(Date().addingTimeInterval(addThreeYear))
14
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .leading)
15
+ PBTimestamp(Date().addingTimeInterval(subOneYear))
16
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .leading)
17
+ }
18
+ Group {
19
+ PBTimestamp(
20
+ Date(),
21
+ showDate: false
22
+ )
23
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .center)
24
+ PBTimestamp(Date())
25
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .center)
26
+ PBTimestamp(Date().addingTimeInterval(addThreeYear))
27
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .center)
28
+ PBTimestamp(Date().addingTimeInterval(subOneYear))
29
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .center)
30
+ }
31
+ Group {
32
+ PBTimestamp(
33
+ Date(),
34
+ showDate: false
35
+ )
36
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .trailing)
37
+ PBTimestamp(Date())
38
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .trailing)
39
+ PBTimestamp(Date().addingTimeInterval(addThreeYear))
40
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .trailing)
41
+ PBTimestamp(Date().addingTimeInterval(subOneYear))
42
+ .frame(minWidth: minWidth, maxWidth: .infinity, alignment: .trailing)
43
+ }
44
+ }
45
+ ```