@schemavaults/ui 0.89.0 → 0.90.0
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/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/index.js.map +1 -1
- package/dist/components/ui/segmented-bar/index.d.ts +2 -0
- package/dist/components/ui/segmented-bar/index.js +2 -0
- package/dist/components/ui/segmented-bar/index.js.map +1 -0
- package/dist/components/ui/segmented-bar/segmented-bar.d.ts +121 -0
- package/dist/components/ui/segmented-bar/segmented-bar.js +154 -0
- package/dist/components/ui/segmented-bar/segmented-bar.js.map +1 -0
- package/package.json +1 -1
|
@@ -128,6 +128,8 @@ export * from "./gauge";
|
|
|
128
128
|
export type * from "./gauge";
|
|
129
129
|
export * from "./meter";
|
|
130
130
|
export type * from "./meter";
|
|
131
|
+
export * from "./segmented-bar";
|
|
132
|
+
export type * from "./segmented-bar";
|
|
131
133
|
export * from "./breadcrumb";
|
|
132
134
|
export type * from "./breadcrumb";
|
|
133
135
|
export * from "./pagination";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AAGzB,cAAc,uBAAuB,CAAC;AAGtC,cAAc,aAAa,CAAC;AAG5B,cAAc,eAAe,CAAC;AAG9B,cAAc,SAAS,CAAC;AAGxB,cAAc,WAAW,CAAC;AAG1B,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,mBAAmB,CAAC;AAGlC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,CAAC;AAGxB,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,kCAAkC,CAAC;AAGjD,cAAc,cAAc,CAAC;AAG7B,cAAc,SAAS,CAAC;AAGxB,cAAc,SAAS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,cAAc,aAAa,CAAC;AAG5B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,cAAc,aAAa,CAAC;AAG5B,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,aAAa,CAAC;AAG5B,cAAc,YAAY,CAAC;AAG3B,cAAc,aAAa,CAAC;AAG5B,cAAc,0BAA0B,CAAC;AAGzC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,qBAAqB,CAAC;AAGpC,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC;AAG9B,cAAc,qBAAqB,CAAC;AAGpC,cAAc,eAAe,CAAC;AAG9B,cAAc,QAAQ,CAAC;AAGvB,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,UAAU,CAAC;AAGzB,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/ui/segmented-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,YAAY,IAAI,OAAO,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import type { HTMLAttributes, KeyboardEvent, MouseEvent, ReactElement, ReactNode, Ref } from "react";
|
|
3
|
+
export declare const segmentedBarSizeIds: ["sm", "default", "lg", "xl"];
|
|
4
|
+
export type SegmentedBarSizeId = (typeof segmentedBarSizeIds)[number];
|
|
5
|
+
export declare const segmentedBarShapeIds: ["rounded", "pill", "square"];
|
|
6
|
+
export type SegmentedBarShapeId = (typeof segmentedBarShapeIds)[number];
|
|
7
|
+
/**
|
|
8
|
+
* Preset colours available for segments. Mirrors the palette used by
|
|
9
|
+
* `PieChart` so a `SegmentedBar` and a `PieChart` visualising the same data
|
|
10
|
+
* agree on which slice is which.
|
|
11
|
+
*/
|
|
12
|
+
export declare const segmentedBarSegmentColorIds: ["default", "primary", "positive", "warning", "destructive", "muted"];
|
|
13
|
+
export type SegmentedBarSegmentColorId = (typeof segmentedBarSegmentColorIds)[number];
|
|
14
|
+
export declare const segmentedBarTrackVariants: (props?: ({
|
|
15
|
+
size?: "sm" | "default" | "lg" | "xl" | null | undefined;
|
|
16
|
+
shape?: "square" | "rounded" | "pill" | null | undefined;
|
|
17
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
18
|
+
export interface SegmentedBarSegment {
|
|
19
|
+
/** Stable identifier for the segment. Used as React key and click payload. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Human-readable label used in the legend and as the segment's `aria-label`. */
|
|
22
|
+
label: string;
|
|
23
|
+
/** Non-negative numeric size. Non-positive values are skipped. */
|
|
24
|
+
value: number;
|
|
25
|
+
/** Preset colour token from the shared palette. Ignored if `fill` is set. */
|
|
26
|
+
color?: SegmentedBarSegmentColorId;
|
|
27
|
+
/**
|
|
28
|
+
* Override the background with a raw CSS colour (e.g. `"#ff0080"` or
|
|
29
|
+
* `"hsl(var(--chart-1))"`). Takes precedence over `color`.
|
|
30
|
+
*/
|
|
31
|
+
fill?: string;
|
|
32
|
+
/** Extra classes applied to this segment element. */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Fired when the segment is clicked or activated via keyboard. */
|
|
35
|
+
onClick?: (segment: SegmentedBarSegment, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Args for a custom legend renderer. `total` reflects the effective total
|
|
39
|
+
* (i.e. the `total` prop when supplied, otherwise the sum of segment values).
|
|
40
|
+
*/
|
|
41
|
+
export interface SegmentedBarLegendRenderArgs {
|
|
42
|
+
segments: ReadonlyArray<SegmentedBarSegment>;
|
|
43
|
+
total: number;
|
|
44
|
+
/** Sum of `value` across `segments` (may be less than `total`). */
|
|
45
|
+
segmentsTotal: number;
|
|
46
|
+
/** `total - segmentsTotal`, clamped to 0. */
|
|
47
|
+
remainder: number;
|
|
48
|
+
}
|
|
49
|
+
export interface SegmentedBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "onClick">, VariantProps<typeof segmentedBarTrackVariants> {
|
|
50
|
+
/** Segments to render, left to right. */
|
|
51
|
+
segments: ReadonlyArray<SegmentedBarSegment>;
|
|
52
|
+
/** Accessible label describing what the bar represents. */
|
|
53
|
+
label: string;
|
|
54
|
+
/**
|
|
55
|
+
* Total the segments should be measured against. Defaults to the sum of
|
|
56
|
+
* segment values. When `total` exceeds the sum, the remainder shows as an
|
|
57
|
+
* unfilled tail — useful for quotas (`used + reserved` of a `capacity`).
|
|
58
|
+
*/
|
|
59
|
+
total?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Whether to render the built-in legend below the bar. Defaults to `false`.
|
|
62
|
+
* Ignored when `renderLegend` is provided.
|
|
63
|
+
*/
|
|
64
|
+
showLegend?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Show the value alongside each label in the default legend. Defaults to
|
|
67
|
+
* `true`.
|
|
68
|
+
*/
|
|
69
|
+
showLegendValues?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Show the percentage share alongside each value in the default legend.
|
|
72
|
+
* Defaults to `false`.
|
|
73
|
+
*/
|
|
74
|
+
showLegendPercentages?: boolean;
|
|
75
|
+
/** Unit appended to values in the default legend (e.g. `"GB"`, `"$"`). */
|
|
76
|
+
unit?: string;
|
|
77
|
+
/**
|
|
78
|
+
* Format a segment value shown in the default legend. Return a string or
|
|
79
|
+
* React node. Defaults to `value + unit`.
|
|
80
|
+
*/
|
|
81
|
+
formatValue?: (value: number, segment: SegmentedBarSegment) => ReactNode;
|
|
82
|
+
/**
|
|
83
|
+
* Custom legend renderer. Overrides the default legend entirely and
|
|
84
|
+
* bypasses `showLegend`.
|
|
85
|
+
*/
|
|
86
|
+
renderLegend?: (args: SegmentedBarLegendRenderArgs) => ReactNode;
|
|
87
|
+
/**
|
|
88
|
+
* Render a thin divider between adjacent segments. Defaults to `true`.
|
|
89
|
+
* Only visible when segments have distinct colours.
|
|
90
|
+
*/
|
|
91
|
+
showDividers?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* When true (default), animates segment widths in on mount using
|
|
94
|
+
* framer-motion. Set to `false` for a static bar.
|
|
95
|
+
*/
|
|
96
|
+
animate?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Header label rendered above the bar. If omitted, the bar has no visible
|
|
99
|
+
* header (the `label` prop is still announced via `aria-label`).
|
|
100
|
+
*/
|
|
101
|
+
headerLabel?: ReactNode;
|
|
102
|
+
/**
|
|
103
|
+
* Value rendered at the end of the header row (e.g. `"84 / 100 GB"`).
|
|
104
|
+
* Only shown when a header label is present.
|
|
105
|
+
*/
|
|
106
|
+
headerValue?: ReactNode;
|
|
107
|
+
/** Extra classes for the header row. */
|
|
108
|
+
headerClassName?: string;
|
|
109
|
+
/** Extra classes for the legend wrapper. */
|
|
110
|
+
legendClassName?: string;
|
|
111
|
+
/** Extra classes applied to the bar track element. */
|
|
112
|
+
trackClassName?: string;
|
|
113
|
+
/** Fallback handler invoked for segments without their own `onClick`. */
|
|
114
|
+
onSegmentClick?: (segment: SegmentedBarSegment, event: MouseEvent<HTMLElement> | KeyboardEvent<HTMLElement>) => void;
|
|
115
|
+
ref?: Ref<HTMLDivElement>;
|
|
116
|
+
}
|
|
117
|
+
declare function SegmentedBar({ segments, label, total, size, shape, showLegend, showLegendValues, showLegendPercentages, unit, formatValue, renderLegend, showDividers, animate, headerLabel, headerValue, className, headerClassName, legendClassName, trackClassName, onSegmentClick, ref, ...props }: SegmentedBarProps): ReactElement;
|
|
118
|
+
declare namespace SegmentedBar {
|
|
119
|
+
var displayName: string;
|
|
120
|
+
}
|
|
121
|
+
export { SegmentedBar };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from "class-variance-authority";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { m } from "../../../framer-motion";
|
|
6
|
+
import { cn } from "../../../lib/utils";
|
|
7
|
+
export const segmentedBarSizeIds = [
|
|
8
|
+
"sm",
|
|
9
|
+
"default",
|
|
10
|
+
"lg",
|
|
11
|
+
"xl",
|
|
12
|
+
];
|
|
13
|
+
export const segmentedBarShapeIds = [
|
|
14
|
+
"rounded",
|
|
15
|
+
"pill",
|
|
16
|
+
"square",
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Preset colours available for segments. Mirrors the palette used by
|
|
20
|
+
* `PieChart` so a `SegmentedBar` and a `PieChart` visualising the same data
|
|
21
|
+
* agree on which slice is which.
|
|
22
|
+
*/
|
|
23
|
+
export const segmentedBarSegmentColorIds = [
|
|
24
|
+
"default",
|
|
25
|
+
"primary",
|
|
26
|
+
"positive",
|
|
27
|
+
"warning",
|
|
28
|
+
"destructive",
|
|
29
|
+
"muted",
|
|
30
|
+
];
|
|
31
|
+
const SEGMENT_BG_CLASSES = {
|
|
32
|
+
default: "bg-schemavaults-brand-blue",
|
|
33
|
+
primary: "bg-primary",
|
|
34
|
+
positive: "bg-emerald-500 dark:bg-emerald-400",
|
|
35
|
+
warning: "bg-warning",
|
|
36
|
+
destructive: "bg-destructive",
|
|
37
|
+
muted: "bg-muted-foreground/60",
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Fallback colour rotation when a segment doesn't specify its own colour.
|
|
41
|
+
* Index is the segment position in the input array, modulo palette length.
|
|
42
|
+
*/
|
|
43
|
+
const DEFAULT_COLOR_ROTATION = [
|
|
44
|
+
"default",
|
|
45
|
+
"positive",
|
|
46
|
+
"warning",
|
|
47
|
+
"destructive",
|
|
48
|
+
"primary",
|
|
49
|
+
"muted",
|
|
50
|
+
];
|
|
51
|
+
export const segmentedBarTrackVariants = cva("relative isolate flex w-full overflow-hidden bg-secondary", {
|
|
52
|
+
variants: {
|
|
53
|
+
size: {
|
|
54
|
+
sm: "h-1.5",
|
|
55
|
+
default: "h-2.5",
|
|
56
|
+
lg: "h-4",
|
|
57
|
+
xl: "h-6",
|
|
58
|
+
},
|
|
59
|
+
shape: {
|
|
60
|
+
rounded: "rounded-md",
|
|
61
|
+
pill: "rounded-full",
|
|
62
|
+
square: "rounded-none",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
defaultVariants: {
|
|
66
|
+
size: "default",
|
|
67
|
+
shape: "pill",
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
function resolveBackground(segment, index) {
|
|
71
|
+
if (segment.fill) {
|
|
72
|
+
return { bgClass: undefined, style: { backgroundColor: segment.fill } };
|
|
73
|
+
}
|
|
74
|
+
const preset = segment.color ??
|
|
75
|
+
DEFAULT_COLOR_ROTATION[index % DEFAULT_COLOR_ROTATION.length];
|
|
76
|
+
return { bgClass: SEGMENT_BG_CLASSES[preset], style: undefined };
|
|
77
|
+
}
|
|
78
|
+
function SegmentedBar({ segments, label, total, size, shape, showLegend = false, showLegendValues = true, showLegendPercentages = false, unit, formatValue, renderLegend, showDividers = true, animate = true, headerLabel, headerValue, className, headerClassName, legendClassName, trackClassName, onSegmentClick, ref, ...props }) {
|
|
79
|
+
const validSegments = segments.filter((s) => Number.isFinite(s.value) && s.value > 0);
|
|
80
|
+
const segmentsTotal = validSegments.reduce((acc, s) => acc + s.value, 0);
|
|
81
|
+
const effectiveTotal = total ?? segmentsTotal;
|
|
82
|
+
const safeTotal = effectiveTotal > 0 ? effectiveTotal : 1;
|
|
83
|
+
const remainder = Math.max(0, effectiveTotal - segmentsTotal);
|
|
84
|
+
const filledPercentage = Math.min(100, (segmentsTotal / safeTotal) * 100);
|
|
85
|
+
const resolvedSegments = validSegments.map((segment, index) => ({
|
|
86
|
+
segment,
|
|
87
|
+
index,
|
|
88
|
+
percentage: (segment.value / safeTotal) * 100,
|
|
89
|
+
...resolveBackground(segment, index),
|
|
90
|
+
}));
|
|
91
|
+
const titleId = useId();
|
|
92
|
+
const showHeader = headerLabel !== undefined || headerValue !== undefined;
|
|
93
|
+
function handleSegmentClick(segment, event) {
|
|
94
|
+
if (segment.onClick) {
|
|
95
|
+
segment.onClick(segment, event);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (onSegmentClick) {
|
|
99
|
+
onSegmentClick(segment, event);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const defaultFormatValue = (v, _s) => (_jsxs(_Fragment, { children: [v, unit ? _jsx("span", { className: "ml-0.5 text-muted-foreground", children: unit }) : null] }));
|
|
103
|
+
return (_jsxs("div", { ref: ref, "data-slot": "segmented-bar", className: cn("flex w-full flex-col gap-1.5", className), ...props, children: [showHeader && (_jsxs("div", { className: cn("flex items-baseline justify-between gap-2 text-sm", headerClassName), children: [headerLabel !== undefined && (_jsx("span", { id: titleId, className: "font-medium text-muted-foreground", "data-slot": "segmented-bar-header-label", children: headerLabel })), headerValue !== undefined && (_jsx("span", { className: "font-medium tabular-nums text-foreground", "data-slot": "segmented-bar-header-value", children: headerValue }))] })), _jsx("div", { role: "progressbar", "aria-label": label, "aria-labelledby": headerLabel !== undefined ? titleId : undefined, "aria-valuenow": Math.round(filledPercentage), "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuetext": `${segmentsTotal} of ${effectiveTotal}`, "data-slot": "segmented-bar-track", className: cn(segmentedBarTrackVariants({ size, shape }), trackClassName), children: resolvedSegments.map((r, i) => {
|
|
104
|
+
const isInteractive = r.segment.onClick !== undefined || onSegmentClick !== undefined;
|
|
105
|
+
const showDivider = showDividers && (i > 0 || (remainder > 0 && i === 0 && false));
|
|
106
|
+
const commonClass = cn("h-full min-w-0 first:rounded-l-[inherit]", remainder <= 0 && "last:rounded-r-[inherit]", r.bgClass, showDivider &&
|
|
107
|
+
"border-l border-background/50 dark:border-background/70", isInteractive &&
|
|
108
|
+
"cursor-pointer transition-opacity hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background", r.segment.className);
|
|
109
|
+
const initialWidth = "0%";
|
|
110
|
+
const animatedWidth = `${r.percentage}%`;
|
|
111
|
+
const commonProps = {
|
|
112
|
+
"data-slot": "segmented-bar-segment",
|
|
113
|
+
"data-segment-id": r.segment.id,
|
|
114
|
+
"aria-label": r.segment.label,
|
|
115
|
+
title: r.segment.label,
|
|
116
|
+
style: r.style,
|
|
117
|
+
className: commonClass,
|
|
118
|
+
};
|
|
119
|
+
if (isInteractive) {
|
|
120
|
+
return (_jsx(m.button, { type: "button", onClick: (e) => handleSegmentClick(r.segment, e), onKeyDown: (e) => {
|
|
121
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
122
|
+
e.preventDefault();
|
|
123
|
+
handleSegmentClick(r.segment, e);
|
|
124
|
+
}
|
|
125
|
+
}, initial: animate ? { width: initialWidth } : false, animate: { width: animatedWidth }, transition: { duration: 0.4, ease: "easeOut" }, ...commonProps }, r.segment.id));
|
|
126
|
+
}
|
|
127
|
+
return (_jsx(m.div, { initial: animate ? { width: initialWidth } : false, animate: { width: animatedWidth }, transition: { duration: 0.4, ease: "easeOut" }, ...commonProps }, r.segment.id));
|
|
128
|
+
}) }), renderLegend
|
|
129
|
+
? renderLegend({
|
|
130
|
+
segments: validSegments,
|
|
131
|
+
total: effectiveTotal,
|
|
132
|
+
segmentsTotal,
|
|
133
|
+
remainder,
|
|
134
|
+
})
|
|
135
|
+
: showLegend && (_jsxs("ul", { "data-slot": "segmented-bar-legend", className: cn("flex flex-wrap items-center gap-x-4 gap-y-1 text-xs", legendClassName), children: [resolvedSegments.map((r) => {
|
|
136
|
+
const pct = safeTotal > 0 ? (r.segment.value / safeTotal) * 100 : 0;
|
|
137
|
+
return (_jsxs("li", { "data-slot": "segmented-bar-legend-item", className: "inline-flex items-center gap-1.5", children: [_jsx("span", { "aria-hidden": "true", className: cn("inline-block size-2.5 shrink-0 rounded-[3px]", r.bgClass), style: r.style }), _jsx("span", { className: "font-medium text-foreground", children: r.segment.label }), showLegendValues && (_jsx("span", { className: "tabular-nums text-muted-foreground", children: formatValue
|
|
138
|
+
? formatValue(r.segment.value, r.segment)
|
|
139
|
+
: defaultFormatValue(r.segment.value, r.segment) })), showLegendPercentages && (_jsxs("span", { className: "tabular-nums text-muted-foreground", children: ["(", pct.toFixed(pct < 10 ? 1 : 0), "%)"] }))] }, r.segment.id));
|
|
140
|
+
}), remainder > 0 && (_jsxs("li", { "data-slot": "segmented-bar-legend-remainder", className: "inline-flex items-center gap-1.5", children: [_jsx("span", { "aria-hidden": "true", className: "inline-block size-2.5 shrink-0 rounded-[3px] bg-secondary" }), _jsx("span", { className: "font-medium text-muted-foreground", children: "Remaining" }), showLegendValues && (_jsx("span", { className: "tabular-nums text-muted-foreground", children: formatValue
|
|
141
|
+
? formatValue(remainder, {
|
|
142
|
+
id: "__remainder__",
|
|
143
|
+
label: "Remaining",
|
|
144
|
+
value: remainder,
|
|
145
|
+
})
|
|
146
|
+
: defaultFormatValue(remainder, {
|
|
147
|
+
id: "__remainder__",
|
|
148
|
+
label: "Remaining",
|
|
149
|
+
value: remainder,
|
|
150
|
+
}) }))] }))] }))] }));
|
|
151
|
+
}
|
|
152
|
+
SegmentedBar.displayName = "SegmentedBar";
|
|
153
|
+
export { SegmentedBar };
|
|
154
|
+
//# sourceMappingURL=segmented-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segmented-bar.js","sourceRoot":"","sources":["../../../../src/components/ui/segmented-bar/segmented-bar.tsx"],"names":[],"mappings":"A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