@grafana/components 0.0.32 → 0.0.34
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/dist/cjs/index.cjs +7 -5
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +178 -30
- package/dist/esm/components/ColorModeProvider/ColorModeProvider.js +3 -3
- package/dist/esm/components/ColorModeProvider/ColorModeProvider.js.map +1 -1
- package/dist/esm/components/ComparisonTooltip/ComparisonTooltip.js.map +1 -1
- package/dist/esm/components/Popover/Popover.js +4 -2
- package/dist/esm/components/Popover/Popover.js.map +1 -1
- package/dist/esm/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.js.map +1 -1
- package/dist/esm/index.d.ts +178 -30
- package/dist/esm/utils/comparison.js.map +1 -1
- package/dist/esm/utils/formatters.js.map +1 -1
- package/package.json +2 -2
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var runtime = require('@grafana/runtime');
|
|
8
|
-
require('@grafana/design-tokens/dist/css/legacy/primitives.css');
|
|
9
|
-
require('@grafana/design-tokens/dist/css/legacy/colors.light.css');
|
|
10
|
-
require('@grafana/design-tokens/dist/css/legacy/colors.dark.css');
|
|
8
|
+
require('@grafana/design-tokens/dist/css/legacy/default/primitives.css');
|
|
9
|
+
require('@grafana/design-tokens/dist/css/legacy/default/colors.light.css');
|
|
10
|
+
require('@grafana/design-tokens/dist/css/legacy/default/colors.dark.css');
|
|
11
11
|
var css = require('@emotion/css');
|
|
12
12
|
var designTokens = require('@grafana/design-tokens');
|
|
13
13
|
var ui = require('@grafana/ui');
|
|
@@ -199,7 +199,8 @@ const getMiddleware = ({
|
|
|
199
199
|
};
|
|
200
200
|
const Popover = React.forwardRef(
|
|
201
201
|
({
|
|
202
|
-
trigger,
|
|
202
|
+
trigger: _trigger,
|
|
203
|
+
content: _content,
|
|
203
204
|
children,
|
|
204
205
|
isOpen: isOpenControlled,
|
|
205
206
|
isInteractive = false,
|
|
@@ -297,6 +298,7 @@ const Popover = React.forwardRef(
|
|
|
297
298
|
},
|
|
298
299
|
[forwardedRef, refs]
|
|
299
300
|
);
|
|
301
|
+
const [trigger, content] = typeof _trigger !== "undefined" ? [_trigger, children] : [children, _content];
|
|
300
302
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
301
303
|
React.cloneElement(trigger, {
|
|
302
304
|
ref: handleRef,
|
|
@@ -306,7 +308,7 @@ const Popover = React.forwardRef(
|
|
|
306
308
|
}),
|
|
307
309
|
(isDelayedOpen || isOpen) && /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { root: portalRoot, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: refs.setFloating, style: floatingStyles, ...getFloatingProps(), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { style: transitionStyles, className: styles.shadow, children: [
|
|
308
310
|
/* @__PURE__ */ jsxRuntime.jsx(react.FloatingArrow, { className: styles.arrow, ref: arrowRef, context }),
|
|
309
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { id: popoverId, role: "tooltip", className: styles.container, children })
|
|
311
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { id: popoverId, role: "tooltip", className: styles.container, children: content })
|
|
310
312
|
] }) }) })
|
|
311
313
|
] });
|
|
312
314
|
}
|
package/dist/cjs/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/components/ColorModeProvider/ColorModeProvider.tsx","../../src/hooks/useColorModeChange.ts","../../src/components/ColorModeChangeHandler/ColorModeChangeHandler.tsx","../../src/components/ColorMode/ColorMode.tsx","../../src/utils/formatters.ts","../../src/utils/comparison.ts","../../src/components/PortalProvider/PortalProvider.tsx","../../src/components/Popover/Popover.styles.ts","../../src/components/Popover/Popover.tsx","../../src/components/ComparisonTooltip/ComparisonTooltip.styles.ts","../../src/components/ComparisonTooltip/ComparisonTooltip.tsx","../../src/components/ComparisonBadge/ComparisonBadge.styles.ts","../../src/components/ComparisonBadge/ComparisonBadge.tsx","../../src/components/GenericSkeleton/GenericSkeleton.styles.ts","../../src/components/GenericSkeleton/GenericSkeleton.tsx","../../src/components/StackedChart/shared.styles.ts","../../src/components/StackedChartSegment/StackedChartSegment.styles.ts","../../src/components/StackedChartSegment/StackedChartSegment.tsx","../../src/components/StackedChart/StackedChart.styles.ts","../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.styles.ts","../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.tsx","../../src/components/StackedChartSkeleton/StackedChartSkeleton.styles.ts","../../src/components/StackedChart/common.ts","../../src/components/StackedChartSkeleton/StackedChartSkeleton.tsx","../../src/components/StackedChartNoData/StackedChartNoData.styles.ts","../../src/components/StackedChartNoData/StackedChartNoData.tsx","../../src/components/StackedChart/StackedChart.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, ReactNode } from 'react';\nimport { ThemeColorMode } from '@grafana/design-tokens';\n\nimport '@grafana/design-tokens/dist/css/legacy/primitives.css';\nimport '@grafana/design-tokens/dist/css/legacy/colors.light.css';\nimport '@grafana/design-tokens/dist/css/legacy/colors.dark.css';\n\nexport interface ColorModeContextType {\n colorMode: ThemeColorMode;\n setColorMode: (colorMode: ThemeColorMode) => void;\n}\n\nexport interface ColorModeProviderProps {\n children: ReactNode;\n defaultColorMode?: ThemeColorMode;\n}\n\nconst ColorModeContext = createContext<ColorModeContextType | undefined>(undefined);\n\n/**\n * Provides a shared context for the currently-active theme color mode, and sets\n * the data-color-mode attribute on the document element whenever it changes.\n */\nexport const ColorModeProvider: React.FC<ColorModeProviderProps> = ({\n children,\n defaultColorMode = 'light',\n}) => {\n const [colorMode, setColorMode] = useState<ThemeColorMode>(defaultColorMode);\n\n useEffect(() => {\n document.documentElement.setAttribute('data-color-mode', colorMode);\n }, [colorMode]);\n\n return (\n <ColorModeContext.Provider value={{ colorMode, setColorMode }}>\n {children}\n </ColorModeContext.Provider>\n );\n};\n\n/**\n * Use this to query the active color mode, or to set it, e.g. with an effect\n * hook within a component which explicitly changes the active color mode:\n *\n * useEffect(() => {\n * setColorMode(colorMode);\n * }, [colorMode]);\n *\n */\nexport const useColorMode = () => {\n const context = useContext(ColorModeContext);\n\n if (context === undefined) {\n throw new Error('useColorMode must be used within a ColorModeProvider');\n }\n\n return context;\n};\n","import { useEffect } from 'react';\nimport type { EventBus, GrafanaTheme2 } from '@grafana/data';\nimport { ThemeChangedEvent } from '@grafana/runtime';\nimport type { ThemeColorMode } from '@grafana/design-tokens';\nimport { useColorMode } from '../components/ColorModeProvider/ColorModeProvider';\n\nconst getThemeColorMode = (isLight: boolean): ThemeColorMode => {\n return isLight ? 'light' : 'dark';\n};\n\nexport interface ColorModeChangeProps {\n getAppEvents: () => EventBus;\n useTheme2: () => GrafanaTheme2;\n}\n\n/**\n * This allows us to register an event listener for when the ThemeChangedEvent\n * is fired, and update the currently active color mode accordingly. It will\n * also determine the color mode on initial registration, and update the context\n * provider accordingly.\n */\nexport const useColorModeChange = ({\n getAppEvents,\n useTheme2,\n}: ColorModeChangeProps): ThemeColorMode => {\n const { colorMode, setColorMode } = useColorMode();\n const appEvents = getAppEvents();\n\n /**\n * Longterm the current colorMode should ideally exist outside of useTheme2\n */\n const { isLight } = useTheme2();\n\n useEffect(() => {\n const themeChangedEvent = appEvents.subscribe<ThemeChangedEvent>(\n ThemeChangedEvent,\n ({ payload }) => {\n const newColorMode = getThemeColorMode(payload.isLight);\n setColorMode(newColorMode);\n },\n );\n\n return () => {\n themeChangedEvent.unsubscribe();\n };\n }, [appEvents, setColorMode]);\n\n // Sync color mode when theme changes (runs on mount and when isLight changes)\n useEffect(() => {\n const newColorMode = getThemeColorMode(isLight);\n setColorMode(newColorMode);\n }, [isLight, setColorMode]);\n\n return colorMode;\n};\n","import React from 'react';\nimport { useColorModeChange, ColorModeChangeProps } from '../../hooks';\n\nexport type ColorModeWrapper = React.FC<ColorModeChangeProps & { children: React.ReactNode }>;\n\nexport const ColorModeChangeHandler: ColorModeWrapper = ({ children, getAppEvents, useTheme2 }) => {\n useColorModeChange({ getAppEvents, useTheme2 });\n\n return children;\n};\n","import { ColorModeWrapper, ColorModeChangeHandler } from '../ColorModeChangeHandler';\nimport { ColorModeProvider } from '../ColorModeProvider';\n\nexport const ColorMode: ColorModeWrapper = ({ children, getAppEvents, useTheme2 }) => {\n return (\n <ColorModeProvider>\n <ColorModeChangeHandler getAppEvents={getAppEvents} useTheme2={useTheme2}>\n {children}\n </ColorModeChangeHandler>\n </ColorModeProvider>\n );\n};\n","/**\n * Number formatting options\n */\nexport interface FormatNumberOptions {\n /** Decimal places (default: 2) */\n decimals?: number;\n /** Threshold for compact formatting (default: 1000) */\n compactThreshold?: number;\n /** Never use compact formatting (for precise displays) */\n precise?: boolean;\n}\n\n/**\n * Format numbers with optional compact notation (k, m, b)\n * Components handle their own prefixes/suffixes ($ or %)\n *\n * @param value - The number to format (or 'loading' state)\n * @param options - Formatting options\n * @returns Formatted number string (no prefixes/suffixes)\n *\n * @example\n * formatNumber(1234) // \"1.2k\"\n * formatNumber(1234, { precise: true }) // \"1,234.00\"\n * formatNumber(1234, { decimals: 0 }) // \"1k\"\n * formatNumber(999) // \"999.00\"\n */\nexport const formatNumber = (\n value: number | string | 'loading',\n options: FormatNumberOptions = {},\n): string => {\n const { decimals = 2, compactThreshold = 1000, precise = false } = options;\n\n if (value === 'loading') {\n return '';\n }\n\n const num = typeof value === 'string' ? parseFloat(value) : value;\n if (isNaN(num)) {\n return 'N/A';\n }\n\n const abs = Math.abs(num);\n\n // Use compact notation if above threshold and not precise\n if (!precise && abs >= compactThreshold) {\n const sign = num < 0 ? '-' : '';\n const absNum = Math.abs(num);\n // Always use 1 decimal place for compact notation for consistency\n if (absNum >= 1000000000) {\n return `${sign}${(absNum / 1000000000).toFixed(1)}b`;\n } else if (absNum >= 1000000) {\n return `${sign}${(absNum / 1000000).toFixed(1)}m`;\n } else if (absNum >= 1000) {\n return `${sign}${(absNum / 1000).toFixed(1)}k`;\n }\n }\n\n // Standard formatting with specified decimal places\n return num.toLocaleString('en-US', {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n};\n","/**\n * Shared utility functions for handling comparison calculations across components\n */\n\nimport { formatNumber } from './formatters';\n\nexport interface ComparisonResult {\n hasComparison: boolean;\n direction: 'up' | 'down' | 'neutral';\n percentageChange: number;\n percentageLabel: string;\n}\n\n/**\n * Calculate comparison metrics between a current value and a baseline value\n * @param current - The current value to compare\n * @param baseline - The baseline value to compare against (optional)\n * @returns ComparisonResult object with calculated metrics\n */\nexport const calculateComparison = (\n current: number | undefined | null,\n baseline: number | undefined | null,\n): ComparisonResult => {\n // If either value is missing, null, undefined, or baseline is 0, return neutral state\n if (\n current === undefined ||\n current === null ||\n baseline === undefined ||\n baseline === null ||\n baseline === 0\n ) {\n return {\n hasComparison: false,\n direction: 'neutral',\n percentageChange: 0,\n percentageLabel: '',\n };\n }\n\n // If values are equal, return neutral state\n if (current === baseline) {\n return {\n hasComparison: true,\n direction: 'neutral',\n percentageChange: 0,\n percentageLabel: '0%',\n };\n }\n\n // Calculate percentage change\n const percentageChange = Math.abs(((current - baseline) / baseline) * 100);\n const direction = current > baseline ? 'up' : 'down';\n\n return {\n hasComparison: true,\n direction,\n percentageChange,\n percentageLabel: `${formatNumber(percentageChange, {\n compactThreshold: 10000,\n decimals: 2,\n })}%`,\n };\n};\n","import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport type { FloatingPortalProps } from '@floating-ui/react';\n\nexport type PortalRoot = FloatingPortalProps['root'];\n\nexport interface PortalContextType {\n root: PortalRoot;\n setRoot: (root: PortalRoot) => void;\n}\n\nexport interface PortalProviderProps {\n children: ReactNode;\n defaultRoot?: PortalRoot;\n}\n\nexport interface UsePortalOptions {\n /** If true, returns document.body instead of throwing when outside provider */\n allowOutsideProvider?: boolean;\n}\n\nconst PortalContext = createContext<PortalContextType | undefined>(undefined);\n\n/**\n * Provides a shared context for a portal root, which can be a selector string,\n * an HTMLElement, or null.\n *\n * Wrap your application (or a subtree) in this provider to enable\n * Popover, Tooltip, and other floating components to render correctly.\n *\n * @example\n * ```tsx\n * <PortalProvider defaultRoot={document.getElementById('grafana-portal-container')}>\n * <App />\n * </PortalProvider>\n * ```\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = ({ children, defaultRoot = null }) => {\n const [root, setRoot] = useState<PortalRoot>(defaultRoot ?? document.body);\n\n return <PortalContext.Provider value={{ root, setRoot }}>{children}</PortalContext.Provider>;\n};\n\n/**\n * Use this hook to access the portal root context.\n */\nexport const usePortal = ({ allowOutsideProvider = false }: UsePortalOptions = {}) => {\n const context = useContext(PortalContext);\n\n if (context === undefined) {\n if (allowOutsideProvider) {\n return { root: document.body, setRoot: () => {} };\n }\n throw new Error('usePortal must be used within a PortalProvider');\n }\n\n return context;\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = () => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n const backgroundColor = legacy.colors.background.secondary;\n\n return {\n arrow: css({\n fill: backgroundColor,\n }),\n shadow: css({\n filter: `drop-shadow(${legacy.boxShadows.z2})`,\n }),\n container: css({\n backgroundColor,\n borderRadius: `calc(${legacy.borderRadius.md} + ${spacing.xs})`,\n padding: spacing.xs,\n color: legacy.colors.text.primary,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n }),\n };\n};\n","import {\n forwardRef,\n cloneElement,\n useCallback,\n useId,\n useRef,\n useState,\n useLayoutEffect,\n JSX,\n} from 'react';\nimport {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n offset,\n Placement,\n safePolygon,\n shift,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useRole,\n useInteractions,\n useTransitionStyles,\n FloatingPortal,\n FloatingPortalProps,\n} from '@floating-ui/react';\nimport { usePortal } from '../PortalProvider';\nimport { getStyles } from './Popover.styles';\n\nexport interface PopoverProps {\n /**\n * Content used to trigger the Popover being displayed\n */\n trigger: JSX.Element;\n\n /**\n * Content to render within the Popover\n */\n children: JSX.Element;\n /**\n * Should the popover be open? Implicitly means the popover visibility is\n * controlled; if omitted, the popover target will control visibility\n */\n isOpen?: boolean;\n\n /**\n * Set to true if you want the tooltip to stay long enough so the user can\n * move mouse over content to select text or click a link\n */\n isInteractive?: boolean;\n\n /**\n * Placement of the Popover relative to the trigger content\n */\n placement?: Placement;\n\n /**\n * Transition duration for hide/show effects, in milliseconds\n */\n transitionDuration?: number;\n\n /**\n * Additional delay before hiding the popover after mouseout, in milliseconds\n */\n hideDelay?: number;\n\n /**\n * Virtual element to anchor the popover to instead of the trigger\n */\n virtualElement?: React.RefObject<Element>;\n\n /**\n * DOM element or ID to render the portal into, falls back to document.body\n */\n portalContainer?: FloatingPortalProps['root'];\n}\n\nconst POPOVER_OFFSET = 8;\n\nconst getMiddleware = ({\n placement,\n arrowRef,\n}: {\n placement?: Placement;\n arrowRef: React.RefObject<null>;\n}) => {\n const BOUNDARY_ELEMENT_ID = 'floating-boundary';\n const _flip = flip({\n // Ensure we flip to the perpendicular axis if it doesn't fit\n // on narrow viewports.\n crossAxis: 'alignment',\n fallbackAxisSideDirection: 'end',\n boundary: document.getElementById(BOUNDARY_ELEMENT_ID) ?? undefined,\n });\n\n const middleware = placement?.includes('-') ? [_flip, shift()] : [shift(), _flip];\n\n // the order of middleware is important!\n // `arrow` should almost always be at the end\n // see https://floating-ui.com/docs/arrow#order\n return [\n offset(POPOVER_OFFSET),\n ...middleware,\n arrow({\n element: arrowRef,\n }),\n ];\n};\n\nexport const Popover = forwardRef<HTMLElement, PopoverProps>(\n (\n {\n trigger,\n children,\n isOpen: isOpenControlled,\n isInteractive = false,\n placement = 'bottom',\n transitionDuration = 200,\n hideDelay = 500,\n virtualElement,\n portalContainer,\n },\n forwardedRef,\n ) => {\n const arrowRef = useRef(null);\n const closeTimer = useRef<number | undefined>(undefined);\n const popoverId = useId();\n const [isOpenState, setOpen] = useState(isOpenControlled);\n const [isDelayedOpen, setDelayedOpen] = useState(isOpenControlled);\n const isOpen = isOpenControlled ?? isOpenState;\n const middleware = getMiddleware({ placement, arrowRef });\n const styles = getStyles();\n const { root } = usePortal();\n\n const portalRoot = (() => {\n switch (true) {\n case portalContainer instanceof HTMLElement:\n return portalContainer;\n case typeof portalContainer === 'string':\n return document.getElementById(portalContainer);\n default:\n return root;\n }\n })();\n\n const { context, refs, floatingStyles } = useFloating({\n open: isOpen,\n placement,\n onOpenChange: (open) => {\n setOpen(open);\n clearTimeout(closeTimer.current);\n\n if (!open) {\n closeTimer.current = window.setTimeout(() => {\n setDelayedOpen(open);\n }, transitionDuration + hideDelay);\n } else {\n setDelayedOpen(open);\n }\n },\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n useLayoutEffect(() => {\n if (virtualElement && virtualElement.current !== null) {\n const domRect = virtualElement.current.getBoundingClientRect();\n\n refs.setPositionReference({\n getBoundingClientRect: () => {\n if (virtualElement.current !== null)\n return virtualElement.current.getBoundingClientRect();\n return domRect;\n },\n contextElement: virtualElement.current,\n });\n }\n }, [refs, virtualElement]);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useDismiss(context),\n useHover(context, {\n handleClose: isInteractive ? safePolygon() : undefined,\n move: false,\n delay: {\n open: 0,\n close: hideDelay,\n },\n }),\n useFocus(context),\n useRole(context),\n ]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: transitionDuration,\n initial: ({ side }) => ({\n opacity: 0,\n transform:\n side === 'top' || side === 'bottom'\n ? `translateY(${POPOVER_OFFSET}px)`\n : `translateX(${POPOVER_OFFSET}px)`,\n }),\n open: ({ side }) => ({\n opacity: 1,\n transform: side === 'top' || side === 'bottom' ? `translateY(0)` : `translateX(0)`,\n }),\n close: ({ side }) => ({\n opacity: 0,\n transform:\n side === 'top' || side === 'bottom'\n ? `translateY(${POPOVER_OFFSET}px)`\n : `translateX(${POPOVER_OFFSET}px)`,\n }),\n });\n\n const handleRef = useCallback(\n (ref: HTMLElement | null) => {\n refs.setReference(ref);\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(ref);\n } else if (forwardedRef) {\n forwardedRef.current = ref;\n }\n },\n [forwardedRef, refs],\n );\n\n return (\n <>\n {/* element to trigger displaying the popover */}\n {cloneElement(trigger, {\n ref: handleRef,\n tabIndex: 0,\n 'aria-describedby': isOpen ? popoverId : undefined,\n ...getReferenceProps(),\n })}\n {/* content to render inside the popover when open */}\n {(isDelayedOpen || isOpen) && (\n <FloatingPortal root={portalRoot}>\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <div style={transitionStyles} className={styles.shadow}>\n <FloatingArrow className={styles.arrow} ref={arrowRef} context={context} />\n <div id={popoverId} role=\"tooltip\" className={styles.container}>\n {children}\n </div>\n </div>\n </div>\n </FloatingPortal>\n )}\n </>\n );\n },\n);\n\nPopover.displayName = 'Popover';\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = () => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n const background = legacy.colors.background.primary;\n\n return {\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n gap: spacing.xs,\n }),\n heading: css({\n padding: `${spacing.sm} ${spacing.md}`,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.bold,\n color: legacy.colors.text.primary,\n background,\n borderRadius: legacy.borderRadius.md,\n }),\n content: css({\n display: 'flex',\n gap: spacing.xs,\n }),\n section: css({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'flex-end',\n gap: spacing.xs,\n background,\n borderRadius: legacy.borderRadius.md,\n padding: `${spacing.sm} ${spacing.md}`,\n }),\n sectionTitle: css({\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.medium,\n color: legacy.colors.text.primary,\n whiteSpace: 'nowrap',\n }),\n value: css({\n display: 'flex',\n alignItems: 'center',\n gap: spacing.xs,\n fontFamily: typography.fontFamily.monospace,\n fontSize: typography.fontSize.monospace.sm,\n color: legacy.colors.text.secondary,\n }),\n icon: css({\n flexShrink: 0,\n }),\n };\n};\n","import { Icon, IconName } from '@grafana/ui';\nimport { Popover, PopoverProps } from '../Popover';\nimport { getStyles } from './ComparisonTooltip.styles';\n\nexport interface ComparisonTooltipProps extends Omit<PopoverProps, 'children'> {\n current?: string;\n previous?: string;\n previousLabel?: string;\n currentLabel?: string;\n title?: string;\n currentIcon?: IconName;\n previousIcon?: IconName;\n hideDelay?: number;\n}\n\nexport const ComparisonTooltip = ({\n trigger,\n placement = 'top',\n current,\n previous,\n previousLabel,\n currentLabel = 'Current',\n title,\n currentIcon = 'eye',\n previousIcon = 'clock-nine',\n hideDelay,\n}: ComparisonTooltipProps) => {\n const styles = getStyles();\n\n return (\n <Popover trigger={trigger} placement={placement} hideDelay={hideDelay}>\n <div className={styles.wrapper}>\n {title && <div className={styles.heading}>{title}</div>}\n <div className={styles.content}>\n <div className={styles.section}>\n <div className={styles.sectionTitle}>{currentLabel}</div>\n <div className={styles.value}>\n <Icon name={currentIcon} size=\"sm\" className={styles.icon} />\n <span>{current || 'N/A'}</span>\n </div>\n </div>\n <div className={styles.section}>\n <div className={styles.sectionTitle}>{previousLabel}</div>\n <div className={styles.value}>\n <Icon name={previousIcon} size=\"sm\" className={styles.icon} />\n <span>{previous || 'N/A'}</span>\n </div>\n </div>\n </div>\n </div>\n </Popover>\n );\n};\n","import { css } from '@emotion/css';\nimport { CSSVariables, getDesignTokens } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'comparison-badge-icon-background-color': legacy.colors.background.secondary,\n 'comparison-badge-icon-highlight-background-color': legacy.palette.whiteBaseOpacity10,\n },\n light: {\n 'comparison-badge-icon-background-color': legacy.colors.background.canvas,\n 'comparison-badge-icon-highlight-background-color': legacy.palette.blackBaseOpacity8,\n },\n };\n};\n\nconst BADGE_HEIGHT = 28;\nconst TREND_ICON_SIZE = 20;\n\nexport const getComparisonBadgeStyles = ({\n highlight,\n direction,\n tooltip,\n}: {\n highlight: boolean;\n direction: string;\n tooltip?: boolean;\n}) => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n const labelColor = (() => {\n switch (true) {\n case highlight:\n case direction === 'up':\n return legacy.colors.text.maxContrast;\n default:\n return legacy.colors.primary.text;\n }\n })();\n\n return {\n container: css({\n boxSizing: 'border-box',\n background: 'transparent',\n borderRadius: legacy.borderRadius.pill,\n border: `1px solid\n ${highlight ? legacy.colors.border.strong : legacy.colors.border.weak}`,\n padding: `${spacing.xxs} ${spacing.sm} ${spacing.xxs} ${spacing.xxs}`,\n textAlign: 'left',\n display: 'inline-flex',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n height: `${BADGE_HEIGHT}px`,\n position: 'relative',\n transition: 'background 0.2s ease-in-out',\n ...(tooltip\n ? {\n cursor: 'pointer',\n '&:hover': {\n background: legacy.colors.background.secondary,\n },\n }\n : {}),\n }),\n clockIconWrapper: css({\n background: highlight\n ? 'var(--comparison-badge-icon-highlight-background-color)'\n : 'var(--comparison-badge-icon-background-color)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '22px',\n height: '22px',\n borderRadius: legacy.borderRadius.pill,\n color: legacy.colors.text.primary,\n }),\n trendLabelContainer: css({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: spacing.xxs,\n paddingLeft: spacing.xxs,\n fontWeight: typography.fontWeight.medium,\n whiteSpace: 'nowrap',\n }),\n trendLabel: css({\n display: 'flex',\n alignItems: 'center',\n color: labelColor,\n lineHeight: `${BADGE_HEIGHT}px`,\n fontWeight: typography.fontWeight.medium,\n fontVariantNumeric: 'tabular-nums',\n }),\n timeframeLabel: css({\n color: highlight ? legacy.colors.text.maxContrast : legacy.colors.text.primary,\n paddingLeft: spacing.xxs,\n lineHeight: `${BADGE_HEIGHT}px`,\n fontWeight: typography.fontWeight.normal,\n }),\n trendIconWrapper: css({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n }),\n trendIcon: css({\n width: `${TREND_ICON_SIZE}px`,\n height: `${TREND_ICON_SIZE}px`,\n }),\n dash: css({\n color: legacy.colors.text.secondary,\n }),\n };\n};\n","import { cx } from '@emotion/css';\nimport { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { Icon, IconName } from '@grafana/ui';\nimport { calculateComparison } from '../../utils/comparison';\nimport { formatNumber } from '../../utils/formatters';\nimport { ComparisonTooltipProps, ComparisonTooltip } from '../ComparisonTooltip';\nimport { cssVariables, getComparisonBadgeStyles } from './ComparisonBadge.styles';\n\nconst formatCurrency = (value: number | undefined | null): string => {\n return !!value ? `$${formatNumber(value, { precise: true })}` : 'N/A';\n};\n\nexport interface ComparisonBadgeProps\n extends Pick<ComparisonTooltipProps, 'currentLabel' | 'previousLabel' | 'placement'> {\n current?: number | null;\n previous?: number | null;\n highlight?: boolean;\n timeframeLabel?: string;\n tooltip?: boolean;\n hideDelay?: number;\n}\n\nconst DIRECTION_ICON: Record<'up' | 'down' | 'neutral', IconName> = {\n up: 'arrow-up',\n down: 'arrow-down',\n neutral: 'minus',\n};\n\nexport const ComparisonBadge = ({\n current,\n previous,\n currentLabel,\n previousLabel,\n placement,\n highlight = false,\n timeframeLabel,\n tooltip = true,\n hideDelay,\n}: ComparisonBadgeProps) => {\n const { direction, hasComparison, percentageLabel } = calculateComparison(current, previous);\n const styles = getComparisonBadgeStyles({ highlight, direction, tooltip });\n\n const directionIconStyle = (() => {\n switch (true) {\n case direction == 'neutral':\n return styles.dash;\n default:\n return undefined;\n }\n })();\n\n const badgeContent = (\n <div className={styles.container}>\n <div className={styles.clockIconWrapper}>\n <Icon name=\"clock-nine\" />\n </div>\n <div className={styles.trendLabelContainer}>\n <span className={styles.trendLabel}>\n <span className={styles.trendIconWrapper}>\n <Icon\n name={DIRECTION_ICON[direction]}\n className={cx(styles.trendIcon, directionIconStyle)}\n />\n </span>\n {hasComparison && percentageLabel && <>{percentageLabel}</>}\n </span>\n {timeframeLabel && (\n <span className={styles.timeframeLabel}>vs {timeframeLabel.toLowerCase()}</span>\n )}\n </div>\n </div>\n );\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n {tooltip ? (\n <ComparisonTooltip\n trigger={badgeContent}\n current={formatCurrency(current)}\n previous={formatCurrency(previous)}\n currentLabel={currentLabel}\n previousLabel={previousLabel}\n placement={placement}\n hideDelay={hideDelay}\n />\n ) : (\n badgeContent\n )}\n </>\n );\n};\n","import { css, keyframes } from '@emotion/css';\nimport { CSSVariables, getDesignTokens } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'skeleton-gradient-background-color': legacy.palette.whiteBaseOpacity12,\n },\n light: {\n 'skeleton-gradient-background-color': legacy.palette.blackBaseOpacity12,\n },\n };\n};\n\nconst shimmer = keyframes({\n '0%': {\n transform: 'translateX(-100%);',\n },\n '100%': {\n transform: 'translateX(100%);',\n },\n});\n\nexport const getStyles = (animationDuration: number) => {\n return css({\n display: 'flex',\n width: '100%',\n height: '100%',\n background: 'transparent',\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '5px',\n '&::before': {\n content: \"''\",\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n animation: `${shimmer} ${animationDuration}s ease-in-out infinite`,\n transform: 'translateX(-100%)',\n background:\n 'linear-gradient(90deg, transparent, var(--skeleton-gradient-background-color), transparent)',\n },\n });\n};\n","import { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { cssVariables, getStyles } from './GenericSkeleton.styles';\n\nexport interface GenericSkeletonProps {\n /**\n * Duration of animation in seconds\n */\n animationDuration?: number;\n}\n\nexport const GenericSkeleton = ({ animationDuration = 2 }: GenericSkeletonProps) => {\n const styles = getStyles(animationDuration);\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n <div className={styles} />\n </>\n );\n};\n","/**\n * Apply a filter to rotate the hue by 10 degrees per index\n */\nexport const filterHueRotate = (index: number) => ({\n filter: `hue-rotate(${index * 10}deg)`,\n});\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\nimport { StackedChartSegmentProps } from './types';\nimport { filterHueRotate } from '../StackedChart/shared.styles';\n\nexport const diagonalStripedBackground = ({\n stripeColor,\n stripeWidth = 2,\n gapWidth = 6,\n}: {\n stripeColor: string;\n stripeWidth?: number;\n gapWidth?: number;\n}) => {\n return `repeating-linear-gradient(\n -45deg,\n ${stripeColor},\n ${stripeColor} ${stripeWidth}px,\n transparent ${stripeWidth}px,\n transparent ${gapWidth}px)`;\n};\n\nexport const getSegmentStyles = () =>\n css({\n display: 'flex',\n height: '100%',\n });\n\nexport const getStyles = <T extends string>({\n index,\n state = 'default',\n}: Pick<StackedChartSegmentProps<T>, 'index' | 'state'>) => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n const hasColor = ['color', 'active'].includes(state);\n\n const backgroundImage = diagonalStripedBackground({\n stripeColor:\n state === 'dimmed' ? legacy.colors.secondary.shade : legacy.colors.secondary.transparent,\n });\n\n return css({\n cursor: hasColor ? 'pointer' : undefined,\n borderRadius: legacy.borderRadius.sm,\n transitionDuration: '0.2s',\n transitionTimingFunction: 'ease-in-out',\n transitionProperty: 'background, filter, box-shadow',\n background: hasColor ? legacy.colors.primary.main : legacy.colors.secondary.transparent,\n backgroundImage,\n opacity: state === 'dimmed' ? 0.4 : undefined,\n boxShadow: state === 'active' ? legacy.boxShadows.z1 : 'none',\n ...(hasColor ? filterHueRotate(index) : {}),\n });\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport { StackedChartSegmentProps } from './types';\nimport { getStyles, getSegmentStyles } from './StackedChartSegment.styles';\n\nconst _StackedChartSegment = <T extends string>(\n {\n categoryId,\n state = 'default',\n index,\n value,\n total = 100,\n minValue = 4,\n onMouseOver,\n onMouseOut,\n }: StackedChartSegmentProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const width = `${Math.max((value / total) * 100, minValue)}%`;\n\n return (\n <div\n ref={ref}\n className={clsx(getStyles({ state, index }), getSegmentStyles())}\n onMouseOver={onMouseOver && onMouseOver({ ref, categoryId })}\n onMouseOut={onMouseOut && onMouseOut({ ref, categoryId })}\n style={{ width }}\n />\n );\n};\n\n_StackedChartSegment.displayName = 'StackedChartSegment';\n\nexport const StackedChartSegment = React.forwardRef(_StackedChartSegment);\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = ({ height }: { height: number }) => {\n const {\n primitives: { spacing },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n container: css({\n display: 'flex',\n width: '100%',\n height,\n gap: spacing.xxs,\n }),\n };\n};\n\nexport const diagonalStripedBackground = ({\n stripeColor,\n stripeWidth = 2,\n gapWidth = 6,\n}: {\n stripeColor: string;\n stripeWidth?: number;\n gapWidth?: number;\n}) => {\n return `repeating-linear-gradient(\n -45deg,\n ${stripeColor},\n ${stripeColor} ${stripeWidth}px,\n transparent ${stripeWidth}px,\n transparent ${gapWidth}px)`;\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\nimport { filterHueRotate } from '../StackedChart/shared.styles';\n\nexport const getStyles = (index: number) => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n gap: spacing.xs,\n }),\n content: css({\n display: 'flex',\n gap: spacing.xs,\n }),\n section: css({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'flex-end',\n gap: spacing.xs,\n background: legacy.colors.background.primary,\n borderRadius: legacy.borderRadius.md,\n padding: `${spacing.sm} ${spacing.md}`,\n }),\n title: css({\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.medium,\n // TODO: this should come from a token!\n lineHeight: '16px',\n color: legacy.colors.text.primary,\n whiteSpace: 'nowrap',\n }),\n value: css({\n // TODO: this should come from a token!\n lineHeight: '16px',\n color: legacy.colors.text.secondary,\n }),\n color: css({\n color: legacy.colors.primary.main,\n fill: 'currentColor',\n ...filterHueRotate(index),\n }),\n };\n};\n","import { StackedChartSegmentProps } from '../StackedChartSegment/types';\nimport { Popover, PopoverProps } from '../Popover';\nimport { getStyles } from './StackedChartSegmentTooltip.styles';\n\nexport type StackedChartTooltipContentFormatter = (\n args: {\n colorClassName: string;\n } & Required<Pick<StackedChartSegmentProps<string>, 'value' | 'total' | 'index'>>,\n) => React.ReactElement;\n\nexport interface StackedChartSegmentTooltipProps<T extends string>\n extends Pick<StackedChartSegmentProps<T>, 'title' | 'value' | 'total' | 'index'>,\n Omit<PopoverProps, 'children'> {\n formatContent?: StackedChartTooltipContentFormatter;\n}\n\n/**\n * The default content formatter assumes a percentage value, but you can create\n * your own formatter using the provided arguments of total and index. The\n * colorClassName allows you to set the colour of some text or an icon to the\n * same colour as the equivalent chart segment.\n */\nconst defaultContentFormatter: StackedChartTooltipContentFormatter = ({\n value,\n colorClassName,\n}) => {\n const valueString = value < 0.1 ? '< 0.1' : `${value.toFixed(1)}`;\n\n return (\n <>\n <span className={colorClassName}>{valueString}%</span> of total usage\n </>\n );\n};\n\nexport const StackedChartSegmentTooltip = <T extends string>({\n trigger,\n placement = 'top',\n hideDelay,\n title,\n value,\n total = 100,\n index,\n formatContent = defaultContentFormatter,\n virtualElement,\n}: StackedChartSegmentTooltipProps<T>) => {\n const styles = getStyles(index);\n\n return (\n <Popover\n trigger={trigger}\n placement={placement}\n hideDelay={hideDelay}\n virtualElement={virtualElement}\n >\n <div className={styles.wrapper}>\n <div className={styles.content}>\n <div className={styles.section}>\n <div className={styles.title}>{title}</div>\n <div className={styles.value}>\n {formatContent({ value, total, index, colorClassName: styles.color })}\n </div>\n </div>\n </div>\n </div>\n </Popover>\n );\n};\n","import { css } from '@emotion/css';\n\nexport const getStyles = (height: number) => {\n return css({\n width: '100%',\n height: `${height}px`,\n borderRadius: '4px',\n overflow: 'hidden',\n });\n};\n","export const STACKED_CHART_DEFAULT_HEIGHT = 24;\n","import { getStyles } from './StackedChartSkeleton.styles';\nimport { GenericSkeleton } from '../GenericSkeleton';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common';\n\nexport interface StackedChartSkeletonProps {\n /**\n * Height to render the stacked chart skeleton, in pixels\n */\n height?: number;\n}\n\nexport const StackedChartSkeleton = ({\n height = STACKED_CHART_DEFAULT_HEIGHT,\n}: StackedChartSkeletonProps) => {\n const styles = getStyles(height);\n\n return (\n <div className={styles}>\n <GenericSkeleton />\n </div>\n );\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens, CSSVariables } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'stacked-chart-no-data-background-color': legacy.palette.blackBaseOpacity15,\n },\n light: {\n 'stacked-chart-no-data-background-color': legacy.palette.blackBaseOpacity4,\n },\n };\n};\n\nexport const getStyles = (height: number) => {\n const {\n legacy,\n primitives: { typography, spacing },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n container: css({\n display: 'flex',\n flex: 1,\n width: '100%',\n height: `${height}px`,\n alignItems: 'center',\n justifyContent: 'center',\n gap: spacing.sm,\n borderRadius: legacy.borderRadius.md,\n color: legacy.colors.text.secondary,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n paddingTop: spacing.xxs,\n background: 'var(--stacked-chart-no-data-background-color)',\n }),\n label: css({\n fontWeight: typography.fontWeight.medium,\n textTransform: 'lowercase',\n }),\n };\n};\n","import { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { Icon } from '@grafana/ui';\nimport { cssVariables, getStyles } from './StackedChartNoData.styles';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common';\n\nexport type StackedChartNoDataMessageFormatter = (args: {\n period: string;\n className: string;\n}) => React.ReactElement;\n\nexport interface StackedChartNoDataProps {\n /**\n * Height to render the stacked chart skeleton, in pixels\n */\n height?: number;\n\n /**\n * Period for which this chart has no data, as a preformatted string\n */\n period?: string;\n\n /**\n * Optional formatter for content message\n */\n formatMessage?: StackedChartNoDataMessageFormatter;\n}\n\n/**\n * The default content formatter assumes a percentage value, but you can create\n * your own formatter using the provided arguments of total and index. The\n * colorClassName allows you to set the colour of some text or an icon to the\n * same colour as the equivalent chart segment.\n */\nconst defaultContentFormatter: StackedChartNoDataMessageFormatter = ({ period, className }) => (\n <>\n No data for <span className={className}>{period}</span>\n </>\n);\n\nexport const StackedChartNoData = ({\n height = STACKED_CHART_DEFAULT_HEIGHT,\n period = 'current',\n formatMessage = defaultContentFormatter,\n}: StackedChartNoDataProps) => {\n const styles = getStyles(height);\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n <div className={styles.container}>\n <Icon name=\"exclamation-triangle\" size=\"sm\" />\n <span>{formatMessage({ period, className: styles.label })}</span>\n </div>\n </>\n );\n};\n","import { useRef, useState } from 'react';\nimport { StackedChartSegment } from '../StackedChartSegment';\nimport { getStyles } from './StackedChart.styles';\nimport { StackedChartSegmentState, SegmentMouseEventHandler } from '../StackedChartSegment/types';\nimport { StackedChartSegmentTooltip } from '../StackedChartSegmentTooltip';\nimport { StackedChartSkeleton } from '../StackedChartSkeleton';\nimport { StackedChartNoData, StackedChartNoDataProps } from '../StackedChartNoData';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from './common';\n\nexport interface StackedChartCategory {\n title: string;\n value: number;\n}\n\nconst DUMMY_CATEGORY: StackedChartCategory = {\n title: 'Category',\n value: 0.01,\n};\n\nexport type StackedChartCategories<T extends string> = Partial<Record<T, StackedChartCategory>>;\n\nexport type StackedChartSortOrder = 'largest-first' | 'smallest-first' | 'natural';\n\n/**\n * Callback function invoked when a mouse event occurs on a chart segment.\n *\n * This is a simplified callback (not a React event handler) that receives\n * segment metadata. It's called after the internal event handling is complete.\n *\n * @param args - Object containing segment metadata\n * @param args.categoryId - The unique identifier of the segment that triggered the event\n * @param args.ref - React ref to the segment's DOM element, useful for positioning tooltips or popovers\n *\n * @example\n * ```tsx\n * <StackedChart\n * categories={categories}\n * onSegmentMouseOver={({ categoryId, ref }) => {\n * console.log(`Hovered segment: ${categoryId}`);\n * // ref.current gives you the DOM element if needed\n * }}\n * onSegmentMouseOut={({ categoryId }) => {\n * console.log(`Left segment: ${categoryId}`);\n * }}\n * />\n * ```\n */\ntype MouseEventHandler = ({\n categoryId,\n ref,\n}: {\n categoryId: string;\n ref: React.ForwardedRef<HTMLDivElement>;\n}) => void;\n\nexport interface StackedChartProps<T extends string> {\n /**\n * How should category segments be sorted?\n */\n sortOrder?: StackedChartSortOrder;\n\n /**\n * Height to render the stacked chart, in pixels\n */\n height?: number;\n\n /**\n * initial category ID to highlight; if omitted then all segments will render\n * in colour and highlight based on mouseover events.\n */\n highlightedCategoryId?: T;\n\n /**\n * Should the whole StackedChart be dimmed, i.e. with a highlighted category\n * not in color, all other categories faded out?\n */\n isDimmed?: boolean;\n\n /**\n * Callback invoked when the mouse enters a chart segment.\n *\n * Receives the segment's `categoryId` and a `ref` to its DOM element.\n * Use this to implement custom hover behavior, analytics tracking,\n * or coordination with external UI elements.\n *\n * @example\n * ```tsx\n * onSegmentMouseOver={({ categoryId, ref }) => {\n * setActiveCategory(categoryId);\n * // Optional: use ref.current for DOM measurements\n * }}\n * ```\n */\n onSegmentMouseOver?: MouseEventHandler;\n\n /**\n * Callback invoked when the mouse leaves a chart segment.\n *\n * Receives the segment's `categoryId` and a `ref` to its DOM element.\n * Use this to clean up hover state or hide related UI elements.\n *\n * @example\n * ```tsx\n * onSegmentMouseOut={({ categoryId }) => {\n * setActiveCategory(null);\n * }}\n * ```\n */\n onSegmentMouseOut?: MouseEventHandler;\n\n /**\n * String representing the period for which the chart is displaying data\n */\n period?: string;\n\n formatNoDataMessage?: StackedChartNoDataProps['formatMessage'];\n\n /**\n * Is the StackedChart explicitly in a loading state?\n */\n isSkeleton?: boolean;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories?: StackedChartCategories<T>;\n}\n\n/**\n * Custom hook to assign a ref per categoryId\n */\nconst useCategoryRefs = <T extends string>(\n categoryIds: T[],\n): Record<T, React.RefObject<HTMLDivElement>> => {\n const refsMap = useRef<Map<T, React.RefObject<HTMLDivElement>>>(new Map());\n\n for (const categoryId of categoryIds) {\n if (!refsMap.current.has(categoryId)) {\n refsMap.current.set(categoryId, { current: null });\n }\n }\n\n const result = {} as Record<T, React.RefObject<HTMLDivElement>>;\n for (const categoryId of categoryIds) {\n result[categoryId] = refsMap.current.get(categoryId)!;\n }\n\n return result;\n};\n\nexport const StackedChart = <T extends string>({\n categories,\n highlightedCategoryId: initialHighlightedCategoryId,\n isSkeleton = false,\n isDimmed = false,\n sortOrder = 'largest-first',\n height = STACKED_CHART_DEFAULT_HEIGHT,\n onSegmentMouseOver,\n onSegmentMouseOut,\n period = 'current',\n formatNoDataMessage,\n}: StackedChartProps<T>) => {\n const shouldRenderSkeleton = isSkeleton || !categories;\n let highlightedSegmentRef = useRef<HTMLDivElement>(null);\n const [highlightedCategoryId, setHighlightedCategoryId] = useState<string | undefined>(\n /**\n * Using a type assertion here ultimately because you can’t pass a generic\n * type argument to the type of props in React.forwardRef (it is inferred as\n * of type string).\n *\n * See: https://stackoverflow.com/questions/51884498/using-react-forwardref-with-typescript-generic-jsx-arguments\n */\n initialHighlightedCategoryId as string,\n );\n const [isHovered, setHovered] = useState<boolean>(false);\n const timer = useRef<number | undefined>(undefined);\n\n const sortedCategoryIds = (() => {\n let categoryIds: T[] = [];\n\n for (const categoryId in categories) {\n categoryIds.push(categoryId);\n }\n\n // return early since we may not even have any categories at this point\n if (shouldRenderSkeleton) return categoryIds;\n\n switch (sortOrder) {\n case 'largest-first':\n return categoryIds.sort(\n (a, b) => (categories[b]?.value ?? 0) - (categories[a]?.value ?? 0),\n );\n case 'smallest-first':\n return categoryIds.sort(\n (a, b) => (categories[a]?.value ?? 0) - (categories[b]?.value ?? 0),\n );\n default:\n return categoryIds;\n }\n })();\n\n const categoryRefs = useCategoryRefs(sortedCategoryIds);\n\n /**\n * Determine what the total value is for all category values combined\n */\n const total = shouldRenderSkeleton\n ? 0\n : Math.round(\n sortedCategoryIds.reduce((sum, categoryId) => {\n return sum + (categories[categoryId]?.value ?? 0);\n }, 0),\n );\n\n const styles = getStyles({ height });\n\n const onMouseOver: SegmentMouseEventHandler =\n ({ ref, categoryId }) =>\n () => {\n clearTimeout(timer.current);\n setHovered(true);\n\n /**\n * Only update the highlighted category ID if an initial category wasn’t\n * supplied\n */\n if (!initialHighlightedCategoryId) {\n setHighlightedCategoryId(categoryId);\n }\n\n if (onSegmentMouseOver) onSegmentMouseOver({ ref, categoryId });\n };\n\n const onMouseOut: SegmentMouseEventHandler =\n ({ ref, categoryId }) =>\n () => {\n /**\n * TODO: rather than use a timeout, maybe use the parent element being\n * moused over (event bubbling?) to validate whether the mouse has left\n * the entire chart vs an individual segment?\n */\n timer.current = window.setTimeout(() => {\n setHovered(false);\n /**\n * Only clear the highlighted category if an initial category wasn’t\n * supplied\n */\n if (!initialHighlightedCategoryId) {\n setHighlightedCategoryId(undefined);\n }\n }, 50);\n\n if (onSegmentMouseOut) onSegmentMouseOut({ ref, categoryId });\n };\n\n const highlightedCategory: (StackedChartCategory & { index: number }) | undefined =\n !shouldRenderSkeleton &&\n initialHighlightedCategoryId &&\n categories[initialHighlightedCategoryId]\n ? {\n ...categories[initialHighlightedCategoryId],\n index: sortedCategoryIds.indexOf(initialHighlightedCategoryId),\n }\n : undefined;\n\n const content = (\n <div className={styles.container}>\n {sortedCategoryIds.map((categoryId, index) => {\n /**\n * Some dummy category data is returned here for the scenario when\n * rendering a skeleton\n */\n const category =\n !shouldRenderSkeleton && categories?.[categoryId] !== undefined\n ? categories?.[categoryId]\n : DUMMY_CATEGORY;\n const ref = categoryRefs[categoryId];\n\n if (categoryId === initialHighlightedCategoryId && ref) highlightedSegmentRef = ref;\n\n const segmentState = ((): StackedChartSegmentState => {\n switch (true) {\n /**\n * If no initial highlighted category was set, and a category is\n * moused over, use the _active_ state for that category rather\n * than the color state; this adds a drop shadow to the segment.\n * Also, if an initial highlighted category _was_ set, and it\n * receives a hover event, also set it to active.\n */\n case !initialHighlightedCategoryId && highlightedCategoryId === categoryId && !isDimmed:\n case initialHighlightedCategoryId === categoryId && isHovered && !isDimmed:\n return 'active';\n\n /**\n * - no initial highlighted category ID was passed _and_ there is\n * no highlightedCategoryId (i.e. all segments in colour)\n * - the highlighted category is this category (but the chart\n * isn’t dimmed)\n * - the initial highlighted category is this category (but the\n * chart isn’t dimmed)\n */\n case !initialHighlightedCategoryId && !highlightedCategoryId && !isDimmed:\n case initialHighlightedCategoryId === categoryId && !isDimmed:\n return 'color';\n\n /**\n * Has an initial highlighted category, but is dimmed (i.e. all\n * segments excepted the highlighted category)\n */\n case Boolean(initialHighlightedCategoryId) &&\n initialHighlightedCategoryId !== categoryId &&\n isDimmed:\n case !initialHighlightedCategoryId && !highlightedCategoryId && isDimmed:\n case highlightedCategoryId !== categoryId && isDimmed:\n return 'dimmed';\n\n /**\n * In any other case, the segment should be the default grey\n */\n default:\n return 'default';\n }\n })();\n\n const segmentProps = {\n key: categoryId,\n index,\n ref,\n categoryId,\n title: category.title,\n value: category.value,\n total,\n state: segmentState,\n onMouseOver,\n onMouseOut,\n };\n\n /**\n * Only wrap the segment in a tooltip if no initially highlighted\n * category ID was supplied.\n */\n return initialHighlightedCategoryId ? (\n <StackedChartSegment {...segmentProps} />\n ) : (\n <StackedChartSegmentTooltip\n key={categoryId}\n title={category.title}\n value={category.value}\n index={index}\n hideDelay={0}\n trigger={<StackedChartSegment {...segmentProps} />}\n />\n );\n })}\n </div>\n );\n\n /**\n * If we should only render a skeleton, return early with that component\n */\n if (shouldRenderSkeleton) return <StackedChartSkeleton height={height} />;\n\n /**\n * If the initial highlighted category isn’t within the provided set of\n * categories, fall back to displaying the No Data component\n */\n if (\n initialHighlightedCategoryId &&\n sortedCategoryIds.indexOf(initialHighlightedCategoryId) === -1\n )\n return (\n <StackedChartNoData height={height} period={period} formatMessage={formatNoDataMessage} />\n );\n\n /**\n * If an initial highlight category was provided, wrap the entire chart inside\n * a tooltip using the props for the highlighted segment to drive the tooltip\n * content.\n */\n return initialHighlightedCategoryId && highlightedCategory ? (\n <StackedChartSegmentTooltip\n hideDelay={0}\n trigger={content}\n virtualElement={highlightedSegmentRef}\n {...highlightedCategory}\n />\n ) : (\n content\n );\n};\n"],"names":["createContext","useState","useEffect","jsx","useContext","ThemeChangedEvent","getStyles","getDesignTokens","css","flip","shift","offset","arrow","forwardRef","useRef","useId","useFloating","autoUpdate","useLayoutEffect","useInteractions","useDismiss","useHover","safePolygon","useFocus","useRole","useTransitionStyles","useCallback","jsxs","Fragment","cloneElement","FloatingPortal","FloatingArrow","Icon","cssVariables","cx","GlobalCSSVariables","keyframes","clsx","React","defaultContentFormatter"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAA,GAAmBA,oBAAgD,MAAS,CAAA;AAM3E,MAAM,oBAAsD,CAAC;AAAA,EAClE,QAAA;AAAA,EACA,gBAAA,GAAmB;AACrB,CAAA,KAAM;AACJ,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAIC,eAAyB,gBAAgB,CAAA;AAE3E,EA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,OAAA,CAAQ,4BAA4B,CAAA,KAAM,EAAA;AAE5D,IAAA,uBACEA,cAAA,CAAC,kBAAA,EAAA,EAAmB,MAAA,EAAgB,MAAA,EAAgB,eAAe,mBAAA,EAAqB,CAAA;AAQ5F,EAAA,OAAO,gCAAgC,mBAAA,mBACrCA,cAAA;AAAA,IAAC,0BAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,CAAA;AAAA,MACX,OAAA,EAAS,OAAA;AAAA,MACT,cAAA,EAAgB,qBAAA;AAAA,MACf,GAAG;AAAA;AAAA,GACN,GAEA,OAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/components/ColorModeProvider/ColorModeProvider.tsx","../../src/hooks/useColorModeChange.ts","../../src/components/ColorModeChangeHandler/ColorModeChangeHandler.tsx","../../src/components/ColorMode/ColorMode.tsx","../../src/utils/formatters.ts","../../src/utils/comparison.ts","../../src/components/PortalProvider/PortalProvider.tsx","../../src/components/Popover/Popover.styles.ts","../../src/components/Popover/Popover.tsx","../../src/components/ComparisonTooltip/ComparisonTooltip.styles.ts","../../src/components/ComparisonTooltip/ComparisonTooltip.tsx","../../src/components/ComparisonBadge/ComparisonBadge.styles.ts","../../src/components/ComparisonBadge/ComparisonBadge.tsx","../../src/components/GenericSkeleton/GenericSkeleton.styles.ts","../../src/components/GenericSkeleton/GenericSkeleton.tsx","../../src/components/StackedChart/shared.styles.ts","../../src/components/StackedChartSegment/StackedChartSegment.styles.ts","../../src/components/StackedChartSegment/StackedChartSegment.tsx","../../src/components/StackedChart/StackedChart.styles.ts","../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.styles.ts","../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.tsx","../../src/components/StackedChartSkeleton/StackedChartSkeleton.styles.ts","../../src/components/StackedChart/common.ts","../../src/components/StackedChartSkeleton/StackedChartSkeleton.tsx","../../src/components/StackedChartNoData/StackedChartNoData.styles.ts","../../src/components/StackedChartNoData/StackedChartNoData.tsx","../../src/components/StackedChart/StackedChart.tsx"],"sourcesContent":["import React, { createContext, useContext, useEffect, useState, ReactNode } from 'react';\nimport { ThemeColorMode } from '@grafana/design-tokens';\n\nimport '@grafana/design-tokens/dist/css/legacy/default/primitives.css';\nimport '@grafana/design-tokens/dist/css/legacy/default/colors.light.css';\nimport '@grafana/design-tokens/dist/css/legacy/default/colors.dark.css';\n\nexport interface ColorModeContextType {\n colorMode: ThemeColorMode;\n setColorMode: (colorMode: ThemeColorMode) => void;\n}\n\nexport interface ColorModeProviderProps {\n children: ReactNode;\n defaultColorMode?: ThemeColorMode;\n}\n\nconst ColorModeContext = createContext<ColorModeContextType | undefined>(undefined);\n\n/**\n * Provides a shared context for the currently-active theme color mode, and sets\n * the data-color-mode attribute on the document element whenever it changes.\n */\nexport const ColorModeProvider: React.FC<ColorModeProviderProps> = ({\n children,\n defaultColorMode = 'light',\n}) => {\n const [colorMode, setColorMode] = useState<ThemeColorMode>(defaultColorMode);\n\n useEffect(() => {\n document.documentElement.setAttribute('data-color-mode', colorMode);\n }, [colorMode]);\n\n return (\n <ColorModeContext.Provider value={{ colorMode, setColorMode }}>\n {children}\n </ColorModeContext.Provider>\n );\n};\n\n/**\n * Use this to query the active color mode, or to set it, e.g. with an effect\n * hook within a component which explicitly changes the active color mode:\n *\n * useEffect(() => {\n * setColorMode(colorMode);\n * }, [colorMode]);\n *\n */\nexport const useColorMode = () => {\n const context = useContext(ColorModeContext);\n\n if (context === undefined) {\n throw new Error('useColorMode must be used within a ColorModeProvider');\n }\n\n return context;\n};\n","import { useEffect } from 'react';\nimport type { EventBus, GrafanaTheme2 } from '@grafana/data';\nimport { ThemeChangedEvent } from '@grafana/runtime';\nimport type { ThemeColorMode } from '@grafana/design-tokens';\nimport { useColorMode } from '../components/ColorModeProvider/ColorModeProvider';\n\nconst getThemeColorMode = (isLight: boolean): ThemeColorMode => {\n return isLight ? 'light' : 'dark';\n};\n\nexport interface ColorModeChangeProps {\n getAppEvents: () => EventBus;\n useTheme2: () => GrafanaTheme2;\n}\n\n/**\n * This allows us to register an event listener for when the ThemeChangedEvent\n * is fired, and update the currently active color mode accordingly. It will\n * also determine the color mode on initial registration, and update the context\n * provider accordingly.\n */\nexport const useColorModeChange = ({\n getAppEvents,\n useTheme2,\n}: ColorModeChangeProps): ThemeColorMode => {\n const { colorMode, setColorMode } = useColorMode();\n const appEvents = getAppEvents();\n\n /**\n * Longterm the current colorMode should ideally exist outside of useTheme2\n */\n const { isLight } = useTheme2();\n\n useEffect(() => {\n const themeChangedEvent = appEvents.subscribe<ThemeChangedEvent>(\n ThemeChangedEvent,\n ({ payload }) => {\n const newColorMode = getThemeColorMode(payload.isLight);\n setColorMode(newColorMode);\n },\n );\n\n return () => {\n themeChangedEvent.unsubscribe();\n };\n }, [appEvents, setColorMode]);\n\n // Sync color mode when theme changes (runs on mount and when isLight changes)\n useEffect(() => {\n const newColorMode = getThemeColorMode(isLight);\n setColorMode(newColorMode);\n }, [isLight, setColorMode]);\n\n return colorMode;\n};\n","import React from 'react';\nimport { useColorModeChange, ColorModeChangeProps } from '../../hooks';\n\nexport type ColorModeWrapper = React.FC<ColorModeChangeProps & { children: React.ReactNode }>;\n\nexport const ColorModeChangeHandler: ColorModeWrapper = ({ children, getAppEvents, useTheme2 }) => {\n useColorModeChange({ getAppEvents, useTheme2 });\n\n return children;\n};\n","import { ColorModeWrapper, ColorModeChangeHandler } from '../ColorModeChangeHandler';\nimport { ColorModeProvider } from '../ColorModeProvider';\n\nexport const ColorMode: ColorModeWrapper = ({ children, getAppEvents, useTheme2 }) => {\n return (\n <ColorModeProvider>\n <ColorModeChangeHandler getAppEvents={getAppEvents} useTheme2={useTheme2}>\n {children}\n </ColorModeChangeHandler>\n </ColorModeProvider>\n );\n};\n","/**\n * Options for formatting numbers with `formatNumber`.\n *\n * @public\n * @category Utilities\n */\nexport interface FormatNumberOptions {\n /**\n * Number of decimal places to display.\n * @default 2\n */\n decimals?: number;\n\n /**\n * Values at or above this threshold will use compact notation (k, m, b).\n * @default 1000\n */\n compactThreshold?: number;\n\n /**\n * When true, always use full precision with locale formatting.\n * Disables compact notation regardless of value.\n * @default false\n */\n precise?: boolean;\n}\n\n/**\n * Format numbers with optional compact notation (k, m, b).\n *\n * Use this utility to display numbers consistently across your application.\n * The function handles large numbers with compact notation and provides\n * locale-aware formatting for smaller values.\n *\n * @public\n * @category Utilities\n *\n * @param value - The number to format. Accepts number, numeric string, or 'loading'\n * @param options - Formatting options (decimals, compactThreshold, precise)\n * @returns Formatted number string without currency or percent symbols\n *\n * @example\n * // Basic usage - compact notation for large numbers\n * formatNumber(1234) // \"1.2k\"\n * formatNumber(1500000) // \"1.5m\"\n * formatNumber(2000000000) // \"2.0b\"\n *\n * @example\n * // Small numbers use locale formatting\n * formatNumber(999) // \"999.00\"\n * formatNumber(42.5) // \"42.50\"\n *\n * @example\n * // Precise mode - disable compact notation\n * formatNumber(1234, { precise: true }) // \"1,234.00\"\n * formatNumber(1500000, { precise: true }) // \"1,500,000.00\"\n *\n * @example\n * // Custom decimal places\n * formatNumber(1234.5678, { decimals: 0 }) // \"1k\"\n * formatNumber(42.5678, { decimals: 3 }) // \"42.568\"\n *\n * @example\n * // With currency (add prefix yourself)\n * `$${formatNumber(15000)}` // \"$15.0k\"\n * `$${formatNumber(15000, { precise: true })}` // \"$15,000.00\"\n *\n * @example\n * // Handle edge cases\n * formatNumber('loading') // \"\"\n * formatNumber('invalid') // \"N/A\"\n * formatNumber(-5000) // \"-5.0k\"\n */\nexport const formatNumber = (\n value: number | string | 'loading',\n options: FormatNumberOptions = {},\n): string => {\n const { decimals = 2, compactThreshold = 1000, precise = false } = options;\n\n if (value === 'loading') {\n return '';\n }\n\n const num = typeof value === 'string' ? parseFloat(value) : value;\n if (isNaN(num)) {\n return 'N/A';\n }\n\n const abs = Math.abs(num);\n\n // Use compact notation if above threshold and not precise\n if (!precise && abs >= compactThreshold) {\n const sign = num < 0 ? '-' : '';\n const absNum = Math.abs(num);\n // Always use 1 decimal place for compact notation for consistency\n if (absNum >= 1000000000) {\n return `${sign}${(absNum / 1000000000).toFixed(1)}b`;\n } else if (absNum >= 1000000) {\n return `${sign}${(absNum / 1000000).toFixed(1)}m`;\n } else if (absNum >= 1000) {\n return `${sign}${(absNum / 1000).toFixed(1)}k`;\n }\n }\n\n // Standard formatting with specified decimal places\n return num.toLocaleString('en-US', {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n};\n","/**\n * Utilities for calculating and displaying value comparisons.\n * @module comparison\n */\n\nimport { formatNumber } from './formatters';\n\n/**\n * Result of a comparison calculation between two values.\n *\n * @public\n * @category Utilities\n *\n * @example\n * ```typescript\n * const result: ComparisonResult = calculateComparison(150, 100);\n * // result = {\n * // hasComparison: true,\n * // direction: 'up',\n * // percentageChange: 50,\n * // percentageLabel: '50.00%'\n * // }\n * ```\n */\nexport interface ComparisonResult {\n /**\n * Whether a valid comparison could be made.\n * False when either value is null, undefined, or baseline is 0.\n */\n hasComparison: boolean;\n\n /**\n * Direction of change: 'up' (increase), 'down' (decrease), or 'neutral' (no change).\n */\n direction: 'up' | 'down' | 'neutral';\n\n /**\n * Absolute percentage change between values (always positive).\n * Use `direction` to determine if it's an increase or decrease.\n */\n percentageChange: number;\n\n /**\n * Human-readable percentage label (e.g., \"25.50%\", \"1.2k%\").\n * Empty string when `hasComparison` is false.\n */\n percentageLabel: string;\n}\n\n/**\n * Calculate comparison metrics between a current value and a baseline value.\n *\n * Use this utility to compute percentage changes for period-over-period comparisons,\n * such as \"this month vs last month\" or \"current vs previous\".\n *\n * @public\n * @category Utilities\n *\n * @param current - The current/new value to compare\n * @param baseline - The baseline/previous value to compare against\n * @returns A {@link ComparisonResult} object with direction, percentage, and formatted label\n *\n * @example\n * // Basic increase\n * calculateComparison(150, 100)\n * // Returns: { hasComparison: true, direction: 'up', percentageChange: 50, percentageLabel: '50.00%' }\n *\n * @example\n * // Decrease\n * calculateComparison(75, 100)\n * // Returns: { hasComparison: true, direction: 'down', percentageChange: 25, percentageLabel: '25.00%' }\n *\n * @example\n * // No change\n * calculateComparison(100, 100)\n * // Returns: { hasComparison: true, direction: 'neutral', percentageChange: 0, percentageLabel: '0%' }\n *\n * @example\n * // Handle missing values gracefully\n * calculateComparison(100, null)\n * // Returns: { hasComparison: false, direction: 'neutral', percentageChange: 0, percentageLabel: '' }\n *\n * calculateComparison(undefined, 100)\n * // Returns: { hasComparison: false, direction: 'neutral', percentageChange: 0, percentageLabel: '' }\n *\n * @example\n * // Division by zero protection\n * calculateComparison(100, 0)\n * // Returns: { hasComparison: false, direction: 'neutral', percentageChange: 0, percentageLabel: '' }\n *\n * @example\n * // Use with ComparisonBadge component\n * ```tsx\n * import { calculateComparison, ComparisonBadge } from '@grafana/components';\n *\n * const { direction, percentageLabel } = calculateComparison(currentSpend, previousSpend);\n *\n * <ComparisonBadge\n * current={currentSpend}\n * previous={previousSpend}\n * timeframeLabel=\"last month\"\n * />\n * ```\n */\nexport const calculateComparison = (\n current: number | undefined | null,\n baseline: number | undefined | null,\n): ComparisonResult => {\n // If either value is missing, null, undefined, or baseline is 0, return neutral state\n if (\n current === undefined ||\n current === null ||\n baseline === undefined ||\n baseline === null ||\n baseline === 0\n ) {\n return {\n hasComparison: false,\n direction: 'neutral',\n percentageChange: 0,\n percentageLabel: '',\n };\n }\n\n // If values are equal, return neutral state\n if (current === baseline) {\n return {\n hasComparison: true,\n direction: 'neutral',\n percentageChange: 0,\n percentageLabel: '0%',\n };\n }\n\n // Calculate percentage change\n const percentageChange = Math.abs(((current - baseline) / baseline) * 100);\n const direction = current > baseline ? 'up' : 'down';\n\n return {\n hasComparison: true,\n direction,\n percentageChange,\n percentageLabel: `${formatNumber(percentageChange, {\n compactThreshold: 10000,\n decimals: 2,\n })}%`,\n };\n};\n","import React, { createContext, useContext, useState, ReactNode } from 'react';\nimport type { FloatingPortalProps } from '@floating-ui/react';\n\nexport type PortalRoot = FloatingPortalProps['root'];\n\nexport interface PortalContextType {\n root: PortalRoot;\n setRoot: (root: PortalRoot) => void;\n}\n\nexport interface PortalProviderProps {\n children: ReactNode;\n defaultRoot?: PortalRoot;\n}\n\nexport interface UsePortalOptions {\n /** If true, returns document.body instead of throwing when outside provider */\n allowOutsideProvider?: boolean;\n}\n\nconst PortalContext = createContext<PortalContextType | undefined>(undefined);\n\n/**\n * Provides a shared context for a portal root, which can be a selector string,\n * an HTMLElement, or null.\n *\n * Wrap your application (or a subtree) in this provider to enable\n * Popover, Tooltip, and other floating components to render correctly.\n *\n * @example\n * ```tsx\n * <PortalProvider defaultRoot={document.getElementById('grafana-portal-container')}>\n * <App />\n * </PortalProvider>\n * ```\n */\nexport const PortalProvider: React.FC<PortalProviderProps> = ({ children, defaultRoot = null }) => {\n const [root, setRoot] = useState<PortalRoot>(defaultRoot ?? document.body);\n\n return <PortalContext.Provider value={{ root, setRoot }}>{children}</PortalContext.Provider>;\n};\n\n/**\n * Use this hook to access the portal root context.\n */\nexport const usePortal = ({ allowOutsideProvider = false }: UsePortalOptions = {}) => {\n const context = useContext(PortalContext);\n\n if (context === undefined) {\n if (allowOutsideProvider) {\n return { root: document.body, setRoot: () => {} };\n }\n throw new Error('usePortal must be used within a PortalProvider');\n }\n\n return context;\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = () => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n const backgroundColor = legacy.colors.background.secondary;\n\n return {\n arrow: css({\n fill: backgroundColor,\n }),\n shadow: css({\n filter: `drop-shadow(${legacy.boxShadows.z2})`,\n }),\n container: css({\n backgroundColor,\n borderRadius: `calc(${legacy.borderRadius.md} + ${spacing.xs})`,\n padding: spacing.xs,\n color: legacy.colors.text.primary,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n }),\n };\n};\n","import {\n forwardRef,\n cloneElement,\n useCallback,\n useId,\n useRef,\n useState,\n useLayoutEffect,\n JSX,\n} from 'react';\nimport {\n arrow,\n autoUpdate,\n flip,\n FloatingArrow,\n offset,\n Placement,\n safePolygon,\n shift,\n useDismiss,\n useFloating,\n useFocus,\n useHover,\n useRole,\n useInteractions,\n useTransitionStyles,\n FloatingPortal,\n FloatingPortalProps,\n} from '@floating-ui/react';\nimport { usePortal } from '../PortalProvider';\nimport { getStyles } from './Popover.styles';\n\nexport interface SharedPopoverProps {\n /**\n * Should the popover be open? Implicitly means the popover visibility is\n * controlled; if omitted, the popover target will control visibility\n */\n isOpen?: boolean;\n\n /**\n * Set to true if you want the tooltip to stay long enough so the user can\n * move mouse over content to select text or click a link\n */\n isInteractive?: boolean;\n\n /**\n * Placement of the Popover relative to the trigger content\n */\n placement?: Placement;\n\n /**\n * Transition duration for hide/show effects, in milliseconds\n */\n transitionDuration?: number;\n\n /**\n * Additional delay before hiding the popover after mouseout, in milliseconds\n */\n hideDelay?: number;\n\n /**\n * Virtual element to anchor the popover to instead of the trigger\n */\n virtualElement?: React.RefObject<Element>;\n\n /**\n * DOM element or ID to render the portal into, falls back to document.body\n */\n portalContainer?: FloatingPortalProps['root'];\n}\n\nexport interface PopoverWithTriggerProps extends SharedPopoverProps {\n /**\n * Content used to trigger the Popover being displayed\n */\n trigger: JSX.Element;\n\n /**\n * Content to render within the Popover\n */\n children: JSX.Element;\n\n /**\n * When using a Trigger prop, there shouldn’t be a content prop\n */\n content?: never;\n}\n\nexport interface PopoverWithContentProps extends SharedPopoverProps {\n /**\n * Content to render within the Popover\n */\n content: JSX.Element | string;\n\n /**\n * Children to use as the trigger for the Popover\n */\n children: JSX.Element;\n\n /**\n * When using a Content prop, there shouldn’t be a trigger prop\n */\n trigger?: never;\n}\n\nexport type PopoverProps = PopoverWithTriggerProps | PopoverWithContentProps;\n\nconst POPOVER_OFFSET = 8;\n\nconst getMiddleware = ({\n placement,\n arrowRef,\n}: {\n placement?: Placement;\n arrowRef: React.RefObject<null>;\n}) => {\n const BOUNDARY_ELEMENT_ID = 'floating-boundary';\n const _flip = flip({\n // Ensure we flip to the perpendicular axis if it doesn't fit\n // on narrow viewports.\n crossAxis: 'alignment',\n fallbackAxisSideDirection: 'end',\n boundary: document.getElementById(BOUNDARY_ELEMENT_ID) ?? undefined,\n });\n\n const middleware = placement?.includes('-') ? [_flip, shift()] : [shift(), _flip];\n\n // the order of middleware is important!\n // `arrow` should almost always be at the end\n // see https://floating-ui.com/docs/arrow#order\n return [\n offset(POPOVER_OFFSET),\n ...middleware,\n arrow({\n element: arrowRef,\n }),\n ];\n};\n\nexport const Popover = forwardRef<HTMLElement, PopoverProps>(\n (\n {\n trigger: _trigger,\n content: _content,\n children,\n isOpen: isOpenControlled,\n isInteractive = false,\n placement = 'bottom',\n transitionDuration = 200,\n hideDelay = 500,\n virtualElement,\n portalContainer,\n },\n forwardedRef,\n ) => {\n const arrowRef = useRef(null);\n const closeTimer = useRef<number | undefined>(undefined);\n const popoverId = useId();\n const [isOpenState, setOpen] = useState(isOpenControlled);\n const [isDelayedOpen, setDelayedOpen] = useState(isOpenControlled);\n const isOpen = isOpenControlled ?? isOpenState;\n const middleware = getMiddleware({ placement, arrowRef });\n const styles = getStyles();\n const { root } = usePortal();\n\n const portalRoot = (() => {\n switch (true) {\n case portalContainer instanceof HTMLElement:\n return portalContainer;\n case typeof portalContainer === 'string':\n return document.getElementById(portalContainer);\n default:\n return root;\n }\n })();\n\n const { context, refs, floatingStyles } = useFloating({\n open: isOpen,\n placement,\n onOpenChange: (open) => {\n setOpen(open);\n clearTimeout(closeTimer.current);\n\n if (!open) {\n closeTimer.current = window.setTimeout(() => {\n setDelayedOpen(open);\n }, transitionDuration + hideDelay);\n } else {\n setDelayedOpen(open);\n }\n },\n middleware,\n whileElementsMounted: autoUpdate,\n });\n\n useLayoutEffect(() => {\n if (virtualElement && virtualElement.current !== null) {\n const domRect = virtualElement.current.getBoundingClientRect();\n\n refs.setPositionReference({\n getBoundingClientRect: () => {\n if (virtualElement.current !== null)\n return virtualElement.current.getBoundingClientRect();\n return domRect;\n },\n contextElement: virtualElement.current,\n });\n }\n }, [refs, virtualElement]);\n\n const { getReferenceProps, getFloatingProps } = useInteractions([\n useDismiss(context),\n useHover(context, {\n handleClose: isInteractive ? safePolygon() : undefined,\n move: false,\n delay: {\n open: 0,\n close: hideDelay,\n },\n }),\n useFocus(context),\n useRole(context),\n ]);\n\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: transitionDuration,\n initial: ({ side }) => ({\n opacity: 0,\n transform:\n side === 'top' || side === 'bottom'\n ? `translateY(${POPOVER_OFFSET}px)`\n : `translateX(${POPOVER_OFFSET}px)`,\n }),\n open: ({ side }) => ({\n opacity: 1,\n transform: side === 'top' || side === 'bottom' ? `translateY(0)` : `translateX(0)`,\n }),\n close: ({ side }) => ({\n opacity: 0,\n transform:\n side === 'top' || side === 'bottom'\n ? `translateY(${POPOVER_OFFSET}px)`\n : `translateX(${POPOVER_OFFSET}px)`,\n }),\n });\n\n const handleRef = useCallback(\n (ref: HTMLElement | null) => {\n refs.setReference(ref);\n\n if (typeof forwardedRef === 'function') {\n forwardedRef(ref);\n } else if (forwardedRef) {\n forwardedRef.current = ref;\n }\n },\n [forwardedRef, refs],\n );\n\n /**\n * The interface of Popover supports two methods of usage where the children can\n * either represent the content of the popover, or the element to trigger\n * rendering the popover. Dependent on whether the trigger or content prop is\n * provided, the children prop will handle the other scenario.\n */\n const [trigger, content] =\n typeof _trigger !== 'undefined' ? [_trigger, children] : [children, _content];\n\n return (\n <>\n {/* element to trigger displaying the popover */}\n {cloneElement(trigger, {\n ref: handleRef,\n tabIndex: 0,\n 'aria-describedby': isOpen ? popoverId : undefined,\n ...getReferenceProps(),\n })}\n {/* content to render inside the popover when open */}\n {(isDelayedOpen || isOpen) && (\n <FloatingPortal root={portalRoot}>\n <div ref={refs.setFloating} style={floatingStyles} {...getFloatingProps()}>\n <div style={transitionStyles} className={styles.shadow}>\n <FloatingArrow className={styles.arrow} ref={arrowRef} context={context} />\n <div id={popoverId} role=\"tooltip\" className={styles.container}>\n {content}\n </div>\n </div>\n </div>\n </FloatingPortal>\n )}\n </>\n );\n },\n);\n\nPopover.displayName = 'Popover';\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = () => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n const background = legacy.colors.background.primary;\n\n return {\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n gap: spacing.xs,\n }),\n heading: css({\n padding: `${spacing.sm} ${spacing.md}`,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.bold,\n color: legacy.colors.text.primary,\n background,\n borderRadius: legacy.borderRadius.md,\n }),\n content: css({\n display: 'flex',\n gap: spacing.xs,\n }),\n section: css({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'flex-end',\n gap: spacing.xs,\n background,\n borderRadius: legacy.borderRadius.md,\n padding: `${spacing.sm} ${spacing.md}`,\n }),\n sectionTitle: css({\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.medium,\n color: legacy.colors.text.primary,\n whiteSpace: 'nowrap',\n }),\n value: css({\n display: 'flex',\n alignItems: 'center',\n gap: spacing.xs,\n fontFamily: typography.fontFamily.monospace,\n fontSize: typography.fontSize.monospace.sm,\n color: legacy.colors.text.secondary,\n }),\n icon: css({\n flexShrink: 0,\n }),\n };\n};\n","import { Icon, IconName } from '@grafana/ui';\nimport { Popover, PopoverWithTriggerProps } from '../Popover';\nimport { getStyles } from './ComparisonTooltip.styles';\n\nexport interface ComparisonTooltipProps extends Omit<PopoverWithTriggerProps, 'children'> {\n current?: string;\n previous?: string;\n previousLabel?: string;\n currentLabel?: string;\n title?: string;\n currentIcon?: IconName;\n previousIcon?: IconName;\n hideDelay?: number;\n}\n\nexport const ComparisonTooltip = ({\n trigger,\n placement = 'top',\n current,\n previous,\n previousLabel,\n currentLabel = 'Current',\n title,\n currentIcon = 'eye',\n previousIcon = 'clock-nine',\n hideDelay,\n}: ComparisonTooltipProps) => {\n const styles = getStyles();\n\n return (\n <Popover trigger={trigger} placement={placement} hideDelay={hideDelay}>\n <div className={styles.wrapper}>\n {title && <div className={styles.heading}>{title}</div>}\n <div className={styles.content}>\n <div className={styles.section}>\n <div className={styles.sectionTitle}>{currentLabel}</div>\n <div className={styles.value}>\n <Icon name={currentIcon} size=\"sm\" className={styles.icon} />\n <span>{current || 'N/A'}</span>\n </div>\n </div>\n <div className={styles.section}>\n <div className={styles.sectionTitle}>{previousLabel}</div>\n <div className={styles.value}>\n <Icon name={previousIcon} size=\"sm\" className={styles.icon} />\n <span>{previous || 'N/A'}</span>\n </div>\n </div>\n </div>\n </div>\n </Popover>\n );\n};\n","import { css } from '@emotion/css';\nimport { CSSVariables, getDesignTokens } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'comparison-badge-icon-background-color': legacy.colors.background.secondary,\n 'comparison-badge-icon-highlight-background-color': legacy.palette.whiteBaseOpacity10,\n },\n light: {\n 'comparison-badge-icon-background-color': legacy.colors.background.canvas,\n 'comparison-badge-icon-highlight-background-color': legacy.palette.blackBaseOpacity8,\n },\n };\n};\n\nconst BADGE_HEIGHT = 28;\nconst TREND_ICON_SIZE = 20;\n\nexport const getComparisonBadgeStyles = ({\n highlight,\n direction,\n tooltip,\n}: {\n highlight: boolean;\n direction: string;\n tooltip?: boolean;\n}) => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n const labelColor = (() => {\n switch (true) {\n case highlight:\n case direction === 'up':\n return legacy.colors.text.maxContrast;\n default:\n return legacy.colors.primary.text;\n }\n })();\n\n return {\n container: css({\n boxSizing: 'border-box',\n background: 'transparent',\n borderRadius: legacy.borderRadius.pill,\n border: `1px solid\n ${highlight ? legacy.colors.border.strong : legacy.colors.border.weak}`,\n padding: `${spacing.xxs} ${spacing.sm} ${spacing.xxs} ${spacing.xxs}`,\n textAlign: 'left',\n display: 'inline-flex',\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n height: `${BADGE_HEIGHT}px`,\n position: 'relative',\n transition: 'background 0.2s ease-in-out',\n ...(tooltip\n ? {\n cursor: 'pointer',\n '&:hover': {\n background: legacy.colors.background.secondary,\n },\n }\n : {}),\n }),\n clockIconWrapper: css({\n background: highlight\n ? 'var(--comparison-badge-icon-highlight-background-color)'\n : 'var(--comparison-badge-icon-background-color)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '22px',\n height: '22px',\n borderRadius: legacy.borderRadius.pill,\n color: legacy.colors.text.primary,\n }),\n trendLabelContainer: css({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n gap: spacing.xxs,\n paddingLeft: spacing.xxs,\n fontWeight: typography.fontWeight.medium,\n whiteSpace: 'nowrap',\n }),\n trendLabel: css({\n display: 'flex',\n alignItems: 'center',\n color: labelColor,\n lineHeight: `${BADGE_HEIGHT}px`,\n fontWeight: typography.fontWeight.medium,\n fontVariantNumeric: 'tabular-nums',\n }),\n timeframeLabel: css({\n color: highlight ? legacy.colors.text.maxContrast : legacy.colors.text.primary,\n paddingLeft: spacing.xxs,\n lineHeight: `${BADGE_HEIGHT}px`,\n fontWeight: typography.fontWeight.normal,\n }),\n trendIconWrapper: css({\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n width: '16px',\n height: '16px',\n }),\n trendIcon: css({\n width: `${TREND_ICON_SIZE}px`,\n height: `${TREND_ICON_SIZE}px`,\n }),\n dash: css({\n color: legacy.colors.text.secondary,\n }),\n };\n};\n","import { cx } from '@emotion/css';\nimport { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { Icon, IconName } from '@grafana/ui';\nimport { calculateComparison } from '../../utils/comparison';\nimport { formatNumber } from '../../utils/formatters';\nimport { ComparisonTooltipProps, ComparisonTooltip } from '../ComparisonTooltip';\nimport { cssVariables, getComparisonBadgeStyles } from './ComparisonBadge.styles';\n\nconst formatCurrency = (value: number | undefined | null): string => {\n return !!value ? `$${formatNumber(value, { precise: true })}` : 'N/A';\n};\n\nexport interface ComparisonBadgeProps\n extends Pick<ComparisonTooltipProps, 'currentLabel' | 'previousLabel' | 'placement'> {\n current?: number | null;\n previous?: number | null;\n highlight?: boolean;\n timeframeLabel?: string;\n tooltip?: boolean;\n hideDelay?: number;\n}\n\nconst DIRECTION_ICON: Record<'up' | 'down' | 'neutral', IconName> = {\n up: 'arrow-up',\n down: 'arrow-down',\n neutral: 'minus',\n};\n\nexport const ComparisonBadge = ({\n current,\n previous,\n currentLabel,\n previousLabel,\n placement,\n highlight = false,\n timeframeLabel,\n tooltip = true,\n hideDelay,\n}: ComparisonBadgeProps) => {\n const { direction, hasComparison, percentageLabel } = calculateComparison(current, previous);\n const styles = getComparisonBadgeStyles({ highlight, direction, tooltip });\n\n const directionIconStyle = (() => {\n switch (true) {\n case direction == 'neutral':\n return styles.dash;\n default:\n return undefined;\n }\n })();\n\n const badgeContent = (\n <div className={styles.container}>\n <div className={styles.clockIconWrapper}>\n <Icon name=\"clock-nine\" />\n </div>\n <div className={styles.trendLabelContainer}>\n <span className={styles.trendLabel}>\n <span className={styles.trendIconWrapper}>\n <Icon\n name={DIRECTION_ICON[direction]}\n className={cx(styles.trendIcon, directionIconStyle)}\n />\n </span>\n {hasComparison && percentageLabel && <>{percentageLabel}</>}\n </span>\n {timeframeLabel && (\n <span className={styles.timeframeLabel}>vs {timeframeLabel.toLowerCase()}</span>\n )}\n </div>\n </div>\n );\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n {tooltip ? (\n <ComparisonTooltip\n trigger={badgeContent}\n current={formatCurrency(current)}\n previous={formatCurrency(previous)}\n currentLabel={currentLabel}\n previousLabel={previousLabel}\n placement={placement}\n hideDelay={hideDelay}\n />\n ) : (\n badgeContent\n )}\n </>\n );\n};\n","import { css, keyframes } from '@emotion/css';\nimport { CSSVariables, getDesignTokens } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'skeleton-gradient-background-color': legacy.palette.whiteBaseOpacity12,\n },\n light: {\n 'skeleton-gradient-background-color': legacy.palette.blackBaseOpacity12,\n },\n };\n};\n\nconst shimmer = keyframes({\n '0%': {\n transform: 'translateX(-100%);',\n },\n '100%': {\n transform: 'translateX(100%);',\n },\n});\n\nexport const getStyles = (animationDuration: number) => {\n return css({\n display: 'flex',\n width: '100%',\n height: '100%',\n background: 'transparent',\n position: 'relative',\n overflow: 'hidden',\n borderRadius: '5px',\n '&::before': {\n content: \"''\",\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n height: '100%',\n animation: `${shimmer} ${animationDuration}s ease-in-out infinite`,\n transform: 'translateX(-100%)',\n background:\n 'linear-gradient(90deg, transparent, var(--skeleton-gradient-background-color), transparent)',\n },\n });\n};\n","import { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { cssVariables, getStyles } from './GenericSkeleton.styles';\n\nexport interface GenericSkeletonProps {\n /**\n * Duration of animation in seconds\n */\n animationDuration?: number;\n}\n\nexport const GenericSkeleton = ({ animationDuration = 2 }: GenericSkeletonProps) => {\n const styles = getStyles(animationDuration);\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n <div className={styles} />\n </>\n );\n};\n","/**\n * Apply a filter to rotate the hue by 10 degrees per index\n */\nexport const filterHueRotate = (index: number) => ({\n filter: `hue-rotate(${index * 10}deg)`,\n});\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\nimport { StackedChartSegmentProps } from './types';\nimport { filterHueRotate } from '../StackedChart/shared.styles';\n\nexport const diagonalStripedBackground = ({\n stripeColor,\n stripeWidth = 2,\n gapWidth = 6,\n}: {\n stripeColor: string;\n stripeWidth?: number;\n gapWidth?: number;\n}) => {\n return `repeating-linear-gradient(\n -45deg,\n ${stripeColor},\n ${stripeColor} ${stripeWidth}px,\n transparent ${stripeWidth}px,\n transparent ${gapWidth}px)`;\n};\n\nexport const getSegmentStyles = () =>\n css({\n display: 'flex',\n height: '100%',\n });\n\nexport const getStyles = <T extends string>({\n index,\n state = 'default',\n}: Pick<StackedChartSegmentProps<T>, 'index' | 'state'>) => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n const hasColor = ['color', 'active'].includes(state);\n\n const backgroundImage = diagonalStripedBackground({\n stripeColor:\n state === 'dimmed' ? legacy.colors.secondary.shade : legacy.colors.secondary.transparent,\n });\n\n return css({\n cursor: hasColor ? 'pointer' : undefined,\n borderRadius: legacy.borderRadius.sm,\n transitionDuration: '0.2s',\n transitionTimingFunction: 'ease-in-out',\n transitionProperty: 'background, filter, box-shadow',\n background: hasColor ? legacy.colors.primary.main : legacy.colors.secondary.transparent,\n backgroundImage,\n opacity: state === 'dimmed' ? 0.4 : undefined,\n boxShadow: state === 'active' ? legacy.boxShadows.z1 : 'none',\n ...(hasColor ? filterHueRotate(index) : {}),\n });\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport { StackedChartSegmentProps } from './types';\nimport { getStyles, getSegmentStyles } from './StackedChartSegment.styles';\n\nconst _StackedChartSegment = <T extends string>(\n {\n categoryId,\n state = 'default',\n index,\n value,\n total = 100,\n minValue = 4,\n onMouseOver,\n onMouseOut,\n }: StackedChartSegmentProps<T>,\n ref: React.ForwardedRef<HTMLDivElement>,\n) => {\n const width = `${Math.max((value / total) * 100, minValue)}%`;\n\n return (\n <div\n ref={ref}\n className={clsx(getStyles({ state, index }), getSegmentStyles())}\n onMouseOver={onMouseOver && onMouseOver({ ref, categoryId })}\n onMouseOut={onMouseOut && onMouseOut({ ref, categoryId })}\n style={{ width }}\n />\n );\n};\n\n_StackedChartSegment.displayName = 'StackedChartSegment';\n\nexport const StackedChartSegment = React.forwardRef(_StackedChartSegment);\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\n\nexport const getStyles = ({ height }: { height: number }) => {\n const {\n primitives: { spacing },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n container: css({\n display: 'flex',\n width: '100%',\n height,\n gap: spacing.xxs,\n }),\n };\n};\n\nexport const diagonalStripedBackground = ({\n stripeColor,\n stripeWidth = 2,\n gapWidth = 6,\n}: {\n stripeColor: string;\n stripeWidth?: number;\n gapWidth?: number;\n}) => {\n return `repeating-linear-gradient(\n -45deg,\n ${stripeColor},\n ${stripeColor} ${stripeWidth}px,\n transparent ${stripeWidth}px,\n transparent ${gapWidth}px)`;\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens } from '@grafana/design-tokens';\nimport { filterHueRotate } from '../StackedChart/shared.styles';\n\nexport const getStyles = (index: number) => {\n const {\n legacy,\n primitives: { spacing, typography },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n wrapper: css({\n display: 'flex',\n flexDirection: 'column',\n gap: spacing.xs,\n }),\n content: css({\n display: 'flex',\n gap: spacing.xs,\n }),\n section: css({\n display: 'flex',\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'flex-end',\n gap: spacing.xs,\n background: legacy.colors.background.primary,\n borderRadius: legacy.borderRadius.md,\n padding: `${spacing.sm} ${spacing.md}`,\n }),\n title: css({\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n fontWeight: typography.fontWeight.medium,\n // TODO: this should come from a token!\n lineHeight: '16px',\n color: legacy.colors.text.primary,\n whiteSpace: 'nowrap',\n }),\n value: css({\n // TODO: this should come from a token!\n lineHeight: '16px',\n color: legacy.colors.text.secondary,\n }),\n color: css({\n color: legacy.colors.primary.main,\n fill: 'currentColor',\n ...filterHueRotate(index),\n }),\n };\n};\n","import { StackedChartSegmentProps } from '../StackedChartSegment/types';\nimport { Popover, PopoverWithTriggerProps } from '../Popover';\nimport { getStyles } from './StackedChartSegmentTooltip.styles';\n\nexport type StackedChartTooltipContentFormatter = (\n args: {\n colorClassName: string;\n } & Required<Pick<StackedChartSegmentProps<string>, 'value' | 'total' | 'index'>>,\n) => React.ReactElement;\n\nexport interface StackedChartSegmentTooltipProps<T extends string>\n extends Pick<StackedChartSegmentProps<T>, 'title' | 'value' | 'total' | 'index'>,\n Omit<PopoverWithTriggerProps, 'children'> {\n formatContent?: StackedChartTooltipContentFormatter;\n}\n\n/**\n * The default content formatter assumes a percentage value, but you can create\n * your own formatter using the provided arguments of total and index. The\n * colorClassName allows you to set the colour of some text or an icon to the\n * same colour as the equivalent chart segment.\n */\nconst defaultContentFormatter: StackedChartTooltipContentFormatter = ({\n value,\n colorClassName,\n}) => {\n const valueString = value < 0.1 ? '< 0.1' : `${value.toFixed(1)}`;\n\n return (\n <>\n <span className={colorClassName}>{valueString}%</span> of total usage\n </>\n );\n};\n\nexport const StackedChartSegmentTooltip = <T extends string>({\n trigger,\n placement = 'top',\n hideDelay,\n title,\n value,\n total = 100,\n index,\n formatContent = defaultContentFormatter,\n virtualElement,\n}: StackedChartSegmentTooltipProps<T>) => {\n const styles = getStyles(index);\n\n return (\n <Popover\n trigger={trigger}\n placement={placement}\n hideDelay={hideDelay}\n virtualElement={virtualElement}\n >\n <div className={styles.wrapper}>\n <div className={styles.content}>\n <div className={styles.section}>\n <div className={styles.title}>{title}</div>\n <div className={styles.value}>\n {formatContent({ value, total, index, colorClassName: styles.color })}\n </div>\n </div>\n </div>\n </div>\n </Popover>\n );\n};\n","import { css } from '@emotion/css';\n\nexport const getStyles = (height: number) => {\n return css({\n width: '100%',\n height: `${height}px`,\n borderRadius: '4px',\n overflow: 'hidden',\n });\n};\n","export const STACKED_CHART_DEFAULT_HEIGHT = 24;\n","import { getStyles } from './StackedChartSkeleton.styles';\nimport { GenericSkeleton } from '../GenericSkeleton';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common';\n\nexport interface StackedChartSkeletonProps {\n /**\n * Height to render the stacked chart skeleton, in pixels\n */\n height?: number;\n}\n\nexport const StackedChartSkeleton = ({\n height = STACKED_CHART_DEFAULT_HEIGHT,\n}: StackedChartSkeletonProps) => {\n const styles = getStyles(height);\n\n return (\n <div className={styles}>\n <GenericSkeleton />\n </div>\n );\n};\n","import { css } from '@emotion/css';\nimport { getDesignTokens, CSSVariables } from '@grafana/design-tokens';\n\nexport const cssVariables = (): CSSVariables => {\n const { legacy } = getDesignTokens({ valueType: 'css' });\n\n return {\n dark: {\n 'stacked-chart-no-data-background-color': legacy.palette.blackBaseOpacity15,\n },\n light: {\n 'stacked-chart-no-data-background-color': legacy.palette.blackBaseOpacity4,\n },\n };\n};\n\nexport const getStyles = (height: number) => {\n const {\n legacy,\n primitives: { typography, spacing },\n } = getDesignTokens({ valueType: 'css' });\n\n return {\n container: css({\n display: 'flex',\n flex: 1,\n width: '100%',\n height: `${height}px`,\n alignItems: 'center',\n justifyContent: 'center',\n gap: spacing.sm,\n borderRadius: legacy.borderRadius.md,\n color: legacy.colors.text.secondary,\n fontFamily: typography.fontFamily.ui,\n fontSize: typography.fontSize.ui.sm,\n paddingTop: spacing.xxs,\n background: 'var(--stacked-chart-no-data-background-color)',\n }),\n label: css({\n fontWeight: typography.fontWeight.medium,\n textTransform: 'lowercase',\n }),\n };\n};\n","import { GlobalCSSVariables } from '@grafana/design-tokens';\nimport { Icon } from '@grafana/ui';\nimport { cssVariables, getStyles } from './StackedChartNoData.styles';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common';\n\nexport type StackedChartNoDataMessageFormatter = (args: {\n period: string;\n className: string;\n}) => React.ReactElement;\n\nexport interface StackedChartNoDataProps {\n /**\n * Height to render the stacked chart skeleton, in pixels\n */\n height?: number;\n\n /**\n * Period for which this chart has no data, as a preformatted string\n */\n period?: string;\n\n /**\n * Optional formatter for content message\n */\n formatMessage?: StackedChartNoDataMessageFormatter;\n}\n\n/**\n * The default content formatter assumes a percentage value, but you can create\n * your own formatter using the provided arguments of total and index. The\n * colorClassName allows you to set the colour of some text or an icon to the\n * same colour as the equivalent chart segment.\n */\nconst defaultContentFormatter: StackedChartNoDataMessageFormatter = ({ period, className }) => (\n <>\n No data for <span className={className}>{period}</span>\n </>\n);\n\nexport const StackedChartNoData = ({\n height = STACKED_CHART_DEFAULT_HEIGHT,\n period = 'current',\n formatMessage = defaultContentFormatter,\n}: StackedChartNoDataProps) => {\n const styles = getStyles(height);\n\n return (\n <>\n <GlobalCSSVariables variables={cssVariables()} defaultColorMode={null} />\n <div className={styles.container}>\n <Icon name=\"exclamation-triangle\" size=\"sm\" />\n <span>{formatMessage({ period, className: styles.label })}</span>\n </div>\n </>\n );\n};\n","import { useRef, useState } from 'react';\nimport { StackedChartSegment } from '../StackedChartSegment';\nimport { getStyles } from './StackedChart.styles';\nimport { StackedChartSegmentState, SegmentMouseEventHandler } from '../StackedChartSegment/types';\nimport { StackedChartSegmentTooltip } from '../StackedChartSegmentTooltip';\nimport { StackedChartSkeleton } from '../StackedChartSkeleton';\nimport { StackedChartNoData, StackedChartNoDataProps } from '../StackedChartNoData';\nimport { STACKED_CHART_DEFAULT_HEIGHT } from './common';\n\nexport interface StackedChartCategory {\n title: string;\n value: number;\n}\n\nconst DUMMY_CATEGORY: StackedChartCategory = {\n title: 'Category',\n value: 0.01,\n};\n\nexport type StackedChartCategories<T extends string> = Partial<Record<T, StackedChartCategory>>;\n\nexport type StackedChartSortOrder = 'largest-first' | 'smallest-first' | 'natural';\n\n/**\n * Callback function invoked when a mouse event occurs on a chart segment.\n *\n * This is a simplified callback (not a React event handler) that receives\n * segment metadata. It's called after the internal event handling is complete.\n *\n * @param args - Object containing segment metadata\n * @param args.categoryId - The unique identifier of the segment that triggered the event\n * @param args.ref - React ref to the segment's DOM element, useful for positioning tooltips or popovers\n *\n * @example\n * ```tsx\n * <StackedChart\n * categories={categories}\n * onSegmentMouseOver={({ categoryId, ref }) => {\n * console.log(`Hovered segment: ${categoryId}`);\n * // ref.current gives you the DOM element if needed\n * }}\n * onSegmentMouseOut={({ categoryId }) => {\n * console.log(`Left segment: ${categoryId}`);\n * }}\n * />\n * ```\n */\ntype MouseEventHandler = ({\n categoryId,\n ref,\n}: {\n categoryId: string;\n ref: React.ForwardedRef<HTMLDivElement>;\n}) => void;\n\nexport interface StackedChartProps<T extends string> {\n /**\n * How should category segments be sorted?\n */\n sortOrder?: StackedChartSortOrder;\n\n /**\n * Height to render the stacked chart, in pixels\n */\n height?: number;\n\n /**\n * initial category ID to highlight; if omitted then all segments will render\n * in colour and highlight based on mouseover events.\n */\n highlightedCategoryId?: T;\n\n /**\n * Should the whole StackedChart be dimmed, i.e. with a highlighted category\n * not in color, all other categories faded out?\n */\n isDimmed?: boolean;\n\n /**\n * Callback invoked when the mouse enters a chart segment.\n *\n * Receives the segment's `categoryId` and a `ref` to its DOM element.\n * Use this to implement custom hover behavior, analytics tracking,\n * or coordination with external UI elements.\n *\n * @example\n * ```tsx\n * onSegmentMouseOver={({ categoryId, ref }) => {\n * setActiveCategory(categoryId);\n * // Optional: use ref.current for DOM measurements\n * }}\n * ```\n */\n onSegmentMouseOver?: MouseEventHandler;\n\n /**\n * Callback invoked when the mouse leaves a chart segment.\n *\n * Receives the segment's `categoryId` and a `ref` to its DOM element.\n * Use this to clean up hover state or hide related UI elements.\n *\n * @example\n * ```tsx\n * onSegmentMouseOut={({ categoryId }) => {\n * setActiveCategory(null);\n * }}\n * ```\n */\n onSegmentMouseOut?: MouseEventHandler;\n\n /**\n * String representing the period for which the chart is displaying data\n */\n period?: string;\n\n formatNoDataMessage?: StackedChartNoDataProps['formatMessage'];\n\n /**\n * Is the StackedChart explicitly in a loading state?\n */\n isSkeleton?: boolean;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories?: StackedChartCategories<T>;\n}\n\n/**\n * Custom hook to assign a ref per categoryId\n */\nconst useCategoryRefs = <T extends string>(\n categoryIds: T[],\n): Record<T, React.RefObject<HTMLDivElement>> => {\n const refsMap = useRef<Map<T, React.RefObject<HTMLDivElement>>>(new Map());\n\n for (const categoryId of categoryIds) {\n if (!refsMap.current.has(categoryId)) {\n refsMap.current.set(categoryId, { current: null });\n }\n }\n\n const result = {} as Record<T, React.RefObject<HTMLDivElement>>;\n for (const categoryId of categoryIds) {\n result[categoryId] = refsMap.current.get(categoryId)!;\n }\n\n return result;\n};\n\nexport const StackedChart = <T extends string>({\n categories,\n highlightedCategoryId: initialHighlightedCategoryId,\n isSkeleton = false,\n isDimmed = false,\n sortOrder = 'largest-first',\n height = STACKED_CHART_DEFAULT_HEIGHT,\n onSegmentMouseOver,\n onSegmentMouseOut,\n period = 'current',\n formatNoDataMessage,\n}: StackedChartProps<T>) => {\n const shouldRenderSkeleton = isSkeleton || !categories;\n let highlightedSegmentRef = useRef<HTMLDivElement>(null);\n const [highlightedCategoryId, setHighlightedCategoryId] = useState<string | undefined>(\n /**\n * Using a type assertion here ultimately because you can’t pass a generic\n * type argument to the type of props in React.forwardRef (it is inferred as\n * of type string).\n *\n * See: https://stackoverflow.com/questions/51884498/using-react-forwardref-with-typescript-generic-jsx-arguments\n */\n initialHighlightedCategoryId as string,\n );\n const [isHovered, setHovered] = useState<boolean>(false);\n const timer = useRef<number | undefined>(undefined);\n\n const sortedCategoryIds = (() => {\n let categoryIds: T[] = [];\n\n for (const categoryId in categories) {\n categoryIds.push(categoryId);\n }\n\n // return early since we may not even have any categories at this point\n if (shouldRenderSkeleton) return categoryIds;\n\n switch (sortOrder) {\n case 'largest-first':\n return categoryIds.sort(\n (a, b) => (categories[b]?.value ?? 0) - (categories[a]?.value ?? 0),\n );\n case 'smallest-first':\n return categoryIds.sort(\n (a, b) => (categories[a]?.value ?? 0) - (categories[b]?.value ?? 0),\n );\n default:\n return categoryIds;\n }\n })();\n\n const categoryRefs = useCategoryRefs(sortedCategoryIds);\n\n /**\n * Determine what the total value is for all category values combined\n */\n const total = shouldRenderSkeleton\n ? 0\n : Math.round(\n sortedCategoryIds.reduce((sum, categoryId) => {\n return sum + (categories[categoryId]?.value ?? 0);\n }, 0),\n );\n\n const styles = getStyles({ height });\n\n const onMouseOver: SegmentMouseEventHandler =\n ({ ref, categoryId }) =>\n () => {\n clearTimeout(timer.current);\n setHovered(true);\n\n /**\n * Only update the highlighted category ID if an initial category wasn’t\n * supplied\n */\n if (!initialHighlightedCategoryId) {\n setHighlightedCategoryId(categoryId);\n }\n\n if (onSegmentMouseOver) onSegmentMouseOver({ ref, categoryId });\n };\n\n const onMouseOut: SegmentMouseEventHandler =\n ({ ref, categoryId }) =>\n () => {\n /**\n * TODO: rather than use a timeout, maybe use the parent element being\n * moused over (event bubbling?) to validate whether the mouse has left\n * the entire chart vs an individual segment?\n */\n timer.current = window.setTimeout(() => {\n setHovered(false);\n /**\n * Only clear the highlighted category if an initial category wasn’t\n * supplied\n */\n if (!initialHighlightedCategoryId) {\n setHighlightedCategoryId(undefined);\n }\n }, 50);\n\n if (onSegmentMouseOut) onSegmentMouseOut({ ref, categoryId });\n };\n\n const highlightedCategory: (StackedChartCategory & { index: number }) | undefined =\n !shouldRenderSkeleton &&\n initialHighlightedCategoryId &&\n categories[initialHighlightedCategoryId]\n ? {\n ...categories[initialHighlightedCategoryId],\n index: sortedCategoryIds.indexOf(initialHighlightedCategoryId),\n }\n : undefined;\n\n const content = (\n <div className={styles.container}>\n {sortedCategoryIds.map((categoryId, index) => {\n /**\n * Some dummy category data is returned here for the scenario when\n * rendering a skeleton\n */\n const category =\n !shouldRenderSkeleton && categories?.[categoryId] !== undefined\n ? categories?.[categoryId]\n : DUMMY_CATEGORY;\n const ref = categoryRefs[categoryId];\n\n if (categoryId === initialHighlightedCategoryId && ref) highlightedSegmentRef = ref;\n\n const segmentState = ((): StackedChartSegmentState => {\n switch (true) {\n /**\n * If no initial highlighted category was set, and a category is\n * moused over, use the _active_ state for that category rather\n * than the color state; this adds a drop shadow to the segment.\n * Also, if an initial highlighted category _was_ set, and it\n * receives a hover event, also set it to active.\n */\n case !initialHighlightedCategoryId && highlightedCategoryId === categoryId && !isDimmed:\n case initialHighlightedCategoryId === categoryId && isHovered && !isDimmed:\n return 'active';\n\n /**\n * - no initial highlighted category ID was passed _and_ there is\n * no highlightedCategoryId (i.e. all segments in colour)\n * - the highlighted category is this category (but the chart\n * isn’t dimmed)\n * - the initial highlighted category is this category (but the\n * chart isn’t dimmed)\n */\n case !initialHighlightedCategoryId && !highlightedCategoryId && !isDimmed:\n case initialHighlightedCategoryId === categoryId && !isDimmed:\n return 'color';\n\n /**\n * Has an initial highlighted category, but is dimmed (i.e. all\n * segments excepted the highlighted category)\n */\n case Boolean(initialHighlightedCategoryId) &&\n initialHighlightedCategoryId !== categoryId &&\n isDimmed:\n case !initialHighlightedCategoryId && !highlightedCategoryId && isDimmed:\n case highlightedCategoryId !== categoryId && isDimmed:\n return 'dimmed';\n\n /**\n * In any other case, the segment should be the default grey\n */\n default:\n return 'default';\n }\n })();\n\n const segmentProps = {\n key: categoryId,\n index,\n ref,\n categoryId,\n title: category.title,\n value: category.value,\n total,\n state: segmentState,\n onMouseOver,\n onMouseOut,\n };\n\n /**\n * Only wrap the segment in a tooltip if no initially highlighted\n * category ID was supplied.\n */\n return initialHighlightedCategoryId ? (\n <StackedChartSegment {...segmentProps} />\n ) : (\n <StackedChartSegmentTooltip\n key={categoryId}\n title={category.title}\n value={category.value}\n index={index}\n hideDelay={0}\n trigger={<StackedChartSegment {...segmentProps} />}\n />\n );\n })}\n </div>\n );\n\n /**\n * If we should only render a skeleton, return early with that component\n */\n if (shouldRenderSkeleton) return <StackedChartSkeleton height={height} />;\n\n /**\n * If the initial highlighted category isn’t within the provided set of\n * categories, fall back to displaying the No Data component\n */\n if (\n initialHighlightedCategoryId &&\n sortedCategoryIds.indexOf(initialHighlightedCategoryId) === -1\n )\n return (\n <StackedChartNoData height={height} period={period} formatMessage={formatNoDataMessage} />\n );\n\n /**\n * If an initial highlight category was provided, wrap the entire chart inside\n * a tooltip using the props for the highlighted segment to drive the tooltip\n * content.\n */\n return initialHighlightedCategoryId && highlightedCategory ? (\n <StackedChartSegmentTooltip\n hideDelay={0}\n trigger={content}\n virtualElement={highlightedSegmentRef}\n {...highlightedCategory}\n />\n ) : (\n content\n );\n};\n"],"names":["createContext","useState","useEffect","jsx","useContext","ThemeChangedEvent","getStyles","getDesignTokens","css","flip","shift","offset","arrow","forwardRef","useRef","useId","useFloating","autoUpdate","useLayoutEffect","useInteractions","useDismiss","useHover","safePolygon","useFocus","useRole","useTransitionStyles","useCallback","jsxs","Fragment","cloneElement","FloatingPortal","FloatingArrow","Icon","cssVariables","cx","GlobalCSSVariables","keyframes","clsx","React","defaultContentFormatter"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,gBAAA,GAAmBA,oBAAgD,MAAS,CAAA;AAM3E,MAAM,oBAAsD,CAAC;AAAA,EAClE,QAAA;AAAA,EACA,gBAAA,GAAmB;AACrB,CAAA,KAAM;AACJ,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAIC,eAAyB,gBAAgB,CAAA;AAE3E,EAAAC,eAAA,CAAU,MAAM;AACd,IAAA,QAAA,CAAS,eAAA,CAAgB,YAAA,CAAa,iBAAA,EAAmB,SAAS,CAAA;AAAA,EACpE,CAAA,EAAG,CAAC,SAAS,CAAC,CAAA;AAEd,EAAA,uBACEC,cAAA,CAAC,iBAAiB,QAAA,EAAjB,EAA0B,OAAO,EAAE,SAAA,EAAW,YAAA,EAAa,EACzD,QAAA,EACH,CAAA;AAEJ;AAWO,MAAM,eAAe,MAAM;AAChC,EAAA,MAAM,OAAA,GAAUC,iBAAW,gBAAgB,CAAA;AAE3C,EAAA,IAAI,YAAY,MAAA,EAAW;AACzB,IAAA,MAAM,IAAI,MAAM,sDAAsD,CAAA;AAAA,EACxE;AAEA,EAAA,OAAO,OAAA;AACT;;ACnDA,MAAM,iBAAA,GAAoB,CAAC,OAAA,KAAqC;AAC9D,EAAA,OAAO,UAAU,OAAA,GAAU,MAAA;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