@planningcenter/chat-react-native 3.30.0-rc.4 → 3.30.0-rc.6
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 +1 -1
- 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.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 +3 -3
- 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 +1 -1
- 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 +2 -2
- 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 +3 -3
- package/build/components/conversation/attachments/video_attachment.js.map +1 -1
- package/build/components/conversation/empty_conversation_blank_state.js +1 -1
- package/build/components/conversation/empty_conversation_blank_state.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 +5 -5
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +1 -1
- package/build/components/conversation/message_attachments.d.ts.map +1 -1
- package/build/components/conversation/message_attachments.js +1 -1
- 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 +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 +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 +4 -4
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.js +1 -1
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- 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_connectors.d.ts.map +1 -1
- package/build/components/conversation/reply_connectors.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +2 -2
- 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_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +2 -2
- package/build/components/conversations/conversation_actions.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 +2 -2
- 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 +1 -1
- package/build/components/conversations/swipeable_toggle_button.d.ts.map +1 -1
- package/build/components/conversations/swipeable_toggle_button.js +1 -1
- 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.d.ts.map +1 -1
- package/build/components/display/action_button.js +2 -2
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/avatar.d.ts +1 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +1 -1
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +1 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +1 -1
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +3 -3
- package/build/components/display/badge.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 +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 +3 -3
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.d.ts.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/heading.js.map +1 -1
- 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 +2 -2
- package/build/components/display/icon_button.js.map +1 -1
- package/build/components/display/image.js +1 -1
- package/build/components/display/image.js.map +1 -1
- package/build/components/display/image_attachment_preview.js +2 -2
- package/build/components/display/image_attachment_preview.js.map +1 -1
- package/build/components/display/keyboard_view.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.js +1 -1
- package/build/components/display/platform_modal_header_buttons.js.map +1 -1
- package/build/components/display/pressable_row.d.ts.map +1 -1
- package/build/components/display/pressable_row.js +1 -1
- package/build/components/display/pressable_row.js.map +1 -1
- package/build/components/display/spinner.js.map +1 -1
- package/build/components/display/switch.js.map +1 -1
- package/build/components/display/tabs.js.map +1 -1
- package/build/components/display/text.js.map +1 -1
- package/build/components/display/text_button.d.ts.map +1 -1
- package/build/components/display/text_button.js +2 -2
- package/build/components/display/text_button.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 +2 -2
- package/build/components/display/toggle_button.js.map +1 -1
- package/build/components/display/utils/button_colors.js.map +1 -1
- package/build/components/display/utils/status_colors.js.map +1 -1
- package/build/components/display/video_attachment_preview.js +3 -3
- 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/page/error_boundary.d.ts.map +1 -1
- package/build/components/page/error_boundary.js +1 -1
- package/build/components/page/error_boundary.js.map +1 -1
- package/build/components/page/loading.js +1 -1
- package/build/components/page/loading.js.map +1 -1
- package/build/components/primitive/avatar_primitive.d.ts +2 -2
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +3 -3
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/banner_primitive.d.ts +2 -2
- package/build/components/primitive/banner_primitive.d.ts.map +1 -1
- package/build/components/primitive/banner_primitive.js +5 -5
- package/build/components/primitive/banner_primitive.js.map +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts +1 -1
- package/build/components/primitive/blank_state_primitive.d.ts.map +1 -1
- package/build/components/primitive/blank_state_primitive.js +1 -1
- package/build/components/primitive/blank_state_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +2 -2
- 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.map +1 -1
- package/build/contexts/api_provider.js +1 -1
- package/build/contexts/api_provider.js.map +1 -1
- package/build/contexts/chat_context.d.ts.map +1 -1
- package/build/contexts/chat_context.js.map +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_group_members_for_new_conversation.d.ts +2 -2
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.js +2 -2
- package/build/hooks/groups/use_group_members_for_new_conversation.js.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.d.ts.map +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js +1 -1
- package/build/hooks/groups/use_groups_conversation_create.js.map +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.d.ts +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 +1 -1
- package/build/hooks/services/use_find_or_create_services_conversation.js.map +1 -1
- package/build/hooks/services/use_services_team.d.ts.map +1 -1
- package/build/hooks/services/use_services_team.js +1 -1
- package/build/hooks/services/use_services_team.js.map +1 -1
- package/build/hooks/services/use_team_members_for_new_conversation.d.ts.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 +1 -1
- package/build/hooks/services/use_team_plans.js.map +1 -1
- package/build/hooks/use_api.d.ts +1 -1
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_async_storage.js +1 -1
- package/build/hooks/use_async_storage.js.map +1 -1
- package/build/hooks/use_attachment_uploader.d.ts.map +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_chat_permissions.d.ts +1 -1
- package/build/hooks/use_chat_permissions.d.ts.map +1 -1
- package/build/hooks/use_chat_permissions.js.map +1 -1
- package/build/hooks/use_conversation.d.ts +1 -1
- package/build/hooks/use_conversation.d.ts.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_jolt_events.js +1 -1
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversation_membership.d.ts.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.d.ts.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 +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 +5 -5
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations.d.ts.map +1 -1
- package/build/hooks/use_conversations.js +1 -1
- package/build/hooks/use_conversations.js.map +1 -1
- package/build/hooks/use_conversations_actions.d.ts.map +1 -1
- package/build/hooks/use_conversations_actions.js +1 -1
- package/build/hooks/use_conversations_actions.js.map +1 -1
- package/build/hooks/use_conversations_cache.d.ts.map +1 -1
- package/build/hooks/use_conversations_cache.js +2 -2
- package/build/hooks/use_conversations_cache.js.map +1 -1
- package/build/hooks/use_conversations_jolt_events.js +2 -2
- package/build/hooks/use_conversations_jolt_events.js.map +1 -1
- package/build/hooks/use_current_person.d.ts.map +1 -1
- package/build/hooks/use_current_person.js.map +1 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -1
- package/build/hooks/use_features.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_groups.d.ts.map +1 -1
- package/build/hooks/use_groups.js.map +1 -1
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.js.map +1 -1
- package/build/hooks/use_jolt.js.map +1 -1
- package/build/hooks/use_live_relative_time.d.ts.map +1 -1
- package/build/hooks/use_live_relative_time.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.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 +2 -2
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/hooks/use_message_draft.d.ts.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 +1 -1
- package/build/hooks/use_message_reaction_toggle.js.map +1 -1
- package/build/hooks/use_my_gender.js.map +1 -1
- package/build/hooks/use_organization.d.ts +2 -2
- package/build/hooks/use_organization.d.ts.map +1 -1
- package/build/hooks/use_organization.js.map +1 -1
- package/build/hooks/use_people_person.d.ts.map +1 -1
- package/build/hooks/use_people_person.js.map +1 -1
- package/build/hooks/use_product_analytics.d.ts.map +1 -1
- package/build/hooks/use_product_analytics.js.map +1 -1
- package/build/hooks/use_qualified_by_age.js +1 -1
- package/build/hooks/use_qualified_by_age.js.map +1 -1
- package/build/hooks/use_read_receipts.d.ts +1 -1
- package/build/hooks/use_read_receipts.d.ts.map +1 -1
- package/build/hooks/use_read_receipts.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_storage.d.ts.map +1 -1
- package/build/hooks/use_storage.js.map +1 -1
- package/build/hooks/use_submit_age_check.d.ts.map +1 -1
- package/build/hooks/use_submit_age_check.js +1 -1
- package/build/hooks/use_submit_age_check.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +3 -3
- 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_teams.d.ts.map +1 -1
- package/build/hooks/use_teams.js.map +1 -1
- package/build/hooks/use_theme.d.ts.map +1 -1
- package/build/hooks/use_theme.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/hooks/use_typing_status_cache.d.ts.map +1 -1
- package/build/hooks/use_typing_status_cache.js.map +1 -1
- package/build/hooks/use_upload_client.d.ts.map +1 -1
- package/build/hooks/use_upload_client.js.map +1 -1
- package/build/icons/font_awesome.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/navigation/chat_access_gate.js.map +1 -1
- package/build/navigation/index.d.ts +6 -1
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +7 -2
- 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/polyfills/events/internals/EventInternals.d.ts +2 -2
- package/build/polyfills/events/internals/EventInternals.d.ts.map +1 -1
- package/build/polyfills/events/internals/EventInternals.js.map +1 -1
- package/build/polyfills/events/internals/EventTargetInternals.d.ts +2 -2
- package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +1 -1
- package/build/polyfills/events/internals/EventTargetInternals.js.map +1 -1
- package/build/screens/age_check/age_check_required_screen.js +1 -1
- package/build/screens/age_check/age_check_required_screen.js.map +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.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/attachment_actions/hooks/useDeleteAttachment.js.map +1 -1
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation/message_read_receipts_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/components/checkbox_row.d.ts +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.map +1 -1
- package/build/screens/conversation_filter_recipients/components/header_row.d.ts +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.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 +5 -5
- package/build/screens/conversation_filter_recipients/conversation_filter_recipients_screen.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.js.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.d.ts.map +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js +1 -1
- package/build/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.js.map +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/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +4 -4
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +3 -3
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +2 -2
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts +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.map +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.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.js.map +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.js.map +1 -1
- package/build/screens/conversation_filters/team_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/team_filters.js +1 -1
- package/build/screens/conversation_filters/team_filters.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts.map +1 -1
- package/build/screens/conversation_filters_screen.js +1 -1
- package/build/screens/conversation_filters_screen.js.map +1 -1
- 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.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +2 -2
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts +1 -1
- package/build/screens/conversation_new/components/services_form.d.ts.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +2 -2
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_new/components/source_app_error_card.js.map +1 -1
- package/build/screens/conversation_new/conversation_new_screen.d.ts +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.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/recipient_link_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/team_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/view_more_link_row.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.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 +2 -2
- 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 +3 -3
- package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_select_recipients/types/screen_props.js.map +1 -1
- package/build/screens/conversation_select_type_screen.d.ts.map +1 -1
- package/build/screens/conversation_select_type_screen.js.map +1 -1
- package/build/screens/conversations/components/chat_group_badge.js.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_action_button.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +5 -5
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_more_actions_screen.d.ts +3 -0
- package/build/screens/conversations/conversations_more_actions_screen.d.ts.map +1 -0
- package/build/screens/conversations/conversations_more_actions_screen.js +35 -0
- package/build/screens/conversations/conversations_more_actions_screen.js.map +1 -0
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +1 -1
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/group_notification_level_select_screen.js +1 -1
- package/build/screens/group_notification_level_select_screen.js.map +1 -1
- package/build/screens/group_notification_settings_screen.js +1 -1
- package/build/screens/group_notification_settings_screen.js.map +1 -1
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/message_report/components/message_preview.d.ts.map +1 -1
- package/build/screens/message_report/components/message_preview.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 +1 -1
- package/build/screens/message_report/components/report_reason_list.js.map +1 -1
- package/build/screens/message_report_screen.js +2 -2
- package/build/screens/message_report_screen.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +2 -2
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/screens/notification_settings/hooks/groups.js.map +1 -1
- package/build/screens/notification_settings_screen.js +2 -2
- package/build/screens/notification_settings_screen.js.map +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.d.ts.map +1 -1
- package/build/screens/preferred_app/hooks/use_chat_types.js.map +1 -1
- package/build/screens/preferred_app_selection_screen.d.ts.map +1 -1
- package/build/screens/preferred_app_selection_screen.js +4 -4
- package/build/screens/preferred_app_selection_screen.js.map +1 -1
- package/build/screens/reactions_screen.js.map +1 -1
- package/build/screens/send_giphy_screen.js.map +1 -1
- package/build/screens/team_conversation_screen.js.map +1 -1
- package/build/types/jolt_events/message_events.d.ts +1 -1
- package/build/types/jolt_events/message_events.d.ts.map +1 -1
- package/build/types/jolt_events/message_events.js.map +1 -1
- package/build/types/jolt_events/reaction_events.d.ts +1 -1
- package/build/types/jolt_events/reaction_events.d.ts.map +1 -1
- package/build/types/jolt_events/reaction_events.js.map +1 -1
- package/build/types/resources/app_grant.d.ts +1 -1
- package/build/types/resources/app_grant.d.ts.map +1 -1
- package/build/types/resources/app_grant.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +1 -1
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/types/resources/group_membership.d.ts +1 -1
- package/build/types/resources/group_membership.d.ts.map +1 -1
- package/build/types/resources/group_membership.js.map +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts +1 -1
- package/build/types/resources/groups/groups_group_resource.d.ts.map +1 -1
- package/build/types/resources/groups/groups_group_resource.js.map +1 -1
- package/build/types/resources/organization.d.ts +1 -1
- package/build/types/resources/organization.d.ts.map +1 -1
- package/build/types/resources/organization.js.map +1 -1
- package/build/types/resources/person.d.ts +1 -1
- package/build/types/resources/person.d.ts.map +1 -1
- package/build/types/resources/person.js.map +1 -1
- package/build/types/resources/services/chat_resource.d.ts +1 -1
- package/build/types/resources/services/chat_resource.d.ts.map +1 -1
- package/build/types/resources/services/chat_resource.js.map +1 -1
- package/build/types/resources/services/team_resource.d.ts +1 -1
- package/build/types/resources/services/team_resource.d.ts.map +1 -1
- package/build/types/resources/services/team_resource.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 +3 -3
- 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/cache/page_mutations.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.js.map +1 -1
- package/build/utils/client/client.d.ts +1 -1
- package/build/utils/client/client.d.ts.map +1 -1
- package/build/utils/client/client.js.map +1 -1
- package/build/utils/convert_attachments_for_create.d.ts.map +1 -1
- package/build/utils/convert_attachments_for_create.js.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.d.ts.map +1 -1
- package/build/utils/destructure_chat_group_graph_id.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.js.map +1 -1
- package/build/utils/performance_tracking.d.ts.map +1 -1
- package/build/utils/performance_tracking.js.map +1 -1
- package/build/utils/reaction_constants.d.ts.map +1 -1
- package/build/utils/reaction_constants.js.map +1 -1
- package/build/utils/request/conversation.d.ts +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js.map +1 -1
- package/build/utils/request/get_features.d.ts.map +1 -1
- package/build/utils/request/get_features.js.map +1 -1
- package/build/utils/request/get_message.d.ts.map +1 -1
- package/build/utils/request/get_message.js +1 -1
- package/build/utils/request/get_message.js.map +1 -1
- package/build/utils/request/get_messages.d.ts.map +1 -1
- package/build/utils/request/get_messages.js +1 -1
- package/build/utils/request/get_messages.js.map +1 -1
- package/build/utils/response_error.d.ts.map +1 -1
- package/build/utils/response_error.js.map +1 -1
- package/build/utils/session.d.ts.map +1 -1
- package/build/utils/session.js.map +1 -1
- package/build/utils/session_manager.d.ts +1 -1
- package/build/utils/session_manager.d.ts.map +1 -1
- package/build/utils/session_manager.js.map +1 -1
- package/build/utils/styles.js.map +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js.map +1 -1
- package/build/utils/upload_uri.d.ts +1 -1
- package/package.json +3 -5
- package/src/__tests__/contexts/session_context.tsx +5 -5
- package/src/__tests__/event-polyfill.test.ts +3 -3
- package/src/__tests__/hooks/useTheme.tsx +2 -2
- package/src/__tests__/hooks/use_async_storage.test.tsx +1 -1
- package/src/__tests__/hooks/use_conversation_messages.ts +2 -2
- package/src/__tests__/hooks/use_font_scale.test.ts +1 -1
- package/src/__tests__/utils/cache/page_mutations.ts +1 -1
- package/src/__tests__/utils/client.ts +5 -5
- package/src/__tests__/utils/native_adapters/configuration.ts +4 -4
- package/src/__tests__/utils/parse_simple_markdown.ts +1 -1
- package/src/__tests__/utils/pluralize.tsx +1 -1
- package/src/__tests__/utils/session.ts +2 -2
- package/src/__tests__/utils/uri.ts +1 -1
- package/src/__utils__/handlers.ts +1 -1
- package/src/components/conversation/attachments/attachment_card.tsx +3 -3
- package/src/components/conversation/attachments/attachment_deleting_overlay.tsx +2 -2
- package/src/components/conversation/attachments/audio_attachment.tsx +4 -4
- package/src/components/conversation/attachments/expanded_link.tsx +4 -4
- package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -5
- package/src/components/conversation/attachments/giphy_attachment.tsx +5 -5
- package/src/components/conversation/attachments/image_attachment.tsx +6 -6
- package/src/components/conversation/attachments/video_attachment.tsx +5 -5
- package/src/components/conversation/empty_conversation_blank_state.tsx +1 -1
- package/src/components/conversation/jump_to_bottom_button.tsx +3 -3
- package/src/components/conversation/message.tsx +19 -19
- package/src/components/conversation/message_attachments.tsx +5 -5
- package/src/components/conversation/message_form/message_form_attachment_image.tsx +2 -2
- package/src/components/conversation/message_form/message_form_attachment_video.tsx +2 -2
- package/src/components/conversation/message_form.tsx +17 -17
- package/src/components/conversation/message_markdown.tsx +3 -3
- package/src/components/conversation/message_reaction.tsx +8 -8
- package/src/components/conversation/message_read_receipts.tsx +3 -3
- package/src/components/conversation/messages_disabled_banners.tsx +2 -2
- package/src/components/conversation/reply_connectors.tsx +3 -3
- package/src/components/conversation/reply_shadow_message.tsx +9 -9
- package/src/components/conversation/typing_indicator.tsx +3 -3
- package/src/components/conversations/conversation_actions.tsx +9 -6
- package/src/components/conversations/conversation_preview.tsx +9 -4
- package/src/components/conversations/conversations.tsx +6 -6
- package/src/components/conversations/mute_indicator.tsx +3 -3
- package/src/components/conversations/swipeable_toggle_button.tsx +5 -5
- package/src/components/conversations/unread_count_badge.tsx +3 -3
- package/src/components/display/action_button.tsx +2 -2
- package/src/components/display/avatar.tsx +2 -2
- package/src/components/display/avatar_group.tsx +2 -2
- package/src/components/display/badge.tsx +3 -3
- package/src/components/display/banner.tsx +1 -1
- package/src/components/display/banner_collapsible.tsx +1 -1
- package/src/components/display/button.tsx +3 -3
- package/src/components/display/child_notice.tsx +3 -3
- package/src/components/display/heading.tsx +3 -3
- package/src/components/display/icon.tsx +1 -1
- package/src/components/display/icon_button.tsx +2 -2
- package/src/components/display/image.tsx +1 -1
- package/src/components/display/image_attachment_preview.tsx +2 -2
- package/src/components/display/keyboard_view.tsx +1 -1
- package/src/components/display/person.tsx +2 -2
- package/src/components/display/platform_modal_header_buttons.tsx +1 -1
- package/src/components/display/pressable_row.tsx +1 -1
- package/src/components/display/spinner.tsx +1 -1
- package/src/components/display/switch.tsx +1 -1
- package/src/components/display/tabs.tsx +1 -1
- package/src/components/display/text.tsx +2 -2
- package/src/components/display/text_button.tsx +2 -2
- package/src/components/display/text_inline_button.tsx +2 -2
- package/src/components/display/toggle_button.tsx +6 -6
- package/src/components/display/utils/button_colors.ts +1 -1
- package/src/components/display/utils/status_colors.ts +1 -1
- package/src/components/display/video_attachment_preview.tsx +3 -3
- package/src/components/group_conversation_list.tsx +5 -5
- package/src/components/page/error_boundary.tsx +2 -2
- package/src/components/page/loading.tsx +1 -1
- package/src/components/primitive/avatar_primitive.tsx +5 -5
- package/src/components/primitive/banner_primitive.tsx +11 -11
- package/src/components/primitive/blank_state_primitive.tsx +2 -2
- package/src/components/primitive/form_sheet.tsx +4 -4
- package/src/components/safe_area_modal.tsx +1 -1
- package/src/contexts/api_provider.tsx +4 -4
- package/src/contexts/chat_context.tsx +6 -6
- package/src/contexts/conversations_context.tsx +3 -3
- package/src/contexts/session_context.tsx +9 -9
- package/src/hooks/groups/use_group_members_for_new_conversation.ts +4 -4
- package/src/hooks/groups/use_groups_conversation_create.ts +3 -3
- package/src/hooks/services/use_find_or_create_services_conversation.ts +3 -3
- package/src/hooks/services/use_services_team.ts +2 -2
- package/src/hooks/services/use_team_members_for_new_conversation.ts +2 -2
- package/src/hooks/services/use_team_plans.ts +2 -2
- package/src/hooks/use_api.ts +2 -2
- package/src/hooks/use_api_client.ts +3 -3
- package/src/hooks/use_async_storage.ts +1 -1
- package/src/hooks/use_attachment_uploader.ts +5 -5
- package/src/hooks/use_broadcast_typing_status.ts +1 -1
- package/src/hooks/use_chat_permissions.ts +1 -1
- package/src/hooks/use_conversation.ts +4 -4
- package/src/hooks/use_conversation_jolt_events.ts +3 -3
- package/src/hooks/use_conversation_membership.ts +3 -3
- package/src/hooks/use_conversation_message.ts +2 -2
- package/src/hooks/use_conversation_messages.ts +2 -2
- package/src/hooks/use_conversation_messages_jolt_events.ts +14 -14
- package/src/hooks/use_conversations.ts +2 -2
- package/src/hooks/use_conversations_actions.ts +2 -2
- package/src/hooks/use_conversations_cache.ts +5 -5
- package/src/hooks/use_conversations_jolt_events.ts +4 -4
- package/src/hooks/use_current_person.ts +2 -2
- package/src/hooks/use_features.ts +3 -3
- package/src/hooks/use_giphy.ts +2 -2
- package/src/hooks/use_groups.ts +2 -2
- package/src/hooks/use_groups_groups.ts +1 -1
- package/src/hooks/use_jolt.ts +3 -3
- package/src/hooks/use_live_relative_time.ts +2 -2
- package/src/hooks/use_mark_latest_message_read.ts +1 -1
- package/src/hooks/use_message_create_or_update.ts +11 -11
- package/src/hooks/use_message_draft.ts +2 -2
- package/src/hooks/use_message_reaction_toggle.ts +4 -4
- package/src/hooks/use_my_gender.ts +1 -1
- package/src/hooks/use_organization.ts +1 -1
- package/src/hooks/use_people_person.ts +1 -1
- package/src/hooks/use_product_analytics.ts +5 -5
- package/src/hooks/use_qualified_by_age.ts +1 -1
- package/src/hooks/use_read_receipts.ts +1 -1
- package/src/hooks/use_report_message.ts +2 -2
- package/src/hooks/use_storage.ts +1 -1
- package/src/hooks/use_submit_age_check.ts +2 -2
- package/src/hooks/use_suspense_api.ts +5 -5
- package/src/hooks/use_teams.ts +1 -1
- package/src/hooks/use_theme.tsx +2 -2
- package/src/hooks/use_typing_indicators.ts +1 -1
- package/src/hooks/use_typing_status_cache.ts +1 -1
- package/src/hooks/use_upload_client.ts +3 -3
- package/src/icons/font_awesome.ts +1 -1
- package/src/navigation/chat_access_gate.tsx +7 -7
- package/src/navigation/index.tsx +42 -31
- package/src/navigation/screenLayout.tsx +2 -2
- package/src/polyfills/events/Event.ts +1 -1
- package/src/polyfills/events/EventTarget.ts +1 -1
- package/src/polyfills/events/internals/EventInternals.ts +2 -2
- package/src/polyfills/events/internals/EventTargetInternals.ts +2 -2
- package/src/screens/age_check/age_check_required_screen.tsx +8 -8
- package/src/screens/age_check/age_check_underage_screen.tsx +3 -3
- package/src/screens/age_check/components/age_check_select_birthdate_modal.tsx +3 -3
- package/src/screens/attachment_actions/attachment_actions_screen.tsx +1 -1
- package/src/screens/attachment_actions/hooks/useDeleteAttachment.tsx +3 -3
- package/src/screens/bug_report_screen.tsx +11 -11
- package/src/screens/conversation/message_read_receipts_screen.tsx +5 -5
- package/src/screens/conversation_details_screen.tsx +10 -10
- package/src/screens/conversation_filter_recipients/components/checkbox_row.tsx +4 -8
- package/src/screens/conversation_filter_recipients/components/header_row.tsx +5 -5
- package/src/screens/conversation_filter_recipients/conversation_filter_recipients_screen.tsx +6 -6
- package/src/screens/conversation_filter_recipients/hooks/use_flattened_array_of_service_types_with_teams.tsx +1 -5
- package/src/screens/conversation_filter_recipients/hooks/use_service_types_with_teams.ts +3 -6
- package/src/screens/conversation_filter_recipients/types.tsx +1 -1
- package/src/screens/conversation_filters/components/conversation_filters.tsx +5 -8
- package/src/screens/conversation_filters/components/rows.tsx +14 -9
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +1 -4
- package/src/screens/conversation_filters/group_filters.tsx +1 -1
- package/src/screens/conversation_filters/hooks/filters.ts +5 -5
- package/src/screens/conversation_filters/screen_props.ts +1 -1
- package/src/screens/conversation_filters/team_filters.tsx +1 -1
- package/src/screens/conversation_filters_screen.tsx +1 -1
- package/src/screens/conversation_new/components/filter_by_plan.tsx +7 -7
- package/src/screens/conversation_new/components/form_list.tsx +3 -3
- package/src/screens/conversation_new/components/gender_filter_toggle.tsx +3 -3
- package/src/screens/conversation_new/components/groups_form.tsx +14 -14
- package/src/screens/conversation_new/components/services_form.tsx +10 -10
- package/src/screens/conversation_new/components/source_app_error_card.tsx +1 -1
- package/src/screens/conversation_new/conversation_new_screen.tsx +3 -3
- package/src/screens/conversation_notification_level_select_screen.tsx +6 -6
- package/src/screens/conversation_screen.tsx +23 -23
- package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +2 -2
- package/src/screens/conversation_select_recipients/components/recipient_link_row.tsx +3 -3
- package/src/screens/conversation_select_recipients/components/restricted_group_row.tsx +4 -4
- package/src/screens/conversation_select_recipients/components/team_recipient_row.tsx +2 -2
- package/src/screens/conversation_select_recipients/components/view_more_link_row.tsx +1 -1
- package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +4 -4
- 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 +4 -7
- package/src/screens/conversation_select_recipients/types/screen_props.tsx +2 -2
- package/src/screens/conversation_select_type_screen.tsx +4 -4
- package/src/screens/conversations/components/chat_group_badge.tsx +4 -4
- package/src/screens/conversations/components/list_header_action_button.tsx +4 -4
- package/src/screens/conversations/components/list_header_component.tsx +15 -15
- package/src/screens/conversations/conversations_more_actions_screen.tsx +51 -0
- package/src/screens/conversations/conversations_screen.tsx +5 -5
- package/src/screens/design_system_screen.tsx +6 -6
- package/src/screens/get_help_screen.tsx +5 -5
- package/src/screens/group_notification_level_select_screen.tsx +3 -3
- package/src/screens/group_notification_settings_screen.tsx +3 -3
- package/src/screens/message_actions_screen.tsx +12 -12
- package/src/screens/message_report/components/message_preview.tsx +3 -3
- package/src/screens/message_report/components/report_reason_list.tsx +7 -4
- package/src/screens/message_report_screen.tsx +11 -11
- package/src/screens/notification_settings/hooks/groups.ts +6 -6
- package/src/screens/notification_settings_screen.tsx +4 -4
- package/src/screens/preferred_app/hooks/use_chat_types.ts +2 -2
- package/src/screens/preferred_app_selection_screen.tsx +7 -7
- package/src/screens/reactions_screen.tsx +9 -9
- package/src/screens/send_giphy_screen.tsx +8 -8
- package/src/screens/team_conversation_screen.tsx +3 -3
- package/src/types/jolt_events/message_events.ts +1 -1
- package/src/types/jolt_events/reaction_events.ts +1 -1
- package/src/types/resources/app_grant.ts +1 -1
- package/src/types/resources/conversation_membership.ts +1 -1
- package/src/types/resources/group_membership.ts +1 -1
- package/src/types/resources/groups/groups_group_resource.ts +1 -1
- package/src/types/resources/organization.ts +1 -1
- package/src/types/resources/person.ts +1 -1
- package/src/types/resources/services/chat_resource.ts +1 -1
- package/src/types/resources/services/team_resource.ts +1 -1
- package/src/utils/__tests__/convert_attachments_for_create.test.ts +3 -3
- package/src/utils/__tests__/session_manager.test.ts +3 -3
- package/src/utils/__tests__/sha_256.test.ts +1 -1
- package/src/utils/cache/messages_cache.ts +5 -5
- package/src/utils/cache/optimistically_create_message.ts +7 -7
- package/src/utils/cache/optimistically_update_message.ts +3 -3
- package/src/utils/cache/page_mutations.ts +1 -1
- package/src/utils/client/client.ts +1 -1
- package/src/utils/convert_attachments_for_create.ts +2 -2
- package/src/utils/destructure_chat_group_graph_id.ts +2 -2
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +4 -4
- package/src/utils/jolt/transform_reaction_event_data_to_reaction_count_resource.ts +3 -3
- package/src/utils/performance_tracking.ts +1 -1
- package/src/utils/reaction_constants.ts +1 -1
- package/src/utils/request/conversation.ts +2 -2
- package/src/utils/request/get_features.ts +1 -1
- package/src/utils/request/get_message.ts +1 -1
- package/src/utils/request/get_messages.ts +1 -1
- package/src/utils/response_error.ts +1 -1
- package/src/utils/session.ts +1 -1
- package/src/utils/session_manager.ts +1 -1
- package/src/utils/styles.ts +1 -1
- package/src/utils/theme.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/display/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAc,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CAAC,SAAS,CAAC,SAAS,EACzB;UAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EACtC;QAAA,EAAE,cAAc,CAClB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC","sourcesContent":["import React, { JSX } from 'react'\nimport type { TextStyle, ViewProps, ViewStyle } from 'react-native'\nimport { Pressable, StyleSheet, View } from 'react-native'\nimport Svg, { Defs, LinearGradient, Path, Stop } from 'react-native-svg'\nimport { Icon, IconString } from './icon'\nimport { Text } from './text'\nimport { useStatusColorAppearanceMap, type StatusAppearanceUnion } from './utils/status_colors'\nimport { useFontScale, useTheme } from '@/hooks'\nimport { platformFontWeightMedium } from '@/utils'\nimport { tokens } from '@/vendor/tapestry/tokens'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst VARIANTS = {\n default: 'default',\n meta: 'meta',\n metaSubtle: 'metaSubtle',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\n\ntype VariantStyles = Record<\n VariantUnion,\n {\n backgroundColor: string\n paddingHorizontal: number\n paddingVertical: number\n borderWidth: number\n borderRadius: number\n textColor: string\n gap: number\n metaLabelPaddingLeft: number\n fontWeight: TextStyle['fontWeight']\n }\n>\n\ntype ProductLogoName = 'Groups' | 'Services' | 'groups' | 'services'\ntype ProductLogoComponent = ({ logoSize }: { logoSize: number }) => JSX.Element\n\nconst PRODUCT_LOGO_COMPONENT_MAP: Record<ProductLogoName, ProductLogoComponent> = {\n Groups: GroupsLogo,\n groups: GroupsLogo,\n services: ServicesIcon,\n Services: ServicesIcon,\n}\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface BadgeProps {\n /**\n * Renders the main text.\n */\n label: string\n /**\n * Renders secondary meta text to the right of the label.\n */\n metaLabel?: string\n /**\n * Changes the status color for the badge and icon.\n */\n appearance?: StatusAppearanceUnion\n /**\n * Changes form of the logo to support a meta label and badge\n */\n variant?: VariantUnion\n /**\n * Adds a product logo to the left of the text.\n */\n productLogoName?: ProductLogoName\n /**\n * Shows an icon of the user choice to the left of the text.\n */\n iconName?: IconString\n /**\n * Shows an icon of the user choice to the right of the text.\n */\n iconNameRight?: IconString\n /**\n * Styles badge wrapper.\n */\n style?: ViewStyle\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Callback function when the badge is pressed.\n */\n onPress?: () => void\n /**\n * Specifies the number of lines for the meta label before truncating.\n */\n numberOfLinesMetaLabel?: number\n}\n\nexport function Badge({\n appearance = 'neutral',\n metaLabel,\n style,\n iconName,\n iconNameRight,\n label,\n productLogoName,\n variant = 'default',\n maxFontSizeMultiplier,\n numberOfLinesMetaLabel = 1,\n onPress,\n}: BadgeProps) {\n const styles = useStyles({ appearance, maxFontSizeMultiplier, variant })\n const { showBadgeProductLogo } = useTheme()\n\n const isMetaSubtle = variant === 'metaSubtle'\n const hasMetaLabel = Boolean(metaLabel)\n\n const showLogo = showBadgeProductLogo && productLogoName\n const ProductLogoSvg = showLogo && PRODUCT_LOGO_COMPONENT_MAP[productLogoName]\n const badgeLabel = isMetaSubtle && hasMetaLabel ? `${label}:` : label\n\n return (\n <BadgeWrapper style={[styles.badgeWrapper, style]} onPress={onPress} accessibilityRole=\"button\">\n <View style={styles.badge}>\n {showLogo && ProductLogoSvg && <ProductLogoSvg logoSize={styles.logo.fontSize} />}\n {iconName && <Icon name={iconName} style={styles.icon} />}\n <Text\n variant=\"footnote\"\n style={styles.label}\n numberOfLines={1}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n >\n {badgeLabel}\n </Text>\n {iconNameRight && <Icon name={iconNameRight} style={styles.iconRight} />}\n </View>\n {hasMetaLabel && (\n <Text\n variant=\"footnote\"\n style={styles.metaLabel}\n numberOfLines={numberOfLinesMetaLabel}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n >\n {metaLabel}\n </Text>\n )}\n </BadgeWrapper>\n )\n}\n\nconst BadgeWrapper = ({\n children,\n onPress,\n accessibilityRole,\n ...restProps\n}: ViewProps & Pick<BadgeProps, 'onPress'>) => {\n if (onPress) {\n return (\n <Pressable accessibilityRole={accessibilityRole} onPress={onPress} {...restProps}>\n {children}\n </Pressable>\n )\n }\n\n return <View {...restProps}>{children}</View>\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'neutral',\n maxFontSizeMultiplier,\n variant = 'default',\n}: Partial<BadgeProps>) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n const statusColorMap = useStatusColorAppearanceMap()\n\n const badgeGap = 4 * fontScale\n const badgePaddingHorizontal = 8\n const badgePaddingVertical = 4\n const badgeFontSize = 12\n\n const variantStylesMap: VariantStyles = {\n default: {\n gap: badgeGap,\n backgroundColor: statusColorMap[appearance].background,\n metaLabelPaddingLeft: badgePaddingHorizontal,\n paddingHorizontal: badgePaddingHorizontal,\n paddingVertical: badgePaddingVertical,\n borderWidth: tokens.borderSizeDefault * fontScale,\n borderRadius: tokens.borderRadiusMd * fontScale,\n textColor: statusColorMap[appearance].text,\n fontWeight: 'normal',\n },\n meta: {\n gap: badgeGap,\n backgroundColor: statusColorMap[appearance].background,\n metaLabelPaddingLeft: badgePaddingHorizontal,\n paddingHorizontal: badgePaddingHorizontal,\n paddingVertical: badgePaddingVertical,\n borderWidth: tokens.borderSizeDefault * fontScale,\n borderRadius: tokens.borderRadiusMd * fontScale,\n textColor: statusColorMap[appearance].text,\n fontWeight: platformFontWeightMedium,\n },\n metaSubtle: {\n gap: badgeGap,\n backgroundColor: 'transparent',\n metaLabelPaddingLeft: badgeGap,\n paddingHorizontal: 0,\n paddingVertical: 0,\n borderWidth: 0,\n borderRadius: 0,\n textColor: colors.textColorDefaultSecondary,\n fontWeight: platformFontWeightMedium,\n },\n }\n\n return StyleSheet.create({\n badgeWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignSelf: 'flex-start',\n borderRadius: variantStylesMap[variant].borderRadius,\n borderWidth: variantStylesMap[variant].borderWidth,\n borderColor: statusColorMap[appearance].background,\n },\n badge: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: variantStylesMap[variant].gap,\n paddingVertical: variantStylesMap[variant].paddingVertical,\n paddingHorizontal: variantStylesMap[variant].paddingHorizontal,\n backgroundColor: variantStylesMap[variant].backgroundColor,\n borderRadius: variantStylesMap[variant].borderRadius - 2,\n },\n icon: {\n color: statusColorMap[appearance].icon,\n fontSize: badgeFontSize,\n },\n iconRight: {\n color: statusColorMap[appearance].icon,\n fontSize: badgeFontSize - 2,\n },\n logo: {\n fontSize: badgeFontSize * fontScale,\n },\n label: {\n color: variantStylesMap[variant].textColor,\n fontWeight: variantStylesMap[variant].fontWeight,\n fontSize: badgeFontSize,\n flexShrink: 1,\n },\n metaLabel: {\n paddingHorizontal: variantStylesMap[variant].paddingHorizontal,\n fontSize: badgeFontSize,\n alignSelf: 'center',\n flexShrink: 1,\n paddingLeft: variantStylesMap[variant].metaLabelPaddingLeft,\n },\n })\n}\n\n// =================================\n// ====== Product Logos ============\n// =================================\n\ninterface ProductLogoProps {\n logoSize: number\n}\n\nfunction GroupsLogo({ logoSize }: ProductLogoProps) {\n return (\n <Svg width={logoSize} height={logoSize} viewBox=\"0 0 16 16\" fill=\"none\">\n <Path\n d=\"M9.06 6.14H6.94c-.152.36-.438.646-.797.798v2.12c.359.152.645.438.797.797h2.117c.152-.359.437-.645.796-.797V6.94a1.502 1.502 0 01-.793-.8zM8 0C1.6 0 0 1.595 0 8s1.6 8 8 8 8-1.595 8-8-1.595-8-8-8zm3.939 10.44a1.5 1.5 0 01-2.882.585H6.94a1.5 1.5 0 11-1.963-1.963v-2.12A1.501 1.501 0 116.94 4.98h2.12a1.5 1.5 0 111.963 1.968v2.11a1.501 1.501 0 01.916 1.383z\"\n fill=\"url(#paint0_linear_2632_26363)\"\n />\n <Defs>\n <LinearGradient\n id=\"paint0_linear_2632_26363\"\n x1={-5.6338}\n y1={5.6338}\n x2={5.6338}\n y2={16.9014}\n gradientUnits=\"userSpaceOnUse\"\n >\n <Stop stopColor=\"#FF962D\" />\n <Stop offset={1} stopColor=\"#FC7638\" />\n </LinearGradient>\n </Defs>\n </Svg>\n )\n}\n\nfunction ServicesIcon({ logoSize }: ProductLogoProps) {\n return (\n <Svg width={logoSize} height={logoSize} viewBox=\"0 0 16 16\" fill=\"none\">\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M.116 8c0-6.4 1.6-8 8-8s8 1.6 8 8-1.6 8-8 8-8-1.6-8-8zm4.123 3.464a.848.848 0 10.943-1.41.848.848 0 00-.943 1.41zm.001-2.76a.848.848 0 10.948-1.408.848.848 0 00-.948 1.407zm0-2.759a.849.849 0 10.948-1.408.849.849 0 00-.948 1.408zm8.1 5.34a.388.388 0 00.03-.149v-.755a.39.39 0 00-.39-.39H6.87a.39.39 0 00-.39.39v.755a.39.39 0 00.39.39h5.11a.39.39 0 00.36-.24zm0-2.758a.388.388 0 00.03-.149v-.757a.387.387 0 00-.39-.388H6.87a.388.388 0 00-.39.388v.757a.388.388 0 00.39.388h5.11a.388.388 0 00.36-.24zm0-2.76a.388.388 0 00.03-.148v-.754a.39.39 0 00-.39-.389H6.87a.39.39 0 00-.39.387v.756a.39.39 0 00.39.39h5.11a.389.389 0 00.36-.241z\"\n fill=\"url(#paint0_linear_2632_56586)\"\n />\n <Defs>\n <LinearGradient\n id=\"paint0_linear_2632_56586\"\n x1={-5.51759}\n y1={5.6338}\n x2={5.75001}\n y2={16.9014}\n gradientUnits=\"userSpaceOnUse\"\n >\n <Stop stopColor=\"#6BB23D\" />\n <Stop offset={1} stopColor=\"#659630\" />\n </LinearGradient>\n </Defs>\n </Svg>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/display/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAc,MAAM,OA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S,CAAC,SAAS,EACzB;UAAA,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,EACtC;QAAA,EAAE,cAAc,CAClB;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,GAAG,CAAC,CACP,CAAA;AACH,CAAC","sourcesContent":["import React, { JSX } from 'react'\nimport type { TextStyle, ViewProps, ViewStyle } from 'react-native'\nimport { Pressable, StyleSheet, View } from 'react-native'\nimport Svg, { Defs, LinearGradient, Path, Stop } from 'react-native-svg'\nimport { useFontScale, useTheme } from '../../hooks'\nimport { platformFontWeightMedium } from '../../utils'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon, IconString } from './icon'\nimport { Text } from './text'\nimport { useStatusColorAppearanceMap, type StatusAppearanceUnion } from './utils/status_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst VARIANTS = {\n default: 'default',\n meta: 'meta',\n metaSubtle: 'metaSubtle',\n} as const\n\ntype VariantUnion = (typeof VARIANTS)[keyof typeof VARIANTS]\n\ntype VariantStyles = Record<\n VariantUnion,\n {\n backgroundColor: string\n paddingHorizontal: number\n paddingVertical: number\n borderWidth: number\n borderRadius: number\n textColor: string\n gap: number\n metaLabelPaddingLeft: number\n fontWeight: TextStyle['fontWeight']\n }\n>\n\ntype ProductLogoName = 'Groups' | 'Services' | 'groups' | 'services'\ntype ProductLogoComponent = ({ logoSize }: { logoSize: number }) => JSX.Element\n\nconst PRODUCT_LOGO_COMPONENT_MAP: Record<ProductLogoName, ProductLogoComponent> = {\n Groups: GroupsLogo,\n groups: GroupsLogo,\n services: ServicesIcon,\n Services: ServicesIcon,\n}\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface BadgeProps {\n /**\n * Renders the main text.\n */\n label: string\n /**\n * Renders secondary meta text to the right of the label.\n */\n metaLabel?: string\n /**\n * Changes the status color for the badge and icon.\n */\n appearance?: StatusAppearanceUnion\n /**\n * Changes form of the logo to support a meta label and badge\n */\n variant?: VariantUnion\n /**\n * Adds a product logo to the left of the text.\n */\n productLogoName?: ProductLogoName\n /**\n * Shows an icon of the user choice to the left of the text.\n */\n iconName?: IconString\n /**\n * Shows an icon of the user choice to the right of the text.\n */\n iconNameRight?: IconString\n /**\n * Styles badge wrapper.\n */\n style?: ViewStyle\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Callback function when the badge is pressed.\n */\n onPress?: () => void\n /**\n * Specifies the number of lines for the meta label before truncating.\n */\n numberOfLinesMetaLabel?: number\n}\n\nexport function Badge({\n appearance = 'neutral',\n metaLabel,\n style,\n iconName,\n iconNameRight,\n label,\n productLogoName,\n variant = 'default',\n maxFontSizeMultiplier,\n numberOfLinesMetaLabel = 1,\n onPress,\n}: BadgeProps) {\n const styles = useStyles({ appearance, maxFontSizeMultiplier, variant })\n const { showBadgeProductLogo } = useTheme()\n\n const isMetaSubtle = variant === 'metaSubtle'\n const hasMetaLabel = Boolean(metaLabel)\n\n const showLogo = showBadgeProductLogo && productLogoName\n const ProductLogoSvg = showLogo && PRODUCT_LOGO_COMPONENT_MAP[productLogoName]\n const badgeLabel = isMetaSubtle && hasMetaLabel ? `${label}:` : label\n\n return (\n <BadgeWrapper style={[styles.badgeWrapper, style]} onPress={onPress} accessibilityRole=\"button\">\n <View style={styles.badge}>\n {showLogo && ProductLogoSvg && <ProductLogoSvg logoSize={styles.logo.fontSize} />}\n {iconName && <Icon name={iconName} style={styles.icon} />}\n <Text\n variant=\"footnote\"\n style={styles.label}\n numberOfLines={1}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n >\n {badgeLabel}\n </Text>\n {iconNameRight && <Icon name={iconNameRight} style={styles.iconRight} />}\n </View>\n {hasMetaLabel && (\n <Text\n variant=\"footnote\"\n style={styles.metaLabel}\n numberOfLines={numberOfLinesMetaLabel}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n >\n {metaLabel}\n </Text>\n )}\n </BadgeWrapper>\n )\n}\n\nconst BadgeWrapper = ({\n children,\n onPress,\n accessibilityRole,\n ...restProps\n}: ViewProps & Pick<BadgeProps, 'onPress'>) => {\n if (onPress) {\n return (\n <Pressable accessibilityRole={accessibilityRole} onPress={onPress} {...restProps}>\n {children}\n </Pressable>\n )\n }\n\n return <View {...restProps}>{children}</View>\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'neutral',\n maxFontSizeMultiplier,\n variant = 'default',\n}: Partial<BadgeProps>) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n const statusColorMap = useStatusColorAppearanceMap()\n\n const badgeGap = 4 * fontScale\n const badgePaddingHorizontal = 8\n const badgePaddingVertical = 4\n const badgeFontSize = 12\n\n const variantStylesMap: VariantStyles = {\n default: {\n gap: badgeGap,\n backgroundColor: statusColorMap[appearance].background,\n metaLabelPaddingLeft: badgePaddingHorizontal,\n paddingHorizontal: badgePaddingHorizontal,\n paddingVertical: badgePaddingVertical,\n borderWidth: tokens.borderSizeDefault * fontScale,\n borderRadius: tokens.borderRadiusMd * fontScale,\n textColor: statusColorMap[appearance].text,\n fontWeight: 'normal',\n },\n meta: {\n gap: badgeGap,\n backgroundColor: statusColorMap[appearance].background,\n metaLabelPaddingLeft: badgePaddingHorizontal,\n paddingHorizontal: badgePaddingHorizontal,\n paddingVertical: badgePaddingVertical,\n borderWidth: tokens.borderSizeDefault * fontScale,\n borderRadius: tokens.borderRadiusMd * fontScale,\n textColor: statusColorMap[appearance].text,\n fontWeight: platformFontWeightMedium,\n },\n metaSubtle: {\n gap: badgeGap,\n backgroundColor: 'transparent',\n metaLabelPaddingLeft: badgeGap,\n paddingHorizontal: 0,\n paddingVertical: 0,\n borderWidth: 0,\n borderRadius: 0,\n textColor: colors.textColorDefaultSecondary,\n fontWeight: platformFontWeightMedium,\n },\n }\n\n return StyleSheet.create({\n badgeWrapper: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignSelf: 'flex-start',\n borderRadius: variantStylesMap[variant].borderRadius,\n borderWidth: variantStylesMap[variant].borderWidth,\n borderColor: statusColorMap[appearance].background,\n },\n badge: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: variantStylesMap[variant].gap,\n paddingVertical: variantStylesMap[variant].paddingVertical,\n paddingHorizontal: variantStylesMap[variant].paddingHorizontal,\n backgroundColor: variantStylesMap[variant].backgroundColor,\n borderRadius: variantStylesMap[variant].borderRadius - 2,\n },\n icon: {\n color: statusColorMap[appearance].icon,\n fontSize: badgeFontSize,\n },\n iconRight: {\n color: statusColorMap[appearance].icon,\n fontSize: badgeFontSize - 2,\n },\n logo: {\n fontSize: badgeFontSize * fontScale,\n },\n label: {\n color: variantStylesMap[variant].textColor,\n fontWeight: variantStylesMap[variant].fontWeight,\n fontSize: badgeFontSize,\n flexShrink: 1,\n },\n metaLabel: {\n paddingHorizontal: variantStylesMap[variant].paddingHorizontal,\n fontSize: badgeFontSize,\n alignSelf: 'center',\n flexShrink: 1,\n paddingLeft: variantStylesMap[variant].metaLabelPaddingLeft,\n },\n })\n}\n\n// =================================\n// ====== Product Logos ============\n// =================================\n\ninterface ProductLogoProps {\n logoSize: number\n}\n\nfunction GroupsLogo({ logoSize }: ProductLogoProps) {\n return (\n <Svg width={logoSize} height={logoSize} viewBox=\"0 0 16 16\" fill=\"none\">\n <Path\n d=\"M9.06 6.14H6.94c-.152.36-.438.646-.797.798v2.12c.359.152.645.438.797.797h2.117c.152-.359.437-.645.796-.797V6.94a1.502 1.502 0 01-.793-.8zM8 0C1.6 0 0 1.595 0 8s1.6 8 8 8 8-1.595 8-8-1.595-8-8-8zm3.939 10.44a1.5 1.5 0 01-2.882.585H6.94a1.5 1.5 0 11-1.963-1.963v-2.12A1.501 1.501 0 116.94 4.98h2.12a1.5 1.5 0 111.963 1.968v2.11a1.501 1.501 0 01.916 1.383z\"\n fill=\"url(#paint0_linear_2632_26363)\"\n />\n <Defs>\n <LinearGradient\n id=\"paint0_linear_2632_26363\"\n x1={-5.6338}\n y1={5.6338}\n x2={5.6338}\n y2={16.9014}\n gradientUnits=\"userSpaceOnUse\"\n >\n <Stop stopColor=\"#FF962D\" />\n <Stop offset={1} stopColor=\"#FC7638\" />\n </LinearGradient>\n </Defs>\n </Svg>\n )\n}\n\nfunction ServicesIcon({ logoSize }: ProductLogoProps) {\n return (\n <Svg width={logoSize} height={logoSize} viewBox=\"0 0 16 16\" fill=\"none\">\n <Path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M.116 8c0-6.4 1.6-8 8-8s8 1.6 8 8-1.6 8-8 8-8-1.6-8-8zm4.123 3.464a.848.848 0 10.943-1.41.848.848 0 00-.943 1.41zm.001-2.76a.848.848 0 10.948-1.408.848.848 0 00-.948 1.407zm0-2.759a.849.849 0 10.948-1.408.849.849 0 00-.948 1.408zm8.1 5.34a.388.388 0 00.03-.149v-.755a.39.39 0 00-.39-.39H6.87a.39.39 0 00-.39.39v.755a.39.39 0 00.39.39h5.11a.39.39 0 00.36-.24zm0-2.758a.388.388 0 00.03-.149v-.757a.387.387 0 00-.39-.388H6.87a.388.388 0 00-.39.388v.757a.388.388 0 00.39.388h5.11a.388.388 0 00.36-.24zm0-2.76a.388.388 0 00.03-.148v-.754a.39.39 0 00-.39-.389H6.87a.39.39 0 00-.39.387v.756a.39.39 0 00.39.39h5.11a.389.389 0 00.36-.241z\"\n fill=\"url(#paint0_linear_2632_56586)\"\n />\n <Defs>\n <LinearGradient\n id=\"paint0_linear_2632_56586\"\n x1={-5.51759}\n y1={5.6338}\n x2={5.75001}\n y2={16.9014}\n gradientUnits=\"userSpaceOnUse\"\n >\n <Stop stopColor=\"#6BB23D\" />\n <Stop offset={1} stopColor=\"#659630\" />\n </LinearGradient>\n </Defs>\n </Svg>\n )\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
2
|
import { ViewStyle } from 'react-native';
|
|
3
|
-
import { type BannerStatusIconProps, type BannerRootProps } from '
|
|
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,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAwB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACrB,MAAM,
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import React, { isValidElement } from 'react';
|
|
2
|
-
import BannerPrimitive from '
|
|
2
|
+
import BannerPrimitive from '../primitive/banner_primitive';
|
|
3
3
|
export function Banner({ appearance, description, heading, iconName, showIcon = true, style, }) {
|
|
4
4
|
if (!description && !heading)
|
|
5
5
|
return null;
|
|
@@ -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;AAE3D,OAAO,eAGN,MAAM,
|
|
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;AAE3D,OAAO,eAGN,MAAM,+BAA+B,CAAA;AAiCtC,MAAM,UAAU,MAAM,CAAC,EACrB,UAAU,EACV,WAAW,EACX,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,IAAI,EACf,KAAK,GACO;IACZ,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,YAAY,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CACzC;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,EACnD;QAAA,EAAE,eAAe,CAAC,OAAO,CAC3B;MAAA,EAAE,eAAe,CAAC,YAAY,CAChC;IAAA,EAAE,eAAe,CAAC,IAAI,CAAC,CACxB,CAAA;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,EAAE,WAAW,EAAqC;IACvF,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,WAAW,KAAK,SAAS;YAC5B,OAAO,IAAI,CAAA;QACb,KAAK,cAAc,CAAC,WAAW,CAAC;YAC9B,OAAO,WAAW,CAAA;QACpB;YACE,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;IACrE,CAAC;AACH,CAAC","sourcesContent":["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 BannerPrimitive from '../primitive/banner_primitive';
|
|
2
3
|
import { ConditionalDescription } from './banner';
|
|
3
|
-
import BannerPrimitive from '../../components/primitive/banner_primitive';
|
|
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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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,12 +1,12 @@
|
|
|
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
|
-
import { Spinner } from './spinner';
|
|
6
|
-
import { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors';
|
|
7
4
|
import { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks';
|
|
8
5
|
import { platformFontWeightBold, platformPressedOpacityStyle } from '../../utils';
|
|
9
6
|
import { tokens } from '../../vendor/tapestry/tokens';
|
|
7
|
+
import { Icon } from './icon';
|
|
8
|
+
import { Spinner } from './spinner';
|
|
9
|
+
import { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors';
|
|
10
10
|
// =================================
|
|
11
11
|
// ====== Constants ================
|
|
12
12
|
// =================================
|
|
@@ -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,OAAO,EAAE,MAAM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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 { Spinner } from './spinner'\nimport { getColorKey, useButtonColorOptionMap, useGradientColorMap } from './utils/button_colors'\nimport type { ButtonAppearanceUnion } from './utils/button_colors'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '@/hooks'\nimport { platformFontWeightBold, platformPressedOpacityStyle } from '@/utils'\nimport { tokens } from '@/vendor/tapestry/tokens'\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,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,OAAO,EACP,qBAAqB,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AAC,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 { 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,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
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,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { platformFontWeightMedium, pluralize } from '../../utils';
|
|
4
|
+
import BannerPrimitive from '../primitive/banner_primitive';
|
|
3
5
|
import { Avatar } from './avatar';
|
|
4
6
|
import { BannerCollapsible } from './banner_collapsible';
|
|
5
7
|
import { Text } from './text';
|
|
6
|
-
import BannerPrimitive from '../../components/primitive/banner_primitive';
|
|
7
|
-
import { platformFontWeightMedium, pluralize } from '../../utils';
|
|
8
8
|
export function ChildNotice({ childMembers, showMembers = false, style }) {
|
|
9
9
|
const styles = useStyles();
|
|
10
10
|
const heading = `${pluralize(childMembers.length, 'member')} under age 13`;
|
|
@@ -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;AACzB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"child_notice.js","sourceRoot":"","sources":["../../../src/components/display/child_notice.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAE/D,OAAO,EAAE,wBAAwB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAY7B,MAAM,UAAU,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C,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.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,
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/components/display/icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAA;AAChE,OAAO,KAAK,GAAG,MAAM,iCAAiC,CAAA;AACtD,OAAO,KAAK,KAAK,MAAM,mCAAmC,CAAA;AAC1D,OAAO,KAAK,QAAQ,MAAM,sCAAsC,CAAA;AAChE,OAAO,KAAK,IAAI,MAAM,kCAAkC,CAAA;AACxD,OAAO,KAAK,YAAY,MAAM,2CAA2C,CAAA;AACzE,OAAO,KAAK,OAAO,MAAM,qCAAqC,CAAA;AAC9D,OAAO,KAAK,MAAM,MAAM,oCAAoC,CAAA;AAC5D,OAAO,KAAK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,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC,CAC5C,IAAI,KAAK,CAAC,EACV,CACH,CAAA;AACH,CAAC;AAED,MAAM,cAAc,GAAG,CAAC,IAAa,EAAE,KAAiB,EAAE,qBAA8B,EAAE,EAAE;IAC1F,MAAM,QAAQ,GAAG,KAAK,EAAE,QAAQ,CAAA;IAChC,MAAM,SAAS,GAAG,YAAY,CAAC,EAAE,qBAAqB,EAAE,CAAC,CAAA;IAEzD,IAAI,QAAQ;QAAE,OAAO,QAAQ,GAAG,SAAS,CAAA;IAEzC,OAAO,IAAI,IAAI,aAAa,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,CAAC,IAAgB,EAAU,EAAE;IAC/C,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAE3C,OAAQ,KAAK,CAAC,OAAsB,CAA4B,EAAE,CAAC,QAAQ,CAAC,CAAA;AAC9E,CAAC,CAAA;AAED,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,EAA4C,EAAE,EAAE;IAClF,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,MAAM,EAAE;YACN,eAAe,EAAE,MAAM,CAAC,wBAAwB;YAChD,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;YAChB,YAAY,EAAE,QAAQ,GAAG,CAAC;SAC3B;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,IAAI,MAAM,CAAC,uBAAuB;SAC/C;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import * as accounts from '@planningcenter/icons/paths/accounts'\nimport * as api from '@planningcenter/icons/paths/api'\nimport * as brand from '@planningcenter/icons/paths/brand'\nimport * as calendar from '@planningcenter/icons/paths/calendar'\nimport * as chat from '@planningcenter/icons/paths/chat'\nimport * as churchCenter from '@planningcenter/icons/paths/church-center'\nimport * as general from '@planningcenter/icons/paths/general'\nimport * as groups from '@planningcenter/icons/paths/groups'\nimport * as logomark from '@planningcenter/icons/paths/logomark'\nimport * as people from '@planningcenter/icons/paths/people'\nimport * as publishing from '@planningcenter/icons/paths/publishing'\nimport * as registrations from '@planningcenter/icons/paths/registrations'\nimport * as services from '@planningcenter/icons/paths/services'\nimport React from 'react'\nimport type { ColorValue, StyleProp, ViewStyle } from 'react-native'\nimport { StyleSheet, View } from 'react-native'\nimport type { XmlProps } from 'react-native-svg'\nimport { SvgXml } from 'react-native-svg'\nimport { useFontScale, useTheme } from '../../hooks'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst FALLBACK_SIZE = 12\n\nconst ICONS = {\n accounts,\n api,\n brand,\n calendar,\n chat,\n churchCenter,\n general,\n groups,\n logomark,\n people,\n services,\n publishing,\n registrations,\n} as const\n\nexport type IconStyle = ViewStyle & {\n fontSize?: number\n color?: string\n}\n\nexport type IconSetName = keyof typeof ICONS\n\ntype IconName<T extends IconSetName> = keyof (typeof ICONS)[T] & string\n\nexport type IconString =\n | `accounts.${IconName<'accounts'>}`\n | `api.${IconName<'api'>}`\n | `brand.${IconName<'brand'>}`\n | `calendar.${IconName<'calendar'>}`\n | `chat.${IconName<'chat'>}`\n | `churchCenter.${IconName<'churchCenter'>}`\n | `general.${IconName<'general'>}`\n | `groups.${IconName<'groups'>}`\n | `logomark.${IconName<'logomark'>}`\n | `people.${IconName<'people'>}`\n | `services.${IconName<'services'>}`\n | `publishing.${IconName<'publishing'>}`\n | `registrations.${IconName<'registrations'>}`\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface IconProps extends Omit<XmlProps, 'xml' | 'fontSize'> {\n /**\n * Made up of the set.iconName.\n * Example: \"general.textMessage\"\n */\n name: IconString\n /**\n * This sets a static size for the icon.\n * Providing a fontSize style will allow the icon to scale with the device's text a11y size.\n */\n size?: number\n /**\n * Specifies the maximum size a font can reach when allowFontScaling is enabled.\n */\n maxFontSizeMultiplier?: number\n /**\n * Changes the color of the icon. Most cases should use a theme color to support light/dark mode.\n */\n color?: ColorValue\n /**\n * Icon can handle ViewStyle, color, and fontSize.\n */\n style?: StyleProp<IconStyle>\n}\n\nexport function Icon({\n color,\n name,\n size,\n style,\n accessibilityElementsHidden,\n accessibilityLabel,\n maxFontSizeMultiplier,\n ...props\n}: IconProps) {\n const flattenStyles = StyleSheet.flatten(style)\n const iconSize = useGetIconSize(size, flattenStyles, maxFontSizeMultiplier)\n const path = getIconPath(name)\n const styles = useStyles({ color, iconSize })\n\n if (!path) {\n console.warn(`No icon available named ${name}. Remember to use the format \"set.iconName\"`)\n return <View style={styles.noIcon} />\n }\n\n return (\n <SvgXml\n accessibilityElementsHidden={accessibilityElementsHidden}\n accessibilityLabel={accessibilityLabel}\n xml={`\n <svg viewBox=\"0 0 16 16\">\n <path d=\"${path}\" fill=\"currentColor\" />\n </svg>\n `}\n height={iconSize}\n width={iconSize}\n style={{ ...styles.icon, ...flattenStyles }}\n {...props}\n />\n )\n}\n\nconst useGetIconSize = (size?: number, style?: IconStyle, maxFontSizeMultiplier?: number) => {\n const fontSize = style?.fontSize\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n\n if (fontSize) return fontSize * fontScale\n\n return size || FALLBACK_SIZE\n}\n\nconst getIconPath = (name: IconString): string => {\n const [setName, iconName] = name.split('.')\n\n return (ICONS[setName as IconSetName] as Record<string, string>)?.[iconName]\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({ color, iconSize }: { color?: ColorValue; iconSize: number }) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n noIcon: {\n backgroundColor: colors.iconColorDefaultDisabled,\n width: iconSize,\n height: iconSize,\n borderRadius: iconSize / 2,\n },\n icon: {\n color: color || colors.iconColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"icon_button.d.ts","sourceRoot":"","sources":["../../../src/components/display/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAyB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAI7D,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAGnD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAA;AAMtE,QAAA,MAAM,KAAK;;;;;;;;;;CAUD,CAAA;AAEV,KAAK,SAAS,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,OAAO,KAAK,CAAC,CAAA;AAmBnD,UAAU,eAAgB,SAAQ,cAAc;IAC9C;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAA;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC;;;;OAIG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,IAAI,EAAE,UAAU,CAAA;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;CAC7B;AAED,wBAAgB,UAAU,CAAC,EACzB,kBAAkB,EAClB,UAAsB,EACtB,QAAgB,EAChB,SAAS,EACT,OAAO,EACP,qBAAqB,EACrB,IAAI,EACJ,IAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,eAAe,qBAoEjB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleSheet } from 'react-native';
|
|
3
|
+
import { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks';
|
|
4
|
+
import { platformPressedOpacityStyle } from '../../utils';
|
|
3
5
|
import { Icon } from './icon';
|
|
4
6
|
import { Spinner } from './spinner';
|
|
5
7
|
import { getColorKey, useIconButtonColorOptionMap } from './utils/button_colors';
|
|
6
|
-
import { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks';
|
|
7
|
-
import { platformPressedOpacityStyle } from '../../utils';
|
|
8
8
|
// =================================
|
|
9
9
|
// ====== Constants ================
|
|
10
10
|
// =================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/components/display/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAEhF,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAA;AAErD,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,EAAE,EA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AAE;YACV,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE,GAAG,SAAS;SACvB;QACD,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE,GAAG,SAAS;SACvB;QACD,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,EAAE,GAAG,SAAS;SACvB;KACF,CAAA;IAED,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,UAAU,EAAE,QAAQ;YACpB,cAAc,EAAE,QAAQ;YACxB,MAAM,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,MAAM;SAClC;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;YACrC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC;SAChC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, type StyleProp } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport { Icon } from './icon'\nimport type { IconProps, IconString } from './icon'\nimport { Spinner } from './spinner'\nimport { getColorKey, useIconButtonColorOptionMap } from './utils/button_colors'\nimport type { IconButtonAppearanceUnion } from './utils/button_colors'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '@/hooks'\nimport { platformPressedOpacityStyle } from '@/utils'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n xxxs: 'xxxs',\n xxs: 'xxs',\n xs: 'xs',\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n xl: 'xl',\n xxl: 'xxl',\n xxxl: 'xxxl',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n height: number\n }\n>\ntype AndroidRadiusSize = Record<\n SizeUnion,\n {\n radius: number\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface IconButtonProps extends PressableProps {\n /**\n * Provides context to screen readers about what the button does.\n * This is required as Icons don't inherently provide non-visual context like text does.\n */\n accessibilityLabel: string\n /**\n * Updates the icon's colors. Defaults to 'neutral'.\n */\n appearance?: IconButtonAppearanceUnion\n /**\n * Styles the icon itself.\n * `fontSize` allows for a custom size that also responds to the device's text scale.\n * `color` changes the color of the icon.\n */\n iconStyle?: IconProps['style']\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 * Generates an icon from `@planningcenter/icons`\n */\n name: IconString\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Styles the `Pressable` wrapper\n */\n style?: StyleProp<ViewStyle>\n}\n\nexport function IconButton({\n accessibilityLabel,\n appearance = 'neutral',\n disabled = false,\n iconStyle,\n loading,\n maxFontSizeMultiplier,\n name,\n size = 'md',\n style,\n ...props\n}: IconButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size })\n const colorOptionMap = useIconButtonColorOptionMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const { color = colorOptionMap[colorKey] } = StyleSheet.flatten(iconStyle || {})\n const androidRippleColor = useCreateAndroidRippleColor({ color: color })\n\n const androidRadiusSizeMap: AndroidRadiusSize = {\n [SIZES.xxxs]: {\n radius: 8,\n },\n [SIZES.xxs]: {\n radius: 10,\n },\n [SIZES.xs]: {\n radius: 12,\n },\n [SIZES.sm]: {\n radius: 14,\n },\n [SIZES.md]: {\n radius: 16,\n },\n [SIZES.lg]: {\n radius: 18,\n },\n [SIZES.xl]: {\n radius: 20,\n },\n [SIZES.xxl]: {\n radius: 26,\n },\n [SIZES.xxxl]: {\n radius: 32,\n },\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.pressable, style, pressed && platformPressedOpacityStyle]}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n accessibilityLabel={accessibilityLabel}\n hitSlop={10}\n android_ripple={{\n color: androidRippleColor,\n borderless: true,\n foreground: true,\n radius: androidRadiusSizeMap[size].radius,\n }}\n {...props}\n >\n {loading ? (\n <Spinner\n size={styles.spinner.fontSize}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n ) : (\n <Icon\n name={name}\n style={[styles.icon, iconStyle, disabled && styles.iconDisabled]}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'neutral',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n}: Partial<IconButtonProps>) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useIconButtonColorOptionMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.xxxs]: {\n fontSize: 8,\n height: 8 * fontScale,\n },\n [SIZES.xxs]: {\n fontSize: 10,\n height: 10 * fontScale,\n },\n [SIZES.xs]: {\n fontSize: 12,\n height: 12 * fontScale,\n },\n [SIZES.sm]: {\n fontSize: 14,\n height: 14 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 16,\n height: 16 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 20,\n height: 20 * fontScale,\n },\n [SIZES.xl]: {\n fontSize: 24,\n height: 24 * fontScale,\n },\n [SIZES.xxl]: {\n fontSize: 32,\n height: 32 * fontScale,\n },\n [SIZES.xxxl]: {\n fontSize: 40,\n height: 40 * fontScale,\n },\n }\n\n return StyleSheet.create({\n pressable: {\n alignItems: 'center',\n justifyContent: 'center',\n height: sizeStyleMap[size].height,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: colorOptionMap[colorKey],\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n spinner: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/components/display/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAkB,MAAM,cAAc,CAAA;AAEpE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAGhF,oCAAoC;AACpC,oCAAoC;AACpC,oCAAoC;AAEpC,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAA;AA2DV,MAAM,UAAU,UAAU,CAAC,EACzB,kBAAkB,EAClB,UAAU,GAAG,SAAS,EACtB,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,OAAO,EACP,qBAAqB,EACrB,IAAI,EACJ,IAAI,GAAG,IAAI,EACX,KAAK,EACL,GAAG,KAAK,EACQ;IAChB,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,UAAU,EAAE,QAAQ,EAA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AAC,IAAI,CAAC,CAAC,MAAM;SAClC;QACD,IAAI,EAAE;YACJ,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;YACrC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC;SAChC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,MAAM,CAAC,wBAAwB;SACvC;QACD,OAAO,EAAE;YACP,QAAQ,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,QAAQ;SACtC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { Pressable, StyleSheet, type StyleProp } from 'react-native'\nimport type { PressableProps, ViewStyle } from 'react-native'\nimport { useTheme, useFontScale, useCreateAndroidRippleColor } from '../../hooks'\nimport { platformPressedOpacityStyle } from '../../utils'\nimport { Icon } from './icon'\nimport type { IconProps, IconString } from './icon'\nimport { Spinner } from './spinner'\nimport { getColorKey, useIconButtonColorOptionMap } from './utils/button_colors'\nimport type { IconButtonAppearanceUnion } from './utils/button_colors'\n\n// =================================\n// ====== Constants ================\n// =================================\n\nconst SIZES = {\n xxxs: 'xxxs',\n xxs: 'xxs',\n xs: 'xs',\n sm: 'sm',\n md: 'md',\n lg: 'lg',\n xl: 'xl',\n xxl: 'xxl',\n xxxl: 'xxxl',\n} as const\n\ntype SizeUnion = (typeof SIZES)[keyof typeof SIZES]\ntype SizeStyle = Record<\n SizeUnion,\n {\n fontSize: number\n height: number\n }\n>\ntype AndroidRadiusSize = Record<\n SizeUnion,\n {\n radius: number\n }\n>\n\n// =================================\n// ====== Component ================\n// =================================\n\ninterface IconButtonProps extends PressableProps {\n /**\n * Provides context to screen readers about what the button does.\n * This is required as Icons don't inherently provide non-visual context like text does.\n */\n accessibilityLabel: string\n /**\n * Updates the icon's colors. Defaults to 'neutral'.\n */\n appearance?: IconButtonAppearanceUnion\n /**\n * Styles the icon itself.\n * `fontSize` allows for a custom size that also responds to the device's text scale.\n * `color` changes the color of the icon.\n */\n iconStyle?: IconProps['style']\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 * Generates an icon from `@planningcenter/icons`\n */\n name: IconString\n /**\n * Changes the overall size of the button and its contents\n */\n size?: SizeUnion\n /**\n * Styles the `Pressable` wrapper\n */\n style?: StyleProp<ViewStyle>\n}\n\nexport function IconButton({\n accessibilityLabel,\n appearance = 'neutral',\n disabled = false,\n iconStyle,\n loading,\n maxFontSizeMultiplier,\n name,\n size = 'md',\n style,\n ...props\n}: IconButtonProps) {\n const styles = useStyles({ appearance, disabled, loading, maxFontSizeMultiplier, size })\n const colorOptionMap = useIconButtonColorOptionMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const { color = colorOptionMap[colorKey] } = StyleSheet.flatten(iconStyle || {})\n const androidRippleColor = useCreateAndroidRippleColor({ color: color })\n\n const androidRadiusSizeMap: AndroidRadiusSize = {\n [SIZES.xxxs]: {\n radius: 8,\n },\n [SIZES.xxs]: {\n radius: 10,\n },\n [SIZES.xs]: {\n radius: 12,\n },\n [SIZES.sm]: {\n radius: 14,\n },\n [SIZES.md]: {\n radius: 16,\n },\n [SIZES.lg]: {\n radius: 18,\n },\n [SIZES.xl]: {\n radius: 20,\n },\n [SIZES.xxl]: {\n radius: 26,\n },\n [SIZES.xxxl]: {\n radius: 32,\n },\n }\n\n return (\n <Pressable\n style={({ pressed }) => [styles.pressable, style, pressed && platformPressedOpacityStyle]}\n accessibilityRole=\"button\"\n disabled={disabled || loading}\n accessibilityState={{ busy: loading }}\n accessibilityLabel={accessibilityLabel}\n hitSlop={10}\n android_ripple={{\n color: androidRippleColor,\n borderless: true,\n foreground: true,\n radius: androidRadiusSizeMap[size].radius,\n }}\n {...props}\n >\n {loading ? (\n <Spinner\n size={styles.spinner.fontSize}\n maxFontSizeMultiplier={maxFontSizeMultiplier || 0}\n />\n ) : (\n <Icon\n name={name}\n style={[styles.icon, iconStyle, disabled && styles.iconDisabled]}\n maxFontSizeMultiplier={maxFontSizeMultiplier}\n />\n )}\n </Pressable>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\nconst useStyles = ({\n appearance = 'neutral',\n disabled = false,\n loading = false,\n maxFontSizeMultiplier,\n size = 'md',\n}: Partial<IconButtonProps>) => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier })\n const colorOptionMap = useIconButtonColorOptionMap()\n const colorKey = getColorKey({ disabled, loading, appearance })\n\n const sizeStyleMap: SizeStyle = {\n [SIZES.xxxs]: {\n fontSize: 8,\n height: 8 * fontScale,\n },\n [SIZES.xxs]: {\n fontSize: 10,\n height: 10 * fontScale,\n },\n [SIZES.xs]: {\n fontSize: 12,\n height: 12 * fontScale,\n },\n [SIZES.sm]: {\n fontSize: 14,\n height: 14 * fontScale,\n },\n [SIZES.md]: {\n fontSize: 16,\n height: 16 * fontScale,\n },\n [SIZES.lg]: {\n fontSize: 20,\n height: 20 * fontScale,\n },\n [SIZES.xl]: {\n fontSize: 24,\n height: 24 * fontScale,\n },\n [SIZES.xxl]: {\n fontSize: 32,\n height: 32 * fontScale,\n },\n [SIZES.xxxl]: {\n fontSize: 40,\n height: 40 * fontScale,\n },\n }\n\n return StyleSheet.create({\n pressable: {\n alignItems: 'center',\n justifyContent: 'center',\n height: sizeStyleMap[size].height,\n },\n icon: {\n fontSize: sizeStyleMap[size].fontSize,\n color: colorOptionMap[colorKey],\n },\n iconDisabled: {\n color: colors.iconColorDefaultDisabled,\n },\n spinner: {\n fontSize: sizeStyleMap[size].fontSize,\n },\n })\n}\n"]}
|
|
@@ -2,8 +2,8 @@ import { noop } from 'lodash';
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { Image as ReactNativeImage, StyleSheet, View, } from 'react-native';
|
|
4
4
|
import Animated from 'react-native-reanimated';
|
|
5
|
-
import { Spinner } from './spinner';
|
|
6
5
|
import { useTheme } from '../../hooks';
|
|
6
|
+
import { Spinner } from './spinner';
|
|
7
7
|
export function Image({ source, onLoad = noop, defaultLoading = true, loading = false, hideLoader = false, loaderSize = 24, loadingBackgroundStyles, style = {}, wrapperStyle = {}, alt, animatedImageStyle = {}, ...props }) {
|
|
8
8
|
const [isImageLoading, setIsImageLoading] = useState(defaultLoading);
|
|
9
9
|
const imageStyles = StyleSheet.flatten(style);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/display/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAIL,KAAK,IAAI,gBAAgB,EAEzB,UAAU,EACV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,QAA2B,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/display/image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvC,OAAO,EAIL,KAAK,IAAI,gBAAgB,EAEzB,UAAU,EACV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,QAA2B,MAAM,yBAAyB,CAAA;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA0CnC,MAAM,UAAU,KAAK,CAAC,EACpB,MAAM,EACN,MAAM,GAAG,IAAI,EACb,cAAc,GAAG,IAAI,EACrB,OAAO,GAAG,KAAK,EACf,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,EAAE,EACf,uBAAuB,EACvB,KAAK,GAAG,EAAE,EACV,YAAY,GAAG,EAAE,EACjB,G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AI,KAAK,CAAC,EAEZ;MAAA,CAAC,CAAC,UAAU,IAAI,SAAS,IAAI,CAC3B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,CAC/D;UAAA,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EACnD;QAAA,EAAE,IAAI,CAAC,CACR,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAYD,MAAM,SAAS,GAAG,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,EAAE,EAAE;IAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAE7B,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,iBAAiB,EAAE;YACjB,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,YAAY;YACZ,KAAK;YACL,MAAM;SACP;QACD,KAAK,EAAE;YACL,eAAe,EAAE,MAAM,CAAC,mBAAmB;YAC3C,KAAK;YACL,MAAM;SACP;QACD,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,MAAM,EAAE,MAAM;YACd,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,QAAQ,EAAE,UAAU;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { noop } from 'lodash'\nimport React, { useState } from 'react'\nimport {\n AnimatableNumericValue,\n DimensionValue,\n ImageStyle,\n Image as ReactNativeImage,\n ImageProps as ReactNativeImageProps,\n StyleSheet,\n View,\n ViewStyle,\n} from 'react-native'\nimport Animated, { AnimatedStyle } from 'react-native-reanimated'\nimport { useTheme } from '../../hooks'\nimport { Spinner } from './spinner'\n\n// =================================\n// ====== Component ================\n// =================================\n\nexport interface ImageProps extends ReactNativeImageProps {\n /**\n * Describes the image to screen-readers and marks the image as `accessible`.\n * Passing an empty string will hide the image from screen-readers.\n */\n alt: string\n /**\n * Shows the image's loading spinner right away. Enabled by default.\n */\n defaultLoading?: boolean\n /**\n * Externally controls the loading state of the image.\n */\n loading?: boolean\n /**\n * Hide the loading spinner, regardless of the loading state.\n */\n hideLoader?: boolean\n /**\n * Size of the loading spinner.\n */\n loaderSize?: number\n /**\n * Style object for the preload background.\n */\n loadingBackgroundStyles?: ViewStyle\n /**\n * Style the outer View of the image.\n */\n wrapperStyle?: ViewStyle\n /**\n * Style the image if animated.\n */\n animatedImageStyle?: AnimatedStyle<ImageStyle>\n}\n\nexport function Image({\n source,\n onLoad = noop,\n defaultLoading = true,\n loading = false,\n hideLoader = false,\n loaderSize = 24,\n loadingBackgroundStyles,\n style = {},\n wrapperStyle = {},\n alt,\n animatedImageStyle = {},\n ...props\n}: ImageProps) {\n const [isImageLoading, setIsImageLoading] = useState(defaultLoading)\n\n const imageStyles = StyleSheet.flatten(style)\n const { width = '100%', height = '100%', borderRadius = 0 } = imageStyles || {}\n const styles = useStyles({ width, height, borderRadius })\n\n const handleOnLoad = (event: any) => {\n setIsImageLoading(false)\n onLoad?.(event)\n }\n\n const isLoading = isImageLoading || loading\n\n const ImageComponent = animatedImageStyle ? Animated.Image : ReactNativeImage\n\n return (\n <View\n style={wrapperStyle}\n accessible={Boolean(alt)}\n accessibilityRole=\"image\"\n accessibilityState={{ busy: isLoading }}\n collapsable={false}\n >\n <ImageComponent\n style={[styles.image, imageStyles, animatedImageStyle]}\n onLoad={handleOnLoad}\n source={source}\n alt={isLoading ? '' : alt}\n {...props}\n />\n {!hideLoader && isLoading && (\n <View style={[styles.loadingBackground, loadingBackgroundStyles]}>\n <Spinner size={loaderSize} style={styles.spinner} />\n </View>\n )}\n </View>\n )\n}\n\n// =================================\n// ====== Styles ===================\n// =================================\n\ninterface Styles {\n width: DimensionValue\n height: DimensionValue\n borderRadius: AnimatableNumericValue | string\n}\n\nconst useStyles = ({ width, height, borderRadius }: Styles) => {\n const { colors } = useTheme()\n\n return StyleSheet.create({\n loadingBackground: {\n position: 'absolute',\n top: 0,\n left: 0,\n backgroundColor: colors.fillColorNeutral070,\n borderRadius,\n width,\n height,\n },\n image: {\n backgroundColor: colors.fillColorNeutral070,\n width,\n height,\n },\n spinner: {\n width: '100%',\n height: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n position: 'absolute',\n },\n })\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { View, StyleSheet } from 'react-native';
|
|
2
|
+
import { useTheme } from '../../hooks';
|
|
3
|
+
import { tokens } from '../../vendor/tapestry/tokens';
|
|
2
4
|
import { Icon } from './icon';
|
|
3
5
|
import { IconButton } from './icon_button';
|
|
4
6
|
import { Image } from './image';
|
|
5
|
-
import { useTheme } from '../../hooks';
|
|
6
|
-
import { tokens } from '../../vendor/tapestry/tokens';
|
|
7
7
|
const SIZES = {
|
|
8
8
|
sm: 'sm',
|
|
9
9
|
md: 'md',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image_attachment_preview.js","sourceRoot":"","sources":["../../../src/components/display/image_attachment_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"image_attachment_preview.js","sourceRoot":"","sources":["../../../src/components/display/image_attachment_preview.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,E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AiB;YACzC,QAAQ,EAAE,UAAU;YACpB,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,sBAAsB,EAAE,YAAY;YACpC,OAAO,EAAE,CAAC;SACX;QACD,SAAS,EAAE;YACT,KAAK,EAAE,MAAM,CAAC,oBAAoB;YAClC,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;YAC9B,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC;SACjC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { View, StyleSheet } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { tokens } from '../../vendor/tapestry/tokens'\nimport { Icon } from './icon'\nimport { IconButton } from './icon_button'\nimport { Image } from './image'\n\nconst SIZES = {\n sm: 'sm',\n md: 'md',\n} as const\ntype ImageSizeUnion = (typeof SIZES)[keyof typeof SIZES]\n\ninterface ImageAttachmentPreviewProps {\n fileName: string\n uri: string\n size?: ImageSizeUnion\n onRemovePress: () => void\n loading?: boolean\n hideRemoveButton?: boolean\n error?: boolean\n}\n\nexport const ImageAttachmentPreview = ({\n uri,\n fileName,\n size = 'md',\n onRemovePress,\n loading = false,\n hideRemoveButton = false,\n error = false,\n}: ImageAttachmentPreviewProps) => {\n const styles = useStyles({ size, error })\n\n return (\n <View style={styles.container}>\n {!hideRemoveButton && (\n <IconButton\n name=\"general.x\"\n onPress={onRemovePress}\n size=\"xxs\"\n appearance=\"neutral\"\n style={styles.closeButton}\n accessibilityLabel=\"Remove image attachment\"\n />\n )}\n <Image\n source={{ uri }}\n style={styles.image}\n alt={`Attached ${fileName}`}\n resizeMode=\"cover\"\n loading={loading}\n loaderSize={size === 'sm' ? 20 : 24}\n />\n {error && (\n <View style={styles.errorBadge}>\n <Icon name=\"general.exclamationTriangle\" size={12} style={styles.errorIcon} />\n </View>\n )}\n </View>\n )\n}\n\nconst useStyles = ({ size = 'md', error = false }: Partial<ImageAttachmentPreviewProps>) => {\n const { colors } = useTheme()\n const borderRadius = 8\n\n const imageSizeMap = {\n sm: 60,\n md: 80,\n }\n const errorIconSizeMap = {\n sm: 10,\n md: 12,\n }\n\n return StyleSheet.create({\n container: {\n width: imageSizeMap[size],\n height: imageSizeMap[size],\n overflow: 'hidden',\n borderRadius: borderRadius,\n borderWidth: error ? 2 : 1,\n borderColor: error ? colors.statusErrorBorder : colors.borderColorDefaultBase,\n },\n image: {\n opacity: error ? 0.5 : 1,\n },\n closeButton: {\n position: 'absolute',\n top: 4,\n right: 4,\n zIndex: 2,\n backgroundColor: colors.fillColorNeutral050Base,\n borderRadius: 16,\n height: 20,\n width: 20,\n },\n errorBadge: {\n backgroundColor: colors.statusErrorBorder,\n position: 'absolute',\n bottom: 0,\n right: 0,\n zIndex: 2,\n borderStartStartRadius: borderRadius,\n padding: 4,\n },\n errorIcon: {\n color: tokens.colorNeutral100White,\n transform: [{ translateX: 1 }],\n fontSize: errorIconSizeMap[size],\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyboard_view.js","sourceRoot":"","sources":["../../../src/components/display/keyboard_view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EACL,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR,UAAU,EACV,IAAI,GAEL,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"keyboard_view.js","sourceRoot":"","sources":["../../../src/components/display/keyboard_view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EACL,UAAU,EACV,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR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,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,CAEjE;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,oBAAoB,CACxB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEvC,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,QAAQ,CAAC,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE;YAClD,OAAO,CAAC,IAAI,CAAC,CAAA;QACf,CAAC,CAAC,CAAC,MAAM,CAAA;IACX,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,QAAQ,CAAC,WAAW,CAAC,iBAAiB,EAAE,GAAG,EAAE;YAClD,OAAO,CAAC,KAAK,CAAC,CAAA;QAChB,CAAC,CAAC,CAAC,MAAM,CAAA;IACX,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;SACR;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC;SACR;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React, { useEffect, useState } from 'react'\nimport {\n Dimensions,\n Keyboard,\n KeyboardAvoidingView,\n Platform,\n StyleSheet,\n View,\n ViewProps,\n} from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useChatContext } from '../../contexts/chat_context'\n\nexport function KeyboardView({ children }: Pick<ViewProps, 'children'>) {\n const styles = useStyles()\n const isKeyboardOpen = useKeyboardOpen()\n const screenHeight = Dimensions.get('screen').height\n const [pageSheetGap, setPageSheetGap] = useState<number>(0)\n const { bottom } = useSafeAreaInsets()\n const { edgeToEdge } = useChatContext()\n\n const behavior: 'padding' | 'height' | 'position' | undefined = Platform.select({\n android: edgeToEdge ? 'padding' : undefined,\n ios: 'padding',\n })\n\n return (\n <View\n style={styles.pageGapView}\n onLayout={event => {\n const { height: viewHeight } = event.nativeEvent.layout\n setPageSheetGap(screenHeight - viewHeight)\n }}\n >\n <KeyboardAvoidingView\n keyboardVerticalOffset={pageSheetGap - bottom}\n behavior={behavior}\n style={styles.keyboardView}\n enabled={Platform.select({ android: isKeyboardOpen, ios: true })}\n >\n {children}\n </KeyboardAvoidingView>\n </View>\n )\n}\n\nexport const useKeyboardOpen = () => {\n const [open, setOpen] = useState(false)\n\n useEffect(() => {\n return Keyboard.addListener('keyboardDidShow', () => {\n setOpen(true)\n }).remove\n }, [])\n\n useEffect(() => {\n return Keyboard.addListener('keyboardDidHide', () => {\n setOpen(false)\n }).remove\n }, [])\n\n return open\n}\n\nconst useStyles = () => {\n return StyleSheet.create({\n pageGapView: {\n flex: 1,\n },\n keyboardView: {\n flex: 1,\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/components/display/person.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"person.d.ts","sourceRoot":"","sources":["../../../src/components/display/person.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;AAU5C,UAAU,WAAW;IACnB,MAAM,EAAE,cAAc,CAAA;IACtB,KAAK,CAAC,EAAE,SAAS,CAAA;CAClB;AAED,wBAAgB,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,WAAW,qBAgBpD"}
|