playbook_ui_docs 13.27.0 → 13.28.0.pre.alpha.PBNTR297gradientoverlay3029
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_advanced_table/docs/_advanced_table_beta_subrow_headers.html.erb +40 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_beta_subrow_headers.md +3 -0
- data/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_subrow_headers.md +1 -1
- data/app/pb_kits/playbook/pb_advanced_table/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.html.erb +46 -66
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.jsx +8 -29
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_badge_component_overlay.md +3 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.html.erb +13 -33
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.jsx +48 -67
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_circle_icon_component_overlay.md +3 -0
- data/app/pb_kits/playbook/pb_avatar/docs/_avatar_default.jsx +0 -20
- data/app/pb_kits/playbook/pb_avatar/docs/example.yml +2 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.md +2 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/{_bar_graph_custom.html.erb → _bar_graph_custom_rails.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +2 -0
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.html.erb +20 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_background.jsx +41 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_background.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.html.erb +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_header.md +1 -1
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.md +1 -1
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.jsx +72 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main.md +3 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.html.erb +19 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/_collapsible_custom_main_rails.md +3 -0
- 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 +7 -0
- data/app/pb_kits/playbook/pb_collapsible/docs/index.js +3 -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_draggable/docs/_draggable_default.jsx +53 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_multiple_containers.jsx +159 -0
- data/app/pb_kits/playbook/pb_draggable/docs/_draggable_with_cards.jsx +121 -0
- data/app/pb_kits/playbook/pb_draggable/docs/example.yml +9 -0
- data/app/pb_kits/playbook/pb_draggable/docs/index.js +3 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_default.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure.md +5 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_subcomponent_structure.html.erb → _dropdown_subcomponent_structure_rails.html.erb} +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_subcomponent_structure_rails.md +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.md +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_display.html.erb → _dropdown_with_custom_display_rails.html.erb} +11 -6
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_display_rails.md +5 -0
- 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.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_options.html.erb → _dropdown_with_custom_options_rails.html.erb} +16 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_options_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_padding.html.erb +3 -3
- 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.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/{_dropdown_with_custom_trigger.html.erb → _dropdown_with_custom_trigger_rails.html.erb} +16 -11
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_custom_trigger_rails.md +1 -0
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.html.erb +3 -3
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_with_label.md +1 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +6 -6
- 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/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.jsx +40 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_default.md +7 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.jsx +36 -0
- data/app/pb_kits/playbook/pb_overlay/docs/_overlay_multi_directional.md +5 -0
- data/app/pb_kits/playbook/pb_overlay/docs/example.yml +4 -0
- data/app/pb_kits/playbook/pb_overlay/docs/index.js +2 -0
- data/app/pb_kits/playbook/pb_pill/docs/_description.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.jsx +33 -32
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_column_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.jsx +33 -33
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.html.erb +34 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_row_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.jsx +51 -50
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.md +1 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.html.erb +54 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data_rails.md +2 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.jsx +37 -38
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.html.erb +53 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row_rails.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_row.html.erb → _table_outer_padding.html.erb} +7 -7
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.jsx +76 -0
- data/app/pb_kits/playbook/pb_table/docs/_table_outer_padding.md +1 -0
- data/app/pb_kits/playbook/pb_table/docs/example.yml +9 -9
- data/app/pb_kits/playbook/pb_table/docs/index.js +1 -0
- data/dist/app/components/playbook/pb_docs/kit_example.html.erb +3 -3
- data/dist/menu.yml +9 -4
- data/dist/playbook-doc.js +10 -10
- metadata +68 -14
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_data.html.erb +0 -63
- data/app/pb_kits/playbook/pb_table/docs/_table_alignment_shift_row.html.erb +0 -52
- /data/app/pb_kits/playbook/pb_table/docs/{_table_alignment_column.html.erb → _table_alignment_column_rails.html.erb} +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
Optionally replace the default trigger's select element by passing child components directly to the `dropdown/dropdown_trigger`.
|
@@ -1,8 +1,8 @@
|
|
1
1
|
<%
|
2
2
|
options = [
|
3
|
-
{ label: 'United States', value: 'United States' },
|
4
|
-
{ label: 'Canada', value: 'Canada' },
|
5
|
-
{ label: 'Pakistan', value: 'Pakistan' },
|
3
|
+
{ label: 'United States', value: 'United States', id: 'us' },
|
4
|
+
{ label: 'Canada', value: 'Canada', id: 'ca' },
|
5
|
+
{ label: 'Pakistan', value: 'Pakistan', id: 'pk' },
|
6
6
|
]
|
7
7
|
|
8
8
|
%>
|
@@ -1 +1 @@
|
|
1
|
-
The
|
1
|
+
The top-level Dropdown component optionally accepts any string through a `label` prop to produce a label above your trigger element.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
examples:
|
2
2
|
rails:
|
3
3
|
- dropdown_default: Default
|
4
|
-
-
|
4
|
+
- dropdown_subcomponent_structure_rails: Subcomponent Structure
|
5
5
|
- dropdown_with_label: With Label
|
6
|
-
-
|
7
|
-
-
|
8
|
-
-
|
9
|
-
- dropdown_with_custom_padding: Custom Padding
|
6
|
+
- dropdown_with_custom_options_rails: Custom Options
|
7
|
+
- dropdown_with_custom_display_rails: Custom Display
|
8
|
+
- dropdown_with_custom_trigger_rails: Custom Trigger
|
9
|
+
- dropdown_with_custom_padding: Custom Option Padding
|
10
10
|
|
11
11
|
react:
|
12
12
|
- dropdown_default: Default
|
@@ -15,7 +15,7 @@ examples:
|
|
15
15
|
- dropdown_with_custom_options: Custom Options
|
16
16
|
- dropdown_with_custom_display: Custom Display
|
17
17
|
- dropdown_with_custom_trigger: Custom Trigger
|
18
|
-
- dropdown_with_custom_padding: Custom Padding
|
18
|
+
- dropdown_with_custom_padding: Custom Option Padding
|
19
19
|
# - dropdown_with_autocomplete: Autocomplete
|
20
20
|
# - dropdown_with_autocomplete_and_custom_display: Autocomplete with Custom Display
|
21
21
|
# - dropdown_with_external_control: useDropdown Hook
|
@@ -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)." } } %>
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import {
|
3
|
+
Overlay,
|
4
|
+
Table,
|
5
|
+
} from '../..'
|
6
|
+
|
7
|
+
const TableExample = () => {
|
8
|
+
return (
|
9
|
+
<Table size="sm">
|
10
|
+
<thead>
|
11
|
+
<tr>
|
12
|
+
<th>{'Column 1'}</th>
|
13
|
+
<th>{'Column 2'}</th>
|
14
|
+
<th>{'Column 3'}</th>
|
15
|
+
<th>{'Column 4'}</th>
|
16
|
+
<th>{'Column 5'}</th>
|
17
|
+
</tr>
|
18
|
+
</thead>
|
19
|
+
<tbody>
|
20
|
+
{Array.from({ length: 7 }, (_, index) => (
|
21
|
+
<tr key={index}>
|
22
|
+
{Array.from({ length: 5 }, (_, columnIndex) => (
|
23
|
+
<td key={columnIndex}>{`Value ${columnIndex + 1}`}</td>
|
24
|
+
))}
|
25
|
+
</tr>
|
26
|
+
))}
|
27
|
+
</tbody>
|
28
|
+
</Table>
|
29
|
+
)
|
30
|
+
}
|
31
|
+
|
32
|
+
const OverlayDefault = () => (
|
33
|
+
<>
|
34
|
+
<Overlay>
|
35
|
+
<TableExample />
|
36
|
+
</Overlay>
|
37
|
+
</>
|
38
|
+
)
|
39
|
+
|
40
|
+
export default OverlayDefault
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Overlays require a `color`, which sets the "start" (opaque) color of a gradient mask. Because this overlay is intended to reveal underlying content, the "end" color is fixed to transparent.
|
2
|
+
|
3
|
+
The optional `layout` prop accepts a `position` and a `size` as a key:value pair object.
|
4
|
+
|
5
|
+
The `position` prop sets the side where the `color` overlay starts. The direction of the overlay is always toward the opposite side of the position. For example, the default position of `bottom` starts the overlay on the bottom edge of your container and extends it toward the opposite side: the top.
|
6
|
+
|
7
|
+
The `size` prop accepts a percentage value as a string and literally translates to how much of the container is covered by the overlay. By default, `size` is set to `100%` so that your overlay covers the entire container with a smooth fade from `color` at its starting edge, fading to transparent and ending at the containers opposite edge.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react'
|
2
|
+
import {
|
3
|
+
Overlay,
|
4
|
+
Card,
|
5
|
+
Flex,
|
6
|
+
FlexItem,
|
7
|
+
} from '../..'
|
8
|
+
|
9
|
+
const InlineCardsExample = () => {
|
10
|
+
return (
|
11
|
+
<Flex
|
12
|
+
columnGap="lg"
|
13
|
+
orientation="row"
|
14
|
+
overflowX="auto"
|
15
|
+
>
|
16
|
+
{Array.from({ length: 15 }, (_, index) => (
|
17
|
+
<FlexItem key={index}>
|
18
|
+
<Card>{"Card Content"}</Card>
|
19
|
+
</FlexItem>
|
20
|
+
))}
|
21
|
+
</Flex>
|
22
|
+
)
|
23
|
+
}
|
24
|
+
|
25
|
+
const OverlayMultiDirectional = () => (
|
26
|
+
<>
|
27
|
+
<Overlay
|
28
|
+
color="white"
|
29
|
+
layout={{"left-right": "10%"}}
|
30
|
+
>
|
31
|
+
<InlineCardsExample />
|
32
|
+
</Overlay>
|
33
|
+
</>
|
34
|
+
)
|
35
|
+
|
36
|
+
export default OverlayMultiDirectional
|
@@ -0,0 +1,5 @@
|
|
1
|
+
Optionally, you can pass multi-directional options (`left-right` or `top-bottom`) to the `position` prop, which create multiple overlays.
|
2
|
+
|
3
|
+
Your `color` is still applied as the starting edge to both overlays, and each mask will fade to transparent moving toward its opposite edge, ending at the `size` percentage you set.
|
4
|
+
|
5
|
+
NOTE: Multi-directional overlays share the available container space, so passing a size greater than "50%" to a multi-directional overlay will cause your masks to overlap at the midline of your container. As a best practice, we do not recommend exceeding a size of 25% when using multi-directional overlays.
|
@@ -1 +1 @@
|
|
1
|
-
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color
|
1
|
+
A pill uses both a keyword and a specific color to categorize an item. Each pill directly corresponds to a data color <a href="https://playbook.powerapp.cloud/visual_guidelines/colors" target="_blank">here</a>.
|
@@ -7,39 +7,40 @@ const TableAlignmentColumn = (props) => {
|
|
7
7
|
<Table
|
8
8
|
{...props}
|
9
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
|
-
|
10
|
+
<Table.Head>
|
11
|
+
<Table.Row>
|
12
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
13
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
14
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
15
|
+
<Table.Header textAlign="center">{'Rating'}</Table.Header>
|
16
|
+
<Table.Header textAlign="right">{'Money'}</Table.Header>
|
17
|
+
</Table.Row>
|
18
|
+
</Table.Head>
|
19
|
+
<Table.Body>
|
20
|
+
<Table.Row>
|
21
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
22
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
23
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
24
|
+
<Table.Cell textAlign="center">{'3'}</Table.Cell>
|
25
|
+
<Table.Cell textAlign="right">{'$57.32'}</Table.Cell>
|
26
|
+
</Table.Row>
|
27
|
+
<Table.Row>
|
28
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
29
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
30
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
31
|
+
<Table.Cell textAlign="center">{'2'}</Table.Cell>
|
32
|
+
<Table.Cell textAlign="right">{'$5,657.08'}</Table.Cell>
|
33
|
+
</Table.Row>
|
34
|
+
<Table.Row>
|
35
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
36
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
37
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
38
|
+
<Table.Cell textAlign="center">{'4'}</Table.Cell>
|
39
|
+
<Table.Cell textAlign="right">{'$358.77'}</Table.Cell>
|
40
|
+
</Table.Row>
|
41
|
+
</Table.Body>
|
42
42
|
</Table>
|
43
|
+
|
43
44
|
)
|
44
45
|
}
|
45
46
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Pass our `textAlign` global prop to any `table.cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
2
|
In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
|
@@ -0,0 +1,2 @@
|
|
1
|
+
Pass our `text_align` global prop to any `table/table_cell` subcomponent to change the text alignment of individual cells, or apply this prop persistently to align entire columns.
|
2
|
+
In the table above the "Rating" column contents is centered and the "Money" column contents is right aligned.
|
@@ -7,39 +7,39 @@ const TableAlignmentRow = (props) => {
|
|
7
7
|
<Table
|
8
8
|
{...props}
|
9
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
|
-
|
10
|
+
<Table.Head>
|
11
|
+
<Table.Row>
|
12
|
+
<Table.Header>{'Column 1'}</Table.Header>
|
13
|
+
<Table.Header>{'Column 2'}</Table.Header>
|
14
|
+
<Table.Header>{'Column 3'}</Table.Header>
|
15
|
+
<Table.Header>{'Column 4'}</Table.Header>
|
16
|
+
<Table.Header>{'Column 5'}</Table.Header>
|
17
|
+
</Table.Row>
|
18
|
+
</Table.Head>
|
19
|
+
<Table.Body>
|
20
|
+
<Table.Row>
|
21
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
22
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
23
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
24
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
25
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
26
|
+
</Table.Row>
|
27
|
+
<Table.Row textAlign="center">
|
28
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
29
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
30
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
31
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
32
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
33
|
+
</Table.Row>
|
34
|
+
<Table.Row textAlign="right">
|
35
|
+
<Table.Cell>{'Value 1'}</Table.Cell>
|
36
|
+
<Table.Cell>{'Value 2'}</Table.Cell>
|
37
|
+
<Table.Cell>{'Value 3'}</Table.Cell>
|
38
|
+
<Table.Cell>{'Value 4'}</Table.Cell>
|
39
|
+
<Table.Cell>{'Value 5'}</Table.Cell>
|
40
|
+
</Table.Row>
|
41
|
+
</Table.Body>
|
42
|
+
</Table>
|
43
43
|
)
|
44
44
|
}
|
45
45
|
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
Pass our `textAlign` global prop to any `table.row` subcomponent to change the text alignment of all cells within that row.
|
2
2
|
The header/ first row is the default, followed by the second row being centered, and then the last row shifted to the right.
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= pb_rails("table") do %>
|
2
|
+
<%= pb_rails("table/table_head") do %>
|
3
|
+
<%= pb_rails("table/table_row") do %>
|
4
|
+
<%= pb_rails("table/table_header", props: { text: "Column 1"}) %>
|
5
|
+
<%= pb_rails("table/table_header", props: { text: "Column 2"}) %>
|
6
|
+
<%= pb_rails("table/table_header", props: { text: "Column 3"}) %>
|
7
|
+
<%= pb_rails("table/table_header", props: { text: "Column 4"}) %>
|
8
|
+
<%= pb_rails("table/table_header", props: { text: "Column 5"}) %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<%= pb_rails("table/table_body") do %>
|
12
|
+
<%= pb_rails("table/table_row") do %>
|
13
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
14
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
15
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
16
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
17
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
18
|
+
<% end %>
|
19
|
+
<%= pb_rails("table/table_row", props: { text_align: "center" }) do %>
|
20
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
21
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
22
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
23
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
24
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
25
|
+
<% end %>
|
26
|
+
<%= pb_rails("table/table_row", props: { text_align: "right" }) do %>
|
27
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 1"}) %>
|
28
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 2"}) %>
|
29
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 3"}) %>
|
30
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 4"}) %>
|
31
|
+
<%= pb_rails("table/table_cell", props: { text: "Value 5"}) %>
|
32
|
+
<% end %>
|
33
|
+
<% end %>
|
34
|
+
<% end %>
|