@grafana/components 0.0.16 → 0.0.18

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.
Files changed (29) hide show
  1. package/dist/cjs/index.cjs +94 -24
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs/index.d.cts +31 -6
  4. package/dist/esm/components/ComparisonBadge/ComparisonBadge.styles.js +2 -2
  5. package/dist/esm/components/ComparisonTooltip/ComparisonTooltip.styles.js +2 -2
  6. package/dist/esm/components/GenericSkeleton/GenericSkeleton.styles.js +3 -3
  7. package/dist/esm/components/GenericSkeleton/GenericSkeleton.styles.js.map +1 -1
  8. package/dist/esm/components/Popover/Popover.styles.js +2 -2
  9. package/dist/esm/components/StackedChart/StackedChart.js +8 -2
  10. package/dist/esm/components/StackedChart/StackedChart.js.map +1 -1
  11. package/dist/esm/components/StackedChart/StackedChart.styles.js +2 -2
  12. package/dist/esm/components/StackedChart/common.js +4 -0
  13. package/dist/esm/components/StackedChart/common.js.map +1 -0
  14. package/dist/esm/components/StackedChartNoData/StackedChartNoData.js +27 -0
  15. package/dist/esm/components/StackedChartNoData/StackedChartNoData.js.map +1 -0
  16. package/dist/esm/components/StackedChartNoData/StackedChartNoData.styles.js +44 -0
  17. package/dist/esm/components/StackedChartNoData/StackedChartNoData.styles.js.map +1 -0
  18. package/dist/esm/components/StackedChartSegment/StackedChartSegment.styles.js +2 -2
  19. package/dist/esm/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.js +6 -3
  20. package/dist/esm/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.js.map +1 -1
  21. package/dist/esm/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.styles.js +2 -2
  22. package/dist/esm/components/StackedChartSkeleton/StackedChartSkeleton.js +4 -1
  23. package/dist/esm/components/StackedChartSkeleton/StackedChartSkeleton.js.map +1 -1
  24. package/dist/esm/components/StackedChartSkeleton/StackedChartSkeleton.styles.js +2 -2
  25. package/dist/esm/components/StackedChartSkeleton/StackedChartSkeleton.styles.js.map +1 -1
  26. package/dist/esm/index.d.ts +31 -6
  27. package/dist/esm/index.js +1 -0
  28. package/dist/esm/index.js.map +1 -1
  29. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"StackedChart.js","sources":["../../../../src/components/StackedChart/StackedChart.tsx"],"sourcesContent":["import { useMemo, 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/StackedChartSkeleton';\n\nexport interface StackedChartCategory {\n title: string;\n value: number;\n}\n\nexport type StackedChartCategories<T extends string> = Record<T, StackedChartCategory>;\n\nexport type StackedChartSortOrder = 'largest-first' | 'smallest-first' | 'natural';\n\ntype MouseEventHandler = ({\n categoryId,\n ref,\n}: {\n categoryId: string;\n ref: React.ForwardedRef<HTMLDivElement>;\n}) => void;\n\nexport interface CommonStackedChartProps<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 * Event handler for whenever a segment gets a mouseover event\n */\n onSegmentMouseOver?: MouseEventHandler;\n\n /**\n * Event handler for whenever a segment gets a mouseout event\n */\n onSegmentMouseOut?: MouseEventHandler;\n}\n\nexport interface SkeletonStackedChartProps<T extends string> extends CommonStackedChartProps<T> {\n isSkeleton: true;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories?: StackedChartCategories<T>;\n}\n\nexport interface LoadedStackedChartProps<T extends string> extends CommonStackedChartProps<T> {\n isSkeleton?: false;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories: StackedChartCategories<T>;\n}\n\nexport type StackedChartProps<T extends string> =\n | SkeletonStackedChartProps<T>\n | LoadedStackedChartProps<T>;\n\nexport const StackedChart = <T extends string>({\n categories: _categories,\n highlightedCategoryId: initialHighlightedCategoryId,\n isSkeleton = false,\n isDimmed = false,\n sortOrder = 'largest-first',\n height = 24,\n onSegmentMouseOver,\n onSegmentMouseOut,\n}: StackedChartProps<T>) => {\n if (isSkeleton || !_categories) return <StackedChartSkeleton height={height} />;\n\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 /**\n * Sort categories according to the sortOrder prop\n */\n const categories = useMemo(() => {\n switch (sortOrder) {\n case 'largest-first':\n case 'smallest-first':\n default:\n return _categories;\n }\n }, [_categories, sortOrder]);\n\n /**\n * Determine what the total value is for all category valeus combined\n */\n const total = useMemo(() => {\n const roundedTotal = Math.round(\n Object.entries<StackedChartCategory>(categories).reduce(\n (sum, [, category]) => sum + category.value,\n 0,\n ),\n );\n\n if (roundedTotal > 100) {\n console.error(`StackedChartCategories have a total value exceeding 100% (${roundedTotal})`);\n } else {\n console.info(`Total of all category value values is ${roundedTotal}`);\n }\n\n return roundedTotal;\n }, [categories]);\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 initialHighlightedCategoryId\n ? {\n ...categories[initialHighlightedCategoryId],\n index: Object.keys(categories).indexOf(initialHighlightedCategoryId),\n }\n : undefined;\n\n const content = (\n <div className={styles.container}>\n {Object.entries<StackedChartCategory>(categories).map(\n ([categoryId, category], categoryIndex) => {\n const ref = useRef<HTMLDivElement>(null);\n if (categoryId === initialHighlightedCategoryId) 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 &&\n highlightedCategoryId === categoryId &&\n !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 segment = (\n <StackedChartSegment\n key={categoryId}\n ref={ref}\n categoryId={categoryId}\n index={categoryIndex}\n title={category.title}\n value={category.value}\n total={total}\n state={segmentState}\n onMouseOver={onMouseOver}\n onMouseOut={onMouseOut}\n />\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 segment\n ) : (\n <StackedChartSegmentTooltip\n key={categoryId}\n title={category.title}\n value={category.value}\n index={categoryIndex}\n hideDelay={0}\n trigger={segment}\n />\n );\n },\n )}\n </div>\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":[],"mappings":";;;;;;;AAgFO,MAAM,eAAe,CAAmB;AAAA,EAC7C,UAAA,EAAY,WAAA;AAAA,EACZ,qBAAA,EAAuB,4BAAA;AAAA,EACvB,UAAA,GAAa,KAAA;AAAA,EACb,QAAA,GAAW,KAAA;AAAA,EACX,SAAA,GAAY,eAAA;AAAA,EACZ,MAAA,GAAS,EAAA;AAAA,EACT,kBAAA;AAAA,EACA;AACF,CAAA,KAA4B;AAC1B,EAAA,IAAI,cAAc,CAAC,WAAA,EAAa,uBAAO,GAAA,CAAC,wBAAqB,MAAA,EAAgB,CAAA;AAE7E,EAAA,IAAI,qBAAA,GAAwB,OAAuB,IAAI,CAAA;AACvD,EAAA,MAAM,CAAC,qBAA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AAA,mBACrC,GAAA;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":"StackedChart.js","sources":["../../../../src/components/StackedChart/StackedChart.tsx"],"sourcesContent":["import { useMemo, 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\nexport type StackedChartCategories<T extends string> = Record<T, StackedChartCategory>;\n\nexport type StackedChartSortOrder = 'largest-first' | 'smallest-first' | 'natural';\n\ntype MouseEventHandler = ({\n categoryId,\n ref,\n}: {\n categoryId: string;\n ref: React.ForwardedRef<HTMLDivElement>;\n}) => void;\n\nexport interface CommonStackedChartProps<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 * Event handler for whenever a segment gets a mouseover event\n */\n onSegmentMouseOver?: MouseEventHandler;\n\n /**\n * Event handler for whenever a segment gets a mouseout event\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\nexport interface SkeletonStackedChartProps<T extends string> extends CommonStackedChartProps<T> {\n isSkeleton: true;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories?: StackedChartCategories<T>;\n}\n\nexport interface LoadedStackedChartProps<T extends string> extends CommonStackedChartProps<T> {\n isSkeleton?: false;\n\n /**\n * Array of StackedChartCategory to build the chart from\n */\n categories: StackedChartCategories<T>;\n}\n\nexport type StackedChartProps<T extends string> =\n | SkeletonStackedChartProps<T>\n | LoadedStackedChartProps<T>;\n\nexport const StackedChart = <T extends string>({\n categories: _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 if (isSkeleton || !_categories) return <StackedChartSkeleton height={height} />;\n\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 /**\n * Sort categories according to the sortOrder prop\n */\n const categories = useMemo(() => {\n switch (sortOrder) {\n case 'largest-first':\n case 'smallest-first':\n default:\n return _categories;\n }\n }, [_categories, sortOrder]);\n\n /**\n * Determine what the total value is for all category valeus combined\n */\n const total = useMemo(() => {\n const roundedTotal = Math.round(\n Object.entries<StackedChartCategory>(categories).reduce(\n (sum, [, category]) => sum + category.value,\n 0,\n ),\n );\n\n if (roundedTotal > 100) {\n console.error(`StackedChartCategories have a total value exceeding 100% (${roundedTotal})`);\n } else {\n console.info(`Total of all category value values is ${roundedTotal}`);\n }\n\n return roundedTotal;\n }, [categories]);\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 /**\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 Object.keys(categories).indexOf(initialHighlightedCategoryId) === -1\n )\n return (\n <StackedChartNoData height={height} period={period} formatMessage={formatNoDataMessage} />\n );\n\n const highlightedCategory: (StackedChartCategory & { index: number }) | undefined =\n initialHighlightedCategoryId\n ? {\n ...categories[initialHighlightedCategoryId],\n index: Object.keys(categories).indexOf(initialHighlightedCategoryId),\n }\n : undefined;\n\n const content = (\n <div className={styles.container}>\n {Object.entries<StackedChartCategory>(categories).map(\n ([categoryId, category], categoryIndex) => {\n const ref = useRef<HTMLDivElement>(null);\n if (categoryId === initialHighlightedCategoryId) 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 &&\n highlightedCategoryId === categoryId &&\n !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 segment = (\n <StackedChartSegment\n key={categoryId}\n ref={ref}\n categoryId={categoryId}\n index={categoryIndex}\n title={category.title}\n value={category.value}\n total={total}\n state={segmentState}\n onMouseOver={onMouseOver}\n onMouseOut={onMouseOut}\n />\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 segment\n ) : (\n <StackedChartSegmentTooltip\n key={categoryId}\n title={category.title}\n value={category.value}\n index={categoryIndex}\n hideDelay={0}\n trigger={segment}\n />\n );\n },\n )}\n </div>\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":[],"mappings":";;;;;;;;;AA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A,OAAO,SAAA;AAAA;AACX,MACF,CAAA,GAAG;AAEH,MAAA,MAAM,OAAA,mBACJ,GAAA;AAAA,QAAC,mBAAA;AAAA,QAAA;AAAA,UAEC,GAAA;AAAA,UACA,UAAA;AAAA,UACA,KAAA,EAAO,aAAA;AAAA,UACP,OAAO,QAAA,CAAS,KAAA;AAAA,UAChB,OAAO,QAAA,CAAS,KAAA;AAAA,UAChB,KAAA;AAAA,UACA,KAAA,EAAO,YAAA;AAAA,UACP,WAAA;AAAA,UACA;AAAA,SAAA;AAAA,QATK;AAAA,OAUP;AAOF,MAAA,OAAO,+BACL,OAAA,mBAEA,GAAA;AAAA,QAAC,0BAAA;AAAA,QAAA;AAAA,UAEC,OAAO,QAAA,CAAS,KAAA;AAAA,UAChB,OAAO,QAAA,CAAS,KAAA;AAAA,UAChB,KAAA,EAAO,aAAA;AAAA,UACP,SAAA,EAAW,CAAA;AAAA,UACX,OAAA,EAAS;AAAA,SAAA;AAAA,QALJ;AAAA,OAMP;AAAA,IAEJ;AAAA,GACF,EACF,CAAA;AAQF,EAAA,OAAO,gCAAgC,mBAAA,mBACrC,GAAA;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,7 +1,7 @@
1
1
  import { css } from '@emotion/css';
2
2
  import { getDesignTokens } from '@grafana/design-tokens';
3
3
 
4
- const getStyles$2 = ({ height }) => {
4
+ const getStyles$3 = ({ height }) => {
5
5
  const {
6
6
  primitives: { spacing }
7
7
  } = getDesignTokens({ valueType: "css" });
@@ -15,5 +15,5 @@ const getStyles$2 = ({ height }) => {
15
15
  };
16
16
  };
17
17
 
18
- export { getStyles$2 as getStyles };
18
+ export { getStyles$3 as getStyles };
19
19
  //# sourceMappingURL=StackedChart.styles.js.map
@@ -0,0 +1,4 @@
1
+ const STACKED_CHART_DEFAULT_HEIGHT = 24;
2
+
3
+ export { STACKED_CHART_DEFAULT_HEIGHT };
4
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sources":["../../../../src/components/StackedChart/common.ts"],"sourcesContent":["export const STACKED_CHART_DEFAULT_HEIGHT = 24;\n"],"names":[],"mappings":"AAAO,MAAM,4BAAA,GAA+B;;;;"}
@@ -0,0 +1,27 @@
1
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
+ import { GlobalCSSVariables } from '@grafana/design-tokens';
3
+ import { Icon } from '@grafana/ui';
4
+ import { getStyles, cssVariables } from './StackedChartNoData.styles.js';
5
+ import { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common.js';
6
+
7
+ const defaultContentFormatter = ({ period, className }) => /* @__PURE__ */ jsxs(Fragment, { children: [
8
+ "No data for ",
9
+ /* @__PURE__ */ jsx("span", { className, children: period })
10
+ ] });
11
+ const StackedChartNoData = ({
12
+ height = STACKED_CHART_DEFAULT_HEIGHT,
13
+ period = "current",
14
+ formatMessage = defaultContentFormatter
15
+ }) => {
16
+ const styles = getStyles(height);
17
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
18
+ /* @__PURE__ */ jsx(GlobalCSSVariables, { variables: cssVariables(), defaultColorMode: null }),
19
+ /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
20
+ /* @__PURE__ */ jsx(Icon, { name: "exclamation-triangle", size: "sm" }),
21
+ /* @__PURE__ */ jsx("span", { children: formatMessage({ period, className: styles.label }) })
22
+ ] })
23
+ ] });
24
+ };
25
+
26
+ export { StackedChartNoData };
27
+ //# sourceMappingURL=StackedChartNoData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedChartNoData.js","sources":["../../../../src/components/StackedChartNoData/StackedChartNoData.tsx"],"sourcesContent":["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"],"names":[],"mappings":";;;;;;AAiCA,MAAM,0BAA8D,CAAC,EAAE,MAAA,EAAQ,SAAA,uBAC7E,IAAA,CAAA,QAAA,EAAA,EAAE,QAAA,EAAA;AAAA,EAAA,cAAA;AAAA,kBACY,GAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAuB,QAAA,EAAA,MAAA,EAAO;AAAA,CAAA,EAClD,CAAA;AAGK,MAAM,qBAAqB,CAAC;AAAA,EACjC,MAAA,GAAS,4BAAA;AAAA,EACT,MAAA,GAAS,SAAA;AAAA,EACT,aAAA,GAAgB;AAClB,CAAA,KAA+B;AAC7B,EAAA,MAAM,MAAA,GAAS,UAAU,MAAM,CAAA;AAE/B,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,kBAAA,EAAA,EAAmB,SAAA,EAAW,YAAA,EAAa,EAAG,kBAAkB,IAAA,EAAM,CAAA;AAAA,oBACvE,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SAAA,EACrB,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,IAAA,EAAK,sBAAA,EAAuB,IAAA,EAAK,IAAA,EAAK,CAAA;AAAA,sBAC5C,GAAA,CAAC,UAAM,QAAA,EAAA,aAAA,CAAc,EAAE,QAAQ,SAAA,EAAW,MAAA,CAAO,KAAA,EAAO,CAAA,EAAE;AAAA,KAAA,EAC5D;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
@@ -0,0 +1,44 @@
1
+ import { css } from '@emotion/css';
2
+ import { getDesignTokens } from '@grafana/design-tokens';
3
+
4
+ const cssVariables = () => {
5
+ const { legacy } = getDesignTokens({ valueType: "css" });
6
+ return {
7
+ dark: {
8
+ "stacked-chart-no-data-background-color": legacy.palette.blackBaseOpacity15
9
+ },
10
+ light: {
11
+ "stacked-chart-no-data-background-color": legacy.palette.blackBaseOpacity4
12
+ }
13
+ };
14
+ };
15
+ const getStyles = (height) => {
16
+ const {
17
+ legacy,
18
+ primitives: { typography, spacing }
19
+ } = getDesignTokens({ valueType: "css" });
20
+ return {
21
+ container: css({
22
+ display: "flex",
23
+ flex: 1,
24
+ width: "100%",
25
+ height: `${height}px`,
26
+ alignItems: "center",
27
+ justifyContent: "center",
28
+ gap: spacing.sm,
29
+ borderRadius: legacy.borderRadius.md,
30
+ color: legacy.colors.text.secondary,
31
+ fontFamily: typography.fontFamily.ui,
32
+ fontSize: typography.fontSize.ui.sm,
33
+ paddingTop: spacing.xxs,
34
+ background: "var(--stacked-chart-no-data-background-color)"
35
+ }),
36
+ label: css({
37
+ fontWeight: typography.fontWeight.medium,
38
+ textTransform: "lowercase"
39
+ })
40
+ };
41
+ };
42
+
43
+ export { cssVariables, getStyles };
44
+ //# sourceMappingURL=StackedChartNoData.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StackedChartNoData.styles.js","sources":["../../../../src/components/StackedChartNoData/StackedChartNoData.styles.ts"],"sourcesContent":["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"],"names":[],"mappings":";;;AAGO,MAAM,eAAe,MAAoB;AAC9C,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,gBAAgB,EAAE,SAAA,EAAW,OAAO,CAAA;AAEvD,EAAA,OAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,wCAAA,EAA0C,OAAO,OAAA,CAAQ;AAAA,KAC3D;AAAA,IACA,KAAA,EAAO;AAAA,MACL,wCAAA,EAA0C,OAAO,OAAA,CAAQ;AAAA;AAC3D,GACF;AACF;AAEO,MAAM,SAAA,GAAY,CAAC,MAAA,KAAmB;AAC3C,EAAA,MAAM;AAAA,IACJ,MAAA;AAAA,IACA,UAAA,EAAY,EAAE,UAAA,EAAY,OAAA;AAAQ,GACpC,GAAI,eAAA,CAAgB,EAAE,SAAA,EAAW,OAAO,CAAA;AAExC,EAAA,OAAO;AAAA,IACL,WAAW,GAAA,CAAI;AAAA,MACb,OAAA,EAAS,MAAA;AAAA,MACT,IAAA,EAAM,CAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,MAAA,EAAQ,GAAG,MAAM,CAAA,EAAA,CAAA;AAAA,MACjB,UAAA,EAAY,QAAA;AAAA,MACZ,cAAA,EAAgB,QAAA;AAAA,MAChB,KAAK,OAAA,CAAQ,EAAA;AAAA,MACb,YAAA,EAAc,OAAO,YAAA,CAAa,EAAA;AAAA,MAClC,KAAA,EAAO,MAAA,CAAO,MAAA,CAAO,IAAA,CAAK,SAAA;AAAA,MAC1B,UAAA,EAAY,WAAW,UAAA,CAAW,EAAA;AAAA,MAClC,QAAA,EAAU,UAAA,CAAW,QAAA,CAAS,EAAA,CAAG,EAAA;AAAA,MACjC,YAAY,OAAA,CAAQ,GAAA;AAAA,MACpB,UAAA,EAAY;AAAA,KACb,CAAA;AAAA,IACD,OAAO,GAAA,CAAI;AAAA,MACT,UAAA,EAAY,WAAW,UAAA,CAAW,MAAA;AAAA,MAClC,aAAA,EAAe;AAAA,KAChB;AAAA,GACH;AACF;;;;"}
@@ -18,7 +18,7 @@ const getSegmentStyles = () => css({
18
18
  display: "flex",
19
19
  height: "100%"
20
20
  });
21
- const getStyles$3 = ({
21
+ const getStyles$4 = ({
22
22
  index,
23
23
  state = "default"
24
24
  }) => {
@@ -41,5 +41,5 @@ const getStyles$3 = ({
41
41
  });
42
42
  };
43
43
 
44
- export { diagonalStripedBackground, getSegmentStyles, getStyles$3 as getStyles };
44
+ export { diagonalStripedBackground, getSegmentStyles, getStyles$4 as getStyles };
45
45
  //# sourceMappingURL=StackedChartSegment.styles.js.map
@@ -2,9 +2,12 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { Popover } from '../Popover/Popover.js';
3
3
  import { getStyles } from './StackedChartSegmentTooltip.styles.js';
4
4
 
5
- const defaultContentFormatter = ({ value, colorClassName }) => /* @__PURE__ */ jsxs(Fragment, { children: [
5
+ const defaultContentFormatter$1 = ({
6
+ value,
7
+ colorClassName
8
+ }) => /* @__PURE__ */ jsxs(Fragment, { children: [
6
9
  /* @__PURE__ */ jsxs("span", { className: colorClassName, children: [
7
- value,
10
+ value.toFixed(1),
8
11
  "%"
9
12
  ] }),
10
13
  " of total usage"
@@ -17,7 +20,7 @@ const StackedChartSegmentTooltip = ({
17
20
  value,
18
21
  total = 100,
19
22
  index,
20
- formatContent = defaultContentFormatter,
23
+ formatContent = defaultContentFormatter$1,
21
24
  virtualElement
22
25
  }) => {
23
26
  const styles = getStyles(index);
@@ -1 +1 @@
1
- {"version":3,"file":"StackedChartSegmentTooltip.js","sources":["../../../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.tsx"],"sourcesContent":["import { StackedChartSegmentProps } from '../StackedChartSegment/types';\nimport { Popover, PopoverProps } from '../Popover';\nimport { getStyles } from './StackedChartSegmentTooltip.styles';\n\nexport type ContentFormatter = (\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?: ContentFormatter;\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: ContentFormatter = ({ value, colorClassName }) => (\n <>\n <span className={colorClassName}>{value}%</span> of total usage\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"],"names":[],"mappings":";;;;AAsBA,MAAM,0BAA4C,CAAC,EAAE,KAAA,EAAO,cAAA,uBAC1D,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,WAAW,cAAA,EAAiB,QAAA,EAAA;AAAA,IAAA,KAAA;AAAA,IAAM;AAAA,GAAA,EAAC,CAAA;AAAA,EAAO;AAAA,CAAA,EAClD,CAAA;AAGK,MAAM,6BAA6B,CAAmB;AAAA,EAC3D,OAAA;AAAA,EACA,SAAA,GAAY,KAAA;AAAA,EACZ,SAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA,GAAQ,GAAA;AAAA,EACR,KAAA;AAAA,EACA,aAAA,GAAgB,uBAAA;AAAA,EAChB;AACF,CAAA,KAA0C;AACxC,EAAA,MAAM,MAAA,GAAS,UAAU,KAAK,CAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SACrB,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,OAAA,EACrB,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,OAAA,EACrB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,KAAA,EAAQ,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,wBACrC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,OACpB,QAAA,EAAA,aAAA,CAAc,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,cAAA,EAAgB,MAAA,CAAO,KAAA,EAAO,CAAA,EACtE;AAAA,OAAA,EACF,GACF,CAAA,EACF;AAAA;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"StackedChartSegmentTooltip.js","sources":["../../../../src/components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.tsx"],"sourcesContent":["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 <>\n <span className={colorClassName}>{value.toFixed(1)}%</span> of total usage\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"],"names":["defaultContentFormatter"],"mappings":";;;;AAsBA,MAAMA,4BAA+D,CAAC;AAAA,EACpE,KAAA;AAAA,EACA;AACF,CAAA,qBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,kBAAA,IAAA,CAAC,MAAA,EAAA,EAAK,WAAW,cAAA,EAAiB,QAAA,EAAA;AAAA,IAAA,KAAA,CAAM,QAAQ,CAAC,CAAA;AAAA,IAAE;AAAA,GAAA,EAAC,CAAA;AAAA,EAAO;AAAA,CAAA,EAC7D,CAAA;AAGK,MAAM,6BAA6B,CAAmB;AAAA,EAC3D,OAAA;AAAA,EACA,SAAA,GAAY,KAAA;AAAA,EACZ,SAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA;AAAA,EACA,KAAA,GAAQ,GAAA;AAAA,EACR,KAAA;AAAA,EACA,aAAA,GAAgBA,yBAAA;AAAA,EAChB;AACF,CAAA,KAA0C;AACxC,EAAA,MAAM,MAAA,GAAS,UAAU,KAAK,CAAA;AAE9B,EAAA,uBACE,GAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACC,OAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA;AAAA,MACA,cAAA;AAAA,MAEA,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,SACrB,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,OAAA,EACrB,QAAA,kBAAA,IAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAO,OAAA,EACrB,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,KAAA,EAAQ,QAAA,EAAA,KAAA,EAAM,CAAA;AAAA,wBACrC,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,OACpB,QAAA,EAAA,aAAA,CAAc,EAAE,KAAA,EAAO,KAAA,EAAO,KAAA,EAAO,cAAA,EAAgB,MAAA,CAAO,KAAA,EAAO,CAAA,EACtE;AAAA,OAAA,EACF,GACF,CAAA,EACF;AAAA;AAAA,GACF;AAEJ;;;;"}
@@ -2,7 +2,7 @@ import { css } from '@emotion/css';
2
2
  import { getDesignTokens } from '@grafana/design-tokens';
3
3
  import { filterHueRotate } from '../StackedChart/shared.styles.js';
4
4
 
5
- const getStyles$1 = (index) => {
5
+ const getStyles$2 = (index) => {
6
6
  const {
7
7
  legacy,
8
8
  primitives: { spacing, typography }
@@ -49,5 +49,5 @@ const getStyles$1 = (index) => {
49
49
  };
50
50
  };
51
51
 
52
- export { getStyles$1 as getStyles };
52
+ export { getStyles$2 as getStyles };
53
53
  //# sourceMappingURL=StackedChartSegmentTooltip.styles.js.map
@@ -1,8 +1,11 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { getStyles } from './StackedChartSkeleton.styles.js';
3
3
  import { GenericSkeleton } from '../GenericSkeleton/GenericSkeleton.js';
4
+ import { STACKED_CHART_DEFAULT_HEIGHT } from '../StackedChart/common.js';
4
5
 
5
- const StackedChartSkeleton = ({ height = 24 }) => {
6
+ const StackedChartSkeleton = ({
7
+ height = STACKED_CHART_DEFAULT_HEIGHT
8
+ }) => {
6
9
  const styles = getStyles(height);
7
10
  return /* @__PURE__ */ jsx("div", { className: styles, children: /* @__PURE__ */ jsx(GenericSkeleton, {}) });
8
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"StackedChartSkeleton.js","sources":["../../../../src/components/StackedChartSkeleton/StackedChartSkeleton.tsx"],"sourcesContent":["import { getStyles } from './StackedChartSkeleton.styles';\nimport { GenericSkeleton } from '../GenericSkeleton';\n\nexport interface StackedChartSkeletonProps {\n /**\n * Height to render the stacked chart skeleton, in pixels\n */\n height?: number;\n}\n\nexport const StackedChartSkeleton = ({ height = 24 }: StackedChartSkeletonProps) => {\n const styles = getStyles(height);\n\n return (\n <div className={styles}>\n <GenericSkeleton />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AAUO,MAAM,oBAAA,GAAuB,CAAC,EAAE,MAAA,GAAS,IAAG,KAAiC;AAClF,EAAA,MAAM,MAAA,GAAS,UAAU,MAAM,CAAA;AAE/B,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,EACd,QAAA,kBAAA,GAAA,CAAC,mBAAgB,CAAA,EACnB,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"StackedChartSkeleton.js","sources":["../../../../src/components/StackedChartSkeleton/StackedChartSkeleton.tsx"],"sourcesContent":["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"],"names":[],"mappings":";;;;;AAWO,MAAM,uBAAuB,CAAC;AAAA,EACnC,MAAA,GAAS;AACX,CAAA,KAAiC;AAC/B,EAAA,MAAM,MAAA,GAAS,UAAU,MAAM,CAAA;AAE/B,EAAA,2BACG,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,EACd,QAAA,kBAAA,GAAA,CAAC,mBAAgB,CAAA,EACnB,CAAA;AAEJ;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { css } from '@emotion/css';
2
2
 
3
- const getStyles = (height) => {
3
+ const getStyles$1 = (height) => {
4
4
  return css({
5
5
  width: "100%",
6
6
  height: `${height}px`,
@@ -9,5 +9,5 @@ const getStyles = (height) => {
9
9
  });
10
10
  };
11
11
 
12
- export { getStyles };
12
+ export { getStyles$1 as getStyles };
13
13
  //# sourceMappingURL=StackedChartSkeleton.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StackedChartSkeleton.styles.js","sources":["../../../../src/components/StackedChartSkeleton/StackedChartSkeleton.styles.ts"],"sourcesContent":["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"],"names":[],"mappings":";;AAEO,MAAM,SAAA,GAAY,CAAC,MAAA,KAAmB;AAC3C,EAAA,OAAO,GAAA,CAAI;AAAA,IACT,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,GAAG,MAAM,CAAA,EAAA,CAAA;AAAA,IACjB,YAAA,EAAc,KAAA;AAAA,IACd,QAAA,EAAU;AAAA,GACX,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"StackedChartSkeleton.styles.js","sources":["../../../../src/components/StackedChartSkeleton/StackedChartSkeleton.styles.ts"],"sourcesContent":["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"],"names":["getStyles"],"mappings":";;AAEO,MAAMA,WAAA,GAAY,CAAC,MAAA,KAAmB;AAC3C,EAAA,OAAO,GAAA,CAAI;AAAA,IACT,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,GAAG,MAAM,CAAA,EAAA,CAAA;AAAA,IACjB,YAAA,EAAc,KAAA;AAAA,IACd,QAAA,EAAU;AAAA,GACX,CAAA;AACH;;;;"}
@@ -117,6 +117,26 @@ interface GenericSkeletonProps {
117
117
  }
118
118
  declare const GenericSkeleton: ({ animationDuration }: GenericSkeletonProps) => react_jsx_runtime.JSX.Element;
119
119
 
120
+ type StackedChartNoDataMessageFormatter = (args: {
121
+ period: string;
122
+ className: string;
123
+ }) => React.ReactElement;
124
+ interface StackedChartNoDataProps {
125
+ /**
126
+ * Height to render the stacked chart skeleton, in pixels
127
+ */
128
+ height?: number;
129
+ /**
130
+ * Period for which this chart has no data, as a preformatted string
131
+ */
132
+ period?: string;
133
+ /**
134
+ * Optional formatter for content message
135
+ */
136
+ formatMessage?: StackedChartNoDataMessageFormatter;
137
+ }
138
+ declare const StackedChartNoData: ({ height, period, formatMessage, }: StackedChartNoDataProps) => react_jsx_runtime.JSX.Element;
139
+
120
140
  interface StackedChartCategory {
121
141
  title: string;
122
142
  value: number;
@@ -154,6 +174,11 @@ interface CommonStackedChartProps<T extends string> {
154
174
  * Event handler for whenever a segment gets a mouseout event
155
175
  */
156
176
  onSegmentMouseOut?: MouseEventHandler;
177
+ /**
178
+ * String representing the period for which the chart is displaying data
179
+ */
180
+ period?: string;
181
+ formatNoDataMessage?: StackedChartNoDataProps['formatMessage'];
157
182
  }
158
183
  interface SkeletonStackedChartProps<T extends string> extends CommonStackedChartProps<T> {
159
184
  isSkeleton: true;
@@ -170,7 +195,7 @@ interface LoadedStackedChartProps<T extends string> extends CommonStackedChartPr
170
195
  categories: StackedChartCategories<T>;
171
196
  }
172
197
  type StackedChartProps<T extends string> = SkeletonStackedChartProps<T> | LoadedStackedChartProps<T>;
173
- declare const StackedChart: <T extends string>({ categories: _categories, highlightedCategoryId: initialHighlightedCategoryId, isSkeleton, isDimmed, sortOrder, height, onSegmentMouseOver, onSegmentMouseOut, }: StackedChartProps<T>) => react_jsx_runtime.JSX.Element;
198
+ declare const StackedChart: <T extends string>({ categories: _categories, highlightedCategoryId: initialHighlightedCategoryId, isSkeleton, isDimmed, sortOrder, height, onSegmentMouseOver, onSegmentMouseOut, period, formatNoDataMessage, }: StackedChartProps<T>) => react_jsx_runtime.JSX.Element;
174
199
 
175
200
  /**
176
201
  * A segment can be in one of four states:
@@ -232,11 +257,11 @@ interface StackedChartSegmentProps<T extends string> {
232
257
 
233
258
  declare const StackedChartSegment: React__default.ForwardRefExoticComponent<StackedChartSegmentProps<string> & React__default.RefAttributes<HTMLDivElement>>;
234
259
 
235
- type ContentFormatter = (args: {
260
+ type StackedChartTooltipContentFormatter = (args: {
236
261
  colorClassName: string;
237
262
  } & Required<Pick<StackedChartSegmentProps<string>, 'value' | 'total' | 'index'>>) => React.ReactElement;
238
263
  interface StackedChartSegmentTooltipProps<T extends string> extends Pick<StackedChartSegmentProps<T>, 'title' | 'value' | 'total' | 'index'>, Omit<PopoverProps, 'children'> {
239
- formatContent?: ContentFormatter;
264
+ formatContent?: StackedChartTooltipContentFormatter;
240
265
  }
241
266
  declare const StackedChartSegmentTooltip: <T extends string>({ trigger, placement, hideDelay, title, value, total, index, formatContent, virtualElement, }: StackedChartSegmentTooltipProps<T>) => react_jsx_runtime.JSX.Element;
242
267
 
@@ -246,7 +271,7 @@ interface StackedChartSkeletonProps {
246
271
  */
247
272
  height?: number;
248
273
  }
249
- declare const StackedChartSkeleton: ({ height }: StackedChartSkeletonProps) => react_jsx_runtime.JSX.Element;
274
+ declare const StackedChartSkeleton: ({ height, }: StackedChartSkeletonProps) => react_jsx_runtime.JSX.Element;
250
275
 
251
276
  /**
252
277
  * Shared utility functions for handling comparison calculations across components
@@ -292,5 +317,5 @@ interface FormatNumberOptions {
292
317
  */
293
318
  declare const formatNumber: (value: number | string | "loading", options?: FormatNumberOptions) => string;
294
319
 
295
- export { ColorMode, ColorModeChangeHandler, ColorModeProvider, ComparisonBadge, ComparisonTooltip, GenericSkeleton, Popover, StackedChart, StackedChartSegment, StackedChartSegmentTooltip, StackedChartSkeleton, calculateComparison, formatNumber, useColorMode, useColorModeChange };
296
- export type { ColorModeChangeProps, ColorModeContextType, ColorModeProviderProps, ColorModeWrapper, CommonStackedChartProps, ComparisonResult, ComparisonTooltipProps, ContentFormatter, FormatNumberOptions, GenericSkeletonProps, LoadedStackedChartProps, PopoverProps, SkeletonStackedChartProps, StackedChartCategories, StackedChartCategory, StackedChartProps, StackedChartSegmentTooltipProps, StackedChartSkeletonProps, StackedChartSortOrder };
320
+ export { ColorMode, ColorModeChangeHandler, ColorModeProvider, ComparisonBadge, ComparisonTooltip, GenericSkeleton, Popover, StackedChart, StackedChartNoData, StackedChartSegment, StackedChartSegmentTooltip, StackedChartSkeleton, calculateComparison, formatNumber, useColorMode, useColorModeChange };
321
+ export type { ColorModeChangeProps, ColorModeContextType, ColorModeProviderProps, ColorModeWrapper, CommonStackedChartProps, ComparisonResult, ComparisonTooltipProps, FormatNumberOptions, GenericSkeletonProps, LoadedStackedChartProps, PopoverProps, SkeletonStackedChartProps, StackedChartCategories, StackedChartCategory, StackedChartNoDataMessageFormatter, StackedChartNoDataProps, StackedChartProps, StackedChartSegmentTooltipProps, StackedChartSkeletonProps, StackedChartSortOrder, StackedChartTooltipContentFormatter };
package/dist/esm/index.js CHANGED
@@ -6,6 +6,7 @@ export { ComparisonTooltip } from './components/ComparisonTooltip/ComparisonTool
6
6
  export { GenericSkeleton } from './components/GenericSkeleton/GenericSkeleton.js';
7
7
  export { Popover } from './components/Popover/Popover.js';
8
8
  export { StackedChart } from './components/StackedChart/StackedChart.js';
9
+ export { StackedChartNoData } from './components/StackedChartNoData/StackedChartNoData.js';
9
10
  export { StackedChartSegment } from './components/StackedChartSegment/StackedChartSegment.js';
10
11
  export { StackedChartSegmentTooltip } from './components/StackedChartSegmentTooltip/StackedChartSegmentTooltip.js';
11
12
  export { StackedChartSkeleton } from './components/StackedChartSkeleton/StackedChartSkeleton.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Grafana Labs",
3
3
  "name": "@grafana/components",
4
4
  "license": "Apache-2.0",
5
- "version": "0.0.16",
5
+ "version": "0.0.18",
6
6
  "description": "Product Design Engineering Components for Grafana",
7
7
  "repository": {
8
8
  "type": "git",