playbook_ui 18.4.0.pre.rc.2 → 18.4.0.pre.rc.3
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_advanced_table/docs/_playground.json +7 -1
- data/app/pb_kits/playbook/pb_advanced_table/kit.schema.json +36 -16
- data/app/pb_kits/playbook/pb_avatar/kit.schema.json +22 -10
- data/app/pb_kits/playbook/pb_background/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_background/kit.schema.json +10 -3
- data/app/pb_kits/playbook/pb_badge/docs/_playground.json +2 -0
- data/app/pb_kits/playbook/pb_badge/kit.schema.json +27 -13
- data/app/pb_kits/playbook/pb_body/docs/_playground.json +3 -3
- data/app/pb_kits/playbook/pb_body/kit.schema.json +14 -5
- data/app/pb_kits/playbook/pb_button/_button.tsx +3 -1
- data/app/pb_kits/playbook/pb_button/button.rb +3 -0
- data/app/pb_kits/playbook/pb_button/button.test.js +154 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_options_rails.md +5 -0
- data/app/pb_kits/playbook/pb_button/docs/_button_options_react.md +9 -0
- data/app/pb_kits/playbook/pb_button/docs/_playground.json +4 -2
- data/app/pb_kits/playbook/pb_button/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_button/docs/example.yml +1 -1
- data/app/pb_kits/playbook/pb_button/kit.schema.json +31 -27
- data/app/pb_kits/playbook/pb_caption/kit.schema.json +17 -7
- data/app/pb_kits/playbook/pb_card/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_card/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_checkbox/docs/_playground.json +6 -1
- data/app/pb_kits/playbook/pb_checkbox/kit.schema.json +10 -5
- data/app/pb_kits/playbook/pb_contact/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_contact/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_copy_button/docs/_playground.json +5 -1
- data/app/pb_kits/playbook/pb_copy_button/kit.schema.json +10 -5
- data/app/pb_kits/playbook/pb_currency/docs/_playground.json +1 -1
- data/app/pb_kits/playbook/pb_currency/kit.schema.json +6 -2
- data/app/pb_kits/playbook/pb_dashboard_value/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_dashboard_value/kit.schema.json +4 -2
- data/app/pb_kits/playbook/pb_date/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date/kit.schema.json +16 -7
- data/app/pb_kits/playbook/pb_date_picker/docs/_playground.json +4 -1
- data/app/pb_kits/playbook/pb_date_picker/kit.schema.json +32 -14
- data/app/pb_kits/playbook/pb_date_range_inline/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date_range_inline/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_date_time/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_date_time/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_date_time_stacked/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_date_time_stacked/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_detail/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_detail/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_dialog/docs/_playground.json +1 -1
- data/app/pb_kits/playbook/pb_dialog/kit.schema.json +22 -9
- data/app/pb_kits/playbook/pb_distribution_bar/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_distribution_bar/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +7 -2
- data/app/pb_kits/playbook/pb_dropdown/kit.schema.json +18 -8
- data/app/pb_kits/playbook/pb_empty_state/docs/_playground.json +1 -1
- data/app/pb_kits/playbook/pb_empty_state/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_file_upload/docs/_playground.json +3 -2
- data/app/pb_kits/playbook/pb_file_upload/kit.schema.json +8 -3
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/docs/_playground.json +4 -4
- data/app/pb_kits/playbook/pb_fixed_confirmation_toast/kit.schema.json +6 -3
- data/app/pb_kits/playbook/pb_flex/docs/_playground.json +3 -0
- data/app/pb_kits/playbook/pb_flex/kit.schema.json +27 -12
- data/app/pb_kits/playbook/pb_form/kit.schema.json +1 -6
- data/app/pb_kits/playbook/pb_form_pill/docs/_playground.json +3 -0
- data/app/pb_kits/playbook/pb_form_pill/kit.schema.json +6 -3
- data/app/pb_kits/playbook/pb_full_screen/docs/_playground.json +3 -3
- data/app/pb_kits/playbook/pb_full_screen/kit.schema.json +8 -4
- data/app/pb_kits/playbook/pb_hashtag/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_hashtag/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_highlight/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_icon/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_icon/kit.schema.json +30 -13
- data/app/pb_kits/playbook/pb_icon_circle/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_icon_circle/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_icon_stat_value/docs/_playground.json +3 -2
- data/app/pb_kits/playbook/pb_icon_stat_value/kit.schema.json +4 -2
- data/app/pb_kits/playbook/pb_image/_image.tsx +2 -2
- data/app/pb_kits/playbook/pb_image/docs/_playground.json +27 -27
- data/app/pb_kits/playbook/pb_image/kit.schema.json +56 -24
- data/app/pb_kits/playbook/pb_label_value/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_label_value/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_layout/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_layout/kit.schema.json +43 -20
- data/app/pb_kits/playbook/pb_legend/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_legend/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_lightbox/_lightbox.tsx +2 -2
- data/app/pb_kits/playbook/pb_lightbox/kit.schema.json +84 -0
- data/app/pb_kits/playbook/pb_link/docs/_playground.json +6 -3
- data/app/pb_kits/playbook/pb_link/kit.schema.json +14 -6
- data/app/pb_kits/playbook/pb_list/docs/_playground.json +2 -2
- data/app/pb_kits/playbook/pb_list/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_loading_inline/docs/_playground.json +0 -1
- data/app/pb_kits/playbook/pb_loading_inline/kit.schema.json +4 -1
- data/app/pb_kits/playbook/pb_map/kit.schema.json +4 -6
- data/app/pb_kits/playbook/pb_message/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_multiple_users/docs/_playground.json +2 -1
- data/app/pb_kits/playbook/pb_multiple_users/kit.schema.json +19 -11
- data/app/pb_kits/playbook/pb_multiple_users_stacked/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_multiple_users_stacked/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_nav/docs/_playground.json +2 -0
- data/app/pb_kits/playbook/pb_nav/kit.schema.json +4 -2
- data/app/pb_kits/playbook/pb_overlay/docs/_playground.json +3 -3
- data/app/pb_kits/playbook/pb_overlay/kit.schema.json +22 -12
- data/app/pb_kits/playbook/pb_pagination/kit.schema.json +6 -3
- data/app/pb_kits/playbook/pb_passphrase/docs/_playground.json +6 -4
- data/app/pb_kits/playbook/pb_passphrase/kit.schema.json +10 -5
- data/app/pb_kits/playbook/pb_pb_gauge_chart/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_person_contact/docs/_playground.json +3 -3
- data/app/pb_kits/playbook/pb_person_contact/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_phone_number_input_validation.html.erb +1 -1
- data/app/pb_kits/playbook/pb_phone_number_input/docs/_playground.json +3 -0
- data/app/pb_kits/playbook/pb_phone_number_input/kit.schema.json +6 -3
- data/app/pb_kits/playbook/pb_popover/docs/_playground.json +1 -2
- data/app/pb_kits/playbook/pb_popover/kit.schema.json +18 -9
- data/app/pb_kits/playbook/pb_progress_pills/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_progress_pills/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_progress_simple/docs/_playground.json +3 -2
- data/app/pb_kits/playbook/pb_progress_simple/kit.schema.json +4 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +9 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/kit.schema.json +18 -9
- data/app/pb_kits/playbook/pb_selectable_card/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_selectable_card/kit.schema.json +4 -2
- data/app/pb_kits/playbook/pb_selectable_card_icon/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_selectable_card_icon/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_source/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_source/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_star_rating/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_star_rating/kit.schema.json +15 -7
- data/app/pb_kits/playbook/pb_stat_change/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_stat_change/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_stat_value/docs/_playground.json +3 -1
- data/app/pb_kits/playbook/pb_stat_value/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_table/docs/_playground.json +5 -1
- data/app/pb_kits/playbook/pb_table/kit.schema.json +28 -11
- data/app/pb_kits/playbook/pb_text_input/docs/_playground.json +3 -0
- data/app/pb_kits/playbook/pb_text_input/kit.schema.json +22 -9
- data/app/pb_kits/playbook/pb_time/kit.schema.json +13 -5
- data/app/pb_kits/playbook/pb_time_picker/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_time_picker/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_time_range_inline/kit.schema.json +12 -5
- data/app/pb_kits/playbook/pb_title/kit.schema.json +23 -10
- data/app/pb_kits/playbook/pb_title_count/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_title_count/kit.schema.json +2 -1
- data/app/pb_kits/playbook/pb_tooltip/docs/_playground.json +5 -1
- data/app/pb_kits/playbook/pb_tooltip/kit.schema.json +10 -5
- data/app/pb_kits/playbook/pb_user/docs/_playground.json +3 -1
- data/app/pb_kits/playbook/pb_user/kit.schema.json +19 -9
- data/app/pb_kits/playbook/pb_weekday_stacked/docs/_playground.json +1 -0
- data/app/pb_kits/playbook/pb_weekday_stacked/kit.schema.json +2 -1
- data/dist/ai/all-schemas.json +870 -375
- data/dist/ai/forms.json +1 -1
- data/dist/ai/index.json +10 -2
- data/dist/ai/kits/advanced_table.schema.json +36 -16
- data/dist/ai/kits/avatar.schema.json +21 -9
- data/dist/ai/kits/background.schema.json +10 -3
- data/dist/ai/kits/badge.schema.json +26 -12
- data/dist/ai/kits/body.schema.json +14 -5
- data/dist/ai/kits/button.schema.json +29 -25
- data/dist/ai/kits/caption.schema.json +17 -7
- data/dist/ai/kits/card.schema.json +2 -1
- data/dist/ai/kits/checkbox.schema.json +10 -5
- data/dist/ai/kits/contact.schema.json +2 -1
- data/dist/ai/kits/copy_button.schema.json +10 -5
- data/dist/ai/kits/currency.schema.json +6 -2
- data/dist/ai/kits/dashboard_value.schema.json +4 -2
- data/dist/ai/kits/date.schema.json +15 -6
- data/dist/ai/kits/date_picker.schema.json +31 -13
- data/dist/ai/kits/date_range_inline.schema.json +2 -1
- data/dist/ai/kits/date_time.schema.json +2 -1
- data/dist/ai/kits/date_time_stacked.schema.json +2 -1
- data/dist/ai/kits/detail.schema.json +2 -1
- data/dist/ai/kits/dialog.schema.json +22 -9
- data/dist/ai/kits/distribution_bar.schema.json +2 -1
- data/dist/ai/kits/dropdown.schema.json +18 -8
- data/dist/ai/kits/empty_state.schema.json +2 -1
- data/dist/ai/kits/file_upload.schema.json +8 -3
- data/dist/ai/kits/fixed_confirmation_toast.schema.json +6 -3
- data/dist/ai/kits/flex.schema.json +27 -12
- data/dist/ai/kits/form.schema.json +1 -6
- data/dist/ai/kits/form_pill.schema.json +6 -3
- data/dist/ai/kits/full_screen.schema.json +8 -4
- data/dist/ai/kits/hashtag.schema.json +2 -1
- data/dist/ai/kits/highlight.schema.json +2 -1
- data/dist/ai/kits/icon.schema.json +30 -13
- data/dist/ai/kits/icon_circle.schema.json +2 -1
- data/dist/ai/kits/icon_stat_value.schema.json +4 -2
- data/dist/ai/kits/image.schema.json +56 -24
- data/dist/ai/kits/label_value.schema.json +2 -1
- data/dist/ai/kits/layout.schema.json +43 -20
- data/dist/ai/kits/legend.schema.json +2 -1
- data/dist/ai/kits/lightbox.schema.json +86 -0
- data/dist/ai/kits/link.schema.json +14 -6
- data/dist/ai/kits/list.schema.json +2 -1
- data/dist/ai/kits/loading_inline.schema.json +4 -1
- data/dist/ai/kits/map.schema.json +4 -7
- data/dist/ai/kits/message.schema.json +2 -1
- data/dist/ai/kits/multiple_users.schema.json +19 -11
- data/dist/ai/kits/multiple_users_stacked.schema.json +2 -1
- data/dist/ai/kits/nav.schema.json +4 -2
- data/dist/ai/kits/overlay.schema.json +22 -12
- data/dist/ai/kits/pagination.schema.json +6 -3
- data/dist/ai/kits/passphrase.schema.json +10 -5
- data/dist/ai/kits/pb_gauge_chart.schema.json +2 -1
- data/dist/ai/kits/person_contact.schema.json +2 -1
- data/dist/ai/kits/phone_number_input.schema.json +6 -3
- data/dist/ai/kits/popover.schema.json +17 -8
- data/dist/ai/kits/progress_pills.schema.json +2 -1
- data/dist/ai/kits/progress_simple.schema.json +4 -2
- data/dist/ai/kits/rich_text_editor.schema.json +18 -9
- data/dist/ai/kits/selectable_card.schema.json +4 -2
- data/dist/ai/kits/selectable_card_icon.schema.json +2 -1
- data/dist/ai/kits/source.schema.json +2 -1
- data/dist/ai/kits/star_rating.schema.json +15 -7
- data/dist/ai/kits/stat_change.schema.json +2 -1
- data/dist/ai/kits/stat_value.schema.json +2 -1
- data/dist/ai/kits/table.schema.json +28 -11
- data/dist/ai/kits/text_input.schema.json +22 -9
- data/dist/ai/kits/time.schema.json +12 -4
- data/dist/ai/kits/time_picker.schema.json +2 -1
- data/dist/ai/kits/time_range_inline.schema.json +12 -5
- data/dist/ai/kits/title.schema.json +23 -10
- data/dist/ai/kits/title_count.schema.json +2 -1
- data/dist/ai/kits/tooltip.schema.json +10 -5
- data/dist/ai/kits/user.schema.json +19 -9
- data/dist/ai/kits/weekday_stacked.schema.json +2 -1
- data/dist/ai/visual-index.json +1 -1
- data/lib/playbook/changelog_generator.rb +47 -21
- data/lib/playbook/connect_message_generator.rb +15 -2
- data/lib/playbook/version.rb +1 -1
- metadata +5 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f8c562cdf4d8c2e781047b89b39658c8e2dd4bc998db9fc6df6ac4807e67f1c
|
|
4
|
+
data.tar.gz: 07a7adf138d0e6d7b525e651bddb4b96ce28ca6cf70e2e3c7e0fe8352aa2e65d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 31174cf9f1a631297db0872325864fc0cb3cee389bb13b1730285ad3ca8961685f6f837ab1b335458fcdafd4356661b7c19bf3198d33418775ad56ac385ce0a2
|
|
7
|
+
data.tar.gz: da82cc4cea55a44dba8f725c8ed3b8548ba549e90048b5a09c5f61110449be4c71a2127eca6b1cefd3db05237b8a75357e10d88e4b3f5e058fb871e20dc9c9e4
|
|
@@ -7,18 +7,24 @@
|
|
|
7
7
|
"subRowHeaders": "AdvancedTable.Body.props"
|
|
8
8
|
},
|
|
9
9
|
"defaults": {
|
|
10
|
-
"
|
|
10
|
+
"cascadeCollapse": false,
|
|
11
11
|
"enableToggleExpansion": "header",
|
|
12
|
+
"enableSortingRemoval": false,
|
|
12
13
|
"fullWidthCell": false,
|
|
13
14
|
"groupSeparators": false,
|
|
15
|
+
"initialLoadingRowsCount": 10,
|
|
14
16
|
"inlineRowLoading": false,
|
|
15
17
|
"loading": false,
|
|
16
18
|
"maxHeight": "auto",
|
|
19
|
+
"pagination": false,
|
|
17
20
|
"responsive": "scroll",
|
|
18
21
|
"scrollBarNone": false,
|
|
19
22
|
"selectableRows": false,
|
|
20
23
|
"showActionsBar": true,
|
|
21
24
|
"persistToggleExpansionButton": false,
|
|
25
|
+
"sortParentOnly": false,
|
|
26
|
+
"toggleExpansionIcon": "arrows-from-line",
|
|
27
|
+
"virtualizedRows": false,
|
|
22
28
|
"collapsibleTrail": true,
|
|
23
29
|
"columnVisibilityControl": {
|
|
24
30
|
"default": true
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"type": "boolean",
|
|
22
22
|
"platforms": [
|
|
23
23
|
"react"
|
|
24
|
-
]
|
|
24
|
+
],
|
|
25
|
+
"default": false
|
|
25
26
|
},
|
|
26
27
|
"columnDefinitions": {
|
|
27
28
|
"type": "array",
|
|
@@ -36,15 +37,28 @@
|
|
|
36
37
|
"react",
|
|
37
38
|
"rails"
|
|
38
39
|
],
|
|
39
|
-
"values":
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
"values": {
|
|
41
|
+
"react": [
|
|
42
|
+
"text_lt_default",
|
|
43
|
+
"text_lt_light",
|
|
44
|
+
"text_lt_lighter",
|
|
45
|
+
"text_dk_default",
|
|
46
|
+
"text_dk_light",
|
|
47
|
+
"text_dk_lighter"
|
|
48
|
+
],
|
|
49
|
+
"rails": [
|
|
50
|
+
"text_lt_default",
|
|
51
|
+
"text_lt_light",
|
|
52
|
+
"text_lt_lighter",
|
|
53
|
+
"text_dk_default",
|
|
54
|
+
"text_dk_light",
|
|
55
|
+
"text_dk_lighter",
|
|
56
|
+
"none"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"default": {
|
|
60
|
+
"rails": "none"
|
|
61
|
+
}
|
|
48
62
|
},
|
|
49
63
|
"columnVisibilityControl": {
|
|
50
64
|
"type": "GenericObject",
|
|
@@ -75,7 +89,8 @@
|
|
|
75
89
|
"type": "boolean",
|
|
76
90
|
"platforms": [
|
|
77
91
|
"react"
|
|
78
|
-
]
|
|
92
|
+
],
|
|
93
|
+
"default": false
|
|
79
94
|
},
|
|
80
95
|
"expandedControl": {
|
|
81
96
|
"type": "GenericObject",
|
|
@@ -115,7 +130,8 @@
|
|
|
115
130
|
"type": "number",
|
|
116
131
|
"platforms": [
|
|
117
132
|
"react"
|
|
118
|
-
]
|
|
133
|
+
],
|
|
134
|
+
"default": 10
|
|
119
135
|
},
|
|
120
136
|
"inlineRowLoading": {
|
|
121
137
|
"type": "boolean",
|
|
@@ -170,7 +186,8 @@
|
|
|
170
186
|
"type": "boolean",
|
|
171
187
|
"platforms": [
|
|
172
188
|
"react"
|
|
173
|
-
]
|
|
189
|
+
],
|
|
190
|
+
"default": false
|
|
174
191
|
},
|
|
175
192
|
"paginationProps": {
|
|
176
193
|
"type": "GenericObject",
|
|
@@ -246,7 +263,8 @@
|
|
|
246
263
|
"type": "boolean",
|
|
247
264
|
"platforms": [
|
|
248
265
|
"react"
|
|
249
|
-
]
|
|
266
|
+
],
|
|
267
|
+
"default": false
|
|
250
268
|
},
|
|
251
269
|
"stickyLeftColumn": {
|
|
252
270
|
"type": "array",
|
|
@@ -278,7 +296,8 @@
|
|
|
278
296
|
"type": "string | string[]",
|
|
279
297
|
"platforms": [
|
|
280
298
|
"react"
|
|
281
|
-
]
|
|
299
|
+
],
|
|
300
|
+
"default": "arrows-from-line"
|
|
282
301
|
},
|
|
283
302
|
"onRowSelectionChange": {
|
|
284
303
|
"type": "function",
|
|
@@ -296,7 +315,8 @@
|
|
|
296
315
|
"type": "boolean",
|
|
297
316
|
"platforms": [
|
|
298
317
|
"react"
|
|
299
|
-
]
|
|
318
|
+
],
|
|
319
|
+
"default": false
|
|
300
320
|
},
|
|
301
321
|
"enableSorting": {
|
|
302
322
|
"type": "boolean",
|
|
@@ -59,14 +59,25 @@
|
|
|
59
59
|
"react",
|
|
60
60
|
"rails"
|
|
61
61
|
],
|
|
62
|
-
"values":
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
"values": {
|
|
63
|
+
"react": [
|
|
64
|
+
"md",
|
|
65
|
+
"lg",
|
|
66
|
+
"sm",
|
|
67
|
+
"xl",
|
|
68
|
+
"xs",
|
|
69
|
+
"xxs"
|
|
70
|
+
],
|
|
71
|
+
"rails": [
|
|
72
|
+
"xxs",
|
|
73
|
+
"xs",
|
|
74
|
+
"sm",
|
|
75
|
+
"md",
|
|
76
|
+
"base",
|
|
77
|
+
"lg",
|
|
78
|
+
"xl"
|
|
79
|
+
]
|
|
80
|
+
},
|
|
70
81
|
"default": "md"
|
|
71
82
|
},
|
|
72
83
|
"status": {
|
|
@@ -79,7 +90,8 @@
|
|
|
79
90
|
"away",
|
|
80
91
|
"offline",
|
|
81
92
|
"online"
|
|
82
|
-
]
|
|
93
|
+
],
|
|
94
|
+
"default": null
|
|
83
95
|
}
|
|
84
96
|
},
|
|
85
97
|
"globalProps": true,
|
|
@@ -91,7 +103,7 @@
|
|
|
91
103
|
},
|
|
92
104
|
"rails": {
|
|
93
105
|
"import": null,
|
|
94
|
-
"example": "<%= pb_rails(\"avatar\", props: { size: \"
|
|
106
|
+
"example": "<%= pb_rails(\"avatar\", props: { size: \"xxs\", status: \"away\" }) %>"
|
|
95
107
|
}
|
|
96
108
|
}
|
|
97
109
|
}
|
|
@@ -112,7 +112,10 @@
|
|
|
112
112
|
"react",
|
|
113
113
|
"rails"
|
|
114
114
|
],
|
|
115
|
-
"default":
|
|
115
|
+
"default": {
|
|
116
|
+
"react": "",
|
|
117
|
+
"rails": null
|
|
118
|
+
}
|
|
116
119
|
},
|
|
117
120
|
"backgroundRepeat": {
|
|
118
121
|
"type": {
|
|
@@ -140,7 +143,8 @@
|
|
|
140
143
|
"platforms": [
|
|
141
144
|
"react",
|
|
142
145
|
"rails"
|
|
143
|
-
]
|
|
146
|
+
],
|
|
147
|
+
"default": ""
|
|
144
148
|
},
|
|
145
149
|
"imageOverlay": {
|
|
146
150
|
"type": "enum",
|
|
@@ -217,7 +221,10 @@
|
|
|
217
221
|
"blur",
|
|
218
222
|
"scale"
|
|
219
223
|
],
|
|
220
|
-
"default":
|
|
224
|
+
"default": {
|
|
225
|
+
"react": "",
|
|
226
|
+
"rails": null
|
|
227
|
+
}
|
|
221
228
|
}
|
|
222
229
|
},
|
|
223
230
|
"globalProps": true,
|
|
@@ -11,13 +11,15 @@
|
|
|
11
11
|
"type": "GenericObject",
|
|
12
12
|
"platforms": [
|
|
13
13
|
"react"
|
|
14
|
-
]
|
|
14
|
+
],
|
|
15
|
+
"default": {}
|
|
15
16
|
},
|
|
16
17
|
"removeIcon": {
|
|
17
18
|
"type": "boolean",
|
|
18
19
|
"platforms": [
|
|
19
20
|
"react"
|
|
20
|
-
]
|
|
21
|
+
],
|
|
22
|
+
"default": false
|
|
21
23
|
},
|
|
22
24
|
"removeOnClick": {
|
|
23
25
|
"type": "function",
|
|
@@ -52,16 +54,28 @@
|
|
|
52
54
|
"react",
|
|
53
55
|
"rails"
|
|
54
56
|
],
|
|
55
|
-
"values":
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
"values": {
|
|
58
|
+
"react": [
|
|
59
|
+
"error",
|
|
60
|
+
"info",
|
|
61
|
+
"neutral",
|
|
62
|
+
"notification",
|
|
63
|
+
"notificationError",
|
|
64
|
+
"primary",
|
|
65
|
+
"success",
|
|
66
|
+
"warning"
|
|
67
|
+
],
|
|
68
|
+
"rails": [
|
|
69
|
+
"success",
|
|
70
|
+
"warning",
|
|
71
|
+
"error",
|
|
72
|
+
"info",
|
|
73
|
+
"neutral",
|
|
74
|
+
"notification",
|
|
75
|
+
"notification_error",
|
|
76
|
+
"primary"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
65
79
|
"default": "neutral"
|
|
66
80
|
}
|
|
67
81
|
},
|
|
@@ -73,7 +87,7 @@
|
|
|
73
87
|
},
|
|
74
88
|
"rails": {
|
|
75
89
|
"import": null,
|
|
76
|
-
"example": "<%= pb_rails(\"badge\", props: { variant: \"
|
|
90
|
+
"example": "<%= pb_rails(\"badge\", props: { variant: \"success\" }) %>"
|
|
77
91
|
}
|
|
78
92
|
}
|
|
79
93
|
}
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"template": "<Body{{props}}>{{children}}</Body>",
|
|
3
3
|
"propTargets": {},
|
|
4
4
|
"defaults": {
|
|
5
|
-
"
|
|
5
|
+
"highlightedText": [],
|
|
6
6
|
"highlighting": false,
|
|
7
|
-
"
|
|
8
|
-
"
|
|
7
|
+
"tag": "div",
|
|
8
|
+
"text": ""
|
|
9
9
|
},
|
|
10
10
|
"children": {
|
|
11
11
|
"editable": true,
|
|
@@ -21,7 +21,10 @@
|
|
|
21
21
|
"error",
|
|
22
22
|
"success"
|
|
23
23
|
],
|
|
24
|
-
"default":
|
|
24
|
+
"default": {
|
|
25
|
+
"react": "",
|
|
26
|
+
"rails": "default"
|
|
27
|
+
}
|
|
25
28
|
},
|
|
26
29
|
"dark": {
|
|
27
30
|
"type": "boolean",
|
|
@@ -34,7 +37,8 @@
|
|
|
34
37
|
"platforms": [
|
|
35
38
|
"react",
|
|
36
39
|
"rails"
|
|
37
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"default": []
|
|
38
42
|
},
|
|
39
43
|
"highlighting": {
|
|
40
44
|
"type": "boolean",
|
|
@@ -55,7 +59,10 @@
|
|
|
55
59
|
"negative",
|
|
56
60
|
"positive"
|
|
57
61
|
],
|
|
58
|
-
"default":
|
|
62
|
+
"default": {
|
|
63
|
+
"react": null,
|
|
64
|
+
"rails": "neutral"
|
|
65
|
+
}
|
|
59
66
|
},
|
|
60
67
|
"tag": {
|
|
61
68
|
"type": "enum",
|
|
@@ -81,7 +88,8 @@
|
|
|
81
88
|
"platforms": [
|
|
82
89
|
"react",
|
|
83
90
|
"rails"
|
|
84
|
-
]
|
|
91
|
+
],
|
|
92
|
+
"default": ""
|
|
85
93
|
},
|
|
86
94
|
"variant": {
|
|
87
95
|
"type": "enum",
|
|
@@ -90,7 +98,8 @@
|
|
|
90
98
|
],
|
|
91
99
|
"values": [
|
|
92
100
|
"link"
|
|
93
|
-
]
|
|
101
|
+
],
|
|
102
|
+
"default": null
|
|
94
103
|
}
|
|
95
104
|
},
|
|
96
105
|
"globalProps": true,
|
|
@@ -34,10 +34,11 @@ type ButtonPropTypes = {
|
|
|
34
34
|
size?: 'sm' | 'md' | 'lg',
|
|
35
35
|
target?: string,
|
|
36
36
|
text?: string,
|
|
37
|
+
// @schemaOmit Deprecated. Adds `pb_button_${type}` only (default `inline`). Use `fullWidth` for layout and `variant` for appearance. HTML type is `htmlType`.
|
|
37
38
|
type?: 'inline' | null,
|
|
38
|
-
htmlType?: 'submit' | 'reset' | 'button' | undefined,
|
|
39
39
|
value?: string | null,
|
|
40
40
|
variant?: 'primary' | 'secondary' | 'link'| 'danger' | 'reaction',
|
|
41
|
+
htmlType?: 'submit' | 'reset' | 'button' | undefined,
|
|
41
42
|
wrapperClass?: string,
|
|
42
43
|
} & GlobalProps
|
|
43
44
|
|
|
@@ -60,6 +61,7 @@ const buttonClassName = (props: ButtonPropTypes) => {
|
|
|
60
61
|
const isIconOnly = icon && !text && !children && variant !== 'reaction'
|
|
61
62
|
|
|
62
63
|
if (variant) classNames.push(`pb_button_${variant}`)
|
|
64
|
+
// Deprecated `type` still controls this class, including legacy values. HTML type is `htmlType`.
|
|
63
65
|
if (type) classNames.push(`pb_button_${type}`)
|
|
64
66
|
if (fullWidth) classNames.push('pb_button_block')
|
|
65
67
|
classNames.push(disabled ? 'pb_button_disabled' : 'pb_button_enabled')
|
|
@@ -23,6 +23,9 @@ module Playbook
|
|
|
23
23
|
default: false
|
|
24
24
|
prop :target
|
|
25
25
|
prop :text
|
|
26
|
+
# HTML type attribute. Not a class hook.
|
|
27
|
+
# React uses `htmlType` for this. There is no Rails `html_type` prop.
|
|
28
|
+
# schema_values: submit, reset, button
|
|
26
29
|
prop :type
|
|
27
30
|
prop :value
|
|
28
31
|
prop :size, type: Playbook::Props::Enum,
|
|
@@ -132,6 +132,160 @@ test('should render child target prop', () => {
|
|
|
132
132
|
expect(kit).not.toHaveAttribute('rel')
|
|
133
133
|
})
|
|
134
134
|
|
|
135
|
+
describe('type and htmlType', () => {
|
|
136
|
+
test('defaults to pb_button_inline and html type button', () => {
|
|
137
|
+
render(
|
|
138
|
+
<Button
|
|
139
|
+
data={{ testid: 'default-type' }}
|
|
140
|
+
text="Save"
|
|
141
|
+
/>
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
const kit = screen.getByTestId('default-type')
|
|
145
|
+
expect(kit).toHaveClass('pb_button_kit pb_button_primary pb_button_inline pb_button_enabled')
|
|
146
|
+
expect(kit).not.toHaveClass('pb_button_block')
|
|
147
|
+
expect(kit).toHaveAttribute('type', 'button')
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
test('type="inline" adds pb_button_inline without changing the html type', () => {
|
|
151
|
+
render(
|
|
152
|
+
<Button
|
|
153
|
+
data={{ testid: 'inline-type' }}
|
|
154
|
+
type="inline"
|
|
155
|
+
/>
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
const kit = screen.getByTestId('inline-type')
|
|
159
|
+
expect(kit).toHaveClass('pb_button_inline')
|
|
160
|
+
expect(kit).toHaveAttribute('type', 'button')
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
test('type={null} omits the layout class', () => {
|
|
164
|
+
render(
|
|
165
|
+
<Button
|
|
166
|
+
data={{ testid: 'null-type' }}
|
|
167
|
+
type={null}
|
|
168
|
+
/>
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
const kit = screen.getByTestId('null-type')
|
|
172
|
+
expect(kit).not.toHaveClass('pb_button_inline')
|
|
173
|
+
expect(kit).toHaveAttribute('type', 'button')
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
test('legacy and undocumented type strings still generate pb_button_${type}', () => {
|
|
177
|
+
const { unmount } = render(
|
|
178
|
+
<Button
|
|
179
|
+
data={{ testid: 'legacy-link' }}
|
|
180
|
+
type="link"
|
|
181
|
+
/>
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
const linkType = screen.getByTestId('legacy-link')
|
|
185
|
+
expect(linkType).toHaveClass('pb_button_primary')
|
|
186
|
+
expect(linkType).toHaveClass('pb_button_link')
|
|
187
|
+
expect(linkType).toHaveAttribute('type', 'button')
|
|
188
|
+
unmount()
|
|
189
|
+
|
|
190
|
+
render(
|
|
191
|
+
<Button
|
|
192
|
+
data={{ testid: 'legacy-submit' }}
|
|
193
|
+
type="submit"
|
|
194
|
+
/>
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
const submitType = screen.getByTestId('legacy-submit')
|
|
198
|
+
expect(submitType).toHaveClass('pb_button_submit')
|
|
199
|
+
expect(submitType).toHaveAttribute('type', 'button')
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
test('fullWidth keeps pb_button_inline and adds pb_button_block', () => {
|
|
203
|
+
render(
|
|
204
|
+
<Button
|
|
205
|
+
data={{ testid: 'full-width-type' }}
|
|
206
|
+
fullWidth
|
|
207
|
+
/>
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
const kit = screen.getByTestId('full-width-type')
|
|
211
|
+
expect(kit).toHaveClass('pb_button_inline')
|
|
212
|
+
expect(kit).toHaveClass('pb_button_block')
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
test('htmlType sets the attribute on standard and reaction buttons', () => {
|
|
216
|
+
const { unmount } = render(
|
|
217
|
+
<Button
|
|
218
|
+
data={{ testid: 'html-submit' }}
|
|
219
|
+
htmlType="submit"
|
|
220
|
+
/>
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
expect(screen.getByTestId('html-submit')).toHaveAttribute('type', 'submit')
|
|
224
|
+
unmount()
|
|
225
|
+
|
|
226
|
+
render(
|
|
227
|
+
<Button
|
|
228
|
+
data={{ testid: 'html-reset' }}
|
|
229
|
+
htmlType="reset"
|
|
230
|
+
variant="reaction"
|
|
231
|
+
/>
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
const kit = screen.getByTestId('html-reset')
|
|
235
|
+
expect(kit).toHaveAttribute('type', 'reset')
|
|
236
|
+
expect(kit).toHaveClass('pb_button_reaction')
|
|
237
|
+
expect(kit).toHaveClass('pb_button_inline')
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
test('htmlType is omitted when link renders an anchor', () => {
|
|
241
|
+
render(
|
|
242
|
+
<Button
|
|
243
|
+
data={{ testid: 'html-link' }}
|
|
244
|
+
htmlType="submit"
|
|
245
|
+
link="https://example.com"
|
|
246
|
+
/>
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
const kit = screen.getByTestId('html-link')
|
|
250
|
+
expect(kit.tagName).toBe('A')
|
|
251
|
+
expect(kit).toHaveAttribute('href', 'https://example.com')
|
|
252
|
+
expect(kit).not.toHaveAttribute('type')
|
|
253
|
+
expect(kit).toHaveClass('pb_button_inline')
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
test('htmlType overrides htmlOptions.type', () => {
|
|
257
|
+
render(
|
|
258
|
+
<Button
|
|
259
|
+
data={{ testid: 'html-override' }}
|
|
260
|
+
htmlOptions={{ type: 'submit' }}
|
|
261
|
+
htmlType="reset"
|
|
262
|
+
/>
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
expect(screen.getByTestId('html-override')).toHaveAttribute('type', 'reset')
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
test('loading, disabled, and variant classes stay independent of type', () => {
|
|
269
|
+
render(
|
|
270
|
+
<Button
|
|
271
|
+
data={{ testid: 'type-states' }}
|
|
272
|
+
disabled
|
|
273
|
+
loading
|
|
274
|
+
type="inline"
|
|
275
|
+
variant="danger"
|
|
276
|
+
/>
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
const kit = screen.getByTestId('type-states')
|
|
280
|
+
expect(kit).toHaveClass('pb_button_danger')
|
|
281
|
+
expect(kit).toHaveClass('pb_button_inline')
|
|
282
|
+
expect(kit).toHaveClass('pb_button_disabled')
|
|
283
|
+
expect(kit).toHaveClass('pb_button_loading')
|
|
284
|
+
expect(kit).toBeDisabled()
|
|
285
|
+
expect(kit).toHaveAttribute('type', 'button')
|
|
286
|
+
})
|
|
287
|
+
})
|
|
288
|
+
|
|
135
289
|
describe('icon-only button', () => {
|
|
136
290
|
test('adds pb_button_icon_only class when icon is provided without text', () => {
|
|
137
291
|
render(
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
`type` sets the HTML `type` attribute (`submit`, `reset`, or `button`). It does not change classes. When `type` is omitted, the attribute is omitted and a button inside a form submits by default.
|
|
2
|
+
|
|
3
|
+
There is no `html_type` prop. Pass `type` instead.
|
|
4
|
+
|
|
5
|
+
`value` is the HTML `value` attribute. The visible label is `text`, so `value` does not appear on the button. When this button submits a form and it has a `name`, the browser includes that name and value in the form data. `"1234"` in the example is only a sample value.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
`onClick` runs when the button is clicked. The example alerts.
|
|
2
|
+
|
|
3
|
+
`htmlType` sets the HTML `type` attribute on a `<button>` (`submit`, `reset`, or `button`). It defaults to `button`, so the button does not submit a form unless you pass `htmlType="submit"`. When `link` is set, the kit renders an `<a>` and does not emit `htmlType`.
|
|
4
|
+
|
|
5
|
+
`value` is the HTML `value` attribute. The visible label is `text`, so `value` does not appear on the button. When this button submits a form and it has a `name`, the browser includes that name and value in the form data. `"1234"` in the example is only a sample value.
|
|
6
|
+
|
|
7
|
+
`tabIndex` sets the HTML `tabindex`. `0` keeps the button in the normal tab order.
|
|
8
|
+
|
|
9
|
+
**Deprecated:** React `type`. It does not set the HTML attribute. It only adds the class `pb_button_${type}`. The default is `inline`, which adds `pb_button_inline`. That class has no stylesheet rule; the button is already inline-flex. `type={null}` omits the class. Other strings, including older undocumented values, still add `pb_button_${type}` so existing classnames stay the same.
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
"iconRight": false,
|
|
9
9
|
"loading": false,
|
|
10
10
|
"newWindow": false,
|
|
11
|
-
"
|
|
12
|
-
"variant": "primary"
|
|
11
|
+
"target": "",
|
|
12
|
+
"variant": "primary",
|
|
13
|
+
"htmlType": "button"
|
|
13
14
|
},
|
|
14
15
|
"children": {
|
|
15
16
|
"editable": true,
|
|
@@ -56,6 +57,7 @@
|
|
|
56
57
|
"name": "Form",
|
|
57
58
|
"props": [
|
|
58
59
|
"htmlType",
|
|
60
|
+
"type",
|
|
59
61
|
"form",
|
|
60
62
|
"value",
|
|
61
63
|
"tabIndex"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{ "name": "Content", "props": ["text", "icon", "iconRight"] },
|
|
15
15
|
{ "name": "Link Mode", "props": ["link", "target", "newWindow"] },
|
|
16
16
|
{ "name": "Reaction Mode", "props": ["count", "highlight"] },
|
|
17
|
-
{ "name": "Form", "props": ["htmlType", "form", "value", "tabIndex"] }
|
|
17
|
+
{ "name": "Form", "props": ["htmlType", "type", "form", "value", "tabIndex"] }
|
|
18
18
|
],
|
|
19
19
|
"presets": [
|
|
20
20
|
{ "name": "Primary", "props": { "variant": "primary" }, "children": "Submit" },
|
|
@@ -24,7 +24,7 @@ examples:
|
|
|
24
24
|
- button_block_content: Button Block Content
|
|
25
25
|
- button_icon_options: Button Icon Options
|
|
26
26
|
- button_accessibility: Button Accessibility Options
|
|
27
|
-
- button_options: Button Additional Options
|
|
27
|
+
- button_options: Button Additional Options
|
|
28
28
|
- button_size: Button Size
|
|
29
29
|
- button_form: Button Form Attribute
|
|
30
30
|
- button_hover: Button Hover
|