@oxyhq/bloom 0.1.0
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/README.md +295 -0
- package/lib/commonjs/avatar/Avatar.js +215 -0
- package/lib/commonjs/avatar/Avatar.js.map +1 -0
- package/lib/commonjs/avatar/index.js +13 -0
- package/lib/commonjs/avatar/index.js.map +1 -0
- package/lib/commonjs/avatar/types.js +6 -0
- package/lib/commonjs/avatar/types.js.map +1 -0
- package/lib/commonjs/button/Button.js +169 -0
- package/lib/commonjs/button/Button.js.map +1 -0
- package/lib/commonjs/button/index.js +43 -0
- package/lib/commonjs/button/index.js.map +1 -0
- package/lib/commonjs/button/types.js +6 -0
- package/lib/commonjs/button/types.js.map +1 -0
- package/lib/commonjs/collapsible/Collapsible.js +58 -0
- package/lib/commonjs/collapsible/Collapsible.js.map +1 -0
- package/lib/commonjs/collapsible/index.js +13 -0
- package/lib/commonjs/collapsible/index.js.map +1 -0
- package/lib/commonjs/collapsible/types.js +6 -0
- package/lib/commonjs/collapsible/types.js.map +1 -0
- package/lib/commonjs/dialog/Dialog.js +186 -0
- package/lib/commonjs/dialog/Dialog.js.map +1 -0
- package/lib/commonjs/dialog/Dialog.web.js +244 -0
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -0
- package/lib/commonjs/dialog/context.js +35 -0
- package/lib/commonjs/dialog/context.js.map +1 -0
- package/lib/commonjs/dialog/index.js +56 -0
- package/lib/commonjs/dialog/index.js.map +1 -0
- package/lib/commonjs/dialog/types.js +6 -0
- package/lib/commonjs/dialog/types.js.map +1 -0
- package/lib/commonjs/divider/Divider.js +39 -0
- package/lib/commonjs/divider/Divider.js.map +1 -0
- package/lib/commonjs/divider/index.js +13 -0
- package/lib/commonjs/divider/index.js.map +1 -0
- package/lib/commonjs/divider/types.js +6 -0
- package/lib/commonjs/divider/types.js.map +1 -0
- package/lib/commonjs/error-boundary/ErrorBoundary.js +116 -0
- package/lib/commonjs/error-boundary/ErrorBoundary.js.map +1 -0
- package/lib/commonjs/error-boundary/index.js +13 -0
- package/lib/commonjs/error-boundary/index.js.map +1 -0
- package/lib/commonjs/error-boundary/types.js +6 -0
- package/lib/commonjs/error-boundary/types.js.map +1 -0
- package/lib/commonjs/grouped-buttons/GroupedButtons.js +86 -0
- package/lib/commonjs/grouped-buttons/GroupedButtons.js.map +1 -0
- package/lib/commonjs/grouped-buttons/index.js +19 -0
- package/lib/commonjs/grouped-buttons/index.js.map +1 -0
- package/lib/commonjs/grouped-buttons/types.js +6 -0
- package/lib/commonjs/grouped-buttons/types.js.map +1 -0
- package/lib/commonjs/index.js +136 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/loading/Loading.js +274 -0
- package/lib/commonjs/loading/Loading.js.map +1 -0
- package/lib/commonjs/loading/index.js +13 -0
- package/lib/commonjs/loading/index.js.map +1 -0
- package/lib/commonjs/loading/types.js +6 -0
- package/lib/commonjs/loading/types.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/portal/index.js +90 -0
- package/lib/commonjs/portal/index.js.map +1 -0
- package/lib/commonjs/prompt/Prompt.js +267 -0
- package/lib/commonjs/prompt/Prompt.js.map +1 -0
- package/lib/commonjs/prompt/index.js +61 -0
- package/lib/commonjs/prompt/index.js.map +1 -0
- package/lib/commonjs/prompt-input/Actions.js +45 -0
- package/lib/commonjs/prompt-input/Actions.js.map +1 -0
- package/lib/commonjs/prompt-input/Attachments.js +277 -0
- package/lib/commonjs/prompt-input/Attachments.js.map +1 -0
- package/lib/commonjs/prompt-input/PromptInput.js +226 -0
- package/lib/commonjs/prompt-input/PromptInput.js.map +1 -0
- package/lib/commonjs/prompt-input/SubmitButton.js +81 -0
- package/lib/commonjs/prompt-input/SubmitButton.js.map +1 -0
- package/lib/commonjs/prompt-input/Textarea.js +101 -0
- package/lib/commonjs/prompt-input/Textarea.js.map +1 -0
- package/lib/commonjs/prompt-input/Textarea.web.js +148 -0
- package/lib/commonjs/prompt-input/Textarea.web.js.map +1 -0
- package/lib/commonjs/prompt-input/context.js +35 -0
- package/lib/commonjs/prompt-input/context.js.map +1 -0
- package/lib/commonjs/prompt-input/index.js +54 -0
- package/lib/commonjs/prompt-input/index.js.map +1 -0
- package/lib/commonjs/prompt-input/types.js +6 -0
- package/lib/commonjs/prompt-input/types.js.map +1 -0
- package/lib/commonjs/radio-indicator/RadioIndicator.js +48 -0
- package/lib/commonjs/radio-indicator/RadioIndicator.js.map +1 -0
- package/lib/commonjs/radio-indicator/index.js +13 -0
- package/lib/commonjs/radio-indicator/index.js.map +1 -0
- package/lib/commonjs/radio-indicator/types.js +6 -0
- package/lib/commonjs/radio-indicator/types.js.map +1 -0
- package/lib/commonjs/theme/BloomThemeProvider.js +122 -0
- package/lib/commonjs/theme/BloomThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/adaptive-colors.js +96 -0
- package/lib/commonjs/theme/adaptive-colors.js.map +1 -0
- package/lib/commonjs/theme/apply-dark-class.js +13 -0
- package/lib/commonjs/theme/apply-dark-class.js.map +1 -0
- package/lib/commonjs/theme/color-presets.js +486 -0
- package/lib/commonjs/theme/color-presets.js.map +1 -0
- package/lib/commonjs/theme/index.js +57 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/set-color-scheme-safe.js +23 -0
- package/lib/commonjs/theme/set-color-scheme-safe.js.map +1 -0
- package/lib/commonjs/theme/types.js +2 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/use-theme.js +29 -0
- package/lib/commonjs/theme/use-theme.js.map +1 -0
- package/lib/module/avatar/Avatar.js +210 -0
- package/lib/module/avatar/Avatar.js.map +1 -0
- package/lib/module/avatar/index.js +4 -0
- package/lib/module/avatar/index.js.map +1 -0
- package/lib/module/avatar/types.js +4 -0
- package/lib/module/avatar/types.js.map +1 -0
- package/lib/module/button/Button.js +164 -0
- package/lib/module/button/Button.js.map +1 -0
- package/lib/module/button/index.js +4 -0
- package/lib/module/button/index.js.map +1 -0
- package/lib/module/button/types.js +4 -0
- package/lib/module/button/types.js.map +1 -0
- package/lib/module/collapsible/Collapsible.js +53 -0
- package/lib/module/collapsible/Collapsible.js.map +1 -0
- package/lib/module/collapsible/index.js +4 -0
- package/lib/module/collapsible/index.js.map +1 -0
- package/lib/module/collapsible/types.js +4 -0
- package/lib/module/collapsible/types.js.map +1 -0
- package/lib/module/dialog/Dialog.js +165 -0
- package/lib/module/dialog/Dialog.js.map +1 -0
- package/lib/module/dialog/Dialog.web.js +222 -0
- package/lib/module/dialog/Dialog.web.js.map +1 -0
- package/lib/module/dialog/context.js +29 -0
- package/lib/module/dialog/context.js.map +1 -0
- package/lib/module/dialog/index.js +5 -0
- package/lib/module/dialog/index.js.map +1 -0
- package/lib/module/dialog/types.js +4 -0
- package/lib/module/dialog/types.js.map +1 -0
- package/lib/module/divider/Divider.js +34 -0
- package/lib/module/divider/Divider.js.map +1 -0
- package/lib/module/divider/index.js +4 -0
- package/lib/module/divider/index.js.map +1 -0
- package/lib/module/divider/types.js +4 -0
- package/lib/module/divider/types.js.map +1 -0
- package/lib/module/error-boundary/ErrorBoundary.js +110 -0
- package/lib/module/error-boundary/ErrorBoundary.js.map +1 -0
- package/lib/module/error-boundary/index.js +4 -0
- package/lib/module/error-boundary/index.js.map +1 -0
- package/lib/module/error-boundary/types.js +4 -0
- package/lib/module/error-boundary/types.js.map +1 -0
- package/lib/module/grouped-buttons/GroupedButtons.js +80 -0
- package/lib/module/grouped-buttons/GroupedButtons.js.map +1 -0
- package/lib/module/grouped-buttons/index.js +4 -0
- package/lib/module/grouped-buttons/index.js.map +1 -0
- package/lib/module/grouped-buttons/types.js +4 -0
- package/lib/module/grouped-buttons/types.js.map +1 -0
- package/lib/module/index.js +16 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/loading/Loading.js +269 -0
- package/lib/module/loading/Loading.js.map +1 -0
- package/lib/module/loading/index.js +4 -0
- package/lib/module/loading/index.js.map +1 -0
- package/lib/module/loading/types.js +4 -0
- package/lib/module/loading/types.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/portal/index.js +85 -0
- package/lib/module/portal/index.js.map +1 -0
- package/lib/module/prompt/Prompt.js +250 -0
- package/lib/module/prompt/Prompt.js.map +1 -0
- package/lib/module/prompt/index.js +4 -0
- package/lib/module/prompt/index.js.map +1 -0
- package/lib/module/prompt-input/Actions.js +40 -0
- package/lib/module/prompt-input/Actions.js.map +1 -0
- package/lib/module/prompt-input/Attachments.js +272 -0
- package/lib/module/prompt-input/Attachments.js.map +1 -0
- package/lib/module/prompt-input/PromptInput.js +221 -0
- package/lib/module/prompt-input/PromptInput.js.map +1 -0
- package/lib/module/prompt-input/SubmitButton.js +76 -0
- package/lib/module/prompt-input/SubmitButton.js.map +1 -0
- package/lib/module/prompt-input/Textarea.js +96 -0
- package/lib/module/prompt-input/Textarea.js.map +1 -0
- package/lib/module/prompt-input/Textarea.web.js +143 -0
- package/lib/module/prompt-input/Textarea.web.js.map +1 -0
- package/lib/module/prompt-input/context.js +28 -0
- package/lib/module/prompt-input/context.js.map +1 -0
- package/lib/module/prompt-input/index.js +9 -0
- package/lib/module/prompt-input/index.js.map +1 -0
- package/lib/module/prompt-input/types.js +4 -0
- package/lib/module/prompt-input/types.js.map +1 -0
- package/lib/module/radio-indicator/RadioIndicator.js +43 -0
- package/lib/module/radio-indicator/RadioIndicator.js.map +1 -0
- package/lib/module/radio-indicator/index.js +4 -0
- package/lib/module/radio-indicator/index.js.map +1 -0
- package/lib/module/radio-indicator/types.js +4 -0
- package/lib/module/radio-indicator/types.js.map +1 -0
- package/lib/module/theme/BloomThemeProvider.js +116 -0
- package/lib/module/theme/BloomThemeProvider.js.map +1 -0
- package/lib/module/theme/adaptive-colors.js +92 -0
- package/lib/module/theme/adaptive-colors.js.map +1 -0
- package/lib/module/theme/apply-dark-class.js +9 -0
- package/lib/module/theme/apply-dark-class.js.map +1 -0
- package/lib/module/theme/color-presets.js +481 -0
- package/lib/module/theme/color-presets.js.map +1 -0
- package/lib/module/theme/index.js +6 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/set-color-scheme-safe.js +19 -0
- package/lib/module/theme/set-color-scheme-safe.js.map +1 -0
- package/lib/module/theme/types.js +2 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/use-theme.js +23 -0
- package/lib/module/theme/use-theme.js.map +1 -0
- package/lib/typescript/commonjs/avatar/Avatar.d.ts +4 -0
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/commonjs/avatar/index.d.ts +3 -0
- package/lib/typescript/commonjs/avatar/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/avatar/types.d.ts +31 -0
- package/lib/typescript/commonjs/avatar/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/button/Button.d.ts +10 -0
- package/lib/typescript/commonjs/button/Button.d.ts.map +1 -0
- package/lib/typescript/commonjs/button/index.d.ts +3 -0
- package/lib/typescript/commonjs/button/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/button/types.d.ts +25 -0
- package/lib/typescript/commonjs/button/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/collapsible/Collapsible.d.ts +4 -0
- package/lib/typescript/commonjs/collapsible/Collapsible.d.ts.map +1 -0
- package/lib/typescript/commonjs/collapsible/index.d.ts +3 -0
- package/lib/typescript/commonjs/collapsible/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/collapsible/types.d.ts +18 -0
- package/lib/typescript/commonjs/collapsible/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/Dialog.d.ts +11 -0
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +23 -0
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/context.d.ts +5 -0
- package/lib/typescript/commonjs/dialog/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/index.d.ts +4 -0
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/types.d.ts +30 -0
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/divider/Divider.d.ts +4 -0
- package/lib/typescript/commonjs/divider/Divider.d.ts.map +1 -0
- package/lib/typescript/commonjs/divider/index.d.ts +3 -0
- package/lib/typescript/commonjs/divider/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/divider/types.d.ts +15 -0
- package/lib/typescript/commonjs/divider/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/error-boundary/ErrorBoundary.d.ts +16 -0
- package/lib/typescript/commonjs/error-boundary/ErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/commonjs/error-boundary/index.d.ts +3 -0
- package/lib/typescript/commonjs/error-boundary/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/error-boundary/types.d.ts +16 -0
- package/lib/typescript/commonjs/error-boundary/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/grouped-buttons/GroupedButtons.d.ts +8 -0
- package/lib/typescript/commonjs/grouped-buttons/GroupedButtons.d.ts.map +1 -0
- package/lib/typescript/commonjs/grouped-buttons/index.d.ts +3 -0
- package/lib/typescript/commonjs/grouped-buttons/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/grouped-buttons/types.d.ts +15 -0
- package/lib/typescript/commonjs/grouped-buttons/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +15 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/loading/Loading.d.ts +4 -0
- package/lib/typescript/commonjs/loading/Loading.d.ts.map +1 -0
- package/lib/typescript/commonjs/loading/index.d.ts +3 -0
- package/lib/typescript/commonjs/loading/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/loading/types.d.ts +60 -0
- package/lib/typescript/commonjs/loading/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/portal/index.d.ts +5 -0
- package/lib/typescript/commonjs/portal/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt/Prompt.d.ts +42 -0
- package/lib/typescript/commonjs/prompt/Prompt.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt/index.d.ts +3 -0
- package/lib/typescript/commonjs/prompt/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/Actions.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Actions.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/Attachments.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Attachments.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/PromptInput.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/PromptInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/SubmitButton.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/SubmitButton.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.web.d.ts +3 -0
- package/lib/typescript/commonjs/prompt-input/Textarea.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/context.d.ts +34 -0
- package/lib/typescript/commonjs/prompt-input/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/index.d.ts +8 -0
- package/lib/typescript/commonjs/prompt-input/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/prompt-input/types.d.ts +88 -0
- package/lib/typescript/commonjs/prompt-input/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/radio-indicator/RadioIndicator.d.ts +4 -0
- package/lib/typescript/commonjs/radio-indicator/RadioIndicator.d.ts.map +1 -0
- package/lib/typescript/commonjs/radio-indicator/index.d.ts +3 -0
- package/lib/typescript/commonjs/radio-indicator/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/radio-indicator/types.d.ts +15 -0
- package/lib/typescript/commonjs/radio-indicator/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts +20 -0
- package/lib/typescript/commonjs/theme/BloomThemeProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/adaptive-colors.d.ts +3 -0
- package/lib/typescript/commonjs/theme/adaptive-colors.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts +2 -0
- package/lib/typescript/commonjs/theme/apply-dark-class.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/color-presets.d.ts +12 -0
- package/lib/typescript/commonjs/theme/color-presets.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/index.d.ts +7 -0
- package/lib/typescript/commonjs/theme/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/set-color-scheme-safe.d.ts +9 -0
- package/lib/typescript/commonjs/theme/set-color-scheme-safe.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/types.d.ts +39 -0
- package/lib/typescript/commonjs/theme/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/theme/use-theme.d.ts +5 -0
- package/lib/typescript/commonjs/theme/use-theme.d.ts.map +1 -0
- package/lib/typescript/module/avatar/Avatar.d.ts +4 -0
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -0
- package/lib/typescript/module/avatar/index.d.ts +3 -0
- package/lib/typescript/module/avatar/index.d.ts.map +1 -0
- package/lib/typescript/module/avatar/types.d.ts +31 -0
- package/lib/typescript/module/avatar/types.d.ts.map +1 -0
- package/lib/typescript/module/button/Button.d.ts +10 -0
- package/lib/typescript/module/button/Button.d.ts.map +1 -0
- package/lib/typescript/module/button/index.d.ts +3 -0
- package/lib/typescript/module/button/index.d.ts.map +1 -0
- package/lib/typescript/module/button/types.d.ts +25 -0
- package/lib/typescript/module/button/types.d.ts.map +1 -0
- package/lib/typescript/module/collapsible/Collapsible.d.ts +4 -0
- package/lib/typescript/module/collapsible/Collapsible.d.ts.map +1 -0
- package/lib/typescript/module/collapsible/index.d.ts +3 -0
- package/lib/typescript/module/collapsible/index.d.ts.map +1 -0
- package/lib/typescript/module/collapsible/types.d.ts +18 -0
- package/lib/typescript/module/collapsible/types.d.ts.map +1 -0
- package/lib/typescript/module/dialog/Dialog.d.ts +11 -0
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -0
- package/lib/typescript/module/dialog/Dialog.web.d.ts +23 -0
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -0
- package/lib/typescript/module/dialog/context.d.ts +5 -0
- package/lib/typescript/module/dialog/context.d.ts.map +1 -0
- package/lib/typescript/module/dialog/index.d.ts +4 -0
- package/lib/typescript/module/dialog/index.d.ts.map +1 -0
- package/lib/typescript/module/dialog/types.d.ts +30 -0
- package/lib/typescript/module/dialog/types.d.ts.map +1 -0
- package/lib/typescript/module/divider/Divider.d.ts +4 -0
- package/lib/typescript/module/divider/Divider.d.ts.map +1 -0
- package/lib/typescript/module/divider/index.d.ts +3 -0
- package/lib/typescript/module/divider/index.d.ts.map +1 -0
- package/lib/typescript/module/divider/types.d.ts +15 -0
- package/lib/typescript/module/divider/types.d.ts.map +1 -0
- package/lib/typescript/module/error-boundary/ErrorBoundary.d.ts +16 -0
- package/lib/typescript/module/error-boundary/ErrorBoundary.d.ts.map +1 -0
- package/lib/typescript/module/error-boundary/index.d.ts +3 -0
- package/lib/typescript/module/error-boundary/index.d.ts.map +1 -0
- package/lib/typescript/module/error-boundary/types.d.ts +16 -0
- package/lib/typescript/module/error-boundary/types.d.ts.map +1 -0
- package/lib/typescript/module/grouped-buttons/GroupedButtons.d.ts +8 -0
- package/lib/typescript/module/grouped-buttons/GroupedButtons.d.ts.map +1 -0
- package/lib/typescript/module/grouped-buttons/index.d.ts +3 -0
- package/lib/typescript/module/grouped-buttons/index.d.ts.map +1 -0
- package/lib/typescript/module/grouped-buttons/types.d.ts +15 -0
- package/lib/typescript/module/grouped-buttons/types.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +15 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/loading/Loading.d.ts +4 -0
- package/lib/typescript/module/loading/Loading.d.ts.map +1 -0
- package/lib/typescript/module/loading/index.d.ts +3 -0
- package/lib/typescript/module/loading/index.d.ts.map +1 -0
- package/lib/typescript/module/loading/types.d.ts +60 -0
- package/lib/typescript/module/loading/types.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/portal/index.d.ts +5 -0
- package/lib/typescript/module/portal/index.d.ts.map +1 -0
- package/lib/typescript/module/prompt/Prompt.d.ts +42 -0
- package/lib/typescript/module/prompt/Prompt.d.ts.map +1 -0
- package/lib/typescript/module/prompt/index.d.ts +3 -0
- package/lib/typescript/module/prompt/index.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/Actions.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Actions.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/Attachments.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Attachments.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/PromptInput.d.ts +3 -0
- package/lib/typescript/module/prompt-input/PromptInput.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/SubmitButton.d.ts +3 -0
- package/lib/typescript/module/prompt-input/SubmitButton.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/Textarea.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Textarea.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/Textarea.web.d.ts +3 -0
- package/lib/typescript/module/prompt-input/Textarea.web.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/context.d.ts +34 -0
- package/lib/typescript/module/prompt-input/context.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/index.d.ts +8 -0
- package/lib/typescript/module/prompt-input/index.d.ts.map +1 -0
- package/lib/typescript/module/prompt-input/types.d.ts +88 -0
- package/lib/typescript/module/prompt-input/types.d.ts.map +1 -0
- package/lib/typescript/module/radio-indicator/RadioIndicator.d.ts +4 -0
- package/lib/typescript/module/radio-indicator/RadioIndicator.d.ts.map +1 -0
- package/lib/typescript/module/radio-indicator/index.d.ts +3 -0
- package/lib/typescript/module/radio-indicator/index.d.ts.map +1 -0
- package/lib/typescript/module/radio-indicator/types.d.ts +15 -0
- package/lib/typescript/module/radio-indicator/types.d.ts.map +1 -0
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts +20 -0
- package/lib/typescript/module/theme/BloomThemeProvider.d.ts.map +1 -0
- package/lib/typescript/module/theme/adaptive-colors.d.ts +3 -0
- package/lib/typescript/module/theme/adaptive-colors.d.ts.map +1 -0
- package/lib/typescript/module/theme/apply-dark-class.d.ts +2 -0
- package/lib/typescript/module/theme/apply-dark-class.d.ts.map +1 -0
- package/lib/typescript/module/theme/color-presets.d.ts +12 -0
- package/lib/typescript/module/theme/color-presets.d.ts.map +1 -0
- package/lib/typescript/module/theme/index.d.ts +7 -0
- package/lib/typescript/module/theme/index.d.ts.map +1 -0
- package/lib/typescript/module/theme/set-color-scheme-safe.d.ts +9 -0
- package/lib/typescript/module/theme/set-color-scheme-safe.d.ts.map +1 -0
- package/lib/typescript/module/theme/types.d.ts +39 -0
- package/lib/typescript/module/theme/types.d.ts.map +1 -0
- package/lib/typescript/module/theme/use-theme.d.ts +5 -0
- package/lib/typescript/module/theme/use-theme.d.ts.map +1 -0
- package/package.json +260 -0
- package/src/avatar/Avatar.tsx +217 -0
- package/src/avatar/index.ts +2 -0
- package/src/avatar/types.ts +32 -0
- package/src/button/Button.tsx +172 -0
- package/src/button/index.ts +10 -0
- package/src/button/types.ts +25 -0
- package/src/collapsible/Collapsible.tsx +62 -0
- package/src/collapsible/index.ts +2 -0
- package/src/collapsible/types.ts +18 -0
- package/src/dialog/Dialog.tsx +160 -0
- package/src/dialog/Dialog.web.tsx +238 -0
- package/src/dialog/context.ts +34 -0
- package/src/dialog/index.ts +3 -0
- package/src/dialog/types.ts +34 -0
- package/src/divider/Divider.tsx +42 -0
- package/src/divider/index.ts +2 -0
- package/src/divider/types.ts +15 -0
- package/src/error-boundary/ErrorBoundary.tsx +112 -0
- package/src/error-boundary/index.ts +2 -0
- package/src/error-boundary/types.ts +16 -0
- package/src/grouped-buttons/GroupedButtons.tsx +94 -0
- package/src/grouped-buttons/index.ts +2 -0
- package/src/grouped-buttons/types.ts +16 -0
- package/src/index.ts +14 -0
- package/src/loading/Loading.tsx +258 -0
- package/src/loading/index.ts +10 -0
- package/src/loading/types.ts +69 -0
- package/src/portal/index.tsx +100 -0
- package/src/prompt/Prompt.tsx +248 -0
- package/src/prompt/index.ts +13 -0
- package/src/prompt-input/Actions.tsx +45 -0
- package/src/prompt-input/Attachments.tsx +264 -0
- package/src/prompt-input/PromptInput.tsx +263 -0
- package/src/prompt-input/SubmitButton.tsx +74 -0
- package/src/prompt-input/Textarea.tsx +102 -0
- package/src/prompt-input/Textarea.web.tsx +154 -0
- package/src/prompt-input/context.ts +59 -0
- package/src/prompt-input/index.ts +18 -0
- package/src/prompt-input/types.ts +92 -0
- package/src/radio-indicator/RadioIndicator.tsx +52 -0
- package/src/radio-indicator/index.ts +2 -0
- package/src/radio-indicator/types.ts +15 -0
- package/src/theme/BloomThemeProvider.tsx +160 -0
- package/src/theme/adaptive-colors.ts +90 -0
- package/src/theme/apply-dark-class.ts +7 -0
- package/src/theme/color-presets.ts +499 -0
- package/src/theme/index.ts +6 -0
- package/src/theme/set-color-scheme-safe.ts +19 -0
- package/src/theme/types.ts +48 -0
- package/src/theme/use-theme.ts +24 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type ThemeMode = 'light' | 'dark' | 'system' | 'adaptive';
|
|
2
|
+
export interface ThemeColors {
|
|
3
|
+
background: string;
|
|
4
|
+
backgroundSecondary: string;
|
|
5
|
+
backgroundTertiary: string;
|
|
6
|
+
text: string;
|
|
7
|
+
textSecondary: string;
|
|
8
|
+
textTertiary: string;
|
|
9
|
+
border: string;
|
|
10
|
+
borderLight: string;
|
|
11
|
+
primary: string;
|
|
12
|
+
primaryLight: string;
|
|
13
|
+
primaryDark: string;
|
|
14
|
+
secondary: string;
|
|
15
|
+
tint: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
iconActive: string;
|
|
18
|
+
success: string;
|
|
19
|
+
error: string;
|
|
20
|
+
warning: string;
|
|
21
|
+
info: string;
|
|
22
|
+
primarySubtle: string;
|
|
23
|
+
primarySubtleForeground: string;
|
|
24
|
+
negative: string;
|
|
25
|
+
negativeForeground: string;
|
|
26
|
+
negativeSubtle: string;
|
|
27
|
+
negativeSubtleForeground: string;
|
|
28
|
+
contrast50: string;
|
|
29
|
+
card: string;
|
|
30
|
+
shadow: string;
|
|
31
|
+
overlay: string;
|
|
32
|
+
}
|
|
33
|
+
export interface Theme {
|
|
34
|
+
mode: 'light' | 'dark';
|
|
35
|
+
colors: ThemeColors;
|
|
36
|
+
isDark: boolean;
|
|
37
|
+
isLight: boolean;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/theme/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAE3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IAEnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IAEb,aAAa,EAAE,MAAM,CAAC;IACtB,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,MAAM,CAAC;IACjC,UAAU,EAAE,MAAM,CAAC;IAEnB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,WAAW,CAAC;IACpB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Theme, ThemeColors } from './types';
|
|
2
|
+
export declare function useTheme(): Theme;
|
|
3
|
+
export declare function useThemeColor(colorKey: keyof ThemeColors): string;
|
|
4
|
+
export declare function useBloomTheme(): import("./BloomThemeProvider").BloomThemeContextValue;
|
|
5
|
+
//# sourceMappingURL=use-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-theme.d.ts","sourceRoot":"","sources":["../../../../src/theme/use-theme.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElD,wBAAgB,QAAQ,IAAI,KAAK,CAMhC;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,WAAW,GAAG,MAAM,CAGjE;AAED,wBAAgB,aAAa,0DAM5B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@oxyhq/bloom",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
|
+
"types": "lib/typescript/commonjs/index.d.ts",
|
|
8
|
+
"react-native": "src/index.ts",
|
|
9
|
+
"source": "src/index.ts",
|
|
10
|
+
"sideEffects": false,
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"react-native": "./src/index.ts",
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./lib/typescript/module/index.d.ts",
|
|
19
|
+
"default": "./lib/module/index.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./lib/typescript/commonjs/index.d.ts",
|
|
23
|
+
"default": "./lib/commonjs/index.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"./theme": {
|
|
27
|
+
"react-native": "./src/theme/index.ts",
|
|
28
|
+
"import": {
|
|
29
|
+
"types": "./lib/typescript/module/theme/index.d.ts",
|
|
30
|
+
"default": "./lib/module/theme/index.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./lib/typescript/commonjs/theme/index.d.ts",
|
|
34
|
+
"default": "./lib/commonjs/theme/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./portal": {
|
|
38
|
+
"react-native": "./src/portal/index.ts",
|
|
39
|
+
"import": {
|
|
40
|
+
"types": "./lib/typescript/module/portal/index.d.ts",
|
|
41
|
+
"default": "./lib/module/portal/index.js"
|
|
42
|
+
},
|
|
43
|
+
"require": {
|
|
44
|
+
"types": "./lib/typescript/commonjs/portal/index.d.ts",
|
|
45
|
+
"default": "./lib/commonjs/portal/index.js"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"./dialog": {
|
|
49
|
+
"react-native": "./src/dialog/index.ts",
|
|
50
|
+
"import": {
|
|
51
|
+
"types": "./lib/typescript/module/dialog/index.d.ts",
|
|
52
|
+
"default": "./lib/module/dialog/index.js"
|
|
53
|
+
},
|
|
54
|
+
"require": {
|
|
55
|
+
"types": "./lib/typescript/commonjs/dialog/index.d.ts",
|
|
56
|
+
"default": "./lib/commonjs/dialog/index.js"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"./prompt": {
|
|
60
|
+
"react-native": "./src/prompt/index.ts",
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./lib/typescript/module/prompt/index.d.ts",
|
|
63
|
+
"default": "./lib/module/prompt/index.js"
|
|
64
|
+
},
|
|
65
|
+
"require": {
|
|
66
|
+
"types": "./lib/typescript/commonjs/prompt/index.d.ts",
|
|
67
|
+
"default": "./lib/commonjs/prompt/index.js"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"./button": {
|
|
71
|
+
"react-native": "./src/button/index.ts",
|
|
72
|
+
"import": {
|
|
73
|
+
"types": "./lib/typescript/module/button/index.d.ts",
|
|
74
|
+
"default": "./lib/module/button/index.js"
|
|
75
|
+
},
|
|
76
|
+
"require": {
|
|
77
|
+
"types": "./lib/typescript/commonjs/button/index.d.ts",
|
|
78
|
+
"default": "./lib/commonjs/button/index.js"
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"./grouped-buttons": {
|
|
82
|
+
"react-native": "./src/grouped-buttons/index.ts",
|
|
83
|
+
"import": {
|
|
84
|
+
"types": "./lib/typescript/module/grouped-buttons/index.d.ts",
|
|
85
|
+
"default": "./lib/module/grouped-buttons/index.js"
|
|
86
|
+
},
|
|
87
|
+
"require": {
|
|
88
|
+
"types": "./lib/typescript/commonjs/grouped-buttons/index.d.ts",
|
|
89
|
+
"default": "./lib/commonjs/grouped-buttons/index.js"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"./divider": {
|
|
93
|
+
"react-native": "./src/divider/index.ts",
|
|
94
|
+
"import": {
|
|
95
|
+
"types": "./lib/typescript/module/divider/index.d.ts",
|
|
96
|
+
"default": "./lib/module/divider/index.js"
|
|
97
|
+
},
|
|
98
|
+
"require": {
|
|
99
|
+
"types": "./lib/typescript/commonjs/divider/index.d.ts",
|
|
100
|
+
"default": "./lib/commonjs/divider/index.js"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"./radio-indicator": {
|
|
104
|
+
"react-native": "./src/radio-indicator/index.ts",
|
|
105
|
+
"import": {
|
|
106
|
+
"types": "./lib/typescript/module/radio-indicator/index.d.ts",
|
|
107
|
+
"default": "./lib/module/radio-indicator/index.js"
|
|
108
|
+
},
|
|
109
|
+
"require": {
|
|
110
|
+
"types": "./lib/typescript/commonjs/radio-indicator/index.d.ts",
|
|
111
|
+
"default": "./lib/commonjs/radio-indicator/index.js"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"./collapsible": {
|
|
115
|
+
"react-native": "./src/collapsible/index.ts",
|
|
116
|
+
"import": {
|
|
117
|
+
"types": "./lib/typescript/module/collapsible/index.d.ts",
|
|
118
|
+
"default": "./lib/module/collapsible/index.js"
|
|
119
|
+
},
|
|
120
|
+
"require": {
|
|
121
|
+
"types": "./lib/typescript/commonjs/collapsible/index.d.ts",
|
|
122
|
+
"default": "./lib/commonjs/collapsible/index.js"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"./error-boundary": {
|
|
126
|
+
"react-native": "./src/error-boundary/index.ts",
|
|
127
|
+
"import": {
|
|
128
|
+
"types": "./lib/typescript/module/error-boundary/index.d.ts",
|
|
129
|
+
"default": "./lib/module/error-boundary/index.js"
|
|
130
|
+
},
|
|
131
|
+
"require": {
|
|
132
|
+
"types": "./lib/typescript/commonjs/error-boundary/index.d.ts",
|
|
133
|
+
"default": "./lib/commonjs/error-boundary/index.js"
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"./avatar": {
|
|
137
|
+
"react-native": "./src/avatar/index.ts",
|
|
138
|
+
"import": {
|
|
139
|
+
"types": "./lib/typescript/module/avatar/index.d.ts",
|
|
140
|
+
"default": "./lib/module/avatar/index.js"
|
|
141
|
+
},
|
|
142
|
+
"require": {
|
|
143
|
+
"types": "./lib/typescript/commonjs/avatar/index.d.ts",
|
|
144
|
+
"default": "./lib/commonjs/avatar/index.js"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"./loading": {
|
|
148
|
+
"react-native": "./src/loading/index.ts",
|
|
149
|
+
"import": {
|
|
150
|
+
"types": "./lib/typescript/module/loading/index.d.ts",
|
|
151
|
+
"default": "./lib/module/loading/index.js"
|
|
152
|
+
},
|
|
153
|
+
"require": {
|
|
154
|
+
"types": "./lib/typescript/commonjs/loading/index.d.ts",
|
|
155
|
+
"default": "./lib/commonjs/loading/index.js"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"./prompt-input": {
|
|
159
|
+
"react-native": "./src/prompt-input/index.ts",
|
|
160
|
+
"import": {
|
|
161
|
+
"types": "./lib/typescript/module/prompt-input/index.d.ts",
|
|
162
|
+
"default": "./lib/module/prompt-input/index.js"
|
|
163
|
+
},
|
|
164
|
+
"require": {
|
|
165
|
+
"types": "./lib/typescript/commonjs/prompt-input/index.d.ts",
|
|
166
|
+
"default": "./lib/commonjs/prompt-input/index.js"
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"./package.json": "./package.json"
|
|
170
|
+
},
|
|
171
|
+
"files": [
|
|
172
|
+
"src",
|
|
173
|
+
"lib"
|
|
174
|
+
],
|
|
175
|
+
"keywords": [
|
|
176
|
+
"react-native",
|
|
177
|
+
"expo",
|
|
178
|
+
"ui",
|
|
179
|
+
"components",
|
|
180
|
+
"dialog",
|
|
181
|
+
"prompt",
|
|
182
|
+
"button",
|
|
183
|
+
"theme",
|
|
184
|
+
"avatar",
|
|
185
|
+
"loading",
|
|
186
|
+
"divider",
|
|
187
|
+
"collapsible",
|
|
188
|
+
"error-boundary",
|
|
189
|
+
"prompt-input",
|
|
190
|
+
"ai"
|
|
191
|
+
],
|
|
192
|
+
"repository": {
|
|
193
|
+
"type": "git",
|
|
194
|
+
"url": "https://github.com/OxyHQ/Bloom.git"
|
|
195
|
+
},
|
|
196
|
+
"license": "MIT",
|
|
197
|
+
"scripts": {
|
|
198
|
+
"build": "bob build",
|
|
199
|
+
"typescript": "tsc --noEmit",
|
|
200
|
+
"clean": "rm -rf lib",
|
|
201
|
+
"prepare": "bob build || true",
|
|
202
|
+
"release": "rm -rf lib && npm run build && release-it"
|
|
203
|
+
},
|
|
204
|
+
"devDependencies": {
|
|
205
|
+
"@gorhom/bottom-sheet": "^5.2.8",
|
|
206
|
+
"@types/react": "~19.1.0",
|
|
207
|
+
"@types/react-native": "*",
|
|
208
|
+
"react": "19.2.0",
|
|
209
|
+
"react-native": "0.83.2",
|
|
210
|
+
"react-native-builder-bob": "^0.40.16",
|
|
211
|
+
"react-native-gesture-handler": "^2.30.0",
|
|
212
|
+
"react-native-reanimated": "^4.2.2",
|
|
213
|
+
"react-native-safe-area-context": "~5.6.0",
|
|
214
|
+
"react-native-svg": "^15.15.3",
|
|
215
|
+
"release-it": "^19.0.6",
|
|
216
|
+
"typescript": "~5.9.2"
|
|
217
|
+
},
|
|
218
|
+
"peerDependencies": {
|
|
219
|
+
"@gorhom/bottom-sheet": ">=5.0.0",
|
|
220
|
+
"react": ">=18.0.0",
|
|
221
|
+
"react-native": ">=0.73.0",
|
|
222
|
+
"react-native-gesture-handler": ">=2.0.0",
|
|
223
|
+
"react-native-reanimated": ">=3.0.0",
|
|
224
|
+
"react-native-safe-area-context": ">=5.0.0",
|
|
225
|
+
"react-native-svg": ">=13.0.0"
|
|
226
|
+
},
|
|
227
|
+
"peerDependenciesMeta": {
|
|
228
|
+
"@gorhom/bottom-sheet": {
|
|
229
|
+
"optional": true
|
|
230
|
+
},
|
|
231
|
+
"react-native-reanimated": {
|
|
232
|
+
"optional": true
|
|
233
|
+
},
|
|
234
|
+
"react-native-gesture-handler": {
|
|
235
|
+
"optional": true
|
|
236
|
+
},
|
|
237
|
+
"react-native-svg": {
|
|
238
|
+
"optional": true
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"react-native-builder-bob": {
|
|
242
|
+
"source": "src",
|
|
243
|
+
"output": "lib",
|
|
244
|
+
"targets": [
|
|
245
|
+
[
|
|
246
|
+
"commonjs",
|
|
247
|
+
{
|
|
248
|
+
"esm": true
|
|
249
|
+
}
|
|
250
|
+
],
|
|
251
|
+
[
|
|
252
|
+
"module",
|
|
253
|
+
{
|
|
254
|
+
"esm": true
|
|
255
|
+
}
|
|
256
|
+
],
|
|
257
|
+
"typescript"
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import React, { memo, useMemo, useState } from 'react';
|
|
2
|
+
import { View, Image, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../theme/use-theme';
|
|
5
|
+
import type { AvatarProps } from './types';
|
|
6
|
+
|
|
7
|
+
// Squircle clip path normalized to 0–1 coordinate space (viewBox="0 0 1 1").
|
|
8
|
+
const SQUIRCLE_PATH =
|
|
9
|
+
'M0 0.5 L0.00122 0.31674 L0.00489 0.25123 L0.01103 0.20331 L0.01969 0.16478 L0.03097 0.13257 L0.04495 0.10518 L0.0618 0.08177 L0.08177 0.0618 L0.10518 0.04495 L0.13257 0.03097 L0.16478 0.01969 L0.20331 0.01103 L0.25123 0.00489 L0.31674 0.00122 L0.5 0' +
|
|
10
|
+
' L0.68895 0.0014 L0.7564 0.00561 L0.80559 0.01267 L0.84499 0.02264 L0.87771 0.03564 L0.9053 0.05181 L0.92862 0.07138 L0.94819 0.0947 L0.96436 0.12228 L0.97736 0.15501 L0.98733 0.19441 L0.99439 0.2436 L0.9986 0.31105 L1 0.5' +
|
|
11
|
+
' L0.9986 0.68895 L0.99439 0.7564 L0.98733 0.80559 L0.97736 0.84499 L0.96436 0.87771 L0.94819 0.9053 L0.92862 0.92862 L0.9053 0.94819 L0.87771 0.96436 L0.84499 0.97736 L0.80559 0.98733 L0.7564 0.99439 L0.68895 0.9986 L0.5 1' +
|
|
12
|
+
' L0.31105 0.9986 L0.2436 0.99439 L0.19441 0.98733 L0.15501 0.97736 L0.12228 0.96436 L0.0947 0.94819 L0.07138 0.92862 L0.05181 0.9053 L0.03564 0.87771 L0.02264 0.84499 L0.01267 0.80559 L0.00561 0.7564 L0.0014 0.68895 L0 0.5Z';
|
|
13
|
+
|
|
14
|
+
let clipIdCounter = 0;
|
|
15
|
+
|
|
16
|
+
// Lazy-loaded SVG components for squircle shape.
|
|
17
|
+
// Returns null if react-native-svg is not installed.
|
|
18
|
+
type SvgModuleType = typeof import('react-native-svg');
|
|
19
|
+
let svgModule: SvgModuleType | null = null;
|
|
20
|
+
let svgModuleResolved = false;
|
|
21
|
+
|
|
22
|
+
function getSvgModule(): SvgModuleType | null {
|
|
23
|
+
if (!svgModuleResolved) {
|
|
24
|
+
svgModuleResolved = true;
|
|
25
|
+
try {
|
|
26
|
+
svgModule = require('react-native-svg');
|
|
27
|
+
} catch {
|
|
28
|
+
svgModule = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return svgModule;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function SquircleImage({
|
|
35
|
+
uri,
|
|
36
|
+
fallbackSource,
|
|
37
|
+
size,
|
|
38
|
+
fallbackColor,
|
|
39
|
+
onError,
|
|
40
|
+
}: {
|
|
41
|
+
uri?: string;
|
|
42
|
+
fallbackSource?: AvatarProps['fallbackSource'];
|
|
43
|
+
size: number;
|
|
44
|
+
fallbackColor: string;
|
|
45
|
+
onError: () => void;
|
|
46
|
+
}) {
|
|
47
|
+
const svg = getSvgModule();
|
|
48
|
+
if (!svg) {
|
|
49
|
+
// Fallback to circle if react-native-svg is not installed
|
|
50
|
+
return <CircleFallback size={size} fallbackColor={fallbackColor} />;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const { default: Svg, Defs, ClipPath, Path, Image: SvgImage } = svg;
|
|
54
|
+
const clipId = useMemo(() => `bloom-sqc${clipIdCounter++}`, []);
|
|
55
|
+
|
|
56
|
+
const href = uri ? { uri } : fallbackSource;
|
|
57
|
+
if (!href) {
|
|
58
|
+
return <CircleFallback size={size} fallbackColor={fallbackColor} />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
{/* Hidden RN Image for error detection on remote URIs */}
|
|
64
|
+
{uri && (
|
|
65
|
+
<Image
|
|
66
|
+
source={{ uri }}
|
|
67
|
+
style={styles.errorDetector}
|
|
68
|
+
onError={onError}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
<Svg width={size} height={size} viewBox="0 0 1 1">
|
|
72
|
+
<Defs>
|
|
73
|
+
<ClipPath id={clipId}>
|
|
74
|
+
<Path d={SQUIRCLE_PATH} />
|
|
75
|
+
</ClipPath>
|
|
76
|
+
</Defs>
|
|
77
|
+
<SvgImage
|
|
78
|
+
href={href}
|
|
79
|
+
width={1}
|
|
80
|
+
height={1}
|
|
81
|
+
preserveAspectRatio="xMidYMid slice"
|
|
82
|
+
clipPath={`url(#${clipId})`}
|
|
83
|
+
/>
|
|
84
|
+
</Svg>
|
|
85
|
+
</>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function CircleFallback({ size, fallbackColor }: { size: number; fallbackColor: string }) {
|
|
90
|
+
const radius = size / 2;
|
|
91
|
+
return (
|
|
92
|
+
<View
|
|
93
|
+
style={{
|
|
94
|
+
width: size,
|
|
95
|
+
height: size,
|
|
96
|
+
borderRadius: radius,
|
|
97
|
+
backgroundColor: fallbackColor,
|
|
98
|
+
}}
|
|
99
|
+
/>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const AvatarComponent: React.FC<AvatarProps> = ({
|
|
104
|
+
source,
|
|
105
|
+
uri,
|
|
106
|
+
fallbackSource,
|
|
107
|
+
size = 40,
|
|
108
|
+
verified = false,
|
|
109
|
+
verifiedIcon,
|
|
110
|
+
shape = 'circle',
|
|
111
|
+
style,
|
|
112
|
+
imageStyle,
|
|
113
|
+
onPress,
|
|
114
|
+
testID,
|
|
115
|
+
}) => {
|
|
116
|
+
const [errored, setErrored] = useState(false);
|
|
117
|
+
const theme = useTheme();
|
|
118
|
+
const radius = size / 2;
|
|
119
|
+
const fallbackColor = theme.colors.backgroundTertiary;
|
|
120
|
+
|
|
121
|
+
// Resolve source prop: string → uri, object → ImageSourcePropType
|
|
122
|
+
const resolvedUri = useMemo(() => {
|
|
123
|
+
if (typeof source === 'string') return source;
|
|
124
|
+
return uri;
|
|
125
|
+
}, [source, uri]);
|
|
126
|
+
|
|
127
|
+
const resolvedImageSource = useMemo(() => {
|
|
128
|
+
if (source != null && typeof source !== 'string') return source;
|
|
129
|
+
return undefined;
|
|
130
|
+
}, [source]);
|
|
131
|
+
|
|
132
|
+
const effectiveUri = errored ? undefined : resolvedUri;
|
|
133
|
+
|
|
134
|
+
const imageSource = useMemo(() => {
|
|
135
|
+
if (effectiveUri) return { uri: effectiveUri };
|
|
136
|
+
if (resolvedImageSource) return resolvedImageSource;
|
|
137
|
+
return fallbackSource;
|
|
138
|
+
}, [effectiveUri, resolvedImageSource, fallbackSource]);
|
|
139
|
+
|
|
140
|
+
const content = (
|
|
141
|
+
<View style={[styles.container, { width: size, height: size }, style]} testID={testID}>
|
|
142
|
+
{shape === 'squircle' ? (
|
|
143
|
+
<SquircleImage
|
|
144
|
+
uri={effectiveUri}
|
|
145
|
+
fallbackSource={fallbackSource}
|
|
146
|
+
size={size}
|
|
147
|
+
fallbackColor={fallbackColor}
|
|
148
|
+
onError={() => setErrored(true)}
|
|
149
|
+
/>
|
|
150
|
+
) : (
|
|
151
|
+
<View style={[styles.imageContainer, { width: size, height: size, borderRadius: radius }]}>
|
|
152
|
+
{imageSource ? (
|
|
153
|
+
<Image
|
|
154
|
+
source={imageSource}
|
|
155
|
+
onError={() => setErrored(true)}
|
|
156
|
+
resizeMode="cover"
|
|
157
|
+
style={[StyleSheet.absoluteFillObject, { borderRadius: radius }, imageStyle]}
|
|
158
|
+
/>
|
|
159
|
+
) : (
|
|
160
|
+
<CircleFallback size={size} fallbackColor={fallbackColor} />
|
|
161
|
+
)}
|
|
162
|
+
</View>
|
|
163
|
+
)}
|
|
164
|
+
|
|
165
|
+
{verified && verifiedIcon && (
|
|
166
|
+
<View
|
|
167
|
+
style={[
|
|
168
|
+
styles.verifiedBadge,
|
|
169
|
+
{
|
|
170
|
+
width: size * 0.36,
|
|
171
|
+
height: size * 0.36,
|
|
172
|
+
},
|
|
173
|
+
]}
|
|
174
|
+
>
|
|
175
|
+
{verifiedIcon}
|
|
176
|
+
</View>
|
|
177
|
+
)}
|
|
178
|
+
</View>
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
if (onPress) {
|
|
182
|
+
return <TouchableOpacity onPress={onPress}>{content}</TouchableOpacity>;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return content;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
const styles = StyleSheet.create({
|
|
189
|
+
container: {
|
|
190
|
+
position: 'relative',
|
|
191
|
+
overflow: 'visible',
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
},
|
|
195
|
+
imageContainer: {
|
|
196
|
+
overflow: 'hidden',
|
|
197
|
+
justifyContent: 'center',
|
|
198
|
+
alignItems: 'center',
|
|
199
|
+
},
|
|
200
|
+
verifiedBadge: {
|
|
201
|
+
position: 'absolute',
|
|
202
|
+
bottom: -2,
|
|
203
|
+
right: -2,
|
|
204
|
+
justifyContent: 'center',
|
|
205
|
+
alignItems: 'center',
|
|
206
|
+
zIndex: 1,
|
|
207
|
+
},
|
|
208
|
+
errorDetector: {
|
|
209
|
+
position: 'absolute',
|
|
210
|
+
width: 1,
|
|
211
|
+
height: 1,
|
|
212
|
+
opacity: 0,
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
export const Avatar = memo(AvatarComponent);
|
|
217
|
+
Avatar.displayName = 'Avatar';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ImageSourcePropType, StyleProp, ViewStyle, ImageStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type AvatarShape = 'circle' | 'squircle';
|
|
5
|
+
|
|
6
|
+
export interface AvatarProps {
|
|
7
|
+
/**
|
|
8
|
+
* Flexible image source — accepts a URL string, an ImageSourcePropType
|
|
9
|
+
* (e.g. require('./img.png') or { uri: '...' }), or null/undefined.
|
|
10
|
+
* Takes precedence over the `uri` prop when both are provided.
|
|
11
|
+
*/
|
|
12
|
+
source?: string | ImageSourcePropType | null;
|
|
13
|
+
/** Direct URI string. Use `source` for more flexible input. */
|
|
14
|
+
uri?: string;
|
|
15
|
+
/** Fallback image source when source/uri is missing or errors (defaults to colored circle) */
|
|
16
|
+
fallbackSource?: ImageSourcePropType;
|
|
17
|
+
/** Avatar size in pixels (defaults to 40) */
|
|
18
|
+
size?: number;
|
|
19
|
+
/** Whether to show a verified badge */
|
|
20
|
+
verified?: boolean;
|
|
21
|
+
/** Custom verified badge icon (rendered at bottom-right) */
|
|
22
|
+
verifiedIcon?: ReactNode;
|
|
23
|
+
/** Shape of the avatar (defaults to 'circle'). 'squircle' requires react-native-svg. */
|
|
24
|
+
shape?: AvatarShape;
|
|
25
|
+
/** Container style */
|
|
26
|
+
style?: StyleProp<ViewStyle>;
|
|
27
|
+
/** Image style (circle shape only) */
|
|
28
|
+
imageStyle?: StyleProp<ImageStyle>;
|
|
29
|
+
/** Press handler — wraps avatar in TouchableOpacity when provided */
|
|
30
|
+
onPress?: () => void;
|
|
31
|
+
testID?: string;
|
|
32
|
+
}
|