@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,69 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export type LoadingVariant = 'spinner' | 'top' | 'skeleton' | 'inline';
|
|
5
|
+
export type LoadingSize = 'small' | 'medium' | 'large';
|
|
6
|
+
|
|
7
|
+
interface BaseLoadingProps {
|
|
8
|
+
/** Variant type */
|
|
9
|
+
variant?: LoadingVariant;
|
|
10
|
+
/** Size of the loading indicator */
|
|
11
|
+
size?: LoadingSize;
|
|
12
|
+
/** Custom color (defaults to theme primary) */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Custom container style */
|
|
15
|
+
style?: ViewStyle;
|
|
16
|
+
/** Whether loading is active (for animated variants) */
|
|
17
|
+
showLoading?: boolean;
|
|
18
|
+
testID?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface SpinnerLoadingProps extends BaseLoadingProps {
|
|
22
|
+
variant?: 'spinner';
|
|
23
|
+
/** Optional text to display below spinner */
|
|
24
|
+
text?: string;
|
|
25
|
+
/** Custom style for the text */
|
|
26
|
+
textStyle?: TextStyle;
|
|
27
|
+
/** Whether to show text */
|
|
28
|
+
showText?: boolean;
|
|
29
|
+
/** Custom icon size (overrides size prop) */
|
|
30
|
+
iconSize?: number;
|
|
31
|
+
/** Custom spinner icon (defaults to ActivityIndicator) */
|
|
32
|
+
spinnerIcon?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface TopLoadingProps extends BaseLoadingProps {
|
|
36
|
+
variant: 'top';
|
|
37
|
+
/** Custom icon size */
|
|
38
|
+
iconSize?: number;
|
|
39
|
+
/** Custom container height offset */
|
|
40
|
+
heightOffset?: number;
|
|
41
|
+
/** Custom spinner icon (defaults to ActivityIndicator) */
|
|
42
|
+
spinnerIcon?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SkeletonLoadingProps extends BaseLoadingProps {
|
|
46
|
+
variant: 'skeleton';
|
|
47
|
+
/** Number of skeleton lines */
|
|
48
|
+
lines?: number;
|
|
49
|
+
/** Width of skeleton (percentage or pixels) */
|
|
50
|
+
width?: number | string;
|
|
51
|
+
/** Height of skeleton lines */
|
|
52
|
+
lineHeight?: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface InlineLoadingProps extends BaseLoadingProps {
|
|
56
|
+
variant: 'inline';
|
|
57
|
+
/** Text to show next to spinner */
|
|
58
|
+
text?: string;
|
|
59
|
+
/** Custom style for the text */
|
|
60
|
+
textStyle?: TextStyle;
|
|
61
|
+
/** Custom spinner icon (defaults to ActivityIndicator) */
|
|
62
|
+
spinnerIcon?: ReactNode;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export type LoadingProps =
|
|
66
|
+
| SpinnerLoadingProps
|
|
67
|
+
| TopLoadingProps
|
|
68
|
+
| SkeletonLoadingProps
|
|
69
|
+
| InlineLoadingProps;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React, {
|
|
2
|
+
createContext,
|
|
3
|
+
Fragment,
|
|
4
|
+
memo,
|
|
5
|
+
useCallback,
|
|
6
|
+
useContext,
|
|
7
|
+
useEffect,
|
|
8
|
+
useId,
|
|
9
|
+
useMemo,
|
|
10
|
+
useRef,
|
|
11
|
+
useState,
|
|
12
|
+
} from 'react';
|
|
13
|
+
import { View, StyleSheet, Platform } from 'react-native';
|
|
14
|
+
|
|
15
|
+
type Component = React.ReactElement;
|
|
16
|
+
|
|
17
|
+
type ContextType = {
|
|
18
|
+
outlet: Component | null;
|
|
19
|
+
append(id: string, component: Component): void;
|
|
20
|
+
remove(id: string): void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ComponentMap = {
|
|
24
|
+
[id: string]: Component | null;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
function createPortalGroup() {
|
|
28
|
+
const Context = createContext<ContextType>({
|
|
29
|
+
outlet: null,
|
|
30
|
+
append: () => {},
|
|
31
|
+
remove: () => {},
|
|
32
|
+
});
|
|
33
|
+
Context.displayName = 'BloomPortalContext';
|
|
34
|
+
|
|
35
|
+
function Provider(props: React.PropsWithChildren<object>) {
|
|
36
|
+
const map = useRef<ComponentMap>({});
|
|
37
|
+
const [outlet, setOutlet] = useState<ContextType['outlet']>(null);
|
|
38
|
+
|
|
39
|
+
const append = useCallback<ContextType['append']>((id, component) => {
|
|
40
|
+
map.current[id] = <Fragment key={id}>{component}</Fragment>;
|
|
41
|
+
setOutlet(<>{Object.values(map.current)}</>);
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
const remove = useCallback<ContextType['remove']>((id) => {
|
|
45
|
+
delete map.current[id];
|
|
46
|
+
setOutlet(<>{Object.values(map.current)}</>);
|
|
47
|
+
}, []);
|
|
48
|
+
|
|
49
|
+
const contextValue = useMemo(
|
|
50
|
+
() => ({ outlet, append, remove }),
|
|
51
|
+
[outlet, append, remove],
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<Context.Provider value={contextValue}>
|
|
56
|
+
{props.children}
|
|
57
|
+
</Context.Provider>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function Outlet() {
|
|
62
|
+
const ctx = useContext(Context);
|
|
63
|
+
if (Platform.OS === 'web') {
|
|
64
|
+
return <View style={styles.portalOutlet}>{ctx.outlet}</View>;
|
|
65
|
+
}
|
|
66
|
+
return ctx.outlet;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function Portal({ children }: React.PropsWithChildren<object>) {
|
|
70
|
+
const { append, remove } = useContext(Context);
|
|
71
|
+
const id = useId();
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
append(id, children as Component);
|
|
75
|
+
return () => remove(id);
|
|
76
|
+
}, [id, children, append, remove]);
|
|
77
|
+
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return { Provider, Outlet, Portal };
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const DefaultPortal = createPortalGroup();
|
|
85
|
+
|
|
86
|
+
export const Provider = DefaultPortal.Provider;
|
|
87
|
+
export const Outlet = memo(DefaultPortal.Outlet);
|
|
88
|
+
export const Portal = DefaultPortal.Portal;
|
|
89
|
+
|
|
90
|
+
const styles = StyleSheet.create({
|
|
91
|
+
portalOutlet: {
|
|
92
|
+
position: 'fixed' as 'absolute',
|
|
93
|
+
top: 0,
|
|
94
|
+
left: 0,
|
|
95
|
+
right: 0,
|
|
96
|
+
bottom: 0,
|
|
97
|
+
pointerEvents: 'box-none',
|
|
98
|
+
zIndex: 999999,
|
|
99
|
+
},
|
|
100
|
+
});
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import React, { createContext, useCallback, useContext, useId, useMemo } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, Platform, type GestureResponderEvent } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../theme/use-theme';
|
|
5
|
+
import type { ThemeColors } from '../theme/types';
|
|
6
|
+
import * as Dialog from '../dialog';
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
type DialogControlProps as PromptControlProps,
|
|
10
|
+
useDialogControl as usePromptControl,
|
|
11
|
+
} from '../dialog';
|
|
12
|
+
|
|
13
|
+
const PromptContext = createContext<{
|
|
14
|
+
titleId: string;
|
|
15
|
+
descriptionId: string;
|
|
16
|
+
}>({
|
|
17
|
+
titleId: '',
|
|
18
|
+
descriptionId: '',
|
|
19
|
+
});
|
|
20
|
+
PromptContext.displayName = 'BloomPromptContext';
|
|
21
|
+
|
|
22
|
+
export function Outer({
|
|
23
|
+
children,
|
|
24
|
+
control,
|
|
25
|
+
testID,
|
|
26
|
+
onClose,
|
|
27
|
+
}: React.PropsWithChildren<{
|
|
28
|
+
control: Dialog.DialogControlProps;
|
|
29
|
+
testID?: string;
|
|
30
|
+
onClose?: () => void;
|
|
31
|
+
}>) {
|
|
32
|
+
const titleId = useId();
|
|
33
|
+
const descriptionId = useId();
|
|
34
|
+
|
|
35
|
+
const context = useMemo(
|
|
36
|
+
() => ({ titleId, descriptionId }),
|
|
37
|
+
[titleId, descriptionId],
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Dialog.Outer
|
|
42
|
+
control={control}
|
|
43
|
+
testID={testID}
|
|
44
|
+
onClose={onClose}
|
|
45
|
+
webOptions={{ alignCenter: true }}
|
|
46
|
+
preventExpansion
|
|
47
|
+
>
|
|
48
|
+
<Dialog.Handle />
|
|
49
|
+
<PromptContext.Provider value={context}>
|
|
50
|
+
<Dialog.ScrollableInner
|
|
51
|
+
label=""
|
|
52
|
+
style={Platform.select({
|
|
53
|
+
web: { maxWidth: 320, borderRadius: 36 },
|
|
54
|
+
default: undefined,
|
|
55
|
+
})}
|
|
56
|
+
>
|
|
57
|
+
{children}
|
|
58
|
+
</Dialog.ScrollableInner>
|
|
59
|
+
</PromptContext.Provider>
|
|
60
|
+
</Dialog.Outer>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function TitleText({ children }: React.PropsWithChildren) {
|
|
65
|
+
const { titleId } = useContext(PromptContext);
|
|
66
|
+
const theme = useTheme();
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<Text
|
|
70
|
+
nativeID={titleId}
|
|
71
|
+
style={{
|
|
72
|
+
fontSize: 22,
|
|
73
|
+
fontWeight: '600',
|
|
74
|
+
color: theme.colors.text,
|
|
75
|
+
paddingBottom: 4,
|
|
76
|
+
lineHeight: 30,
|
|
77
|
+
}}
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
</Text>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function DescriptionText({
|
|
85
|
+
children,
|
|
86
|
+
selectable,
|
|
87
|
+
}: React.PropsWithChildren<{ selectable?: boolean }>) {
|
|
88
|
+
const { descriptionId } = useContext(PromptContext);
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
|
|
91
|
+
return (
|
|
92
|
+
<Text
|
|
93
|
+
nativeID={descriptionId}
|
|
94
|
+
selectable={selectable}
|
|
95
|
+
style={{
|
|
96
|
+
fontSize: 16,
|
|
97
|
+
color: theme.colors.textSecondary,
|
|
98
|
+
paddingBottom: 16,
|
|
99
|
+
lineHeight: 22,
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{children}
|
|
103
|
+
</Text>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function Actions({ children }: { children: React.ReactNode }) {
|
|
108
|
+
return <View style={{ width: '100%', gap: 8, justifyContent: 'flex-end' }}>{children}</View>;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function Content({ children }: { children: React.ReactNode }) {
|
|
112
|
+
return <View style={{ paddingBottom: 8 }}>{children}</View>;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export type ActionColor = 'primary' | 'primary_subtle' | 'secondary' | 'negative' | 'negative_subtle';
|
|
116
|
+
|
|
117
|
+
function getActionColors(color: ActionColor, colors: ThemeColors) {
|
|
118
|
+
switch (color) {
|
|
119
|
+
case 'negative':
|
|
120
|
+
return { background: colors.negative, foreground: colors.negativeForeground };
|
|
121
|
+
case 'negative_subtle':
|
|
122
|
+
return { background: colors.negativeSubtle, foreground: colors.negativeSubtleForeground };
|
|
123
|
+
case 'primary_subtle':
|
|
124
|
+
return { background: colors.primarySubtle, foreground: colors.primarySubtleForeground };
|
|
125
|
+
case 'secondary':
|
|
126
|
+
return { background: colors.contrast50, foreground: colors.text };
|
|
127
|
+
case 'primary':
|
|
128
|
+
default:
|
|
129
|
+
return { background: colors.primary, foreground: '#FFFFFF' };
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function Cancel({ cta }: { cta?: string }) {
|
|
134
|
+
const { close } = Dialog.useDialogContext();
|
|
135
|
+
const theme = useTheme();
|
|
136
|
+
const { background } = getActionColors('secondary', theme.colors);
|
|
137
|
+
|
|
138
|
+
return (
|
|
139
|
+
<TouchableOpacity
|
|
140
|
+
style={{
|
|
141
|
+
borderRadius: 9999,
|
|
142
|
+
alignItems: 'center',
|
|
143
|
+
justifyContent: 'center',
|
|
144
|
+
backgroundColor: background,
|
|
145
|
+
paddingVertical: 12,
|
|
146
|
+
paddingHorizontal: 24,
|
|
147
|
+
}}
|
|
148
|
+
onPress={() => close()}
|
|
149
|
+
activeOpacity={0.7}
|
|
150
|
+
>
|
|
151
|
+
<Text style={{ fontSize: 16, fontWeight: '500', color: theme.colors.text }}>
|
|
152
|
+
{cta ?? 'Cancel'}
|
|
153
|
+
</Text>
|
|
154
|
+
</TouchableOpacity>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export function Action({
|
|
159
|
+
onPress,
|
|
160
|
+
color = 'primary',
|
|
161
|
+
cta,
|
|
162
|
+
disabled = false,
|
|
163
|
+
shouldCloseOnPress = true,
|
|
164
|
+
testID,
|
|
165
|
+
}: {
|
|
166
|
+
onPress: (e: GestureResponderEvent) => void;
|
|
167
|
+
color?: ActionColor;
|
|
168
|
+
cta?: string;
|
|
169
|
+
disabled?: boolean;
|
|
170
|
+
shouldCloseOnPress?: boolean;
|
|
171
|
+
testID?: string;
|
|
172
|
+
}) {
|
|
173
|
+
const { close } = Dialog.useDialogContext();
|
|
174
|
+
const theme = useTheme();
|
|
175
|
+
|
|
176
|
+
const handleOnPress = useCallback(
|
|
177
|
+
(e: GestureResponderEvent) => {
|
|
178
|
+
if (shouldCloseOnPress) {
|
|
179
|
+
close(() => onPress(e));
|
|
180
|
+
} else {
|
|
181
|
+
onPress(e);
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
[close, onPress, shouldCloseOnPress],
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
const { background, foreground } = getActionColors(color, theme.colors);
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
<TouchableOpacity
|
|
191
|
+
style={{
|
|
192
|
+
borderRadius: 9999,
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
justifyContent: 'center',
|
|
195
|
+
backgroundColor: background,
|
|
196
|
+
opacity: disabled ? 0.5 : 1,
|
|
197
|
+
paddingVertical: 12,
|
|
198
|
+
paddingHorizontal: 24,
|
|
199
|
+
}}
|
|
200
|
+
onPress={handleOnPress}
|
|
201
|
+
disabled={disabled}
|
|
202
|
+
activeOpacity={0.7}
|
|
203
|
+
testID={testID}
|
|
204
|
+
>
|
|
205
|
+
<Text style={{ fontSize: 16, fontWeight: '500', color: foreground }}>
|
|
206
|
+
{cta ?? 'Confirm'}
|
|
207
|
+
</Text>
|
|
208
|
+
</TouchableOpacity>
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export function Basic({
|
|
213
|
+
control,
|
|
214
|
+
title,
|
|
215
|
+
description,
|
|
216
|
+
cancelButtonCta,
|
|
217
|
+
confirmButtonCta,
|
|
218
|
+
onConfirm,
|
|
219
|
+
confirmButtonColor,
|
|
220
|
+
showCancel = true,
|
|
221
|
+
}: {
|
|
222
|
+
control: Dialog.DialogOuterProps['control'];
|
|
223
|
+
title: string;
|
|
224
|
+
description?: string;
|
|
225
|
+
cancelButtonCta?: string;
|
|
226
|
+
confirmButtonCta?: string;
|
|
227
|
+
onConfirm: (e: GestureResponderEvent) => void;
|
|
228
|
+
confirmButtonColor?: ActionColor;
|
|
229
|
+
showCancel?: boolean;
|
|
230
|
+
}) {
|
|
231
|
+
return (
|
|
232
|
+
<Outer control={control} testID="confirmModal">
|
|
233
|
+
<Content>
|
|
234
|
+
<TitleText>{title}</TitleText>
|
|
235
|
+
{description && <DescriptionText>{description}</DescriptionText>}
|
|
236
|
+
</Content>
|
|
237
|
+
<Actions>
|
|
238
|
+
<Action
|
|
239
|
+
cta={confirmButtonCta}
|
|
240
|
+
onPress={onConfirm}
|
|
241
|
+
color={confirmButtonColor}
|
|
242
|
+
testID="confirmBtn"
|
|
243
|
+
/>
|
|
244
|
+
{showCancel && <Cancel cta={cancelButtonCta} />}
|
|
245
|
+
</Actions>
|
|
246
|
+
</Outer>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { useTheme } from '../theme/use-theme';
|
|
5
|
+
import { usePromptInput } from './context';
|
|
6
|
+
import type { PromptInputActionsProps } from './types';
|
|
7
|
+
|
|
8
|
+
export function PromptInputActions({
|
|
9
|
+
children,
|
|
10
|
+
style,
|
|
11
|
+
testID,
|
|
12
|
+
}: PromptInputActionsProps) {
|
|
13
|
+
const { isFullscreen } = usePromptInput();
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<View
|
|
18
|
+
style={[
|
|
19
|
+
{
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
gap: 8,
|
|
23
|
+
},
|
|
24
|
+
isFullscreen && {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
bottom: 16,
|
|
27
|
+
left: 16,
|
|
28
|
+
right: 16,
|
|
29
|
+
maxWidth: 672,
|
|
30
|
+
alignSelf: 'center',
|
|
31
|
+
borderRadius: 9999,
|
|
32
|
+
borderWidth: 1,
|
|
33
|
+
borderColor: theme.colors.border,
|
|
34
|
+
backgroundColor: theme.colors.background,
|
|
35
|
+
paddingHorizontal: 16,
|
|
36
|
+
paddingVertical: 12,
|
|
37
|
+
},
|
|
38
|
+
style,
|
|
39
|
+
]}
|
|
40
|
+
testID={testID}
|
|
41
|
+
>
|
|
42
|
+
{children}
|
|
43
|
+
</View>
|
|
44
|
+
);
|
|
45
|
+
}
|