@planningcenter/chat-react-native 3.29.0 → 3.30.0-rc.1
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.
- package/build/components/conversation/attachments/attachment_card.js +2 -2
- package/build/components/conversation/attachments/attachment_card.js.map +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js +1 -1
- package/build/components/conversation/attachments/attachment_deleting_overlay.js.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/audio_attachment.js +3 -3
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -1
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -1
- package/build/components/conversation/attachments/expanded_link.js +2 -2
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +4 -4
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +3 -3
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +6 -6
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/video_attachment.js +4 -4
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/jump_to_bottom_button.js +1 -1
- package/build/components/conversation/jump_to_bottom_button.js.map +1 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +11 -11
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +4 -4
- package/build/components/conversation/message_attachments.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_image.js.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.d.ts.map +1 -1
- package/build/components/conversation/message_form/message_form_attachment_video.js.map +1 -1
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +9 -9
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.js +2 -2
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +1 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +2 -2
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +1 -1
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +1 -1
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +7 -7
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/components/conversation/typing_indicator.js +1 -1
- package/build/components/conversation/typing_indicator.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +3 -3
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.js +1 -1
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/mute_indicator.js +1 -1
- package/build/components/conversations/mute_indicator.js.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +2 -2
- package/build/components/conversations/swipeable_toggle_button.js.map +1 -1
- package/build/components/conversations/unread_count_badge.js +1 -1
- package/build/components/conversations/unread_count_badge.js.map +1 -1
- package/build/components/display/action_button.js +3 -3
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/banner.d.ts +1 -1
- package/build/components/display/banner.d.ts.map +1 -1
- package/build/components/display/banner.js.map +1 -1
- package/build/components/display/banner_collapsible.d.ts.map +1 -1
- package/build/components/display/banner_collapsible.js +1 -1
- package/build/components/display/banner_collapsible.js.map +1 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js +2 -2
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts +1 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +3 -3
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/heading.d.ts.map +1 -1
- package/build/components/display/heading.js +2 -2
- package/build/components/display/heading.js.map +1 -1
- package/build/components/display/icon.d.ts +4 -4
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +5 -5
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/icon_button.d.ts.map +1 -1
- package/build/components/display/icon_button.js +1 -1
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image_attachment_preview.js +3 -3
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/person.d.ts.map +1 -1
- package/build/components/display/person.js +1 -1
- package/build/components/display/person.js.map +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts +1 -1
- package/build/components/display/platform_modal_header_buttons.d.ts.map +1 -1
- package/build/components/display/platform_modal_header_buttons.js +3 -3
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/text.d.ts.map +1 -1
- package/build/components/display/text.js +1 -1
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_inline_button.d.ts.map +1 -1
- package/build/components/display/text_inline_button.js +2 -2
- package/build/components/display/text_inline_button.js.map +1 -1
- package/build/components/display/toggle_button.d.ts.map +1 -1
- package/build/components/display/toggle_button.js +3 -3
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/video_attachment_preview.js +4 -4
- package/build/components/display/video_attachment_preview.js.map +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +2 -2
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +1 -1
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.d.ts +1 -1
- package/build/components/primitive/banner_primitive.d.ts.map +1 -1
- package/build/components/primitive/banner_primitive.js +3 -3
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +1 -1
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/components/safe_area_modal.js +1 -1
- package/build/components/safe_area_modal.js.map +1 -1
- package/build/contexts/api_provider.js +3 -3
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts +3 -3
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js +1 -1
- package/build/contexts/chat_context.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +1 -1
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/contexts/session_context.d.ts.map +1 -1
- package/build/contexts/session_context.js +1 -1
- package/build/contexts/session_context.js.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts +2 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js +3 -2
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.js +2 -2
- package/build/hooks/services/use_find_or_create_services_conversation.js.map +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.js +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.js.map +1 -1
- package/build/hooks/services/use_team_plans.js +2 -2
- package/build/hooks/services/use_team_plans.js.map +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_attachment_uploader.d.ts.map +1 -1
- package/build/hooks/use_attachment_uploader.js +1 -1
- package/build/hooks/use_attachment_uploader.js.map +1 -1
- package/build/hooks/use_broadcast_typing_status.js +1 -1
- package/build/hooks/use_broadcast_typing_status.js.map +1 -1
- package/build/hooks/use_conversation.js +2 -2
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_membership.js +2 -2
- package/build/hooks/use_conversation_membership.js.map +1 -1
- package/build/hooks/use_conversation_message.js +1 -1
- package/build/hooks/use_conversation_message.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +1 -1
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +8 -8
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_create_android_ripple_color.js +1 -1
- package/build/hooks/use_create_android_ripple_color.js.map +1 -1
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_features.d.ts +1 -0
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -0
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_font_scale.js +1 -1
- package/build/hooks/use_font_scale.js.map +1 -1
- package/build/hooks/use_giphy.d.ts.map +1 -1
- package/build/hooks/use_giphy.js.map +1 -1
- package/build/hooks/use_interaction_ghost_color.js +1 -1
- package/build/hooks/use_interaction_ghost_color.js.map +1 -1
- package/build/hooks/use_live_relative_time.d.ts.map +1 -1
- package/build/hooks/use_live_relative_time.js +1 -1
- package/build/hooks/use_live_relative_time.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +5 -5
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/hooks/use_message_draft.js +1 -1
- package/build/hooks/use_message_draft.js.map +1 -1
- package/build/hooks/use_message_reaction_toggle.d.ts.map +1 -1
- package/build/hooks/use_message_reaction_toggle.js +2 -2
- package/build/hooks/use_message_reaction_toggle.js.map +1 -1
- package/build/hooks/use_my_gender.d.ts +7 -0
- package/build/hooks/use_my_gender.d.ts.map +1 -0
- package/build/hooks/use_my_gender.js +28 -0
- package/build/hooks/use_my_gender.js.map +1 -0
- package/build/hooks/use_organization.d.ts.map +1 -1
- package/build/hooks/use_organization.js.map +1 -1
- package/build/hooks/use_product_analytics.d.ts.map +1 -1
- package/build/hooks/use_product_analytics.js +1 -1
- package/build/hooks/use_product_analytics.js.map +1 -1
- package/build/hooks/use_report_message.d.ts.map +1 -1
- package/build/hooks/use_report_message.js +1 -1
- package/build/hooks/use_report_message.js.map +1 -1
- package/build/hooks/use_submit_age_check.d.ts.map +1 -1
- package/build/hooks/use_submit_age_check.js +2 -2
- package/build/hooks/use_submit_age_check.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +1 -1
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_typing_indicators.d.ts.map +1 -1
- package/build/hooks/use_typing_indicators.js +1 -1
- package/build/hooks/use_typing_indicators.js.map +1 -1
- package/build/navigation/chat_access_gate.js +4 -4
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +4 -4
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +6 -6
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.js +1 -1
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/polyfills/events/Event.d.ts +0 -4
- package/build/polyfills/events/Event.d.ts.map +1 -1
- package/build/polyfills/events/Event.js +5 -1
- package/build/polyfills/events/Event.js.map +1 -1
- package/build/polyfills/events/EventTarget.d.ts +0 -3
- package/build/polyfills/events/EventTarget.d.ts.map +1 -1
- package/build/polyfills/events/EventTarget.js +1 -1
- package/build/polyfills/events/EventTarget.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +5 -5
- package/build/screens/age_check/age_check_required_screen.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.d.ts.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +1 -1
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.d.ts.map +1 -1
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js +2 -2
- package/build/screens/age_check/components/age_check_select_birthdate_modal.js.map +1 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js +2 -2
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js.map +1 -1
- package/build/screens/bug_report_screen.d.ts +1 -1
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +9 -9
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js +2 -2
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js +2 -2
- package/build/screens/conversation_filter_recipients/components/checkbox_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.js +3 -3
- package/build/screens/conversation_filter_recipients/components/header_row.js.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js +1 -1
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/types.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/types.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/types.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +1 -1
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +2 -2
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts +1 -1
- package/build/screens/conversation_filters/group_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/group_filters.js +1 -1
- package/build/screens/conversation_filters/group_filters.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +2 -2
- package/build/screens/conversation_filters_screen.js.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.d.ts.map +1 -1
- package/build/screens/conversation_new/components/filter_by_plan.js +4 -4
- package/build/screens/conversation_new/components/filter_by_plan.js.map +1 -1
- package/build/screens/conversation_new/components/form_list.d.ts.map +1 -1
- package/build/screens/conversation_new/components/form_list.js.map +1 -1
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts +10 -0
- package/build/screens/conversation_new/components/gender_filter_toggle.d.ts.map +1 -0
- package/build/screens/conversation_new/components/gender_filter_toggle.js +50 -0
- package/build/screens/conversation_new/components/gender_filter_toggle.js.map +1 -0
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +28 -4
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +6 -6
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.js.map +1 -1
- package/build/screens/conversation_notification_level_select_screen.js +1 -1
- package/build/screens/conversation_notification_level_select_screen.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +9 -9
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +1 -1
- package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +2 -2
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts +1 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js +1 -1
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +4 -4
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/design_system_screen.js +3 -3
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.js +2 -2
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/report_reason_list.d.ts.map +1 -1
- package/build/screens/message_report/components/report_reason_list.js +2 -2
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.d.ts +2 -2
- package/build/screens/message_report_screen.d.ts.map +1 -1
- package/build/screens/message_report_screen.js +5 -5
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/not_found.d.ts.map +1 -1
- package/build/screens/not_found.js +1 -1
- package/build/screens/not_found.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.js +1 -1
- package/build/screens/notification_settings/hooks/groups.js.map +1 -1
- package/build/screens/notification_settings_screen.js +1 -1
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +1 -1
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.js +1 -1
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.js +1 -1
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.js +3 -3
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_create_message.js +2 -2
- package/build/utils/cache/optimistically_create_message.js.map +1 -1
- package/build/utils/cache/optimistically_update_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_update_message.js +1 -1
- package/build/utils/cache/optimistically_update_message.js.map +1 -1
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/client/transform_request_data.d.ts.map +1 -1
- package/build/utils/client/transform_request_data.js.map +1 -1
- package/build/utils/gender_display_label.d.ts +2 -0
- package/build/utils/gender_display_label.d.ts.map +1 -0
- package/build/utils/gender_display_label.js +11 -0
- package/build/utils/gender_display_label.js.map +1 -0
- package/build/utils/native_adapters/configuration.d.ts +3 -3
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +5 -5
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/performance_tracking.js +1 -1
- package/build/utils/performance_tracking.js.map +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/contexts/session_context.tsx +4 -4
- package/src/__tests__/event-polyfill.test.ts +2 -3
- package/src/__tests__/hooks/useTheme.tsx +3 -3
- package/src/__tests__/hooks/use_async_storage.test.tsx +2 -2
- package/src/__tests__/hooks/use_conversation_messages.ts +1 -1
- package/src/__tests__/utils/client.ts +2 -2
- package/src/__tests__/utils/native_adapters/configuration.ts +2 -2
- package/src/__utils__/handlers.ts +1 -1
- package/src/components/conversation/attachments/attachment_card.tsx +2 -2
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +1 -1
- package/src/components/conversation/attachments/audio_attachment.tsx +3 -3
- package/src/components/conversation/attachments/expanded_link.tsx +2 -2
- package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -5
- package/src/components/conversation/attachments/giphy_attachment.tsx +3 -3
- package/src/components/conversation/attachments/image_attachment.tsx +7 -7
- package/src/components/conversation/attachments/video_attachment.tsx +4 -4
- package/src/components/conversation/jump_to_bottom_button.tsx +1 -1
- package/src/components/conversation/message.tsx +13 -13
- package/src/components/conversation/message_attachments.tsx +4 -4
- package/src/components/conversation/message_form/message_form_attachment_image.tsx +1 -1
- package/src/components/conversation/message_form/message_form_attachment_video.tsx +1 -1
- package/src/components/conversation/message_form.tsx +15 -17
- package/src/components/conversation/message_markdown.tsx +2 -2
- package/src/components/conversation/message_reaction.tsx +3 -3
- package/src/components/conversation/message_read_receipts.tsx +2 -2
- package/src/components/conversation/messages_disabled_banners.tsx +1 -1
- package/src/components/conversation/reply_shadow_message.tsx +7 -7
- package/src/components/conversation/typing_indicator.tsx +1 -1
- package/src/components/conversations/conversation_preview.tsx +4 -4
- package/src/components/conversations/conversations.tsx +1 -1
- package/src/components/conversations/mute_indicator.tsx +1 -1
- package/src/components/conversations/swipeable_toggle_button.tsx +2 -2
- package/src/components/conversations/unread_count_badge.tsx +1 -1
- package/src/components/display/action_button.tsx +4 -4
- package/src/components/display/banner.tsx +1 -1
- package/src/components/display/banner_collapsible.tsx +1 -1
- package/src/components/display/button.tsx +2 -2
- package/src/components/display/child_notice.tsx +3 -3
- package/src/components/display/heading.tsx +2 -2
- package/src/components/display/icon.tsx +7 -8
- package/src/components/display/icon_button.tsx +2 -2
- package/src/components/display/image_attachment_preview.tsx +3 -3
- package/src/components/display/person.tsx +2 -2
- package/src/components/display/platform_modal_header_buttons.tsx +4 -4
- package/src/components/display/text.tsx +1 -1
- package/src/components/display/text_inline_button.tsx +2 -2
- package/src/components/display/toggle_button.tsx +3 -3
- package/src/components/display/video_attachment_preview.tsx +4 -4
- package/src/components/group_conversation_list.tsx +4 -4
- package/src/components/primitive/avatar_primitive.tsx +1 -1
- package/src/components/primitive/banner_primitive.tsx +6 -6
- package/src/components/primitive/form_sheet.tsx +1 -1
- package/src/components/safe_area_modal.tsx +1 -1
- package/src/contexts/api_provider.tsx +3 -3
- package/src/contexts/chat_context.tsx +4 -4
- package/src/contexts/conversations_context.tsx +3 -3
- package/src/contexts/session_context.tsx +2 -2
- package/src/hooks/groups/use_groups_conversation_create.ts +4 -2
- package/src/hooks/services/use_find_or_create_services_conversation.ts +2 -2
- package/src/hooks/services/use_team_members_for_new_conversation.ts +2 -2
- package/src/hooks/services/use_team_plans.ts +3 -3
- package/src/hooks/use_api_client.ts +1 -1
- package/src/hooks/use_attachment_uploader.ts +3 -3
- package/src/hooks/use_broadcast_typing_status.ts +1 -1
- package/src/hooks/use_conversation.ts +2 -2
- package/src/hooks/use_conversation_membership.ts +2 -2
- package/src/hooks/use_conversation_message.ts +1 -1
- package/src/hooks/use_conversation_messages.ts +1 -1
- package/src/hooks/use_conversation_messages_jolt_events.ts +12 -12
- package/src/hooks/use_create_android_ripple_color.ts +1 -1
- package/src/hooks/use_current_person.ts +1 -1
- package/src/hooks/use_features.ts +3 -2
- package/src/hooks/use_font_scale.ts +1 -1
- package/src/hooks/use_giphy.ts +1 -1
- package/src/hooks/use_interaction_ghost_color.ts +1 -1
- package/src/hooks/use_live_relative_time.ts +1 -1
- package/src/hooks/use_message_create_or_update.ts +7 -7
- package/src/hooks/use_message_draft.ts +2 -2
- package/src/hooks/use_message_reaction_toggle.ts +2 -2
- package/src/hooks/use_my_gender.ts +42 -0
- package/src/hooks/use_organization.ts +1 -1
- package/src/hooks/use_product_analytics.ts +2 -2
- package/src/hooks/use_report_message.ts +2 -2
- package/src/hooks/use_submit_age_check.ts +3 -3
- package/src/hooks/use_suspense_api.ts +3 -3
- package/src/hooks/use_typing_indicators.ts +2 -2
- package/src/navigation/chat_access_gate.tsx +4 -4
- package/src/navigation/index.tsx +12 -12
- package/src/navigation/screenLayout.tsx +1 -1
- package/src/polyfills/events/Event.ts +1 -1
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/screens/age_check/age_check_required_screen.tsx +5 -5
- package/src/screens/age_check/age_check_underage_screen.tsx +1 -1
- package/src/screens/age_check/components/age_check_select_birthdate_modal.tsx +2 -2
- package/src/screens/attachment_actions/hooks/useDeleteAttachment.tsx +2 -2
- package/src/screens/bug_report_screen.tsx +13 -13
- package/src/screens/conversation/message_read_receipts_screen.tsx +3 -3
- package/src/screens/conversation_details_screen.tsx +0 -1
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +2 -2
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +4 -4
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +1 -1
- package/src/screens/conversation_filter_recipients/types.tsx +1 -1
- package/src/screens/conversation_filters/components/rows.tsx +1 -1
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +3 -3
- package/src/screens/conversation_filters/group_filters.tsx +3 -3
- package/src/screens/conversation_filters/hooks/filters.ts +1 -1
- package/src/screens/conversation_filters_screen.tsx +2 -2
- package/src/screens/conversation_new/components/filter_by_plan.tsx +4 -4
- package/src/screens/conversation_new/components/form_list.tsx +1 -1
- package/src/screens/conversation_new/components/gender_filter_toggle.tsx +92 -0
- package/src/screens/conversation_new/components/groups_form.tsx +63 -4
- package/src/screens/conversation_new/components/services_form.tsx +7 -7
- package/src/screens/conversation_new/conversation_new_screen.tsx +3 -3
- package/src/screens/conversation_notification_level_select_screen.tsx +1 -1
- package/src/screens/conversation_screen.tsx +13 -13
- package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +3 -3
- package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +3 -3
- package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +3 -3
- package/src/screens/conversation_select_type_screen.tsx +2 -2
- package/src/screens/conversations/components/list_header_component.tsx +4 -4
- package/src/screens/design_system_screen.tsx +3 -3
- package/src/screens/group_notification_settings_screen.tsx +1 -1
- package/src/screens/message_actions_screen.tsx +3 -3
- package/src/screens/message_report/components/report_reason_list.tsx +2 -2
- package/src/screens/message_report_screen.tsx +8 -8
- package/src/screens/not_found.tsx +1 -1
- package/src/screens/notification_settings/hooks/groups.ts +1 -1
- package/src/screens/notification_settings_screen.tsx +1 -1
- package/src/screens/preferred_app_selection_screen.tsx +1 -1
- package/src/screens/send_giphy_screen.tsx +1 -1
- package/src/screens/team_conversation_screen.tsx +1 -1
- package/src/utils/__tests__/convert_attachments_for_create.test.ts +2 -2
- package/src/utils/cache/messages_cache.ts +3 -3
- package/src/utils/cache/optimistically_create_message.ts +4 -4
- package/src/utils/cache/optimistically_update_message.ts +1 -1
- package/src/utils/client/client.ts +0 -1
- package/src/utils/client/transform_request_data.ts +1 -1
- package/src/utils/gender_display_label.ts +10 -0
- package/src/utils/native_adapters/configuration.ts +5 -5
- package/src/utils/performance_tracking.ts +1 -1
- package/src/utils/theme.ts +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import { AvatarGroup, Heading, Text, Badge } from '../display';
|
|
4
|
-
import { formatDatePreview } from '../../utils/date';
|
|
5
3
|
import { useTheme, useAtFontScaleBreakpoint, useFontScale, useScalableNumberOfLines, } from '../../hooks';
|
|
6
|
-
import {
|
|
4
|
+
import { formatDatePreview } from '../../utils/date';
|
|
5
|
+
import { AvatarGroup, Heading, Text, Badge } from '../display';
|
|
7
6
|
import { ConversationActions } from './conversation_actions';
|
|
8
7
|
import { MuteIndicator } from './mute_indicator';
|
|
8
|
+
import { UnreadCountBadge } from './unread_count_badge';
|
|
9
9
|
const EMPTY_CONVERSATION_PREVIEW_TEXT = 'Send your first message';
|
|
10
10
|
export const ConversationPreview = ({ conversation, onPress, showBadges = true, style, }) => {
|
|
11
11
|
const styles = useStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_preview.js","sourceRoot":"","sources":["../../../src/components/conversations/conversation_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAE1D,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAA;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,GACzB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAEhD,MAAM,+BAA+B,GAAG,yBAAyB,CAAA;AASjE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,EAClC,YAAY,EACZ,OAAO,EACP,UAAU,GAAG,IAAI,EACjB,KAAK,GACoB,EAAE,EAAE;IAC7B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EACJ,qBAAqB,EACrB,oBA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C,YAAY,EAAE,CAAC;SAChB;QACD,aAAa,EAAE;YACb,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;YACzD,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;YACtE,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;SACxD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY,EAAE,CAAC;SAChB;QACD,MAAM,EAAE;YACN,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,YAAY;SACzB;QACD,eAAe,EAAE;YACf,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC,GAAG,SAAS;SACnB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { ConversationResource } from '../../types'\nimport { AvatarGroup, Heading, Text, Badge, type BadgeProps } from '../display'\nimport { formatDatePreview } from '../../utils/date'\nimport {\n useTheme,\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n} from '../../hooks'\nimport { UnreadCountBadge } from './unread_count_badge'\nimport { ConversationActions } from './conversation_actions'\nimport { MuteIndicator } from './mute_indicator'\n\nconst EMPTY_CONVERSATION_PREVIEW_TEXT = 'Send your first message'\n\ninterface ConversationPreviewProps {\n conversation: ConversationResource\n onPress: () => void\n showBadges?: boolean\n style?: ViewStyle\n}\n\nexport const ConversationPreview = ({\n conversation,\n onPress,\n showBadges = true,\n style,\n}: ConversationPreviewProps) => {\n const styles = useStyles()\n const {\n lastMessageAuthorName,\n lastMessageCreatedAt,\n lastMessageTextPreview,\n previewAvatarUrls,\n title,\n unreadCount,\n badges,\n muted,\n } = conversation\n\n const emptyConversation = !lastMessageCreatedAt\n const hasAvatarUrls = previewAvatarUrls && previewAvatarUrls.length > 0\n const shouldShowFallback = emptyConversation || !hasAvatarUrls\n const fallbackIconName = emptyConversation ? 'people.noTextMessage' : 'general.person'\n const hasMetaContent = lastMessageCreatedAt || unreadCount > 0 || muted\n\n const numberOfLinesScaledTitle = useScalableNumberOfLines(1)\n const numberOfLinesScaledPreviewText = useScalableNumberOfLines(2)\n\n const conversationPreviewText = lastMessageTextPreview\n ? `${lastMessageAuthorName}: ${lastMessageTextPreview}`\n : EMPTY_CONVERSATION_PREVIEW_TEXT\n\n const conversationAccessibilityLabel = getConversationAccessibilityLabel({\n conversation,\n showBadges,\n })\n\n return (\n <ConversationActions\n conversation={conversation}\n style={[styles.previewRow, style]}\n onPress={onPress}\n accessibilityLabel={conversationAccessibilityLabel}\n >\n <AvatarGroup\n size=\"lg\"\n sourceUris={previewAvatarUrls || []}\n showFallback={shouldShowFallback}\n fallbackIconName={fallbackIconName}\n />\n <View style={styles.conversationBody}>\n <Heading numberOfLines={numberOfLinesScaledTitle} variant=\"h3\" style={styles.title}>\n {title}\n </Heading>\n <Text\n variant=\"tertiary\"\n numberOfLines={numberOfLinesScaledPreviewText}\n style={emptyConversation && styles.emptyConversationPreviewText}\n >\n {conversationPreviewText}\n </Text>\n <ConversationBadges visible={showBadges} badges={badges} />\n </View>\n {hasMetaContent && (\n <View style={styles.metaContainer}>\n <Text variant=\"tertiary\">{formatDatePreview(lastMessageCreatedAt)}</Text>\n <View style={styles.statusContainer}>\n <UnreadCountBadge count={unreadCount} showDot={muted} />\n <MuteIndicator muted={muted} />\n </View>\n </View>\n )}\n </ConversationActions>\n )\n}\n\ninterface BadgeShape {\n appName?: BadgeProps['productLogoName']\n pcoResourceType: string\n text: string | null\n}\nconst ConversationBadges = ({ visible, badges }: { visible: boolean; badges?: BadgeShape[] }) => {\n const styles = useStyles()\n const numberOfLinesScaled = useScalableNumberOfLines(1)\n\n if (!visible || !badges || badges.length === 0) {\n return null\n }\n\n return (\n <View style={styles.badges}>\n {badges.map(badge => (\n <Badge\n key={badge.text}\n variant=\"meta\"\n productLogoName={badge.appName}\n label={badge.pcoResourceType}\n metaLabel={badge.text || ''}\n numberOfLinesMetaLabel={numberOfLinesScaled}\n />\n ))}\n </View>\n )\n}\n\nconst skeletonBadges: BadgeShape[] = [\n {\n pcoResourceType: ' ',\n text: ' ',\n },\n]\nexport const ConversationPreviewSkeleton = () => {\n const styles = useStyles()\n\n return (\n <View style={styles.previewRow}>\n <AvatarGroup\n size=\"lg\"\n sourceUris={[]}\n showFallback={true}\n fallbackIconName={'general.person'}\n />\n <View style={styles.conversationBody}>\n <View style={styles.titleLoading} />\n <View style={styles.subtitleLoading} />\n <ConversationBadges visible={true} badges={skeletonBadges} />\n </View>\n <View style={styles.metaContainer}>\n <View style={styles.dateLoading} />\n </View>\n </View>\n )\n}\n\ninterface GetConversationAccessibilityLabelProps {\n conversation: ConversationResource\n showBadges: boolean\n}\nconst getConversationAccessibilityLabel = ({\n conversation,\n showBadges,\n}: GetConversationAccessibilityLabelProps) => {\n const {\n badges,\n title,\n lastMessageAuthorName,\n lastMessageTextPreview,\n muted,\n unreadCount,\n lastMessageCreatedAt,\n } = conversation\n\n const hasBadges = badges && showBadges\n const hasUnreadMessages = unreadCount > 0\n const hasLastMessage = lastMessageCreatedAt\n\n const label = {\n title,\n badge: hasBadges ? `for ${badges[0]?.pcoResourceType} ${badges[0]?.text || ''}` : '',\n muted: muted ? 'Muted' : '',\n readStatus: hasUnreadMessages ? `${unreadCount} unread messages` : '',\n lastMessage: hasLastMessage\n ? `Last message sent ${formatDatePreview(lastMessageCreatedAt)} from ${lastMessageAuthorName} and says ${lastMessageTextPreview}`\n : EMPTY_CONVERSATION_PREVIEW_TEXT,\n }\n\n return `Select ${label.title}, ${label.badge}, ${label.muted}, ${label.readStatus}, ${label.lastMessage}`.trim()\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n const fontScale = useFontScale()\n\n return StyleSheet.create({\n previewRow: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n gap: 8,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? colors.borderColorDefaultDark\n : colors.borderColorDefaultDim,\n paddingTop: 12,\n paddingBottom: 12,\n paddingHorizontal: 16,\n },\n title: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n },\n titleLoading: {\n width: 120,\n height: 20,\n backgroundColor: colors.fillColorNeutral080,\n borderRadius: 4,\n },\n conversationBody: {\n flex: 1,\n rowGap: 2,\n },\n emptyConversationPreviewText: {\n color: colors.interaction,\n },\n subtitleLoading: {\n width: 80,\n height: 16,\n backgroundColor: colors.fillColorNeutral090,\n borderRadius: 4,\n },\n metaContainer: {\n gap: 4,\n alignItems: atFontScaleBreakpoint ? 'center' : 'flex-end',\n justifyContent: atFontScaleBreakpoint ? 'space-between' : 'flex-start',\n flexDirection: atFontScaleBreakpoint ? 'row' : 'column',\n },\n dateLoading: {\n width: 60,\n height: 16,\n backgroundColor: colors.fillColorNeutral090,\n borderRadius: 4,\n },\n badges: {\n marginTop: 4,\n alignItems: 'flex-start',\n },\n statusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4 * fontScale,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_preview.js","sourceRoot":"","sources":["../../../src/components/conversations/conversation_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAa,MAAM,cAAc,CAAA;AAC1D,OAAO,EACL,QAAQ,EACR,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,GACzB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE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QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,uBAAuB;SACtC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY,EAAE,CAAC;SAChB;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;SACV;QACD,4BAA4B,EAAE;YAC5B,KAAK,EAAE,MAAM,CAAC,WAAW;SAC1B;QACD,eAAe,EAAE;YACf,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY,EAAE,CAAC;SAChB;QACD,aAAa,EAAE;YACb,GAAG,EAAE,CAAC;YACN,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU;YACzD,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,YAAY;YACtE,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ;SACxD;QACD,WAAW,EAAE;YACX,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY,EAAE,CAAC;SAChB;QACD,MAAM,EAAE;YACN,SAAS,EAAE,CAAC;YACZ,UAAU,EAAE,YAAY;SACzB;QACD,eAAe,EAAE;YACf,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC,GAAG,SAAS;SACnB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport {\n useTheme,\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n} from '../../hooks'\nimport { ConversationResource } from '../../types'\nimport { formatDatePreview } from '../../utils/date'\nimport { AvatarGroup, Heading, Text, Badge, type BadgeProps } from '../display'\nimport { ConversationActions } from './conversation_actions'\nimport { MuteIndicator } from './mute_indicator'\nimport { UnreadCountBadge } from './unread_count_badge'\n\nconst EMPTY_CONVERSATION_PREVIEW_TEXT = 'Send your first message'\n\ninterface ConversationPreviewProps {\n conversation: ConversationResource\n onPress: () => void\n showBadges?: boolean\n style?: ViewStyle\n}\n\nexport const ConversationPreview = ({\n conversation,\n onPress,\n showBadges = true,\n style,\n}: ConversationPreviewProps) => {\n const styles = useStyles()\n const {\n lastMessageAuthorName,\n lastMessageCreatedAt,\n lastMessageTextPreview,\n previewAvatarUrls,\n title,\n unreadCount,\n badges,\n muted,\n } = conversation\n\n const emptyConversation = !lastMessageCreatedAt\n const hasAvatarUrls = previewAvatarUrls && previewAvatarUrls.length > 0\n const shouldShowFallback = emptyConversation || !hasAvatarUrls\n const fallbackIconName = emptyConversation ? 'people.noTextMessage' : 'general.person'\n const hasMetaContent = lastMessageCreatedAt || unreadCount > 0 || muted\n\n const numberOfLinesScaledTitle = useScalableNumberOfLines(1)\n const numberOfLinesScaledPreviewText = useScalableNumberOfLines(2)\n\n const conversationPreviewText = lastMessageTextPreview\n ? `${lastMessageAuthorName}: ${lastMessageTextPreview}`\n : EMPTY_CONVERSATION_PREVIEW_TEXT\n\n const conversationAccessibilityLabel = getConversationAccessibilityLabel({\n conversation,\n showBadges,\n })\n\n return (\n <ConversationActions\n conversation={conversation}\n style={[styles.previewRow, style]}\n onPress={onPress}\n accessibilityLabel={conversationAccessibilityLabel}\n >\n <AvatarGroup\n size=\"lg\"\n sourceUris={previewAvatarUrls || []}\n showFallback={shouldShowFallback}\n fallbackIconName={fallbackIconName}\n />\n <View style={styles.conversationBody}>\n <Heading numberOfLines={numberOfLinesScaledTitle} variant=\"h3\" style={styles.title}>\n {title}\n </Heading>\n <Text\n variant=\"tertiary\"\n numberOfLines={numberOfLinesScaledPreviewText}\n style={emptyConversation && styles.emptyConversationPreviewText}\n >\n {conversationPreviewText}\n </Text>\n <ConversationBadges visible={showBadges} badges={badges} />\n </View>\n {hasMetaContent && (\n <View style={styles.metaContainer}>\n <Text variant=\"tertiary\">{formatDatePreview(lastMessageCreatedAt)}</Text>\n <View style={styles.statusContainer}>\n <UnreadCountBadge count={unreadCount} showDot={muted} />\n <MuteIndicator muted={muted} />\n </View>\n </View>\n )}\n </ConversationActions>\n )\n}\n\ninterface BadgeShape {\n appName?: BadgeProps['productLogoName']\n pcoResourceType: string\n text: string | null\n}\nconst ConversationBadges = ({ visible, badges }: { visible: boolean; badges?: BadgeShape[] }) => {\n const styles = useStyles()\n const numberOfLinesScaled = useScalableNumberOfLines(1)\n\n if (!visible || !badges || badges.length === 0) {\n return null\n }\n\n return (\n <View style={styles.badges}>\n {badges.map(badge => (\n <Badge\n key={badge.text}\n variant=\"meta\"\n productLogoName={badge.appName}\n label={badge.pcoResourceType}\n metaLabel={badge.text || ''}\n numberOfLinesMetaLabel={numberOfLinesScaled}\n />\n ))}\n </View>\n )\n}\n\nconst skeletonBadges: BadgeShape[] = [\n {\n pcoResourceType: ' ',\n text: ' ',\n },\n]\nexport const ConversationPreviewSkeleton = () => {\n const styles = useStyles()\n\n return (\n <View style={styles.previewRow}>\n <AvatarGroup\n size=\"lg\"\n sourceUris={[]}\n showFallback={true}\n fallbackIconName={'general.person'}\n />\n <View style={styles.conversationBody}>\n <View style={styles.titleLoading} />\n <View style={styles.subtitleLoading} />\n <ConversationBadges visible={true} badges={skeletonBadges} />\n </View>\n <View style={styles.metaContainer}>\n <View style={styles.dateLoading} />\n </View>\n </View>\n )\n}\n\ninterface GetConversationAccessibilityLabelProps {\n conversation: ConversationResource\n showBadges: boolean\n}\nconst getConversationAccessibilityLabel = ({\n conversation,\n showBadges,\n}: GetConversationAccessibilityLabelProps) => {\n const {\n badges,\n title,\n lastMessageAuthorName,\n lastMessageTextPreview,\n muted,\n unreadCount,\n lastMessageCreatedAt,\n } = conversation\n\n const hasBadges = badges && showBadges\n const hasUnreadMessages = unreadCount > 0\n const hasLastMessage = lastMessageCreatedAt\n\n const label = {\n title,\n badge: hasBadges ? `for ${badges[0]?.pcoResourceType} ${badges[0]?.text || ''}` : '',\n muted: muted ? 'Muted' : '',\n readStatus: hasUnreadMessages ? `${unreadCount} unread messages` : '',\n lastMessage: hasLastMessage\n ? `Last message sent ${formatDatePreview(lastMessageCreatedAt)} from ${lastMessageAuthorName} and says ${lastMessageTextPreview}`\n : EMPTY_CONVERSATION_PREVIEW_TEXT,\n }\n\n return `Select ${label.title}, ${label.badge}, ${label.muted}, ${label.readStatus}, ${label.lastMessage}`.trim()\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n const fontScale = useFontScale()\n\n return StyleSheet.create({\n previewRow: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n gap: 8,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? colors.borderColorDefaultDark\n : colors.borderColorDefaultDim,\n paddingTop: 12,\n paddingBottom: 12,\n paddingHorizontal: 16,\n },\n title: {\n fontSize: 16,\n color: colors.textColorDefaultPrimary,\n },\n titleLoading: {\n width: 120,\n height: 20,\n backgroundColor: colors.fillColorNeutral080,\n borderRadius: 4,\n },\n conversationBody: {\n flex: 1,\n rowGap: 2,\n },\n emptyConversationPreviewText: {\n color: colors.interaction,\n },\n subtitleLoading: {\n width: 80,\n height: 16,\n backgroundColor: colors.fillColorNeutral090,\n borderRadius: 4,\n },\n metaContainer: {\n gap: 4,\n alignItems: atFontScaleBreakpoint ? 'center' : 'flex-end',\n justifyContent: atFontScaleBreakpoint ? 'space-between' : 'flex-start',\n flexDirection: atFontScaleBreakpoint ? 'row' : 'column',\n },\n dateLoading: {\n width: 60,\n height: 16,\n backgroundColor: colors.fillColorNeutral090,\n borderRadius: 4,\n },\n badges: {\n marginTop: 4,\n alignItems: 'flex-start',\n },\n statusContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 4 * fontScale,\n },\n })\n}\n"]}
|
|
@@ -3,10 +3,10 @@ import React, { useMemo } from 'react';
|
|
|
3
3
|
import { FlatList, StyleSheet, View } from 'react-native';
|
|
4
4
|
import { useConversationsContext } from '../../contexts/conversations_context';
|
|
5
5
|
import { useTheme } from '../../hooks';
|
|
6
|
+
import { useConversationsJoltEvents } from '../../hooks/use_conversations_jolt_events';
|
|
6
7
|
import { throwResponseError } from '../../utils/response_error';
|
|
7
8
|
import BlankState from '../primitive/blank_state_primitive';
|
|
8
9
|
import { ConversationPreview, ConversationPreviewSkeleton } from './conversation_preview';
|
|
9
|
-
import { useConversationsJoltEvents } from '../../hooks/use_conversations_jolt_events';
|
|
10
10
|
export const Conversations = ({ ListHeaderComponent }) => {
|
|
11
11
|
const styles = useStyles();
|
|
12
12
|
const { conversations, isLoading, fetchNextPage, refetch, isRefetching, isFetched, isError, error, args: { chat_group_graph_id }, } = useConversationsContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"conversations.js","sourceRoot":"","sources":["../../../src/components/conversations/conversations.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAA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KAAK;wBAC1B,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;wBAChC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO;wBAC9B,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK;qBAC3B,CACH,CAAC,CACD,UAAU,CAAC,CAAC,UAAU,CAAC,EACvB,CACH,CAAA;YACH,CAAC;QACH,CAAC,CAAC,CACF,YAAY,CAAC,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,CAAC,EAExC;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACtB,gBAAgB,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE;QACzC,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,EAAE;QAC/C,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,eAAe,EAAE,EAAE;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA;AAaD,MAAM,kBAAkB,GAAmB,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9E,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,UAAU,CAAC,EAAE;CAClB,CAAC,CAAC,CAAA","sourcesContent":["import { useNavigation } from '@react-navigation/native'\nimport React, { useMemo } from 'react'\nimport { FlatList, StyleSheet, View } from 'react-native'\nimport { useConversationsContext } from '../../contexts/conversations_context'\nimport { useTheme } from '../../hooks'\nimport { useConversationsJoltEvents } from '../../hooks/use_conversations_jolt_events'\nimport { ConversationResource } from '../../types'\nimport { throwResponseError } from '../../utils/response_error'\nimport BlankState from '../primitive/blank_state_primitive'\nimport { ConversationPreview, ConversationPreviewSkeleton } from './conversation_preview'\n\ninterface ConversationsProps {\n ListHeaderComponent?:\n | React.ComponentType<any>\n | React.ReactElement<any, string | React.JSXElementConstructor<any>>\n | null\n | undefined\n}\n\nexport const Conversations = ({ ListHeaderComponent }: ConversationsProps) => {\n const styles = useStyles()\n const {\n conversations,\n isLoading,\n fetchNextPage,\n refetch,\n isRefetching,\n isFetched,\n isError,\n error,\n args: { chat_group_graph_id },\n } = useConversationsContext()\n const navigation = useNavigation()\n\n const showBadges = !chat_group_graph_id\n\n const data: FlatListItem[] = useMemo(() => {\n if (isLoading) {\n return loadingPlaceholder\n }\n return conversations.map(conversation => ({\n type: 'conversation' as const,\n id: conversation.id,\n resource: conversation,\n }))\n }, [conversations, isLoading])\n\n if (isError) {\n throwResponseError(error)\n }\n\n useConversationsJoltEvents()\n\n return (\n <View style={styles.container}>\n <FlatList\n data={data}\n keyExtractor={item => item.id.toString()}\n contentContainerStyle={styles.contentContainer}\n onRefresh={refetch}\n refreshing={!isFetched && isRefetching}\n ListHeaderComponent={ListHeaderComponent}\n ListEmptyComponent={\n <View style={styles.listEmpty}>\n <BlankState.Root>\n <BlankState.Imagery name=\"general.outlinedTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>No conversations</BlankState.Heading>\n </BlankState.Content>\n </BlankState.Root>\n </View>\n }\n renderItem={({ item }) => {\n if (item.type === 'loading') {\n return <ConversationPreviewSkeleton />\n } else {\n return (\n <ConversationPreview\n conversation={item.resource}\n onPress={() =>\n navigation.navigate('Conversation', {\n conversation_id: item.resource.id,\n title: item.resource.title,\n badge: item.resource.badges?.[0],\n deleted: item.resource.deleted,\n muted: item.resource.muted,\n })\n }\n showBadges={showBadges}\n />\n )\n }\n }}\n onEndReached={() => fetchNextPage()}\n />\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n container: { flex: 1 },\n contentContainer: { paddingVertical: 16 },\n listItem: { color: colors.fillColorNeutral020 },\n listEmpty: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 32,\n },\n })\n}\n\ninterface FlatListLoadingItem {\n type: 'loading'\n id: string\n}\ninterface FlatListConversationItem {\n type: 'conversation'\n resource: ConversationResource\n id: number\n}\ntype FlatListItem = FlatListLoadingItem | FlatListConversationItem\n\nconst loadingPlaceholder: FlatListItem[] = Array.from({ length: 5 }, (_, i) => ({\n type: 'loading',\n id: `loading${i}`,\n}))\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
|
-
import { Icon } from '../display';
|
|
4
3
|
import { useTheme } from '../../hooks';
|
|
5
4
|
import { MAX_FONT_SIZE_MULTIPLIER } from '../../utils';
|
|
5
|
+
import { Icon } from '../display';
|
|
6
6
|
export const MuteIndicator = ({ muted }) => {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
if (!muted)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mute_indicator.js","sourceRoot":"","sources":["../../../src/components/conversations/mute_indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"mute_indicator.js","sourceRoot":"","sources":["../../../src/components/conversations/mute_indicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAE,KAAK,EAAsB,EAAE,EAAE;IAC7D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,CAAC,mBAAmB,CACxB,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CACxB,qBAAqB,CAAC,CAAC,wBAAwB,CAAC,EAChD,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,mBAAmB;YACjC,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER } from '../../utils'\nimport { Icon } from '../display'\n\nexport const MuteIndicator = ({ muted }: { muted: boolean }) => {\n const styles = useStyles()\n\n if (!muted) return null\n\n return (\n <Icon\n name=\"general.bellMuted\"\n style={styles.mutedIcon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n mutedIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipeable_toggle_button.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/swipeable_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"swipeable_toggle_button.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/swipeable_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAS7E,OAAO,EAAQ,UAAU,EAAiB,MAAM,YAAY,CAAA;AAE5D,UAAU,0BAA2B,SAAQ,cAAc;IACzD,eAAe,EAAE,MAAM,CAAA;IACvB,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE;QACb,IAAI,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;QAC7C,KAAK,EAAE;YAAE,QAAQ,EAAE,UAAU,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAA;KAC/C,CAAA;IACD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,eAAe,EACf,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,OAAO,EACP,OAAe,EACf,GAAG,KAAK,EACT,EAAE,0BAA0B,qBAyC5B"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import { Pressable } from 'react-native-gesture-handler';
|
|
4
|
-
import { Icon, Spinner, Text } from '../display';
|
|
5
4
|
import { useCreateAndroidRippleColor, useTheme } from '../../hooks';
|
|
5
|
+
import { Haptic } from '../../utils/native_adapters/configuration';
|
|
6
6
|
import { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightMedium, platformPressedOpacityStyle, } from '../../utils/styles';
|
|
7
7
|
import { tokens } from '../../vendor/tapestry/tokens';
|
|
8
|
-
import {
|
|
8
|
+
import { Icon, Spinner, Text } from '../display';
|
|
9
9
|
export function SwipeableToggleButton({ backgroundColor, onPress, toggleContent, disabled = false, toggled, loading = false, ...props }) {
|
|
10
10
|
const styles = useStyles({ backgroundColor, disabled });
|
|
11
11
|
const androidRippleColor = useCreateAndroidRippleColor({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swipeable_toggle_button.js","sourceRoot":"","sources":["../../../src/components/conversations/swipeable_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"swipeable_toggle_button.js","sourceRoot":"","sources":["../../../src/components/conversations/swipeable_toggle_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAuB,MAAM,8BAA8B,CAAA;AAC7E,OAAO,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EACL,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,IAAI,EAAc,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAY5D,MAAM,UAAU,qBAAqB,CAAC,EACpC,eAAe,EACf,OAAO,EACP,aAAa,EACb,QAAQ,GAAG,KAAK,EAChB,OAAO,EACP,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EACmB;IAC3B,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAE,CAAC,CAAA;IACvD,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;QACrD,KAAK,EAAE,eAAe;KACvB,CAAC,CAAA;IA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MAAM,SAAS,GAAG,CAAC,EAAE,eAAe,EAAE,QAAQ,EAAuC,EAAE,EAAE;IACvF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,SAAS,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAA;IAC1F,MAAM,qBAAqB,GAAG,QAAQ;QACpC,CAAC,CAAC,MAAM,CAAC,mCAAmC;QAC5C,CAAC,CAAC,eAAe,CAAA;IAEnB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,IAAI,EAAE,CAAC;YACP,aAAa,EAAE,QAAQ;YACvB,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,CAAC;YACN,MAAM,EAAE,MAAM;YACd,eAAe,EAAE,qBAAqB;SACvC;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,CAAC;SACb;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,wBAAwB;YACpC,SAAS,EAAE,QAAQ;YACnB,iBAAiB,EAAE,CAAC;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { Pressable, type PressableProps } from 'react-native-gesture-handler'\nimport { useCreateAndroidRippleColor, useTheme } from '../../hooks'\nimport { Haptic } from '../../utils/native_adapters/configuration'\nimport {\n MAX_FONT_SIZE_MULTIPLIER,\n platformFontWeightMedium,\n platformPressedOpacityStyle,\n} from '../../utils/styles'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon, IconString, Spinner, Text } from '../display'\n\ninterface SwipeableToggleButtonProps extends PressableProps {\n backgroundColor: string\n toggled: boolean\n toggleContent: {\n true: { iconName: IconString; label: string }\n false: { iconName: IconString; label: string }\n }\n loading?: boolean\n}\n\nexport function SwipeableToggleButton({\n backgroundColor,\n onPress,\n toggleContent,\n disabled = false,\n toggled,\n loading = false,\n ...props\n}: SwipeableToggleButtonProps) {\n const styles = useStyles({ backgroundColor, disabled })\n const androidRippleColor = useCreateAndroidRippleColor({\n color: backgroundColor,\n })\n\n const { iconName, label } = toggleContent[toggled ? 'true' : 'false']\n\n return (\n <Pressable\n onPress={event => {\n Haptic.impactLight()\n onPress?.(event)\n }}\n style={({ pressed }) => [styles.button, pressed && platformPressedOpacityStyle]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n disabled={disabled || loading}\n accessibilityRole=\"togglebutton\"\n accessibilityState={{ checked: toggled }}\n {...props}\n >\n {loading ? (\n <Spinner size={20} />\n ) : (\n <>\n <Icon\n name={iconName}\n style={styles.icon}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n <Text\n variant=\"footnote\"\n style={styles.text}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n >\n {label}\n </Text>\n </>\n )}\n </Pressable>\n )\n}\n\nconst useStyles = ({ backgroundColor, disabled }: Partial<SwipeableToggleButtonProps>) => {\n const { colors } = useTheme()\n const fillColor = disabled ? colors.textColorDefaultDisabled : tokens.colorNeutral100White\n const buttonBackgroundColor = disabled\n ? colors.fillColorButtonNeutralSolidDisabled\n : backgroundColor\n\n return StyleSheet.create({\n button: {\n flex: 1,\n flexDirection: 'column',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n height: '100%',\n backgroundColor: buttonBackgroundColor,\n },\n icon: {\n fontSize: 20,\n color: fillColor,\n marginTop: 4,\n },\n text: {\n color: fillColor,\n fontWeight: platformFontWeightMedium,\n textAlign: 'center',\n paddingHorizontal: 8,\n },\n })\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import { Text } from '../display';
|
|
4
3
|
import { useFontScale, useTheme } from '../../hooks';
|
|
5
4
|
import { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../utils';
|
|
5
|
+
import { Text } from '../display';
|
|
6
6
|
export const UnreadCountBadge = ({ count, showDot }) => {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
const displayCount = count > 99 ? '99+' : count;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unread_count_badge.js","sourceRoot":"","sources":["../../../src/components/conversations/unread_count_badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"unread_count_badge.js","sourceRoot":"","sources":["../../../src/components/conversations/unread_count_badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAAuC,EAAE,EAAE;IAC1F,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,YAAY,GAAG,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;IAE/C,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,IAAI,CAAA;IAC5B,IAAI,OAAO;QAAE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAG,CAAA;IAE/C,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACxB;MAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAC3C;QAAA,CAAC,YAAY,CACf;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,aAAa,GAAG,wBAAwB,GAAG,GAAG,CAAA;IACpD,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,qBAAqB,EAAE,aAAa,EAAE,CAAC,CAAA;IACxE,MAAM,IAAI,GAAG,CAAC,GAAG,SAAS,CAAA;IAE1B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,KAAK,EAAE;YACL,SAAS,EAAE,UAAU;YACrB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,eAAe,EAAE,CAAC;YAClB,iBAAiB,EAAE,CAAC;YACpB,YAAY,EAAE,EAAE,GAAG,SAAS;SAC7B;QACD,KAAK,EAAE;YACL,UAAU,EAAE,sBAAsB;YAClC,KAAK,EAAE,OAAO;SACf;QACD,GAAG,EAAE;YACH,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,IAAI;YAClB,eAAe,EAAE,MAAM,CAAC,2BAA2B;SACpD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { useFontScale, useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../utils'\nimport { Text } from '../display'\n\nexport const UnreadCountBadge = ({ count, showDot }: { count: number; showDot: boolean }) => {\n const styles = useStyles()\n const displayCount = count > 99 ? '99+' : count\n\n if (count === 0) return null\n if (showDot) return <View style={styles.dot} />\n\n return (\n <View style={styles.badge}>\n <Text variant=\"footnote\" style={styles.count}>\n {displayCount}\n </Text>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const dotScaleLimit = MAX_FONT_SIZE_MULTIPLIER * 1.5\n const fontScale = useFontScale({ maxFontSizeMultiplier: dotScaleLimit })\n const size = 8 * fontScale\n\n return StyleSheet.create({\n badge: {\n alignSelf: 'flex-end',\n backgroundColor: colors.fillColorInteractionDefault,\n paddingVertical: 2,\n paddingHorizontal: 8,\n borderRadius: 24 * fontScale,\n },\n count: {\n fontWeight: platformFontWeightBold,\n color: 'white',\n },\n dot: {\n width: size,\n height: size,\n borderRadius: size,\n backgroundColor: colors.fillColorInteractionDefault,\n },\n })\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Animated, LayoutAnimation, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
3
|
-
import { Button } from './button';
|
|
4
2
|
import { useEffect } from 'react';
|
|
3
|
+
import { Animated, LayoutAnimation, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
5
4
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
5
|
import { useTheme } from '../../hooks';
|
|
7
|
-
import { Text } from './text';
|
|
8
6
|
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils';
|
|
7
|
+
import { Button } from './button';
|
|
8
|
+
import { Text } from './text';
|
|
9
9
|
export const ActionButton = ({ visible = true, disabled = false, onPress, title, infoText, buttonIconNameLeft, secondaryButton, loading = false, }) => {
|
|
10
10
|
const styles = useStyles();
|
|
11
11
|
const [show, setShow] = useState(visible);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action_button.js","sourceRoot":"","sources":["../../../src/components/display/action_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,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MAAM,CAAC;QACvB,SAAS,EAAE;YACT,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,iBAAiB,EAAE,EAAE;YACrB,UAAU,EAAE,wBAAwB;YACpC,aAAa,EAAE,MAAM,GAAG,wBAAwB;YAChD,cAAc,EAAE,CAAC;YACjB,cAAc,EAAE,MAAM,CAAC,qBAAqB;YAC5C,GAAG,EAAE,EAAE;SACR;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,eAAe;YAC1D,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,QAAQ,EAAE,cAAc;SACzB;QACD,eAAe,EAAE;YACf,QAAQ,EAAE,CAAC;SACZ;QACD,QAAQ,EAAE;YACR,SAAS,EAAE,QAAQ;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport { useEffect } from 'react'\nimport { Animated, LayoutAnimation, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'\nimport { Button } from './button'\nimport { IconString } from './icon'\nimport { Text } from './text'\n\nexport const ActionButton = ({\n visible = true,\n disabled = false,\n onPress,\n title,\n infoText,\n buttonIconNameLeft,\n secondaryButton,\n loading = false,\n}: {\n visible?: boolean\n disabled?: boolean\n onPress: () => void\n title: string\n infoText?: string\n buttonIconNameLeft?: IconString\n secondaryButton?: React.ReactNode\n loading?: boolean\n}) => {\n const styles = useStyles()\n const [show, setShow] = useState(visible)\n\n useEffect(() => {\n if (show === visible) return\n\n setShow(visible)\n LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut)\n }, [show, visible])\n\n if (!visible) return null\n\n return (\n <Animated.View style={styles.container}>\n {Boolean(infoText) && (\n <Text style={styles.infoText} variant=\"footnote\">\n {infoText}\n </Text>\n )}\n <View style={styles.buttonRow}>\n {secondaryButton}\n <Button\n variant=\"fill\"\n size=\"lg\"\n onPress={onPress}\n title={title}\n disabled={disabled}\n style={secondaryButton ? null : styles.fullWidthButton}\n iconNameLeft={buttonIconNameLeft}\n loading={loading}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityShowsLargeContentViewer\n accessibilityLargeContentTitle={title}\n />\n </View>\n </Animated.View>\n )\n}\n\nconst useStyles = () => {\n const { fontScale } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n const { colors } = useTheme()\n const containerVerticalPadding = 16\n\n return StyleSheet.create({\n container: {\n backgroundColor: colors.surfaceColor090,\n paddingHorizontal: 24,\n paddingTop: containerVerticalPadding,\n paddingBottom: bottom + containerVerticalPadding,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultDim,\n gap: 16,\n },\n buttonRow: {\n flexDirection: 'row',\n justifyContent: fontScale > 1 ? 'center' : 'space-between',\n alignItems: 'center',\n gap: 16,\n flexWrap: 'wrap-reverse',\n },\n fullWidthButton: {\n flexGrow: 1,\n },\n infoText: {\n textAlign: 'center',\n },\n })\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
|
-
import { type BannerStatusIconProps, type BannerRootProps } from '../primitive/banner_primitive';
|
|
3
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
+
import { type BannerStatusIconProps, type BannerRootProps } from '../primitive/banner_primitive';
|
|
4
4
|
type descriptionUnion = string | ReactElement | undefined;
|
|
5
5
|
export interface BannerProps {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/components/display/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkB,YAAY,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAwB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/components/display/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAkB,YAAY,EAAE,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAwB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAA;AAEtC,KAAK,gBAAgB,GAAG,MAAM,GAAG,YAAY,GAAG,SAAS,CAAA;AAEzD,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAA;IAC1C;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAA;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,qBAAqB,CAAC,UAAU,CAAC,CAAA;IAC5C;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,wBAAgB,MAAM,CAAC,EACrB,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAe,EACf,KAAK,GACN,EAAE,WAAW,4BAcb;AAED,wBAAgB,sBAAsB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,gBAAgB,CAAA;CAAE,4BASxF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../src/components/display/banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAgB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../src/components/display/banner.tsx"],"names":[],"m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ent":["import React, { isValidElement, ReactElement } from 'react'\nimport { ViewStyle } from 'react-native'\nimport BannerPrimitive, {\n type BannerStatusIconProps,\n type BannerRootProps,\n} from '../primitive/banner_primitive'\n\ntype descriptionUnion = string | ReactElement | undefined\n\nexport interface BannerProps {\n /**\n * Changes the status color for the background, text, and icon.\n * Sets a preset status icon.\n */\n appearance?: BannerRootProps['appearance']\n /**\n * Renders the banner's main text.\n * If some of the text is interactive it can also take `BannerPrimitive.Link` wrapped in `BannerPrimitive.Text`.\n */\n description?: descriptionUnion\n /**\n * Renders the banner's heading text.\n */\n heading?: string\n /**\n * Overrides the preset status icon.\n */\n iconName?: BannerStatusIconProps['iconName']\n /**\n * Hides the status icon. By default, the status icon is shown.\n */\n showIcon?: boolean\n /**\n * Adds a style to the banner.\n */\n style?: ViewStyle\n}\n\nexport function Banner({\n appearance,\n description,\n heading,\n iconName,\n showIcon = true,\n style,\n}: BannerProps) {\n if (!description && !heading) return null\n\n return (\n <BannerPrimitive.Root appearance={appearance}>\n <BannerPrimitive.StaticLayout style={style}>\n {showIcon && <BannerPrimitive.StatusIcon iconName={iconName} />}\n <BannerPrimitive.Content>\n {Boolean(heading) && <BannerPrimitive.Heading>{heading}</BannerPrimitive.Heading>}\n <ConditionalDescription description={description} />\n </BannerPrimitive.Content>\n </BannerPrimitive.StaticLayout>\n </BannerPrimitive.Root>\n )\n}\n\nexport function ConditionalDescription({ description }: { description: descriptionUnion }) {\n switch (true) {\n case description === undefined:\n return null\n case isValidElement(description):\n return description\n default:\n return <BannerPrimitive.Text>{description}</BannerPrimitive.Text>\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner_collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/display/banner_collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"banner_collapsible.d.ts","sourceRoot":"","sources":["../../../src/components/display/banner_collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,EAAE,WAAW,EAA0B,MAAM,UAAU,CAAA;AAM9D,UAAU,sBAAuB,SAAQ,WAAW;IAClD;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAe,EACf,KAAK,GACN,EAAE,sBAAsB,4BAyBxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ConditionalDescription } from './banner';
|
|
3
2
|
import BannerPrimitive from '../primitive/banner_primitive';
|
|
3
|
+
import { ConditionalDescription } from './banner';
|
|
4
4
|
export function BannerCollapsible({ appearance, children, description, heading, iconName, showIcon = true, style, }) {
|
|
5
5
|
const [expanded, setExpanded] = React.useState(false);
|
|
6
6
|
const toggleCollapsible = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner_collapsible.js","sourceRoot":"","sources":["../../../src/components/display/banner_collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"banner_collapsible.js","sourceRoot":"","sources":["../../../src/components/display/banner_collapsible.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAA;AACxC,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAe,sBAAsB,EAAE,MAAM,UAAU,CAAA;AAa9D,MAAM,UAAU,iBAAiB,CAAC,EAChC,UAAU,EACV,QAAQ,EACR,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,IAAI,EACf,KAAK,GACkB;IACvB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAErD,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC,CAAA;IAED,IAAI,CAAC,WAAW,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAEzC,OAAO,CACL,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAC3C;MAAA,CAAC,eAAe,CAAC,iBAAiB,CAChC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAC3B,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,CAEb;QAAA,CAAC,QAAQ,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAC/D;QAAA,CAAC,eAAe,CAAC,OAAO,CACtB;UAAA,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC,OAAO,CAAC,CACjF;UAAA,CAAC,sBAAsB,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,EACjD;UAAA,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAC7B;QAAA,EAAE,eAAe,CAAC,OAAO,CAC3B;MAAA,EAAE,eAAe,CAAC,iBAAiB,CACrC;IAAA,EAAE,eAAe,CAAC,IAAI,CAAC,CACxB,CAAA;AACH,CAAC","sourcesContent":["import React, { ReactNode } from 'react'\nimport BannerPrimitive from '../primitive/banner_primitive'\nimport { BannerProps, ConditionalDescription } from './banner'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface BannerCollapsibleProps extends BannerProps {\n /**\n * Hidden by default and shown when the banner is expanded.\n */\n children?: ReactNode\n}\n\nexport function BannerCollapsible({\n appearance,\n children,\n description,\n heading,\n iconName,\n showIcon = true,\n style,\n}: BannerCollapsibleProps) {\n const [expanded, setExpanded] = React.useState(false)\n\n const toggleCollapsible = () => {\n setExpanded(prev => !prev)\n }\n\n if (!description && !heading) return null\n\n return (\n <BannerPrimitive.Root appearance={appearance}>\n <BannerPrimitive.CollapsibleLayout\n onPress={toggleCollapsible}\n expanded={expanded}\n style={style}\n >\n {showIcon && <BannerPrimitive.StatusIcon iconName={iconName} />}\n <BannerPrimitive.Content>\n {Boolean(heading) && <BannerPrimitive.Heading>{heading}</BannerPrimitive.Heading>}\n <ConditionalDescription description={description} />\n {expanded ? children : null}\n </BannerPrimitive.Content>\n </BannerPrimitive.CollapsibleLayout>\n </BannerPrimitive.Root>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAK7D,OAAO,EAAQ,UAAU,EAAE,MAAM,QAAQ,CAAA;AAGzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAMlE,QAAA,MAAM,KAAK;;;;CAID,CAAA;AAEV,KAAK,SAAS,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAA;AAYnD,QAAA,MAAM,QAAQ;;;CAGJ,CAAA;AAEV,KAAK,YAAY,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAA;AAa5D,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,qBAAqB,CAAA;IAClC;;OAEG;IACH,kBAAkB,CAAC,EAAE,SAAS,CAAA;IAC9B;;OAEG;IACH,oBAAoB,CAAC,EAAE,SAAS,CAAA;IAChC;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,CAAA;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,UAAU,CAAA;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB;AAED,wBAAgB,MAAM,CAAC,EACrB,oBAA4B,EAC5B,gBAAuB,EACvB,UAA0B,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,QAAgB,EAChB,YAAY,EACZ,aAAa,EACb,OAAO,EACP,qBAAqB,EACrB,gBAAgB,EAChB,IAAW,EACX,KAAK,EACL,OAAgB,EAChB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,WAAW,qBAkEb"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
3
|
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
-
import { Icon } from './icon';
|
|
5
4
|
import { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks';
|
|
6
|
-
import { tokens } from '../../vendor/tapestry/tokens';
|
|
7
5
|
import { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils';
|
|
6
|
+
import { tokens } from '../../vendor/tapestry/tokens';
|
|
7
|
+
import { Icon } from './icon';
|
|
8
8
|
import { Spinner } from './spinner';
|
|
9
9
|
import { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors';
|
|
10
10
|
// =================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,IAAI,EAAc,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAGjG,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,KAAK,GAAG;IACZ,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACA,CAAA;AAcV,MAAM,QAAQ,GAAG;IACf,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;CACV,CAAA;AAsEV,MAAM,UAAU,MAAM,CAAC,EACrB,oBAAoB,GAAG,KAAK,EAC5B,gBAAgB,GAAG,IAAI,EACvB,UAAU,GAAG,aAAa,EAC1B,oBAAoB,EACpB,kBAAkB,EAClB,QAAQ,GAAG,KAAK,EAChB,YAAY,EACZ,aAAa,EACb,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YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,YAAY,GAAG,mBAAmB;YACnE,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM;YACjC,eAAe,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe;YACzD,iBAAiB,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,iBAAiB;SACxD;QACD,IAAI,EAAE;YACJ,SAAS,EAAE,QAAQ;YACnB,iBAAiB,EAAE,QAAQ;YAC3B,kBAAkB,EAAE,KAAK;YACzB,UAAU,EAAE,sBAAsB;YAClC,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;YACrC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK;SACtC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;YACrC,KAAK,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC,KAAK;SACtC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,UAAU;YACpB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,CAAC;SACV;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, Text, View } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport LinearGradient from 'react-native-linear-gradient'\nimport { Icon, IconString } from './icon'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils'\nimport { Spinner } from './spinner'\nimport { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n paddingHorizontal: number\n height: number\n borderRadius: number\n gap: number\n }\n>\n\nconst VARIANTS = {\n fill: 'fill',\n outline: 'outline',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantColors = Record<\n VariantUnion,\n {\n backgroundColor: string\n color: string\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Styles the outer LinearGradient that gives the button its background and outline color\n */\n colorWrapperStyles?: ViewStyle\n /**\n * Styles the inner View that wraps the button's content\n */\n contentWrapperStyles?: ViewStyle\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: IconString\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: IconString\n /**\n * Disables the button and replaces its content with a spinner\n */\n loading?: boolean\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Renders as text within the button\n */\n title: string\n /**\n * Fill buttons are visually more propmonitent then outline buttons\n */\n variant?: VariantUnion\n}\n\nexport function Button({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n contentWrapperStyles,\n colorWrapperStyles,\n disabled = false,\n iconNameLeft,\n iconNameRight,\n loading,\n maxFontSizeMultiplier,\n minimumFontScale,\n size = 'md',\n title,\n variant = 'fill',\n style,\n ...props\n}: ButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size, variant })\n const gradientOptionsMap = useGradientColorMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const overrideStyles = StyleSheet.flatten(style)\n const textStyles = [styles.text, disabled && styles.textDisabled, loading && styles.iconLoading]\n const iconStyles = [styles.icon, disabled && styles.iconDisabled, loading && styles.textLoading]\n\n const androidRippleColor = useCreateAndroidRippleColor({ color: gradientOptionsMap[colorKey][0] })\n\n return (\n <Pressable\n style={({ pressed }) => ({\n ...styles.pressable,\n ...(pressed && platformPressedOpacityStyle),\n ...overrideStyles,\n })}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n {...props}\n >\n <LinearGradient\n start={{ x: 0.1, y: 0.1 }}\n end={{ x: 0.9, y: 0.9 }}\n colors={gradientOptionsMap[colorKey]}\n style={[styles.colorWrapper, colorWrapperStyles]}\n >\n {loading && (\n <Spinner\n size={styles.spinnerSize.fontSize}\n style={styles.spinner}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n )}\n <View style={[styles.innerWrapper, contentWrapperStyles]}>\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={textStyles}\n >\n {title}\n </Text>\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </View>\n </LinearGradient>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'interaction',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n variant = 'fill',\n}: Partial<ButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useButtonColorOptionMap()\n\n const outlineHeightOffset = size === 'sm' ? 2 : 4\n const outlineMarginOffset = size === 'sm' ? 1 : 2\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.sm]: {\n fontSize: 12,\n paddingHorizontal: 12 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 24 * fontScale - outlineHeightOffset,\n gap: 4 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 14,\n paddingHorizontal: 16 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 32 * fontScale - outlineHeightOffset,\n gap: 6 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 16,\n paddingHorizontal: 24 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 40 * fontScale - outlineHeightOffset,\n gap: 8 * fontScale,\n },\n }\n\n const variantOutlineColor =\n disabled || loading ? colors.fillColorNeutral090 : colors.fillColorNeutral100Inverted\n\n const variantStyleMap: VariantColors = {\n fill: {\n backgroundColor: 'transparent',\n color: tokens.colorNeutral100White,\n },\n outline: {\n backgroundColor: variantOutlineColor,\n color: colorOptionMap[appearance],\n },\n }\n\n return StyleSheet.create({\n pressable: {\n borderRadius: sizeStyleMap[size].borderRadius,\n overflow: 'hidden',\n },\n colorWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: sizeStyleMap[size].borderRadius,\n },\n innerWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n margin: outlineMarginOffset,\n gap: sizeStyleMap[size].gap,\n borderRadius: sizeStyleMap[size].borderRadius - outlineMarginOffset,\n height: sizeStyleMap[size].height,\n backgroundColor: variantStyleMap[variant].backgroundColor,\n paddingHorizontal: sizeStyleMap[size].paddingHorizontal,\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n textDisabled: {\n color: colors.textColorDefaultDisabled,\n },\n textLoading: {\n opacity: 0,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n iconLoading: {\n opacity: 0,\n },\n spinnerSize: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n spinner: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/display/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEhE,OAAO,cAAc,MAAM,8BAA8B,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,IAAI,EAAc,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OA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ACZ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,WAAW,EAAE;YACX,OAAO,EAAE,CAAC;SACX;QACD,WAAW,EAAE;YACX,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,UAAU;YACpB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,CAAC;SACV;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, Text, View } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport LinearGradient from 'react-native-linear-gradient'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks'\nimport { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon, IconString } from './icon'\nimport { Spinner } from './spinner'\nimport { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n paddingHorizontal: number\n height: number\n borderRadius: number\n gap: number\n }\n>\n\nconst VARIANTS = {\n fill: 'fill',\n outline: 'outline',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\ntype VariantColors = Record<\n VariantUnion,\n {\n backgroundColor: string\n color: string\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ButtonProps extends PressableProps {\n /**\n * Specifies whether fonts should be scaled down automatically to fit given style constraints.\n */\n adjustsFontSizeToFit?: boolean\n /**\n * Specifies whether fonts should scale to respect the device's text size accessibility settings. The default is true.\n */\n allowFontScaling?: boolean\n /**\n * Updates the button's colors\n */\n appearance?: ButtonAppearanceUnion\n /**\n * Styles the outer LinearGradient that gives the button its background and outline color\n */\n colorWrapperStyles?: ViewStyle\n /**\n * Styles the inner View that wraps the button's content\n */\n contentWrapperStyles?: ViewStyle\n /**\n * Generates an icon to the left of the button text\n */\n iconNameLeft?: IconString\n /**\n * Generates an icon to the right of the button text\n */\n iconNameRight?: IconString\n /**\n * Disables the button and replaces its content with a spinner\n */\n loading?: boolean\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0).\n */\n minimumFontScale?: number\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Renders as text within the button\n */\n title: string\n /**\n * Fill buttons are visually more propmonitent then outline buttons\n */\n variant?: VariantUnion\n}\n\nexport function Button({\n adjustsFontSizeToFit = false,\n allowFontScaling = true,\n appearance = 'interaction',\n contentWrapperStyles,\n colorWrapperStyles,\n disabled = false,\n iconNameLeft,\n iconNameRight,\n loading,\n maxFontSizeMultiplier,\n minimumFontScale,\n size = 'md',\n title,\n variant = 'fill',\n style,\n ...props\n}: ButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size, variant })\n const gradientOptionsMap = useGradientColorMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const overrideStyles = StyleSheet.flatten(style)\n const textStyles = [styles.text, disabled && styles.textDisabled, loading && styles.iconLoading]\n const iconStyles = [styles.icon, disabled && styles.iconDisabled, loading && styles.textLoading]\n\n const androidRippleColor = useCreateAndroidRippleColor({ color: gradientOptionsMap[colorKey][0] })\n\n return (\n <Pressable\n style={({ pressed }) => ({\n ...styles.pressable,\n ...(pressed && platformPressedOpacityStyle),\n ...overrideStyles,\n })}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n {...props}\n >\n <LinearGradient\n start={{ x: 0.1, y: 0.1 }}\n end={{ x: 0.9, y: 0.9 }}\n colors={gradientOptionsMap[colorKey]}\n style={[styles.colorWrapper, colorWrapperStyles]}\n >\n {loading && (\n <Spinner\n size={styles.spinnerSize.fontSize}\n style={styles.spinner}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n )}\n <View style={[styles.innerWrapper, contentWrapperStyles]}>\n {iconNameLeft && (\n <Icon\n name={iconNameLeft}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n <Text\n allowFontScaling={allowFontScaling}\n minimumFontScale={minimumFontScale}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n adjustsFontSizeToFit={adjustsFontSizeToFit}\n numberOfLines={1}\n style={textStyles}\n >\n {title}\n </Text>\n {iconNameRight && (\n <Icon\n name={iconNameRight}\n style={iconStyles}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </View>\n </LinearGradient>\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'interaction',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n variant = 'fill',\n}: Partial<ButtonProps>) => {\n const { colors, button } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useButtonColorOptionMap()\n\n const outlineHeightOffset = size === 'sm' ? 2 : 4\n const outlineMarginOffset = size === 'sm' ? 1 : 2\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.sm]: {\n fontSize: 12,\n paddingHorizontal: 12 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 24 * fontScale - outlineHeightOffset,\n gap: 4 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 14,\n paddingHorizontal: 16 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 32 * fontScale - outlineHeightOffset,\n gap: 6 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 16,\n paddingHorizontal: 24 * fontScale,\n borderRadius: button.borderRadius * fontScale,\n height: 40 * fontScale - outlineHeightOffset,\n gap: 8 * fontScale,\n },\n }\n\n const variantOutlineColor =\n disabled || loading ? colors.fillColorNeutral090 : colors.fillColorNeutral100Inverted\n\n const variantStyleMap: VariantColors = {\n fill: {\n backgroundColor: 'transparent',\n color: tokens.colorNeutral100White,\n },\n outline: {\n backgroundColor: variantOutlineColor,\n color: colorOptionMap[appearance],\n },\n }\n\n return StyleSheet.create({\n pressable: {\n borderRadius: sizeStyleMap[size].borderRadius,\n overflow: 'hidden',\n },\n colorWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: sizeStyleMap[size].borderRadius,\n },\n innerWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n margin: outlineMarginOffset,\n gap: sizeStyleMap[size].gap,\n borderRadius: sizeStyleMap[size].borderRadius - outlineMarginOffset,\n height: sizeStyleMap[size].height,\n backgroundColor: variantStyleMap[variant].backgroundColor,\n paddingHorizontal: sizeStyleMap[size].paddingHorizontal,\n },\n text: {\n textAlign: 'center',\n textAlignVertical: 'center',\n includeFontPadding: false,\n fontWeight: platformFontWeightBold,\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n textDisabled: {\n color: colors.textColorDefaultDisabled,\n },\n textLoading: {\n opacity: 0,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: variantStyleMap[variant].color,\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n iconLoading: {\n opacity: 0,\n },\n spinnerSize: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n spinner: {\n width: '100%',\n height: '100%',\n position: 'absolute',\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: 2,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child_notice.d.ts","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"child_notice.d.ts","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAW5C,UAAU,gBAAgB;IACxB,YAAY,EAAE,cAAc,EAAE,CAAA;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,wBAAgB,WAAW,CAAC,EAAE,YAAY,EAAE,WAAmB,EAAE,KAAK,EAAE,EAAE,gBAAgB,qBAqBzF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BannerCollapsible } from './banner_collapsible';
|
|
3
|
-
import BannerPrimitive from '../primitive/banner_primitive';
|
|
4
2
|
import { View, StyleSheet } from 'react-native';
|
|
5
|
-
import { Avatar } from './avatar';
|
|
6
3
|
import { platformFontWeightMedium, pluralize } from '../../utils';
|
|
4
|
+
import BannerPrimitive from '../primitive/banner_primitive';
|
|
5
|
+
import { Avatar } from './avatar';
|
|
6
|
+
import { BannerCollapsible } from './banner_collapsible';
|
|
7
7
|
import { Text } from './text';
|
|
8
8
|
export function ChildNotice({ childMembers, showMembers = false, style }) {
|
|
9
9
|
const styles = useStyles();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"child_notice.js","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"child_notice.js","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"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M,GAAG,SAAS,EAAE,CAAA;IAC1B,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACxB;MAAA,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,EAC1C;MAAA,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAC1C;QAAA,CAAC,KAAK,CAAC,IAAI,CACb;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,eAAe,EAAE;YACf,SAAS,EAAE,CAAC;YACZ,GAAG,EAAE,CAAC;SACP;QACD,KAAK,EAAE;YACL,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;SACP;QACD,IAAI,EAAE;YACJ,UAAU,EAAE,wBAAwB;SACrC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { View, StyleSheet, type ViewStyle } from 'react-native'\nimport { MemberResource } from '../../types'\nimport { platformFontWeightMedium, pluralize } from '../../utils'\nimport BannerPrimitive from '../primitive/banner_primitive'\nimport { Avatar } from './avatar'\nimport { BannerCollapsible } from './banner_collapsible'\nimport { Text } from './text'\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface ChildNoticeProps {\n childMembers: MemberResource[]\n showMembers?: boolean\n style?: ViewStyle\n}\n\nexport function ChildNotice({ childMembers, showMembers = false, style }: ChildNoticeProps) {\n const styles = useStyles()\n const heading = `${pluralize(childMembers.length, 'member')} under age 13`\n\n return (\n <BannerCollapsible\n appearance=\"warning\"\n iconName=\"general.shieldExclamation\"\n heading={heading}\n style={style}\n >\n <BannerPrimitive.Text>\n Under age members cannot chat. They won't see conversations or notifications.\n </BannerPrimitive.Text>\n {showMembers && (\n <View style={styles.childrenWrapper}>\n {childMembers?.map(child => <Child key={child.id} child={child} />)}\n </View>\n )}\n </BannerCollapsible>\n )\n}\n\nfunction Child({ child }: { child: MemberResource }) {\n const styles = useStyles()\n return (\n <View style={styles.child}>\n <Avatar sourceUri={child.avatar} size=\"sm\" />\n <Text variant=\"tertiary\" style={styles.name}>\n {child.name}\n </Text>\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n return StyleSheet.create({\n childrenWrapper: {\n marginTop: 8,\n gap: 8,\n },\n child: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n },\n name: {\n fontWeight: platformFontWeightMedium,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/display/heading.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["../../../src/components/display/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAIL,SAAS,IAAI,oBAAoB,EAClC,MAAM,cAAc,CAAA;AASrB,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;CACpC;AAED,wBAAgB,OAAO,CAAC,EAAE,KAAK,EAAE,OAAc,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,qBAkBlF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useTheme } from '../../hooks';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { Platform, StyleSheet, Text as ReactNativeText, } from 'react-native';
|
|
4
|
-
import {
|
|
3
|
+
import { useTheme } from '../../hooks';
|
|
5
4
|
import { platformFontWeightBold } from '../../utils/styles';
|
|
5
|
+
import { tokens } from '../../vendor/tapestry/tokens';
|
|
6
6
|
export function Heading({ style, variant = 'h1', children, ...props }) {
|
|
7
7
|
const styles = useStyles();
|
|
8
8
|
const variantStyleMap = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../src/components/display/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"heading.js","sourceRoot":"","sources":["../../../src/components/display/heading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,IAAI,IAAI,eAAe,GAExB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAcrD,MAAM,UAAU,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAgB;IACjF,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,eAAe,GAAG;QACtB,EAAE,EAAE,MAAM,CAAC,QAAQ;QACnB,EAAE,EAAE,MAAM,CAAC,QAAQ;QACnB,EAAE,EAAE,MAAM,CAAC,QAAQ;QACnB,EAAE,EAAE,MAAM,CAAC,QAAQ;KACpB,CAAA;IAED,OAAO,CACL,CAAC,eAAe,CACd,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,CACxD,iBAAiB,CAAC,QAAQ,CAC1B,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,eAAe,CAAC,CACnB,CAAA;AACH,CAAC;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAC1B,GAAG,EAAE,QAAQ;gBACb,OAAO,EAAE,QAAQ;aAClB,CAAC;SACH;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,wBAAwB;YACtC,QAAQ,EAAE,MAAM,CAAC,WAAW;SAC7B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,wBAAwB;YACtC,UAAU,EAAE,sBAAsB;YAClC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,wBAAwB;YACtC,UAAU,EAAE,sBAAsB;YAClC,QAAQ,EAAE,MAAM,CAAC,UAAU;SAC5B;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,MAAM,CAAC,yBAAyB;YACvC,UAAU,EAAE,sBAAsB;YAClC,QAAQ,EAAE,MAAM,CAAC,UAAU;YAC3B,aAAa,EAAE,WAAW;SAC3B;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport {\n Platform,\n StyleSheet,\n Text as ReactNativeText,\n TextProps as ReactNativeTextProps,\n} from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { platformFontWeightBold } from '../../utils/styles'\nimport { tokens } from '../../vendor/tapestry/tokens'\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface HeadingProps extends ReactNativeTextProps {\n /**\n * Changes the styles and size of the text.\n * Semantically all React Native headings have the same 'hierarchical' level.\n */\n variant?: 'h1' | 'h2' | 'h3' | 'h4'\n}\n\nexport function Heading({ style, variant = 'h1', children, ...props }: HeadingProps) {\n const styles = useStyles()\n const variantStyleMap = {\n h1: styles.heading1,\n h2: styles.heading2,\n h3: styles.heading3,\n h4: styles.heading4,\n }\n\n return (\n <ReactNativeText\n style={[styles.global, variantStyleMap[variant], style]}\n accessibilityRole=\"header\"\n {...props}\n >\n {children}\n </ReactNativeText>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = () => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n global: {\n fontFamily: Platform.select({\n ios: 'System',\n android: 'normal',\n }),\n },\n heading1: {\n color: colors.textColorDefaultHeadline,\n fontSize: tokens.fontSize2xl,\n },\n heading2: {\n color: colors.textColorDefaultHeadline,\n fontWeight: platformFontWeightBold,\n fontSize: tokens.fontSizeXl,\n },\n heading3: {\n color: colors.textColorDefaultHeadline,\n fontWeight: platformFontWeightBold,\n fontSize: tokens.fontSizeLg,\n },\n heading4: {\n color: colors.textColorDefaultSecondary,\n fontWeight: platformFontWeightBold,\n fontSize: tokens.fontSizeSm,\n textTransform: 'uppercase',\n },\n })\n}\n"]}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import type { XmlProps } from 'react-native-svg';
|
|
4
1
|
import * as accounts from '@planningcenter/icons/paths/accounts';
|
|
5
2
|
import * as api from '@planningcenter/icons/paths/api';
|
|
6
3
|
import * as brand from '@planningcenter/icons/paths/brand';
|
|
@@ -11,9 +8,12 @@ import * as general from '@planningcenter/icons/paths/general';
|
|
|
11
8
|
import * as groups from '@planningcenter/icons/paths/groups';
|
|
12
9
|
import * as logomark from '@planningcenter/icons/paths/logomark';
|
|
13
10
|
import * as people from '@planningcenter/icons/paths/people';
|
|
14
|
-
import * as services from '@planningcenter/icons/paths/services';
|
|
15
11
|
import * as publishing from '@planningcenter/icons/paths/publishing';
|
|
16
12
|
import * as registrations from '@planningcenter/icons/paths/registrations';
|
|
13
|
+
import * as services from '@planningcenter/icons/paths/services';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import type { ColorValue, StyleProp, ViewStyle } from 'react-native';
|
|
16
|
+
import type { XmlProps } from 'react-native-svg';
|
|
17
17
|
declare const ICONS: {
|
|
18
18
|
readonly accounts: typeof accounts;
|
|
19
19
|
readonly api: typeof api;
|