@oxy.so/bloom 23.8.1 → 23.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/bloom-language-classnames.mdx +14 -14
- package/docs/bloom-language-codemod.mdx +40 -5
- package/docs/bloom-language-for-agents.mdx +3 -1
- package/docs/bloom-language-from-jsx.mdx +1 -0
- package/docs/bloom-language-modifiers.mdx +231 -84
- package/docs/bloom-language-nodes.mdx +48 -26
- package/docs/bloom-language-tokens.mdx +71 -14
- package/docs/bloom-language.mdx +251 -68
- package/docs/design-tokens.mdx +12 -2
- package/docs/no-nativewind.mdx +5 -4
- package/docs/task-catalog.json +1 -1
- package/docs/task-catalog.mdx +1 -1
- package/docs/theme.mdx +22 -6
- package/lib/commonjs/accordion/Accordion.js +12 -12
- package/lib/commonjs/accordion/Accordion.js.map +1 -1
- package/lib/commonjs/accordion/Accordion.web.js +8 -8
- package/lib/commonjs/accordion/Accordion.web.js.map +1 -1
- package/lib/commonjs/agent-creator/AgentCreatorSection.js +8 -10
- package/lib/commonjs/agent-creator/AgentCreatorSection.js.map +1 -1
- package/lib/commonjs/agent-creator/EmotionPicker.js +3 -5
- package/lib/commonjs/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/commonjs/agent-log/AgentLog.js +131 -174
- package/lib/commonjs/agent-log/AgentLog.js.map +1 -1
- package/lib/commonjs/agent-reply/AgentProfile.js +6 -9
- package/lib/commonjs/agent-reply/AgentProfile.js.map +1 -1
- package/lib/commonjs/agent-thinking/AgentThinking.js +8 -7
- package/lib/commonjs/agent-thinking/AgentThinking.js.map +1 -1
- package/lib/commonjs/agent-thinking/ThinkingReasoning.js +8 -8
- package/lib/commonjs/agent-thinking/ThinkingReasoning.js.map +1 -1
- package/lib/commonjs/app-shell/AppShell.js +5 -7
- package/lib/commonjs/app-shell/AppShell.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellEngine.js +72 -28
- package/lib/commonjs/app-shell/AppShellEngine.js.map +1 -1
- package/lib/commonjs/app-shell/AppShellPanelLayout.js +3 -3
- package/lib/commonjs/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/commonjs/app-shell/NotificationBell.js +9 -9
- package/lib/commonjs/app-shell/NotificationBell.js.map +1 -1
- package/lib/commonjs/app-shell/PanelReorderHandle.js +4 -6
- package/lib/commonjs/app-shell/PanelReorderHandle.js.map +1 -1
- package/lib/commonjs/avatar-group/AvatarGroupBase.js +7 -7
- package/lib/commonjs/avatar-group/AvatarGroupBase.js.map +1 -1
- package/lib/commonjs/chat-list/ChatSearchResultsBase.js +4 -4
- package/lib/commonjs/chat-list/ChatSearchResultsBase.js.map +1 -1
- package/lib/commonjs/choice-list/ChoiceList.js +5 -5
- package/lib/commonjs/choice-list/ChoiceList.js.map +1 -1
- package/lib/commonjs/color-swatch-picker/ColorSwatchPicker.js +7 -7
- package/lib/commonjs/color-swatch-picker/ColorSwatchPicker.js.map +1 -1
- package/lib/commonjs/connection-dots/ConnectionDots.js +4 -4
- package/lib/commonjs/connection-dots/ConnectionDots.js.map +1 -1
- package/lib/commonjs/connection-dots/ConnectionDots.web.js +4 -4
- package/lib/commonjs/connection-dots/ConnectionDots.web.js.map +1 -1
- package/lib/commonjs/cover-header/CoverHeader.js +3 -3
- package/lib/commonjs/cover-header/CoverHeader.js.map +1 -1
- package/lib/commonjs/data-table/DataTable.js +10 -11
- package/lib/commonjs/data-table/DataTable.js.map +1 -1
- package/lib/commonjs/data-table/DataTableSelect.js +8 -8
- package/lib/commonjs/data-table/DataTableSelect.js.map +1 -1
- package/lib/commonjs/design-tokens/theme.css +1 -0
- package/lib/commonjs/design-tokens/tokens.json +390 -0
- package/lib/commonjs/dialog/DialogContent.js +5 -4
- package/lib/commonjs/dialog/DialogContent.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +6 -5
- package/lib/commonjs/dialog/DialogHeader.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +5 -4
- package/lib/commonjs/dialog/SheetShell.js.map +1 -1
- package/lib/commonjs/expandable-text/ExpandableText.js +3 -3
- package/lib/commonjs/expandable-text/ExpandableText.js.map +1 -1
- package/lib/commonjs/floating/lens/lens-cover.js +56 -0
- package/lib/commonjs/floating/lens/lens-cover.js.map +1 -0
- package/lib/commonjs/floating/lens/native-lens.js.map +1 -1
- package/lib/commonjs/grouped-section/GroupedSection.js +16 -15
- package/lib/commonjs/grouped-section/GroupedSection.js.map +1 -1
- package/lib/commonjs/home-search/BudgetPicker.js +8 -8
- package/lib/commonjs/home-search/BudgetPicker.js.map +1 -1
- package/lib/commonjs/home-search/MoveInPicker.js +7 -7
- package/lib/commonjs/home-search/MoveInPicker.js.map +1 -1
- package/lib/commonjs/icon-circle/IconCircle.js +14 -16
- package/lib/commonjs/icon-circle/IconCircle.js.map +1 -1
- package/lib/commonjs/icons/shared.js +3 -5
- package/lib/commonjs/icons/shared.js.map +1 -1
- package/lib/commonjs/image/BloomImage.js +3 -0
- package/lib/commonjs/image/BloomImage.js.map +1 -1
- package/lib/commonjs/kbd/Kbd.js +8 -8
- package/lib/commonjs/kbd/Kbd.js.map +1 -1
- package/lib/commonjs/layout/ResizeHandle.js +6 -5
- package/lib/commonjs/layout/ResizeHandle.js.map +1 -1
- package/lib/commonjs/link-preview/LinkPreviewCard.js +24 -26
- package/lib/commonjs/link-preview/LinkPreviewCard.js.map +1 -1
- package/lib/commonjs/list/ListBase.js +3 -3
- package/lib/commonjs/list/ListBase.js.map +1 -1
- package/lib/commonjs/list/ListPerson.js +3 -3
- package/lib/commonjs/list/ListPerson.js.map +1 -1
- package/lib/commonjs/listing-editor/ListingPreviewPane.js +30 -30
- package/lib/commonjs/listing-editor/ListingPreviewPane.js.map +1 -1
- package/lib/commonjs/markdown/InlineMarkdown.js +9 -11
- package/lib/commonjs/markdown/InlineMarkdown.js.map +1 -1
- package/lib/commonjs/markdown/MarkdownBlocks.js +35 -43
- package/lib/commonjs/markdown/MarkdownBlocks.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js +5 -8
- package/lib/commonjs/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js +9 -11
- package/lib/commonjs/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
- package/lib/commonjs/notifications/NotificationPermissionSheet.js +3 -5
- package/lib/commonjs/notifications/NotificationPermissionSheet.js.map +1 -1
- package/lib/commonjs/notifications/NotificationsScreen.js +21 -27
- package/lib/commonjs/notifications/NotificationsScreen.js.map +1 -1
- package/lib/commonjs/overlay/OverlayInertBoundary.js +33 -12
- package/lib/commonjs/overlay/OverlayInertBoundary.js.map +1 -1
- package/lib/commonjs/page-header/PageHeaderTitleInput.js +20 -20
- package/lib/commonjs/page-header/PageHeaderTitleInput.js.map +1 -1
- package/lib/commonjs/panel-routing/expo-router/StackScene.js +42 -24
- package/lib/commonjs/panel-routing/expo-router/StackScene.js.map +1 -1
- package/lib/commonjs/phone-input/CountryCodeSelect.js +4 -4
- package/lib/commonjs/phone-input/CountryCodeSelect.js.map +1 -1
- package/lib/commonjs/project-board/MemberAvatars.js +7 -9
- package/lib/commonjs/project-board/MemberAvatars.js.map +1 -1
- package/lib/commonjs/project-board/ProjectBoardBase.js +3 -6
- package/lib/commonjs/project-board/ProjectBoardBase.js.map +1 -1
- package/lib/commonjs/project-board/ProjectBoardCanvas.js +2 -2
- package/lib/commonjs/project-board/ProjectBoardCanvas.js.map +1 -1
- package/lib/commonjs/project-board/styles.js +2 -5
- package/lib/commonjs/project-board/styles.js.map +1 -1
- package/lib/commonjs/radio/RadioSwatch.js +5 -5
- package/lib/commonjs/radio/RadioSwatch.js.map +1 -1
- package/lib/commonjs/rating/Rating.js +7 -7
- package/lib/commonjs/rating/Rating.js.map +1 -1
- package/lib/commonjs/rating/RatingBar.js +8 -8
- package/lib/commonjs/rating/RatingBar.js.map +1 -1
- package/lib/commonjs/rating/RatingBar.web.js +5 -5
- package/lib/commonjs/rating/RatingBar.web.js.map +1 -1
- package/lib/commonjs/rating/RatingInput.js +9 -9
- package/lib/commonjs/rating/RatingInput.js.map +1 -1
- package/lib/commonjs/rating/RatingSummary.js +6 -6
- package/lib/commonjs/rating/RatingSummary.js.map +1 -1
- package/lib/commonjs/row-actions/RowActions.js +5 -5
- package/lib/commonjs/row-actions/RowActions.js.map +1 -1
- package/lib/commonjs/select/Select.js +5 -5
- package/lib/commonjs/select/Select.js.map +1 -1
- package/lib/commonjs/skeleton/Skeleton.js +22 -30
- package/lib/commonjs/skeleton/Skeleton.js.map +1 -1
- package/lib/commonjs/stat-bar/StatBar.js +41 -43
- package/lib/commonjs/stat-bar/StatBar.js.map +1 -1
- package/lib/commonjs/stay-filters/AvailabilityFilter.js +3 -3
- package/lib/commonjs/stay-filters/AvailabilityFilter.js.map +1 -1
- package/lib/commonjs/stay-filters/CountFilter.js +3 -3
- package/lib/commonjs/stay-filters/CountFilter.js.map +1 -1
- package/lib/commonjs/stay-filters/FilterFooter.js +7 -7
- package/lib/commonjs/stay-filters/FilterFooter.js.map +1 -1
- package/lib/commonjs/stay-filters/FilterSection.js +12 -12
- package/lib/commonjs/stay-filters/FilterSection.js.map +1 -1
- package/lib/commonjs/stay-filters/SwitchFilterRow.js +9 -9
- package/lib/commonjs/stay-filters/SwitchFilterRow.js.map +1 -1
- package/lib/commonjs/stay-search/GuestPicker.js +5 -5
- package/lib/commonjs/stay-search/GuestPicker.js.map +1 -1
- package/lib/commonjs/stepper/Stepper.js +11 -10
- package/lib/commonjs/stepper/Stepper.js.map +1 -1
- package/lib/commonjs/stepper/StepperRow.js +12 -12
- package/lib/commonjs/stepper/StepperRow.js.map +1 -1
- package/lib/commonjs/subscription-plans/SubscriptionPlans.js +10 -10
- package/lib/commonjs/subscription-plans/SubscriptionPlans.js.map +1 -1
- package/lib/commonjs/subscription-plans/SubscriptionPrice.js +5 -5
- package/lib/commonjs/subscription-plans/SubscriptionPrice.js.map +1 -1
- package/lib/commonjs/task-list/TaskList.js +14 -15
- package/lib/commonjs/task-list/TaskList.js.map +1 -1
- package/lib/commonjs/theme/BloomThemeProvider.js +207 -223
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -1
- package/lib/commonjs/theme/build-theme-from-seed.js +1 -1
- package/lib/commonjs/theme/build-theme.js +39 -9
- package/lib/commonjs/theme/build-theme.js.map +1 -1
- package/lib/commonjs/theme/canonical-tokens.js +40 -0
- package/lib/commonjs/theme/canonical-tokens.js.map +1 -0
- package/lib/commonjs/theme/color-policy.js +3 -0
- package/lib/commonjs/theme/color-policy.js.map +1 -1
- package/lib/commonjs/theme/color-scope/resolve-scope.js +48 -5
- package/lib/commonjs/theme/color-scope/resolve-scope.js.map +1 -1
- package/lib/commonjs/theme/color-scope/use-scope.js +1 -5
- package/lib/commonjs/theme/color-scope/use-scope.js.map +1 -1
- package/lib/commonjs/theme/color-tokens.js +32 -10
- package/lib/commonjs/theme/color-tokens.js.map +1 -1
- package/lib/commonjs/theme/color-utils.js +4 -0
- package/lib/commonjs/theme/color-utils.js.map +1 -1
- package/lib/commonjs/theme/default-token-vars.js +92 -0
- package/lib/commonjs/theme/default-token-vars.js.map +1 -0
- package/lib/commonjs/theme/index.js +6 -0
- package/lib/commonjs/theme/index.js.map +1 -1
- package/lib/commonjs/theme/index.web.js +6 -0
- package/lib/commonjs/theme/index.web.js.map +1 -1
- package/lib/commonjs/theme/prepaint-palettes.js +1 -5
- package/lib/commonjs/theme/prepaint-palettes.js.map +1 -1
- package/lib/commonjs/theme/token-registry.js +7 -28
- package/lib/commonjs/theme/token-registry.js.map +1 -1
- package/lib/commonjs/theme/use-theme-paint.js +28 -0
- package/lib/commonjs/theme/use-theme-paint.js.map +1 -1
- package/lib/commonjs/typography/Typography.js +27 -27
- package/lib/commonjs/typography/Typography.js.map +1 -1
- package/lib/commonjs/web-search/WebSearch.js +18 -19
- package/lib/commonjs/web-search/WebSearch.js.map +1 -1
- package/lib/commonjs/wizard/WizardFooterBase.js +10 -10
- package/lib/commonjs/wizard/WizardFooterBase.js.map +1 -1
- package/lib/commonjs/wizard/WizardProgress.js +5 -5
- package/lib/commonjs/wizard/WizardProgress.js.map +1 -1
- package/lib/module/accordion/Accordion.js +12 -12
- package/lib/module/accordion/Accordion.js.map +1 -1
- package/lib/module/accordion/Accordion.web.js +8 -8
- package/lib/module/accordion/Accordion.web.js.map +1 -1
- package/lib/module/agent-creator/AgentCreatorSection.js +8 -10
- package/lib/module/agent-creator/AgentCreatorSection.js.map +1 -1
- package/lib/module/agent-creator/EmotionPicker.js +3 -5
- package/lib/module/agent-creator/EmotionPicker.js.map +1 -1
- package/lib/module/agent-log/AgentLog.js +131 -174
- package/lib/module/agent-log/AgentLog.js.map +1 -1
- package/lib/module/agent-reply/AgentProfile.js +7 -10
- package/lib/module/agent-reply/AgentProfile.js.map +1 -1
- package/lib/module/agent-thinking/AgentThinking.js +8 -7
- package/lib/module/agent-thinking/AgentThinking.js.map +1 -1
- package/lib/module/agent-thinking/ThinkingReasoning.js +8 -8
- package/lib/module/agent-thinking/ThinkingReasoning.js.map +1 -1
- package/lib/module/app-shell/AppShell.js +5 -7
- package/lib/module/app-shell/AppShell.js.map +1 -1
- package/lib/module/app-shell/AppShellEngine.js +73 -29
- package/lib/module/app-shell/AppShellEngine.js.map +1 -1
- package/lib/module/app-shell/AppShellPanelLayout.js +3 -3
- package/lib/module/app-shell/AppShellPanelLayout.js.map +1 -1
- package/lib/module/app-shell/NotificationBell.js +9 -9
- package/lib/module/app-shell/NotificationBell.js.map +1 -1
- package/lib/module/app-shell/PanelReorderHandle.js +4 -6
- package/lib/module/app-shell/PanelReorderHandle.js.map +1 -1
- package/lib/module/avatar-group/AvatarGroupBase.js +7 -7
- package/lib/module/avatar-group/AvatarGroupBase.js.map +1 -1
- package/lib/module/chat-list/ChatSearchResultsBase.js +4 -4
- package/lib/module/chat-list/ChatSearchResultsBase.js.map +1 -1
- package/lib/module/choice-list/ChoiceList.js +5 -5
- package/lib/module/choice-list/ChoiceList.js.map +1 -1
- package/lib/module/color-swatch-picker/ColorSwatchPicker.js +7 -7
- package/lib/module/color-swatch-picker/ColorSwatchPicker.js.map +1 -1
- package/lib/module/connection-dots/ConnectionDots.js +4 -4
- package/lib/module/connection-dots/ConnectionDots.js.map +1 -1
- package/lib/module/connection-dots/ConnectionDots.web.js +4 -4
- package/lib/module/connection-dots/ConnectionDots.web.js.map +1 -1
- package/lib/module/cover-header/CoverHeader.js +3 -3
- package/lib/module/cover-header/CoverHeader.js.map +1 -1
- package/lib/module/data-table/DataTable.js +10 -11
- package/lib/module/data-table/DataTable.js.map +1 -1
- package/lib/module/data-table/DataTableSelect.js +8 -8
- package/lib/module/data-table/DataTableSelect.js.map +1 -1
- package/lib/module/design-tokens/theme.css +1 -0
- package/lib/module/design-tokens/tokens.json +390 -0
- package/lib/module/dialog/DialogContent.js +5 -4
- package/lib/module/dialog/DialogContent.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +6 -5
- package/lib/module/dialog/DialogHeader.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +5 -4
- package/lib/module/dialog/SheetShell.js.map +1 -1
- package/lib/module/expandable-text/ExpandableText.js +3 -3
- package/lib/module/expandable-text/ExpandableText.js.map +1 -1
- package/lib/module/floating/lens/lens-cover.js +51 -0
- package/lib/module/floating/lens/lens-cover.js.map +1 -0
- package/lib/module/floating/lens/native-lens.js.map +1 -1
- package/lib/module/grouped-section/GroupedSection.js +16 -15
- package/lib/module/grouped-section/GroupedSection.js.map +1 -1
- package/lib/module/home-search/BudgetPicker.js +8 -8
- package/lib/module/home-search/BudgetPicker.js.map +1 -1
- package/lib/module/home-search/MoveInPicker.js +7 -7
- package/lib/module/home-search/MoveInPicker.js.map +1 -1
- package/lib/module/icon-circle/IconCircle.js +14 -16
- package/lib/module/icon-circle/IconCircle.js.map +1 -1
- package/lib/module/icons/shared.js +3 -5
- package/lib/module/icons/shared.js.map +1 -1
- package/lib/module/image/BloomImage.js +3 -0
- package/lib/module/image/BloomImage.js.map +1 -1
- package/lib/module/kbd/Kbd.js +8 -8
- package/lib/module/kbd/Kbd.js.map +1 -1
- package/lib/module/layout/ResizeHandle.js +6 -5
- package/lib/module/layout/ResizeHandle.js.map +1 -1
- package/lib/module/link-preview/LinkPreviewCard.js +24 -26
- package/lib/module/link-preview/LinkPreviewCard.js.map +1 -1
- package/lib/module/list/ListBase.js +3 -3
- package/lib/module/list/ListBase.js.map +1 -1
- package/lib/module/list/ListPerson.js +3 -3
- package/lib/module/list/ListPerson.js.map +1 -1
- package/lib/module/listing-editor/ListingPreviewPane.js +30 -30
- package/lib/module/listing-editor/ListingPreviewPane.js.map +1 -1
- package/lib/module/markdown/InlineMarkdown.js +9 -11
- package/lib/module/markdown/InlineMarkdown.js.map +1 -1
- package/lib/module/markdown/MarkdownBlocks.js +35 -43
- package/lib/module/markdown/MarkdownBlocks.js.map +1 -1
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js +6 -9
- package/lib/module/multi-agent-chat/MultiAgentChatBase.js.map +1 -1
- package/lib/module/multi-agent-chat/SelectedAgentPreview.js +9 -11
- package/lib/module/multi-agent-chat/SelectedAgentPreview.js.map +1 -1
- package/lib/module/notifications/NotificationPermissionSheet.js +3 -5
- package/lib/module/notifications/NotificationPermissionSheet.js.map +1 -1
- package/lib/module/notifications/NotificationsScreen.js +21 -27
- package/lib/module/notifications/NotificationsScreen.js.map +1 -1
- package/lib/module/overlay/OverlayInertBoundary.js +33 -12
- package/lib/module/overlay/OverlayInertBoundary.js.map +1 -1
- package/lib/module/page-header/PageHeaderTitleInput.js +20 -20
- package/lib/module/page-header/PageHeaderTitleInput.js.map +1 -1
- package/lib/module/panel-routing/expo-router/StackScene.js +42 -24
- package/lib/module/panel-routing/expo-router/StackScene.js.map +1 -1
- package/lib/module/phone-input/CountryCodeSelect.js +4 -4
- package/lib/module/phone-input/CountryCodeSelect.js.map +1 -1
- package/lib/module/project-board/MemberAvatars.js +7 -9
- package/lib/module/project-board/MemberAvatars.js.map +1 -1
- package/lib/module/project-board/ProjectBoardBase.js +4 -7
- package/lib/module/project-board/ProjectBoardBase.js.map +1 -1
- package/lib/module/project-board/ProjectBoardCanvas.js +2 -2
- package/lib/module/project-board/ProjectBoardCanvas.js.map +1 -1
- package/lib/module/project-board/styles.js +3 -6
- package/lib/module/project-board/styles.js.map +1 -1
- package/lib/module/radio/RadioSwatch.js +5 -5
- package/lib/module/radio/RadioSwatch.js.map +1 -1
- package/lib/module/rating/Rating.js +7 -7
- package/lib/module/rating/Rating.js.map +1 -1
- package/lib/module/rating/RatingBar.js +8 -8
- package/lib/module/rating/RatingBar.js.map +1 -1
- package/lib/module/rating/RatingBar.web.js +5 -5
- package/lib/module/rating/RatingBar.web.js.map +1 -1
- package/lib/module/rating/RatingInput.js +9 -9
- package/lib/module/rating/RatingInput.js.map +1 -1
- package/lib/module/rating/RatingSummary.js +6 -6
- package/lib/module/rating/RatingSummary.js.map +1 -1
- package/lib/module/row-actions/RowActions.js +5 -5
- package/lib/module/row-actions/RowActions.js.map +1 -1
- package/lib/module/select/Select.js +5 -5
- package/lib/module/select/Select.js.map +1 -1
- package/lib/module/skeleton/Skeleton.js +22 -30
- package/lib/module/skeleton/Skeleton.js.map +1 -1
- package/lib/module/stat-bar/StatBar.js +41 -43
- package/lib/module/stat-bar/StatBar.js.map +1 -1
- package/lib/module/stay-filters/AvailabilityFilter.js +3 -3
- package/lib/module/stay-filters/AvailabilityFilter.js.map +1 -1
- package/lib/module/stay-filters/CountFilter.js +3 -3
- package/lib/module/stay-filters/CountFilter.js.map +1 -1
- package/lib/module/stay-filters/FilterFooter.js +7 -7
- package/lib/module/stay-filters/FilterFooter.js.map +1 -1
- package/lib/module/stay-filters/FilterSection.js +12 -12
- package/lib/module/stay-filters/FilterSection.js.map +1 -1
- package/lib/module/stay-filters/SwitchFilterRow.js +9 -9
- package/lib/module/stay-filters/SwitchFilterRow.js.map +1 -1
- package/lib/module/stay-search/GuestPicker.js +5 -5
- package/lib/module/stay-search/GuestPicker.js.map +1 -1
- package/lib/module/stepper/Stepper.js +11 -10
- package/lib/module/stepper/Stepper.js.map +1 -1
- package/lib/module/stepper/StepperRow.js +12 -12
- package/lib/module/stepper/StepperRow.js.map +1 -1
- package/lib/module/subscription-plans/SubscriptionPlans.js +10 -10
- package/lib/module/subscription-plans/SubscriptionPlans.js.map +1 -1
- package/lib/module/subscription-plans/SubscriptionPrice.js +5 -5
- package/lib/module/subscription-plans/SubscriptionPrice.js.map +1 -1
- package/lib/module/task-list/TaskList.js +14 -15
- package/lib/module/task-list/TaskList.js.map +1 -1
- package/lib/module/theme/BloomThemeProvider.js +208 -224
- package/lib/module/theme/BloomThemeProvider.js.map +1 -1
- package/lib/module/theme/build-theme-from-seed.js +1 -1
- package/lib/module/theme/build-theme.js +38 -9
- package/lib/module/theme/build-theme.js.map +1 -1
- package/lib/module/theme/canonical-tokens.js +36 -0
- package/lib/module/theme/canonical-tokens.js.map +1 -0
- package/lib/module/theme/color-policy.js +3 -0
- package/lib/module/theme/color-policy.js.map +1 -1
- package/lib/module/theme/color-scope/resolve-scope.js +46 -5
- package/lib/module/theme/color-scope/resolve-scope.js.map +1 -1
- package/lib/module/theme/color-scope/use-scope.js +2 -6
- package/lib/module/theme/color-scope/use-scope.js.map +1 -1
- package/lib/module/theme/color-tokens.js +30 -8
- package/lib/module/theme/color-tokens.js.map +1 -1
- package/lib/module/theme/color-utils.js +4 -0
- package/lib/module/theme/color-utils.js.map +1 -1
- package/lib/module/theme/default-token-vars.js +88 -0
- package/lib/module/theme/default-token-vars.js.map +1 -0
- package/lib/module/theme/index.js +1 -1
- package/lib/module/theme/index.js.map +1 -1
- package/lib/module/theme/index.web.js +1 -1
- package/lib/module/theme/index.web.js.map +1 -1
- package/lib/module/theme/prepaint-palettes.js +2 -6
- package/lib/module/theme/prepaint-palettes.js.map +1 -1
- package/lib/module/theme/token-registry.js +1 -27
- package/lib/module/theme/token-registry.js.map +1 -1
- package/lib/module/theme/use-theme-paint.js +30 -3
- package/lib/module/theme/use-theme-paint.js.map +1 -1
- package/lib/module/typography/Typography.js +27 -27
- package/lib/module/typography/Typography.js.map +1 -1
- package/lib/module/web-search/WebSearch.js +18 -19
- package/lib/module/web-search/WebSearch.js.map +1 -1
- package/lib/module/wizard/WizardFooterBase.js +10 -10
- package/lib/module/wizard/WizardFooterBase.js.map +1 -1
- package/lib/module/wizard/WizardProgress.js +5 -5
- package/lib/module/wizard/WizardProgress.js.map +1 -1
- package/lib/typescript/commonjs/agent-creator/AgentCreatorSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-log/AgentLog.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-reply/AgentProfile.d.ts.map +1 -1
- package/lib/typescript/commonjs/agent-thinking/AgentThinking.d.ts.map +1 -1
- package/lib/typescript/commonjs/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/commonjs/data-table/DataTable.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogContent.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/floating/lens/lens-cover.d.ts +15 -0
- package/lib/typescript/commonjs/floating/lens/lens-cover.d.ts.map +1 -0
- package/lib/typescript/commonjs/floating/lens/native-lens.d.ts +6 -0
- package/lib/typescript/commonjs/floating/lens/native-lens.d.ts.map +1 -1
- package/lib/typescript/commonjs/grouped-section/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/image/BloomImage.d.ts.map +1 -1
- package/lib/typescript/commonjs/layout/ResizeHandle.d.ts.map +1 -1
- package/lib/typescript/commonjs/list/ListBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/overlay/OverlayInertBoundary.d.ts.map +1 -1
- package/lib/typescript/commonjs/panel-routing/expo-router/StackScene.d.ts +3 -1
- package/lib/typescript/commonjs/panel-routing/expo-router/StackScene.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/ProjectBoardBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/project-board/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/stay-search/GuestPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/commonjs/task-list/TaskList.d.ts +3 -3
- package/lib/typescript/commonjs/task-list/TaskList.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/build-theme.d.ts +9 -0
- package/lib/typescript/commonjs/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/canonical-tokens.d.ts +20 -0
- package/lib/typescript/commonjs/theme/canonical-tokens.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/resolve-scope.d.ts +58 -0
- package/lib/typescript/commonjs/theme/color-scope/resolve-scope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-scope/use-scope.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-tokens.d.ts +5 -2
- package/lib/typescript/commonjs/theme/color-tokens.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/color-utils.d.ts +3 -0
- package/lib/typescript/commonjs/theme/color-utils.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/default-token-vars.d.ts +11 -0
- package/lib/typescript/commonjs/theme/default-token-vars.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +1 -1
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/theme/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/prepaint-palettes.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/token-registry.d.ts +1 -16
- package/lib/typescript/commonjs/theme/token-registry.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme/use-theme-paint.d.ts +11 -0
- package/lib/typescript/commonjs/theme/use-theme-paint.d.ts.map +1 -1
- package/lib/typescript/commonjs/web-search/WebSearch.d.ts +3 -3
- package/lib/typescript/commonjs/web-search/WebSearch.d.ts.map +1 -1
- package/lib/typescript/module/agent-creator/AgentCreatorSection.d.ts.map +1 -1
- package/lib/typescript/module/agent-log/AgentLog.d.ts.map +1 -1
- package/lib/typescript/module/agent-reply/AgentProfile.d.ts.map +1 -1
- package/lib/typescript/module/agent-thinking/AgentThinking.d.ts.map +1 -1
- package/lib/typescript/module/app-shell/AppShellEngine.d.ts.map +1 -1
- package/lib/typescript/module/data-table/DataTable.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogContent.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts.map +1 -1
- package/lib/typescript/module/floating/lens/lens-cover.d.ts +15 -0
- package/lib/typescript/module/floating/lens/lens-cover.d.ts.map +1 -0
- package/lib/typescript/module/floating/lens/native-lens.d.ts +6 -0
- package/lib/typescript/module/floating/lens/native-lens.d.ts.map +1 -1
- package/lib/typescript/module/grouped-section/GroupedSection.d.ts.map +1 -1
- package/lib/typescript/module/image/BloomImage.d.ts.map +1 -1
- package/lib/typescript/module/layout/ResizeHandle.d.ts.map +1 -1
- package/lib/typescript/module/list/ListBase.d.ts.map +1 -1
- package/lib/typescript/module/multi-agent-chat/MultiAgentChatBase.d.ts.map +1 -1
- package/lib/typescript/module/overlay/OverlayInertBoundary.d.ts.map +1 -1
- package/lib/typescript/module/panel-routing/expo-router/StackScene.d.ts +3 -1
- package/lib/typescript/module/panel-routing/expo-router/StackScene.d.ts.map +1 -1
- package/lib/typescript/module/project-board/ProjectBoardBase.d.ts.map +1 -1
- package/lib/typescript/module/project-board/styles.d.ts.map +1 -1
- package/lib/typescript/module/stay-search/GuestPicker.d.ts.map +1 -1
- package/lib/typescript/module/stepper/Stepper.d.ts.map +1 -1
- package/lib/typescript/module/task-list/TaskList.d.ts +3 -3
- package/lib/typescript/module/task-list/TaskList.d.ts.map +1 -1
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -1
- package/lib/typescript/module/theme/build-theme.d.ts +9 -0
- package/lib/typescript/module/theme/build-theme.d.ts.map +1 -1
- package/lib/typescript/module/theme/canonical-tokens.d.ts +20 -0
- package/lib/typescript/module/theme/canonical-tokens.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-policy.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/resolve-scope.d.ts +58 -0
- package/lib/typescript/module/theme/color-scope/resolve-scope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-scope/use-scope.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-tokens.d.ts +5 -2
- package/lib/typescript/module/theme/color-tokens.d.ts.map +1 -1
- package/lib/typescript/module/theme/color-utils.d.ts +3 -0
- package/lib/typescript/module/theme/color-utils.d.ts.map +1 -1
- package/lib/typescript/module/theme/default-token-vars.d.ts +11 -0
- package/lib/typescript/module/theme/default-token-vars.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +1 -1
- package/lib/typescript/module/theme/index.d.ts.map +1 -1
- package/lib/typescript/module/theme/index.web.d.ts +1 -1
- package/lib/typescript/module/theme/index.web.d.ts.map +1 -1
- package/lib/typescript/module/theme/prepaint-palettes.d.ts.map +1 -1
- package/lib/typescript/module/theme/token-registry.d.ts +1 -16
- package/lib/typescript/module/theme/token-registry.d.ts.map +1 -1
- package/lib/typescript/module/theme/use-theme-paint.d.ts +11 -0
- package/lib/typescript/module/theme/use-theme-paint.d.ts.map +1 -1
- package/lib/typescript/module/web-search/WebSearch.d.ts +3 -3
- package/lib/typescript/module/web-search/WebSearch.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/accordion/Accordion.tsx +6 -6
- package/src/accordion/Accordion.web.tsx +6 -6
- package/src/agent-creator/AgentCreatorSection.tsx +4 -6
- package/src/agent-creator/EmotionPicker.tsx +3 -3
- package/src/agent-log/AgentLog.tsx +8 -21
- package/src/agent-reply/AgentProfile.tsx +4 -5
- package/src/agent-thinking/AgentThinking.tsx +4 -3
- package/src/agent-thinking/ThinkingReasoning.tsx +4 -4
- package/src/app-shell/AppShell.tsx +3 -3
- package/src/app-shell/AppShellEngine.tsx +67 -19
- package/src/app-shell/AppShellPanelLayout.tsx +3 -3
- package/src/app-shell/NotificationBell.tsx +6 -6
- package/src/app-shell/PanelReorderHandle.tsx +4 -4
- package/src/avatar-group/AvatarGroupBase.tsx +6 -6
- package/src/chat-list/ChatSearchResultsBase.tsx +4 -4
- package/src/choice-list/ChoiceList.tsx +3 -3
- package/src/color-swatch-picker/ColorSwatchPicker.tsx +4 -4
- package/src/connection-dots/ConnectionDots.tsx +4 -4
- package/src/connection-dots/ConnectionDots.web.tsx +4 -4
- package/src/cover-header/CoverHeader.tsx +3 -3
- package/src/data-table/DataTable.tsx +8 -10
- package/src/data-table/DataTableSelect.tsx +4 -4
- package/src/design-tokens/theme.css +1 -0
- package/src/design-tokens/tokens.json +390 -0
- package/src/dialog/DialogContent.tsx +3 -2
- package/src/dialog/DialogHeader.tsx +6 -5
- package/src/dialog/SheetShell.tsx +3 -2
- package/src/expandable-text/ExpandableText.tsx +3 -3
- package/src/floating/lens/lens-cover.tsx +29 -0
- package/src/floating/lens/native-lens.ts +2 -0
- package/src/grouped-section/GroupedSection.tsx +7 -6
- package/src/home-search/BudgetPicker.tsx +4 -4
- package/src/home-search/MoveInPicker.tsx +3 -3
- package/src/icon-circle/IconCircle.tsx +5 -5
- package/src/icons/shared.tsx +3 -3
- package/src/image/BloomImage.tsx +3 -0
- package/src/kbd/Kbd.tsx +4 -4
- package/src/layout/ResizeHandle.tsx +7 -5
- package/src/link-preview/LinkPreviewCard.tsx +7 -7
- package/src/list/ListBase.tsx +3 -6
- package/src/list/ListPerson.tsx +3 -3
- package/src/listing-editor/ListingPreviewPane.tsx +13 -13
- package/src/markdown/InlineMarkdown.tsx +3 -3
- package/src/markdown/MarkdownBlocks.tsx +14 -14
- package/src/multi-agent-chat/MultiAgentChatBase.tsx +6 -9
- package/src/multi-agent-chat/SelectedAgentPreview.tsx +4 -4
- package/src/notifications/NotificationPermissionSheet.tsx +3 -3
- package/src/notifications/NotificationsScreen.tsx +9 -9
- package/src/overlay/OverlayInertBoundary.tsx +10 -1
- package/src/page-header/PageHeaderTitleInput.tsx +4 -4
- package/src/panel-routing/expo-router/StackScene.tsx +7 -2
- package/src/phone-input/CountryCodeSelect.tsx +4 -4
- package/src/project-board/MemberAvatars.tsx +3 -3
- package/src/project-board/ProjectBoardBase.tsx +4 -5
- package/src/project-board/ProjectBoardCanvas.tsx +2 -2
- package/src/project-board/styles.ts +3 -4
- package/src/radio/RadioSwatch.tsx +3 -3
- package/src/rating/Rating.tsx +5 -5
- package/src/rating/RatingBar.tsx +4 -4
- package/src/rating/RatingBar.web.tsx +3 -3
- package/src/rating/RatingInput.tsx +5 -5
- package/src/rating/RatingSummary.tsx +4 -4
- package/src/row-actions/RowActions.tsx +3 -3
- package/src/select/Select.tsx +3 -3
- package/src/skeleton/Skeleton.tsx +9 -9
- package/src/stat-bar/StatBar.tsx +14 -14
- package/src/stay-filters/AvailabilityFilter.tsx +3 -3
- package/src/stay-filters/CountFilter.tsx +3 -3
- package/src/stay-filters/FilterFooter.tsx +4 -4
- package/src/stay-filters/FilterSection.tsx +5 -5
- package/src/stay-filters/SwitchFilterRow.tsx +4 -4
- package/src/stay-search/GuestPicker.tsx +3 -6
- package/src/stepper/Stepper.tsx +6 -5
- package/src/stepper/StepperRow.tsx +5 -5
- package/src/subscription-plans/SubscriptionPlans.tsx +6 -6
- package/src/subscription-plans/SubscriptionPrice.tsx +3 -3
- package/src/task-list/TaskList.tsx +14 -16
- package/src/theme/BloomThemeProvider.tsx +33 -33
- package/src/theme/__tests__/__fixtures__/golden-resolved-tokens.json +134 -0
- package/src/theme/build-theme-from-seed.ts +1 -1
- package/src/theme/build-theme.ts +52 -11
- package/src/theme/canonical-tokens.ts +108 -0
- package/src/theme/color-policy.ts +3 -0
- package/src/theme/color-scope/resolve-scope.ts +47 -8
- package/src/theme/color-scope/use-scope.ts +2 -6
- package/src/theme/color-tokens.ts +7 -7
- package/src/theme/color-utils.ts +4 -0
- package/src/theme/default-token-vars.ts +86 -0
- package/src/theme/index.ts +1 -1
- package/src/theme/index.web.ts +1 -1
- package/src/theme/prepaint-palettes.ts +2 -3
- package/src/theme/token-registry.ts +1 -101
- package/src/theme/use-theme-paint.ts +26 -3
- package/src/typography/Typography.tsx +12 -12
- package/src/web-search/WebSearch.tsx +16 -18
- package/src/wizard/WizardFooterBase.tsx +5 -5
- package/src/wizard/WizardProgress.tsx +5 -5
package/docs/bloom-language.mdx
CHANGED
|
@@ -9,7 +9,7 @@ Bloom's UI language is a way to write Bloom interfaces in TypeScript the way
|
|
|
9
9
|
SwiftUI writes them in Swift: a component is a function, and its look is a chain
|
|
10
10
|
of modifiers applied in order. Every modifier value is a Bloom token, never a
|
|
11
11
|
pixel or a colour; only geometry the view computes as it renders (a size, a
|
|
12
|
-
pinned edge, a stacking order) is a number of points (see
|
|
12
|
+
pinned edge, a stacking order, an offset) is a number of points (see
|
|
13
13
|
[Styles computed at runtime](#styles-computed-at-runtime)). The package is `packages/bloom-language`
|
|
14
14
|
(`@oxy.so/bloom-language`, published from 1.0.0 beside Bloom 23):
|
|
15
15
|
|
|
@@ -128,13 +128,16 @@ HStack(Badge({ label: 'New' }), …)
|
|
|
128
128
|
- **One fiber.** The component is React's own `memo` of the body's host, with
|
|
129
129
|
no comparator: props compare key by key, `Object.is` each, and the body
|
|
130
130
|
re-runs only when one changes.
|
|
131
|
-
- **One theme read.** The body is a tree of its own: it reads
|
|
132
|
-
where it starts,
|
|
133
|
-
[Rendering](#rendering)), so a
|
|
134
|
-
component that reads the
|
|
131
|
+
- **One theme read, when it paints.** The body is a tree of its own: it reads
|
|
132
|
+
the theme once, where it starts, when a node of it paints from the theme, and
|
|
133
|
+
every node it draws paints from that read (see [Rendering](#rendering)), so a
|
|
134
|
+
theme switch re-runs it once, as it does a JSX component that reads the
|
|
135
|
+
theme. A body that paints nothing from the theme reads none.
|
|
135
136
|
- **The environment** (text traits set above the view) arrives through a
|
|
136
|
-
context that is provided only where an environment modifier changed it
|
|
137
|
-
|
|
137
|
+
context that is provided only where an environment modifier changed it, and
|
|
138
|
+
is read only when the body takes from it (see
|
|
139
|
+
[What a root costs](#interop)). A view under an unchanged environment adds no
|
|
140
|
+
provider.
|
|
138
141
|
|
|
139
142
|
A view node takes the universal modifiers. Environment modifiers flow into its
|
|
140
143
|
body, and box modifiers wrap it.
|
|
@@ -238,20 +241,22 @@ Measured on Mention (the codemod at this commit, `style` kept 222 elements):
|
|
|
238
241
|
| A static value off Tailwind's scale: an `rgba()` scrim, a radius of half a fixed side, an app constant (`HPAD`), a font size and its line | 36 | Tokens: an app colour, `'full'`, a numeric token; the codemod's to read |
|
|
239
242
|
| A theme colour read at render: `useColorTokens()`, `theme.colors.*` in a list or chosen by state, `withAlpha(…)`, a hook that builds the app's ink styles | 73 | A role, chosen at render where the state chooses it: `.background(active ? 'primary' : 'card')`, `'primary/10'` for `withAlpha(primary, 0.1)` |
|
|
240
243
|
| A style a caller hands in (`style`, `style?.handle`, `rowStyle`, a spread of props) | 26 | Modifiers, not a style object: the caller chains them on the view it places; a part inside takes a `ViewModifier` |
|
|
241
|
-
| Geometry computed at render: a size from props or a measurement, a pinned edge, a stacking order, a playback fraction | 20 | Points: `.frame({ width: itemSize })`, `.position({ left })`, `.zIndex(count - index)`; a fraction that moves with playback is a `MotionValue` or Bloom's progress |
|
|
244
|
+
| Geometry computed at render: a size from props or a measurement, a pinned edge, a stacking order, a nudge, a media's own aspect ratio, a playback fraction | 20 | Points: `.frame({ width: itemSize })`, `.position({ left })`, `.zIndex(count - index)`, `.offset({ y: nudge })`; a ratio is a number, `.aspectRatio(media.aspect)`; a fraction that moves with playback is a `MotionValue` or Bloom's progress |
|
|
242
245
|
| Safe-area and bar insets | 11 | `.safeAreaPadding()` for a padding; points for a pinned edge (`.position({ top: insets.top + 8 })`) |
|
|
243
246
|
| Spacing computed at render (an indent times a depth, an offset of the header's rows) | 7 | Stays JSX: spacing is a token, chosen at render (`compact ? 'none' : 'md'`), never arithmetic |
|
|
244
247
|
| A colour from data (an artwork's accent, a severity's hex) | 4 | A closed set is an app colour table indexed at render (`.background(severity.color[level])`); an open one (an artwork's accent) stays JSX |
|
|
245
248
|
| A style of the press state (`({ pressed }) => …`) | 1 | `.when('pressed', (v) => …)` |
|
|
246
249
|
|
|
247
|
-
No element among them animates a style
|
|
248
|
-
|
|
249
|
-
|
|
250
|
+
No element among them animates a style: Mention's moving views are the
|
|
251
|
+
engine's already (`MotionValue`, see [Animations](#animations)). A view drawn
|
|
252
|
+
shifted by an amount its props give (a name size's nudge) is an offset of
|
|
253
|
+
points, below.
|
|
250
254
|
|
|
251
255
|
**Points: geometry takes numbers computed at render.** SwiftUI's `.frame`,
|
|
252
|
-
`.position` and `.zIndex` take any `CGFloat` and `Double`; so do the
|
|
253
|
-
language's, for geometry alone: a frame's six lengths, a pinned view's edges
|
|
254
|
-
and its stacking order take a number of points (`Points`) besides
|
|
256
|
+
`.position`, `.offset` and `.zIndex` take any `CGFloat` and `Double`; so do the
|
|
257
|
+
language's, for geometry alone: a frame's six lengths, a pinned view's edges,
|
|
258
|
+
its offset and its stacking order take a number of points (`Points`) besides
|
|
259
|
+
their tokens.
|
|
255
260
|
|
|
256
261
|
```ts
|
|
257
262
|
const Cell = view(function Cell({ item, size }: { item: Media; size: number }) {
|
|
@@ -259,6 +264,8 @@ const Cell = view(function Cell({ item, size }: { item: Media; size: number }) {
|
|
|
259
264
|
});
|
|
260
265
|
CheckoutBadge().position({ top: insets.top + 8, right: 'lg' })
|
|
261
266
|
Avatar(actor.avatar).zIndex(shown.length - index)
|
|
267
|
+
AccountBadge({ kind }).offset({ y: NAME_SIZES[size].nudge })
|
|
268
|
+
Embed(<iframe src={url} />).frame({ width: 'full' }).aspectRatio(getPlayerAspect(provider))
|
|
262
269
|
```
|
|
263
270
|
|
|
264
271
|
- **Only what the view computes.** A number written out is a token: `.frame({
|
|
@@ -278,9 +285,12 @@ Avatar(actor.avatar).zIndex(shown.length - index)
|
|
|
278
285
|
in state is still that: the language draws it, but a `Grid`, a fraction of
|
|
279
286
|
the parent (`'1/3'`) or `.aspectRatio()` says the layout without a second
|
|
280
287
|
pass, and is the form for new screens.
|
|
281
|
-
- **
|
|
282
|
-
|
|
283
|
-
|
|
288
|
+
- **A ratio is a number.** `.aspectRatio()` is no token: a ratio written out
|
|
289
|
+
(`16 / 9`) and a media's own one computed at render (`media.width /
|
|
290
|
+
media.height`) are both numbers, React Native's `aspectRatio` as it is.
|
|
291
|
+
- **The spec.** `points.params` names them (`frame`, `edges`, `zIndex`,
|
|
292
|
+
`padding`, `offset`); the compiler holds every other parameter to tokens and
|
|
293
|
+
rejects a number written out anywhere, with the token to write.
|
|
284
294
|
|
|
285
295
|
**A style a caller hands in is modifiers.** In SwiftUI a caller modifies the
|
|
286
296
|
view it places, and a view never takes a style object. So it is here:
|
|
@@ -304,11 +314,22 @@ condition between two is the condition between two roles, the modifier the
|
|
|
304
314
|
same: `.border(isActive ? 'primary' : 'border', 'thin')`. Bloom's
|
|
305
315
|
`withAlpha(colors.primary, 0.1)` is `'primary/10'`. An app's own palette chosen
|
|
306
316
|
by a key is an app colour table (`defineTokens({ color: { low: '#64748b',
|
|
307
|
-
high: '#ef4444' } })` as `severity`, `.foreground(severity.color[level])`).
|
|
317
|
+
high: '#ef4444' } })` as `severity`, `.foreground(severity.color[level])`). An
|
|
318
|
+
app colour at an opacity is the token's own, as a role's is (`'primary/20'`):
|
|
319
|
+
`severity.color[level].opacity('12.5')` is the hex with its alpha in 8 bits
|
|
320
|
+
(`#64748b20`), an `rgb()` an `rgba()`, so a table keeps one colour per entry.
|
|
321
|
+
The opacities `'12.5'` and `'31.4'` are the hex alphas `20` and `50` (32 and 80
|
|
322
|
+
of 255) apps write after a hex.
|
|
308
323
|
|
|
309
324
|
**Insets.** `.safeAreaPadding()` pads by the device's insets (see
|
|
310
|
-
[Layout](#layout))
|
|
311
|
-
|
|
325
|
+
[Layout](#layout)), `.safeAreaPadding(edge, 'content')` by the content's
|
|
326
|
+
(`useContentSafeAreaInsets()`); a view pinned below the inset is pinned by
|
|
327
|
+
points, `.position({ top: insets.top + 8 })`.
|
|
328
|
+
|
|
329
|
+
**Spacing computed at render.** A padding the view works out as it renders is
|
|
330
|
+
points, the same rule as geometry: a thread's indent times its depth
|
|
331
|
+
(`.padding('leading', depth * 12)`), a measured bar and a gap (`.padding('bottom',
|
|
332
|
+
barHeight + 20)`). A number written out is still a token (`'44'`).
|
|
312
333
|
|
|
313
334
|
## Rendering
|
|
314
335
|
|
|
@@ -341,8 +362,9 @@ high: '#ef4444' } })` as `severity`, `.foreground(severity.color[level])`).
|
|
|
341
362
|
and colour *roles*, and one cache serves every theme. Each role is painted where
|
|
342
363
|
it is cheapest:
|
|
343
364
|
|
|
344
|
-
- **One theme read per tree.** A tree reads the theme once, where it starts
|
|
345
|
-
|
|
365
|
+
- **One theme read per tree.** A tree reads the theme once, where it starts,
|
|
366
|
+
when a node of it paints from the theme: a `toElement` root (beside the
|
|
367
|
+
environment), a `view()` body, and the content of
|
|
346
368
|
a Bloom component that re-themes what it holds (a dialog's, an immersive
|
|
347
369
|
player's slot), which is a tree of its own. Every node of it paints from that
|
|
348
370
|
read where it is drawn: its host takes the palette's colours (built once per
|
|
@@ -408,9 +430,9 @@ of its own it draws the platform face.
|
|
|
408
430
|
**Colours.** A role is a theme colour on native and its canonical CSS
|
|
409
431
|
variable on the web. `mutedFill` is `--muted` (the subtle fill of `bg-muted`;
|
|
410
432
|
`muted` stays the quiet ink, `--muted-foreground`), `textTertiary` is Bloom's
|
|
411
|
-
`ThemeColors.textTertiary` (on the web `--
|
|
412
|
-
|
|
413
|
-
its colours, so it is not `muted` there), `card` is `--card`,
|
|
433
|
+
`ThemeColors.textTertiary` (on the web `--faint-foreground`, which every preset
|
|
434
|
+
holds at `--muted-foreground`'s colour; on Android and iOS the system's tertiary
|
|
435
|
+
label where Bloom adapts its colours, so it is not `muted` there), `card` is `--card`,
|
|
414
436
|
`destructive` is `--destructive` (Bloom's `ThemeColors.destructive`, which
|
|
415
437
|
the engine's error role fills; `error` is the policy's status colour),
|
|
416
438
|
`primaryText` is `--primary-text`, `errorText` `--error-text`, `onSurface`
|
|
@@ -494,48 +516,53 @@ The vocabulary is closed. Every value is a name from the spec, whose every rung
|
|
|
494
516
|
|
|
495
517
|
| Modifier | Values |
|
|
496
518
|
| --- | --- |
|
|
497
|
-
| `padding(edge?, v)` | space: `none` `2xs` `xs` `sm` `md` `lg` `xl` `2xl`…`5xl`, or a numeric token (`'1'` `'6'` `'10'` `'14'` `'28'` `'44'` `'56'` `'96'`…); `-lg`, `-6` and the like pull outward (a margin) |
|
|
498
|
-
| `safeAreaPadding(edge?)` | the device's safe-area insets (`react-native-safe-area-context`) as padding on those sides: `all` (the default), `top`, `bottom`, `horizontal`, `vertical`, `left`, `right` (physical: the insets are the device's); on the view itself, a top or bottom inset added to the view's own padding there (see [Layout](#layout)) |
|
|
519
|
+
| `padding(edge?, v)` | space: `none` `2xs` `xs` `sm` `md` `lg` `xl` `2xl`…`5xl`, or a numeric token (`'1'` `'6'` `'10'` `'14'` `'28'` `'44'` `'56'` `'96'`…); `-lg`, `-6` and the like pull outward (a margin); or points computed at render (`depth * 12`) |
|
|
520
|
+
| `safeAreaPadding(edge?, source?)` | the device's safe-area insets (`react-native-safe-area-context`), or with `'content'` the content's (what the frame around the view left of them, Bloom's `useContentSafeAreaInsets()`), as padding on those sides: `all` (the default), `top`, `bottom`, `horizontal`, `vertical`, `left`, `right` (physical: the insets are the device's); on the view itself, a top or bottom inset added to the view's own padding there (see [Layout](#layout)) |
|
|
499
521
|
| `spacing(v)` | space: the gap between a stack's children |
|
|
500
522
|
| `horizontalSpacing(v)`, `verticalSpacing(v)` | space: the gap along one axis only, over `spacing`'s: between children side by side (`columnGap`, `gap-x-*`) or one above another and between wrapped lines (`rowGap`, `gap-y-*`) |
|
|
501
523
|
| `childSpacing(axis, v)` | Tailwind's `space-x-*`/`space-y-*` as NativeWind draws them: on the web Tailwind's own rule, a margin after each child but the last along the axis (inline end, or block end); on Android and iOS nothing, as NativeWind writes no rule for a child selector. Not a gap; new screens use `spacing()` |
|
|
502
524
|
| `justify(j)`, `wrap()`, `axis(a)` | a stack's distribution: `start` `center` `end` `between` `around` `evenly`; lines that wrap; `horizontal` or `vertical` over its constructor's (see [Layout](#layout)) |
|
|
503
525
|
| `frame({ width, height, min…, max… })` | space, or a length of the parent: `full`, `1/2` `1/3` `2/3` `1/4` `3/4` `1/5` `2/5` `3/5`, and the percentages apps write that no fraction holds, named by their value (`90%`, `31%`), or points computed at render (`{ width: itemSize }`; see [Styles computed at runtime](#styles-computed-at-runtime)) |
|
|
504
526
|
| `frame({ width: 'fit' })` | as wide (or tall) as its content: `fit-content` (`w-fit`) |
|
|
505
|
-
| `
|
|
506
|
-
| `
|
|
527
|
+
| `frame({ width: 'auto' })` | the view's own size, React Native's and the web's `auto` (`w-auto`, `h-auto`): what a view draws with no length, and what takes back a Bloom component's own length for its content's (a `Field`, full width by default, as wide as its content beside `.grow()`). A width's or a height's, not a minimum's or a maximum's |
|
|
528
|
+
| `aspectRatio(r)` | the view's width to its height (`1`, `1.6`, or a ratio computed at render: `media.aspect`), React Native's `aspectRatio`, in its frame's view: the frame's width or height (or the view's stretch) sets the other side. Any view, a pressable one included; an `Image`'s sizes the image in its box |
|
|
529
|
+
| `grow()`, `shrink(p)`, `basis(l)` | `never` `normal` `first` (0, 1, 10), or a rank named by its value (`'20'`); a frame length, its `flex-basis` |
|
|
507
530
|
| `flex(f)` | Tailwind's flex utility, exactly as NativeWind writes it: `'1'` (`flex-1`: grow 1, shrink 1, basis 0%), `auto`, `initial`, `none`, `grow` (`flex-grow: 1` alone). `grow()` stays React Native's `flex: 1` |
|
|
508
531
|
| `margin(edge?, v)` | space (negatives included), or `auto` (the free space on that side: `.margin('leading', 'auto')` is `ms-auto`), on the view itself: no view around it |
|
|
509
532
|
| `clipped(on?)` | clips what the view draws to its bounds and its corner; `clipped(false)` draws what overflows it, React Native's `overflow: 'visible'` written out (NativeWind's `overflow-visible`), over a clip the view would otherwise have |
|
|
510
533
|
| `align(a)`, `alignSelf(a)` | `start` `center` `end` `stretch` `baseline` (a stack's children; the view's own place) |
|
|
511
|
-
| `position({ top, bottom, leading, trailing, left, right })`, `offset({ x, y })` | space, negatives included (see [Layout](#layout)); a position's edge also a percentage of the parent (`'25%'`, the spec's `insetPercent`) and points computed at render (`{ top: insets.top + 8 }`) |
|
|
512
|
-
| `
|
|
534
|
+
| `position({ top, bottom, leading, trailing, left, right, horizontal, vertical })`, `offset({ x, y })` | space, negatives included (see [Layout](#layout)); a position's edge also a percentage of the parent (`'25%'`, `'100%'`: pinned above its parent with `bottom`, the spec's `insetPercent`) and points computed at render (`{ top: insets.top + 8 }`), an offset's axis points computed at render too (`{ y: nudge }`, React Native's `translateY`). `horizontal` is both inline edges at once (React Native's `insetInline`), `vertical` both block edges (`insetBlock`); `.position({})` is a view taken out of the flow where it would sit, pinned by no edge (`position: 'absolute'` alone) |
|
|
535
|
+
| `sticky(edge?)` | the web's `position: sticky` at `top` (the default) or `bottom`: held at its scroll container's edge once scrolled to it. React Native has no sticky position, so native draws the view in place; a list's or a scroll's sticky rows are `.stickyIndices()` |
|
|
536
|
+
| `cursor(c)` | the pointer's shape over the view on the web (CSS's `cursor`): `auto` `default` `pointer` `grab` `grabbing` `text` `move` `not-allowed`; native has none, as NativeWind's `cursor-*` writes nothing there |
|
|
537
|
+
| `zIndex(z)`, `hidden(on?)` | Bloom's `Z_INDEX`: `base` `raised` `floating` `dropdown`, or Tailwind's `'20'` `'30'` `'50'`, or an exact level (`'-1'` `'2'`…`'7'` `'60'` `'1000'`), or `auto` (Tailwind's `z-auto` as NativeWind writes it: `z-index: auto` on the web, nothing on native), or an order computed at render (`count - index`); out of the layout |
|
|
513
538
|
| `scale(s)` | drawn scaled about its anchor (its centre unless `anchor` says otherwise): Bloom's `dip` 0.7, `pressed` 0.98, `full`, `swell` 1.2, or a percent (`'95'` `'105'`…) |
|
|
514
539
|
| `anchor(a)` | the point the view scales and rotates about (SwiftUI's `anchor:`, Tailwind's `origin-*`): `center` `top` `bottom` `leading` `trailing` `top-leading` `top-trailing` `bottom-leading` `bottom-trailing`; leading and trailing are left and right, as an offset's x |
|
|
515
540
|
| `allowsHitTesting(on)`, `accessibilityOnly()` | `false`: touches pass through it and everything in it; `'children'`: only what is inside it takes them, `'self'`: only the view; read by a screen reader and not drawn (`sr-only`) |
|
|
516
541
|
| `overlay(view, alignment?)`, `background(view, alignment?)` | a view over or under this one, at `center` `top` `bottom` `leading` `trailing` `top-leading` … `bottom-trailing` |
|
|
517
542
|
| `shadow(s)`, `ring(c, width?, offset?)` | Bloom's elevation `s` `m` `floating`, or one of Tailwind's shadows by its exact box-shadow; a colour role (or a role at an opacity, or `none`) as an outline, `thin` `thick` or `'3'` wide |
|
|
518
543
|
| `when(condition, (v) => v…)` | a variant: `sm` `md` `lg` `xl` `2xl`, `dark`, `hovered` `focused` `pressed` `disabled`, `web` `native` `ios` `android`, or the app's own boolean (see [Variants](#variants)) |
|
|
519
|
-
| `font(f)` | a Bloom type-ramp step (`body`, `headline`, `caption-1`…: size, line height and tracking, as `Text variant`) or a size rung (`sm` 13, `md` 15…), a numeric size (`'9'` `'11'` `'12.5'` `'14'` `'16'` `'18'` `'24'` `'28'` `'30'` `'36'` `'42'` `'96'`), or a face beside the size: `mono` (Bloom's monospaced face) or `display` (the face of Bloom's big ramp steps, for a numeric size: `.font('96').font('display')`) |
|
|
544
|
+
| `font(f)` | a Bloom type-ramp step (`body`, `headline`, `caption-1`…: size, line height and tracking, as `Text variant`) or a size rung (`sm` 13, `md` 15…), a numeric size (`'9'` `'11'` `'12.5'` `'14'` `'16'` `'18'` `'24'` `'28'` `'30'` `'36'` `'42'` `'96'`), or a face beside the size: `mono` (Bloom's monospaced face), `system-mono` (the platform's own monospaced face, React Native's generic `monospace`) or `display` (the face of Bloom's big ramp steps, for a numeric size: `.font('96').font('display')`) |
|
|
520
545
|
| `weight(w)` | `light` `regular` `medium` `semibold` `bold` `extrabold` |
|
|
521
546
|
| `tracking(t)` | `tight` `wide` `wider` `widest` (em of the size); or an exact em (`'-0.02em'` `'-0.01em'` `'0.04em'`) or px (`'-0.5px'` … `'2px'`) |
|
|
522
547
|
| `leading(l)` | Bloom line heights (ratios of the size) `tight` 1.15, `close` 1.25, `snug` 1.3, `easy` 1.375, `normal` 1.5, `relaxed` 1.625; or an exact px height (`'14px'` … `'40px'`, and `'96px'`, Tailwind's `text-8xl` line, a 96pt countdown's) |
|
|
523
548
|
| `foreground(c)`, `background(c)` | colour roles: `foreground` `muted` `primary` `surface` `card` `mutedFill` `border` `error` `destructive` `primaryText` `white` `black`…, or a role at an opacity token (`'muted/70'`); `foreground(undefined)` is no ink of its own (SwiftUI's `foregroundColor(nil)`), so `.foreground(invalid ? 'error' : undefined)` inks the view only when it is invalid |
|
|
524
549
|
| `borderStyle(s)` | the border's line: `solid` (the default), `dashed`, `dotted` (React Native's `borderStyle`), in the border's view |
|
|
525
|
-
| `border(c, width?, edge?)` | colour role (or a role at an opacity); `hairline` (the platform hairline), `thin` or `thick`, or an exact width (`'0.5'`, a fixed half point; `'1.5'` `'2.5'` `'3'` `'4'`) |
|
|
550
|
+
| `border(c, width?, edge?)` | colour role (or a role at an opacity); `hairline` (the platform hairline), `thin` or `thick`, or an exact width (`'0.5'`, a fixed half point; `'1.5'` `'2.5'` `'3'` `'4'`). A colour of `undefined` writes the width alone, as a style with a `borderWidth` and no `borderColor`: the line keeps the platform's default colour (black natively, react-native-web's own on the web), so `.border(subscribed ? 'border' : undefined, 'thin')` is Mention's labelers pill; it reads no theme |
|
|
526
551
|
| edges | `padding`, `margin` and `border` take `leading` and `trailing` (the reading direction's sides) and `left` and `right` (physical, the same right to left) |
|
|
527
552
|
| `corner(r, side?)`, `cornerCurve(c)` | radius rungs, numeric radii (`'6'` `'7'` `'10'` `'14'` `'15'` `'18'` `'22'`), `full` (Bloom's `radius-max`, 9999; an app's 999 is `full` too, since both round any box under 1998pt fully), `infinite` (Tailwind's `rounded-full` as NativeWind writes it: 9007199254740000 on native, `calc(infinity * 1px)` on the web; a Bloom component that takes a radius in points gets `full`), `concentric`; the corners it rounds: `all`, `top` `bottom` `leading` `trailing`, or one (`top-leading`…), which follow the reading direction, or `left` `right` and one (`top-left`…), which do not (Tailwind's `rounded-l`, `rounded-tl`…); `round` `smooth` (see [Material](#material)) |
|
|
528
|
-
| `opacity(o)` | `transparent` 0, `half` 0.5, `opaque` 1; or a percent (`'10'` `'20'` `'30'` `'40'` `'45'` `'60'` `'70'` `'75'` `'80'` `'85'` `'90'`) |
|
|
553
|
+
| `opacity(o)` | `transparent` 0, `half` 0.5, `opaque` 1; or a percent (`'5'` `'10'` `'20'` `'25'` `'30'` `'40'` `'45'` `'60'` `'70'` `'75'` `'80'` `'85'` `'90'`) |
|
|
529
554
|
| `size(s)` | icon rungs, avatar rungs, or Bloom sizes, by node |
|
|
530
555
|
| `style(a)` / `shape(s)` / `tint(t)` | Bloom appearance / `circle` `pill` / Bloom tone |
|
|
531
556
|
| `glass(material?)` | `regular`, `clear`, `.tint(role, 'subtle' \| 'medium' \| 'strong'?)` |
|
|
532
557
|
| `blur()` | Bloom's floating island (`BlurIsland`) |
|
|
533
|
-
| `onPress`, `onLongPress`, `onHover`, `hoverGroup` | handlers. `onPress(undefined)` keeps the pressable host, out of the focus order. |
|
|
558
|
+
| `onPress`, `onLongPress(action, duration?)`, `onHover`, `hoverGroup` | handlers. `onPress(undefined)` keeps the pressable host, out of the focus order. `hoverGroup()` on a view with no press of its own is a plain view with Bloom's marker (`hoverGroupProps`), its press a view inside it. A long press's `duration` is how long it is held (React Native's `delayLongPress`: `'500'`, its own default, `'250'`…, the [duration](bloom-language-tokens.mdx#duration) tokens); a Bloom component that takes a long press of its own (a tab, a nav item, a tree item, a destination) takes no duration |
|
|
559
|
+
| `accessibilityElement(on)`, `focusable(on?)`, `collapsable(on)` | React Native's own: whether the view is one accessibility element (`accessible`; `false` leaves what is inside to be read, its press kept), whether keyboard focus stops at it (`tabIndex` `0` or `-1`, on the web and Android), and `false` keeps its native view from being flattened (`collapsable`, Android). Each is written on the view's outermost host as the JSX writes it |
|
|
560
|
+
| responder props (`onStartShouldSetResponder`, a `PanResponder`'s `panHandlers`) | no modifier: a view that claims or tracks touches by hand stays an `Embed` of its JSX. The language's gestures are `.onPress()`, `.drag()`, `.swipe()`, `.pinch()` and `.onDoubleTap()` |
|
|
534
561
|
| `accessibilityState(s)`, `accessibilityValue(v)`, `liveRegion(r)`, `accessibilityHidden(on?)` | what assistive technology reads: a state (`selected`, `checked` or `'mixed'`, `busy`, `expanded`, `disabled`: React Native's `accessibilityState`); a value, a range (`min`, `max`, `now`) or a text (React Native's `accessibilityValue`; numbers and a text, no tokens); a region whose changes are announced (`polite`, `assertive`, `none`: `accessibilityLiveRegion`); hidden from screen readers with what is inside (see [Layout](#layout)) |
|
|
535
562
|
| `hitSlop(edge?, s)` | how far beyond its bounds a press reaches: Bloom's `sm` `md` `lg`, `none`, or an exact slop (`'4'` `'5'`); with a side first (`top` `bottom` `horizontal` `vertical` `left` `right`, physical as React Native's insets are) only that side, a later one of a side over the earlier. Every side alike is one number (`hitSlop={8}`), sides of their own React Native's insets with the sides named. An `Action`'s is its `EngagementAction`'s (an `Action` takes no `hitSlop` option) |
|
|
536
563
|
| `ref(r)`, `onLayout(f)` | escape hatches, on the view's outermost box (its host, or the Bloom component that draws it): React Native's `ref` (a ref object or a callback, for a visibility tracker, a measurement, a DOM lookup on the web) and `onLayout`. Laying a view out from state its own `onLayout` wrote is discouraged: it draws twice, the second time moved, and can loop; a frame, a grow, an aspect ratio or a `ZStack` says the layout instead |
|
|
537
|
-
| `label`, `hint`, `role`, `testID`, `id` | accessibility and identity. `role` is React Native's `accessibilityRole` of the same name: `button` `link` `header` `image` `text` `none` `checkbox` `radio` `tab` `radiogroup` `tablist` `list` `alert` `progressbar` `imagebutton` `summary` |
|
|
538
|
-
| `lines(n)`, `noWrap()`, `truncation`, `selectable`, `textStyle`, `link`, `textAlign`, `italic`, `underline`, `strikethrough`, `textCase`, `monospacedDigit`, `wordBreak` | text only (see [Text](#text)) |
|
|
564
|
+
| `label`, `hint`, `role`, `testID`, `id` | accessibility and identity. `role` is React Native's `accessibilityRole` of the same name: `button` `link` `header` `image` `text` `none` `checkbox` `radio` `tab` `radiogroup` `tablist` `list` `alert` `progressbar` `imagebutton` `summary`; `option` and `listbox`, which React Native names only as a web role, are its `role` (`listbox` is react-native-web's, outside React Native's types; native has neither) (a `Row`'s `.role('option')` is Bloom Item's `role="option"`, whose `.selected()` is `aria-selected`; an option's or a tab's `.accessibilityState({ selected })` is also a flat `aria-selected` on the web, which react-native-web reads in place of the state) |
|
|
565
|
+
| `lines(n)`, `noWrap()`, `truncation`, `selectable`, `textStyle`, `link`, `textAlign`, `italic`, `underline`, `strikethrough`, `textCase`, `monospacedDigit`, `wordBreak`, `textShadow` | text only (see [Text](#text)) |
|
|
539
566
|
| `listMarker(m)` | a stack only: a web list behind `disc` or `decimal` markers (see [Layout](#layout)) |
|
|
540
567
|
| `contentFit`, `aspectRatio`, `tint`, `crossFade`, `onLoad`, `onError` | `Image` only (see [Image](#image)) |
|
|
541
568
|
| `contentTransition('roll', direction?)` | text only (see [Animations](#animations)) |
|
|
@@ -620,8 +647,10 @@ VStack(...).background('surface').corner('xl').shadow('m')
|
|
|
620
647
|
does not. A left or right inset beside a padding across is a view of its
|
|
621
648
|
own around it (a padding's start and end are logical, the inset physical).
|
|
622
649
|
On a column or row with no press, the safe area is the host itself. The insets are the device's
|
|
623
|
-
physical ones, not what a Bloom header or bar has already taken
|
|
624
|
-
(`useContentSafeAreaInsets()
|
|
650
|
+
physical ones, not what a Bloom header or bar has already taken; `.safeAreaPadding(edge,
|
|
651
|
+
'content')` pads by what is left (`useContentSafeAreaInsets()`, as a screen's body pads
|
|
652
|
+
itself): `paddingTop: insets.top + 60` from it is `.safeAreaPadding('top',
|
|
653
|
+
'content').padding('top', '5xl')`.
|
|
625
654
|
- **Auto margins.** `.margin(edge, 'auto')` takes the free space on that side,
|
|
626
655
|
as React Native's and CSS's `margin: auto` do: `.margin('leading', 'auto')`
|
|
627
656
|
pushes the view to its row's trailing end (Tailwind's `ms-auto`), and
|
|
@@ -663,7 +692,8 @@ VStack(...).background('surface').corner('xl').shadow('m')
|
|
|
663
692
|
`raised` 1, `floating` 10, `dropdown` 40; Tailwind's `z-20`, `z-30` and
|
|
664
693
|
`z-50` are the numeric tokens `'20'`, `'30'`, `'50'`, and the exact levels
|
|
665
694
|
apps write are named by their value: `'-1'` (under its siblings), `'2'` to
|
|
666
|
-
`'7'`, `'60'
|
|
695
|
+
`'7'`, `'60'`, and `'1000'`, a picker raised over a whole screen (Mention's
|
|
696
|
+
mention picker, `z-[1000]`).
|
|
667
697
|
- **Defaults that are no modifier.** Every view is the positioned parent of
|
|
668
698
|
what it pins (`position: relative`, React Native's and react-native-web's
|
|
669
699
|
default) and draws what overflows it (`overflow: visible`, the default of
|
|
@@ -700,7 +730,13 @@ VStack(...).background('surface').corner('xl').shadow('m')
|
|
|
700
730
|
(`box-none`: `pointer-events: none` on the view, `auto` on each child), held
|
|
701
731
|
equal to it by the layout parity, a value chosen at render included;
|
|
702
732
|
react-native-web drops an inline `pointerEvents`, so on the web a Bloom
|
|
703
|
-
component's is a box of its own around it.
|
|
733
|
+
component's is a box of its own around it. React Native's `pointerEvents`
|
|
734
|
+
written in an inline style is a native hit testing: react-native-web writes
|
|
735
|
+
`box-none` and `box-only` there as they are, CSS values the browser drops,
|
|
736
|
+
so the web view takes touches as any view does. Its form is
|
|
737
|
+
`.when('native', (v) => v.allowsHitTesting('children'))`, held equal to the
|
|
738
|
+
inline style by the layout parity; a StyleSheet's style is compiled into
|
|
739
|
+
the prop's classes, and is `.allowsHitTesting()` on every platform.
|
|
704
740
|
- **Drawn, not read.** `.accessibilityHidden()` hides the view and everything
|
|
705
741
|
inside it from screen readers, each platform its own way: on Android and iOS
|
|
706
742
|
`accessibilityElementsHidden` and `importantForAccessibility:
|
|
@@ -802,9 +838,13 @@ inside; a stack's layout to its host; a placement to its outermost box.
|
|
|
802
838
|
condition that holds as the view renders (`web`, `native`, `ios`, `android`,
|
|
803
839
|
`disabled`, a boolean that is `true`), anything else but a box layer, a placement, a press or a name
|
|
804
840
|
is the chain's own, as if chained there (`when('web', (v) => v.monospacedDigit())`
|
|
805
|
-
is Tailwind's `tabular-nums` as NativeWind draws it
|
|
806
|
-
|
|
807
|
-
|
|
841
|
+
is Tailwind's `tabular-nums` as NativeWind draws it; `when('native', (v) =>
|
|
842
|
+
v.accessibilityHidden())` hides a view from native screen readers only, as React
|
|
843
|
+
Native's `accessibilityElementsHidden` and `importantForAccessibility` do). What no
|
|
844
|
+
condition sets is the spec's `variants.held.except`, which the compiler reads too.
|
|
845
|
+
Anything else inside `when()` is left out and said once in development; the
|
|
846
|
+
compiler rejects it (`A variant cannot change .onPress()`), and checks the
|
|
847
|
+
condition and every value.
|
|
808
848
|
- **Geometry varies by component.** A transform is one property, so a view
|
|
809
849
|
whose geometry varies draws it as its outermost box's placement, one value
|
|
810
850
|
per component (translate x, translate y, rotate, scale), and a variant
|
|
@@ -935,6 +975,28 @@ Text('Read the ', Text('terms').link('https://oxy.so/terms'), '.').font('caption
|
|
|
935
975
|
Markdown nests its runs: it writes only what its own chain names (a weight,
|
|
936
976
|
an ink, a link) and inherits the rest, so a span of an `h1` keeps the
|
|
937
977
|
heading's size.
|
|
978
|
+
- **Pressable runs.** A span takes `.onPress()` and `.onLongPress()`, as a
|
|
979
|
+
React Native `Text` nested in a text takes `onPress`: it stays a span of the
|
|
980
|
+
line (no box of its own), a URL that opens on a press or a "Read more"
|
|
981
|
+
(`RawText(body, Text(' Read more').foreground('primary').onPress(expand))`).
|
|
982
|
+
A whole `Text` takes them too, a footer link.
|
|
983
|
+
- **Element runs.** `Embed(element)` is a run like any other, drawn as it is
|
|
984
|
+
inside the line: a router's `Link`, an app's own component. A render
|
|
985
|
+
function hands an element that takes a child (`asChild`) a span: inside a
|
|
986
|
+
text, `render(Text(…))` draws the span's host, so expo-router's `Link
|
|
987
|
+
asChild` gives it its `href`, its role and its press (an anchor on the web),
|
|
988
|
+
and its own props (`hrefAttrs` with `rel: 'nofollow'`) reach the span as
|
|
989
|
+
they reach a JSX child:
|
|
990
|
+
|
|
991
|
+
```tsx
|
|
992
|
+
const mention = (handle: string) =>
|
|
993
|
+
Embed((render) => (
|
|
994
|
+
<Link href={`/@${handle}`} push asChild>
|
|
995
|
+
{render(Text(`@${handle}`).foreground('primary'))}
|
|
996
|
+
</Link>
|
|
997
|
+
));
|
|
998
|
+
RawText('Hi ', mention('bob'), ', see ', Text('oxy.so').foreground('primary').onPress(open))
|
|
999
|
+
```
|
|
938
1000
|
- **Raw text.** `RawText(...runs)` is React Native's own `Text`, not Bloom's:
|
|
939
1001
|
it writes only what its chain names, so a text that names no family draws
|
|
940
1002
|
the platform face (Roboto on Android, San Francisco on iOS,
|
|
@@ -942,7 +1004,10 @@ Text('Read the ', Text('terms').link('https://oxy.so/terms'), '.').font('caption
|
|
|
942
1004
|
codemod writes for a React Native `Text`, so the move changes no pixel: a
|
|
943
1005
|
face the app's bundler gives React Native's `Text` (`@oxy.so/app-preset`'s
|
|
944
1006
|
`baseFont`) reaches `RawText` alike. New screens use `Text`. Inside a `Text`
|
|
945
|
-
it is a span that inherits its parent's face.
|
|
1007
|
+
it is a span that inherits its parent's face. It takes nothing set above it,
|
|
1008
|
+
so a root or a `view()` body over one reads no environment, and the theme
|
|
1009
|
+
only when a role inks it, as React Native's `Text` in a component that reads
|
|
1010
|
+
the theme to ink it.
|
|
946
1011
|
|
|
947
1012
|
- **Digits and breaking.** `.monospacedDigit()` draws digits of one width
|
|
948
1013
|
(`tabular-nums`, React Native's `fontVariant`). `.wordBreak('all')` lets a
|
|
@@ -954,6 +1019,11 @@ Text('Read the ', Text('terms').link('https://oxy.so/terms'), '.').font('caption
|
|
|
954
1019
|
`@oxy.so/bloom/typography`). A family sits beside the size: it keeps the
|
|
955
1020
|
ramp step or size rung the text has, and a later size keeps the face, so
|
|
956
1021
|
`.font('body').font('mono')` is body in mono.
|
|
1022
|
+
- **The platform's mono.** `.font('system-mono')` is the platform's own
|
|
1023
|
+
monospaced face by its generic name (`fontFamily: 'monospace'`, as an app
|
|
1024
|
+
writes it), not Bloom's JetBrains Mono: a slug or an id drawn as the system
|
|
1025
|
+
draws code. `.when('native', (v) => v.font('system-mono'))` keeps the web
|
|
1026
|
+
in the face it inherits.
|
|
957
1027
|
- **Display.** `.font('display')` is the face Bloom's `Text` sets its big
|
|
958
1028
|
ramp steps in (`large-title`, `display-*`, `title-*`: BlomusModernus,
|
|
959
1029
|
`fontFamilyStyle('display')`), for a size off the ramp: Mention's camera
|
|
@@ -970,6 +1040,11 @@ Text('Read the ', Text('terms').link('https://oxy.so/terms'), '.').font('caption
|
|
|
970
1040
|
size: its font's, or with no font the 13px of Bloom's `Text` without a
|
|
971
1041
|
variant (the size itself stays Bloom's, unwritten). Over a ramp step it
|
|
972
1042
|
replaces the step's own tracking.
|
|
1043
|
+
- **Shadow.** `.textShadow(shadow)` draws a shadow under the glyphs, for text
|
|
1044
|
+
over a photo or a video. Each is named by its exact CSS `text-shadow`
|
|
1045
|
+
(`'0 1px 3px rgb(0 0 0 / 0.8)'`, `'0 1px 2px rgb(0 0 0 / 0.8)'`): React
|
|
1046
|
+
Native's `textShadowColor`, `textShadowOffset` and `textShadowRadius` as an
|
|
1047
|
+
app writes them, which react-native-web draws as that `text-shadow`.
|
|
973
1048
|
|
|
974
1049
|
## Icons
|
|
975
1050
|
|
|
@@ -993,6 +1068,12 @@ HStack(Icon(RiRepeat2Line), Text('Reposted')).foreground('muted')
|
|
|
993
1068
|
`primary` when given no fill; a language icon follows the text around it,
|
|
994
1069
|
as SwiftUI's does, so `Icon(X)` alone is `<X fill={colors.text} />`.
|
|
995
1070
|
- **A box** (padding, a fill, a corner, a name) is one `View` around the glyph.
|
|
1071
|
+
A glyph that is only placed (a margin, a flex, a pin) takes its placement as
|
|
1072
|
+
its own style, as the Svg an app writes takes `style={{ marginLeft: 2 }}`,
|
|
1073
|
+
with no view around it.
|
|
1074
|
+
- **`currentColor`** is the glyph's `color` on every platform: react-native-svg
|
|
1075
|
+
and Bloom's native glyph resolve it so (black with none), as CSS does on the
|
|
1076
|
+
web. `<X fill="currentColor" color={c} />` is `Icon(X).foreground(c)`.
|
|
996
1077
|
- Bloom's icon `gradient` prop has no modifier: no app passes one.
|
|
997
1078
|
|
|
998
1079
|
## Material
|
|
@@ -1116,8 +1197,17 @@ ButtonGroup(Button(Text('Day')), Button(Text('Week'))).separated().size('sm')
|
|
|
1116
1197
|
state).
|
|
1117
1198
|
- **Views beside the label.** With a `Text` label, a view before it (that is
|
|
1118
1199
|
no `Icon`) is Bloom's `leading`, one after it its `trailing`, drawn as they
|
|
1119
|
-
are. A
|
|
1120
|
-
|
|
1200
|
+
are. A plain `Icon` child is the button's glyph (`leadingIcon`): Bloom
|
|
1201
|
+
paints it in its ink. A bare glyph as its content, `Button(Group(Icon(X)))`
|
|
1202
|
+
with no ink of its own (a `.size()` at most), is Bloom's render-function
|
|
1203
|
+
children, `(color) => <X fill={color} />`: drawn in the ink Bloom hands it
|
|
1204
|
+
(its tone's, `.foreground()`'s, under the pointer `.hoverForeground()`'s,
|
|
1205
|
+
disabled its muted one) with no glyph box of its own, as a compose
|
|
1206
|
+
toolbar's controls draw theirs (on the web the `leadingIcon` sits in Bloom's
|
|
1207
|
+
20pt glyph box; the render function's glyph does not). A circle or pill whose
|
|
1208
|
+
content is one view (`Button(Group(busy ? Loading().style('inline').size('sm') :
|
|
1209
|
+
Icon(X)))`, a spinner in the glyph's place while it works) is Bloom's icon
|
|
1210
|
+
button too (`iconOnly`), so it keeps its square.
|
|
1121
1211
|
- **Inks and spinner.** `.foreground(role)` is the button's ink at rest
|
|
1122
1212
|
(Bloom's `color`) and `.hoverForeground(role)` under the pointer
|
|
1123
1213
|
(`hoverColor`), each painted from a colour role. `.loadingIndicator(null)`
|
|
@@ -1181,6 +1271,14 @@ rendition of a file id).
|
|
|
1181
1271
|
`.badge(Badge(…))`.
|
|
1182
1272
|
- Presence: `.presence('online' | 'idle' | 'busy' | 'offline')` is Bloom's
|
|
1183
1273
|
`AvatarPresence`, the dot sized from the avatar.
|
|
1274
|
+
- Motion: `.motion('auto' | 'always' | 'never')` is Bloom's `motion`, whether
|
|
1275
|
+
its character moves (an `AvatarGroup`'s, each member's); reduced motion always
|
|
1276
|
+
wins. An app's avatar that forwards every prop to Bloom's is a `view()`
|
|
1277
|
+
returning `Avatar(…)` with its policy's `.motion()`, which its callers chain
|
|
1278
|
+
their modifiers on.
|
|
1279
|
+
- `.cornerRadius(radius)` rounds the avatar's own corners (Bloom's Avatar
|
|
1280
|
+
`style.borderRadius`, a corner token: `'md'` is 12): a rounded square no
|
|
1281
|
+
shape name draws (a list's cover). `.corner()` is a box around it.
|
|
1184
1282
|
- `.label(name)` is its `alt`; `.onPress` its own press.
|
|
1185
1283
|
|
|
1186
1284
|
`AvatarGroup(items)` takes Bloom's `AvatarGroupItem`s: `.layout('stack' |
|
|
@@ -1188,6 +1286,12 @@ rendition of a file id).
|
|
|
1188
1286
|
`.total(n)`, `.spacing(space)` (a row's gap), `.overflow('count' |
|
|
1189
1287
|
'truncate')`, `.initials()` (tinted initials instead of the neutral
|
|
1190
1288
|
placeholder), `.onPressItem(fn)`, `.hoverCard()`, and `.label()` to name it.
|
|
1289
|
+
`.ringColor(color)` is the ring each face is cut out of its neighbours by
|
|
1290
|
+
(Bloom's `ringColor`): a role painted from the theme (`'background'`, the
|
|
1291
|
+
colour behind the group) or an app colour. `.variant(name)` is the rendition
|
|
1292
|
+
the members' images load (`'thumb'` with none). `.itemAction((item, index) =>
|
|
1293
|
+
view)` is Bloom's `renderItemAction`: a view under the member's name in its
|
|
1294
|
+
hover card on the web (a follow button), drawn as a tree of its own.
|
|
1191
1295
|
|
|
1192
1296
|
## Small pieces
|
|
1193
1297
|
|
|
@@ -1199,13 +1303,16 @@ placeholder), `.onPressItem(fn)`, `.hoverCard()`, and `.label()` to name it.
|
|
|
1199
1303
|
attached. `view.badge(Badge(…))` attaches it to any view.
|
|
1200
1304
|
- **`IconCircle(icon)`**: an icon on Bloom's tinted disc; `.size()` an icon rung.
|
|
1201
1305
|
- **`Loading(Text(…)?)`**: `.style('spinner' | 'top' | 'inline')`, `.size()`,
|
|
1202
|
-
`.tint(tone)
|
|
1306
|
+
`.tint(tone)` (or an app's own colour, Bloom's `color` as written: a white
|
|
1307
|
+
spinner over a photo); the `Text` is what it says, `.label()` names it as a progress bar.
|
|
1203
1308
|
Its box modifiers (padding, frame, fill, corner, margin, flex) are its
|
|
1204
1309
|
`style`, as an app writes them.
|
|
1205
1310
|
- **`SpinnerIcon()`**: Bloom's `SpinnerIcon` (`@oxy.so/bloom/loading`), the
|
|
1206
1311
|
loader's morphing glyph alone. `.size()` is its side (an icon rung, a numeric
|
|
1207
|
-
side such as `'18'`, or an app token; Bloom's 26 by default), `.tint(
|
|
1208
|
-
its `color
|
|
1312
|
+
side such as `'18'`, or an app token; Bloom's 26 by default), `.tint(color)`
|
|
1313
|
+
its `color`: a role painted from the theme, or an app colour as written
|
|
1314
|
+
(white over a video, the same in both schemes); its box modifiers are its
|
|
1315
|
+
`style`.
|
|
1209
1316
|
- **`Skeleton(shape)`**: `text`, `circle`, `pill` or `box`. Its frame is its
|
|
1210
1317
|
size (a circle's and a pill's height, a box's width and height), a box's
|
|
1211
1318
|
corner its radius, a text line's height its font's. It takes nothing else
|
|
@@ -1280,8 +1387,8 @@ binding on a node that has no such value.
|
|
|
1280
1387
|
|
|
1281
1388
|
| Node | Bloom | Modifiers |
|
|
1282
1389
|
| --- | --- | --- |
|
|
1283
|
-
| `TextField(text, label)`, `SecureField(text, label)` | `TextFieldInput` in its `TextField` shell (`TextFieldIcon`, `TextFieldPrefix`, `TextFieldSuffix`, `TextFieldGhost`) | `.placeholder` (`null`: none, not even the label Bloom draws in its place otherwise), `.size`, `.disabled` (the shell and its input: what `<TextField disabled>` around a plain input draws too, since the input reads its shell's state), `.invalid`, `.floatingLabel()`, `.revealable()` (secure), `.icon(X)`, `.trailingIcon(X)`, `.prefix(text)`, `.suffix(text)`, `.completion(rest)`, `.focused(binding)`, `.keyboard`, `.autocapitalize`, `.autocorrect`, `.contentType` (autofill), `.submitLabel`, `.onSubmit`, `.autoFocus()`, `.maxLength`, `.multiline()`, `.editable(false)` (shown and selectable, no typing) |
|
|
1284
|
-
| `TextEditor(text, label?)` | `Textarea` | `.placeholder`, `.description` (its hint), `.size`, `.disabled`, `.invalid`, `.required`, `.rows`, `.autoResize(maxRows?)`, `.resize`, `.maxLength`, `.showCount()`, `.focused(binding)`, `.label(name)` (its `accessibilityLabel`, beside the visible `label`), the keyboard modifiers |
|
|
1390
|
+
| `TextField(text, label)`, `SecureField(text, label)` | `TextFieldInput` in its `TextField` shell (`TextFieldIcon`, `TextFieldPrefix`, `TextFieldSuffix`, `TextFieldGhost`) | `.placeholder` (`null`: none, not even the label Bloom draws in its place otherwise), `.size`, `.disabled` (the shell and its input: what `<TextField disabled>` around a plain input draws too, since the input reads its shell's state), `.invalid`, `.floatingLabel()`, `.revealable()` (secure), `.icon(X)`, `.trailingIcon(X)`, `.prefix(text)`, `.suffix(text)`, `.completion(rest)`, `.focused(binding)`, `.keyboard`, `.autocapitalize`, `.autocorrect`, `.contentType` (autofill), `.submitLabel`, `.onSubmit`, `.autoFocus()`, `.maxLength`, `.multiline()`, `.editable(false)` (shown and selectable, no typing), `.inputMode` (the kind of text it takes: React Native's `inputMode`, the web's `inputmode`), `.inputRef(ref)` (its `TextInput`'s ref, to focus it or move its caret; `.ref()` is its box's), `.onSelectionChange(fn)` (React Native's, handed its event) |
|
|
1391
|
+
| `TextEditor(text, label?)` | `Textarea` | `.placeholder`, `.description` (its hint), `.size`, `.disabled`, `.invalid`, `.required`, `.rows`, `.autoResize(maxRows?)`, `.resize`, `.maxLength`, `.showCount()`, `.focused(binding)`, `.label(name)` (its `accessibilityLabel`, beside the visible `label`), the keyboard modifiers, `.inputMode`, `.inputRef(ref)`, `.onSelectionChange(fn)` |
|
|
1285
1392
|
| `Field(label, ...content)` | `Field` | `.description`, `.error`, `.required`, `.disabled`: the label names its control, the error marks it invalid; `.multiple()` for a field of several controls (chips, two inputs), whose label names the group (Bloom's `multiple`) |
|
|
1286
1393
|
| `Label(text)` | `Label` | `.size('xs' \| 'sm' \| 'md')`, `.required`, `.disabled` |
|
|
1287
1394
|
| `Toggle(isOn)` | `Switch` | `.size`, `.tint(tone)`, `.disabled`; `.label()` names it (a switch draws no words) |
|
|
@@ -1291,7 +1398,7 @@ binding on a node that has no such value.
|
|
|
1291
1398
|
| `Picker(selection, ...options)` | `Select`: its trigger (`SelectValue`, `SelectIcon`) and its list (`SelectItem` with its indicator and text) | `.placeholder`, `.size`, `.disabled`, `.presented(isOpen)` (its list open through a binding: Bloom's controlled `open`); `.label()` names it |
|
|
1292
1399
|
| `Option(value, label)` | an option of the three above | `.description` (a radio's), `.disabled`, `.testID`, `.leadingView(...)` (a picker row's mark), `.tint(role)` and `.foreground(role)` (a swatch's colour and its chosen dot) |
|
|
1293
1400
|
| `OptionGroup(label, ...options)` | a picker's `SelectGroup` with its `SelectLabel`, heading its first row | none |
|
|
1294
|
-
| `Search(text)` | `Search` | `.placeholder`, `.size`, `.disabled`, `.collapsible('auto'?)` (a button that opens the field), `.presented(isOpen)`, `.tokens(tokens)` (removing a token writes the binding), `.trigger(Button)`, `.trailing(...)`, `.focused(binding)`, `.submitLabel`, `.onSubmit`, `.onClearText(action)` (the clear button's press: the screen empties its text, and its tokens), `.maxLength(n)` (the most characters it takes), the keyboard modifiers |
|
|
1401
|
+
| `Search(text)` | `Search` | `.placeholder`, `.size`, `.disabled`, `.editable(false)` (shown, taking no typing: React Native's `editable`), `.collapsible('auto'?)` (a button that opens the field), `.presented(isOpen)`, `.tokens(tokens)` (removing a token writes the binding), `.trigger(Button)`, `.trailing(...)`, `.focused(binding)`, `.submitLabel`, `.onSubmit`, `.onClearText(action)` (the clear button's press: the screen empties its text, and its tokens), `.maxLength(n)` (the most characters it takes), the keyboard modifiers, `.inputMode`, `.inputRef(ref)` (the `TextInput` Bloom's Search hands its `ref`), `.onSelectionChange(fn)` (its caret, as a mention or hashtag picker reads it) |
|
|
1295
1402
|
|
|
1296
1403
|
- **The box.** A field's box modifiers (`frame`, `padding`…) are its shell's
|
|
1297
1404
|
style, as an app writes `<TextField style>`; a picker's are its trigger's;
|
|
@@ -1675,7 +1782,7 @@ Bloom's PageHeader. The PageHeader's own props are modifiers of the same
|
|
|
1675
1782
|
name: `.safeArea(on?)`, `.titleAlign('start' | 'center')`, `.accessory(view)`
|
|
1676
1783
|
(full-width chrome under the title row), `.tone('default' | 'onImage')`,
|
|
1677
1784
|
`.scrimColor(role)` (the opaque colour the scrim fades from, painted from the
|
|
1678
|
-
theme), `.scrimFalloff('smooth' | 'linear')` and `.titleReveal('auto' |
|
|
1785
|
+
theme, or an app's own colour as written, the same in both schemes), `.scrimFalloff('smooth' | 'linear')` and `.titleReveal('auto' |
|
|
1679
1786
|
'always' | 'onScroll' | 'onDock')`. The system bar has none of them: a header
|
|
1680
1787
|
that needs them on iOS in a native stack is `.inPage()`.
|
|
1681
1788
|
|
|
@@ -1854,6 +1961,7 @@ toast.success('Saved')
|
|
|
1854
1961
|
| `.alert(isPresented, Alert(title))` | Bloom `AlertDialog` beside the view (`open`, `onOpenChange`) |
|
|
1855
1962
|
| `.dialog(isPresented, Dialog(...content))` | Bloom `Dialog` beside the view (`open`, `onClose`), its content the children |
|
|
1856
1963
|
| `Dialog(...content).presented(isPresented)` | the same Bloom `Dialog`, as a view of its own in place |
|
|
1964
|
+
| `Dialog(...content).control(control)` | the same, opened and closed by Bloom's dialog control (`useDialogControl()`: `control.open()`, `control.close()`), for a dialog another view opens (a FAB): Bloom's `control` |
|
|
1857
1965
|
| `.popover(isPresented, Popover(...content))` | Bloom `Popover`: the view is its `PopoverTrigger asChild`, the content its `PopoverContent` |
|
|
1858
1966
|
| `.confirmationDialog(isPresented, ConfirmationDialog(title, ...rows))` | the lens menu grown out of the view (Android, OxyOS), SwiftUI's `confirmationDialog` (iOS), Bloom `Dialog` (the web) |
|
|
1859
1967
|
| `ConnectionStatus()` | Bloom `ConnectionStatusToasts` |
|
|
@@ -1921,7 +2029,11 @@ toast.success('Saved')
|
|
|
1921
2029
|
where the view is, by the same code `.dialog()` draws it with. `.presented()`
|
|
1922
2030
|
ends the chain (it is a view, with no modifier of its own); every modifier
|
|
1923
2031
|
before it is the dialog's, so `.frame()` and `.padding()` are its width and
|
|
1924
|
-
`contentPadding`, never a box around it.
|
|
2032
|
+
`contentPadding`, never a box around it. `.control(control)` ends it the
|
|
2033
|
+
same way for a dialog Bloom's control opens. `.detached()` floats a bottom
|
|
2034
|
+
dialog above the safe area with gutters (Bloom's `detached`), and
|
|
2035
|
+
`.panelFrame({ maxWidth: '540' })` is the side or bottom panel's own frame
|
|
2036
|
+
(Bloom's `panelStyle`); `.frame()` stays the centred card's.
|
|
1925
2037
|
|
|
1926
2038
|
```ts
|
|
1927
2039
|
const PublishAs = view(({ open, onClose }: { open: boolean; onClose: () => void }) =>
|
|
@@ -2011,11 +2123,12 @@ inside a screen, as Bloom's is.
|
|
|
2011
2123
|
| `.contentMargins(edge?, space)`, `.spacing(space)` | `contentContainerStyle`'s padding (a later margin of an edge replaces the earlier) and `gap` |
|
|
2012
2124
|
| `.contentGrows(on?)` | `contentContainerStyle`'s `flexGrow: 1`: the content container grows to fill the scroll, so content shorter than the viewport (an empty state) centres or sits at its end; `on` a condition (`items.length === 0`) grows it only while it holds. A `ScrollArea`, a `ScrollSurface` and a `VirtualList` take it too |
|
|
2013
2125
|
| `.refreshable([refreshing, setRefreshing], tint?)`, `.refreshable({ refreshing, onRefresh }, tint?)` | a `RefreshControl`: `refreshing` the binding's value, a pull writing `true` (`onRefresh`); the app writes `false` when it has refreshed. Or a refreshing value and the action a pull runs (a query's `isRefetching` and `refetch`), passed as they are. `tint`, a colour role (or a role at an opacity), is its `tintColor` and `colors={[…]}`, painted from the theme as an app writes `tintColor={theme.colors.primary} colors={[theme.colors.primary]}`; `{ ios, android }` is each platform's own (`{ ios: 'primary' }` is `tintColor` alone: Android's spinner keeps its look) |
|
|
2014
|
-
| `.onEndReached(action, threshold?)` | `onEndReached`, `onEndReachedThreshold` (2 viewports by default) |
|
|
2126
|
+
| `.onEndReached(action, threshold?)` | `onEndReached`, `onEndReachedThreshold` (2 viewports by default); `action` chosen at render, `undefined` included (`hasMore ? loadMore : undefined`), as the app wrote it: `undefined` calls nothing |
|
|
2015
2127
|
| `.scrollIndicators('automatic' \| 'visible' \| 'hidden', axis?)` | `showsVerticalScrollIndicator` and `showsHorizontalScrollIndicator`, or only the one `axis` (`'vertical'` or `'horizontal'`) names: `showsVerticalScrollIndicator={false}` alone is `.scrollIndicators('hidden', 'vertical')` |
|
|
2016
2128
|
| `.scrollDismissesKeyboard('never' \| 'immediately' \| 'interactively')` | `keyboardDismissMode` `none`, `on-drag`, `interactive` |
|
|
2017
2129
|
| `.safeAreaInset(edge, view, spacing?)`, `.safeAreaBar(edge, view)` | a view pinned at the `top` or `bottom` and the content padded by its height (see below) |
|
|
2018
2130
|
| `.keyboardTaps('never' \| 'always' \| 'handled')` | `keyboardShouldPersistTaps` |
|
|
2131
|
+
| `.stickyIndices(indices)` | `stickyHeaderIndices`: the children, by index, that stay at the top once scrolled to it (a profile's tabs); `undefined` keeps none |
|
|
2019
2132
|
| `.contentView((v) => v…)` | Bloom's `ScreenScrollView contentView` (what an app's `contentContainerClassName` drew): the content laid out in a view of its own inside the content container, which then grows to the viewport and pads only the screen's chrome (a content-sized screen reads no intrinsic height from it). `v` takes the layout of one view: `padding`, `spacing`, `align`, `justify`, `wrap`, `axis`, `frame`, `flex`, `grow`, `shrink`, `basis`, `alignSelf` (the spec's `contentView.modifiers`), drawn as a vertical stack of them is, in layer order (a frame after its padding: one view); the content margins and spacing go on that view after its own, as an app's `contentContainerStyle` followed its class |
|
|
2020
2133
|
|
|
2021
2134
|
Only what the chain names reaches the scroll view, so Bloom's own defaults
|
|
@@ -2400,6 +2513,12 @@ Image(post.cover, 'Cover')
|
|
|
2400
2513
|
`crossFade` is a Bloom duration (`instant` 100, `fast` 150, `normal` 200,
|
|
2401
2514
|
`slow` 300 ms); without it the image appears at once. `onLoad` receives the
|
|
2402
2515
|
intrinsic `{ width, height }` and `onError` `{ error }`.
|
|
2516
|
+
- **Name.** `alt` is the image's name, Bloom's `alt`: expo-image and React
|
|
2517
|
+
Native's Image read it as `accessibilityLabel` (natively it also makes the
|
|
2518
|
+
image an accessibility element), and on the web react-native-web's Image
|
|
2519
|
+
writes it as its `aria-label` and `<img alt>`, as React Native's Image with
|
|
2520
|
+
an `accessibilityLabel` does (`parity/image-name.cases.tsx`). `.label()`
|
|
2521
|
+
names it the same way on the web.
|
|
2403
2522
|
- **Presses.** `BloomImage` takes accessibility props but no presses, so an image
|
|
2404
2523
|
with `onPress`, `onHover` or `hoverGroup` is drawn inside its pressable host,
|
|
2405
2524
|
which also takes `grow` and `shrink`.
|
|
@@ -2434,7 +2553,7 @@ ErrorBoundary(Feed()).title('The feed failed').resetKey(userId)
|
|
|
2434
2553
|
| Node | Draws |
|
|
2435
2554
|
| --- | --- |
|
|
2436
2555
|
| `Card(...)`, `CardHeader` / `CardBody` / `CardFooter(...)`, `CardTitle` / `CardDescription(text)` | Bloom `Card` and its parts; a card lays its children out as a stack does, `.axis()`, `.spacing()`, `.align()`, `.justify()`, in the view Bloom's Card holds them in (its `style`) |
|
|
2437
|
-
| `Row(title?)` | Bloom `Item` (the list row; `Item` is the menu's row) |
|
|
2556
|
+
| `Row(title?)` | Bloom `Item` (the list row; `Item` is the menu's row); `.onPress(undefined)` (a press chosen at render, `full ? undefined : add`) is an `Item` with no press, no button, as Bloom draws one |
|
|
2438
2557
|
| `GroupedSection(...rows)`, `GroupedSectionItem(title)` | Bloom `GroupedSection`, `GroupedSectionItem` |
|
|
2439
2558
|
| `GroupedSectionIcon(icon)`, `GroupedSectionDivider()`, `GroupedSectionCollapse(open, ...rows)` | Bloom `GroupedSectionIcon`, `GroupedSectionDivider`, `GroupedSectionCollapse` |
|
|
2440
2559
|
| `Chip(...content)` | Bloom `Chip`: the `Text` is its label, an `Icon` before or after it its glyphs; a glyph with a size or ink of its own (`Icon(X).size('sm').foreground('primary')`), or any other view, before or after the label is drawn as it is (Bloom's `leading` and `trailing`) |
|
|
@@ -2458,6 +2577,16 @@ ErrorBoundary(Feed()).title('The feed failed').resetKey(userId)
|
|
|
2458
2577
|
`.lines(n)`. The box modifiers (padding, frame, background, corner, margin,
|
|
2459
2578
|
flex) are the card's `style`, as an app writes them; on the web a role in
|
|
2460
2579
|
it is its CSS variable, as Bloom's prepainted theme hands it to an app.
|
|
2580
|
+
The card's own box is the one its padding, frame and fill share, in that
|
|
2581
|
+
order: a `.background()` there is Bloom Card's `style.backgroundColor`,
|
|
2582
|
+
which its surface paints from, so `.background('transparent')` draws no
|
|
2583
|
+
surface at all (Mention's composer zeroes a card's fill so:
|
|
2584
|
+
`.padding('lg').frame({ width: 'full', height: 'full' }).background('transparent').grow()`).
|
|
2585
|
+
A background after a `.corner()` or a second padding is a view around the
|
|
2586
|
+
card, as anywhere (see [Order means nesting](#order-means-nesting)), and
|
|
2587
|
+
the card still paints its own surface inside it. Its corner and outline are
|
|
2588
|
+
`.radius()` and `.outline()`: a border width or a corner in its `style` is
|
|
2589
|
+
Bloom's to ignore, so the chain writes neither.
|
|
2461
2590
|
- **Row.** `.subtitle()`, `.leadingView(...)` and `.trailing(...)` (its slots,
|
|
2462
2591
|
as views), `.size()`, `.lines(n)` (the title's), `.disabled()`,
|
|
2463
2592
|
`.destructive()`, `.selected()`, `.active()`, `.highlighted()`,
|
|
@@ -2719,7 +2848,10 @@ at its edges adds to that padding), `.itemKey()`, `.itemType()` (FlashList's rec
|
|
|
2719
2848
|
`.estimatedItemSize(px)`, `.columns()`, `.itemLayout(fn)` (Bloom's `overrideItemLayout`:
|
|
2720
2849
|
`fn(layout, item, index, columns)` sets `layout.span`, so a full-width row sits in a grid of
|
|
2721
2850
|
columns), `.onEndReached(action, threshold?)`,
|
|
2722
|
-
`.refreshable([refreshing, setRefreshing])` or `.refreshable({ refreshing, onRefresh })`, `.stickyIndices()
|
|
2851
|
+
`.refreshable([refreshing, setRefreshing])` or `.refreshable({ refreshing, onRefresh })`, `.stickyIndices()`
|
|
2852
|
+
(each chosen at render with `undefined` for none, as JSX writes `onEndReached={hasMore ? loadMore : undefined}`,
|
|
2853
|
+
`onRefresh={signedIn ? refetch : undefined}` and `stickyHeaderIndices={tabBar ? [0] : undefined}`: no end call, no
|
|
2854
|
+
pull to refresh, no sticky row),
|
|
2723
2855
|
`.restorationKey()`, `.headerContent()`, `.headerFitsContent()` (the header is its content's
|
|
2724
2856
|
height and the list's width, `ListHeaderComponentStyle`'s `flexGrow: 0, flexShrink: 0,
|
|
2725
2857
|
alignSelf: 'stretch'`, so the engine never stretches it to the viewport and a sticky row after it
|
|
@@ -2779,10 +2911,12 @@ Text(InlineMarkdown(post.body).plainRun(mentions).suffix(Text(' Read more').link
|
|
|
2779
2911
|
Inline markdown inside a line is `InlineMarkdown(source)`, Bloom's own: a run
|
|
2780
2912
|
of a `Text` (emphasis, strikethrough, code and links as spans of it), its
|
|
2781
2913
|
source a string or Bloom's parsed runs. It takes `.streaming()`,
|
|
2782
|
-
`.onLinkPress()`, `.plainRun(text =>
|
|
2783
|
-
or code), `.linkView(link =>
|
|
2784
|
-
Bloom's) and `.suffix(
|
|
2785
|
-
spans
|
|
2914
|
+
`.onLinkPress()`, `.plainRun(text => runs)` (each plain run, not inside links
|
|
2915
|
+
or code), `.linkView(link => runs)` (a link of your own; `undefined` keeps
|
|
2916
|
+
Bloom's) and `.suffix(runs)`. Each hands back runs of the text, as `Text`
|
|
2917
|
+
takes them: one, or several in order, strings beside spans and element runs,
|
|
2918
|
+
so a post's linkified plain run is its prose as strings and its mentions,
|
|
2919
|
+
tags and URLs as spans, with no span around the prose (see [Text](#text)).
|
|
2786
2920
|
|
|
2787
2921
|
### Sliders
|
|
2788
2922
|
|
|
@@ -4417,6 +4551,47 @@ A root placed back in a language tree has no boundary: `Embed(toElement(chain))`
|
|
|
4417
4551
|
an `Embed` render function or a `VirtualList` row that returns one, is drawn
|
|
4418
4552
|
as part of that tree, in the environment provided there.
|
|
4419
4553
|
|
|
4554
|
+
**What a root costs.** Every node costs React what the JSX it stands for
|
|
4555
|
+
costs: a press, a hit slop, a pinned edge, a fill at an opacity, an app colour,
|
|
4556
|
+
a glyph (the per-node cost gate, `parity/cost.parity.test.tsx`, measures each
|
|
4557
|
+
against its JSX). The boundary is the one thing JSX does not have: one fiber,
|
|
4558
|
+
and a context read for each thing its tree takes from where it is placed. It
|
|
4559
|
+
reads the environment (an `.environment()`, `.disabled()`, `.animation()`,
|
|
4560
|
+
navigator or text trait set above reaches the root through it) when a node of
|
|
4561
|
+
its tree takes from it: a press (a `.disabled()` above disables it), a text, a
|
|
4562
|
+
glyph with no colour of its own, any modifier that sets a value for what is
|
|
4563
|
+
inside it. It reads the theme when a node paints a theme colour; a fixed
|
|
4564
|
+
colour (`white`, `black/60`, natively) and an app's own colour read none. A
|
|
4565
|
+
tree of fixed geometry, a glyph in a fixed colour, an embedded element or a
|
|
4566
|
+
`view()` (which reads what it takes itself) reads nothing, and a `view()`
|
|
4567
|
+
inside it still reads what is set above. A RawText takes no trait set above it
|
|
4568
|
+
(it writes only what its chain names), so it reads the theme only when a role
|
|
4569
|
+
inks it; an `Avatar` or an `AvatarGroup` hands Bloom its props as they are (a
|
|
4570
|
+
size, a shape, an avatar colour by name) and reads only what its box paints
|
|
4571
|
+
(an AvatarGroup's ring in a role, its item action), so a `view()` that hands
|
|
4572
|
+
its props to one costs what the component that renders Bloom's does (Mention's
|
|
4573
|
+
`AccountAvatar`). What a tree reads is known from its nodes, once per node
|
|
4574
|
+
(the modifiers that read nothing are the spec's `reads.nothing`), and read with
|
|
4575
|
+
React's `use`, so a root whose tree comes to read more stays the same component
|
|
4576
|
+
and keeps its state; a `view()` body reads the same way. A root whose tree is
|
|
4577
|
+
host views alone (stacks and spacers, `reads.hostViews`) and reads nothing has
|
|
4578
|
+
nothing for a boundary to provide: it is those views, with no fiber of its own
|
|
4579
|
+
(Mention's splash marker, `VStack().frame({ width: 'none', height: 'none' })
|
|
4580
|
+
.position({}).allowsHitTesting(false).onLayout(release)`, is the `View` it
|
|
4581
|
+
replaced). Such a tree holds no component and no state, so one that comes to
|
|
4582
|
+
read something is drawn again under a boundary, as JSX that comes to wrap a
|
|
4583
|
+
view in a component is; a root that holds a `view()`, an embedded element, a
|
|
4584
|
+
control or a list (whose items leave through a component of their own) keeps
|
|
4585
|
+
its boundary whatever it reads. Mention's feed video preview (a tap area and a mute button
|
|
4586
|
+
in one root) is its JSX's fibers, hooks and reads, and one read more, the
|
|
4587
|
+
environment its presses take. A component whose JSX holds two roots pays them
|
|
4588
|
+
twice; converting a region into one root, not each of its pieces into a root
|
|
4589
|
+
of its own, pays them once, and a region already inside a language tree pays
|
|
4590
|
+
nothing. Order still means nesting:
|
|
4591
|
+
`.frame().background().border().corner()` is the one rounded, filled, outlined
|
|
4592
|
+
view a JSX style writes; `.corner()` before `.background()` rounds the content
|
|
4593
|
+
and fills a square behind it, a second view.
|
|
4594
|
+
|
|
4420
4595
|
## ViewThatFits
|
|
4421
4596
|
|
|
4422
4597
|
`ViewThatFits(axis, ...candidates)` is SwiftUI's `ViewThatFits(in:)`: the first
|
|
@@ -4815,14 +4990,14 @@ the owner's decision, or an app's `defineTokens`) before a codemod moves it.
|
|
|
4815
4990
|
|
|
4816
4991
|
| | Utilities | Uses | Share of uses |
|
|
4817
4992
|
| --- | ---: | ---: | ---: |
|
|
4818
|
-
| Maps to a modifier and a token |
|
|
4993
|
+
| Maps to a modifier and a token | 1090 | 47358 | 88.2% |
|
|
4819
4994
|
| Expressed by the view’s structure | 48 | 3426 | 6.4% |
|
|
4820
|
-
| Redundant in the language |
|
|
4821
|
-
| Needs a named token (raw value) |
|
|
4995
|
+
| Redundant in the language | 28 | 407 | 0.8% |
|
|
4996
|
+
| Needs a named token (raw value) | 258 | 608 | 1.1% |
|
|
4822
4997
|
| An app’s own token (a brand colour) | 30 | 76 | 0.1% |
|
|
4823
4998
|
| Maps to the motion layer | 13 | 236 | 0.4% |
|
|
4824
4999
|
| Needs a modifier the language lacks | 26 | 63 | 0.1% |
|
|
4825
|
-
| An app’s own class |
|
|
5000
|
+
| An app’s own class | 427 | 1546 | 2.9% |
|
|
4826
5001
|
|
|
4827
5002
|
53720 uses of 1920 utilities across 28 apps. Of the
|
|
4828
5003
|
2061 variant prefixes written over them, 1739 (84.4%) are a `when()`
|
|
@@ -4832,12 +5007,12 @@ condition. The values with no rung, by scale (the owner names each as a token or
|
|
|
4832
5007
|
| --- | ---: | --- |
|
|
4833
5008
|
| color | 219 | --primary-subtle (20), --ring (18), --sidebar-foreground (14), green-500 (12), --sidebar-border (12), red-500 (10), --sidebar-accent (9), red-400 (9), --sidebar-accent-foreground (9), --sidebar (8), --sidebar-ring (8), --accent-foreground (8) |
|
|
4834
5009
|
| space | 199 | 18px (9), 600px (8), 144px (8), 520px (7), 100px (7), 220px (7), 565px (6), 52px (6), 112px (6), 7px (6), 150px (6), 88px (6) |
|
|
4835
|
-
| opacity |
|
|
5010
|
+
| opacity | 58 | --ring at 50% (16), black at [0.04]% (7), white at [0.06]% (6), white at 15% (4), --primary at 15% (3), black at [0.025]% (2), black at [0.07]% (2), white at [0.02]% (2), white at [0.07]% (2), --sidebar-foreground at 70% (2), black at [0.06]% (2), black at 35% (1) |
|
|
4836
5011
|
| leading | 42 | 1 (15), 29px (6), 17px (5), 15px (2), 41px (2), 12px (1), 13px (1), 19px (1), 21px (1), 23px (1), 26px (1), 27px (1) |
|
|
4837
5012
|
| font | 37 | 10.5px (8), 23px (5), 34px (4), 48px / 48px (2), 11.5px (2), 13.5px (2), 15.5px (2), 21px (2), 29px (2), 28px / 34px (2), 60px / 60px (1), 19px (1) |
|
|
4838
5013
|
| corner | 29 | 23px (6), 5px (5), 13px (3), 27px (3), 25px (2), 26px (2), 3px (2), 9px (2), 19px (1), 30px (1), 35px (1), 32px (1) |
|
|
4839
5014
|
| shadow | 16 | shadow-shop-s (10), shadow-shop-m (2), shadow-dropdown (1), shadow-foreground/10 (1), shadow-foreground/20 (1), shadow-l (1) |
|
|
4840
|
-
| zIndex |
|
|
5015
|
+
| zIndex | 5 | 10000 (1), 2000 (1), 2001 (1), 80 (1), 9998 (1) |
|
|
4841
5016
|
| rotation | 1 | -12° (1) |
|
|
4842
5017
|
| weight | 1 | 900 (1) |
|
|
4843
5018
|
| scale | 1 | 1.01 (1) |
|
|
@@ -4932,6 +5107,14 @@ every chain, and the pass changes only what it proves keeps its meaning.
|
|
|
4932
5107
|
prefix (`HStack(…).padding('md')` before `.spacing(gap)`). Names resolve
|
|
4933
5108
|
through scope analysis, so a local that shadows an import is never hoisted.
|
|
4934
5109
|
- **Adds `"use memo"`** to every function passed to `view()`.
|
|
5110
|
+
- **Builds a root as it renders.** A dynamic `toElement(chain)` in JSX becomes
|
|
5111
|
+
`<LanguageRoot build={() => chain} />`, so the handlers and refs the chain
|
|
5112
|
+
takes reach the React Compiler as one JSX prop, never as arguments a call
|
|
5113
|
+
might read during render (which costs the whole component its memoization).
|
|
5114
|
+
A bare `view()` node stays `toElement`, which mounts its component, and so
|
|
5115
|
+
does a chain of host views that reads nothing and takes no handler or ref
|
|
5116
|
+
(the spec's `reads`), which `toElement` draws as those views, with no
|
|
5117
|
+
boundary to build it in.
|
|
4935
5118
|
- **Checks chains** against the spec: an unknown modifier for the node, a wrong
|
|
4936
5119
|
argument count, or a literal token outside its set fails the build with the
|
|
4937
5120
|
source line and a suggestion. Every chain is checked before anything is
|