@oxyhq/bloom 0.8.2 → 0.8.3
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/avatar/Avatar.js +2 -1
- package/lib/commonjs/avatar/Avatar.js.map +1 -1
- package/lib/commonjs/badge/Badge.js +2 -1
- package/lib/commonjs/badge/Badge.js.map +1 -1
- package/lib/commonjs/bottom-sheet/index.js +3 -2
- package/lib/commonjs/bottom-sheet/index.js.map +1 -1
- package/lib/commonjs/context-menu/index.web.js +5 -2
- package/lib/commonjs/context-menu/index.web.js.map +1 -1
- package/lib/commonjs/dialog/CenteredDialog.web.js +4 -2
- package/lib/commonjs/dialog/CenteredDialog.web.js.map +1 -1
- package/lib/commonjs/dialog/Dialog.web.js +4 -2
- package/lib/commonjs/dialog/Dialog.web.js.map +1 -1
- package/lib/commonjs/dialog/SheetShell.js +2 -1
- package/lib/commonjs/dialog/SheetShell.js.map +1 -1
- package/lib/commonjs/index.js +14 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +14 -0
- package/lib/commonjs/index.web.js.map +1 -1
- package/lib/commonjs/menu/index.web.js +38 -19
- package/lib/commonjs/menu/index.web.js.map +1 -1
- package/lib/commonjs/popover/index.web.js +5 -2
- package/lib/commonjs/popover/index.web.js.map +1 -1
- package/lib/commonjs/portal/index.js +2 -1
- package/lib/commonjs/portal/index.js.map +1 -1
- package/lib/commonjs/portal/index.web.js +2 -1
- package/lib/commonjs/portal/index.web.js.map +1 -1
- package/lib/commonjs/prompt-input/PromptInput.js +4 -3
- package/lib/commonjs/prompt-input/PromptInput.js.map +1 -1
- package/lib/commonjs/select/index.web.js +5 -2
- package/lib/commonjs/select/index.web.js.map +1 -1
- package/lib/commonjs/styles/index.js +13 -0
- package/lib/commonjs/styles/index.js.map +1 -1
- package/lib/commonjs/styles/z-index.js +52 -0
- package/lib/commonjs/styles/z-index.js.map +1 -0
- package/lib/commonjs/tooltip/index.web.js +2 -1
- package/lib/commonjs/tooltip/index.web.js.map +1 -1
- package/lib/module/avatar/Avatar.js +2 -1
- package/lib/module/avatar/Avatar.js.map +1 -1
- package/lib/module/badge/Badge.js +2 -1
- package/lib/module/badge/Badge.js.map +1 -1
- package/lib/module/bottom-sheet/index.js +3 -2
- package/lib/module/bottom-sheet/index.js.map +1 -1
- package/lib/module/context-menu/index.web.js +6 -3
- package/lib/module/context-menu/index.web.js.map +1 -1
- package/lib/module/dialog/CenteredDialog.web.js +4 -2
- package/lib/module/dialog/CenteredDialog.web.js.map +1 -1
- package/lib/module/dialog/Dialog.web.js +4 -2
- package/lib/module/dialog/Dialog.web.js.map +1 -1
- package/lib/module/dialog/SheetShell.js +2 -1
- package/lib/module/dialog/SheetShell.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +1 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/module/menu/index.web.js +40 -21
- package/lib/module/menu/index.web.js.map +1 -1
- package/lib/module/popover/index.web.js +4 -2
- package/lib/module/popover/index.web.js.map +1 -1
- package/lib/module/portal/index.js +2 -1
- package/lib/module/portal/index.js.map +1 -1
- package/lib/module/portal/index.web.js +2 -1
- package/lib/module/portal/index.web.js.map +1 -1
- package/lib/module/prompt-input/PromptInput.js +4 -3
- package/lib/module/prompt-input/PromptInput.js.map +1 -1
- package/lib/module/select/index.web.js +4 -2
- package/lib/module/select/index.web.js.map +1 -1
- package/lib/module/styles/index.js +1 -0
- package/lib/module/styles/index.js.map +1 -1
- package/lib/module/styles/z-index.js +45 -0
- package/lib/module/styles/z-index.js.map +1 -0
- package/lib/module/tooltip/index.web.js +2 -1
- package/lib/module/tooltip/index.web.js.map +1 -1
- package/lib/typescript/commonjs/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/commonjs/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/commonjs/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/CenteredDialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dialog/SheetShell.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.web.d.ts +1 -1
- package/lib/typescript/commonjs/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/portal/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/portal/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/prompt-input/PromptInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/select/index.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/index.d.ts +1 -0
- package/lib/typescript/commonjs/styles/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles/z-index.d.ts +49 -0
- package/lib/typescript/commonjs/styles/z-index.d.ts.map +1 -0
- package/lib/typescript/commonjs/tooltip/index.web.d.ts.map +1 -1
- package/lib/typescript/module/avatar/Avatar.d.ts.map +1 -1
- package/lib/typescript/module/badge/Badge.d.ts.map +1 -1
- package/lib/typescript/module/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/module/context-menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/CenteredDialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/Dialog.web.d.ts.map +1 -1
- package/lib/typescript/module/dialog/SheetShell.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +1 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/index.web.d.ts +1 -1
- package/lib/typescript/module/index.web.d.ts.map +1 -1
- package/lib/typescript/module/menu/index.web.d.ts.map +1 -1
- package/lib/typescript/module/popover/index.web.d.ts.map +1 -1
- package/lib/typescript/module/portal/index.d.ts.map +1 -1
- package/lib/typescript/module/portal/index.web.d.ts.map +1 -1
- package/lib/typescript/module/prompt-input/PromptInput.d.ts.map +1 -1
- package/lib/typescript/module/select/index.web.d.ts.map +1 -1
- package/lib/typescript/module/styles/index.d.ts +1 -0
- package/lib/typescript/module/styles/index.d.ts.map +1 -1
- package/lib/typescript/module/styles/z-index.d.ts +49 -0
- package/lib/typescript/module/styles/z-index.d.ts.map +1 -0
- package/lib/typescript/module/tooltip/index.web.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/avatar/Avatar.tsx +2 -1
- package/src/badge/Badge.tsx +2 -1
- package/src/bottom-sheet/index.tsx +3 -2
- package/src/context-menu/index.web.tsx +5 -2
- package/src/dialog/CenteredDialog.web.tsx +4 -2
- package/src/dialog/Dialog.web.tsx +4 -2
- package/src/dialog/SheetShell.tsx +2 -1
- package/src/index.ts +1 -1
- package/src/index.web.ts +1 -1
- package/src/menu/index.web.tsx +44 -21
- package/src/popover/index.web.tsx +5 -2
- package/src/portal/index.tsx +2 -1
- package/src/portal/index.web.tsx +2 -1
- package/src/prompt-input/PromptInput.tsx +4 -3
- package/src/select/index.web.tsx +5 -2
- package/src/styles/index.ts +1 -0
- package/src/styles/z-index.ts +47 -0
- package/src/tooltip/index.web.tsx +2 -1
package/src/select/index.web.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import { Pressable, StyleSheet, View } from 'react-native';
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { Text } from '../typography';
|
|
6
6
|
import { Portal } from '../portal/index.web';
|
|
7
|
+
import { createOverlayZIndex } from '../styles/z-index';
|
|
7
8
|
import { RadioIndicator } from '../radio-indicator';
|
|
8
9
|
import { useInteractionState } from '../hooks/useInteractionState';
|
|
9
10
|
import {
|
|
@@ -25,6 +26,8 @@ import type {
|
|
|
25
26
|
|
|
26
27
|
export { useItemContext };
|
|
27
28
|
|
|
29
|
+
const selectZIndex = createOverlayZIndex();
|
|
30
|
+
|
|
28
31
|
// ---------------------------------------------------------------------------
|
|
29
32
|
// Context
|
|
30
33
|
// ---------------------------------------------------------------------------
|
|
@@ -337,13 +340,13 @@ const styles = StyleSheet.create({
|
|
|
337
340
|
left: 0,
|
|
338
341
|
right: 0,
|
|
339
342
|
bottom: 0,
|
|
340
|
-
zIndex:
|
|
343
|
+
zIndex: selectZIndex.backdrop,
|
|
341
344
|
// Opt back in from the Portal root's `pointer-events: none`.
|
|
342
345
|
pointerEvents: 'auto',
|
|
343
346
|
},
|
|
344
347
|
dropdown: {
|
|
345
348
|
position: 'absolute',
|
|
346
|
-
zIndex:
|
|
349
|
+
zIndex: selectZIndex.surface,
|
|
347
350
|
borderRadius: 8,
|
|
348
351
|
borderWidth: 1,
|
|
349
352
|
overflow: 'hidden',
|
package/src/styles/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { atoms, flatten } from './atoms';
|
|
2
2
|
export type { ViewStyleProp, TextStyleProp } from './atoms';
|
|
3
3
|
export * as tokens from './tokens';
|
|
4
|
+
export { Z_INDEX, zIndex } from './z-index';
|
|
4
5
|
export { web, native, ios, android, platform, select } from './platform';
|
|
5
6
|
export { SUPPORTS_NATIVE_DRIVER } from './native-driver';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared stacking scale for Bloom primitives.
|
|
3
|
+
*
|
|
4
|
+
* Keep component layers on this scale instead of introducing local magic
|
|
5
|
+
* numbers. App-specific surfaces can still sit above Bloom's inline layers,
|
|
6
|
+
* while portaled overlays use `portalRoot` as the document-level host.
|
|
7
|
+
*/
|
|
8
|
+
export const Z_INDEX = {
|
|
9
|
+
base: 0,
|
|
10
|
+
raised: 1,
|
|
11
|
+
floating: 10,
|
|
12
|
+
sticky: 20,
|
|
13
|
+
dropdown: 40,
|
|
14
|
+
dropdownSurface: 41,
|
|
15
|
+
overlayBackdrop: 50,
|
|
16
|
+
overlaySurface: 60,
|
|
17
|
+
tooltip: 70,
|
|
18
|
+
toast: 80,
|
|
19
|
+
fullscreen: 90,
|
|
20
|
+
fullscreenControl: 91,
|
|
21
|
+
sheetHandle: 100,
|
|
22
|
+
portalRoot: 999999,
|
|
23
|
+
} as const;
|
|
24
|
+
|
|
25
|
+
export const Z_INDEX_LAYER_STEP = 10;
|
|
26
|
+
|
|
27
|
+
function layerOffset(layer = 0) {
|
|
28
|
+
return Math.max(0, Math.floor(layer)) * Z_INDEX_LAYER_STEP;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function createDropdownZIndex(layer = 0) {
|
|
32
|
+
const offset = layerOffset(layer);
|
|
33
|
+
return {
|
|
34
|
+
root: Z_INDEX.dropdown + offset,
|
|
35
|
+
surface: Z_INDEX.dropdownSurface + offset,
|
|
36
|
+
} as const;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function createOverlayZIndex(layer = 0) {
|
|
40
|
+
const offset = layerOffset(layer);
|
|
41
|
+
return {
|
|
42
|
+
backdrop: Z_INDEX.overlayBackdrop + offset,
|
|
43
|
+
surface: Z_INDEX.overlaySurface + offset,
|
|
44
|
+
} as const;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const zIndex = Z_INDEX;
|
|
@@ -3,6 +3,7 @@ import { Pressable, StyleSheet, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { useTheme } from '../theme/use-theme';
|
|
5
5
|
import { atoms as a, flatten } from '../styles';
|
|
6
|
+
import { Z_INDEX } from '../styles/z-index';
|
|
6
7
|
import {
|
|
7
8
|
ARROW_SIZE,
|
|
8
9
|
BUBBLE_MAX_WIDTH,
|
|
@@ -154,6 +155,6 @@ const webStyles = StyleSheet.create({
|
|
|
154
155
|
left: 0,
|
|
155
156
|
right: 0,
|
|
156
157
|
bottom: 0,
|
|
157
|
-
zIndex:
|
|
158
|
+
zIndex: Z_INDEX.tooltip,
|
|
158
159
|
},
|
|
159
160
|
});
|