@oxyhq/bloom 0.45.0 → 0.48.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/lib/commonjs/bottom-sheet/BottomSheetBase.js +34 -12
- package/lib/commonjs/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/commonjs/combobox/Combobox.js +3 -3
- package/lib/commonjs/combobox/Combobox.js.map +1 -1
- package/lib/commonjs/command/Command.js +3 -3
- package/lib/commonjs/command/Command.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.js +86 -8
- package/lib/commonjs/dialog/Dialog.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +176 -18
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/DialogBottomSheet.js +84 -29
- package/lib/commonjs/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/commonjs/dialog/DialogHeader.js +365 -0
- package/lib/commonjs/dialog/DialogHeader.js.map +1 -0
- package/lib/commonjs/dialog/index.js +7 -0
- package/lib/commonjs/dialog/index.js.map +1 -1
- package/lib/commonjs/dialog/index.web.js +7 -0
- package/lib/commonjs/dialog/index.web.js.map +1 -1
- package/lib/commonjs/index.js +40 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +84 -48
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/react-native-className.d.js +6 -0
- package/lib/commonjs/react-native-className.d.js.map +1 -0
- package/lib/commonjs/{search-input → search}/index.js +5 -3
- package/lib/commonjs/search/index.js.map +1 -0
- package/lib/commonjs/settings-list/SettingsList.js +5 -1
- package/lib/commonjs/settings-list/SettingsList.js.map +1 -1
- package/lib/commonjs/surfaces/SurfaceHost.js +202 -0
- package/lib/commonjs/surfaces/SurfaceHost.js.map +1 -0
- package/lib/commonjs/surfaces/api.js +83 -0
- package/lib/commonjs/surfaces/api.js.map +1 -0
- package/lib/commonjs/surfaces/index.js +82 -0
- package/lib/commonjs/surfaces/index.js.map +1 -0
- package/lib/commonjs/surfaces/index.web.js +77 -0
- package/lib/commonjs/surfaces/index.web.js.map +1 -0
- package/lib/commonjs/surfaces/prompts.js +154 -0
- package/lib/commonjs/surfaces/prompts.js.map +1 -0
- package/lib/commonjs/surfaces/surfaceStore.js +172 -0
- package/lib/commonjs/surfaces/surfaceStore.js.map +1 -0
- package/lib/commonjs/surfaces/types.js +6 -0
- package/lib/commonjs/surfaces/types.js.map +1 -0
- package/lib/commonjs/surfaces/useSurface.js +36 -0
- package/lib/commonjs/surfaces/useSurface.js.map +1 -0
- package/lib/commonjs/text-field/index.js +22 -6
- package/lib/commonjs/text-field/index.js.map +1 -1
- package/lib/module/bottom-sheet/BottomSheetBase.js +34 -12
- package/lib/module/bottom-sheet/BottomSheetBase.js.map +1 -1
- package/lib/module/combobox/Combobox.js +3 -3
- package/lib/module/combobox/Combobox.js.map +1 -1
- package/lib/module/command/Command.js +3 -3
- package/lib/module/command/Command.js.map +1 -1
- package/lib/module/dialog/Dialog.js +88 -10
- package/lib/module/dialog/Dialog.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +179 -21
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/DialogBottomSheet.js +85 -30
- package/lib/module/dialog/DialogBottomSheet.js.map +1 -1
- package/lib/module/dialog/DialogHeader.js +356 -0
- package/lib/module/dialog/DialogHeader.js.map +1 -0
- package/lib/module/dialog/index.js +1 -0
- package/lib/module/dialog/index.js.map +1 -1
- package/lib/module/dialog/index.web.js +1 -0
- package/lib/module/dialog/index.web.js.map +1 -1
- package/lib/module/index.js +7 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +7 -2
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/react-native-className.d.js +20 -0
- package/lib/module/react-native-className.d.js.map +1 -0
- package/lib/module/{search-input → search}/index.js +6 -2
- package/lib/module/search/index.js.map +1 -0
- package/lib/module/settings-list/SettingsList.js +5 -1
- package/lib/module/settings-list/SettingsList.js.map +1 -1
- package/lib/module/surfaces/SurfaceHost.js +197 -0
- package/lib/module/surfaces/SurfaceHost.js.map +1 -0
- package/lib/module/surfaces/api.js +48 -0
- package/lib/module/surfaces/api.js.map +1 -0
- package/lib/module/surfaces/index.js +24 -0
- package/lib/module/surfaces/index.js.map +1 -0
- package/lib/module/surfaces/index.web.js +19 -0
- package/lib/module/surfaces/index.web.js.map +1 -0
- package/lib/module/surfaces/prompts.js +148 -0
- package/lib/module/surfaces/prompts.js.map +1 -0
- package/lib/module/surfaces/surfaceStore.js +159 -0
- package/lib/module/surfaces/surfaceStore.js.map +1 -0
- package/lib/module/surfaces/types.js +4 -0
- package/lib/module/surfaces/types.js.map +1 -0
- package/lib/module/surfaces/useSurface.js +31 -0
- package/lib/module/surfaces/useSurface.js.map +1 -0
- package/lib/module/text-field/index.js +22 -6
- package/lib/module/text-field/index.js.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts +23 -0
- package/lib/typescript/commonjs/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/commonjs/combobox/Combobox.d.ts +1 -1
- package/lib/typescript/commonjs/command/Command.d.ts +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/commonjs/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts +86 -0
- package/lib/typescript/commonjs/dialog/DialogHeader.d.ts.map +1 -0
- package/lib/typescript/commonjs/dialog/index.d.ts +2 -1
- package/lib/typescript/commonjs/dialog/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts +2 -1
- package/lib/typescript/commonjs/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/types.d.ts +85 -0
- package/lib/typescript/commonjs/dialog/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/icons/common.d.ts +1 -0
- package/lib/typescript/commonjs/icons/common.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +5 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +5 -3
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/input-group/types.d.ts +1 -1
- package/lib/typescript/commonjs/{search-input → search}/index.d.ts +1 -1
- package/lib/typescript/commonjs/search/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts +25 -0
- package/lib/typescript/commonjs/surfaces/SurfaceHost.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/api.d.ts +41 -0
- package/lib/typescript/commonjs/surfaces/api.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/index.d.ts +25 -0
- package/lib/typescript/commonjs/surfaces/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/index.web.d.ts +20 -0
- package/lib/typescript/commonjs/surfaces/index.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/prompts.d.ts +13 -0
- package/lib/typescript/commonjs/surfaces/prompts.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/surfaceStore.d.ts +51 -0
- package/lib/typescript/commonjs/surfaces/surfaceStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/types.d.ts +161 -0
- package/lib/typescript/commonjs/surfaces/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/surfaces/useSurface.d.ts +21 -0
- package/lib/typescript/commonjs/surfaces/useSurface.d.ts.map +1 -0
- package/lib/typescript/commonjs/text-field/index.d.ts +2 -1
- package/lib/typescript/commonjs/text-field/index.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts +23 -0
- package/lib/typescript/module/bottom-sheet/BottomSheetBase.d.ts.map +1 -1
- package/lib/typescript/module/combobox/Combobox.d.ts +1 -1
- package/lib/typescript/module/command/Command.d.ts +1 -1
- package/lib/typescript/module/dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts +2 -2
- package/lib/typescript/module/dialog/DialogBottomSheet.d.ts.map +1 -1
- package/lib/typescript/module/dialog/DialogHeader.d.ts +86 -0
- package/lib/typescript/module/dialog/DialogHeader.d.ts.map +1 -0
- package/lib/typescript/module/dialog/index.d.ts +2 -1
- package/lib/typescript/module/dialog/index.d.ts.map +1 -1
- package/lib/typescript/module/dialog/index.web.d.ts +2 -1
- package/lib/typescript/module/dialog/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/types.d.ts +85 -0
- package/lib/typescript/module/dialog/types.d.ts.map +1 -1
- package/lib/typescript/module/icons/common.d.ts +1 -0
- package/lib/typescript/module/icons/common.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +5 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +5 -3
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/input-group/types.d.ts +1 -1
- package/lib/typescript/module/{search-input → search}/index.d.ts +1 -1
- package/lib/typescript/module/search/index.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/SurfaceHost.d.ts +25 -0
- package/lib/typescript/module/surfaces/SurfaceHost.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/api.d.ts +41 -0
- package/lib/typescript/module/surfaces/api.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/index.d.ts +25 -0
- package/lib/typescript/module/surfaces/index.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/index.web.d.ts +20 -0
- package/lib/typescript/module/surfaces/index.web.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/prompts.d.ts +13 -0
- package/lib/typescript/module/surfaces/prompts.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/surfaceStore.d.ts +51 -0
- package/lib/typescript/module/surfaces/surfaceStore.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/types.d.ts +161 -0
- package/lib/typescript/module/surfaces/types.d.ts.map +1 -0
- package/lib/typescript/module/surfaces/useSurface.d.ts +21 -0
- package/lib/typescript/module/surfaces/useSurface.d.ts.map +1 -0
- package/lib/typescript/module/text-field/index.d.ts +2 -1
- package/lib/typescript/module/text-field/index.d.ts.map +1 -1
- package/package.json +24 -8
- package/src/__tests__/BottomSheet.test.tsx +47 -0
- package/src/__tests__/DialogBottomSheet.test.tsx +30 -5
- package/src/__tests__/surfaceStore.test.ts +219 -0
- package/src/bottom-sheet/BottomSheetBase.tsx +59 -10
- package/src/combobox/Combobox.tsx +3 -3
- package/src/command/Command.tsx +3 -3
- package/src/dialog/Dialog.tsx +88 -7
- package/src/dialog/Dialog.web.tsx +179 -29
- package/src/dialog/DialogBottomSheet.tsx +90 -28
- package/src/dialog/DialogHeader.tsx +420 -0
- package/src/dialog/index.ts +2 -0
- package/src/dialog/index.web.ts +2 -0
- package/src/dialog/types.ts +86 -0
- package/src/index.ts +18 -1
- package/src/index.web.ts +18 -1
- package/src/input-group/types.ts +1 -1
- package/src/react-native-className.d.ts +38 -0
- package/src/{search-input → search}/index.tsx +8 -5
- package/src/settings-list/SettingsList.tsx +5 -1
- package/src/surfaces/SurfaceHost.tsx +222 -0
- package/src/surfaces/api.ts +55 -0
- package/src/surfaces/index.ts +38 -0
- package/src/surfaces/index.web.ts +33 -0
- package/src/surfaces/prompts.tsx +178 -0
- package/src/surfaces/surfaceStore.ts +168 -0
- package/src/surfaces/types.ts +172 -0
- package/src/surfaces/useSurface.ts +33 -0
- package/src/text-field/index.tsx +24 -5
- package/lib/commonjs/search-input/index.js.map +0 -1
- package/lib/module/search-input/index.js.map +0 -1
- package/lib/typescript/commonjs/search-input/index.d.ts.map +0 -1
- package/lib/typescript/module/search-input/index.d.ts.map +0 -1
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","bloomTailwindPreset","bloomThemeCss","bloomThemeBlock","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","SPACING","RADIUS","BORDER_WIDTH","TYPOGRAPHY","FONT_FAMILY_VARS","SHADOW_BOX","bloomShadowStyle","useInteractionState","useDelayedLoading","useThrottledValue","useHaptics","BloomHapticsProvider","useGutters","useImagePreload","preloadImage","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","Fab","FrostedIconButton","ErrorBoundary","AvatarGroup","UserHoverCard","toast","Typography","Skeleton","Grid","Fill","MediaInsetBorder","IconCircle","ConnectionDots","BenefitRow","BenefitList","PressableScale","PressableWithHover","SubtleHover","ScaleAndFadeIn","ScaleAndFadeOut","ShrinkAndPop","ScreenTransition","AnimatedCheck","
|
|
1
|
+
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","bloomTailwindPreset","bloomThemeCss","bloomThemeBlock","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","SPACING","RADIUS","BORDER_WIDTH","TYPOGRAPHY","FONT_FAMILY_VARS","SHADOW_BOX","bloomShadowStyle","useInteractionState","useDelayedLoading","useThrottledValue","useHaptics","BloomHapticsProvider","useGutters","useImagePreload","preloadImage","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","useDialogHeader","surfaces","SurfaceProvider","SurfaceHost","useSurface","Fab","FrostedIconButton","ErrorBoundary","AvatarGroup","UserHoverCard","toast","Typography","Skeleton","Grid","Fill","MediaInsetBorder","IconCircle","ConnectionDots","BenefitRow","BenefitList","PressableScale","PressableWithHover","SubtleHover","ScaleAndFadeIn","ScaleAndFadeOut","ShrinkAndPop","ScreenTransition","AnimatedCheck","Search","Label","Field","InputGroup","Slider","Combobox","BottomSheet","LinkPreviewCard","CompositionBar","DotGridMeter","StatBar","ActivityHeatmap","bucketByDay","ProfileCard","Item","Kbd","AlertDialog","AlertDialogHost","confirm","Command","Code","Fonts"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA;AACA,cAAc,kBAAS;;AAEvB;AACA,SAASA,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,QAAQ,mBAAU;AAE1D,OAAO,KAAKC,MAAM,MAAM,oBAAiB;AACzC,SAASC,GAAG,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,sBAAmB;;AAE/E;AACA;AACA;AACA,SACEC,mBAAmB,EACnBC,aAAa,EACbC,eAAe,EACfC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,OAAO,EACPC,MAAM,EACNC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,UAAU,EACVC,gBAAgB,QACX,0BAAiB;AAYxB;AACA,SAASC,mBAAmB,QAAQ,gCAA6B;AACjE,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,UAAU,EAAEC,oBAAoB,QAAQ,uBAAoB;AAErE,SAASC,UAAU,QAAQ,uBAAoB;AAE/C,SAASC,eAAe,EAAEC,YAAY,QAAQ,4BAAyB;;AAEvE;AACA,OAAO,KAAKC,KAAK,MAAM,kBAAS;AAChC,SAAkCC,KAAK,IAAIC,SAAS,EAAEC,iBAAiB,QAAQ,mBAAgB;;AAE/F;AACA,cAAc,UAAU;AACxB,SACEC,MAAM,EACNC,4BAA4B,EAC5BC,mBAAmB,EACnBC,KAAK,EACLC,gBAAgB,EAChBC,gBAAgB,EAChBC,eAAe,QACV,UAAU;AAcjB;AACA;AACA;AACA;AACA,SAASC,QAAQ,EAAEC,eAAe,EAAEC,WAAW,EAAEC,UAAU,QAAQ,YAAY;AAW/E,cAAc,UAAU;AAC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,kBAAS;AACvB,cAAc,iBAAQ;AACtB,cAAc,iBAAQ;AACtB,cAAc,qBAAY;AAC1B,cAAc,sBAAa;AAC3B,SAASC,eAAe,QAAQ,yBAAgB;AAGhD;AACA,SAASC,cAAc,QAAQ,4BAAmB;AAElD,SAASC,YAAY,QAAQ,2BAAkB;AAE/C,SAASC,OAAO,QAAQ,qBAAY;AAOpC,SAASC,eAAe,EAAEC,WAAW,QAAQ,6BAAoB;AAEjE,SAASC,WAAW,QAAQ,yBAAgB;AAU5C;AACA,cAAc,0BAAiB;AAC/B,SAASC,IAAI,QAAQ,iBAAQ;AAE7B,SAASC,GAAG,QAAQ,gBAAO;AAG3B;AACA,cAAc,uBAAc;AAC5B,cAAc,QAAQ;AACtB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,SAASC,WAAW,EAAEC,eAAe,EAAEC,OAAO,QAAQ,gBAAgB;AAMtE,SAASC,OAAO,QAAQ,WAAW;AAGnC;AACA,OAAO,KAAKC,IAAI,MAAM,iBAAQ;;AAE9B;AACA,OAAO,KAAKC,KAAK,MAAM,SAAS","ignoreList":[]}
|
package/lib/module/index.web.js
CHANGED
|
@@ -31,7 +31,12 @@ export { sizes as iconSizes, useCommonSVGProps } from "./icons/common.js";
|
|
|
31
31
|
|
|
32
32
|
// Core components
|
|
33
33
|
export * from "./portal/index.web.js";
|
|
34
|
-
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl } from "./dialog/index.web.js";
|
|
34
|
+
export { Dialog, DIALOG_SHEET_BACKDROP_TESTID, BloomDialogProvider, alert, useDialogContext, useDialogControl, useDialogHeader } from "./dialog/index.web.js";
|
|
35
|
+
// Surface stack — the shared, coordinated overlay system. The imperative API is
|
|
36
|
+
// the `surfaces` object (its members would otherwise clash with alert-dialog's
|
|
37
|
+
// `confirm`); the individual functions are also named exports of
|
|
38
|
+
// `@oxyhq/bloom/surfaces`.
|
|
39
|
+
export { surfaces, SurfaceProvider, SurfaceHost, useSurface } from "./surfaces/index.web.js";
|
|
35
40
|
export * from "./button/index.web.js";
|
|
36
41
|
export { Fab } from "./fab/index.web.js";
|
|
37
42
|
export { FrostedIconButton } from "./frosted-icon-button/index.web.js";
|
|
@@ -69,7 +74,7 @@ export { AnimatedCheck } from "./animated-check/index.js";
|
|
|
69
74
|
// Form components
|
|
70
75
|
export * from "./text-field/index.js";
|
|
71
76
|
export * from "./segmented-control/index.js";
|
|
72
|
-
export {
|
|
77
|
+
export { Search } from "./search/index.js";
|
|
73
78
|
export { Label } from "./label/index.js";
|
|
74
79
|
export { Field } from "./field/index.js";
|
|
75
80
|
export { InputGroup } from "./input-group/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","bloomTailwindPreset","bloomThemeCss","bloomThemeBlock","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","SPACING","RADIUS","BORDER_WIDTH","TYPOGRAPHY","FONT_FAMILY_VARS","SHADOW_BOX","bloomShadowStyle","useInteractionState","useDelayedLoading","useThrottledValue","useHaptics","BloomHapticsProvider","useGutters","useImagePreload","preloadImage","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","Fab","FrostedIconButton","ErrorBoundary","AvatarGroup","UserHoverCard","toast","Typography","Skeleton","Grid","Fill","MediaInsetBorder","IconCircle","ConnectionDots","BenefitRow","BenefitList","PressableScale","PressableWithHover","SubtleHover","ScaleAndFadeIn","ScaleAndFadeOut","ShrinkAndPop","ScreenTransition","AnimatedCheck","
|
|
1
|
+
{"version":3,"names":["atoms","flatten","Z_INDEX","zIndex","tokens","web","native","ios","android","platform","select","bloomTailwindPreset","bloomThemeCss","bloomThemeBlock","FILL_ROLES","TEXT_ROLES","BORDER_ROLES","SPACING","RADIUS","BORDER_WIDTH","TYPOGRAPHY","FONT_FAMILY_VARS","SHADOW_BOX","bloomShadowStyle","useInteractionState","useDelayedLoading","useThrottledValue","useHaptics","BloomHapticsProvider","useGutters","useImagePreload","preloadImage","Icons","sizes","iconSizes","useCommonSVGProps","Dialog","DIALOG_SHEET_BACKDROP_TESTID","BloomDialogProvider","alert","useDialogContext","useDialogControl","useDialogHeader","surfaces","SurfaceProvider","SurfaceHost","useSurface","Fab","FrostedIconButton","ErrorBoundary","AvatarGroup","UserHoverCard","toast","Typography","Skeleton","Grid","Fill","MediaInsetBorder","IconCircle","ConnectionDots","BenefitRow","BenefitList","PressableScale","PressableWithHover","SubtleHover","ScaleAndFadeIn","ScaleAndFadeOut","ShrinkAndPop","ScreenTransition","AnimatedCheck","Search","Label","Field","InputGroup","Slider","Combobox","BottomSheet","LinkPreviewCard","CompositionBar","DotGridMeter","StatBar","ActivityHeatmap","bucketByDay","ProfileCard","Item","Kbd","AlertDialog","AlertDialogHost","confirm","Command","Code","Fonts"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA;AACA,cAAc,kBAAS;;AAEvB;AACA,SAASA,KAAK,EAAEC,OAAO,EAAEC,OAAO,EAAEC,MAAM,QAAQ,mBAAU;AAE1D,OAAO,KAAKC,MAAM,MAAM,oBAAiB;AACzC,SAASC,GAAG,EAAEC,MAAM,EAAEC,GAAG,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,sBAAmB;;AAE/E;AACA;AACA;AACA,SACEC,mBAAmB,EACnBC,aAAa,EACbC,eAAe,EACfC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,OAAO,EACPC,MAAM,EACNC,YAAY,EACZC,UAAU,EACVC,gBAAgB,EAChBC,UAAU,EACVC,gBAAgB,QACX,0BAAiB;AAYxB;AACA,SAASC,mBAAmB,QAAQ,gCAA6B;AACjE,SAASC,iBAAiB,QAAQ,8BAA2B;AAC7D,SAASC,iBAAiB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KAAKC,KAAK,MAAM,sBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `className` support for React Native core components in Bloom.
|
|
5
|
+
*
|
|
6
|
+
* Bloom styles some primitives with NativeWind/`react-native-css` utility
|
|
7
|
+
* classes (`className="..."`). react-native-css applies them at runtime — on web
|
|
8
|
+
* as real CSS classes emitted by the consumer's Tailwind pipeline (`@source`-
|
|
9
|
+
* scanning Bloom's lib), on native as compiled styles. This ambient augmentation
|
|
10
|
+
* makes `className` type-valid on the RN primitives we set it on.
|
|
11
|
+
*
|
|
12
|
+
* Heritage-free (a plain interface-merge `declare module`, no `extends` / import
|
|
13
|
+
* of RN's own module graph) so it never drags a second `@types/react` copy into
|
|
14
|
+
* the RN 0.85 / React 19 tree — the same hazard the `mergeRefs` note calls out.
|
|
15
|
+
*/
|
|
16
|
+
// `export {}` makes this file a MODULE, so the `declare module` below MERGES
|
|
17
|
+
// with react-native's real types (an augmentation) instead of replacing the
|
|
18
|
+
// module and hiding its exports.
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=react-native-className.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../src","sources":["react-native-className.d.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -8,8 +8,11 @@ import { Button } from '../button';
|
|
|
8
8
|
import { TextField, TextFieldIcon, TextFieldInput } from "../text-field/index.js";
|
|
9
9
|
import { MagnifyingGlass_Stroke2_Corner0_Rounded as MagnifyingGlassIcon } from "../icons/MagnifyingGlass.js";
|
|
10
10
|
import { TimesLarge_Stroke2_Corner0_Rounded as X } from "../icons/Times.js";
|
|
11
|
+
|
|
12
|
+
/** Fully-rounded (pill) corner radius — clamps to half the field height. */
|
|
11
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
-
|
|
14
|
+
const PILL_RADIUS = 999;
|
|
15
|
+
export const Search = /*#__PURE__*/forwardRef(function Search({
|
|
13
16
|
value,
|
|
14
17
|
label = 'Search',
|
|
15
18
|
onClearText,
|
|
@@ -20,6 +23,7 @@ export const SearchInput = /*#__PURE__*/forwardRef(function SearchInput({
|
|
|
20
23
|
return /*#__PURE__*/_jsxs(View, {
|
|
21
24
|
style: [a.w_full, a.relative],
|
|
22
25
|
children: [/*#__PURE__*/_jsxs(TextField, {
|
|
26
|
+
radius: PILL_RADIUS,
|
|
23
27
|
children: [/*#__PURE__*/_jsx(TextFieldIcon, {
|
|
24
28
|
icon: MagnifyingGlassIcon
|
|
25
29
|
}), /*#__PURE__*/_jsx(TextFieldInput, {
|
|
@@ -68,5 +72,5 @@ export const SearchInput = /*#__PURE__*/forwardRef(function SearchInput({
|
|
|
68
72
|
})]
|
|
69
73
|
});
|
|
70
74
|
});
|
|
71
|
-
|
|
75
|
+
Search.displayName = 'Search';
|
|
72
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["forwardRef","Platform","View","useTheme","atoms","a","Button","TextField","TextFieldIcon","TextFieldInput","MagnifyingGlass_Stroke2_Corner0_Rounded","MagnifyingGlassIcon","TimesLarge_Stroke2_Corner0_Rounded","X","jsx","_jsx","jsxs","_jsxs","PILL_RADIUS","Search","value","label","onClearText","rest","ref","theme","showClear","length","style","w_full","relative","children","radius","icon","inputRef","placeholder","returnKeyType","keyboardAppearance","mode","selectTextOnFocus","OS","autoFocus","accessibilityRole","autoCorrect","autoComplete","autoCapitalize","paddingRight","undefined","absolute","z_20","my_auto","inset_0","justify_center","pr_sm","left","testID","onPress","accessibilityLabel","hitSlop","top","bottom","right","variant","size","fill","colors","textSecondary","padding","minHeight","displayName"],"sourceRoot":"../../../src","sources":["search/index.tsx"],"mappings":";;AAAA,SAASA,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et.create({
|
|
|
213
213
|
marginBottom: 16
|
|
214
214
|
},
|
|
215
215
|
groupCard: {
|
|
216
|
-
|
|
216
|
+
// No horizontal self-inset: a `SettingsListGroup` fills its parent's content
|
|
217
|
+
// width, so the single horizontal inset comes from the ONE content padding
|
|
218
|
+
// the screen/Dialog already applies (the same `px-screen-margin` that pads
|
|
219
|
+
// the title/search). Keeping a self-margin here double-inset grouped rows on
|
|
220
|
+
// every screen that also applies that padding.
|
|
217
221
|
borderRadius: 16,
|
|
218
222
|
overflow: 'hidden'
|
|
219
223
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","View","Text","Pressable","StyleSheet","useTheme","useInteractionState","jsx","_jsx","jsxs","_jsxs","Chevron","size","color","style","fontSize","lineHeight","textAlign","width","children","displayName","SettingsListItem","icon","title","description","value","rightElement","showChevron","destructive","onPress","disabled","accessibilityLabel","accessibilityHint","accessibilityRole","leftInset","theme","hasChevron","Boolean","titleColor","colors","error","text","pressedOpacity","state","pressed","onIn","onPressIn","onOut","onPressOut","role","label","content","styles","itemContainer","undefined","paddingLeft","testID","iconContainer","textContainer","numberOfLines","textSecondary","textTertiary","android_ripple","border","accessibilityState","opacity","SettingsListGroup","footer","filteredChildren","Children","toArray","filter","groupContainer","groupTitle","groupCard","backgroundColor","card","map","child","index","Fragment","length","divider","groupFooter","SettingsListDivider","inset","marginLeft","create","flexDirection","alignItems","paddingHorizontal","paddingVertical","minHeight","gap","height","justifyContent","flex","fontWeight","marginBottom","
|
|
1
|
+
{"version":3,"names":["React","memo","View","Text","Pressable","StyleSheet","useTheme","useInteractionState","jsx","_jsx","jsxs","_jsxs","Chevron","size","color","style","fontSize","lineHeight","textAlign","width","children","displayName","SettingsListItem","icon","title","description","value","rightElement","showChevron","destructive","onPress","disabled","accessibilityLabel","accessibilityHint","accessibilityRole","leftInset","theme","hasChevron","Boolean","titleColor","colors","error","text","pressedOpacity","state","pressed","onIn","onPressIn","onOut","onPressOut","role","label","content","styles","itemContainer","undefined","paddingLeft","testID","iconContainer","textContainer","numberOfLines","textSecondary","textTertiary","android_ripple","border","accessibilityState","opacity","SettingsListGroup","footer","filteredChildren","Children","toArray","filter","groupContainer","groupTitle","groupCard","backgroundColor","card","map","child","index","Fragment","length","divider","groupFooter","SettingsListDivider","inset","marginLeft","create","flexDirection","alignItems","paddingHorizontal","paddingVertical","minHeight","gap","height","justifyContent","flex","fontWeight","marginBottom","borderRadius","overflow","textTransform","letterSpacing","paddingTop","paddingBottom","hairlineWidth"],"sourceRoot":"../../../src","sources":["settings-list/SettingsList.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,IAAI,QAAQ,OAAO;AACnC,SAASC,IAAI,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAEhE,SAASC,QAAQ,QAAQ,uBAAoB;AAC7C,SAASC,mBAAmB,QAAQ,iCAA8B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOnE;AACA,MAAMC,OAAO,gBAAGX,IAAI,CAAC,CAAC;EAAEY,IAAI,GAAG,EAAE;EAAEC;AAAwC,CAAC,kBAC1EL,IAAA,CAACN,IAAI;EACHY,KAAK,EAAE;IACLC,QAAQ,EAAEH,IAAI;IACdC,KAAK;IACLG,UAAU,EAAEJ,IAAI;IAChBK,SAAS,EAAE,QAAQ;IACnBC,KAAK,EAAEN;EACT,CAAE;EAAAO,QAAA,EAED;AAAQ,CACL,CACP,CAAC;AACFR,OAAO,CAACS,WAAW,GAAG,SAAS;;AAE/B;;AAEA,OAAO,MAAMC,gBAAgB,gBAAGrB,IAAI,CAAwB,SAASqB,gBAAgBA,CAAC;EACpFC,IAAI;EACJC,KAAK;EACLC,WAAW;EACXC,KAAK;EACLC,YAAY;EACZC,WAAW;EACXC,WAAW,GAAG,KAAK;EACnBC,OAAO;EACPC,QAAQ,GAAG,KAAK;EAChBC,kBAAkB;EAClBC,iBAAiB;EACjBC,iBAAiB;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,EAAE,EAAE;IACVL,UAAU,EAAE,QAAQ;IACpBM,cAAc,EAAE;EAClB,CAAC;EACDrC,aAAa,EAAE;IACbsC,IAAI,EAAE;EACR,CAAC;EACDzE,KAAK,EAAE;IACLR,QAAQ,EAAE,EAAE;IACZkF,UAAU,EAAE,KAAK;IACjBjF,UAAU,EAAE;EACd,CAAC;EACDQ,WAAW,EAAE;IACXT,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDS,KAAK,EAAE;IACLV,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd,CAAC;EACDc,QAAQ,EAAE;IACRmC,OAAO,EAAE;EACX,CAAC;EAED;EACAO,cAAc,EAAE;IACd0B,YAAY,EAAE;EAChB,CAAC;EACDxB,SAAS,EAAE;IACT;IACA;IACA;IACA;IACA;IACAyB,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE;EACZ,CAAC;EACD3B,UAAU,EAAE;IACV1D,QAAQ,EAAE,EAAE;IACZkF,UAAU,EAAE,KAAK;IACjBI,aAAa,EAAE,WAAW;IAC1BC,aAAa,EAAE,GAAG;IAClBZ,iBAAiB,EAAE,EAAE;IACrBa,UAAU,EAAE,CAAC;IACbC,aAAa,EAAE;EACjB,CAAC;EACDrB,WAAW,EAAE;IACXpE,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACd0E,iBAAiB,EAAE,EAAE;IACrBa,UAAU,EAAE;EACd,CAAC;EAED;EACArB,OAAO,EAAE;IACPY,MAAM,EAAE1F,UAAU,CAACqG,aAAa;IAChCnB,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useCallback, useEffect, useMemo, useSyncExternalStore } from 'react';
|
|
4
|
+
import { BackHandler, Platform } from 'react-native';
|
|
5
|
+
import { useDialogControl } from "../dialog/context.js";
|
|
6
|
+
import { finalizeClose, getSnapshot, present, requestDismiss, resetSurfaces, subscribe } from "./surfaceStore.js";
|
|
7
|
+
import { SurfaceContext } from "./useSurface.js";
|
|
8
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
/** Default placement — the ecosystem's responsive "sheet" (bottom → centered). */
|
|
10
|
+
const DEFAULT_PLACEMENT = {
|
|
11
|
+
base: 'bottom',
|
|
12
|
+
md: 'center'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Map a surface's presentation config onto the shared `Dialog` props. */
|
|
16
|
+
function placementFor(p) {
|
|
17
|
+
return {
|
|
18
|
+
placement: p.placement ?? DEFAULT_PLACEMENT,
|
|
19
|
+
width: p.width,
|
|
20
|
+
maxWidth: p.maxWidth,
|
|
21
|
+
maxHeightRatio: p.maxHeightRatio,
|
|
22
|
+
inset: p.inset,
|
|
23
|
+
showHandle: p.showHandle,
|
|
24
|
+
dismissOnBackdrop: p.dismissOnBackdrop,
|
|
25
|
+
contentPadding: p.contentPadding,
|
|
26
|
+
header: p.header,
|
|
27
|
+
scrollable: p.scrollable,
|
|
28
|
+
style: p.style,
|
|
29
|
+
panelStyle: p.panelStyle,
|
|
30
|
+
panelClassName: p.panelClassName,
|
|
31
|
+
containerStyle: p.containerStyle,
|
|
32
|
+
containerClassName: p.containerClassName,
|
|
33
|
+
label: p.label,
|
|
34
|
+
testID: p.testID
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Build the `<SurfaceHost>` + `<SurfaceProvider>` bound to a platform `Dialog`.
|
|
40
|
+
*
|
|
41
|
+
* `Dialog` is platform-forked (native `BottomSheet`-backed vs. pure-DOM web
|
|
42
|
+
* overlay), so — like `createAlertDialog` — the platform entry files
|
|
43
|
+
* (`index.ts` / `index.web.ts`) inject the correct one. The stack logic below is
|
|
44
|
+
* single-source, no duplication.
|
|
45
|
+
*/
|
|
46
|
+
export function createSurfaceHost(Dialog) {
|
|
47
|
+
/**
|
|
48
|
+
* One stacked surface. Bridges a store entry onto an IMPERATIVE `Dialog`
|
|
49
|
+
* (`useDialogControl()` + `open()`/`close()`) — never the controlled
|
|
50
|
+
* `open`/`onClose` boolean path, which fires `onClose` synchronously as the
|
|
51
|
+
* dismiss REQUEST and has no post-exit callback, so it could never tell the
|
|
52
|
+
* store WHEN to splice the entry after the exit animation.
|
|
53
|
+
*/
|
|
54
|
+
function SurfaceLayer({
|
|
55
|
+
entry,
|
|
56
|
+
index
|
|
57
|
+
}) {
|
|
58
|
+
const control = useDialogControl();
|
|
59
|
+
const {
|
|
60
|
+
id,
|
|
61
|
+
status
|
|
62
|
+
} = entry;
|
|
63
|
+
const controls = useMemo(() => ({
|
|
64
|
+
dismiss: result => requestDismiss(id, result),
|
|
65
|
+
present: (render, opts) => present(render, opts)
|
|
66
|
+
}), [id]);
|
|
67
|
+
|
|
68
|
+
// Open imperatively on mount (mirrors `AlertDialog`'s canonical
|
|
69
|
+
// fresh-mount open-from-effect; `control` is stable for the layer's life).
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
control.open();
|
|
72
|
+
}, [control]);
|
|
73
|
+
|
|
74
|
+
// When the store flips this entry to 'closing' (a programmatic dismiss,
|
|
75
|
+
// dismissAll, dismissToRoot, Escape, or Android-back), run the exit
|
|
76
|
+
// animation. A user backdrop/Escape handled by the Dialog itself instead
|
|
77
|
+
// drives its own internal close; either way `onClose` fires post-exit.
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (status === 'closing') control.close();
|
|
80
|
+
}, [status, control]);
|
|
81
|
+
|
|
82
|
+
// Fires AFTER the exit animation settles (imperative mode), for ANY
|
|
83
|
+
// dismissal path — user backdrop/Escape/back OR a programmatic dismiss.
|
|
84
|
+
// `requestDismiss` resolves-once (a programmatic dismiss already resolved
|
|
85
|
+
// with its result; this is a no-op then), then `finalizeClose` splices the
|
|
86
|
+
// entry out. Guarded by unique ids + `'closing'` status in the store.
|
|
87
|
+
const handleClose = useCallback(() => {
|
|
88
|
+
requestDismiss(id);
|
|
89
|
+
finalizeClose(id);
|
|
90
|
+
}, [id]);
|
|
91
|
+
const placement = useMemo(() => placementFor(entry.presentation), [entry.presentation]);
|
|
92
|
+
return (
|
|
93
|
+
/*#__PURE__*/
|
|
94
|
+
// `startOpen` is the surface's open-INTENT (true while not closing). It
|
|
95
|
+
// ONLY seeds a freshly-mounted Dialog branch's visible state — the
|
|
96
|
+
// imperative `control` still owns open/close — so when a responsive Dialog
|
|
97
|
+
// swaps its inner component on resize (centered card ↔ bottom sheet) the
|
|
98
|
+
// new branch mounts STILL OPEN instead of dismissing the surface. A real
|
|
99
|
+
// dismiss (backdrop/Escape/back/programmatic) still resolves + splices
|
|
100
|
+
// exactly once via `control.close()` → `handleClose`, post-exit.
|
|
101
|
+
_jsx(Dialog, {
|
|
102
|
+
control: control,
|
|
103
|
+
onClose: handleClose,
|
|
104
|
+
layer: index,
|
|
105
|
+
startOpen: status !== 'closing',
|
|
106
|
+
...placement,
|
|
107
|
+
children: /*#__PURE__*/_jsx(SurfaceContext.Provider, {
|
|
108
|
+
value: controls,
|
|
109
|
+
children: entry.render(controls)
|
|
110
|
+
})
|
|
111
|
+
})
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
function SurfaceHost() {
|
|
115
|
+
const stack = useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
|
|
116
|
+
useAndroidBackDismissesTop();
|
|
117
|
+
useEscapeDismissesTop();
|
|
118
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
119
|
+
children: stack.map((entry, index) => /*#__PURE__*/_jsx(SurfaceLayer, {
|
|
120
|
+
entry: entry,
|
|
121
|
+
index: index
|
|
122
|
+
}, entry.id))
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
SurfaceHost.displayName = 'SurfaceHost';
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Mount ONCE near your app root — renders `children` plus the stack host.
|
|
129
|
+
* Requires the Bloom Portal provider to be mounted too (same as any `<Dialog>`
|
|
130
|
+
* usage): on web the Portal auto-creates `#bloom-portal-root`; on native mount
|
|
131
|
+
* `<Provider>`/`<Outlet>` from `@oxyhq/bloom/portal`. Can equally be folded
|
|
132
|
+
* next to that Portal provider — `<SurfaceHost>` used directly does the same
|
|
133
|
+
* job without wrapping `children`.
|
|
134
|
+
*/
|
|
135
|
+
function SurfaceProvider({
|
|
136
|
+
children
|
|
137
|
+
}) {
|
|
138
|
+
// Resolve any pending awaiters if the provider unmounts so no `present()`
|
|
139
|
+
// promise is stranded.
|
|
140
|
+
useEffect(() => () => resetSurfaces(), []);
|
|
141
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
142
|
+
children: [children, /*#__PURE__*/_jsx(SurfaceHost, {})]
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
SurfaceProvider.displayName = 'SurfaceProvider';
|
|
146
|
+
return {
|
|
147
|
+
SurfaceHost,
|
|
148
|
+
SurfaceProvider
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* ONE Android hardware-back handler for the whole stack → dismiss the TOP
|
|
154
|
+
* surface. Reads the live top from the store so a single registration always
|
|
155
|
+
* targets the current top. Returns `false` when the stack is empty so app-level
|
|
156
|
+
* back navigation is untouched.
|
|
157
|
+
*/
|
|
158
|
+
function useAndroidBackDismissesTop() {
|
|
159
|
+
useEffect(() => {
|
|
160
|
+
if (Platform.OS !== 'android') return;
|
|
161
|
+
const sub = BackHandler.addEventListener('hardwareBackPress', () => {
|
|
162
|
+
const stack = getSnapshot();
|
|
163
|
+
const top = stack[stack.length - 1];
|
|
164
|
+
if (!top) return false;
|
|
165
|
+
if (top.presentation.dismissOnBackdrop === false) return true;
|
|
166
|
+
requestDismiss(top.id);
|
|
167
|
+
return true;
|
|
168
|
+
});
|
|
169
|
+
return () => sub.remove();
|
|
170
|
+
}, []);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Web-only: route Escape to the TOP surface only. A window-CAPTURE listener runs
|
|
175
|
+
* before each `Dialog`'s own document-level keydown, so `stopImmediatePropagation`
|
|
176
|
+
* prevents the lower stacked dialogs from ALSO handling Escape (they each add a
|
|
177
|
+
* document listener) — Escape dismisses strictly the top, LIFO. No-op on native.
|
|
178
|
+
*/
|
|
179
|
+
function useEscapeDismissesTop() {
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (Platform.OS !== 'web') return;
|
|
182
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') return;
|
|
183
|
+
const handler = e => {
|
|
184
|
+
if (e.key !== 'Escape') return;
|
|
185
|
+
const stack = getSnapshot();
|
|
186
|
+
const top = stack[stack.length - 1];
|
|
187
|
+
if (!top) return;
|
|
188
|
+
if (top.presentation.dismissOnBackdrop === false) return;
|
|
189
|
+
e.stopImmediatePropagation();
|
|
190
|
+
e.preventDefault();
|
|
191
|
+
requestDismiss(top.id);
|
|
192
|
+
};
|
|
193
|
+
window.addEventListener('keydown', handler, true);
|
|
194
|
+
return () => window.removeEventListener('keydown', handler, true);
|
|
195
|
+
}, []);
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=SurfaceHost.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useSyncExternalStore","BackHandler","Platform","useDialogControl","finalizeClose","getSnapshot","present","requestDismiss","resetSurfaces","subscribe","SurfaceContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","DEFAULT_PLACEMENT","base","md","placementFor","p","placement","width","maxWidth","maxHeightRatio","inset","showHandle","dismissOnBackdrop","contentPadding","header","scrollable","style","panelStyle","panelClassName","containerStyle","containerClassName","label","testID","createSurfaceHost","Dialog","SurfaceLayer","entry","index","control","id","status","controls","dismiss","result","render","opts","open","close","handleClose","presentation","onClose","layer","startOpen","children","Provider","value","SurfaceHost","stack","useAndroidBackDismissesTop","useEscapeDismissesTop","map","displayName","SurfaceProvider","OS","sub","addEventListener","top","length","remove","window","document","handler","e","key","stopImmediatePropagation","preventDefault","removeEventListener"],"sourceRoot":"../../../src","sources":["surfaces/SurfaceHost.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,oBAAoB,QACf,OAAO;AACd,SAASC,WAAW,EAAEC,QAAQ,QAAQ,cAAc;AAEpD,SAASC,gBAAgB,QAAQ,sBAAmB;AAEpD,SACEC,aAAa,EACbC,WAAW,EACXC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,SAAS,QACJ,mBAAgB;AACvB,SAASC,cAAc,QAAQ,iBAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAK9C;AACA,MAAMC,iBAAmD,GAAG;EAC1DC,IAAI,EAAE,QAAQ;EACdC,EAAE,EAAE;AACN,CAAC;;AAED;AACA,SAASC,YAAYA,CAACC,CAAsB,EAAwB;EAClE,OAAO;IACLC,SAAS,EAAED,CAAC,CAACC,SAAS,IAAIL,iBAAiB;IAC3CM,KAAK,EAAEF,CAAC,CAACE,KAAK;IACdC,QAAQ,EAAEH,CAAC,CAACG,QAAQ;IACpBC,cAAc,EAAEJ,CAAC,CAACI,cAAc;IAChCC,KAAK,EAAEL,CAAC,CAACK,KAAK;IACdC,UAAU,EAAEN,CAAC,CAACM,UAAU;IACxBC,iBAAiB,EAAEP,CAAC,CAACO,iBAAiB;IACtCC,cAAc,EAAER,CAAC,CAACQ,cAAc;IAChCC,MAAM,EAAET,CAAC,CAACS,MAAM;IAChBC,UAAU,EAAEV,CAAC,CAACU,UAAU;IACxBC,KAAK,EAAEX,CAAC,CAACW,KAAK;IACdC,UAAU,EAAEZ,CAAC,CAACY,UAAU;IACxBC,cAAc,EAAEb,CAAC,CAACa,cAAc;IAChCC,cAAc,EAAEd,CAAC,CAACc,cAAc;IAChCC,kBAAkB,EAA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,CAACG,cAAc,CAAC,CAAC;MAClB1E,cAAc,CAACiE,GAAG,CAAC3B,EAAE,CAAC;IACxB,CAAC;IACD8B,MAAM,CAACJ,gBAAgB,CAAC,SAAS,EAAEM,OAAO,EAAE,IAAI,CAAC;IACjD,OAAO,MAAMF,MAAM,CAACO,mBAAmB,CAAC,SAAS,EAAEL,OAAO,EAAE,IAAI,CAAC;EACnE,CAAC,EAAE,EAAE,CAAC;AACR","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { dismissAll, dismissToRoot, dismissTop, present, requestDismiss } from "./surfaceStore.js";
|
|
4
|
+
import { confirm, prompt } from "./prompts.js";
|
|
5
|
+
/**
|
|
6
|
+
* Dismiss the TOP surface, resolving its `present()` promise with `result`.
|
|
7
|
+
* The public counterpart of the store's `dismissTop`.
|
|
8
|
+
*/
|
|
9
|
+
function dismiss(result) {
|
|
10
|
+
dismissTop(result);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Dismiss a SPECIFIC surface by id, resolving its `present()` promise with
|
|
15
|
+
* `result`. Rarely needed — most call sites use `dismiss()` (top) or the
|
|
16
|
+
* per-surface `SurfaceControls.dismiss`.
|
|
17
|
+
*/
|
|
18
|
+
function dismissById(id, result) {
|
|
19
|
+
requestDismiss(id, result);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The shared imperative surface-stack API — a module singleton (mirrors
|
|
24
|
+
* `alert()`'s shape) so any consumer, in the SDK or an app, presents into the
|
|
25
|
+
* SAME coordinated Bloom stack from anywhere without threading a provider.
|
|
26
|
+
*
|
|
27
|
+
* Exposed at the package root as `surfaces` (avoids a bare `present`/`confirm`
|
|
28
|
+
* name clash with the existing `alert-dialog` `confirm`); the individual
|
|
29
|
+
* functions are also named exports of `@oxyhq/bloom/surfaces` for direct import.
|
|
30
|
+
*/
|
|
31
|
+
export const surfaces = {
|
|
32
|
+
/** Present a new surface on top. Resolves with the dismissal result. */
|
|
33
|
+
present: (render, opts) => present(render, opts),
|
|
34
|
+
/** Dismiss the top surface. */
|
|
35
|
+
dismiss,
|
|
36
|
+
/** Dismiss a specific surface by id. */
|
|
37
|
+
dismissById,
|
|
38
|
+
/** Dismiss everything above the root surface. */
|
|
39
|
+
dismissToRoot,
|
|
40
|
+
/** Dismiss the entire stack (resolves pending awaiters with `undefined`). */
|
|
41
|
+
dismissAll,
|
|
42
|
+
/** Present a confirm surface; resolves `true`/`false`. */
|
|
43
|
+
confirm,
|
|
44
|
+
/** Present a prompt surface; resolves the string or `null`. */
|
|
45
|
+
prompt
|
|
46
|
+
};
|
|
47
|
+
export { confirm, dismiss, dismissAll, dismissById, dismissToRoot, present, prompt };
|
|
48
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dismissAll","dismissToRoot","dismissTop","present","requestDismiss","confirm","prompt","dismiss","result","dismissById","id","surfaces","render","opts"],"sourceRoot":"../../../src","sources":["surfaces/api.ts"],"mappings":";;AAAA,SACEA,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,cAAc,QACT,mBAAgB;AACvB,SAASC,OAAO,EAAEC,MAAM,QAAQ,cAAW;AAG3C;AACA;AACA;AACA;AACA,SAASC,OAAOA,CAACC,MAAgB,EAAQ;EACvCN,UAAU,CAACM,MAAM,CAAC;AACpB;;AAEA;AACA;AACA;AACA;AACA;AACA,SAASC,WAAWA,CAACC,EAAU,EAAEF,MAAgB,EAAQ;EACvDJ,cAAc,CAACM,EAAE,EAAEF,MAAM,CAAC;AAC5B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAQ,GAAG;EACtB;EACAR,OAAO,EAAEA,CAAmBS,MAAuB,EAAEC,IAAqB,KACxEV,OAAO,CAASS,MAAM,EAAEC,IAAI,CAAC;EAC/B;EACAN,OAAO;EACP;EACAE,WAAW;EACX;EACAR,aAAa;EACb;EACAD,UAAU;EACV;EACAK,OAAO;EACP;EACAC;AACF,CAAU;AAEV,SAASD,OAAO,EAAEE,OAAO,EAAEP,UAAU,EAAES,WAAW,EAAER,aAAa,EAAEE,OAAO,EAAEG,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dialog } from '../dialog';
|
|
4
|
+
import { createSurfaceHost } from "./SurfaceHost.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shared, content-agnostic SURFACE STACK.
|
|
8
|
+
*
|
|
9
|
+
* `<SurfaceProvider>`/`<SurfaceHost>` render the coordinated stack; the
|
|
10
|
+
* imperative `surfaces` API (+ its named functions) present into it from
|
|
11
|
+
* anywhere; `useSurface()` gives a presented surface its own controls.
|
|
12
|
+
*
|
|
13
|
+
* `SurfaceHost`/`SurfaceProvider` are bound to the NATIVE `Dialog` here; the web
|
|
14
|
+
* fork (`./index.web`) binds the web `Dialog`. The store, imperative API, hook,
|
|
15
|
+
* and types are platform-agnostic and shared by both.
|
|
16
|
+
*/
|
|
17
|
+
const {
|
|
18
|
+
SurfaceHost,
|
|
19
|
+
SurfaceProvider
|
|
20
|
+
} = createSurfaceHost(Dialog);
|
|
21
|
+
export { SurfaceHost, SurfaceProvider };
|
|
22
|
+
export { surfaces, present, dismiss, dismissById, dismissToRoot, dismissAll, confirm, prompt } from "./api.js";
|
|
23
|
+
export { useSurface } from "./useSurface.js";
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dialog","createSurfaceHost","SurfaceHost","SurfaceProvider","surfaces","present","dismiss","dismissById","dismissToRoot","dismissAll","confirm","prompt","useSurface"],"sourceRoot":"../../../src","sources":["surfaces/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,WAAW;AAClC,SAASC,iBAAiB,QAAQ,kBAAe;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;EAAEC,WAAW;EAAEC;AAAgB,CAAC,GAAGF,iBAAiB,CAACD,MAAM,CAAC;AAElE,SAASE,WAAW,EAAEC,eAAe;AACrC,SACEC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,WAAW,EACXC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,MAAM,QACD,UAAO;AACd,SAASC,UAAU,QAAQ,iBAAc","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Dialog } from "../dialog/index.web.js";
|
|
4
|
+
import { createSurfaceHost } from "./SurfaceHost.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Web variant of the surface stack barrel. Identical surface area to the native
|
|
8
|
+
* `./index.ts` — it just binds the web-fork `Dialog` (`Dialog.web.tsx`, a
|
|
9
|
+
* pure-DOM overlay) instead of the native `BottomSheet`-backed one. The store,
|
|
10
|
+
* imperative API, hook, and types are shared, platform-agnostic modules.
|
|
11
|
+
*/
|
|
12
|
+
const {
|
|
13
|
+
SurfaceHost,
|
|
14
|
+
SurfaceProvider
|
|
15
|
+
} = createSurfaceHost(Dialog);
|
|
16
|
+
export { SurfaceHost, SurfaceProvider };
|
|
17
|
+
export { surfaces, present, dismiss, dismissById, dismissToRoot, dismissAll, confirm, prompt } from "./api.js";
|
|
18
|
+
export { useSurface } from "./useSurface.js";
|
|
19
|
+
//# sourceMappingURL=index.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Dialog","createSurfaceHost","SurfaceHost","SurfaceProvider","surfaces","present","dismiss","dismissById","dismissToRoot","dismissAll","confirm","prompt","useSurface"],"sourceRoot":"../../../src","sources":["surfaces/index.web.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,wBAAqB;AAC5C,SAASC,iBAAiB,QAAQ,kBAAe;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;EAAEC,WAAW;EAAEC;AAAgB,CAAC,GAAGF,iBAAiB,CAACD,MAAM,CAAC;AAElE,SAASE,WAAW,EAAEC,eAAe;AACrC,SACEC,QAAQ,EACRC,OAAO,EACPC,OAAO,EACPC,WAAW,EACXC,aAAa,EACbC,UAAU,EACVC,OAAO,EACPC,MAAM,QACD,UAAO;AACd,SAASC,UAAU,QAAQ,iBAAc","ignoreList":[]}
|