diff --git a/eslint.config.js b/eslint.config.js index e39625e07..a3f4ea182 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -41,6 +41,7 @@ export default [ document: 'readonly', navigator: 'readonly', console: 'readonly', + fetch: 'readonly', URL: 'readonly', caches: 'readonly', diff --git a/packages/ui/src/constants/zIndex.js b/packages/ui/src/constants/zIndex.js new file mode 100644 index 000000000..3d47b3ec1 --- /dev/null +++ b/packages/ui/src/constants/zIndex.js @@ -0,0 +1,44 @@ +/** + * Z-Index Constants + * + * Centralized z-index values for overlay components to ensure consistent layering. + * All values are Tailwind CSS classes for compatibility with existing setup. + * + * Z-Index Tier System: + * - z-40: Tooltips, Popovers, Menus, Comboboxes (lowest overlay tier, non-blocking) + * - z-50: Dialogs, Drawers, Toasts (modal overlays and notifications) + * - z-100: Tour backdrops, System banners (high-priority overlays) + * - z-101: Tour spotlight (above tour backdrop) + * - z-102: Tour content (highest, above all other overlays) + */ + +export const Z_INDEX = { + /** Tooltip and Popover - Lowest overlay tier for non-blocking hints */ + TOOLTIP: 'z-40', + POPOVER: 'z-40', + + /** Menu and Combobox - Dropdown menus and autocomplete */ + MENU: 'z-40', + COMBOBOX: 'z-40', + + /** Dialog and Drawer Backdrop - Modal backdrops */ + BACKDROP: 'z-50', + + /** Dialog and Drawer Content - Modal content */ + DIALOG: 'z-50', + + /** Toast - Toast notifications */ + TOAST: 'z-50', + + /** Tour Backdrop - Tour overlay backdrop */ + TOUR_BACKDROP: 'z-100', + + /** Tour Spotlight - Tour spotlight effect */ + TOUR_SPOTLIGHT: 'z-101', + + /** Tour Content - Tour content (highest overlay) */ + TOUR_CONTENT: 'z-102', + + /** Banner - System-level banners (e.g., ImpersonationBanner) */ + BANNER: 'z-100', +}; diff --git a/packages/ui/src/index.js b/packages/ui/src/index.js index 62851c338..08ae6f6c6 100644 --- a/packages/ui/src/index.js +++ b/packages/ui/src/index.js @@ -8,3 +8,6 @@ export { useWindowDrag } from './primitives/useWindowDrag.js'; // Re-export utilities export { cn } from './lib/cn.js'; + +// Re-export constants +export { Z_INDEX } from './constants/zIndex.js'; diff --git a/packages/ui/src/zag/Combobox.jsx b/packages/ui/src/zag/Combobox.jsx index b276afbbb..a6f04b2d2 100644 --- a/packages/ui/src/zag/Combobox.jsx +++ b/packages/ui/src/zag/Combobox.jsx @@ -3,6 +3,7 @@ import { Portal } from 'solid-js/web'; import { normalizeProps, useMachine } from '@zag-js/solid'; import { createMemo, createSignal, createUniqueId, For, Show, splitProps } from 'solid-js'; import { FiChevronDown, FiX, FiCheck } from 'solid-icons/fi'; +import { Z_INDEX } from '../constants/zIndex.js'; /** * Combobox - Searchable select with autocomplete @@ -75,7 +76,7 @@ export function Combobox(props) { 0}>