diff --git a/hexawebshare/src/components/admin/dashboard/ChartPie.stories.svelte b/hexawebshare/src/components/admin/dashboard/ChartPie.stories.svelte new file mode 100644 index 0000000..81787bd --- /dev/null +++ b/hexawebshare/src/components/admin/dashboard/ChartPie.stories.svelte @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hexawebshare/src/components/admin/dashboard/ChartPie.svelte b/hexawebshare/src/components/admin/dashboard/ChartPie.svelte index 315da07..08802df 100644 --- a/hexawebshare/src/components/admin/dashboard/ChartPie.svelte +++ b/hexawebshare/src/components/admin/dashboard/ChartPie.svelte @@ -2,3 +2,773 @@ SPDX-FileCopyrightText: 2025 hexaTune LLC SPDX-License-Identifier: MIT --> + + + +
+ +
+ {accessibleDescription} +
+ + {#if loading} + + + + {:else if error} + + + + {:else if !hasData} + + + + {:else} + +
+ +
+ + {#each processedData as slice, i} + {@const [sx, sy] = labelPos(slice)} + + + { + if (disabled) return; + onSliceClick?.({ label: slice.label, value: slice.value }, i); + onSelectedChange?.(i); + }} + onkeydown={(e) => { + if (disabled) return; + if (e.key === 'Enter' || e.key === ' ') { + e.preventDefault(); + onSliceClick?.({ label: slice.label, value: slice.value }, i); + onSelectedChange?.(i); + } + }} + onmouseenter={() => { + if (!disabled) onSliceHover?.({ label: slice.label, value: slice.value }, i); + }} + > + + {slice.label}: {formatValue(slice.value)} ({formatPercentage( + slice.percentage + )}) + + + {/each} + + {#if donut && centerTitle} + + + {/if} + {#if showLabels} + + + {/if} +
+ {#if showLegend && legendItemsWithColors.length > 0} + + +
+ {#each legendItemsWithColors as item} + {#if onSelectedChange} + + {:else} + +
+ + {#if !hideLegendLabels && item.label} + + {/if} + {#if showValues && item.value !== undefined} + + {/if} +
+ {/if} + {/each} +
+ {/if} +
+ {/if} +
diff --git a/hexawebshare/src/components/core/layout/Row.svelte b/hexawebshare/src/components/core/layout/Row.svelte index 54f06ba..a55543c 100644 --- a/hexawebshare/src/components/core/layout/Row.svelte +++ b/hexawebshare/src/components/core/layout/Row.svelte @@ -70,6 +70,10 @@ SPDX-License-Identifier: MIT * @default '' */ class?: string; + /** + * Inline styles for dynamic dimensions (e.g. min-height, width) + */ + style?: string; } let { @@ -85,6 +89,7 @@ SPDX-License-Identifier: MIT hideAbove, ariaLabel, class: className = '', + style, ...props }: Props = $props(); @@ -170,6 +175,7 @@ SPDX-License-Identifier: MIT class="{displayClass} {gapClass} {alignClass} {justifyClass} {wrapClass} {visibilityClasses} {layoutClasses} {className}" role="group" aria-label={ariaLabel} + {style} {...props} > {@render children?.()}