@oxyhq/bloom 0.4.0 → 0.5.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/README.md +105 -90
- package/lib/commonjs/bottom-sheet/index.js +2 -2
- package/lib/commonjs/context-menu/index.js +18 -19
- package/lib/commonjs/context-menu/index.js.map +1 -1
- package/lib/commonjs/dialog/BloomDialogProvider.js +61 -0
- package/lib/commonjs/dialog/BloomDialogProvider.js.map +1 -0
- package/lib/commonjs/dialog/BloomDialogProvider.web.js +45 -0
- package/lib/commonjs/dialog/BloomDialogProvider.web.js.map +1 -0
- package/lib/commonjs/dialog/Dialog.js +197 -100
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +194 -84
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +149 -0
- package/lib/commonjs/dialog/SheetShell.js.map +1 -0
- package/lib/commonjs/dialog/alert-store.js +116 -0
- package/lib/commonjs/dialog/alert-store.js.map +1 -0
- package/lib/commonjs/dialog/alert.js +38 -0
- package/lib/commonjs/dialog/alert.js.map +1 -0
- package/lib/commonjs/dialog/context.js +10 -2
- package/lib/commonjs/dialog/context.js.map +1 -1
- package/lib/commonjs/dialog/index.js +8 -24
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +10 -20
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/fonts/FontLoader.js +6 -5
- package/lib/commonjs/fonts/FontLoader.js.map +1 -1
- package/lib/commonjs/fonts/apply-font-faces.js +4 -4
- package/lib/commonjs/fonts/apply-font-faces.web.js +13 -12
- package/lib/commonjs/fonts/apply-font-faces.web.js.map +1 -1
- package/lib/commonjs/fonts/font-assets.js +2 -2
- package/lib/commonjs/fonts/font-data.web.js +22 -0
- package/lib/commonjs/fonts/font-data.web.js.map +1 -0
- package/lib/commonjs/index.js +101 -66
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +101 -66
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/menu/index.js +21 -23
- package/lib/commonjs/menu/index.js.map +1 -1
- package/lib/commonjs/select/index.js +26 -27
- package/lib/commonjs/select/index.js.map +1 -1
- package/lib/commonjs/toast/index.js +42 -13
- package/lib/commonjs/toast/index.js.map +1 -1
- package/lib/commonjs/toast/index.web.js +19 -15
- package/lib/commonjs/toast/index.web.js.map +1 -1
- package/lib/module/bottom-sheet/index.js +2 -2
- package/lib/module/context-menu/index.js +15 -16
- package/lib/module/context-menu/index.js.map +1 -1
- package/lib/module/dialog/BloomDialogProvider.js +57 -0
- package/lib/module/dialog/BloomDialogProvider.js.map +1 -0
- package/lib/module/dialog/BloomDialogProvider.web.js +41 -0
- package/lib/module/dialog/BloomDialogProvider.web.js.map +1 -0
- package/lib/module/dialog/Dialog.js +199 -87
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +195 -70
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +143 -0
- package/lib/module/dialog/SheetShell.js.map +1 -0
- package/lib/module/dialog/alert-store.js +107 -0
- package/lib/module/dialog/alert-store.js.map +1 -0
- package/lib/module/dialog/alert.js +35 -0
- package/lib/module/dialog/alert.js.map +1 -0
- package/lib/module/dialog/context.js +10 -2
- package/lib/module/dialog/context.js.map +1 -1
- package/lib/module/dialog/index.js +3 -1
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +9 -7
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/fonts/FontLoader.js +6 -5
- package/lib/module/fonts/FontLoader.js.map +1 -1
- package/lib/module/fonts/apply-font-faces.js +4 -4
- package/lib/module/fonts/apply-font-faces.web.js +13 -10
- package/lib/module/fonts/apply-font-faces.web.js.map +1 -1
- package/lib/module/fonts/font-assets.js +2 -2
- package/lib/module/fonts/font-data.web.js +18 -0
- package/lib/module/fonts/font-data.web.js.map +1 -0
- package/lib/module/fonts/index.web.js +4 -4
- package/lib/module/index.js +2 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +2 -3
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/menu/index.js +11 -13
- package/lib/module/menu/index.js.map +1 -1
- package/lib/module/select/index.js +27 -28
- package/lib/module/select/index.js.map +1 -1
- package/lib/module/toast/index.js +41 -11
- package/lib/module/toast/index.js.map +1 -1
- package/lib/module/toast/index.web.js +18 -13
- package/lib/module/toast/index.web.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts +1 -1
- package/lib/typescript/commonjs/context-menu/index.d.ts +4 -3
- package/lib/typescript/commonjs/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts +27 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts +15 -0
- package/lib/typescript/commonjs/dialog/BloomDialogProvider.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/Dialog.d.ts +37 -10
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts +26 -10
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts +31 -0
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/alert-store.d.ts +70 -0
- package/lib/typescript/commonjs/dialog/alert-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/alert.d.ts +27 -0
- package/lib/typescript/commonjs/dialog/alert.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/context.d.ts +7 -0
- package/lib/typescript/commonjs/dialog/context.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.d.ts +5 -2
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +5 -2
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +70 -15
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/fonts/FontLoader.d.ts.map +1 -1
- package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts +8 -1
- package/lib/typescript/commonjs/fonts/apply-font-faces.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts +5 -0
- package/lib/typescript/commonjs/fonts/font-data.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +3 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +3 -3
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.d.ts +4 -4
- package/lib/typescript/commonjs/menu/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/index.d.ts +32 -3
- package/lib/typescript/commonjs/toast/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/toast/index.web.d.ts +14 -7
- package/lib/typescript/commonjs/toast/index.web.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.d.ts +1 -1
- package/lib/typescript/module/context-menu/index.d.ts +4 -3
- package/lib/typescript/module/context-menu/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/BloomDialogProvider.d.ts +27 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.d.ts.map +1 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts +15 -0
- package/lib/typescript/module/dialog/BloomDialogProvider.web.d.ts.map +1 -0
- package/lib/typescript/module/dialog/Dialog.d.ts +37 -10
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts +26 -10
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts +31 -0
- package/lib/typescript/module/dialog/SheetShell.d.ts.map +1 -0
- package/lib/typescript/module/dialog/alert-store.d.ts +70 -0
- package/lib/typescript/module/dialog/alert-store.d.ts.map +1 -0
- package/lib/typescript/module/dialog/alert.d.ts +27 -0
- package/lib/typescript/module/dialog/alert.d.ts.map +1 -0
- package/lib/typescript/module/dialog/context.d.ts +7 -0
- package/lib/typescript/module/dialog/context.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.d.ts +5 -2
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +5 -2
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +70 -15
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/fonts/FontLoader.d.ts.map +1 -1
- package/lib/typescript/module/fonts/apply-font-faces.web.d.ts +8 -1
- package/lib/typescript/module/fonts/apply-font-faces.web.d.ts.map +1 -1
- package/lib/typescript/module/fonts/font-data.web.d.ts +5 -0
- package/lib/typescript/module/fonts/font-data.web.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +3 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +3 -3
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.d.ts +4 -4
- package/lib/typescript/module/menu/index.d.ts.map +1 -1
- package/lib/typescript/module/select/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/index.d.ts +32 -3
- package/lib/typescript/module/toast/index.d.ts.map +1 -1
- package/lib/typescript/module/toast/index.web.d.ts +14 -7
- package/lib/typescript/module/toast/index.web.d.ts.map +1 -1
- package/package.json +38 -18
- package/src/__tests__/Dialog.test.tsx +177 -0
- package/src/avatar/Avatar.stories.tsx +69 -0
- package/src/bottom-sheet/BottomSheet.stories.tsx +92 -0
- package/src/bottom-sheet/index.tsx +3 -3
- package/src/button/Button.stories.tsx +94 -0
- package/src/context-menu/ContextMenu.stories.tsx +71 -0
- package/src/context-menu/index.tsx +12 -12
- package/src/dialog/BloomDialogProvider.tsx +61 -0
- package/src/dialog/BloomDialogProvider.web.tsx +46 -0
- package/src/dialog/Dialog.stories.tsx +112 -0
- package/src/dialog/Dialog.tsx +217 -64
- package/src/dialog/Dialog.web.tsx +240 -75
- package/src/dialog/SheetShell.tsx +154 -0
- package/src/dialog/alert-store.ts +126 -0
- package/src/dialog/alert.ts +42 -0
- package/src/dialog/context.ts +14 -3
- package/src/dialog/index.ts +14 -2
- package/src/dialog/index.web.ts +20 -8
- package/src/dialog/types.ts +73 -16
- package/src/fonts/FontLoader.tsx +6 -5
- package/src/fonts/apply-font-faces.ts +4 -4
- package/src/fonts/apply-font-faces.web.ts +18 -10
- package/src/fonts/font-assets.ts +2 -2
- package/src/fonts/font-data.web.ts +15 -0
- package/src/fonts/index.web.ts +4 -4
- package/src/index.ts +17 -3
- package/src/index.web.ts +17 -3
- package/src/loading/Loading.stories.tsx +60 -0
- package/src/menu/Menu.stories.tsx +79 -0
- package/src/menu/index.tsx +13 -17
- package/src/prompt-input/PromptInput.stories.tsx +82 -0
- package/src/select/Select.stories.tsx +84 -0
- package/src/select/index.tsx +30 -30
- package/src/settings-list/SettingsList.stories.tsx +106 -0
- package/src/text-field/TextField.stories.tsx +90 -0
- package/src/toast/Toast.stories.tsx +109 -0
- package/src/toast/index.tsx +55 -11
- package/src/toast/index.web.tsx +33 -13
- package/lib/commonjs/fonts/assets/BlomusModernus-Bold.woff2 +0 -0
- package/lib/commonjs/fonts/assets/BlomusModernus-Regular.woff2 +0 -0
- package/lib/commonjs/fonts/assets/GeistMono-Variable.woff2 +0 -0
- package/lib/commonjs/fonts/assets/InterVariable.woff2 +0 -0
- package/lib/commonjs/prompt/Prompt.js +0 -267
- package/lib/commonjs/prompt/Prompt.js.map +0 -1
- package/lib/commonjs/prompt/index.js +0 -61
- package/lib/commonjs/prompt/index.js.map +0 -1
- package/lib/module/fonts/assets/BlomusModernus-Bold.woff2 +0 -0
- package/lib/module/fonts/assets/BlomusModernus-Regular.woff2 +0 -0
- package/lib/module/fonts/assets/GeistMono-Variable.woff2 +0 -0
- package/lib/module/fonts/assets/InterVariable.woff2 +0 -0
- package/lib/module/prompt/Prompt.js +0 -250
- package/lib/module/prompt/Prompt.js.map +0 -1
- package/lib/module/prompt/index.js +0 -4
- package/lib/module/prompt/index.js.map +0 -1
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.fonts-web.test.d.ts +0 -5
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.fonts-web.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/BloomThemeProvider.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/BottomSheet.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/BottomSheet.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/Button.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/Button.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/Code.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/Code.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/FontLoader.native.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/FontLoader.native.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/Pre.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/Pre.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/SettingsList.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/SettingsList.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/apply-font-faces.test.d.ts +0 -5
- package/lib/typescript/commonjs/__tests__/apply-font-faces.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/__tests__/theme.test.d.ts +0 -2
- package/lib/typescript/commonjs/__tests__/theme.test.d.ts.map +0 -1
- package/lib/typescript/commonjs/prompt/Prompt.d.ts +0 -42
- package/lib/typescript/commonjs/prompt/Prompt.d.ts.map +0 -1
- package/lib/typescript/commonjs/prompt/index.d.ts +0 -3
- package/lib/typescript/commonjs/prompt/index.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/BloomThemeProvider.fonts-web.test.d.ts +0 -5
- package/lib/typescript/module/__tests__/BloomThemeProvider.fonts-web.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/BloomThemeProvider.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/BloomThemeProvider.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/BottomSheet.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/BottomSheet.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/Button.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/Button.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/Code.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/Code.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/FontLoader.native.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/FontLoader.native.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/Pre.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/Pre.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/SettingsList.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/SettingsList.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/apply-font-faces.test.d.ts +0 -5
- package/lib/typescript/module/__tests__/apply-font-faces.test.d.ts.map +0 -1
- package/lib/typescript/module/__tests__/theme.test.d.ts +0 -2
- package/lib/typescript/module/__tests__/theme.test.d.ts.map +0 -1
- package/lib/typescript/module/prompt/Prompt.d.ts +0 -42
- package/lib/typescript/module/prompt/Prompt.d.ts.map +0 -1
- package/lib/typescript/module/prompt/index.d.ts +0 -3
- package/lib/typescript/module/prompt/index.d.ts.map +0 -1
- package/src/prompt/Prompt.tsx +0 -247
- package/src/prompt/index.ts +0 -13
|
@@ -3,10 +3,17 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Web-only. The native counterpart in `apply-font-faces.ts` is a no-op
|
|
5
5
|
* stub — Metro cannot parse `.woff2` imports, so the file split keeps
|
|
6
|
-
*
|
|
6
|
+
* the font payload out of the native bundle entirely. Idempotent: safe to
|
|
7
7
|
* call multiple times; subsequent calls early-return after the
|
|
8
8
|
* `<style id="bloom-fonts">` tag has been mounted. SSR-safe via the
|
|
9
9
|
* `typeof document === 'undefined'` guard.
|
|
10
|
+
*
|
|
11
|
+
* The font URLs come from `./font-data.web`, a generated module that
|
|
12
|
+
* embeds the woff2 bytes as base64 data URLs. Inlining (rather than
|
|
13
|
+
* relying on bundler asset loaders for `.woff2`) means consumers do not
|
|
14
|
+
* have to extend Metro's `assetExts` or add a webpack/Vite asset rule —
|
|
15
|
+
* the published JS is self-contained. See `scripts/generate-font-data.mjs`
|
|
16
|
+
* for the rationale and trade-offs.
|
|
10
17
|
*/
|
|
11
18
|
export declare function applyFontFaces(): void;
|
|
12
19
|
//# sourceMappingURL=apply-font-faces.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-font-faces.web.d.ts","sourceRoot":"","sources":["../../../../src/fonts/apply-font-faces.web.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apply-font-faces.web.d.ts","sourceRoot":"","sources":["../../../../src/fonts/apply-font-faces.web.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAkBrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"font-data.web.d.ts","sourceRoot":"","sources":["../../../../src/fonts/font-data.web.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,qBAAqB,EAAE,MAA0oqG,CAAC;AAC/qqG,eAAO,MAAM,kBAAkB,EAAE,MAA8lqG,CAAC;AAChoqG,eAAO,MAAM,aAAa,EAAE,MAA039D,CAAC;AACv59D,eAAO,MAAM,iBAAiB,EAAE,MAA09tC,CAAC"}
|
|
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
|
|
|
9
9
|
export * as Icons from './icons';
|
|
10
10
|
export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
|
|
11
11
|
export * from './portal';
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog';
|
|
13
|
+
export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog';
|
|
14
14
|
export * from './button';
|
|
15
15
|
export * from './grouped-buttons';
|
|
16
16
|
export * from './divider';
|
|
@@ -22,7 +22,7 @@ export * from './avatar';
|
|
|
22
22
|
export * from './loading';
|
|
23
23
|
export * as PromptInput from './prompt-input';
|
|
24
24
|
export * from './switch';
|
|
25
|
-
export
|
|
25
|
+
export { toast, type Toast } from './toast';
|
|
26
26
|
export * as Typography from './typography';
|
|
27
27
|
export * as Skeleton from './skeleton';
|
|
28
28
|
export * as Grid from './grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAGhF,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,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OAAO,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAG9C,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC"}
|
|
@@ -9,8 +9,8 @@ export { useThrottledValue } from './hooks/useThrottledValue';
|
|
|
9
9
|
export * as Icons from './icons';
|
|
10
10
|
export { type Props as IconProps, sizes as iconSizes, useCommonSVGProps } from './icons/common';
|
|
11
11
|
export * from './portal/index.web';
|
|
12
|
-
export
|
|
13
|
-
export
|
|
12
|
+
export { Dialog, BloomDialogProvider, alert, useDialogContext, useDialogControl, } from './dialog/index.web';
|
|
13
|
+
export type { AlertButton, AlertButtonStyle, DialogAction, DialogActionColor, DialogContextProps, DialogControlProps, DialogProps, } from './dialog/index.web';
|
|
14
14
|
export * from './button';
|
|
15
15
|
export * from './grouped-buttons';
|
|
16
16
|
export * from './divider';
|
|
@@ -22,7 +22,7 @@ export * from './avatar';
|
|
|
22
22
|
export * from './loading';
|
|
23
23
|
export * as PromptInput from './prompt-input';
|
|
24
24
|
export * from './switch';
|
|
25
|
-
export
|
|
25
|
+
export { toast, type Toast } from './toast/index.web';
|
|
26
26
|
export * as Typography from './typography';
|
|
27
27
|
export * as Skeleton from './skeleton';
|
|
28
28
|
export * as Grid from './grid';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAMA,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,E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zC,cAAc,iBAAiB,CAAC;AAGhC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAC;AACzC,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,MAAM,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,WAAW,MAAM,0BAA0B,CAAC;AAGxD,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAG/B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import
|
|
3
|
+
import type { DialogControlProps } from '../dialog/types';
|
|
4
4
|
import { useMenuContext } from './context';
|
|
5
5
|
import type { GroupProps, ItemIconProps, ItemProps, ItemTextProps, TriggerProps } from './types';
|
|
6
|
-
export type { DialogControlProps as MenuControlProps } from '../dialog';
|
|
7
|
-
export { useDialogControl as useMenuControl } from '../dialog';
|
|
6
|
+
export type { DialogControlProps as MenuControlProps } from '../dialog/types';
|
|
7
|
+
export { useDialogControl as useMenuControl } from '../dialog/context';
|
|
8
8
|
export { useMenuContext };
|
|
9
9
|
export declare function Root({ children, control, }: React.PropsWithChildren<{
|
|
10
|
-
control?:
|
|
10
|
+
control?: DialogControlProps;
|
|
11
11
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export declare function Trigger({ children, label, role, hint, }: TriggerProps): React.ReactNode;
|
|
13
13
|
export declare function Outer({ children, showCancel, }: React.PropsWithChildren<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/menu/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiF,MAAM,OAAO,CAAC;AACtG,OAAO,EAA+B,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|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,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,aAAa,2CAgB3D;AAED,wBAAgB,KAAK,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,UAAU,2CAsCpD;AAED,wBAAgB,OAAO,SAEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAON,MAAM,OAAO,CAAC;AAcf,OAAO,EAA0C,cAAc,EAAE,MAAM,UAAU,CAAC;AAClF,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,SAAS,EAET,YAAY,EACZ,cAAc,EACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,cAAc,EAAE,CAAC;AA8B1B,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,EAAE,SAAS,2CAgB3E;AAMD,wBAAgB,OAAO,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,YAAY,yTAqCxD;AAMD,wBAAgB,SAAS,CAAC,EACxB,WAAW,EACX,QAAQ,EAAE,YAAkC,EAC5C,KAAK,GACN,EAAE,cAAc,2CAkBhB;AAaD,wBAAgB,IAAI,CAAC,MAAM,EAAE,SAAS,2CAGrC;AAMD,wBAAgB,OAAO,CAAC,CAAC,EAAE,EACzB,KAAK,EACL,cAA0C,EAC1C,GAAG,KAAK,EACT,EAAE,YAAY,CAAC,CAAC,CAAC,2CAwBjB;AAkED,wBAAgB,IAAI,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,SAAS,2CA2ChE;AAMD,wBAAgB,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,2CAc1D;AAMD,wBAAgB,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,kBAAkB,2CAYxE;AAMD,wBAAgB,SAAS,4CAWxB"}
|
|
@@ -9,7 +9,8 @@ export type { ToastType, BaseToastOptions } from './types';
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Direct access to the Sonner API. Use sparingly — `toast()` covers the
|
|
13
|
+
* common case and keeps the surface tied to bloom's themed look.
|
|
13
14
|
*/
|
|
14
15
|
export declare const api: ((message: string, data?: Omit<import("sonner-native").ToastProps, "title" | "id" | "type" | "variant" | "jsx" | "promise"> & {
|
|
15
16
|
id?: string | number;
|
|
@@ -49,7 +50,35 @@ export declare const api: ((message: string, data?: Omit<import("sonner-native")
|
|
|
49
50
|
/**
|
|
50
51
|
* Show a toast notification.
|
|
51
52
|
*
|
|
52
|
-
* Pass a string for a simple text toast, or a React element for a custom
|
|
53
|
+
* Pass a string for a simple text toast, or a React element for a custom
|
|
54
|
+
* toast. The optional `options` argument accepts the standard Sonner
|
|
55
|
+
* options plus a bloom `type` (defaults to `'default'`).
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* toast('Saved');
|
|
59
|
+
* toast.success('Profile updated');
|
|
60
|
+
* toast.error('Network error', { duration: 5000 });
|
|
61
|
+
* toast.dismiss(id);
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* Pre-typed variants (`toast.success`, `toast.error`, `toast.warning`,
|
|
65
|
+
* `toast.info`) are aliases for the corresponding `type`.
|
|
66
|
+
*/
|
|
67
|
+
export interface ToastFn {
|
|
68
|
+
(content: React.ReactNode, options?: BaseToastOptions): void;
|
|
69
|
+
success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
70
|
+
error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
71
|
+
warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
72
|
+
info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
73
|
+
dismiss: (id?: string | number) => void;
|
|
74
|
+
}
|
|
75
|
+
export declare const toast: ToastFn;
|
|
76
|
+
/**
|
|
77
|
+
* Alias of `toast` kept for compatibility with the original 0.4.x surface
|
|
78
|
+
* where `show()` was the documented entry point. New code should prefer
|
|
79
|
+
* `toast()` directly.
|
|
53
80
|
*/
|
|
54
|
-
export declare
|
|
81
|
+
export declare const show: ToastFn;
|
|
82
|
+
/** Re-export the Toast function type so callers can refer to it. */
|
|
83
|
+
export type Toast = ToastFn;
|
|
55
84
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAY9C,OAAO,KAAK,EAAE,gBAAgB,EAAa,MAAM,SAAS,CAAC;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACzE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,WAAW,4CAE1B;AAUD;;;GAGG;AACH,eAAO,MAAM,GAAG;;;mCA8F+W,CAAC;;;gCAAqE,CAAC;;;iCAAsE,CAAC;;;mCAAwE,CAAC;;;0CAA+E,CAAC;;;;;;;;;mBA9GlqB,CAAC;mBACF,CAAC;iBAA4B,CAAC;;;mCA6GizB,CAAC;;;gBAAqD,CAAC;;CA9Fh3B,CAAC;AAwC1B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,OAAO;IACtB,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACpF,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACtF,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;IACnF,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;CACzC;AAYD,eAAO,MAAM,KAAK,EAAE,OAAmB,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,IAAI,EAAE,OAAmB,CAAC;AAEvC,oEAAoE;AACpE,MAAM,MAAM,KAAK,GAAG,OAAO,CAAC"}
|
|
@@ -9,14 +9,21 @@ export type { ToastType, BaseToastOptions } from './types';
|
|
|
9
9
|
* component tree.
|
|
10
10
|
*/
|
|
11
11
|
export declare function ToastOutlet(): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
/**
|
|
13
|
-
* Access the full Sonner API
|
|
14
|
-
*/
|
|
12
|
+
/** Direct access to the underlying Sonner API. Use sparingly. */
|
|
15
13
|
export declare const api: typeof sonner;
|
|
16
14
|
/**
|
|
17
|
-
* Show a toast notification.
|
|
18
|
-
*
|
|
19
|
-
* Pass a string for a simple text toast, or a React element for a custom toast.
|
|
15
|
+
* Show a toast notification. Identical API to the native variant — see
|
|
16
|
+
* `./index.tsx` for the full usage docs.
|
|
20
17
|
*/
|
|
21
|
-
export
|
|
18
|
+
export interface ToastFn {
|
|
19
|
+
(content: React.ReactNode, options?: BaseToastOptions): void;
|
|
20
|
+
success: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
21
|
+
error: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
22
|
+
warning: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
23
|
+
info: (content: React.ReactNode, options?: Omit<BaseToastOptions, 'type'>) => void;
|
|
24
|
+
dismiss: (id?: string | number) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare const toast: ToastFn;
|
|
27
|
+
export declare const show: ToastFn;
|
|
28
|
+
export type Toast = ToastFn;
|
|
22
29
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/toast/index.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,KAAK,IAAI,MAAM,EAAW,MAAM,QAAQ,CAAC;AASlD,OAAO,KAAK,EAAE,gBAAgB,EAAa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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxyhq/bloom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Bloom UI — Oxy ecosystem component library for React Native + Expo + Web",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -93,17 +93,6 @@
|
|
|
93
93
|
"default": "./lib/commonjs/dialog/index.js"
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
|
-
"./prompt": {
|
|
97
|
-
"react-native": "./src/prompt/index.ts",
|
|
98
|
-
"import": {
|
|
99
|
-
"types": "./lib/typescript/module/prompt/index.d.ts",
|
|
100
|
-
"default": "./lib/module/prompt/index.js"
|
|
101
|
-
},
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./lib/typescript/commonjs/prompt/index.d.ts",
|
|
104
|
-
"default": "./lib/commonjs/prompt/index.js"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
96
|
"./button": {
|
|
108
97
|
"react-native": "./src/button/index.ts",
|
|
109
98
|
"import": {
|
|
@@ -553,7 +542,8 @@
|
|
|
553
542
|
"ui",
|
|
554
543
|
"components",
|
|
555
544
|
"dialog",
|
|
556
|
-
"
|
|
545
|
+
"alert",
|
|
546
|
+
"toast",
|
|
557
547
|
"button",
|
|
558
548
|
"theme",
|
|
559
549
|
"avatar",
|
|
@@ -562,7 +552,6 @@
|
|
|
562
552
|
"collapsible",
|
|
563
553
|
"error-boundary",
|
|
564
554
|
"prompt-input",
|
|
565
|
-
"toast",
|
|
566
555
|
"icons",
|
|
567
556
|
"typography",
|
|
568
557
|
"skeleton",
|
|
@@ -593,20 +582,42 @@
|
|
|
593
582
|
"license": "MIT",
|
|
594
583
|
"scripts": {
|
|
595
584
|
"generate:exports": "node scripts/generate-platform-exports.mjs",
|
|
596
|
-
"
|
|
585
|
+
"generate:font-data": "node scripts/generate-font-data.mjs",
|
|
586
|
+
"prebuild": "node scripts/generate-platform-exports.mjs && node scripts/generate-font-data.mjs",
|
|
597
587
|
"build": "bob build",
|
|
598
588
|
"test": "jest",
|
|
589
|
+
"pretest": "node scripts/generate-font-data.mjs",
|
|
599
590
|
"typescript": "tsc --noEmit",
|
|
591
|
+
"pretypescript": "node scripts/generate-font-data.mjs",
|
|
600
592
|
"clean": "rm -rf lib",
|
|
601
593
|
"prepare": "bob build || true",
|
|
602
|
-
"release": "rm -rf lib &&
|
|
594
|
+
"release": "rm -rf lib && bun run build && release-it",
|
|
595
|
+
"storybook": "storybook dev -p 6006 --no-open",
|
|
596
|
+
"storybook:build": "storybook build -o storybook-static"
|
|
597
|
+
},
|
|
598
|
+
"release-it": {
|
|
599
|
+
"git": {
|
|
600
|
+
"tagName": "@oxyhq/bloom@${version}",
|
|
601
|
+
"tagAnnotation": "Release @oxyhq/bloom@${version}",
|
|
602
|
+
"commitMessage": "chore: release @oxyhq/bloom@${version}"
|
|
603
|
+
},
|
|
604
|
+
"github": {
|
|
605
|
+
"release": true,
|
|
606
|
+
"releaseName": "@oxyhq/bloom@${version}"
|
|
607
|
+
},
|
|
608
|
+
"npm": {
|
|
609
|
+
"publish": true
|
|
610
|
+
}
|
|
603
611
|
},
|
|
604
612
|
"devDependencies": {
|
|
613
|
+
"@storybook/addon-docs": "^10",
|
|
614
|
+
"@storybook/react-vite": "^10",
|
|
605
615
|
"@testing-library/react-native": "^13.3.3",
|
|
606
616
|
"@types/jest": "^30.0.0",
|
|
607
617
|
"@types/react": "~19.1.0",
|
|
608
618
|
"@types/react-dom": "^19.2.3",
|
|
609
619
|
"@types/react-native": "*",
|
|
620
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
610
621
|
"expo-font": "^56.0.5",
|
|
611
622
|
"jest": "^30.3.0",
|
|
612
623
|
"jest-environment-jsdom": "^30.4.1",
|
|
@@ -618,12 +629,15 @@
|
|
|
618
629
|
"react-native-reanimated": "^4.2.2",
|
|
619
630
|
"react-native-safe-area-context": "~5.6.0",
|
|
620
631
|
"react-native-svg": "^15.15.3",
|
|
632
|
+
"react-native-web": "^0.21.2",
|
|
621
633
|
"react-test-renderer": "^19.2.0",
|
|
622
634
|
"release-it": "^19.0.6",
|
|
623
635
|
"sonner": "^2.0.3",
|
|
624
636
|
"sonner-native": "^0.23.1",
|
|
637
|
+
"storybook": "^10",
|
|
625
638
|
"ts-jest": "^29.4.6",
|
|
626
|
-
"typescript": "~5.9.2"
|
|
639
|
+
"typescript": "~5.9.2",
|
|
640
|
+
"vite": "^7"
|
|
627
641
|
},
|
|
628
642
|
"peerDependencies": {
|
|
629
643
|
"expo": "*",
|
|
@@ -667,6 +681,7 @@
|
|
|
667
681
|
"react-native-builder-bob": {
|
|
668
682
|
"source": "src",
|
|
669
683
|
"output": "lib",
|
|
684
|
+
"exclude": "{**/{__tests__,__fixtures__,__mocks__}/**,**/*.stories.{ts,tsx},**/*.{test,spec}.{ts,tsx},**/*.woff2}",
|
|
670
685
|
"targets": [
|
|
671
686
|
[
|
|
672
687
|
"commonjs",
|
|
@@ -680,7 +695,12 @@
|
|
|
680
695
|
"esm": true
|
|
681
696
|
}
|
|
682
697
|
],
|
|
683
|
-
|
|
698
|
+
[
|
|
699
|
+
"typescript",
|
|
700
|
+
{
|
|
701
|
+
"project": "tsconfig.build.json"
|
|
702
|
+
}
|
|
703
|
+
]
|
|
684
704
|
]
|
|
685
705
|
},
|
|
686
706
|
"dependencies": {
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { act, fireEvent, render } from '@testing-library/react-native';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
alert,
|
|
7
|
+
BloomDialogProvider,
|
|
8
|
+
Dialog,
|
|
9
|
+
useDialogControl,
|
|
10
|
+
} from '../dialog';
|
|
11
|
+
import { dismissAlert, getAlertQueue } from '../dialog/alert-store';
|
|
12
|
+
import { BloomThemeProvider } from '../theme/BloomThemeProvider';
|
|
13
|
+
|
|
14
|
+
function renderWithTheme(ui: React.ReactElement) {
|
|
15
|
+
return render(
|
|
16
|
+
<BloomThemeProvider mode="light" colorPreset="teal">
|
|
17
|
+
{ui}
|
|
18
|
+
</BloomThemeProvider>,
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function Harness({
|
|
23
|
+
children,
|
|
24
|
+
onControl,
|
|
25
|
+
}: {
|
|
26
|
+
children?: (control: ReturnType<typeof useDialogControl>) => React.ReactNode;
|
|
27
|
+
onControl?: (control: ReturnType<typeof useDialogControl>) => void;
|
|
28
|
+
}) {
|
|
29
|
+
const control = useDialogControl();
|
|
30
|
+
React.useEffect(() => {
|
|
31
|
+
onControl?.(control);
|
|
32
|
+
}, [control, onControl]);
|
|
33
|
+
return <>{children?.(control)}</>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
describe('Dialog (unified API)', () => {
|
|
37
|
+
it('does not render content until control.open() is called', () => {
|
|
38
|
+
const { queryByText } = renderWithTheme(
|
|
39
|
+
<Harness>
|
|
40
|
+
{(control) => (
|
|
41
|
+
<Dialog control={control} title="Hidden until opened">
|
|
42
|
+
<Text>Body</Text>
|
|
43
|
+
</Dialog>
|
|
44
|
+
)}
|
|
45
|
+
</Harness>,
|
|
46
|
+
);
|
|
47
|
+
expect(queryByText('Hidden until opened')).toBeNull();
|
|
48
|
+
expect(queryByText('Body')).toBeNull();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('renders declarative title + description + actions when opened', () => {
|
|
52
|
+
let control: ReturnType<typeof useDialogControl> | undefined;
|
|
53
|
+
const onDelete = jest.fn();
|
|
54
|
+
const { getByText } = renderWithTheme(
|
|
55
|
+
<Harness onControl={(c) => { control = c; }}>
|
|
56
|
+
{(c) => (
|
|
57
|
+
<Dialog
|
|
58
|
+
control={c}
|
|
59
|
+
title="Delete item?"
|
|
60
|
+
description="This action cannot be undone."
|
|
61
|
+
actions={[
|
|
62
|
+
{ label: 'Delete', color: 'destructive', onPress: onDelete },
|
|
63
|
+
{ label: 'Cancel', color: 'cancel' },
|
|
64
|
+
]}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
</Harness>,
|
|
68
|
+
);
|
|
69
|
+
act(() => { control?.open(); });
|
|
70
|
+
expect(getByText('Delete item?')).toBeTruthy();
|
|
71
|
+
expect(getByText('This action cannot be undone.')).toBeTruthy();
|
|
72
|
+
expect(getByText('Delete')).toBeTruthy();
|
|
73
|
+
expect(getByText('Cancel')).toBeTruthy();
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('renders custom children alongside the declarative header', () => {
|
|
77
|
+
let control: ReturnType<typeof useDialogControl> | undefined;
|
|
78
|
+
const { getByText } = renderWithTheme(
|
|
79
|
+
<Harness onControl={(c) => { control = c; }}>
|
|
80
|
+
{(c) => (
|
|
81
|
+
<Dialog control={c} title="Pick a tag">
|
|
82
|
+
<Text>Custom body content</Text>
|
|
83
|
+
</Dialog>
|
|
84
|
+
)}
|
|
85
|
+
</Harness>,
|
|
86
|
+
);
|
|
87
|
+
act(() => { control?.open(); });
|
|
88
|
+
expect(getByText('Pick a tag')).toBeTruthy();
|
|
89
|
+
expect(getByText('Custom body content')).toBeTruthy();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('fires the action onPress after the dialog finishes closing', () => {
|
|
93
|
+
let control: ReturnType<typeof useDialogControl> | undefined;
|
|
94
|
+
const onConfirm = jest.fn();
|
|
95
|
+
const { getByText } = renderWithTheme(
|
|
96
|
+
<Harness onControl={(c) => { control = c; }}>
|
|
97
|
+
{(c) => (
|
|
98
|
+
<Dialog
|
|
99
|
+
control={c}
|
|
100
|
+
title="Confirm?"
|
|
101
|
+
actions={[
|
|
102
|
+
{ label: 'Confirm', onPress: onConfirm },
|
|
103
|
+
]}
|
|
104
|
+
/>
|
|
105
|
+
)}
|
|
106
|
+
</Harness>,
|
|
107
|
+
);
|
|
108
|
+
act(() => { control?.open(); });
|
|
109
|
+
act(() => {
|
|
110
|
+
fireEvent.press(getByText('Confirm'));
|
|
111
|
+
});
|
|
112
|
+
expect(onConfirm).toHaveBeenCalledTimes(1);
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
describe('alert() helper', () => {
|
|
117
|
+
// The alert store is module-scope; ensure no cross-test contamination by
|
|
118
|
+
// draining anything left over from prior tests before each new run.
|
|
119
|
+
beforeEach(() => {
|
|
120
|
+
while (getAlertQueue().length > 0) {
|
|
121
|
+
const head = getAlertQueue()[0];
|
|
122
|
+
if (head) dismissAlert(head.id);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('queues alerts before any provider mounts and drains them on subscribe', () => {
|
|
127
|
+
// Call alert() *before* the provider mounts — entry should sit in the
|
|
128
|
+
// queue until a subscriber attaches, at which point the head is
|
|
129
|
+
// rendered.
|
|
130
|
+
alert('Pending', 'Was queued before provider', [
|
|
131
|
+
{ text: 'OK' },
|
|
132
|
+
]);
|
|
133
|
+
expect(getAlertQueue().length).toBe(1);
|
|
134
|
+
|
|
135
|
+
const { getByText } = renderWithTheme(
|
|
136
|
+
<BloomDialogProvider>
|
|
137
|
+
<Text>app body</Text>
|
|
138
|
+
</BloomDialogProvider>,
|
|
139
|
+
);
|
|
140
|
+
// The queued entry now renders inside the provider.
|
|
141
|
+
expect(getByText('Pending')).toBeTruthy();
|
|
142
|
+
expect(getByText('Was queued before provider')).toBeTruthy();
|
|
143
|
+
expect(getByText('OK')).toBeTruthy();
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('defaults to a single OK button when no buttons are passed', () => {
|
|
147
|
+
const { getByText } = renderWithTheme(
|
|
148
|
+
<BloomDialogProvider>
|
|
149
|
+
<Text>app</Text>
|
|
150
|
+
</BloomDialogProvider>,
|
|
151
|
+
);
|
|
152
|
+
act(() => {
|
|
153
|
+
alert('Hello');
|
|
154
|
+
});
|
|
155
|
+
expect(getByText('Hello')).toBeTruthy();
|
|
156
|
+
expect(getByText('OK')).toBeTruthy();
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('invokes the button onPress when tapped', () => {
|
|
160
|
+
const onPress = jest.fn();
|
|
161
|
+
const { getByText } = renderWithTheme(
|
|
162
|
+
<BloomDialogProvider>
|
|
163
|
+
<Text>app</Text>
|
|
164
|
+
</BloomDialogProvider>,
|
|
165
|
+
);
|
|
166
|
+
act(() => {
|
|
167
|
+
alert('Sign out?', undefined, [
|
|
168
|
+
{ text: 'Cancel', style: 'cancel' },
|
|
169
|
+
{ text: 'Sign out', style: 'destructive', onPress },
|
|
170
|
+
]);
|
|
171
|
+
});
|
|
172
|
+
act(() => {
|
|
173
|
+
fireEvent.press(getByText('Sign out'));
|
|
174
|
+
});
|
|
175
|
+
expect(onPress).toHaveBeenCalledTimes(1);
|
|
176
|
+
});
|
|
177
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
|
+
|
|
5
|
+
import { Avatar } from './Avatar';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof Avatar> = {
|
|
8
|
+
title: 'Components/Avatar',
|
|
9
|
+
component: Avatar,
|
|
10
|
+
argTypes: {
|
|
11
|
+
size: {
|
|
12
|
+
control: { type: 'number', min: 16, max: 256, step: 4 },
|
|
13
|
+
},
|
|
14
|
+
shape: {
|
|
15
|
+
control: 'select',
|
|
16
|
+
options: ['circle', 'squircle'],
|
|
17
|
+
},
|
|
18
|
+
verified: { control: 'boolean' },
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default meta;
|
|
23
|
+
|
|
24
|
+
type Story = StoryObj<typeof Avatar>;
|
|
25
|
+
|
|
26
|
+
const SAMPLE_URI =
|
|
27
|
+
'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200&h=200&fit=crop';
|
|
28
|
+
|
|
29
|
+
export const Basic: Story = {
|
|
30
|
+
args: { size: 64, name: 'Nate Isern' },
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const FromUri: Story = {
|
|
34
|
+
args: { size: 64, uri: SAMPLE_URI },
|
|
35
|
+
name: 'From URI',
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Initials: Story = {
|
|
39
|
+
args: { size: 64, name: 'Ada Lovelace' },
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export const Squircle: Story = {
|
|
43
|
+
args: { size: 64, name: 'Ada Lovelace', shape: 'squircle' },
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const Sizes: Story = {
|
|
47
|
+
render: () => (
|
|
48
|
+
<View style={{ flexDirection: 'row', gap: 12, alignItems: 'center' }}>
|
|
49
|
+
<Avatar size={24} name="Ada" />
|
|
50
|
+
<Avatar size={32} name="Ada" />
|
|
51
|
+
<Avatar size={40} name="Ada" />
|
|
52
|
+
<Avatar size={56} name="Ada" />
|
|
53
|
+
<Avatar size={80} name="Ada" />
|
|
54
|
+
<Avatar size={120} name="Ada" />
|
|
55
|
+
</View>
|
|
56
|
+
),
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const Composition: Story = {
|
|
60
|
+
render: () => (
|
|
61
|
+
<View style={{ flexDirection: 'row', gap: 12, alignItems: 'center' }}>
|
|
62
|
+
<Avatar size={48} name="Ada Lovelace" />
|
|
63
|
+
<Avatar size={48} name="Grace Hopper" />
|
|
64
|
+
<Avatar size={48} name="Alan Turing" />
|
|
65
|
+
<Avatar size={48} name="Linus Torvalds" />
|
|
66
|
+
<Avatar size={48} name="Margaret Hamilton" />
|
|
67
|
+
</View>
|
|
68
|
+
),
|
|
69
|
+
};
|