playbook_ui_docs 13.27.0.pre.alpha.testingcollapsible2917 → 13.28.0.pre.alpha.PBNTR296dropdownwithform2941
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_collapsible/docs/_collapsible_custom_main.jsx +0 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.md +2 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.html.erb +0 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.md +2 -4
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.jsx +73 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.html.erb +20 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_with_icon_rails.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +2 -1
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_default_swift.md +61 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_date_range_inline_props_swift.md +11 -0
- data/app/pb_kits/playbook/pb_date_range_inline/docs/example.yml +4 -1
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_bold_swift.md +32 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_default_swift.md +17 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_not_current_year_swift.md +19 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_props_swift.md +10 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/_date_stacked_reversed_swift.md +17 -0
- data/app/pb_kits/playbook/pb_date_stacked/docs/example.yml +7 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_alignment_swift.md +39 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_default_swift.md +39 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_props_swift.md +15 -0
- data/app/pb_kits/playbook/pb_date_time/docs/_date_time_size_swift.md +78 -0
- data/app/pb_kits/playbook/pb_date_time/docs/example.yml +6 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display.jsx +6 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.html.erb +11 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options.jsx +5 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.html.erb +13 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger.jsx +5 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.html.erb +13 -8
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_children_swift.md +23 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md +7 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_default_swift.md +9 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_dismiss_with_timer_swift.md +22 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_multi_line_swift.md +9 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_positions_swift.md +62 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md +8 -0
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with.html.erb +11 -1
- data/app/pb_kits/playbook/pb_form/docs/_form_form_with_validate.html.erb +1 -1
- data/dist/playbook-doc.js +6 -6
- metadata +24 -2
@@ -30,14 +30,19 @@
|
|
30
30
|
<%= pb_rails("dropdown/dropdown_container") do %>
|
31
31
|
<% options.each do |option| %>
|
32
32
|
<%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
33
|
+
<%= pb_rails("flex", props: {
|
34
|
+
align: "center",
|
35
|
+
justify: "between",
|
36
|
+
}) do %>
|
37
|
+
<%= pb_rails("flex/flex_item") do %>
|
38
|
+
<%= pb_rails("flex") do %>
|
39
|
+
<%= pb_rails("icon", props: {icon: option[:icon]}) %>
|
40
|
+
<%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<%= pb_rails("flex/flex_item") do %>
|
44
|
+
<%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
|
45
|
+
<% end %>
|
41
46
|
<% end %>
|
42
47
|
<% end %>
|
43
48
|
<% end %>
|
@@ -1 +1 @@
|
|
1
|
-
By default, dropdown option
|
1
|
+
By default, dropdown option paddingX is set to `sm` and paddingY is set to `xs`, but this padding can be overridden using our global padding props. In this example we are setting the option padding to `sm` all around.
|
@@ -51,7 +51,10 @@ const [selectedOption, setSelectedOption] = useState();
|
|
51
51
|
<Dropdown.Option key={option.id}
|
52
52
|
option={option}
|
53
53
|
>
|
54
|
-
|
54
|
+
<Flex
|
55
|
+
align="center"
|
56
|
+
justify="between"
|
57
|
+
>
|
55
58
|
<FlexItem>
|
56
59
|
<Flex>
|
57
60
|
<Icon icon={option.icon}
|
@@ -65,7 +68,7 @@ const [selectedOption, setSelectedOption] = useState();
|
|
65
68
|
text={option.areaCode}
|
66
69
|
/>
|
67
70
|
</FlexItem>
|
68
|
-
|
71
|
+
</Flex>
|
69
72
|
</Dropdown.Option>
|
70
73
|
))}
|
71
74
|
</Dropdown.Container>
|
@@ -32,15 +32,20 @@
|
|
32
32
|
<%= pb_rails("dropdown/dropdown_container", props:{max_width:"xs"}) do %>
|
33
33
|
<% options.each do |option| %>
|
34
34
|
<%= pb_rails("dropdown/dropdown_option", props: {option: option}) do %>
|
35
|
+
<%= pb_rails("flex", props: {
|
36
|
+
align: "center",
|
37
|
+
justify: "between",
|
38
|
+
}) do %>
|
35
39
|
<%= pb_rails("flex/flex_item") do %>
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
40
|
+
<%= pb_rails("flex") do %>
|
41
|
+
<%= pb_rails("icon", props: {icon: option[:icon]}) %>
|
42
|
+
<%= pb_rails("body", props: {text: option[:label], padding_left:"xs"}) %>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
<%= pb_rails("flex/flex_item") do %>
|
46
|
+
<%= pb_rails("body", props: {color:"light", text: option[:areaCode]}) %>
|
47
|
+
<% end %>
|
48
|
+
<% end %>
|
44
49
|
<% end %>
|
45
50
|
<% end %>
|
46
51
|
<% end %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
![Children-Toast](https://github.com/powerhome/playbook-swift/assets/54749071/55aebd12-43c4-4061-92d3-6aebb07ff349)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBToast(
|
6
|
+
text: message,
|
7
|
+
variant: .success,
|
8
|
+
actionView: .custom(AnyView(Text("Undo").pbFont(.title4, color: .white))),
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
PBToast(
|
12
|
+
variant: .custom(nil, .pbPrimary),
|
13
|
+
actionView: .custom(
|
14
|
+
AnyView(
|
15
|
+
HStack {
|
16
|
+
Text("Undo action").pbFont(.caption, color: .white)
|
17
|
+
PBButton(variant: .primary, title: "Undo").disabled(true)
|
18
|
+
}
|
19
|
+
)),
|
20
|
+
dismissAction: closeToast
|
21
|
+
)
|
22
|
+
}
|
23
|
+
```
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_close_swift.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
```swift
|
2
|
+
VStack(alignment: .leading) {
|
3
|
+
PBToast(text: "Error Message", variant: .error, actionView: .default, dismissAction: closeToast)
|
4
|
+
PBToast(text: "Items Successfully Moved", variant: .success, actionView: .default, dismissAction: closeToast)
|
5
|
+
PBToast(text: "Scan to Assign Selected Items", variant: .neutral, actionView: .default, dismissAction: closeToast)
|
6
|
+
}
|
7
|
+
```
|
@@ -0,0 +1,9 @@
|
|
1
|
+
![Default-Toast](https://github.com/powerhome/playbook-swift/assets/54749071/cc465b1b-85ba-4492-a832-b06b842a1555)
|
2
|
+
|
3
|
+
```swift
|
4
|
+
VStack(alignment: .leading) {
|
5
|
+
PBToast(text: "Error Message", variant: .error, dismissAction: closeToast)
|
6
|
+
PBToast(text: "Items Successfully Moved", variant: .success, dismissAction: closeToast)
|
7
|
+
PBToast(text: "Scan to Assign Selected Items", variant: .neutral, dismissAction: closeToast)
|
8
|
+
}
|
9
|
+
```
|
@@ -0,0 +1,22 @@
|
|
1
|
+
```swift
|
2
|
+
HStack {
|
3
|
+
PBButton(variant: .secondary, title: "Top Center") {
|
4
|
+
position = .top
|
5
|
+
toastView = PBToast(
|
6
|
+
text: "Top Center",
|
7
|
+
variant: .neutral,
|
8
|
+
actionView: .withTimer(3),
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
}
|
12
|
+
PBButton(variant: .secondary, title: "Bottom Center") {
|
13
|
+
position = .bottom
|
14
|
+
toastView = PBToast(
|
15
|
+
text: "Bottom Center",
|
16
|
+
variant: .neutral,
|
17
|
+
actionView: .withTimer(2),
|
18
|
+
dismissAction: closeToast
|
19
|
+
)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
```
|
@@ -0,0 +1,62 @@
|
|
1
|
+
```swift
|
2
|
+
GridRow {
|
3
|
+
PBButton(variant: .secondary, title: "Top Left") {
|
4
|
+
position = .topLeft
|
5
|
+
toastView = PBToast(
|
6
|
+
text: "Top Left",
|
7
|
+
variant: .neutral,
|
8
|
+
actionView: .default,
|
9
|
+
dismissAction: closeToast
|
10
|
+
)
|
11
|
+
}
|
12
|
+
PBButton(variant: .secondary, title: "Top Right") {
|
13
|
+
position = .topRight
|
14
|
+
toastView = PBToast(
|
15
|
+
text: "Top Right",
|
16
|
+
variant: .neutral,
|
17
|
+
actionView: .default,
|
18
|
+
dismissAction: closeToast
|
19
|
+
)
|
20
|
+
}
|
21
|
+
}
|
22
|
+
GridRow {
|
23
|
+
PBButton(variant: .secondary, title: "Top Center") {
|
24
|
+
position = .top
|
25
|
+
toastView = PBToast(
|
26
|
+
text: "Top Center",
|
27
|
+
variant: .neutral,
|
28
|
+
actionView: .default,
|
29
|
+
dismissAction: closeToast
|
30
|
+
)
|
31
|
+
}
|
32
|
+
PBButton(variant: .secondary, title: "Bottom Center") {
|
33
|
+
position = .bottom
|
34
|
+
toastView = PBToast(
|
35
|
+
text: "Bottom Center",
|
36
|
+
variant: .custom(.user, .status(.neutral)),
|
37
|
+
actionView: .default,
|
38
|
+
dismissAction: closeToast
|
39
|
+
)
|
40
|
+
}
|
41
|
+
}
|
42
|
+
GridRow {
|
43
|
+
PBButton(variant: .secondary, title: "Bottom Left") {
|
44
|
+
position = .bottomLeft
|
45
|
+
toastView = PBToast(
|
46
|
+
text: "Bottom Left",
|
47
|
+
variant: .custom(.user, .status(.neutral)),
|
48
|
+
actionView: .default,
|
49
|
+
dismissAction: closeToast
|
50
|
+
)
|
51
|
+
}
|
52
|
+
PBButton(variant: .secondary, title: "Bottom Right") {
|
53
|
+
position = .bottomRight
|
54
|
+
toastView = PBToast(
|
55
|
+
text: "Bottom Right",
|
56
|
+
variant: .custom(.user, .status(.neutral)),
|
57
|
+
actionView: .default,
|
58
|
+
dismissAction: closeToast
|
59
|
+
)
|
60
|
+
}
|
61
|
+
}
|
62
|
+
```
|
data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_fixed_confirmation_toast_props_swift.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
### Props
|
2
|
+
| Name | Type | Description | Default | Values |
|
3
|
+
| --- | ----------- | --------- | --------- | --------- |
|
4
|
+
| **text** | `String` |`Value for the toast message` | `nil` | |
|
5
|
+
| **variant** | `Variant` | `Determines the type pf toast message being displayed` | `.custom()` | `error`, `success`,
|
6
|
+
`neutral`, `custom()` |
|
7
|
+
| **actionView** | `dismissAction` | Dismisses the toast message | `.default` | `default` `custom()` `withTimer()` |
|
8
|
+
| **dismissAction** | `(() -> Void)` | `Triggers the dismiss action` | | |
|
@@ -14,3 +14,12 @@ examples:
|
|
14
14
|
- fixed_confirmation_toast_positions: Click to Show Positions
|
15
15
|
- fixed_confirmation_toast_auto_close: Click to Show Auto Close
|
16
16
|
- fixed_confirmation_toast_children: Children
|
17
|
+
|
18
|
+
swift:
|
19
|
+
- fixed_confirmation_toast_default_swift: Default
|
20
|
+
- fixed_confirmation_toast_multi_line_swift: Multi Line
|
21
|
+
#- fixed_confirmation_toast_close_swift: Click to Close
|
22
|
+
#- fixed_confirmation_toast_positions_swift: Click to Show Positions
|
23
|
+
- fixed_confirmation_toast_children_swift: Children
|
24
|
+
#- fixed_confirmation_toast_dismiss_with_timer_swift: Timer
|
25
|
+
- fixed_confirmation_toast_props_swift: ""
|
@@ -13,16 +13,26 @@
|
|
13
13
|
]
|
14
14
|
%>
|
15
15
|
|
16
|
+
<%
|
17
|
+
example_dropdown_options = [
|
18
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
19
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
20
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
21
|
+
]
|
22
|
+
|
23
|
+
%>
|
24
|
+
|
16
25
|
<%= pb_form_with(scope: :example, url: "", method: :get) do |form| %>
|
17
26
|
<%= form.typeahead :example_user, props: { data: { typeahead_example1: true, user: {} }, placeholder: "Search for a user" } %>
|
18
27
|
<%= form.text_field :example_text_field, props: { label: true } %>
|
19
|
-
<%= form.
|
28
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
20
29
|
<%= form.email_field :example_email_field, props: { label: true } %>
|
21
30
|
<%= form.number_field :example_number_field, props: { label: true } %>
|
22
31
|
<%= form.search_field :example_search_field, props: { label: true } %>
|
23
32
|
<%= form.password_field :example_password_field, props: { label: true } %>
|
24
33
|
<%= form.url_field :example_url_field, props: { label: true } %>
|
25
34
|
<%= form.text_area :example_text_area, props: { label: true } %>
|
35
|
+
<%= form.dropdown_field :example_dropdown, props: { label: true, options: example_dropdown_options } %>
|
26
36
|
<%= form.select :example_select, [ ["Yes", 1], ["No", 2] ], props: { label: true } %>
|
27
37
|
<%= form.collection_select :example_collection_select, example_collection, :value, :name, props: { label: true } %>
|
28
38
|
<%= form.check_box :example_checkbox,
|
@@ -15,7 +15,7 @@
|
|
15
15
|
|
16
16
|
<%= pb_form_with(scope: :example, method: :get, url: "", validate: true) do |form| %>
|
17
17
|
<%= form.text_field :example_text_field, props: { label: true, required: true } %>
|
18
|
-
<%= form.
|
18
|
+
<%= form.phone_number_field :example_phone_number_field, props: { label: "Example phone field" } %>
|
19
19
|
<%= form.email_field :example_email_field, props: { label: true, required: true } %>
|
20
20
|
<%= form.number_field :example_number_field, props: { label: true, required: true } %>
|
21
21
|
<%= form.search_field :example_project_number, props: { label: true, required: true, validation: { pattern: "[0-9]{2}-[0-9]{5}", message: "Please enter a valid project number (example: 33-12345)." } } %>
|