@epilot/spark-ui 1.0.0-alpha.3 → 1.0.0-alpha.5
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/accent-colors-Ch2J0EEY.js +13 -0
- package/dist/accent-colors-Ch2J0EEY.js.map +1 -0
- package/dist/accent-colors-CjHCf8fH.cjs +18 -0
- package/dist/accent-colors-CjHCf8fH.cjs.map +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.d.ts +1 -1
- package/dist/components/accordion.js +1 -1
- package/dist/components/attachment.d.cts +1 -1
- package/dist/components/attachment.d.ts +1 -1
- package/dist/components/badge.cjs +12 -7
- package/dist/components/badge.cjs.map +1 -1
- package/dist/components/badge.d.cts +5 -1
- package/dist/components/badge.d.ts +5 -1
- package/dist/components/badge.js +12 -7
- package/dist/components/badge.js.map +1 -1
- package/dist/components/bar-chart.cjs +60 -56
- package/dist/components/bar-chart.cjs.map +1 -1
- package/dist/components/bar-chart.d.cts +7 -2
- package/dist/components/bar-chart.d.ts +7 -2
- package/dist/components/bar-chart.js +60 -56
- package/dist/components/bar-chart.js.map +1 -1
- package/dist/components/battery-progress-row.cjs +10 -16
- package/dist/components/battery-progress-row.cjs.map +1 -1
- package/dist/components/battery-progress-row.d.cts +1 -1
- package/dist/components/battery-progress-row.d.ts +2 -2
- package/dist/components/battery-progress-row.js +10 -16
- package/dist/components/battery-progress-row.js.map +1 -1
- package/dist/components/bubble.d.cts +1 -1
- package/dist/components/bubble.d.ts +1 -1
- package/dist/components/button.cjs +5 -2
- package/dist/components/button.cjs.map +1 -1
- package/dist/components/button.d.cts +16 -7
- package/dist/components/button.d.ts +16 -7
- package/dist/components/button.js +5 -2
- package/dist/components/button.js.map +1 -1
- package/dist/components/callout.d.cts +1 -1
- package/dist/components/callout.d.ts +1 -1
- package/dist/components/card.d.cts +1 -1
- package/dist/components/card.d.ts +1 -1
- package/dist/components/chart.cjs +1 -1
- package/dist/components/chart.cjs.map +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox.cjs +30 -23
- package/dist/components/checkbox.cjs.map +1 -1
- package/dist/components/checkbox.d.cts +5 -1
- package/dist/components/checkbox.d.ts +5 -1
- package/dist/components/checkbox.js +30 -23
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/circular-gauge.d.ts +1 -1
- package/dist/components/day-of-week-picker.cjs +2 -2
- package/dist/components/day-of-week-picker.cjs.map +1 -1
- package/dist/components/day-of-week-picker.js +2 -2
- package/dist/components/day-of-week-picker.js.map +1 -1
- package/dist/components/device-card.d.ts +1 -1
- package/dist/components/donut-chart.cjs +3 -3
- package/dist/components/donut-chart.cjs.map +1 -1
- package/dist/components/donut-chart.js +3 -3
- package/dist/components/donut-chart.js.map +1 -1
- package/dist/components/energy-bar-chart.cjs +2 -1
- package/dist/components/energy-bar-chart.cjs.map +1 -1
- package/dist/components/energy-bar-chart.d.ts +1 -1
- package/dist/components/energy-bar-chart.js +2 -1
- package/dist/components/energy-bar-chart.js.map +1 -1
- package/dist/components/energy-breakdown.cjs +1 -1
- package/dist/components/energy-breakdown.cjs.map +1 -1
- package/dist/components/energy-breakdown.js +1 -1
- package/dist/components/energy-breakdown.js.map +1 -1
- package/dist/components/energy-history-chart.cjs +14 -6
- package/dist/components/energy-history-chart.cjs.map +1 -1
- package/dist/components/energy-history-chart.d.cts +11 -3
- package/dist/components/energy-history-chart.d.ts +11 -3
- package/dist/components/energy-history-chart.js +14 -6
- package/dist/components/energy-history-chart.js.map +1 -1
- package/dist/components/feed-in-hero.d.ts +1 -1
- package/dist/components/field.cjs +1 -1
- package/dist/components/field.d.cts +1 -1
- package/dist/components/field.d.ts +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/info-block.d.cts +1 -1
- package/dist/components/info-block.d.ts +1 -1
- package/dist/components/input-group.cjs +1 -1
- package/dist/components/input-group.js +1 -1
- package/dist/components/input-otp.cjs +1 -1
- package/dist/components/input-otp.js +1 -1
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.d.cts +1 -1
- package/dist/components/input.d.ts +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.cjs +61 -19
- package/dist/components/line-chart.cjs.map +1 -1
- package/dist/components/line-chart.d.cts +7 -0
- package/dist/components/line-chart.d.ts +7 -0
- package/dist/components/line-chart.js +61 -19
- package/dist/components/line-chart.js.map +1 -1
- package/dist/components/metering-row.d.ts +1 -1
- package/dist/components/money-saved-block.cjs +1 -1
- package/dist/components/money-saved-block.cjs.map +1 -1
- package/dist/components/money-saved-block.js +1 -1
- package/dist/components/money-saved-block.js.map +1 -1
- package/dist/components/number-flow.d.ts +1 -1
- package/dist/components/power-history-chart.cjs +23 -44
- package/dist/components/power-history-chart.cjs.map +1 -1
- package/dist/components/power-history-chart.d.cts +10 -1
- package/dist/components/power-history-chart.d.ts +10 -1
- package/dist/components/power-history-chart.js +24 -45
- package/dist/components/power-history-chart.js.map +1 -1
- package/dist/components/power-history.cjs +1 -1
- package/dist/components/power-history.cjs.map +1 -1
- package/dist/components/power-history.js +1 -1
- package/dist/components/power-history.js.map +1 -1
- package/dist/components/power-network.cjs +36 -11
- package/dist/components/power-network.cjs.map +1 -1
- package/dist/components/power-network.js +36 -11
- package/dist/components/power-network.js.map +1 -1
- package/dist/components/progress.cjs +1 -1
- package/dist/components/progress.cjs.map +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-card-group.cjs +26 -1
- package/dist/components/radio-card-group.cjs.map +1 -1
- package/dist/components/radio-card-group.js +26 -1
- package/dist/components/radio-card-group.js.map +1 -1
- package/dist/components/radio.cjs +11 -4
- package/dist/components/radio.cjs.map +1 -1
- package/dist/components/radio.d.cts +15 -3
- package/dist/components/radio.d.ts +15 -3
- package/dist/components/radio.js +11 -4
- package/dist/components/radio.js.map +1 -1
- package/dist/components/sankey-chart.cjs +12 -45
- package/dist/components/sankey-chart.cjs.map +1 -1
- package/dist/components/sankey-chart.d.cts +8 -0
- package/dist/components/sankey-chart.d.ts +9 -1
- package/dist/components/sankey-chart.js +12 -45
- package/dist/components/sankey-chart.js.map +1 -1
- package/dist/components/schedule-list.cjs +3 -3
- package/dist/components/schedule-list.cjs.map +1 -1
- package/dist/components/schedule-list.js +3 -3
- package/dist/components/schedule-list.js.map +1 -1
- package/dist/components/segmented-control.cjs +44 -0
- package/dist/components/segmented-control.cjs.map +1 -0
- package/dist/components/segmented-control.d.cts +33 -0
- package/dist/components/segmented-control.d.ts +33 -0
- package/dist/components/segmented-control.js +40 -0
- package/dist/components/segmented-control.js.map +1 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.d.cts +1 -1
- package/dist/components/select.d.ts +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.cjs.map +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/separator.js.map +1 -1
- package/dist/components/series-legend.cjs +1 -1
- package/dist/components/series-legend.cjs.map +1 -1
- package/dist/components/series-legend.js +1 -1
- package/dist/components/series-legend.js.map +1 -1
- package/dist/components/slider.cjs +6 -19
- package/dist/components/slider.cjs.map +1 -1
- package/dist/components/slider.d.cts +0 -13
- package/dist/components/slider.d.ts +0 -13
- package/dist/components/slider.js +6 -19
- package/dist/components/slider.js.map +1 -1
- package/dist/components/solar-forecast-chart.cjs +4 -3
- package/dist/components/solar-forecast-chart.cjs.map +1 -1
- package/dist/components/solar-forecast-chart.d.cts +4 -1
- package/dist/components/solar-forecast-chart.d.ts +4 -1
- package/dist/components/solar-forecast-chart.js +4 -3
- package/dist/components/solar-forecast-chart.js.map +1 -1
- package/dist/components/stepper.cjs +2 -2
- package/dist/components/stepper.cjs.map +1 -1
- package/dist/components/stepper.js +2 -2
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.cjs +8 -3
- package/dist/components/switch.cjs.map +1 -1
- package/dist/components/switch.d.cts +9 -4
- package/dist/components/switch.d.ts +9 -4
- package/dist/components/switch.js +8 -3
- package/dist/components/switch.js.map +1 -1
- package/dist/components/tabs.cjs +4 -4
- package/dist/components/tabs.cjs.map +1 -1
- package/dist/components/tabs.js +4 -4
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/theme.cjs +1 -1
- package/dist/components/theme.d.cts +1 -1
- package/dist/components/theme.d.ts +1 -1
- package/dist/components/theme.js +1 -1
- package/dist/components/time-picker.cjs +1 -1
- package/dist/components/time-picker.cjs.map +1 -1
- package/dist/components/time-picker.js +1 -1
- package/dist/components/time-picker.js.map +1 -1
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.cjs.map +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/hooks/use-reduced-motion.cjs +22 -0
- package/dist/hooks/use-reduced-motion.cjs.map +1 -0
- package/dist/hooks/use-reduced-motion.d.cts +7 -0
- package/dist/hooks/use-reduced-motion.d.ts +7 -0
- package/dist/hooks/use-reduced-motion.js +20 -0
- package/dist/hooks/use-reduced-motion.js.map +1 -0
- package/dist/{input-box-variants-Dr1K7uYE.js → input-box-variants-DcajYXvo.js} +1 -1
- package/dist/{input-box-variants-Dr1K7uYE.js.map → input-box-variants-DcajYXvo.js.map} +1 -1
- package/dist/{input-box-variants-BMDdwvqg.cjs → input-box-variants-ZCtgs-1S.cjs} +1 -1
- package/dist/{input-box-variants-BMDdwvqg.cjs.map → input-box-variants-ZCtgs-1S.cjs.map} +1 -1
- package/dist/{number-flow-DSbucQ_K.d.ts → number-flow-D9zsxH0-.d.ts} +1 -1
- package/dist/styles/index.css +39 -0
- package/dist/styles/spark-default.css +123 -40
- package/dist/styles/theme.css +78 -0
- package/dist/{theme-B3WtiByA.js → theme-8PDO9E0S.js} +2 -2
- package/dist/theme-8PDO9E0S.js.map +1 -0
- package/dist/{theme-C9_OSe0S.cjs → theme-ClRJhexF.cjs} +2 -2
- package/dist/theme-ClRJhexF.cjs.map +1 -0
- package/dist/{theme-types-DoROIXpi.d.ts → theme-types-BDdoRxXa.d.ts} +2 -3
- package/dist/{theme-types-r20EJfEC.d.cts → theme-types-BwSJKdsB.d.cts} +2 -3
- package/dist/{tones-DyCkL71h.d.ts → tones-PXJGlSpe.d.ts} +1 -1
- package/dist/utils/build-sankey-nodes.cjs +16 -3
- package/dist/utils/build-sankey-nodes.cjs.map +1 -1
- package/dist/utils/build-sankey-nodes.js +16 -3
- package/dist/utils/build-sankey-nodes.js.map +1 -1
- package/dist/utils/chart-scale.cjs +43 -0
- package/dist/utils/chart-scale.cjs.map +1 -0
- package/dist/utils/chart-scale.d.cts +22 -0
- package/dist/utils/chart-scale.d.ts +22 -0
- package/dist/utils/chart-scale.js +41 -0
- package/dist/utils/chart-scale.js.map +1 -0
- package/package.json +1 -1
- package/dist/theme-B3WtiByA.js.map +0 -1
- package/dist/theme-C9_OSe0S.cjs.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/accent-colors.ts
|
|
3
|
+
const accentByColor = {
|
|
4
|
+
accent: void 0,
|
|
5
|
+
neutral: "gray",
|
|
6
|
+
success: "green",
|
|
7
|
+
warning: "orange",
|
|
8
|
+
danger: "red"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { accentByColor as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=accent-colors-Ch2J0EEY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accent-colors-Ch2J0EEY.js","names":[],"sources":["../src/lib/accent-colors.ts"],"sourcesContent":["export type SparkAccentColor =\n | 'accent'\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n\nexport const accentByColor: Record<\n SparkAccentColor,\n 'gray' | 'red' | 'green' | 'orange' | undefined\n> = {\n accent: undefined,\n neutral: 'gray',\n success: 'green',\n warning: 'orange',\n danger: 'red',\n}\n"],"mappings":";;AAOA,MAAa,gBAGT;CACF,QAAQ,KAAA;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
//#region src/lib/accent-colors.ts
|
|
3
|
+
const accentByColor = {
|
|
4
|
+
accent: void 0,
|
|
5
|
+
neutral: "gray",
|
|
6
|
+
success: "green",
|
|
7
|
+
warning: "orange",
|
|
8
|
+
danger: "red"
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
Object.defineProperty(exports, "accentByColor", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function() {
|
|
14
|
+
return accentByColor;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=accent-colors-CjHCf8fH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accent-colors-CjHCf8fH.cjs","names":[],"sources":["../src/lib/accent-colors.ts"],"sourcesContent":["export type SparkAccentColor =\n | 'accent'\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n\nexport const accentByColor: Record<\n SparkAccentColor,\n 'gray' | 'red' | 'green' | 'orange' | undefined\n> = {\n accent: undefined,\n neutral: 'gray',\n success: 'green',\n warning: 'orange',\n danger: 'red',\n}\n"],"mappings":";;AAOA,MAAa,gBAGT;CACF,QAAQ,KAAA;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;CACT"}
|
|
@@ -4,8 +4,8 @@ const require_chunk = require("../chunk-aJGBMT86.cjs");
|
|
|
4
4
|
const require_icons_material_symbol = require("../icons/material-symbol.cjs");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
react = require_chunk.__toESM(react);
|
|
7
|
-
let _base_ui_react_accordion = require("@base-ui/react/accordion");
|
|
8
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
|
+
let _base_ui_react_accordion = require("@base-ui/react/accordion");
|
|
9
9
|
let cnfast = require("cnfast");
|
|
10
10
|
//#region src/components/accordion.tsx
|
|
11
11
|
function Accordion({ className, variant = "soft", ...props }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React$1 from "react";
|
|
4
|
-
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
5
4
|
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
6
6
|
|
|
7
7
|
//#region src/components/accordion.d.ts
|
|
8
8
|
type AccordionVariant = 'ghost' | 'soft' | 'surface' | 'outline';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { MaterialSymbol } from "../icons/material-symbol.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { Accordion as Accordion$1 } from "@base-ui/react/accordion";
|
|
7
7
|
//#region src/components/accordion.tsx
|
|
8
8
|
function Accordion({ className, variant = "soft", ...props }) {
|
|
9
9
|
return /* @__PURE__ */ jsx(Accordion$1.Root, {
|
|
@@ -9,7 +9,7 @@ import { useRender } from "@base-ui/react/use-render";
|
|
|
9
9
|
|
|
10
10
|
//#region src/components/attachment.d.ts
|
|
11
11
|
declare const attachmentVariants: (props?: ({
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "default" | "xs" | null | undefined;
|
|
13
13
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
14
14
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
15
15
|
declare function Attachment({
|
|
@@ -9,7 +9,7 @@ import * as _$class_variance_authority_types0 from "class-variance-authority/typ
|
|
|
9
9
|
|
|
10
10
|
//#region src/components/attachment.d.ts
|
|
11
11
|
declare const attachmentVariants: (props?: ({
|
|
12
|
-
size?: "
|
|
12
|
+
size?: "sm" | "default" | "xs" | null | undefined;
|
|
13
13
|
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
14
14
|
} & _$class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
15
15
|
declare function Attachment({
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const require_chunk = require("../chunk-aJGBMT86.cjs");
|
|
4
|
+
const require_accent_colors = require("../accent-colors-CjHCf8fH.cjs");
|
|
4
5
|
let react = require("react");
|
|
5
6
|
react = require_chunk.__toESM(react);
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
let cnfast = require("cnfast");
|
|
8
9
|
//#region src/components/badge.tsx
|
|
9
|
-
const Badge = react.forwardRef(({ className, children, ...props }, ref) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
const Badge = react.forwardRef(({ className, children, styleVariant, color, ...props }, ref) => {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
12
|
+
"data-slot": "badge",
|
|
13
|
+
"data-style": styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "soft" : void 0,
|
|
14
|
+
"data-accent-color": color ? require_accent_colors.accentByColor[color] : void 0,
|
|
15
|
+
className: (0, cnfast.cn)("inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1.5 text-center text-xs font-normal tabular-nums", "border-(length:--spark-style-border-width,1px) border-(--spark-style-border,transparent)", "bg-(--spark-style-bg,var(--color-gray-a3)) text-(--spark-style-fg,var(--spark-badge-fg,var(--color-gray-a11)))", className),
|
|
16
|
+
ref,
|
|
17
|
+
...props,
|
|
18
|
+
children
|
|
19
|
+
});
|
|
20
|
+
});
|
|
16
21
|
Badge.displayName = "Badge";
|
|
17
22
|
//#endregion
|
|
18
23
|
exports.Badge = Badge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.cjs","names":["React"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n children?: React.ReactNode\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, children, ...props }, ref) => (\n
|
|
1
|
+
{"version":3,"file":"badge.cjs","names":["React","accentByColor"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkBadgeColor =\n | 'accent'\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n\ninterface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n styleVariant?: SparkStyle\n color?: SparkBadgeColor\n children?: React.ReactNode\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, children, styleVariant, color, ...props }, ref) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n return (\n <span\n data-slot=\"badge\"\n data-style={hasLook ? (styleVariant ?? 'soft') : undefined}\n data-accent-color={color ? accentByColor[color] : undefined}\n className={cn(\n 'inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1.5 text-center text-xs font-normal tabular-nums',\n 'border-(length:--spark-style-border-width,1px) border-(--spark-style-border,transparent)',\n 'bg-(--spark-style-bg,var(--color-gray-a3)) text-(--spark-style-fg,var(--spark-badge-fg,var(--color-gray-a11)))',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </span>\n )\n },\n)\n\nBadge.displayName = 'Badge'\n\nexport { Badge }\nexport type { BadgeProps }\n"],"mappings":";;;;;;;;;AAkBA,MAAM,QAAQA,MAAM,YACjB,EAAE,WAAW,UAAU,cAAc,OAAO,GAAG,SAAS,QAAQ;AAE/D,QACE,iBAAA,GAAA,kBAAA,KAAC,QAAD;EACE,aAAU;EACV,cAJY,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAI7B,gBAAgB,SAAU,KAAA;EACjD,qBAAmB,QAAQC,sBAAAA,cAAc,SAAS,KAAA;EAClD,YAAA,GAAA,OAAA,IACE,sHACA,4FACA,kHACA,UACD;EACI;EACL,GAAI;EAEH;EACI,CAAA;EAGZ;AAED,MAAM,cAAc"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { u as SparkStyle } from "../theme-types-BwSJKdsB.cjs";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
|
|
5
6
|
//#region src/components/badge.d.ts
|
|
7
|
+
type SparkBadgeColor = 'accent' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
6
8
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
styleVariant?: SparkStyle;
|
|
10
|
+
color?: SparkBadgeColor;
|
|
7
11
|
children?: React$1.ReactNode;
|
|
8
12
|
}
|
|
9
13
|
declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
10
14
|
//#endregion
|
|
11
|
-
export { Badge, type BadgeProps };
|
|
15
|
+
export { Badge, type BadgeProps, SparkBadgeColor };
|
|
12
16
|
//# sourceMappingURL=badge.d.cts.map
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { u as SparkStyle } from "../theme-types-BDdoRxXa.js";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
|
|
5
6
|
//#region src/components/badge.d.ts
|
|
7
|
+
type SparkBadgeColor = 'accent' | 'neutral' | 'success' | 'warning' | 'danger';
|
|
6
8
|
interface BadgeProps extends React$1.HTMLAttributes<HTMLSpanElement> {
|
|
9
|
+
styleVariant?: SparkStyle;
|
|
10
|
+
color?: SparkBadgeColor;
|
|
7
11
|
children?: React$1.ReactNode;
|
|
8
12
|
}
|
|
9
13
|
declare const Badge: React$1.ForwardRefExoticComponent<BadgeProps & React$1.RefAttributes<HTMLSpanElement>>;
|
|
10
14
|
//#endregion
|
|
11
|
-
export { Badge, type BadgeProps };
|
|
15
|
+
export { Badge, type BadgeProps, SparkBadgeColor };
|
|
12
16
|
//# sourceMappingURL=badge.d.ts.map
|
package/dist/components/badge.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
|
+
import { t as accentByColor } from "../accent-colors-Ch2J0EEY.js";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/components/badge.tsx
|
|
6
|
-
const Badge = React$1.forwardRef(({ className, children, ...props }, ref) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const Badge = React$1.forwardRef(({ className, children, styleVariant, color, ...props }, ref) => {
|
|
8
|
+
return /* @__PURE__ */ jsx("span", {
|
|
9
|
+
"data-slot": "badge",
|
|
10
|
+
"data-style": styleVariant !== void 0 || color !== void 0 ? styleVariant ?? "soft" : void 0,
|
|
11
|
+
"data-accent-color": color ? accentByColor[color] : void 0,
|
|
12
|
+
className: cn("inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1.5 text-center text-xs font-normal tabular-nums", "border-(length:--spark-style-border-width,1px) border-(--spark-style-border,transparent)", "bg-(--spark-style-bg,var(--color-gray-a3)) text-(--spark-style-fg,var(--spark-badge-fg,var(--color-gray-a11)))", className),
|
|
13
|
+
ref,
|
|
14
|
+
...props,
|
|
15
|
+
children
|
|
16
|
+
});
|
|
17
|
+
});
|
|
13
18
|
Badge.displayName = "Badge";
|
|
14
19
|
//#endregion
|
|
15
20
|
export { Badge };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","names":["React"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from 'react'\nimport { cn } from '../utils/cn'\n\ninterface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n children?: React.ReactNode\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, children, ...props }, ref) => (\n
|
|
1
|
+
{"version":3,"file":"badge.js","names":["React"],"sources":["../../src/components/badge.tsx"],"sourcesContent":["import * as React from 'react'\nimport { accentByColor } from '../lib/accent-colors'\nimport type { SparkStyle } from '../lib/theme-types'\nimport { cn } from '../utils/cn'\n\nexport type SparkBadgeColor =\n | 'accent'\n | 'neutral'\n | 'success'\n | 'warning'\n | 'danger'\n\ninterface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {\n styleVariant?: SparkStyle\n color?: SparkBadgeColor\n children?: React.ReactNode\n}\n\nconst Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(\n ({ className, children, styleVariant, color, ...props }, ref) => {\n const hasLook = styleVariant !== undefined || color !== undefined\n return (\n <span\n data-slot=\"badge\"\n data-style={hasLook ? (styleVariant ?? 'soft') : undefined}\n data-accent-color={color ? accentByColor[color] : undefined}\n className={cn(\n 'inline-flex h-5 min-w-5 items-center justify-center rounded-sm px-1.5 text-center text-xs font-normal tabular-nums',\n 'border-(length:--spark-style-border-width,1px) border-(--spark-style-border,transparent)',\n 'bg-(--spark-style-bg,var(--color-gray-a3)) text-(--spark-style-fg,var(--spark-badge-fg,var(--color-gray-a11)))',\n className,\n )}\n ref={ref}\n {...props}\n >\n {children}\n </span>\n )\n },\n)\n\nBadge.displayName = 'Badge'\n\nexport { Badge }\nexport type { BadgeProps }\n"],"mappings":";;;;;;AAkBA,MAAM,QAAQA,QAAM,YACjB,EAAE,WAAW,UAAU,cAAc,OAAO,GAAG,SAAS,QAAQ;AAE/D,QACE,oBAAC,QAAD;EACE,aAAU;EACV,cAJY,iBAAiB,KAAA,KAAa,UAAU,KAAA,IAI7B,gBAAgB,SAAU,KAAA;EACjD,qBAAmB,QAAQ,cAAc,SAAS,KAAA;EAClD,WAAW,GACT,sHACA,4FACA,kHACA,UACD;EACI;EACL,GAAI;EAEH;EACI,CAAA;EAGZ;AAED,MAAM,cAAc"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
require("../chunk-aJGBMT86.cjs");
|
|
4
|
+
const require_hooks_use_reduced_motion = require("../hooks/use-reduced-motion.cjs");
|
|
4
5
|
const require_utils_format = require("../utils/format.cjs");
|
|
6
|
+
const require_utils_chart_scale = require("../utils/chart-scale.cjs");
|
|
5
7
|
const require_components_chart = require("./chart.cjs");
|
|
6
8
|
const require_components_series_legend = require("./series-legend.cjs");
|
|
7
9
|
const require_components_typography = require("./typography.cjs");
|
|
@@ -21,25 +23,6 @@ const FOCUS_TRANSITION_MS = 180;
|
|
|
21
23
|
const DEFAULT_HEIGHT = 220;
|
|
22
24
|
const BAR_RADIUS = 2;
|
|
23
25
|
const Y_AXIS_GUTTER = 34;
|
|
24
|
-
function buildYAxisTicks(yMax) {
|
|
25
|
-
const rawStep = yMax / 4;
|
|
26
|
-
const normalized = rawStep === 0 ? 1 : rawStep;
|
|
27
|
-
const magnitude = Math.pow(10, Math.floor(Math.log10(normalized)));
|
|
28
|
-
const step = ([
|
|
29
|
-
1,
|
|
30
|
-
2,
|
|
31
|
-
2.5,
|
|
32
|
-
5,
|
|
33
|
-
10
|
|
34
|
-
].find((value) => value * magnitude >= normalized) ?? 10) * magnitude;
|
|
35
|
-
const upper = Math.ceil(yMax / step) * step;
|
|
36
|
-
const ticks = [];
|
|
37
|
-
for (let value = 0; value <= upper + step * .001; value += step) ticks.push(Number(value.toFixed(6)));
|
|
38
|
-
return ticks;
|
|
39
|
-
}
|
|
40
|
-
function formatYAxisTick(value) {
|
|
41
|
-
return value >= 10 ? require_utils_format.integerFormat.format(value) : require_utils_format.oneDecimalFormat.format(value);
|
|
42
|
-
}
|
|
43
26
|
function buildBarPath(x, y, width, height, radius, roundTop, roundBottom) {
|
|
44
27
|
const r = Math.max(0, Math.min(radius, width / 2, height / 2));
|
|
45
28
|
if (r === 0 || !roundTop && !roundBottom) return `M ${x} ${y} H ${x + width} V ${y + height} H ${x} Z`;
|
|
@@ -69,15 +52,21 @@ function BarStackLayer({ stackData, series, seriesByKey, xScale, yScale, colorSc
|
|
|
69
52
|
xScale,
|
|
70
53
|
yScale,
|
|
71
54
|
color: colorScale,
|
|
55
|
+
offset: "diverging",
|
|
72
56
|
children: (barStacks) => barStacks.map((barStack) => barStack.bars.map((bar) => {
|
|
73
|
-
|
|
57
|
+
const values = bar.bar.data.__values;
|
|
58
|
+
const segmentValue = values[barStack.key] ?? 0;
|
|
59
|
+
if (segmentValue === 0) return null;
|
|
74
60
|
const strokeColor = seriesByKey.get(barStack.key)?.color ?? bar.color;
|
|
75
61
|
const fillColor = strokeColor;
|
|
76
|
-
const
|
|
77
|
-
const
|
|
78
|
-
const
|
|
62
|
+
const positiveKeys = series.map((entry) => entry.key).filter((key) => (values[key] ?? 0) > 0);
|
|
63
|
+
const negativeKeys = series.map((entry) => entry.key).filter((key) => (values[key] ?? 0) < 0);
|
|
64
|
+
const roundTop = segmentValue > 0 && positiveKeys[positiveKeys.length - 1] === barStack.key;
|
|
65
|
+
const roundBottom = segmentValue > 0 ? positiveKeys[0] === barStack.key : negativeKeys[negativeKeys.length - 1] === barStack.key;
|
|
66
|
+
const top = bar.height < 0 ? bar.y + bar.height : bar.y;
|
|
67
|
+
const barHeight = Math.abs(bar.height);
|
|
79
68
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
80
|
-
d: buildBarPath(bar.x,
|
|
69
|
+
d: buildBarPath(bar.x, top, bar.width, Math.max(0, barHeight), BAR_RADIUS, roundTop, roundBottom),
|
|
81
70
|
fill: fillColor,
|
|
82
71
|
stroke: strokeColor,
|
|
83
72
|
strokeWidth: 1,
|
|
@@ -87,12 +76,13 @@ function BarStackLayer({ stackData, series, seriesByKey, xScale, yScale, colorSc
|
|
|
87
76
|
});
|
|
88
77
|
}
|
|
89
78
|
function FocusBorder({ category, visible, stackData, series, xScale, yScale }) {
|
|
79
|
+
const reducedMotion = require_hooks_use_reduced_motion.useReducedMotion();
|
|
90
80
|
const x = xScale(category);
|
|
91
81
|
const datum = stackData.find((entry) => entry.__category === category);
|
|
92
82
|
if (x === void 0 || !datum) return null;
|
|
93
|
-
if (!series.some((entry) => (datum.__values[entry.key] ?? 0)
|
|
83
|
+
if (!series.some((entry) => (datum.__values[entry.key] ?? 0) !== 0)) return null;
|
|
94
84
|
const topY = PADDING_TOP;
|
|
95
|
-
const
|
|
85
|
+
const bottomY = yScale(series.reduce((sum, entry) => sum + Math.min(0, datum.__values[entry.key] ?? 0), 0));
|
|
96
86
|
const borderPaddingX = 4;
|
|
97
87
|
const borderPaddingY = 3;
|
|
98
88
|
const borderXRaw = x - borderPaddingX;
|
|
@@ -104,7 +94,7 @@ function FocusBorder({ category, visible, stackData, series, xScale, yScale }) {
|
|
|
104
94
|
const borderX = Math.max(minX, borderXRaw);
|
|
105
95
|
const borderRight = Math.min(maxX, borderXRaw + borderWidthRaw);
|
|
106
96
|
const borderWidth = Math.max(0, borderRight - borderX);
|
|
107
|
-
const borderHeight = Math.max(1,
|
|
97
|
+
const borderHeight = Math.max(1, bottomY - topY + borderPaddingY * 2);
|
|
108
98
|
if (borderWidth <= 0) return null;
|
|
109
99
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
|
|
110
100
|
x: borderX,
|
|
@@ -118,7 +108,7 @@ function FocusBorder({ category, visible, stackData, series, xScale, yScale }) {
|
|
|
118
108
|
pointerEvents: "none",
|
|
119
109
|
style: {
|
|
120
110
|
opacity: visible ? 1 : 0,
|
|
121
|
-
transition: `x ${FOCUS_TRANSITION_MS}ms ease, y ${FOCUS_TRANSITION_MS}ms ease, width ${FOCUS_TRANSITION_MS}ms ease, height ${FOCUS_TRANSITION_MS}ms ease, opacity ${FOCUS_TRANSITION_MS}ms ease`
|
|
111
|
+
transition: reducedMotion ? `opacity ${FOCUS_TRANSITION_MS}ms ease` : `x ${FOCUS_TRANSITION_MS}ms ease, y ${FOCUS_TRANSITION_MS}ms ease, width ${FOCUS_TRANSITION_MS}ms ease, height ${FOCUS_TRANSITION_MS}ms ease, opacity ${FOCUS_TRANSITION_MS}ms ease`
|
|
122
112
|
}
|
|
123
113
|
});
|
|
124
114
|
}
|
|
@@ -164,7 +154,7 @@ function CategoryTicks({ ticks, xScale, height, formatCategory }) {
|
|
|
164
154
|
x: x + xScale.bandwidth() / 2,
|
|
165
155
|
y: height - PADDING_BOTTOM + 16,
|
|
166
156
|
textAnchor: "middle",
|
|
167
|
-
fill: "var(--
|
|
157
|
+
fill: "var(--neutral-a11)",
|
|
168
158
|
fontSize: 10,
|
|
169
159
|
children: formatCategory(category)
|
|
170
160
|
}, `tick-${String(category)}`);
|
|
@@ -175,6 +165,7 @@ function defaultFormatTotal(value) {
|
|
|
175
165
|
}
|
|
176
166
|
function BarChart({ data, series, lines, getCategory, categories, categoryTicks, formatCategory = (category) => String(category), formatTooltipCategory = formatCategory, highlightedCategory, showHighlightLine = false, referenceLine, title, yAxisUnit, height = DEFAULT_HEIGHT, renderTotal, formatTotal = defaultFormatTotal, formatValue, className }) {
|
|
177
167
|
const containerRef = (0, react.useRef)(null);
|
|
168
|
+
const reducedMotion = require_hooks_use_reduced_motion.useReducedMotion();
|
|
178
169
|
const [width, setWidth] = (0, react.useState)(0);
|
|
179
170
|
const [hoveredCategory, setHoveredCategory] = (0, react.useState)(null);
|
|
180
171
|
const [trailingHoverLabel, setTrailingHoverLabel] = (0, react.useState)(null);
|
|
@@ -218,11 +209,12 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
218
209
|
series,
|
|
219
210
|
hiddenSeries
|
|
220
211
|
]);
|
|
221
|
-
const yMax = (0, react.useMemo)(() => Math.max(1, referenceLine?.value ?? 0, ...stackData.map((record) => series.reduce((sum, entry) => sum + (record.__values[entry.key] ?? 0), 0))), [
|
|
212
|
+
const yMax = (0, react.useMemo)(() => Math.max(1, referenceLine?.value ?? 0, ...stackData.map((record) => series.reduce((sum, entry) => sum + Math.max(0, record.__values[entry.key] ?? 0), 0))), [
|
|
222
213
|
referenceLine,
|
|
223
214
|
series,
|
|
224
215
|
stackData
|
|
225
216
|
]);
|
|
217
|
+
const yMin = (0, react.useMemo)(() => Math.min(0, ...stackData.map((record) => series.reduce((sum, entry) => sum + Math.min(0, record.__values[entry.key] ?? 0), 0))), [series, stackData]);
|
|
226
218
|
const xDomain = (0, react.useMemo)(() => categories ?? stackData.map((record) => record.__category), [categories, stackData]);
|
|
227
219
|
const xScale = (0, react.useMemo)(() => (0, _visx_scale.scaleBand)({
|
|
228
220
|
domain: xDomain,
|
|
@@ -230,9 +222,13 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
230
222
|
padding: .32
|
|
231
223
|
}), [xDomain, width]);
|
|
232
224
|
const yScale = (0, react.useMemo)(() => (0, _visx_scale.scaleLinear)({
|
|
233
|
-
domain: [
|
|
225
|
+
domain: [yMin, yMax],
|
|
234
226
|
range: [height - PADDING_BOTTOM, PADDING_TOP]
|
|
235
|
-
}), [
|
|
227
|
+
}), [
|
|
228
|
+
height,
|
|
229
|
+
yMax,
|
|
230
|
+
yMin
|
|
231
|
+
]);
|
|
236
232
|
const colorScale = (0, react.useMemo)(() => (0, _visx_scale.scaleOrdinal)({
|
|
237
233
|
domain: series.map((entry) => entry.key),
|
|
238
234
|
range: series.map((entry) => entry.color)
|
|
@@ -283,8 +279,8 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
283
279
|
const focusCategory = lastFocusCategoryRef.current;
|
|
284
280
|
const focused = (0, react.useMemo)(() => hoveredCategory === null ? null : stackData.find((record) => record.__category === hoveredCategory) ?? null, [hoveredCategory, stackData]);
|
|
285
281
|
const totalValue = (0, react.useMemo)(() => {
|
|
286
|
-
if (focused) return series.reduce((sum, entry) => sum + (focused.__values[entry.key] ?? 0), 0);
|
|
287
|
-
return stackData.reduce((sum, record) => sum + series.reduce((s, entry) => s + (record.__values[entry.key] ?? 0), 0), 0);
|
|
282
|
+
if (focused) return series.reduce((sum, entry) => sum + Math.max(0, focused.__values[entry.key] ?? 0), 0);
|
|
283
|
+
return stackData.reduce((sum, record) => sum + series.reduce((s, entry) => s + Math.max(0, record.__values[entry.key] ?? 0), 0), 0);
|
|
288
284
|
}, [
|
|
289
285
|
focused,
|
|
290
286
|
series,
|
|
@@ -304,7 +300,7 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
304
300
|
};
|
|
305
301
|
}, [hoverLabel]);
|
|
306
302
|
const ticks = categoryTicks ?? xDomain;
|
|
307
|
-
const yTicks = (0, react.useMemo)(() =>
|
|
303
|
+
const yTicks = (0, react.useMemo)(() => require_utils_chart_scale.buildYAxisScale(yMin, yMax).ticks, [yMin, yMax]);
|
|
308
304
|
const highlightX = (0, react.useMemo)(() => {
|
|
309
305
|
if (!showHighlightLine || highlightedCategory === void 0) return null;
|
|
310
306
|
const x = xScale(highlightedCategory);
|
|
@@ -320,12 +316,27 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
320
316
|
data,
|
|
321
317
|
getCategory
|
|
322
318
|
]);
|
|
319
|
+
const barStackLayer = (0, react.useMemo)(() => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BarStackLayer, {
|
|
320
|
+
stackData,
|
|
321
|
+
series,
|
|
322
|
+
seriesByKey,
|
|
323
|
+
xScale,
|
|
324
|
+
yScale,
|
|
325
|
+
colorScale
|
|
326
|
+
}), [
|
|
327
|
+
stackData,
|
|
328
|
+
series,
|
|
329
|
+
seriesByKey,
|
|
330
|
+
xScale,
|
|
331
|
+
yScale,
|
|
332
|
+
colorScale
|
|
333
|
+
]);
|
|
323
334
|
const fmtTooltipValue = formatValue ?? formatTotal;
|
|
324
|
-
const tooltipRows = focused ? [...series.filter((entry) => (focused.__values[entry.key] ?? 0)
|
|
335
|
+
const tooltipRows = focused ? [...series.filter((entry) => (focused.__values[entry.key] ?? 0) !== 0).map((entry) => ({
|
|
325
336
|
key: entry.key,
|
|
326
337
|
label: entry.label,
|
|
327
338
|
color: entry.color,
|
|
328
|
-
value: fmtTooltipValue(focused.__values[entry.key] ?? 0)
|
|
339
|
+
value: fmtTooltipValue(Math.abs(focused.__values[entry.key] ?? 0))
|
|
329
340
|
})), ...(lines ?? []).filter((line) => !hiddenSeries.has(line.key)).flatMap((line) => {
|
|
330
341
|
const value = focusedDatum === null ? null : line.getValue(focusedDatum);
|
|
331
342
|
if (value === null || !Number.isFinite(value)) return [];
|
|
@@ -355,7 +366,7 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
355
366
|
className: "flex items-baseline justify-between",
|
|
356
367
|
children: [title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_typography.SectionTitle, { children: title }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
357
368
|
className: "tabular-nums",
|
|
358
|
-
children: renderTotal ? renderTotal(totalValue) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
369
|
+
children: renderTotal ? renderTotal(totalValue, focused === null) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
359
370
|
className: "text-base font-bold text-gray tabular-nums",
|
|
360
371
|
children: formatTotal(totalValue)
|
|
361
372
|
})
|
|
@@ -393,7 +404,7 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
393
404
|
left: tooltipPos.left,
|
|
394
405
|
top: tooltipPos.top,
|
|
395
406
|
opacity: tooltipActive ? 1 : 0,
|
|
396
|
-
transition: "left 140ms ease-out, top 140ms ease-out, opacity 140ms ease-out"
|
|
407
|
+
transition: reducedMotion ? "opacity 140ms ease-out" : "left 140ms ease-out, top 140ms ease-out, opacity 140ms ease-out"
|
|
397
408
|
},
|
|
398
409
|
children: focusCategory !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_components_chart.ChartTooltipCard, {
|
|
399
410
|
label: formatTooltipCategory(focusCategory),
|
|
@@ -407,8 +418,8 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
407
418
|
x1: Y_AXIS_GUTTER,
|
|
408
419
|
x2: Y_AXIS_GUTTER,
|
|
409
420
|
y1: PADDING_TOP,
|
|
410
|
-
y2:
|
|
411
|
-
stroke: "var(--
|
|
421
|
+
y2: height - PADDING_BOTTOM,
|
|
422
|
+
stroke: "var(--neutral-a6)",
|
|
412
423
|
strokeWidth: 1
|
|
413
424
|
}),
|
|
414
425
|
yTicks.map((tick, index) => {
|
|
@@ -419,22 +430,22 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
419
430
|
x2: Y_AXIS_GUTTER,
|
|
420
431
|
y1: y,
|
|
421
432
|
y2: y,
|
|
422
|
-
stroke: "var(--
|
|
433
|
+
stroke: "var(--neutral-a8)",
|
|
423
434
|
strokeWidth: 1
|
|
424
435
|
}), !hideTickLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("text", {
|
|
425
436
|
x: Y_AXIS_GUTTER - 7,
|
|
426
437
|
y: y + 3,
|
|
427
438
|
textAnchor: "end",
|
|
428
|
-
fill: "var(--
|
|
439
|
+
fill: "var(--neutral-a11)",
|
|
429
440
|
fontSize: 10,
|
|
430
|
-
children: formatYAxisTick(tick)
|
|
441
|
+
children: require_utils_chart_scale.formatYAxisTick(tick)
|
|
431
442
|
})] }, `y-tick-${tick}`);
|
|
432
443
|
}),
|
|
433
444
|
yAxisUnit && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("text", {
|
|
434
445
|
x: 0,
|
|
435
446
|
y: PADDING_TOP - 6,
|
|
436
447
|
textAnchor: "start",
|
|
437
|
-
fill: "var(--
|
|
448
|
+
fill: "var(--neutral-a11)",
|
|
438
449
|
fontSize: 10,
|
|
439
450
|
fontWeight: 600,
|
|
440
451
|
children: yAxisUnit
|
|
@@ -443,7 +454,7 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
443
454
|
x1: highlightX,
|
|
444
455
|
x2: highlightX,
|
|
445
456
|
y1: PADDING_TOP,
|
|
446
|
-
y2:
|
|
457
|
+
y2: height - PADDING_BOTTOM,
|
|
447
458
|
stroke: "var(--spark-a9)",
|
|
448
459
|
strokeWidth: 1.5,
|
|
449
460
|
strokeDasharray: "5 4",
|
|
@@ -454,7 +465,7 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
454
465
|
x2: width,
|
|
455
466
|
y1: yScale(0),
|
|
456
467
|
y2: yScale(0),
|
|
457
|
-
stroke: "var(--
|
|
468
|
+
stroke: "var(--neutral-a5)",
|
|
458
469
|
strokeWidth: 1
|
|
459
470
|
}),
|
|
460
471
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_visx_group.Group, { children: [
|
|
@@ -466,20 +477,13 @@ function BarChart({ data, series, lines, getCategory, categories, categoryTicks,
|
|
|
466
477
|
xScale,
|
|
467
478
|
yScale
|
|
468
479
|
}),
|
|
469
|
-
|
|
470
|
-
stackData,
|
|
471
|
-
series,
|
|
472
|
-
seriesByKey,
|
|
473
|
-
xScale,
|
|
474
|
-
yScale,
|
|
475
|
-
colorScale
|
|
476
|
-
}),
|
|
480
|
+
barStackLayer,
|
|
477
481
|
referenceLine && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("line", {
|
|
478
482
|
x1: Y_AXIS_GUTTER,
|
|
479
483
|
x2: width,
|
|
480
484
|
y1: yScale(referenceLine.value),
|
|
481
485
|
y2: yScale(referenceLine.value),
|
|
482
|
-
stroke: referenceLine.color ?? "var(--
|
|
486
|
+
stroke: referenceLine.color ?? "var(--neutral-a11)",
|
|
483
487
|
strokeWidth: 1.5,
|
|
484
488
|
pointerEvents: "none"
|
|
485
489
|
}),
|