playbook_ui 18.0.0.pre.alpha.play316819718 → 18.0.0.pre.alpha.play320919498
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_background/_background.tsx +1 -4
- data/app/pb_kits/playbook/pb_background/background.test.js +1 -23
- data/app/pb_kits/playbook/pb_body/_body.tsx +1 -3
- data/app/pb_kits/playbook/pb_body/kit.schema.json +0 -1
- data/app/pb_kits/playbook/pb_card/_card.tsx +1 -4
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -12
- data/app/pb_kits/playbook/pb_card/kit.schema.json +0 -1
- data/app/pb_kits/playbook/pb_copy_button/_copy_button.tsx +1 -5
- data/app/pb_kits/playbook/pb_copy_button/copy_button.test.jsx +0 -12
- data/app/pb_kits/playbook/pb_date_time_stacked/_date_time_stacked.tsx +4 -10
- data/app/pb_kits/playbook/pb_date_time_stacked/date_time_stacked.test.js +0 -12
- data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +4 -9
- data/app/pb_kits/playbook/pb_dialog/dialog.test.jsx +0 -10
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.scss +0 -16
- data/app/pb_kits/playbook/pb_dropdown/_dropdown.tsx +9 -18
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.json +0 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/_playground.overrides.json +1 -2
- data/app/pb_kits/playbook/pb_dropdown/docs/example.yml +0 -8
- data/app/pb_kits/playbook/pb_dropdown/docs/index.js +0 -2
- data/app/pb_kits/playbook/pb_dropdown/dropdown.rb +1 -20
- data/app/pb_kits/playbook/pb_dropdown/dropdown.test.jsx +2 -205
- data/app/pb_kits/playbook/pb_dropdown/index.js +44 -466
- data/app/pb_kits/playbook/pb_dropdown/keyboard_accessibility.js +3 -5
- data/app/pb_kits/playbook/pb_dropdown/kit.schema.json +3 -56
- data/app/pb_kits/playbook/pb_dropdown/subcomponents/MultiSelectTriggerDisplay.tsx +2 -2
- data/app/pb_kits/playbook/pb_empty_state/_empty_state.tsx +1 -5
- data/app/pb_kits/playbook/pb_empty_state/empty_state.test.jsx +0 -11
- data/app/pb_kits/playbook/pb_filter/Filter/FilterBackground.tsx +2 -8
- data/app/pb_kits/playbook/pb_filter/Filter/index.tsx +6 -48
- data/app/pb_kits/playbook/pb_filter/_filter.scss +0 -127
- data/app/pb_kits/playbook/pb_filter/_filter.tsx +0 -1
- data/app/pb_kits/playbook/pb_filter/docs/_playground.json +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/_playground.overrides.json +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_filter/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_filter/filter.html.erb +97 -139
- data/app/pb_kits/playbook/pb_filter/filter.rb +1 -21
- data/app/pb_kits/playbook/pb_filter/filter.test.js +0 -78
- data/app/pb_kits/playbook/pb_filter/kit.schema.json +2 -13
- data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -3
- data/app/pb_kits/playbook/pb_flex/kit.schema.json +0 -1
- data/app/pb_kits/playbook/pb_form/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_multi_level_select/_helper_functions.tsx +1 -12
- data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +3 -2
- data/app/pb_kits/playbook/pb_multi_level_select/multi_level_select.test.jsx +0 -26
- data/app/pb_kits/playbook/pb_multi_level_select/tree_helpers.js +4 -10
- data/app/pb_kits/playbook/pb_pagination/_pagination.scss +19 -22
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.scss +0 -4
- data/app/pb_kits/playbook/pb_passphrase/_passphrase.tsx +1 -5
- data/app/pb_kits/playbook/pb_passphrase/index.ts +1 -1
- data/app/pb_kits/playbook/pb_passphrase/passphrase.html.erb +1 -2
- data/app/pb_kits/playbook/pb_passphrase/passphrase.rb +0 -4
- data/app/pb_kits/playbook/pb_passphrase/passphrase.test.jsx +1 -28
- data/app/pb_kits/playbook/pb_pill/_pill.scss +4 -9
- data/app/pb_kits/playbook/pb_pill/_pill.test.jsx +0 -43
- data/app/pb_kits/playbook/pb_pill/_pill.tsx +6 -12
- data/app/pb_kits/playbook/pb_pill/docs/_pill_notification.jsx +0 -6
- data/app/pb_kits/playbook/pb_pill/docs/_playground.json +1 -14
- data/app/pb_kits/playbook/pb_pill/docs/_playground.overrides.json +0 -17
- data/app/pb_kits/playbook/pb_pill/docs/example.yml +0 -2
- data/app/pb_kits/playbook/pb_pill/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_pill/pill.html.erb +1 -5
- data/app/pb_kits/playbook/pb_progress_step/_progress_step_item.tsx +1 -2
- data/app/pb_kits/playbook/pb_progress_step/progress_step.test.js +0 -16
- data/app/pb_kits/playbook/pb_rich_text_editor/_previewer_mixin.scss +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/_tiptap_styles.scss +6 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.json +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_playground.overrides.json +1 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_extensions.html.erb +5 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_extensions.md +7 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_text_align.html.erb +5 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/_rich_text_editor_rails_text_align.md +3 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/docs/example.yml +2 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/kit.schema.json +6 -2
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.html.erb +44 -1
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor.rb +28 -0
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.js +135 -43
- data/app/pb_kits/playbook/pb_rich_text_editor/rich_text_editor_rails.test.js +159 -0
- data/app/pb_kits/playbook/pb_source/_source.tsx +11 -14
- data/app/pb_kits/playbook/pb_source/source.test.js +0 -6
- data/app/pb_kits/playbook/pb_table/_table.tsx +1 -1
- data/app/pb_kits/playbook/pb_table/docs/{_table_header_rails.md → _table_header.md} +3 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_responsive_table.html.erb +0 -75
- data/app/pb_kits/playbook/pb_table/docs/_table_responsive_table.jsx +0 -80
- data/app/pb_kits/playbook/pb_table/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_table/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_table/subcomponents/_table_header.tsx +12 -143
- data/app/pb_kits/playbook/pb_table/table.rb +1 -1
- data/app/pb_kits/playbook/pb_table/table.test.js +1 -134
- data/app/pb_kits/playbook/pb_title/_title.tsx +1 -3
- data/app/pb_kits/playbook/pb_title/kit.schema.json +0 -1
- data/app/pb_kits/playbook/utilities/test/globalProps/globalProps.integration.test.js +5 -7
- data/dist/chunks/{_detail-BqqzPTNr.js → _detail-B4-co8rv.js} +2 -2
- data/dist/chunks/_table-CUU7TisO.js +1 -0
- data/dist/chunks/_typeahead-DeIqOMbJ.js +1 -0
- data/dist/chunks/vendor.js +3 -3
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/changelog_generator.rb +3 -33
- data/lib/playbook/forms/builder/checkbox_field.rb +0 -2
- data/lib/playbook/forms/builder/collection_select_field.rb +0 -3
- data/lib/playbook/forms/builder/date_picker_field.rb +7 -22
- data/lib/playbook/forms/builder/dropdown_field.rb +0 -12
- data/lib/playbook/forms/builder/form_field_builder.rb +0 -4
- data/lib/playbook/forms/builder/intl_telephone_field.rb +0 -8
- data/lib/playbook/forms/builder/multi_level_select_field.rb +0 -10
- data/lib/playbook/forms/builder/phone_number_field.rb +0 -8
- data/lib/playbook/forms/builder/select_field.rb +0 -3
- data/lib/playbook/forms/builder/star_rating_field.rb +0 -7
- data/lib/playbook/forms/builder/time_picker_field.rb +0 -8
- data/lib/playbook/forms/builder/typeahead_field.rb +0 -15
- data/lib/playbook/forms/builder.rb +0 -17
- data/lib/playbook/pagination_renderer.rb +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +11 -263
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_async_custom_content.html.erb +0 -57
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_async_custom_content.md +0 -10
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_async_search.html.erb +0 -42
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_async_search.md +0 -55
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options.html.erb +0 -34
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options.md +0 -4
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options_with_autocomplete.html.erb +0 -35
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options_with_autocomplete.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options_with_multi_select.html.erb +0 -35
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_dynamic_options_with_multi_select.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_react_hook.jsx +0 -45
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_multi_select_react_hook.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_react_hook.jsx +0 -36
- data/app/pb_kits/playbook/pb_dropdown/docs/_dropdown_react_hook.md +0 -1
- data/app/pb_kits/playbook/pb_dropdown/dropdown_index.test.js +0 -1145
- data/app/pb_kits/playbook/pb_filter/Filter/FilterResponsive.tsx +0 -116
- data/app/pb_kits/playbook/pb_filter/docs/_filter_responsive.html.erb +0 -42
- data/app/pb_kits/playbook/pb_filter/docs/_filter_responsive.jsx +0 -76
- data/app/pb_kits/playbook/pb_filter/docs/_filter_responsive.md +0 -3
- data/app/pb_kits/playbook/pb_form/docs/_form_model_values.html.erb +0 -43
- data/app/pb_kits/playbook/pb_form/docs/_form_model_values.md +0 -22
- data/app/pb_kits/playbook/pb_pill/docs/_pill_children.html.erb +0 -9
- data/app/pb_kits/playbook/pb_pill/docs/_pill_children.jsx +0 -45
- data/app/pb_kits/playbook/pb_pill/docs/_pill_children.md +0 -1
- data/app/pb_kits/playbook/pb_table/docs/_table_header.jsx +0 -193
- data/app/pb_kits/playbook/pb_table/docs/_table_header_react.md +0 -15
- data/app/pb_kits/playbook/pb_table/docs/_table_responsive_table_rails.md +0 -5
- data/app/pb_kits/playbook/pb_table/docs/_table_responsive_table_react.md +0 -5
- data/app/pb_kits/playbook/pb_table/utilities/sortMenuHelpers.test.ts +0 -76
- data/app/pb_kits/playbook/pb_table/utilities/sortMenuHelpers.ts +0 -84
- data/app/pb_kits/playbook/utilities/global-event-props.schema.json +0 -22
- data/app/pb_kits/playbook/utilities/globalEventProps.ts +0 -13
- data/app/pb_kits/playbook/utilities/test/globalProps/onClick.test.js +0 -212
- data/dist/ai/all-schemas.json +0 -16054
- data/dist/ai/external-dependencies.json +0 -1
- data/dist/ai/forms.json +0 -1026
- data/dist/ai/global-event-props.schema.json +0 -22
- data/dist/ai/global-props.schema.json +0 -1271
- data/dist/ai/index.json +0 -1048
- data/dist/ai/kits/advanced_table.schema.json +0 -334
- data/dist/ai/kits/avatar.schema.json +0 -100
- data/dist/ai/kits/background.schema.json +0 -238
- data/dist/ai/kits/badge.schema.json +0 -83
- data/dist/ai/kits/body.schema.json +0 -112
- data/dist/ai/kits/bread_crumbs.schema.json +0 -32
- data/dist/ai/kits/button.schema.json +0 -292
- data/dist/ai/kits/button_toolbar.schema.json +0 -70
- data/dist/ai/kits/caption.schema.json +0 -95
- data/dist/ai/kits/card.schema.json +0 -204
- data/dist/ai/kits/checkbox.schema.json +0 -322
- data/dist/ai/kits/circle_icon_button.schema.json +0 -127
- data/dist/ai/kits/collapsible.schema.json +0 -109
- data/dist/ai/kits/contact.schema.json +0 -69
- data/dist/ai/kits/container.schema.json +0 -56
- data/dist/ai/kits/copy_button.schema.json +0 -98
- data/dist/ai/kits/currency.schema.json +0 -154
- data/dist/ai/kits/dashboard_value.schema.json +0 -60
- data/dist/ai/kits/date.schema.json +0 -107
- data/dist/ai/kits/date_picker.schema.json +0 -581
- data/dist/ai/kits/date_range_inline.schema.json +0 -88
- data/dist/ai/kits/date_range_stacked.schema.json +0 -48
- data/dist/ai/kits/date_stacked.schema.json +0 -90
- data/dist/ai/kits/date_time.schema.json +0 -107
- data/dist/ai/kits/date_time_stacked.schema.json +0 -74
- data/dist/ai/kits/date_year_stacked.schema.json +0 -54
- data/dist/ai/kits/detail.schema.json +0 -82
- data/dist/ai/kits/dialog.schema.json +0 -188
- data/dist/ai/kits/distribution_bar.schema.json +0 -52
- data/dist/ai/kits/draggable.schema.json +0 -70
- data/dist/ai/kits/dropdown.schema.json +0 -617
- data/dist/ai/kits/empty_state.schema.json +0 -121
- data/dist/ai/kits/file_upload.schema.json +0 -139
- data/dist/ai/kits/filter.schema.json +0 -173
- data/dist/ai/kits/fixed_confirmation_toast.schema.json +0 -128
- data/dist/ai/kits/flex.schema.json +0 -177
- data/dist/ai/kits/form.schema.json +0 -55
- data/dist/ai/kits/form_group.schema.json +0 -34
- data/dist/ai/kits/form_pill.schema.json +0 -142
- data/dist/ai/kits/full_screen.schema.json +0 -93
- data/dist/ai/kits/hashtag.schema.json +0 -81
- data/dist/ai/kits/highlight.schema.json +0 -39
- data/dist/ai/kits/home_address_street.schema.json +0 -136
- data/dist/ai/kits/icon.schema.json +0 -201
- data/dist/ai/kits/icon_circle.schema.json +0 -83
- data/dist/ai/kits/icon_stat_value.schema.json +0 -106
- data/dist/ai/kits/icon_value.schema.json +0 -59
- data/dist/ai/kits/image.schema.json +0 -78
- data/dist/ai/kits/label_pill.schema.json +0 -56
- data/dist/ai/kits/label_value.schema.json +0 -94
- data/dist/ai/kits/layout.schema.json +0 -129
- data/dist/ai/kits/legend.schema.json +0 -54
- data/dist/ai/kits/link.schema.json +0 -135
- data/dist/ai/kits/list.schema.json +0 -121
- data/dist/ai/kits/loading_inline.schema.json +0 -83
- data/dist/ai/kits/map.schema.json +0 -62
- data/dist/ai/kits/message.schema.json +0 -111
- data/dist/ai/kits/multi_level_select.schema.json +0 -377
- data/dist/ai/kits/multiple_users.schema.json +0 -77
- data/dist/ai/kits/multiple_users_stacked.schema.json +0 -65
- data/dist/ai/kits/nav.schema.json +0 -115
- data/dist/ai/kits/online_status.schema.json +0 -66
- data/dist/ai/kits/overlay.schema.json +0 -112
- data/dist/ai/kits/pagination.schema.json +0 -60
- data/dist/ai/kits/passphrase.schema.json +0 -117
- data/dist/ai/kits/pb_bar_graph.schema.json +0 -42
- data/dist/ai/kits/pb_circle_chart.schema.json +0 -42
- data/dist/ai/kits/pb_gauge_chart.schema.json +0 -42
- data/dist/ai/kits/pb_line_graph.schema.json +0 -42
- data/dist/ai/kits/person.schema.json +0 -40
- data/dist/ai/kits/person_contact.schema.json +0 -47
- data/dist/ai/kits/phone_number_input.schema.json +0 -387
- data/dist/ai/kits/pill.schema.json +0 -80
- data/dist/ai/kits/popover.schema.json +0 -137
- data/dist/ai/kits/progress_pills.schema.json +0 -70
- data/dist/ai/kits/progress_simple.schema.json +0 -96
- data/dist/ai/kits/progress_step.schema.json +0 -84
- data/dist/ai/kits/radio.schema.json +0 -117
- data/dist/ai/kits/rich_text_editor.schema.json +0 -194
- data/dist/ai/kits/section_separator.schema.json +0 -89
- data/dist/ai/kits/select.schema.json +0 -423
- data/dist/ai/kits/selectable_card.schema.json +0 -126
- data/dist/ai/kits/selectable_card_icon.schema.json +0 -129
- data/dist/ai/kits/selectable_icon.schema.json +0 -116
- data/dist/ai/kits/selectable_list.schema.json +0 -58
- data/dist/ai/kits/skeleton_loading.schema.json +0 -111
- data/dist/ai/kits/source.schema.json +0 -68
- data/dist/ai/kits/star_rating.schema.json +0 -329
- data/dist/ai/kits/stat_change.schema.json +0 -62
- data/dist/ai/kits/stat_value.schema.json +0 -49
- data/dist/ai/kits/table.schema.json +0 -262
- data/dist/ai/kits/text_input.schema.json +0 -667
- data/dist/ai/kits/textarea.schema.json +0 -364
- data/dist/ai/kits/time.schema.json +0 -104
- data/dist/ai/kits/time_picker.schema.json +0 -325
- data/dist/ai/kits/time_range_inline.schema.json +0 -89
- data/dist/ai/kits/time_stacked.schema.json +0 -70
- data/dist/ai/kits/timeline.schema.json +0 -64
- data/dist/ai/kits/timestamp.schema.json +0 -138
- data/dist/ai/kits/title.schema.json +0 -111
- data/dist/ai/kits/title_count.schema.json +0 -71
- data/dist/ai/kits/title_detail.schema.json +0 -53
- data/dist/ai/kits/toggle.schema.json +0 -80
- data/dist/ai/kits/tooltip.schema.json +0 -174
- data/dist/ai/kits/typeahead.schema.json +0 -532
- data/dist/ai/kits/user.schema.json +0 -157
- data/dist/ai/kits/user_badge.schema.json +0 -51
- data/dist/ai/kits/weekday_stacked.schema.json +0 -73
- data/dist/ai/playgrounds/advanced_table.json +0 -1
- data/dist/ai/playgrounds/avatar.json +0 -1
- data/dist/ai/playgrounds/background.json +0 -1
- data/dist/ai/playgrounds/badge.json +0 -1
- data/dist/ai/playgrounds/body.json +0 -1
- data/dist/ai/playgrounds/bread_crumbs.json +0 -1
- data/dist/ai/playgrounds/button.json +0 -1
- data/dist/ai/playgrounds/button_toolbar.json +0 -1
- data/dist/ai/playgrounds/caption.json +0 -1
- data/dist/ai/playgrounds/card.json +0 -1
- data/dist/ai/playgrounds/checkbox.json +0 -1
- data/dist/ai/playgrounds/circle_icon_button.json +0 -1
- data/dist/ai/playgrounds/collapsible.json +0 -1
- data/dist/ai/playgrounds/contact.json +0 -1
- data/dist/ai/playgrounds/container.json +0 -1
- data/dist/ai/playgrounds/copy_button.json +0 -1
- data/dist/ai/playgrounds/currency.json +0 -1
- data/dist/ai/playgrounds/dashboard_value.json +0 -1
- data/dist/ai/playgrounds/date.json +0 -1
- data/dist/ai/playgrounds/date_picker.json +0 -1
- data/dist/ai/playgrounds/date_range_inline.json +0 -1
- data/dist/ai/playgrounds/date_range_stacked.json +0 -1
- data/dist/ai/playgrounds/date_stacked.json +0 -1
- data/dist/ai/playgrounds/date_time.json +0 -1
- data/dist/ai/playgrounds/date_time_stacked.json +0 -1
- data/dist/ai/playgrounds/date_year_stacked.json +0 -1
- data/dist/ai/playgrounds/detail.json +0 -1
- data/dist/ai/playgrounds/dialog.json +0 -1
- data/dist/ai/playgrounds/distribution_bar.json +0 -1
- data/dist/ai/playgrounds/draggable.json +0 -1
- data/dist/ai/playgrounds/dropdown.json +0 -1
- data/dist/ai/playgrounds/empty_state.json +0 -1
- data/dist/ai/playgrounds/file_upload.json +0 -1
- data/dist/ai/playgrounds/filter.json +0 -1
- data/dist/ai/playgrounds/fixed_confirmation_toast.json +0 -1
- data/dist/ai/playgrounds/flex.json +0 -1
- data/dist/ai/playgrounds/form_group.json +0 -1
- data/dist/ai/playgrounds/form_pill.json +0 -1
- data/dist/ai/playgrounds/full_screen.json +0 -1
- data/dist/ai/playgrounds/hashtag.json +0 -1
- data/dist/ai/playgrounds/highlight.json +0 -1
- data/dist/ai/playgrounds/home_address_street.json +0 -1
- data/dist/ai/playgrounds/icon.json +0 -1
- data/dist/ai/playgrounds/icon_circle.json +0 -1
- data/dist/ai/playgrounds/icon_stat_value.json +0 -1
- data/dist/ai/playgrounds/icon_value.json +0 -1
- data/dist/ai/playgrounds/image.json +0 -1
- data/dist/ai/playgrounds/index.json +0 -1
- data/dist/ai/playgrounds/label_pill.json +0 -1
- data/dist/ai/playgrounds/label_value.json +0 -1
- data/dist/ai/playgrounds/layout.json +0 -1
- data/dist/ai/playgrounds/legend.json +0 -1
- data/dist/ai/playgrounds/link.json +0 -1
- data/dist/ai/playgrounds/list.json +0 -1
- data/dist/ai/playgrounds/loading_inline.json +0 -1
- data/dist/ai/playgrounds/map.json +0 -1
- data/dist/ai/playgrounds/message.json +0 -1
- data/dist/ai/playgrounds/multi_level_select.json +0 -1
- data/dist/ai/playgrounds/multiple_users.json +0 -1
- data/dist/ai/playgrounds/multiple_users_stacked.json +0 -1
- data/dist/ai/playgrounds/nav.json +0 -1
- data/dist/ai/playgrounds/online_status.json +0 -1
- data/dist/ai/playgrounds/overlay.json +0 -1
- data/dist/ai/playgrounds/pagination.json +0 -1
- data/dist/ai/playgrounds/passphrase.json +0 -1
- data/dist/ai/playgrounds/pb_bar_graph.json +0 -1
- data/dist/ai/playgrounds/pb_circle_chart.json +0 -1
- data/dist/ai/playgrounds/pb_gauge_chart.json +0 -1
- data/dist/ai/playgrounds/pb_line_graph.json +0 -1
- data/dist/ai/playgrounds/person.json +0 -1
- data/dist/ai/playgrounds/person_contact.json +0 -1
- data/dist/ai/playgrounds/phone_number_input.json +0 -1
- data/dist/ai/playgrounds/pill.json +0 -1
- data/dist/ai/playgrounds/popover.json +0 -1
- data/dist/ai/playgrounds/progress_pills.json +0 -1
- data/dist/ai/playgrounds/progress_simple.json +0 -1
- data/dist/ai/playgrounds/progress_step.json +0 -1
- data/dist/ai/playgrounds/radio.json +0 -1
- data/dist/ai/playgrounds/rich_text_editor.json +0 -1
- data/dist/ai/playgrounds/section_separator.json +0 -1
- data/dist/ai/playgrounds/select.json +0 -1
- data/dist/ai/playgrounds/selectable_card.json +0 -1
- data/dist/ai/playgrounds/selectable_card_icon.json +0 -1
- data/dist/ai/playgrounds/selectable_icon.json +0 -1
- data/dist/ai/playgrounds/selectable_list.json +0 -1
- data/dist/ai/playgrounds/skeleton_loading.json +0 -1
- data/dist/ai/playgrounds/source.json +0 -1
- data/dist/ai/playgrounds/star_rating.json +0 -1
- data/dist/ai/playgrounds/stat_change.json +0 -1
- data/dist/ai/playgrounds/stat_value.json +0 -1
- data/dist/ai/playgrounds/table.json +0 -1
- data/dist/ai/playgrounds/text_input.json +0 -1
- data/dist/ai/playgrounds/textarea.json +0 -1
- data/dist/ai/playgrounds/time.json +0 -1
- data/dist/ai/playgrounds/time_picker.json +0 -1
- data/dist/ai/playgrounds/time_range_inline.json +0 -1
- data/dist/ai/playgrounds/time_stacked.json +0 -1
- data/dist/ai/playgrounds/timeline.json +0 -1
- data/dist/ai/playgrounds/timestamp.json +0 -1
- data/dist/ai/playgrounds/title.json +0 -1
- data/dist/ai/playgrounds/title_count.json +0 -1
- data/dist/ai/playgrounds/title_detail.json +0 -1
- data/dist/ai/playgrounds/toggle.json +0 -1
- data/dist/ai/playgrounds/tooltip.json +0 -1
- data/dist/ai/playgrounds/typeahead.json +0 -1
- data/dist/ai/playgrounds/user.json +0 -1
- data/dist/ai/playgrounds/user_badge.json +0 -1
- data/dist/ai/playgrounds/weekday_stacked.json +0 -1
- data/dist/ai/visual-index.json +0 -1
- data/dist/chunks/_table-D7wuBFbb.js +0 -1
- data/dist/chunks/_typeahead-KNcX62pc.js +0 -1
- data/lib/playbook/forms/builder/attribute_defaults.rb +0 -118
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3af0b188f87053d463603829df3767654f8de44a60f29eac5461b101a9c151d5
|
|
4
|
+
data.tar.gz: d541b26c3db0e6318e9b16e40507a4258b428bf4a9e549211a5a9f3b64426594
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 775749829145497000f59badfacaaad4ba79a49e14833c893f42a6bb42bda54c839affd668e2664bdd27641b251919ffc7257272cb5107b432abef03d03cefe1
|
|
7
|
+
data.tar.gz: 31a4797e342999ca8dbd9cad3197b28e9864de04527aa0e52ee5c841e0152ddd11bdf98f4ed7eb35b895ff3b4f0dc7f2778b83d179d916cda062a6900a36ca51
|
|
@@ -98,7 +98,7 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
|
98
98
|
imageUrl: getResponsiveValue(imageUrl),
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
//
|
|
101
|
+
// Update responsive values on window resize.
|
|
102
102
|
useEffect(() => {
|
|
103
103
|
const updateResponsiveProps = () => {
|
|
104
104
|
setResponsiveProps({
|
|
@@ -109,7 +109,6 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
|
109
109
|
imageUrl: getResponsiveValue(imageUrl),
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
|
-
updateResponsiveProps();
|
|
113
112
|
window.addEventListener('resize', updateResponsiveProps);
|
|
114
113
|
return () => window.removeEventListener('resize', updateResponsiveProps);
|
|
115
114
|
}, [backgroundSize, backgroundPosition, backgroundRepeat, backgroundColor, imageUrl]);
|
|
@@ -154,8 +153,6 @@ const Background = (props: BackgroundProps): React.ReactElement => {
|
|
|
154
153
|
...dynamicInlineProps
|
|
155
154
|
};
|
|
156
155
|
|
|
157
|
-
// Dynamic HTML tag from props; matches other kits (Title, Collapsible, etc.).
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
159
156
|
const Tag: React.ReactElement | any = `${tag}`;
|
|
160
157
|
const ariaProps = buildAriaProps(aria);
|
|
161
158
|
const dataProps = buildDataProps(data);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ensureAccessible, render, renderKit } from '../utilities/test-utils'
|
|
1
|
+
import { ensureAccessible, renderKit } from '../utilities/test-utils'
|
|
3
2
|
|
|
4
3
|
import Background from './_background'
|
|
5
4
|
|
|
@@ -21,27 +20,6 @@ test('backgroundColor = category_1', () => {
|
|
|
21
20
|
expect(kit).toHaveClass('pb_background_kit pb_background_color_category_1')
|
|
22
21
|
})
|
|
23
22
|
|
|
24
|
-
test('updates backgroundColor class when the prop changes', () => {
|
|
25
|
-
const { getByTestId, rerender } = render(
|
|
26
|
-
<Background
|
|
27
|
-
backgroundColor="info_subtle"
|
|
28
|
-
data={{ testid: 'background' }}
|
|
29
|
-
/>
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
expect(getByTestId('background')).toHaveClass('pb_background_color_info_subtle')
|
|
33
|
-
|
|
34
|
-
rerender(
|
|
35
|
-
<Background
|
|
36
|
-
backgroundColor="card_light"
|
|
37
|
-
data={{ testid: 'background' }}
|
|
38
|
-
/>
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
expect(getByTestId('background')).toHaveClass('pb_background_color_card_light')
|
|
42
|
-
expect(getByTestId('background')).not.toHaveClass('pb_background_color_info_subtle')
|
|
43
|
-
})
|
|
44
|
-
|
|
45
23
|
test('customColor prop styles background color with a hex value', () => {
|
|
46
24
|
const kit = renderKit(Background, props, { customColor: '#1d99a8' })
|
|
47
25
|
|
|
@@ -3,7 +3,6 @@ import classnames from 'classnames'
|
|
|
3
3
|
|
|
4
4
|
import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
|
|
5
5
|
import { deprecatedProps, globalProps, GlobalProps } from '../utilities/globalProps'
|
|
6
|
-
import { globalEventProps, GlobalEventProps } from '../utilities/globalEventProps'
|
|
7
6
|
|
|
8
7
|
import Highlight from '../pb_highlight/_highlight'
|
|
9
8
|
|
|
@@ -22,7 +21,7 @@ type BodyProps = {
|
|
|
22
21
|
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
|
|
23
22
|
text?: string,
|
|
24
23
|
variant?: null | 'link',
|
|
25
|
-
} & GlobalProps
|
|
24
|
+
} & GlobalProps
|
|
26
25
|
|
|
27
26
|
const Body = (props: BodyProps): React.ReactElement => {
|
|
28
27
|
if (props.variant) deprecatedProps() //status prop is deprecated, use color instead please
|
|
@@ -57,7 +56,6 @@ const Body = (props: BodyProps): React.ReactElement => {
|
|
|
57
56
|
{...ariaProps}
|
|
58
57
|
{...dataProps}
|
|
59
58
|
{...htmlProps}
|
|
60
|
-
{...globalEventProps(props)}
|
|
61
59
|
className={classes}
|
|
62
60
|
id={id}
|
|
63
61
|
>
|
|
@@ -7,7 +7,6 @@ import classnames from 'classnames'
|
|
|
7
7
|
|
|
8
8
|
import { buildAriaProps, buildDataProps, buildHtmlProps } from '../utilities/props'
|
|
9
9
|
import { GlobalProps, globalProps, globalInlineProps } from '../utilities/globalProps'
|
|
10
|
-
import { GlobalEventProps, globalEventProps } from '../utilities/globalEventProps'
|
|
11
10
|
import type { ProductColors, CategoryColors, BackgroundColors, StatusColors } from '../types/colors'
|
|
12
11
|
|
|
13
12
|
import Icon from '../pb_icon/_icon'
|
|
@@ -35,7 +34,7 @@ type CardPropTypes = {
|
|
|
35
34
|
padding?: string,
|
|
36
35
|
selected?: boolean,
|
|
37
36
|
tag?: "div" | "section" | "footer" | "header" | "article" | "aside" | "main" | "nav",
|
|
38
|
-
} & GlobalProps
|
|
37
|
+
} & GlobalProps
|
|
39
38
|
|
|
40
39
|
type CardHeaderProps = {
|
|
41
40
|
headerColor?: BackgroundColors | ProductColors | CategoryColors | StatusColors | "none",
|
|
@@ -157,7 +156,6 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
|
157
156
|
{...dataProps}
|
|
158
157
|
className={classnames(cardCss, globalProps(props), className)}
|
|
159
158
|
{...restHtmlProps}
|
|
160
|
-
{...globalEventProps(props)}
|
|
161
159
|
style={mergedStyles}
|
|
162
160
|
>
|
|
163
161
|
{subComponentTags('Header')}
|
|
@@ -187,7 +185,6 @@ const Card = (props: CardPropTypes): React.ReactElement => {
|
|
|
187
185
|
{...dataProps}
|
|
188
186
|
className={classnames(cardCss, globalProps(props), className)}
|
|
189
187
|
{...restHtmlProps}
|
|
190
|
-
{...globalEventProps(props)}
|
|
191
188
|
style={mergedStyles}
|
|
192
189
|
>
|
|
193
190
|
{subComponentTags('Header')}
|
|
@@ -25,16 +25,6 @@ $additional_colors: (
|
|
|
25
25
|
);
|
|
26
26
|
$background_colors: map-merge($product_colors, $additional_colors);
|
|
27
27
|
$pb_card_header_colors: map-merge(map-merge(map-merge($product_colors, $additional_colors), $category_colors), $status_colors);
|
|
28
|
-
// Prop sizes only — legacy $border_radius keys like "light" collide with background_light.
|
|
29
|
-
$pb_card_border_radius_values: (
|
|
30
|
-
xs: $border_radius_xs,
|
|
31
|
-
sm: $border_radius_sm,
|
|
32
|
-
md: $border_radius_md,
|
|
33
|
-
lg: $border_radius_lg,
|
|
34
|
-
xl: $border_radius_xl,
|
|
35
|
-
none: $border_radius_none,
|
|
36
|
-
rounded: $border_radius_rounded,
|
|
37
|
-
);
|
|
38
28
|
|
|
39
29
|
@mixin pb_card_selected($border_color: $primary) {
|
|
40
30
|
border-color: $border_color;
|
|
@@ -73,8 +63,8 @@ $pb_card_border_radius_values: (
|
|
|
73
63
|
}
|
|
74
64
|
}
|
|
75
65
|
|
|
76
|
-
@each $name, $radius in $
|
|
77
|
-
|
|
66
|
+
@each $name, $radius in $border_radius {
|
|
67
|
+
&[class*=_#{$name}] {
|
|
78
68
|
border-radius: $radius;
|
|
79
69
|
}
|
|
80
70
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
|
-
import { buildAriaProps, buildCss, buildDataProps
|
|
3
|
+
import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
|
|
4
4
|
import { globalProps } from '../utilities/globalProps'
|
|
5
5
|
|
|
6
6
|
import Button from '../pb_button/_button'
|
|
@@ -13,7 +13,6 @@ type CopyButtonProps = {
|
|
|
13
13
|
aria?: { [key: string]: string }
|
|
14
14
|
className?: string
|
|
15
15
|
data?: { [key: string]: string }
|
|
16
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)}
|
|
17
16
|
id?: string
|
|
18
17
|
from?: string
|
|
19
18
|
text?: string
|
|
@@ -30,7 +29,6 @@ const CopyButton = (props: CopyButtonProps) => {
|
|
|
30
29
|
className,
|
|
31
30
|
data = {},
|
|
32
31
|
from = '',
|
|
33
|
-
htmlOptions = {},
|
|
34
32
|
id,
|
|
35
33
|
text = 'Copy',
|
|
36
34
|
timeout = 1000,
|
|
@@ -44,14 +42,12 @@ const CopyButton = (props: CopyButtonProps) => {
|
|
|
44
42
|
|
|
45
43
|
const ariaProps = buildAriaProps(aria)
|
|
46
44
|
const dataProps = buildDataProps(data)
|
|
47
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
|
48
45
|
const classes = classnames(buildCss('pb_copy_button_kit'), globalProps(props), className)
|
|
49
46
|
|
|
50
47
|
return (
|
|
51
48
|
<div
|
|
52
49
|
{...ariaProps}
|
|
53
50
|
{...dataProps}
|
|
54
|
-
{...htmlProps}
|
|
55
51
|
className={classes}
|
|
56
52
|
id={id}
|
|
57
53
|
>
|
|
@@ -86,15 +86,3 @@ test('passes text and tooltip props to button', () => {
|
|
|
86
86
|
const tooltip = kit.querySelector('.pb_tooltip_kit')
|
|
87
87
|
expect(tooltip).toBeInTheDocument()
|
|
88
88
|
})
|
|
89
|
-
|
|
90
|
-
test('applies htmlOptions to the root element', () => {
|
|
91
|
-
render(
|
|
92
|
-
<CopyButton
|
|
93
|
-
data={{ testid: 'html-options-test' }}
|
|
94
|
-
htmlOptions={{ title: 'copy title' }}
|
|
95
|
-
value="copy"
|
|
96
|
-
/>
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
expect(screen.getByTestId('html-options-test')).toHaveAttribute('title', 'copy title')
|
|
100
|
-
})
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import classnames from 'classnames'
|
|
4
3
|
|
|
5
4
|
import { buildCss, buildHtmlProps } from '../utilities/props'
|
|
6
5
|
import { deprecatedProps, globalProps } from '../utilities/globalProps'
|
|
@@ -12,7 +11,6 @@ import TimeStacked from '../pb_time_stacked/_time_stacked'
|
|
|
12
11
|
import DateStacked from '../pb_date_stacked/_date_stacked'
|
|
13
12
|
|
|
14
13
|
type DateTimeStackedProps = {
|
|
15
|
-
className?: string,
|
|
16
14
|
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
17
15
|
id?: string,
|
|
18
16
|
date: Date,
|
|
@@ -29,25 +27,20 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
29
27
|
date,
|
|
30
28
|
datetime,
|
|
31
29
|
dark,
|
|
32
|
-
className,
|
|
33
30
|
htmlOptions = {},
|
|
34
31
|
timeZone = 'America/New_York',
|
|
35
32
|
showCurrentYear = false,
|
|
36
33
|
} = props
|
|
37
34
|
|
|
38
|
-
const classes =
|
|
39
|
-
|
|
40
|
-
globalProps(props),
|
|
41
|
-
className
|
|
42
|
-
)
|
|
35
|
+
const classes = buildCss('pb_date_time_stacked_kit', globalProps(props))
|
|
36
|
+
const htmlProps = buildHtmlProps(htmlOptions)
|
|
43
37
|
|
|
44
38
|
return (
|
|
45
39
|
<Flex
|
|
46
|
-
htmlOptions={htmlOptions}
|
|
47
40
|
inline={false}
|
|
48
41
|
vertical="stretch"
|
|
42
|
+
{...htmlProps}
|
|
49
43
|
{...props}
|
|
50
|
-
className={classes}
|
|
51
44
|
>
|
|
52
45
|
<FlexItem>
|
|
53
46
|
<DateStacked
|
|
@@ -65,6 +58,7 @@ const DateTimeStacked = (props: DateTimeStackedProps): React.ReactElement => {
|
|
|
65
58
|
/>
|
|
66
59
|
<FlexItem>
|
|
67
60
|
<TimeStacked
|
|
61
|
+
className={classes}
|
|
68
62
|
dark={dark}
|
|
69
63
|
date={date || datetime}
|
|
70
64
|
timeZone={timeZone}
|
|
@@ -74,15 +74,3 @@ test('hides current year by default', () => {
|
|
|
74
74
|
expect(yearElement).toBeNull()
|
|
75
75
|
}
|
|
76
76
|
})
|
|
77
|
-
|
|
78
|
-
test('applies kit class and global props to the root', () => {
|
|
79
|
-
const kit = renderKit(DateTimeStacked, {
|
|
80
|
-
data: { testid: 'datetimestacked-root' },
|
|
81
|
-
datetime,
|
|
82
|
-
dark: false,
|
|
83
|
-
margin: 'md',
|
|
84
|
-
})
|
|
85
|
-
|
|
86
|
-
expect(kit).toHaveClass('pb_date_time_stacked_kit')
|
|
87
|
-
expect(kit).toHaveClass('m_md')
|
|
88
|
-
})
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import classnames from 'classnames'
|
|
3
|
-
import { buildCss
|
|
3
|
+
import { buildCss } from '../../utilities/props'
|
|
4
4
|
import { globalProps } from '../../utilities/globalProps'
|
|
5
5
|
|
|
6
6
|
type DialogBodyProps = {
|
|
7
7
|
children: React.ReactNode | React.ReactNode[] | string,
|
|
8
8
|
padding?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
|
|
9
|
-
className?: string
|
|
10
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
9
|
+
className?: string
|
|
11
10
|
}
|
|
12
11
|
|
|
13
12
|
// Body component
|
|
14
13
|
const DialogBody = (props: DialogBodyProps): React.ReactElement => {
|
|
15
|
-
const { children, className
|
|
14
|
+
const { children, className } = props
|
|
16
15
|
const bodyCSS = buildCss("dialog_body")
|
|
17
16
|
const bodySpacing = globalProps(props)
|
|
18
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
|
19
17
|
|
|
20
18
|
return (
|
|
21
|
-
<div
|
|
22
|
-
{...htmlProps}
|
|
23
|
-
className={classnames(bodyCSS, bodySpacing, className)}
|
|
24
|
-
>
|
|
19
|
+
<div className={classnames(bodyCSS, bodySpacing, className)}>
|
|
25
20
|
{children}
|
|
26
21
|
</div>
|
|
27
22
|
)
|
|
@@ -268,13 +268,3 @@ describe('isNativeSelectMenuInteraction', () => {
|
|
|
268
268
|
expect(isNativeSelectMenuInteraction(dialog, select)).toBe(false)
|
|
269
269
|
})
|
|
270
270
|
})
|
|
271
|
-
|
|
272
|
-
test("applies htmlOptions to Dialog.Body", () => {
|
|
273
|
-
render(
|
|
274
|
-
<Dialog.Body htmlOptions={{ title: "body title" }}>
|
|
275
|
-
{"Body content"}
|
|
276
|
-
</Dialog.Body>
|
|
277
|
-
)
|
|
278
|
-
|
|
279
|
-
expect(document.querySelector(".dialog_body")).toHaveAttribute("title", "body title")
|
|
280
|
-
})
|
|
@@ -106,22 +106,6 @@
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
// Let Rails autocomplete use the trigger space left by its action icons.
|
|
110
|
-
> :has([data-dropdown-autocomplete]) {
|
|
111
|
-
flex: 1;
|
|
112
|
-
min-width: 0;
|
|
113
|
-
|
|
114
|
-
.pb_flex_kit:has([data-dropdown-autocomplete]) {
|
|
115
|
-
min-width: 0;
|
|
116
|
-
width: 100%;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
[data-dropdown-autocomplete] {
|
|
120
|
-
min-width: 0;
|
|
121
|
-
width: 100%;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
109
|
.dropdown_input:disabled {
|
|
126
110
|
background-color: $input_background_disabled;
|
|
127
111
|
color: $input_text_disabled;
|
|
@@ -112,8 +112,6 @@ type DropdownProps = {
|
|
|
112
112
|
isClosed?: boolean;
|
|
113
113
|
label?: string;
|
|
114
114
|
multiSelect?: boolean;
|
|
115
|
-
name?: string;
|
|
116
|
-
onChange?: (event: { target: { name?: string; value: any } }) => void;
|
|
117
115
|
onSelect?: (arg: GenericObject) => null;
|
|
118
116
|
options?: GenericObject;
|
|
119
117
|
placeholder?: string;
|
|
@@ -158,8 +156,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
158
156
|
label,
|
|
159
157
|
multiSelect = false,
|
|
160
158
|
formPillProps,
|
|
161
|
-
name,
|
|
162
|
-
onChange,
|
|
163
159
|
onSelect,
|
|
164
160
|
options,
|
|
165
161
|
placeholder,
|
|
@@ -418,10 +414,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
418
414
|
setIsDropDownClosed(false);
|
|
419
415
|
};
|
|
420
416
|
|
|
421
|
-
const handleSelectionChange = (value: any) => {
|
|
422
|
-
onSelect && onSelect(value);
|
|
423
|
-
onChange && onChange({ target: { name, value } });
|
|
424
|
-
};
|
|
425
417
|
|
|
426
418
|
const handleOptionClick = (clickedItem: GenericObject) => {
|
|
427
419
|
if (disabled) return;
|
|
@@ -434,7 +426,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
434
426
|
const next = exists
|
|
435
427
|
? list.filter((option) => option.value !== clickedItem.value)
|
|
436
428
|
: [...list, clickedItem];
|
|
437
|
-
|
|
429
|
+
onSelect && onSelect(next);
|
|
438
430
|
return next;
|
|
439
431
|
});
|
|
440
432
|
setFilterItem("");
|
|
@@ -447,7 +439,7 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
447
439
|
if (shouldCloseOnClick) {
|
|
448
440
|
setIsDropDownClosed(true);
|
|
449
441
|
}
|
|
450
|
-
|
|
442
|
+
onSelect && onSelect(clickedItem);
|
|
451
443
|
|
|
452
444
|
// Sync with DatePickers if this is a quickpick variant
|
|
453
445
|
if (variant === "quickpick" && Array.isArray(clickedItem.value)) {
|
|
@@ -476,10 +468,10 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
476
468
|
if (disabled) return;
|
|
477
469
|
if (multiSelect) {
|
|
478
470
|
setSelected([]);
|
|
479
|
-
|
|
471
|
+
onSelect && onSelect([]);
|
|
480
472
|
} else {
|
|
481
473
|
setSelected({});
|
|
482
|
-
|
|
474
|
+
onSelect && onSelect(null);
|
|
483
475
|
setFocusedOptionIndex(-1);
|
|
484
476
|
setFilterItem("");
|
|
485
477
|
|
|
@@ -513,10 +505,10 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
513
505
|
clearSelected: () => {
|
|
514
506
|
if (multiSelect) {
|
|
515
507
|
setSelected([]);
|
|
516
|
-
|
|
508
|
+
onSelect && onSelect([]);
|
|
517
509
|
} else {
|
|
518
510
|
setSelected({});
|
|
519
|
-
|
|
511
|
+
onSelect && onSelect(null);
|
|
520
512
|
}
|
|
521
513
|
setFilterItem("");
|
|
522
514
|
setIsDropDownClosed(true);
|
|
@@ -530,16 +522,16 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
530
522
|
clearSelected: () => {
|
|
531
523
|
if (multiSelect) {
|
|
532
524
|
setSelected([]);
|
|
533
|
-
|
|
525
|
+
onSelect && onSelect([]);
|
|
534
526
|
} else {
|
|
535
527
|
setSelected({});
|
|
536
|
-
|
|
528
|
+
onSelect && onSelect(null);
|
|
537
529
|
}
|
|
538
530
|
setFilterItem("");
|
|
539
531
|
setIsDropDownClosed(true);
|
|
540
532
|
},
|
|
541
533
|
};
|
|
542
|
-
}, [multiSelect,
|
|
534
|
+
}, [multiSelect, onSelect, setSelected, setFilterItem, setIsDropDownClosed]);
|
|
543
535
|
|
|
544
536
|
useImperativeHandle(ref, () => imperativeRef.current);
|
|
545
537
|
|
|
@@ -602,7 +594,6 @@ let Dropdown = (props: DropdownProps, ref: any): React.ReactElement | null => {
|
|
|
602
594
|
handleBackspace,
|
|
603
595
|
handleChange,
|
|
604
596
|
handleOptionClick,
|
|
605
|
-
handleSelectionChange,
|
|
606
597
|
handleWrapperClick,
|
|
607
598
|
inputRef,
|
|
608
599
|
inputWrapperRef,
|
|
@@ -70,7 +70,6 @@
|
|
|
70
70
|
"name": "Content",
|
|
71
71
|
"props": [
|
|
72
72
|
"label",
|
|
73
|
-
"name",
|
|
74
73
|
"placeholder",
|
|
75
74
|
"options",
|
|
76
75
|
"defaultValue",
|
|
@@ -112,7 +111,7 @@
|
|
|
112
111
|
},
|
|
113
112
|
{
|
|
114
113
|
"name": "Events",
|
|
115
|
-
"props": ["
|
|
114
|
+
"props": ["onSelect"]
|
|
116
115
|
}
|
|
117
116
|
],
|
|
118
117
|
"presets": [
|
|
@@ -2,8 +2,6 @@ examples:
|
|
|
2
2
|
rails:
|
|
3
3
|
- dropdown_default_rails: Default
|
|
4
4
|
- dropdown_with_autocomplete: Autocomplete
|
|
5
|
-
- dropdown_async_search: Async Search
|
|
6
|
-
- dropdown_async_custom_content: Async Search with Custom Content
|
|
7
5
|
- dropdown_multi_select_rails: Multi Select
|
|
8
6
|
- dropdown_multi_select_with_autocomplete: Multi Select with Autocomplete
|
|
9
7
|
- dropdown_multi_select_display_rails: Multi Select with Form Pill Props
|
|
@@ -41,9 +39,6 @@ examples:
|
|
|
41
39
|
- dropdown_disabled: Disabled Input
|
|
42
40
|
- dropdown_grouped_options: Grouped Options
|
|
43
41
|
- dropdown_custom_event_type: Custom Event Type
|
|
44
|
-
- dropdown_dynamic_options: Dynamic Options
|
|
45
|
-
- dropdown_dynamic_options_with_autocomplete: Dynamic Options with Autocomplete
|
|
46
|
-
- dropdown_dynamic_options_with_multi_select: Dynamic Options with Multi Select
|
|
47
42
|
|
|
48
43
|
react:
|
|
49
44
|
- dropdown_default: Default
|
|
@@ -86,6 +81,3 @@ examples:
|
|
|
86
81
|
- dropdown_required_indicator: Required Indicator
|
|
87
82
|
- dropdown_disabled: Disabled Input
|
|
88
83
|
- dropdown_grouped_options: Grouped Options
|
|
89
|
-
- dropdown_react_hook: React Hook
|
|
90
|
-
- dropdown_multi_select_react_hook: React Hook Multi Select
|
|
91
|
-
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export { default as DropdownDefault } from './_dropdown_default.jsx'
|
|
2
|
-
export { default as DropdownReactHook } from './_dropdown_react_hook.jsx'
|
|
3
|
-
export { default as DropdownMultiSelectReactHook } from './_dropdown_multi_select_react_hook.jsx'
|
|
4
2
|
export { default as DropdownWithCustomDisplay } from './_dropdown_with_custom_display.jsx'
|
|
5
3
|
export { default as DropdownWithCustomOptions } from './_dropdown_with_custom_options.jsx'
|
|
6
4
|
export { default as DropdownWithCustomTrigger } from './_dropdown_with_custom_trigger.jsx'
|
|
@@ -27,9 +27,6 @@ module Playbook
|
|
|
27
27
|
default: true
|
|
28
28
|
prop :autocomplete, type: Playbook::Props::Boolean,
|
|
29
29
|
default: false
|
|
30
|
-
prop :async, type: Playbook::Props::Boolean, default: false
|
|
31
|
-
prop :search_term_minimum_length, default: 3
|
|
32
|
-
prop :search_debounce_timeout, default: 250
|
|
33
30
|
prop :searchbar, type: Playbook::Props::Boolean,
|
|
34
31
|
default: false
|
|
35
32
|
prop :multi_select, type: Playbook::Props::Boolean,
|
|
@@ -62,22 +59,10 @@ module Playbook
|
|
|
62
59
|
default: false
|
|
63
60
|
prop :custom_event_type, type: Playbook::Props::String,
|
|
64
61
|
default: ""
|
|
65
|
-
prop :options_by_context, type: Playbook::Props::HashProp,
|
|
66
|
-
default: {}
|
|
67
|
-
prop :context_selector, type: Playbook::Props::String,
|
|
68
|
-
default: ""
|
|
69
|
-
prop :clear_on_context_change, type: Playbook::Props::Boolean,
|
|
70
|
-
default: true
|
|
71
|
-
prop :options_event_type, type: Playbook::Props::String,
|
|
72
|
-
default: ""
|
|
73
62
|
|
|
74
63
|
def data
|
|
75
64
|
Hash(prop(:data)).merge(
|
|
76
65
|
pb_dropdown: true,
|
|
77
|
-
pb_dropdown_async: async ? true : nil,
|
|
78
|
-
pb_dropdown_default_value: async && default_value.present? ? default_value.to_json : nil,
|
|
79
|
-
pb_dropdown_search_term_minimum_length: async ? search_term_minimum_length : nil,
|
|
80
|
-
pb_dropdown_search_debounce_timeout: async ? search_debounce_timeout : nil,
|
|
81
66
|
pb_dropdown_multi_select: multi_select,
|
|
82
67
|
pb_dropdown_disabled: disabled,
|
|
83
68
|
pb_dropdown_variant: variant,
|
|
@@ -88,11 +73,7 @@ module Playbook
|
|
|
88
73
|
end_date_id: variant == "quickpick" ? end_date_id : nil,
|
|
89
74
|
controls_start_id: variant == "quickpick" && controls_start_id.present? ? controls_start_id : nil,
|
|
90
75
|
controls_end_id: variant == "quickpick" && controls_end_id.present? ? controls_end_id : nil,
|
|
91
|
-
custom_event_type: custom_event_type.presence
|
|
92
|
-
pb_dropdown_options_by_context: options_by_context.present? ? options_by_context.to_json : nil,
|
|
93
|
-
pb_dropdown_context_selector: context_selector.presence,
|
|
94
|
-
pb_dropdown_clear_on_context_change: clear_on_context_change,
|
|
95
|
-
options_event_type: options_event_type.presence
|
|
76
|
+
custom_event_type: custom_event_type.presence
|
|
96
77
|
).compact
|
|
97
78
|
end
|
|
98
79
|
|