@six-vallees/ui-react 0.1.0 → 0.1.2
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/README.md +54 -0
- package/dist/button/button.d.ts +23 -0
- package/dist/button/button.js +10 -0
- package/dist/button/button.js.map +1 -0
- package/dist/charts/area-chart.d.ts +27 -0
- package/dist/charts/area-chart.js +9 -0
- package/dist/charts/area-chart.js.map +1 -0
- package/dist/charts/bar-chart.d.ts +29 -0
- package/dist/charts/bar-chart.js +10 -0
- package/dist/charts/bar-chart.js.map +1 -0
- package/dist/charts/lib/path.d.ts +12 -0
- package/dist/charts/lib/path.js +11 -0
- package/dist/charts/lib/path.js.map +1 -0
- package/dist/charts/lib/series.d.ts +35 -0
- package/dist/charts/lib/series.js +19 -0
- package/dist/charts/lib/series.js.map +1 -0
- package/dist/charts/ring.d.ts +44 -0
- package/dist/charts/ring.js +10 -0
- package/dist/charts/ring.js.map +1 -0
- package/dist/charts/segmented-bar.d.ts +34 -0
- package/dist/charts/segmented-bar.js +9 -0
- package/dist/charts/segmented-bar.js.map +1 -0
- package/dist/charts/sparkline.d.ts +19 -0
- package/dist/charts/sparkline.js +9 -0
- package/dist/charts/sparkline.js.map +1 -0
- package/dist/charts/stat.d.ts +22 -0
- package/dist/charts/stat.js +8 -0
- package/dist/charts/stat.js.map +1 -0
- package/dist/chunk-27MWE4F5.js +24 -0
- package/dist/chunk-27MWE4F5.js.map +1 -0
- package/dist/chunk-5DZPPT7X.js +30 -0
- package/dist/chunk-5DZPPT7X.js.map +1 -0
- package/dist/chunk-DXRY7AS4.js +11 -0
- package/dist/chunk-DXRY7AS4.js.map +1 -0
- package/dist/chunk-HXRF55LD.js +64 -0
- package/dist/chunk-HXRF55LD.js.map +1 -0
- package/dist/chunk-I2PXLL75.js +41 -0
- package/dist/chunk-I2PXLL75.js.map +1 -0
- package/dist/chunk-IAKPFV2O.js +31 -0
- package/dist/chunk-IAKPFV2O.js.map +1 -0
- package/dist/chunk-IVQKYAL6.js +30 -0
- package/dist/chunk-IVQKYAL6.js.map +1 -0
- package/dist/chunk-N5ZJZ7I3.js +18 -0
- package/dist/chunk-N5ZJZ7I3.js.map +1 -0
- package/dist/chunk-OIL3X3BZ.js +98 -0
- package/dist/chunk-OIL3X3BZ.js.map +1 -0
- package/dist/chunk-QZYA5GS2.js +40 -0
- package/dist/chunk-QZYA5GS2.js.map +1 -0
- package/dist/chunk-SN3OYOEU.js +89 -0
- package/dist/chunk-SN3OYOEU.js.map +1 -0
- package/dist/chunk-UNKWUPX2.js +91 -0
- package/dist/chunk-UNKWUPX2.js.map +1 -0
- package/dist/chunk-WBTUZO4N.js +74 -0
- package/dist/chunk-WBTUZO4N.js.map +1 -0
- package/dist/icon/icon.d.ts +30 -0
- package/dist/icon/icon.js +8 -0
- package/dist/icon/icon.js.map +1 -0
- package/dist/index.d.ts +15 -257
- package/dist/index.js +61 -437
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +6 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/logo/logo-mark.d.ts +12 -0
- package/dist/logo/logo-mark.js +7 -0
- package/dist/logo/logo-mark.js.map +1 -0
- package/dist/logo/logo.d.ts +13 -0
- package/dist/logo/logo.js +7 -0
- package/dist/logo/logo.js.map +1 -0
- package/package.json +10 -5
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/button/button.tsx
|
|
6
|
+
import * as React from "react";
|
|
7
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva } from "class-variance-authority";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
var buttonVariants = cva(
|
|
11
|
+
"inline-flex items-center justify-center gap-2 leading-none rounded-control font-medium whitespace-nowrap transition-[background-color,border-color,filter] duration-150 outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:pointer-events-none disabled:opacity-40",
|
|
12
|
+
{
|
|
13
|
+
variants: {
|
|
14
|
+
variant: {
|
|
15
|
+
primary: "bg-primary text-on-primary hover:bg-primary-hover active:brightness-90",
|
|
16
|
+
secondary: "border border-outline-strong bg-surface text-on-surface hover:bg-surface-subtle active:bg-surface-muted",
|
|
17
|
+
ghost: "text-on-surface hover:bg-surface-subtle active:bg-surface-muted",
|
|
18
|
+
danger: "bg-danger text-on-danger hover:brightness-95 active:brightness-90"
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
sm: "h-9 px-3 text-sm",
|
|
22
|
+
md: "h-11 px-5 text-sm",
|
|
23
|
+
lg: "h-12 px-6 text-base"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
defaultVariants: { variant: "primary", size: "md" }
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
var Button = React.forwardRef(
|
|
30
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
31
|
+
const Comp = asChild ? Slot : "button";
|
|
32
|
+
return /* @__PURE__ */ jsx(Comp, { ref, className: cn(buttonVariants({ variant, size }), className), ...props });
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
Button.displayName = "Button";
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
buttonVariants,
|
|
39
|
+
Button
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=chunk-I2PXLL75.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/button/button.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '@/lib/utils';\n\n/**\n * Cairn Button. Consumes the design tokens through the Tailwind bridge\n * (bg-primary, rounded-control, …), install the Cairn theme in the target project.\n */\nconst buttonVariants = cva(\n 'inline-flex items-center justify-center gap-2 leading-none rounded-control font-medium whitespace-nowrap transition-[background-color,border-color,filter] duration-150 outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus disabled:pointer-events-none disabled:opacity-40',\n {\n variants: {\n variant: {\n primary: 'bg-primary text-on-primary hover:bg-primary-hover active:brightness-90',\n secondary:\n 'border border-outline-strong bg-surface text-on-surface hover:bg-surface-subtle active:bg-surface-muted',\n ghost: 'text-on-surface hover:bg-surface-subtle active:bg-surface-muted',\n danger: 'bg-danger text-on-danger hover:brightness-95 active:brightness-90',\n },\n size: {\n sm: 'h-9 px-3 text-sm',\n md: 'h-11 px-5 text-sm',\n lg: 'h-12 px-6 text-base',\n },\n },\n defaultVariants: { variant: 'primary', size: 'md' },\n }\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /** Visual style of the button. */\n variant?: 'primary' | 'secondary' | 'ghost' | 'danger';\n /** Control height and padding. */\n size?: 'sm' | 'md' | 'lg';\n /** Render as the child element (e.g. an `<a>`) instead of a `<button>`. */\n asChild?: boolean;\n}\n\nexport const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button';\n return (\n <Comp ref={ref} className={cn(buttonVariants({ variant, size }), className)} {...props} />\n );\n }\n);\nButton.displayName = 'Button';\n\nexport { buttonVariants };\n"],"mappings":";;;;;AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AA2CjC;AApCN,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,OAAO;AAAA,QACP,QAAQ;AAAA,MACV;AAAA,MACA,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,IACF;AAAA,IACA,iBAAiB,EAAE,SAAS,WAAW,MAAM,KAAK;AAAA,EACpD;AACF;AAaO,IAAM,SAAe;AAAA,EAC1B,CAAC,EAAE,WAAW,SAAS,MAAM,UAAU,OAAO,GAAG,MAAM,GAAG,QAAQ;AAChE,UAAM,OAAO,UAAU,OAAO;AAC9B,WACE,oBAAC,QAAK,KAAU,WAAW,GAAG,eAAe,EAAE,SAAS,KAAK,CAAC,GAAG,SAAS,GAAI,GAAG,OAAO;AAAA,EAE5F;AACF;AACA,OAAO,cAAc;","names":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extent,
|
|
3
|
+
finite,
|
|
4
|
+
smooth
|
|
5
|
+
} from "./chunk-27MWE4F5.js";
|
|
6
|
+
import {
|
|
7
|
+
cn
|
|
8
|
+
} from "./chunk-DXRY7AS4.js";
|
|
9
|
+
|
|
10
|
+
// src/charts/sparkline.tsx
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function Sparkline({ data, width = 120, height = 34, type = "line", strokeWidth = 1.75, className }) {
|
|
13
|
+
if (data.length < 2) return null;
|
|
14
|
+
const values = finite(data);
|
|
15
|
+
const { min, range } = extent(values);
|
|
16
|
+
const step = width / (values.length - 1);
|
|
17
|
+
const pad = strokeWidth;
|
|
18
|
+
const pts = values.map((v, i) => [i * step, pad + (1 - (v - min) / range) * (height - pad * 2)]);
|
|
19
|
+
const line = smooth(pts);
|
|
20
|
+
const area = `${line} L ${width},${height} L 0,${height} Z`;
|
|
21
|
+
return /* @__PURE__ */ jsxs("svg", { viewBox: `0 0 ${width} ${height}`, width, height, fill: "none", className: cn("overflow-visible", className), "aria-hidden": "true", children: [
|
|
22
|
+
type === "area" && /* @__PURE__ */ jsx("path", { d: area, fill: "currentColor", opacity: "0.12" }),
|
|
23
|
+
/* @__PURE__ */ jsx("path", { d: line, stroke: "currentColor", strokeWidth, strokeLinecap: "round", strokeLinejoin: "round" })
|
|
24
|
+
] });
|
|
25
|
+
}
|
|
26
|
+
Sparkline.displayName = "Sparkline";
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
Sparkline
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=chunk-IAKPFV2O.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/sparkline.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport { smooth, finite, extent } from './lib/path';\n\nexport interface SparklineProps {\n /** The series of values. */\n data: number[];\n width?: number;\n height?: number;\n /** `line` or filled `area`. */\n type?: 'line' | 'area';\n strokeWidth?: number;\n className?: string;\n}\n\n/** Cairn Sparkline, a compact, axis-less trend line. Colour follows currentColor. */\nexport function Sparkline({ data, width = 120, height = 34, type = 'line', strokeWidth = 1.75, className }: SparklineProps) {\n if (data.length < 2) return null;\n const values = finite(data);\n const { min, range } = extent(values);\n const step = width / (values.length - 1);\n const pad = strokeWidth;\n const pts = values.map((v, i) => [i * step, pad + (1 - (v - min) / range) * (height - pad * 2)] as const);\n const line = smooth(pts);\n const area = `${line} L ${width},${height} L 0,${height} Z`;\n return (\n <svg viewBox={`0 0 ${width} ${height}`} width={width} height={height} fill=\"none\" className={cn('overflow-visible', className)} aria-hidden=\"true\">\n {type === 'area' && <path d={area} fill=\"currentColor\" opacity=\"0.12\" />}\n <path d={line} stroke=\"currentColor\" strokeWidth={strokeWidth} strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\nSparkline.displayName = 'Sparkline';\n"],"mappings":";;;;;;;;;;AAyBI,SACsB,KADtB;AAVG,SAAS,UAAU,EAAE,MAAM,QAAQ,KAAK,SAAS,IAAI,OAAO,QAAQ,cAAc,MAAM,UAAU,GAAmB;AAC1H,MAAI,KAAK,SAAS,EAAG,QAAO;AAC5B,QAAM,SAAS,OAAO,IAAI;AAC1B,QAAM,EAAE,KAAK,MAAM,IAAI,OAAO,MAAM;AACpC,QAAM,OAAO,SAAS,OAAO,SAAS;AACtC,QAAM,MAAM;AACZ,QAAM,MAAM,OAAO,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,MAAM,OAAO,KAAK,IAAI,OAAO,UAAU,SAAS,MAAM,EAAE,CAAU;AACxG,QAAM,OAAO,OAAO,GAAG;AACvB,QAAM,OAAO,GAAG,IAAI,MAAM,KAAK,IAAI,MAAM,QAAQ,MAAM;AACvD,SACE,qBAAC,SAAI,SAAS,OAAO,KAAK,IAAI,MAAM,IAAI,OAAc,QAAgB,MAAK,QAAO,WAAW,GAAG,oBAAoB,SAAS,GAAG,eAAY,QACzI;AAAA,aAAS,UAAU,oBAAC,UAAK,GAAG,MAAM,MAAK,gBAAe,SAAQ,QAAO;AAAA,IACtE,oBAAC,UAAK,GAAG,MAAM,QAAO,gBAAe,aAA0B,eAAc,SAAQ,gBAAe,SAAQ;AAAA,KAC9G;AAEJ;AACA,UAAU,cAAc;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/logo/logo-mark.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var LogoMark = React.forwardRef(function LogoMark2({ title = "Six Vall\xE9es", className, ...props }, ref) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
ref,
|
|
9
|
+
viewBox: "0 0 1042 648",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
role: title ? "img" : void 0,
|
|
13
|
+
"aria-label": title || void 0,
|
|
14
|
+
"aria-hidden": title ? void 0 : true,
|
|
15
|
+
className,
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsxs("g", { transform: "matrix(1,0,0,1,-21444.579167,-1926.130417)", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,21444.579167,2147.084583)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,49.399L30.241,42.796C32.086,54.442 35.102,62.856 39.287,68.037C43.481,73.219 50.326,75.81 59.84,75.81C67.933,75.81 74.388,74.354 79.215,71.443C84.041,68.531 86.458,64.233 86.458,58.558C86.458,52.596 84.154,48.013 79.535,44.824C74.925,41.627 64.38,37.476 47.917,32.364C32.441,27.537 21.472,21.68 15.016,14.8C8.552,7.911 5.329,-0.572 5.329,-10.649C5.329,-22.286 9.826,-32.268 18.846,-40.569C27.858,-48.878 40.11,-53.029 55.577,-53.029C69.64,-53.029 81.736,-49.624 91.891,-42.804C102.038,-35.994 108.389,-25.838 110.945,-12.356L83.053,-5.329C78.651,-19.383 69.493,-26.41 55.577,-26.41C48.194,-26.41 42.701,-24.989 39.079,-22.147C35.457,-19.305 33.646,-15.545 33.646,-10.865C33.646,-6.464 35.699,-3.093 39.824,-0.745C43.94,1.595 54.52,5.676 71.555,11.499C88.018,17.174 99.309,23.318 105.409,29.92C111.517,36.514 114.567,45.43 114.567,56.643C114.567,69.848 109.594,80.775 99.664,89.44C89.725,98.096 76.451,102.428 59.84,102.428C42.943,102.428 29.279,97.992 18.846,89.119C8.414,80.246 2.132,67.006 0,49.399" }) }),
|
|
19
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,22212.97625,2119.575)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,62.604L35.777,-43.229L65.585,-43.229L12.347,105.833L-13.838,105.833L0,62.604Z" }) }),
|
|
20
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(0,-4.166667,-4.166667,0,22020.05375,1939.45375)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M-14.987,-14.987C-23.264,-14.987 -29.974,-8.277 -29.974,0C-29.974,8.277 -23.264,14.987 -14.987,14.987C-6.71,14.987 0,8.277 0,0C0,-8.277 -6.71,-14.987 -14.987,-14.987" }) })
|
|
21
|
+
] })
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
});
|
|
25
|
+
LogoMark.displayName = "LogoMark";
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
LogoMark
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=chunk-IVQKYAL6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/logo/logo-mark.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface LogoMarkProps extends React.SVGProps<SVGSVGElement> {\n /** Accessible name. Pass an empty string for a purely decorative mark. */\n title?: string;\n}\n\n/**\n * Six Vallées symbol (compact mark). Colour follows `currentColor`; size with `className`.\n */\nexport const LogoMark = React.forwardRef<SVGSVGElement, LogoMarkProps>(function LogoMark(\n { title = 'Six Vallées', className, ...props },\n ref\n) {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 1042 648\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role={title ? 'img' : undefined}\n aria-label={title || undefined}\n aria-hidden={title ? undefined : true}\n className={className}\n {...props}\n >\n <g transform=\"matrix(1,0,0,1,-21444.579167,-1926.130417)\">\n <g transform=\"matrix(4.166667,0,0,4.166667,21444.579167,2147.084583)\">\n <path fillRule=\"nonzero\" d=\"M0,49.399L30.241,42.796C32.086,54.442 35.102,62.856 39.287,68.037C43.481,73.219 50.326,75.81 59.84,75.81C67.933,75.81 74.388,74.354 79.215,71.443C84.041,68.531 86.458,64.233 86.458,58.558C86.458,52.596 84.154,48.013 79.535,44.824C74.925,41.627 64.38,37.476 47.917,32.364C32.441,27.537 21.472,21.68 15.016,14.8C8.552,7.911 5.329,-0.572 5.329,-10.649C5.329,-22.286 9.826,-32.268 18.846,-40.569C27.858,-48.878 40.11,-53.029 55.577,-53.029C69.64,-53.029 81.736,-49.624 91.891,-42.804C102.038,-35.994 108.389,-25.838 110.945,-12.356L83.053,-5.329C78.651,-19.383 69.493,-26.41 55.577,-26.41C48.194,-26.41 42.701,-24.989 39.079,-22.147C35.457,-19.305 33.646,-15.545 33.646,-10.865C33.646,-6.464 35.699,-3.093 39.824,-0.745C43.94,1.595 54.52,5.676 71.555,11.499C88.018,17.174 99.309,23.318 105.409,29.92C111.517,36.514 114.567,45.43 114.567,56.643C114.567,69.848 109.594,80.775 99.664,89.44C89.725,98.096 76.451,102.428 59.84,102.428C42.943,102.428 29.279,97.992 18.846,89.119C8.414,80.246 2.132,67.006 0,49.399\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,22212.97625,2119.575)\">\n <path fillRule=\"nonzero\" d=\"M0,62.604L35.777,-43.229L65.585,-43.229L12.347,105.833L-13.838,105.833L0,62.604Z\" />\n </g>\n <g transform=\"matrix(0,-4.166667,-4.166667,0,22020.05375,1939.45375)\">\n <path fillRule=\"nonzero\" d=\"M-14.987,-14.987C-23.264,-14.987 -29.974,-8.277 -29.974,0C-29.974,8.277 -23.264,14.987 -14.987,14.987C-6.71,14.987 0,8.277 0,0C0,-8.277 -6.71,-14.987 -14.987,-14.987\" />\n </g>\n </g>\n </svg>\n );\n});\nLogoMark.displayName = 'LogoMark';\n"],"mappings":";AAAA,YAAY,WAAW;AA0BjB,SAEI,KAFJ;AAhBC,IAAM,WAAiB,iBAAyC,SAASA,UAC9E,EAAE,QAAQ,kBAAe,WAAW,GAAG,MAAM,GAC7C,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAM,QAAQ,QAAQ;AAAA,MACtB,cAAY,SAAS;AAAA,MACrB,eAAa,QAAQ,SAAY;AAAA,MACjC;AAAA,MACC,GAAG;AAAA,MAEJ,+BAAC,OAAE,WAAU,8CACX;AAAA,4BAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,++BAA8+B,GAC3gC;AAAA,QACA,oBAAC,OAAE,WAAU,sDACX,8BAAC,UAAK,UAAS,WAAU,GAAE,oFAAmF,GAChH;AAAA,QACA,oBAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,yKAAwK,GACrM;AAAA,SACF;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,SAAS,cAAc;","names":["LogoMark"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "./chunk-DXRY7AS4.js";
|
|
4
|
+
|
|
5
|
+
// src/icon/icon.tsx
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var SIZES = { sm: 16, md: 20, lg: 24, xl: 32 };
|
|
8
|
+
function Icon({ icon: Glyph, size = "md", weight = "regular", label, className }) {
|
|
9
|
+
const px = typeof size === "number" ? size : SIZES[size];
|
|
10
|
+
const a11y = label ? { role: "img", "aria-label": label } : { "aria-hidden": true };
|
|
11
|
+
return /* @__PURE__ */ jsx(Glyph, { size: px, weight, className: cn("inline-block shrink-0", className), ...a11y });
|
|
12
|
+
}
|
|
13
|
+
Icon.displayName = "Icon";
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
Icon
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=chunk-N5ZJZ7I3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/icon/icon.tsx"],"sourcesContent":["import type { Icon as PhosphorIcon, IconWeight } from '@phosphor-icons/react';\nimport { cn } from '@/lib/utils';\n\nconst SIZES = { sm: 16, md: 20, lg: 24, xl: 32 } as const;\n\nexport interface IconProps {\n /** The Phosphor icon to render, e.g. `House`. */\n icon: PhosphorIcon;\n /** Preset size (sm 16 · md 20 · lg 24 · xl 32) or a raw pixel value. */\n size?: keyof typeof SIZES | number;\n /** Stroke weight. `fill` marks a selected/active state. */\n weight?: IconWeight;\n /** Accessible label. Omit for decorative icons, they render `aria-hidden`. */\n label?: string;\n className?: string;\n}\n\n/**\n * Cairn Icon, a thin wrapper over Phosphor. Standardises size and weight, and makes\n * accessibility the default: decorative unless a `label` is given.\n */\nexport function Icon({ icon: Glyph, size = 'md', weight = 'regular', label, className }: IconProps) {\n const px = typeof size === 'number' ? size : SIZES[size];\n const a11y = label\n ? { role: 'img' as const, 'aria-label': label }\n : { 'aria-hidden': true as const };\n return <Glyph size={px} weight={weight} className={cn('inline-block shrink-0', className)} {...a11y} />;\n}\nIcon.displayName = 'Icon';\n"],"mappings":";;;;;AA0BS;AAvBT,IAAM,QAAQ,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAkBxC,SAAS,KAAK,EAAE,MAAM,OAAO,OAAO,MAAM,SAAS,WAAW,OAAO,UAAU,GAAc;AAClG,QAAM,KAAK,OAAO,SAAS,WAAW,OAAO,MAAM,IAAI;AACvD,QAAM,OAAO,QACT,EAAE,MAAM,OAAgB,cAAc,MAAM,IAC5C,EAAE,eAAe,KAAc;AACnC,SAAO,oBAAC,SAAM,MAAM,IAAI,QAAgB,WAAW,GAAG,yBAAyB,SAAS,GAAI,GAAG,MAAM;AACvG;AACA,KAAK,cAAc;","names":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
chartToken,
|
|
5
|
+
toneFill
|
|
6
|
+
} from "./chunk-WBTUZO4N.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-DXRY7AS4.js";
|
|
10
|
+
|
|
11
|
+
// src/charts/ring.tsx
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function Ring({
|
|
15
|
+
value,
|
|
16
|
+
size = 160,
|
|
17
|
+
thickness = 14,
|
|
18
|
+
tone = "ink",
|
|
19
|
+
color,
|
|
20
|
+
casing = false,
|
|
21
|
+
animate = true,
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
"aria-label": ariaLabel
|
|
25
|
+
}) {
|
|
26
|
+
const pct = Math.min(Math.max(Number.isFinite(value) ? value : 0, 0), 100);
|
|
27
|
+
const r = (size - thickness) / 2;
|
|
28
|
+
const c = 2 * Math.PI * r;
|
|
29
|
+
const [progress, setProgress] = React.useState(animate ? 0 : pct);
|
|
30
|
+
const [instant, setInstant] = React.useState(!animate);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
if (!animate) {
|
|
33
|
+
setProgress(pct);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const reduce = typeof window !== "undefined" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
|
|
37
|
+
if (reduce) {
|
|
38
|
+
setInstant(true);
|
|
39
|
+
setProgress(pct);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
setInstant(false);
|
|
43
|
+
const id = requestAnimationFrame(() => setProgress(pct));
|
|
44
|
+
return () => cancelAnimationFrame(id);
|
|
45
|
+
}, [pct, animate]);
|
|
46
|
+
const arc = progress / 100 * c;
|
|
47
|
+
const motion = instant ? void 0 : "transition-[stroke-dasharray] duration-[900ms] ease-out";
|
|
48
|
+
const stroke = color ?? toneFill(tone);
|
|
49
|
+
return /* @__PURE__ */ jsxs(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: cn("relative inline-grid place-items-center", className),
|
|
53
|
+
style: { width: size, height: size },
|
|
54
|
+
role: "img",
|
|
55
|
+
"aria-label": ariaLabel ?? `${Math.round(pct)}%`,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, className: "rotate-[-90deg]", "aria-hidden": "true", children: [
|
|
58
|
+
/* @__PURE__ */ jsx("circle", { cx: size / 2, cy: size / 2, r, fill: "none", stroke: chartToken.track, strokeWidth: thickness }),
|
|
59
|
+
casing && /* @__PURE__ */ jsx(
|
|
60
|
+
"circle",
|
|
61
|
+
{
|
|
62
|
+
cx: size / 2,
|
|
63
|
+
cy: size / 2,
|
|
64
|
+
r,
|
|
65
|
+
fill: "none",
|
|
66
|
+
stroke: typeof casing === "string" ? casing : "var(--sv-sys-color-on-surface)",
|
|
67
|
+
strokeWidth: thickness + 2,
|
|
68
|
+
strokeLinecap: "round",
|
|
69
|
+
strokeDasharray: `${arc} ${c - arc}`,
|
|
70
|
+
className: motion
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
"circle",
|
|
75
|
+
{
|
|
76
|
+
cx: size / 2,
|
|
77
|
+
cy: size / 2,
|
|
78
|
+
r,
|
|
79
|
+
fill: "none",
|
|
80
|
+
stroke,
|
|
81
|
+
strokeWidth: thickness,
|
|
82
|
+
strokeLinecap: "round",
|
|
83
|
+
strokeDasharray: `${arc} ${c - arc}`,
|
|
84
|
+
className: motion
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }),
|
|
88
|
+
children != null && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 grid place-items-center", children })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
Ring.displayName = "Ring";
|
|
94
|
+
|
|
95
|
+
export {
|
|
96
|
+
Ring
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=chunk-OIL3X3BZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/ring.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { chartToken, toneFill } from './lib/series';\n\nexport interface RingProps {\n /** Progress, 0-100. */\n value: number;\n /** Outer diameter in px. */\n size?: number;\n /** Ring thickness in px. */\n thickness?: number;\n /** Colour of the filled arc. Defaults to ink; `accent` uses categorical blue. */\n tone?: 'ink' | 'accent';\n /**\n * Explicit arc colour (a token / CSS colour), overrides `tone`. Pass only colours that\n * clear 3:1 against the surface as a thin stroke, ink, blue, or a dark graphite. Acid\n * and mid-gray are fill-only (they fail as a line); see AGENTS.md rule 9.\n */\n color?: string;\n /**\n * Draw a darker keyline under the arc so a light, low-contrast colour (acid) stays\n * perceptible, the rim carries the 3:1 shape contrast the fill can't (AGENTS.md rule 9).\n * `true` uses ink; pass a colour (e.g. `sys.color.accent-edge`) for a tonal, in-family rim.\n */\n casing?: boolean | string;\n /** Fill the arc from empty on mount. Honours `prefers-reduced-motion`. */\n animate?: boolean;\n /** Centre content, e.g. the value. Omit for a bare ring. */\n children?: React.ReactNode;\n /** Accessible label; falls back to \"<value>%\". */\n 'aria-label'?: string;\n className?: string;\n}\n\n/**\n * Cairn Ring, single-value radial progress. Grayscale by default (ink arc on a\n * neutral track); `tone=\"accent\"` opts into the categorical blue, or pass an explicit\n * `color`. The arc fills from empty on mount (rounded cap, 12 o'clock, clockwise).\n * Zero-dependency SVG. A client component (`'use client'`): the mount animation uses state;\n * pass `animate={false}` to render it statically.\n */\nexport function Ring({\n value,\n size = 160,\n thickness = 14,\n tone = 'ink',\n color,\n casing = false,\n animate = true,\n children,\n className,\n 'aria-label': ariaLabel,\n}: RingProps) {\n const pct = Math.min(Math.max(Number.isFinite(value) ? value : 0, 0), 100);\n const r = (size - thickness) / 2;\n const c = 2 * Math.PI * r;\n\n // Fill from empty on mount: first client paint is 0, then rAF advances to the value so the\n // CSS transition animates. Under prefers-reduced-motion we jump straight to the value with the\n // transition removed — self-contained, never relying on a global reduced-motion rule existing.\n const [progress, setProgress] = React.useState(animate ? 0 : pct);\n const [instant, setInstant] = React.useState(!animate);\n React.useEffect(() => {\n if (!animate) {\n setProgress(pct);\n return;\n }\n const reduce =\n typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;\n if (reduce) {\n setInstant(true);\n setProgress(pct);\n return;\n }\n setInstant(false);\n const id = requestAnimationFrame(() => setProgress(pct));\n return () => cancelAnimationFrame(id);\n }, [pct, animate]);\n\n const arc = (progress / 100) * c;\n const motion = instant ? undefined : 'transition-[stroke-dasharray] duration-[900ms] ease-out';\n const stroke = color ?? toneFill(tone);\n return (\n <div\n className={cn('relative inline-grid place-items-center', className)}\n style={{ width: size, height: size }}\n role=\"img\"\n aria-label={ariaLabel ?? `${Math.round(pct)}%`}\n >\n <svg width={size} height={size} viewBox={`0 0 ${size} ${size}`} className=\"rotate-[-90deg]\" aria-hidden=\"true\">\n <circle cx={size / 2} cy={size / 2} r={r} fill=\"none\" stroke={chartToken.track} strokeWidth={thickness} />\n {casing && (\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke={typeof casing === 'string' ? casing : 'var(--sv-sys-color-on-surface)'}\n strokeWidth={thickness + 2}\n strokeLinecap=\"round\"\n strokeDasharray={`${arc} ${c - arc}`}\n className={motion}\n />\n )}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={r}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={thickness}\n strokeLinecap=\"round\"\n strokeDasharray={`${arc} ${c - arc}`}\n className={motion}\n />\n </svg>\n {children != null && <div className=\"absolute inset-0 grid place-items-center\">{children}</div>}\n </div>\n );\n}\nRing.displayName = 'Ring';\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAyFjB,SACE,KADF;AAhDC,SAAS,KAAK;AAAA,EACnB;AAAA,EACA,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP;AAAA,EACA,SAAS;AAAA,EACT,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,cAAc;AAChB,GAAc;AACZ,QAAM,MAAM,KAAK,IAAI,KAAK,IAAI,OAAO,SAAS,KAAK,IAAI,QAAQ,GAAG,CAAC,GAAG,GAAG;AACzE,QAAM,KAAK,OAAO,aAAa;AAC/B,QAAM,IAAI,IAAI,KAAK,KAAK;AAKxB,QAAM,CAAC,UAAU,WAAW,IAAU,eAAS,UAAU,IAAI,GAAG;AAChE,QAAM,CAAC,SAAS,UAAU,IAAU,eAAS,CAAC,OAAO;AACrD,EAAM,gBAAU,MAAM;AACpB,QAAI,CAAC,SAAS;AACZ,kBAAY,GAAG;AACf;AAAA,IACF;AACA,UAAM,SACJ,OAAO,WAAW,eAAe,OAAO,aAAa,kCAAkC,EAAE;AAC3F,QAAI,QAAQ;AACV,iBAAW,IAAI;AACf,kBAAY,GAAG;AACf;AAAA,IACF;AACA,eAAW,KAAK;AAChB,UAAM,KAAK,sBAAsB,MAAM,YAAY,GAAG,CAAC;AACvD,WAAO,MAAM,qBAAqB,EAAE;AAAA,EACtC,GAAG,CAAC,KAAK,OAAO,CAAC;AAEjB,QAAM,MAAO,WAAW,MAAO;AAC/B,QAAM,SAAS,UAAU,SAAY;AACrC,QAAM,SAAS,SAAS,SAAS,IAAI;AACrC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,2CAA2C,SAAS;AAAA,MAClE,OAAO,EAAE,OAAO,MAAM,QAAQ,KAAK;AAAA,MACnC,MAAK;AAAA,MACL,cAAY,aAAa,GAAG,KAAK,MAAM,GAAG,CAAC;AAAA,MAE3C;AAAA,6BAAC,SAAI,OAAO,MAAM,QAAQ,MAAM,SAAS,OAAO,IAAI,IAAI,IAAI,IAAI,WAAU,mBAAkB,eAAY,QACtG;AAAA,8BAAC,YAAO,IAAI,OAAO,GAAG,IAAI,OAAO,GAAG,GAAM,MAAK,QAAO,QAAQ,WAAW,OAAO,aAAa,WAAW;AAAA,UACvG,UACC;AAAA,YAAC;AAAA;AAAA,cACC,IAAI,OAAO;AAAA,cACX,IAAI,OAAO;AAAA,cACX;AAAA,cACA,MAAK;AAAA,cACL,QAAQ,OAAO,WAAW,WAAW,SAAS;AAAA,cAC9C,aAAa,YAAY;AAAA,cACzB,eAAc;AAAA,cACd,iBAAiB,GAAG,GAAG,IAAI,IAAI,GAAG;AAAA,cAClC,WAAW;AAAA;AAAA,UACb;AAAA,UAEF;AAAA,YAAC;AAAA;AAAA,cACC,IAAI,OAAO;AAAA,cACX,IAAI,OAAO;AAAA,cACX;AAAA,cACA,MAAK;AAAA,cACL;AAAA,cACA,aAAa;AAAA,cACb,eAAc;AAAA,cACd,iBAAiB,GAAG,GAAG,IAAI,IAAI,GAAG;AAAA,cAClC,WAAW;AAAA;AAAA,UACb;AAAA,WACF;AAAA,QACC,YAAY,QAAQ,oBAAC,SAAI,WAAU,4CAA4C,UAAS;AAAA;AAAA;AAAA,EAC3F;AAEJ;AACA,KAAK,cAAc;","names":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/logo/logo.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
var Logo = React.forwardRef(function Logo2({ title = "Six Vall\xE9es", className, ...props }, ref) {
|
|
5
|
+
return /* @__PURE__ */ jsx(
|
|
6
|
+
"svg",
|
|
7
|
+
{
|
|
8
|
+
ref,
|
|
9
|
+
viewBox: "0 0 3528 570",
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
12
|
+
role: title ? "img" : void 0,
|
|
13
|
+
"aria-label": title || void 0,
|
|
14
|
+
"aria-hidden": title ? void 0 : true,
|
|
15
|
+
className,
|
|
16
|
+
...props,
|
|
17
|
+
children: /* @__PURE__ */ jsxs("g", { transform: "matrix(1,0,0,1,-38236.28375,-1970.557917)", children: [
|
|
18
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,38236.28375,2181.884167)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,40.893L22.244,36.051C23.917,46.695 26.756,54.41 30.764,59.188C34.769,63.974 41.375,66.364 50.585,66.364C58.237,66.364 64.218,64.843 68.523,61.795C72.827,58.74 74.98,54.592 74.98,49.322C74.98,44.067 72.976,39.94 68.972,36.948C64.964,33.963 55.906,30.312 41.795,26.003C28.639,21.939 19.222,16.978 13.543,11.12C7.862,5.262 5.022,-1.857 5.022,-10.23C5.022,-19.795 8.727,-27.986 16.144,-34.804C23.558,-41.622 33.602,-45.027 46.28,-45.027C58.12,-45.027 68.224,-42.126 76.595,-36.331C84.964,-30.53 90.107,-21.946 92.021,-10.588L71.393,-5.564C69.716,-11.779 66.968,-16.628 63.142,-20.096C59.313,-23.565 53.693,-25.295 46.28,-25.295C39.464,-25.295 34.352,-23.922 30.943,-21.168C27.534,-18.421 25.831,-14.834 25.831,-10.405C25.831,-6.341 27.683,-3.111 31.391,-0.722C35.096,1.675 43.827,5.199 57.58,9.859C72.407,14.883 82.483,20.145 87.807,25.646C93.127,31.146 95.789,38.623 95.789,48.068C95.789,58.95 91.69,67.982 83.501,75.157C75.308,82.333 64.277,85.92 50.405,85.92C35.935,85.92 24.395,82.122 15.785,74.527C7.175,66.938 1.911,55.727 0,40.893" }) }),
|
|
19
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,36000,187.379167)", children: /* @__PURE__ */ jsx("rect", { x: "651.688", y: "473.118", width: "20.448", height: "88.793" }) }),
|
|
20
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,38869.324167,2132.544167)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,95.071L32.826,46.099L1.972,0L23.498,0L45.563,33.542L45.921,33.542L67.805,0L89.331,0L58.658,46.099L91.305,95.071L69.24,95.071L45.742,59.37L45.383,59.37L22.063,95.071L0,95.071Z" }) }),
|
|
21
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,39935.577917,2299.980833)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,14.701C-6.699,16.383 -11.152,18.289 -13.364,20.447C-15.578,22.598 -16.682,25.226 -16.682,28.337C-16.682,35.988 -11.479,39.814 -1.076,39.814C6.576,39.814 12.346,38.266 16.234,35.154C20.119,32.043 22.063,28.281 22.063,23.852L22.063,4.835L21.706,4.835C21.226,5.795 20.599,6.629 19.821,7.351C19.043,8.065 17.011,9.081 13.723,10.399C10.432,11.716 5.858,13.152 0,14.701M24.397,54.886L24.397,45.378L24.038,45.378C23.558,46.092 22.841,46.961 21.885,47.977C20.926,48.993 19.401,50.311 17.311,51.922C15.217,53.541 12.406,54.886 8.88,55.958C5.352,57.037 1.435,57.577 -2.869,57.577C-13.991,57.577 -22.363,54.914 -27.983,49.596C-33.606,44.271 -36.414,37.663 -36.414,29.773C-36.414,21.638 -33.965,15.395 -29.06,11.029C-24.157,6.664 -15.846,3.041 -4.125,0.175C6.396,-2.452 13.275,-4.638 16.503,-6.376C19.732,-8.107 21.347,-10.65 21.347,-14C21.347,-17.223 19.881,-19.914 16.952,-22.072C14.019,-24.223 9.687,-25.295 3.947,-25.295C-2.631,-25.295 -7.443,-23.803 -10.493,-20.811C-13.543,-17.826 -15.785,-13.755 -17.22,-8.618L-34.62,-15.254C-32.588,-23.382 -28.342,-30.018 -21.885,-35.161C-15.426,-40.304 -6.995,-42.876 3.409,-42.876C14.888,-42.876 24.155,-39.947 31.213,-34.089C38.267,-28.224 41.795,-19.08 41.795,-6.642L41.795,54.886L24.397,54.886Z" }) }),
|
|
22
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,36000,11.729167)", children: /* @__PURE__ */ jsx("rect", { x: "1011.445", y: "473.119", width: "21.167", height: "130.947" }) }),
|
|
23
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,36000,11.729167)", children: /* @__PURE__ */ jsx("rect", { x: "1059.517", y: "473.119", width: "21.167", height: "130.947" }) }),
|
|
24
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,40675.49,2369.469167)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,-18.653L46.281,-18.653C45.922,-25.352 43.769,-30.824 39.823,-35.07C35.876,-39.31 30.255,-41.44 22.962,-41.44C16.144,-41.44 10.702,-39.163 6.637,-34.622C2.572,-30.074 0.359,-24.756 0,-18.653M48.613,6.635L63.323,18.652C54.112,33.486 40.958,40.9 23.859,40.9C10.702,40.9 -0.03,36.324 -8.34,27.173C-16.654,18.029 -20.807,5.858 -20.807,-9.327C-20.807,-24.511 -16.682,-36.682 -8.429,-45.833C-0.179,-54.977 10.285,-59.553 22.962,-59.553C35.636,-59.553 46.012,-55.005 54.084,-45.924C62.156,-36.829 66.192,-24.637 66.192,-9.327L66.192,-3.231L-0.179,-3.231C0.06,4.666 2.242,10.973 6.369,15.695C10.495,20.418 16.204,22.78 23.5,22.78C26.967,22.78 30.074,22.303 32.828,21.343C35.576,20.39 37.999,18.954 40.092,17.041C42.182,15.128 43.769,13.453 44.845,12.017C45.922,10.58 47.178,8.787 48.613,6.635" }) }),
|
|
25
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,41097.772083,2369.469167)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,-18.653L46.281,-18.653C45.922,-25.352 43.769,-30.824 39.823,-35.07C35.876,-39.31 30.255,-41.44 22.962,-41.44C16.144,-41.44 10.702,-39.163 6.637,-34.622C2.572,-30.074 0.359,-24.756 0,-18.653M48.613,6.635L63.323,18.652C54.112,33.486 40.958,40.9 23.859,40.9C10.702,40.9 -0.03,36.324 -8.34,27.173C-16.654,18.029 -20.807,5.858 -20.807,-9.327C-20.807,-24.511 -16.682,-36.682 -8.429,-45.833C-0.179,-54.977 10.285,-59.553 22.962,-59.553C35.636,-59.553 46.012,-55.005 54.084,-45.924C62.156,-36.829 66.192,-24.637 66.192,-9.327L66.192,-3.231L-0.179,-3.231C0.06,4.666 2.242,10.973 6.369,15.695C10.495,20.418 16.204,22.78 23.5,22.78C26.967,22.78 30.074,22.303 32.828,21.343C35.576,20.39 37.999,18.954 40.092,17.041C42.182,15.128 43.769,13.453 44.845,12.017C45.922,10.58 47.178,8.787 48.613,6.635" }) }),
|
|
26
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,41429.620417,2264.828333)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,31.574L18.656,27.09C20.329,41.559 27.983,48.79 41.616,48.79C47.953,48.79 52.885,47.69 56.415,45.476C59.942,43.262 61.707,40.305 61.707,36.591C61.707,33.003 60.092,30.376 56.864,28.701C53.635,27.026 46.518,24.637 35.517,21.526C24.395,18.415 16.293,14.743 11.211,10.497C6.128,6.251 3.588,0.659 3.588,-6.278C3.588,-13.93 6.695,-20.537 12.916,-26.101C19.133,-31.657 27.683,-34.439 38.567,-34.439C59.493,-34.439 72.47,-25.169 77.492,-6.635L60.271,-1.611C56.683,-12.136 49.447,-17.398 38.567,-17.398C33.423,-17.398 29.419,-16.382 26.548,-14.35C23.678,-12.318 22.244,-9.922 22.244,-7.175C22.244,-4.064 23.827,-1.702 26.996,-0.091C30.163,1.528 37.908,4.064 50.226,7.533C61.707,10.763 69.569,14.652 73.815,19.193C78.058,23.74 80.183,29.661 80.183,36.955C80.183,44.488 76.983,51.215 70.585,57.136C64.188,63.05 54.77,66.013 42.333,66.013C29.298,66.013 19.311,62.692 12.378,56.057C5.441,49.421 1.314,41.258 0,31.574" }) }),
|
|
27
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(0,-4.166667,-4.166667,0,39388.936667,2005.484583)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M-12.625,-12.626C-19.598,-12.626 -25.251,-6.973 -25.251,-0C-25.251,6.972 -19.598,12.625 -12.625,12.625C-5.652,12.625 0,6.972 0,-0C0,-6.973 -5.652,-12.626 -12.625,-12.626" }) }),
|
|
28
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(0,-4.166667,-4.166667,0,40770.042917,1970.557917)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M-12.626,-12.625C-19.599,-12.625 -25.251,-6.972 -25.251,-0C-25.251,6.973 -19.599,12.626 -12.626,12.626C-5.653,12.626 0,6.973 0,-0C0,-6.972 -5.653,-12.625 -12.626,-12.625" }) }),
|
|
29
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(4.166667,0,0,4.166667,39551.4625,2157.219167)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M0,52.74L30.14,-36.417L55.25,-36.417L10.402,89.157L-11.657,89.157L0,52.74Z" }) }),
|
|
30
|
+
/* @__PURE__ */ jsx("g", { transform: "matrix(0,-4.166667,-4.166667,0,38757.969583,2008.057917)", children: /* @__PURE__ */ jsx("path", { fillRule: "nonzero", d: "M-12.626,-12.625C-19.599,-12.625 -25.251,-6.972 -25.251,0.001C-25.251,6.973 -19.599,12.626 -12.626,12.626C-5.653,12.626 0,6.973 0,0.001C0,-6.972 -5.653,-12.625 -12.626,-12.625" }) })
|
|
31
|
+
] })
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
Logo.displayName = "Logo";
|
|
36
|
+
|
|
37
|
+
export {
|
|
38
|
+
Logo
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=chunk-QZYA5GS2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/logo/logo.tsx"],"sourcesContent":["import * as React from 'react';\n\nexport interface LogoProps extends React.SVGProps<SVGSVGElement> {\n /** Accessible name. Pass an empty string for a purely decorative logo. */\n title?: string;\n}\n\n/**\n * Six Vallées wordmark. Colour follows `currentColor`, set it via `text-*` / CSS `color`.\n * Size it with `className` (e.g. `h-6 w-auto`).\n */\nexport const Logo = React.forwardRef<SVGSVGElement, LogoProps>(function Logo(\n { title = 'Six Vallées', className, ...props },\n ref\n) {\n return (\n <svg\n ref={ref}\n viewBox=\"0 0 3528 570\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n role={title ? 'img' : undefined}\n aria-label={title || undefined}\n aria-hidden={title ? undefined : true}\n className={className}\n {...props}\n >\n <g transform=\"matrix(1,0,0,1,-38236.28375,-1970.557917)\">\n <g transform=\"matrix(4.166667,0,0,4.166667,38236.28375,2181.884167)\">\n <path fillRule=\"nonzero\" d=\"M0,40.893L22.244,36.051C23.917,46.695 26.756,54.41 30.764,59.188C34.769,63.974 41.375,66.364 50.585,66.364C58.237,66.364 64.218,64.843 68.523,61.795C72.827,58.74 74.98,54.592 74.98,49.322C74.98,44.067 72.976,39.94 68.972,36.948C64.964,33.963 55.906,30.312 41.795,26.003C28.639,21.939 19.222,16.978 13.543,11.12C7.862,5.262 5.022,-1.857 5.022,-10.23C5.022,-19.795 8.727,-27.986 16.144,-34.804C23.558,-41.622 33.602,-45.027 46.28,-45.027C58.12,-45.027 68.224,-42.126 76.595,-36.331C84.964,-30.53 90.107,-21.946 92.021,-10.588L71.393,-5.564C69.716,-11.779 66.968,-16.628 63.142,-20.096C59.313,-23.565 53.693,-25.295 46.28,-25.295C39.464,-25.295 34.352,-23.922 30.943,-21.168C27.534,-18.421 25.831,-14.834 25.831,-10.405C25.831,-6.341 27.683,-3.111 31.391,-0.722C35.096,1.675 43.827,5.199 57.58,9.859C72.407,14.883 82.483,20.145 87.807,25.646C93.127,31.146 95.789,38.623 95.789,48.068C95.789,58.95 91.69,67.982 83.501,75.157C75.308,82.333 64.277,85.92 50.405,85.92C35.935,85.92 24.395,82.122 15.785,74.527C7.175,66.938 1.911,55.727 0,40.893\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,36000,187.379167)\">\n <rect x=\"651.688\" y=\"473.118\" width=\"20.448\" height=\"88.793\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,38869.324167,2132.544167)\">\n <path fillRule=\"nonzero\" d=\"M0,95.071L32.826,46.099L1.972,0L23.498,0L45.563,33.542L45.921,33.542L67.805,0L89.331,0L58.658,46.099L91.305,95.071L69.24,95.071L45.742,59.37L45.383,59.37L22.063,95.071L0,95.071Z\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,39935.577917,2299.980833)\">\n <path fillRule=\"nonzero\" d=\"M0,14.701C-6.699,16.383 -11.152,18.289 -13.364,20.447C-15.578,22.598 -16.682,25.226 -16.682,28.337C-16.682,35.988 -11.479,39.814 -1.076,39.814C6.576,39.814 12.346,38.266 16.234,35.154C20.119,32.043 22.063,28.281 22.063,23.852L22.063,4.835L21.706,4.835C21.226,5.795 20.599,6.629 19.821,7.351C19.043,8.065 17.011,9.081 13.723,10.399C10.432,11.716 5.858,13.152 0,14.701M24.397,54.886L24.397,45.378L24.038,45.378C23.558,46.092 22.841,46.961 21.885,47.977C20.926,48.993 19.401,50.311 17.311,51.922C15.217,53.541 12.406,54.886 8.88,55.958C5.352,57.037 1.435,57.577 -2.869,57.577C-13.991,57.577 -22.363,54.914 -27.983,49.596C-33.606,44.271 -36.414,37.663 -36.414,29.773C-36.414,21.638 -33.965,15.395 -29.06,11.029C-24.157,6.664 -15.846,3.041 -4.125,0.175C6.396,-2.452 13.275,-4.638 16.503,-6.376C19.732,-8.107 21.347,-10.65 21.347,-14C21.347,-17.223 19.881,-19.914 16.952,-22.072C14.019,-24.223 9.687,-25.295 3.947,-25.295C-2.631,-25.295 -7.443,-23.803 -10.493,-20.811C-13.543,-17.826 -15.785,-13.755 -17.22,-8.618L-34.62,-15.254C-32.588,-23.382 -28.342,-30.018 -21.885,-35.161C-15.426,-40.304 -6.995,-42.876 3.409,-42.876C14.888,-42.876 24.155,-39.947 31.213,-34.089C38.267,-28.224 41.795,-19.08 41.795,-6.642L41.795,54.886L24.397,54.886Z\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,36000,11.729167)\">\n <rect x=\"1011.445\" y=\"473.119\" width=\"21.167\" height=\"130.947\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,36000,11.729167)\">\n <rect x=\"1059.517\" y=\"473.119\" width=\"21.167\" height=\"130.947\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,40675.49,2369.469167)\">\n <path fillRule=\"nonzero\" d=\"M0,-18.653L46.281,-18.653C45.922,-25.352 43.769,-30.824 39.823,-35.07C35.876,-39.31 30.255,-41.44 22.962,-41.44C16.144,-41.44 10.702,-39.163 6.637,-34.622C2.572,-30.074 0.359,-24.756 0,-18.653M48.613,6.635L63.323,18.652C54.112,33.486 40.958,40.9 23.859,40.9C10.702,40.9 -0.03,36.324 -8.34,27.173C-16.654,18.029 -20.807,5.858 -20.807,-9.327C-20.807,-24.511 -16.682,-36.682 -8.429,-45.833C-0.179,-54.977 10.285,-59.553 22.962,-59.553C35.636,-59.553 46.012,-55.005 54.084,-45.924C62.156,-36.829 66.192,-24.637 66.192,-9.327L66.192,-3.231L-0.179,-3.231C0.06,4.666 2.242,10.973 6.369,15.695C10.495,20.418 16.204,22.78 23.5,22.78C26.967,22.78 30.074,22.303 32.828,21.343C35.576,20.39 37.999,18.954 40.092,17.041C42.182,15.128 43.769,13.453 44.845,12.017C45.922,10.58 47.178,8.787 48.613,6.635\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,41097.772083,2369.469167)\">\n <path fillRule=\"nonzero\" d=\"M0,-18.653L46.281,-18.653C45.922,-25.352 43.769,-30.824 39.823,-35.07C35.876,-39.31 30.255,-41.44 22.962,-41.44C16.144,-41.44 10.702,-39.163 6.637,-34.622C2.572,-30.074 0.359,-24.756 0,-18.653M48.613,6.635L63.323,18.652C54.112,33.486 40.958,40.9 23.859,40.9C10.702,40.9 -0.03,36.324 -8.34,27.173C-16.654,18.029 -20.807,5.858 -20.807,-9.327C-20.807,-24.511 -16.682,-36.682 -8.429,-45.833C-0.179,-54.977 10.285,-59.553 22.962,-59.553C35.636,-59.553 46.012,-55.005 54.084,-45.924C62.156,-36.829 66.192,-24.637 66.192,-9.327L66.192,-3.231L-0.179,-3.231C0.06,4.666 2.242,10.973 6.369,15.695C10.495,20.418 16.204,22.78 23.5,22.78C26.967,22.78 30.074,22.303 32.828,21.343C35.576,20.39 37.999,18.954 40.092,17.041C42.182,15.128 43.769,13.453 44.845,12.017C45.922,10.58 47.178,8.787 48.613,6.635\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,41429.620417,2264.828333)\">\n <path fillRule=\"nonzero\" d=\"M0,31.574L18.656,27.09C20.329,41.559 27.983,48.79 41.616,48.79C47.953,48.79 52.885,47.69 56.415,45.476C59.942,43.262 61.707,40.305 61.707,36.591C61.707,33.003 60.092,30.376 56.864,28.701C53.635,27.026 46.518,24.637 35.517,21.526C24.395,18.415 16.293,14.743 11.211,10.497C6.128,6.251 3.588,0.659 3.588,-6.278C3.588,-13.93 6.695,-20.537 12.916,-26.101C19.133,-31.657 27.683,-34.439 38.567,-34.439C59.493,-34.439 72.47,-25.169 77.492,-6.635L60.271,-1.611C56.683,-12.136 49.447,-17.398 38.567,-17.398C33.423,-17.398 29.419,-16.382 26.548,-14.35C23.678,-12.318 22.244,-9.922 22.244,-7.175C22.244,-4.064 23.827,-1.702 26.996,-0.091C30.163,1.528 37.908,4.064 50.226,7.533C61.707,10.763 69.569,14.652 73.815,19.193C78.058,23.74 80.183,29.661 80.183,36.955C80.183,44.488 76.983,51.215 70.585,57.136C64.188,63.05 54.77,66.013 42.333,66.013C29.298,66.013 19.311,62.692 12.378,56.057C5.441,49.421 1.314,41.258 0,31.574\" />\n </g>\n <g transform=\"matrix(0,-4.166667,-4.166667,0,39388.936667,2005.484583)\">\n <path fillRule=\"nonzero\" d=\"M-12.625,-12.626C-19.598,-12.626 -25.251,-6.973 -25.251,-0C-25.251,6.972 -19.598,12.625 -12.625,12.625C-5.652,12.625 0,6.972 0,-0C0,-6.973 -5.652,-12.626 -12.625,-12.626\" />\n </g>\n <g transform=\"matrix(0,-4.166667,-4.166667,0,40770.042917,1970.557917)\">\n <path fillRule=\"nonzero\" d=\"M-12.626,-12.625C-19.599,-12.625 -25.251,-6.972 -25.251,-0C-25.251,6.973 -19.599,12.626 -12.626,12.626C-5.653,12.626 0,6.973 0,-0C0,-6.972 -5.653,-12.625 -12.626,-12.625\" />\n </g>\n <g transform=\"matrix(4.166667,0,0,4.166667,39551.4625,2157.219167)\">\n <path fillRule=\"nonzero\" d=\"M0,52.74L30.14,-36.417L55.25,-36.417L10.402,89.157L-11.657,89.157L0,52.74Z\" />\n </g>\n <g transform=\"matrix(0,-4.166667,-4.166667,0,38757.969583,2008.057917)\">\n <path fillRule=\"nonzero\" d=\"M-12.626,-12.625C-19.599,-12.625 -25.251,-6.972 -25.251,0.001C-25.251,6.973 -19.599,12.626 -12.626,12.626C-5.653,12.626 0,6.973 0,0.001C0,-6.972 -5.653,-12.625 -12.626,-12.625\" />\n </g>\n </g>\n </svg>\n );\n});\nLogo.displayName = 'Logo';\n"],"mappings":";AAAA,YAAY,WAAW;AA2BjB,SAEI,KAFJ;AAhBC,IAAM,OAAa,iBAAqC,SAASA,MACtE,EAAE,QAAQ,kBAAe,WAAW,GAAG,MAAM,GAC7C,KACA;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,SAAQ;AAAA,MACR,MAAK;AAAA,MACL,OAAM;AAAA,MACN,MAAM,QAAQ,QAAQ;AAAA,MACtB,cAAY,SAAS;AAAA,MACrB,eAAa,QAAQ,SAAY;AAAA,MACjC;AAAA,MACC,GAAG;AAAA,MAEJ,+BAAC,OAAE,WAAU,6CACX;AAAA,4BAAC,OAAE,WAAU,yDACX,8BAAC,UAAK,UAAS,WAAU,GAAE,ghCAA+gC,GAC5iC;AAAA,QACA,oBAAC,OAAE,WAAU,kDACX,8BAAC,UAAK,GAAE,WAAU,GAAE,WAAU,OAAM,UAAS,QAAO,UAAS,GAC/D;AAAA,QACA,oBAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,qLAAoL,GACjN;AAAA,QACA,oBAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,otCAAmtC,GAChvC;AAAA,QACA,oBAAC,OAAE,WAAU,iDACX,8BAAC,UAAK,GAAE,YAAW,GAAE,WAAU,OAAM,UAAS,QAAO,WAAU,GACjE;AAAA,QACA,oBAAC,OAAE,WAAU,iDACX,8BAAC,UAAK,GAAE,YAAW,GAAE,WAAU,OAAM,UAAS,QAAO,WAAU,GACjE;AAAA,QACA,oBAAC,OAAE,WAAU,sDACX,8BAAC,UAAK,UAAS,WAAU,GAAE,sxBAAqxB,GAClzB;AAAA,QACA,oBAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,sxBAAqxB,GAClzB;AAAA,QACA,oBAAC,OAAE,WAAU,0DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,84BAA64B,GAC16B;AAAA,QACA,oBAAC,OAAE,WAAU,4DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,6KAA4K,GACzM;AAAA,QACA,oBAAC,OAAE,WAAU,4DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,6KAA4K,GACzM;AAAA,QACA,oBAAC,OAAE,WAAU,wDACX,8BAAC,UAAK,UAAS,WAAU,GAAE,8EAA6E,GAC1G;AAAA,QACA,oBAAC,OAAE,WAAU,4DACX,8BAAC,UAAK,UAAS,WAAU,GAAE,mLAAkL,GAC/M;AAAA,SACF;AAAA;AAAA,EACF;AAEJ,CAAC;AACD,KAAK,cAAc;","names":["Logo"]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
chartToken,
|
|
5
|
+
toneFill
|
|
6
|
+
} from "./chunk-WBTUZO4N.js";
|
|
7
|
+
import {
|
|
8
|
+
cn
|
|
9
|
+
} from "./chunk-DXRY7AS4.js";
|
|
10
|
+
|
|
11
|
+
// src/charts/bar-chart.tsx
|
|
12
|
+
import * as React from "react";
|
|
13
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
|
+
function BarChart({ data, height = 200, showValue = true, tone = "ink", className }) {
|
|
15
|
+
const max = Math.max(...data.map((d) => Number.isFinite(d.value) ? d.value : 0), 1);
|
|
16
|
+
const [hover, setHover] = React.useState(null);
|
|
17
|
+
const activeFill = toneFill(tone);
|
|
18
|
+
const mutedFill = chartToken.muted;
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("w-full", className), role: "group", "aria-label": "Bar chart", children: [
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-end gap-2", style: { height }, onMouseLeave: () => setHover(null), children: data.map((d, i) => {
|
|
21
|
+
const on = d.active || hover === i;
|
|
22
|
+
const dim = hover != null && hover !== i;
|
|
23
|
+
const h = Number.isFinite(d.value) ? d.value : 0;
|
|
24
|
+
return (
|
|
25
|
+
// Each bar is a focusable graphical object: keyboard + screen-reader parity with hover,
|
|
26
|
+
// so its value is never mouse-only (rule 9). Focus mirrors hover to reveal the pill.
|
|
27
|
+
/* @__PURE__ */ jsxs(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "img",
|
|
31
|
+
"aria-label": `${d.label}: ${d.value}`,
|
|
32
|
+
tabIndex: 0,
|
|
33
|
+
className: "flex h-full flex-1 flex-col items-center justify-end gap-2 rounded-control outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
|
|
34
|
+
onMouseEnter: () => setHover(i),
|
|
35
|
+
onFocus: () => setHover(i),
|
|
36
|
+
onBlur: () => setHover(null),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
"span",
|
|
40
|
+
{
|
|
41
|
+
className: cn(
|
|
42
|
+
"rounded-pill px-2 py-0.5 sv-body-xs font-medium tabular-nums transition-opacity duration-150",
|
|
43
|
+
on && showValue ? "opacity-100" : "opacity-0"
|
|
44
|
+
),
|
|
45
|
+
style: { background: activeFill, color: "var(--sv-sys-color-on-primary)" },
|
|
46
|
+
children: d.value
|
|
47
|
+
}
|
|
48
|
+
),
|
|
49
|
+
/* @__PURE__ */ jsx(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: cn(
|
|
53
|
+
"w-full rounded-t-control transition-[height,background-color,opacity] duration-500 ease-out",
|
|
54
|
+
dim && "opacity-60"
|
|
55
|
+
),
|
|
56
|
+
style: {
|
|
57
|
+
height: `${Math.max(2, h / max * 100)}%`,
|
|
58
|
+
background: on ? activeFill : mutedFill,
|
|
59
|
+
// The pale muted fill is < 3:1 vs the surface; a keyline carries the mark's
|
|
60
|
+
// shape contrast (AGENTS.md rule 9). Active (ink) bars already clear 3:1.
|
|
61
|
+
boxShadow: on ? void 0 : `inset 0 0 0 1px ${chartToken.markEdge}`
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
)
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
d.label
|
|
68
|
+
)
|
|
69
|
+
);
|
|
70
|
+
}) }),
|
|
71
|
+
/* @__PURE__ */ jsx("div", { className: "mt-3 flex gap-2", "aria-hidden": "true", children: data.map((d, i) => /* @__PURE__ */ jsx(
|
|
72
|
+
"span",
|
|
73
|
+
{
|
|
74
|
+
className: cn(
|
|
75
|
+
"flex-1 text-center sv-body-sm transition-colors",
|
|
76
|
+
d.active || hover === i ? "text-on-surface" : "text-on-surface-variant"
|
|
77
|
+
),
|
|
78
|
+
children: d.label
|
|
79
|
+
},
|
|
80
|
+
d.label
|
|
81
|
+
)) })
|
|
82
|
+
] });
|
|
83
|
+
}
|
|
84
|
+
BarChart.displayName = "BarChart";
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
BarChart
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=chunk-SN3OYOEU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/bar-chart.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cn } from '@/lib/utils';\nimport { chartToken, toneFill } from './lib/series';\n\nexport interface BarDatum {\n label: string;\n value: number;\n /** Highlight this bar (ink) and show its value by default. */\n active?: boolean;\n}\n\nexport interface BarChartProps {\n data: BarDatum[];\n height?: number;\n showValue?: boolean;\n /** Colour of the promoted bar. Defaults to ink; `accent` uses the categorical blue. */\n tone?: 'ink' | 'accent';\n className?: string;\n}\n\n/**\n * Cairn BarChart, grayscale-first: muted neutral bars, the active bar promoted to ink\n * (or the categorical blue via `tone=\"accent\"`) with a value pill. Interactive: hover any\n * bar to promote it and reveal its value. Colours resolve from `sys.chart.*` tokens (via\n * `chartToken`), so a theme swap recolours the chart for free. The chart carries a text\n * `aria-label` listing every label/value, so the data is never mouse-only (WCAG-safe).\n */\nexport function BarChart({ data, height = 200, showValue = true, tone = 'ink', className }: BarChartProps) {\n const max = Math.max(...data.map((d) => (Number.isFinite(d.value) ? d.value : 0)), 1);\n const [hover, setHover] = React.useState<number | null>(null);\n\n const activeFill = toneFill(tone);\n const mutedFill = chartToken.muted;\n\n return (\n <div className={cn('w-full', className)} role=\"group\" aria-label=\"Bar chart\">\n <div className=\"flex items-end gap-2\" style={{ height }} onMouseLeave={() => setHover(null)}>\n {data.map((d, i) => {\n const on = d.active || hover === i;\n const dim = hover != null && hover !== i;\n const h = Number.isFinite(d.value) ? d.value : 0;\n return (\n // Each bar is a focusable graphical object: keyboard + screen-reader parity with hover,\n // so its value is never mouse-only (rule 9). Focus mirrors hover to reveal the pill.\n <div\n key={d.label}\n role=\"img\"\n aria-label={`${d.label}: ${d.value}`}\n tabIndex={0}\n className=\"flex h-full flex-1 flex-col items-center justify-end gap-2 rounded-control outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus\"\n onMouseEnter={() => setHover(i)}\n onFocus={() => setHover(i)}\n onBlur={() => setHover(null)}\n >\n <span\n className={cn(\n 'rounded-pill px-2 py-0.5 sv-body-xs font-medium tabular-nums transition-opacity duration-150',\n on && showValue ? 'opacity-100' : 'opacity-0'\n )}\n style={{ background: activeFill, color: 'var(--sv-sys-color-on-primary)' }}\n >\n {d.value}\n </span>\n <div\n className={cn(\n 'w-full rounded-t-control transition-[height,background-color,opacity] duration-500 ease-out',\n dim && 'opacity-60'\n )}\n style={{\n height: `${Math.max(2, (h / max) * 100)}%`,\n background: on ? activeFill : mutedFill,\n // The pale muted fill is < 3:1 vs the surface; a keyline carries the mark's\n // shape contrast (AGENTS.md rule 9). Active (ink) bars already clear 3:1.\n boxShadow: on ? undefined : `inset 0 0 0 1px ${chartToken.markEdge}`,\n }}\n />\n </div>\n );\n })}\n </div>\n <div className=\"mt-3 flex gap-2\" aria-hidden=\"true\">\n {data.map((d, i) => (\n <span\n key={d.label}\n className={cn(\n 'flex-1 text-center sv-body-sm transition-colors',\n d.active || hover === i ? 'text-on-surface' : 'text-on-surface-variant'\n )}\n >\n {d.label}\n </span>\n ))}\n </div>\n </div>\n );\n}\nBarChart.displayName = 'BarChart';\n"],"mappings":";;;;;;;;;AACA,YAAY,WAAW;AA4CX,SAUE,KAVF;AAjBL,SAAS,SAAS,EAAE,MAAM,SAAS,KAAK,YAAY,MAAM,OAAO,OAAO,UAAU,GAAkB;AACzG,QAAM,MAAM,KAAK,IAAI,GAAG,KAAK,IAAI,CAAC,MAAO,OAAO,SAAS,EAAE,KAAK,IAAI,EAAE,QAAQ,CAAE,GAAG,CAAC;AACpF,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAwB,IAAI;AAE5D,QAAM,aAAa,SAAS,IAAI;AAChC,QAAM,YAAY,WAAW;AAE7B,SACE,qBAAC,SAAI,WAAW,GAAG,UAAU,SAAS,GAAG,MAAK,SAAQ,cAAW,aAC/D;AAAA,wBAAC,SAAI,WAAU,wBAAuB,OAAO,EAAE,OAAO,GAAG,cAAc,MAAM,SAAS,IAAI,GACvF,eAAK,IAAI,CAAC,GAAG,MAAM;AAClB,YAAM,KAAK,EAAE,UAAU,UAAU;AACjC,YAAM,MAAM,SAAS,QAAQ,UAAU;AACvC,YAAM,IAAI,OAAO,SAAS,EAAE,KAAK,IAAI,EAAE,QAAQ;AAC/C;AAAA;AAAA;AAAA,QAGE;AAAA,UAAC;AAAA;AAAA,YAEC,MAAK;AAAA,YACL,cAAY,GAAG,EAAE,KAAK,KAAK,EAAE,KAAK;AAAA,YAClC,UAAU;AAAA,YACV,WAAU;AAAA,YACV,cAAc,MAAM,SAAS,CAAC;AAAA,YAC9B,SAAS,MAAM,SAAS,CAAC;AAAA,YACzB,QAAQ,MAAM,SAAS,IAAI;AAAA,YAE3B;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,MAAM,YAAY,gBAAgB;AAAA,kBACpC;AAAA,kBACA,OAAO,EAAE,YAAY,YAAY,OAAO,iCAAiC;AAAA,kBAExE,YAAE;AAAA;AAAA,cACL;AAAA,cACA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAW;AAAA,oBACT;AAAA,oBACA,OAAO;AAAA,kBACT;AAAA,kBACA,OAAO;AAAA,oBACL,QAAQ,GAAG,KAAK,IAAI,GAAI,IAAI,MAAO,GAAG,CAAC;AAAA,oBACvC,YAAY,KAAK,aAAa;AAAA;AAAA;AAAA,oBAG9B,WAAW,KAAK,SAAY,mBAAmB,WAAW,QAAQ;AAAA,kBACpE;AAAA;AAAA,cACF;AAAA;AAAA;AAAA,UA9BK,EAAE;AAAA,QA+BT;AAAA;AAAA,IAEJ,CAAC,GACH;AAAA,IACA,oBAAC,SAAI,WAAU,mBAAkB,eAAY,QAC1C,eAAK,IAAI,CAAC,GAAG,MACZ;AAAA,MAAC;AAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,EAAE,UAAU,UAAU,IAAI,oBAAoB;AAAA,QAChD;AAAA,QAEC,YAAE;AAAA;AAAA,MANE,EAAE;AAAA,IAOT,CACD,GACH;AAAA,KACF;AAEJ;AACA,SAAS,cAAc;","names":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
extent,
|
|
3
|
+
finite,
|
|
4
|
+
smooth
|
|
5
|
+
} from "./chunk-27MWE4F5.js";
|
|
6
|
+
import {
|
|
7
|
+
cn
|
|
8
|
+
} from "./chunk-DXRY7AS4.js";
|
|
9
|
+
|
|
10
|
+
// src/charts/area-chart.tsx
|
|
11
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
var W = 1e3;
|
|
13
|
+
var TOP = 26;
|
|
14
|
+
var BOTTOM = 8;
|
|
15
|
+
function AreaChart({ data, height = 240, markerIndex, markerLabel, className }) {
|
|
16
|
+
const values = finite(data.map((d) => typeof d === "number" ? d : d.value));
|
|
17
|
+
if (values.length < 2) return null;
|
|
18
|
+
const { min, max, range } = extent(values);
|
|
19
|
+
const stepX = W / (values.length - 1);
|
|
20
|
+
const labelled = data.filter((d) => typeof d !== "number" && d.label);
|
|
21
|
+
const ariaLabel = labelled.length ? data.map((d, i) => typeof d === "number" ? `${values[i]}` : `${d.label} ${d.value}`).join(", ") : `Trend across ${values.length} points, from ${min} to ${max}`;
|
|
22
|
+
const y = (v) => TOP + (1 - (v - min) / range) * (height - TOP - BOTTOM);
|
|
23
|
+
const pts = values.map((v, i) => [i * stepX, y(v)]);
|
|
24
|
+
const line = smooth(pts);
|
|
25
|
+
const area = `${line} L ${W},${height} L 0,${height} Z`;
|
|
26
|
+
const marked = markerIndex != null && markerIndex >= 0 && markerIndex < values.length;
|
|
27
|
+
const markLeft = marked ? markerIndex / (values.length - 1) * 100 : 0;
|
|
28
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full", className), style: { height }, role: "img", "aria-label": ariaLabel, children: [
|
|
29
|
+
/* @__PURE__ */ jsxs(
|
|
30
|
+
"svg",
|
|
31
|
+
{
|
|
32
|
+
viewBox: `0 0 ${W} ${height}`,
|
|
33
|
+
width: "100%",
|
|
34
|
+
height,
|
|
35
|
+
preserveAspectRatio: "none",
|
|
36
|
+
fill: "none",
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsx("path", { d: area, fill: "currentColor", fillOpacity: 0.1 }),
|
|
40
|
+
/* @__PURE__ */ jsx(
|
|
41
|
+
"path",
|
|
42
|
+
{
|
|
43
|
+
d: line,
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: 2.5,
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round",
|
|
48
|
+
vectorEffect: "non-scaling-stroke"
|
|
49
|
+
}
|
|
50
|
+
),
|
|
51
|
+
marked && /* @__PURE__ */ jsx(
|
|
52
|
+
"line",
|
|
53
|
+
{
|
|
54
|
+
x1: markerIndex * stepX,
|
|
55
|
+
y1: TOP,
|
|
56
|
+
x2: markerIndex * stepX,
|
|
57
|
+
y2: height,
|
|
58
|
+
stroke: "var(--sv-sys-color-outline-strong)",
|
|
59
|
+
strokeWidth: 1,
|
|
60
|
+
vectorEffect: "non-scaling-stroke"
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
),
|
|
66
|
+
marked && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
/* @__PURE__ */ jsx(
|
|
68
|
+
"span",
|
|
69
|
+
{
|
|
70
|
+
className: "pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-[2.5px] border-current bg-surface",
|
|
71
|
+
style: { left: `${markLeft}%`, top: y(values[markerIndex]) },
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
markerLabel && /* @__PURE__ */ jsx(
|
|
76
|
+
"span",
|
|
77
|
+
{
|
|
78
|
+
className: "pointer-events-none absolute top-0 -translate-x-1/2 whitespace-nowrap sv-body-sm font-medium text-on-surface",
|
|
79
|
+
style: { left: `${markLeft}%` },
|
|
80
|
+
children: markerLabel
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] })
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
AreaChart.displayName = "AreaChart";
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
AreaChart
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=chunk-UNKWUPX2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/charts/area-chart.tsx"],"sourcesContent":["import { cn } from '@/lib/utils';\nimport { smooth, finite, extent } from './lib/path';\n\nexport interface AreaChartProps {\n /** Values, or `{ label, value }` points. */\n data: (number | { label?: string; value: number })[];\n height?: number;\n /** Index of the point to mark with a guideline + callout. */\n markerIndex?: number;\n markerLabel?: string;\n className?: string;\n}\n\n/** Internal coordinate width; the SVG stretches to the container (see preserveAspectRatio). */\nconst W = 1000;\n/** Top room (px) reserved for the marker callout so it never clips. */\nconst TOP = 26;\nconst BOTTOM = 8;\n\n/**\n * Cairn AreaChart, a smooth line with a flat fill. Colour follows `currentColor`.\n * Zero-dependency SVG: renders server-side (Astro-safe), no client JS. The horizontal\n * axis stretches to the container (non-scaling strokes keep the line crisp); the marker\n * dot + callout are HTML overlays so they never distort. An interactive tier (hover\n * tooltips) belongs to the visx layer, this is the static SSR tier.\n */\nexport function AreaChart({ data, height = 240, markerIndex, markerLabel, className }: AreaChartProps) {\n const values = finite(data.map((d) => (typeof d === 'number' ? d : d.value)));\n if (values.length < 2) return null;\n\n const { min, max, range } = extent(values);\n const stepX = W / (values.length - 1);\n\n // Expose the series to assistive tech: labelled points when given, else a plain range summary.\n const labelled = data.filter((d) => typeof d !== 'number' && d.label);\n const ariaLabel = labelled.length\n ? (data.map((d, i) => (typeof d === 'number' ? `${values[i]}` : `${d.label} ${d.value}`)).join(', '))\n : `Trend across ${values.length} points, from ${min} to ${max}`;\n const y = (v: number) => TOP + (1 - (v - min) / range) * (height - TOP - BOTTOM);\n\n const pts = values.map((v, i) => [i * stepX, y(v)] as const);\n const line = smooth(pts);\n const area = `${line} L ${W},${height} L 0,${height} Z`;\n\n const marked = markerIndex != null && markerIndex >= 0 && markerIndex < values.length;\n const markLeft = marked ? (markerIndex! / (values.length - 1)) * 100 : 0;\n\n return (\n <div className={cn('relative w-full', className)} style={{ height }} role=\"img\" aria-label={ariaLabel}>\n <svg\n viewBox={`0 0 ${W} ${height}`}\n width=\"100%\"\n height={height}\n preserveAspectRatio=\"none\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <path d={area} fill=\"currentColor\" fillOpacity={0.1} />\n <path\n d={line}\n stroke=\"currentColor\"\n strokeWidth={2.5}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n vectorEffect=\"non-scaling-stroke\"\n />\n {marked && (\n <line\n x1={markerIndex! * stepX}\n y1={TOP}\n x2={markerIndex! * stepX}\n y2={height}\n stroke=\"var(--sv-sys-color-outline-strong)\"\n strokeWidth={1}\n vectorEffect=\"non-scaling-stroke\"\n />\n )}\n </svg>\n\n {marked && (\n <>\n {/* HTML overlays: undistorted regardless of the horizontal stretch. */}\n <span\n className=\"pointer-events-none absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-[2.5px] border-current bg-surface\"\n style={{ left: `${markLeft}%`, top: y(values[markerIndex!]) }}\n aria-hidden=\"true\"\n />\n {markerLabel && (\n <span\n className=\"pointer-events-none absolute top-0 -translate-x-1/2 whitespace-nowrap sv-body-sm font-medium text-on-surface\"\n style={{ left: `${markLeft}%` }}\n >\n {markerLabel}\n </span>\n )}\n </>\n )}\n </div>\n );\n}\nAreaChart.displayName = 'AreaChart';\n"],"mappings":";;;;;;;;;;AAiDM,SA+BE,UAvBA,KARF;AAnCN,IAAM,IAAI;AAEV,IAAM,MAAM;AACZ,IAAM,SAAS;AASR,SAAS,UAAU,EAAE,MAAM,SAAS,KAAK,aAAa,aAAa,UAAU,GAAmB;AACrG,QAAM,SAAS,OAAO,KAAK,IAAI,CAAC,MAAO,OAAO,MAAM,WAAW,IAAI,EAAE,KAAM,CAAC;AAC5E,MAAI,OAAO,SAAS,EAAG,QAAO;AAE9B,QAAM,EAAE,KAAK,KAAK,MAAM,IAAI,OAAO,MAAM;AACzC,QAAM,QAAQ,KAAK,OAAO,SAAS;AAGnC,QAAM,WAAW,KAAK,OAAO,CAAC,MAAM,OAAO,MAAM,YAAY,EAAE,KAAK;AACpE,QAAM,YAAY,SAAS,SACtB,KAAK,IAAI,CAAC,GAAG,MAAO,OAAO,MAAM,WAAW,GAAG,OAAO,CAAC,CAAC,KAAK,GAAG,EAAE,KAAK,IAAI,EAAE,KAAK,EAAG,EAAE,KAAK,IAAI,IACjG,gBAAgB,OAAO,MAAM,iBAAiB,GAAG,OAAO,GAAG;AAC/D,QAAM,IAAI,CAAC,MAAc,OAAO,KAAK,IAAI,OAAO,UAAU,SAAS,MAAM;AAEzE,QAAM,MAAM,OAAO,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC,CAAC,CAAU;AAC3D,QAAM,OAAO,OAAO,GAAG;AACvB,QAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,QAAQ,MAAM;AAEnD,QAAM,SAAS,eAAe,QAAQ,eAAe,KAAK,cAAc,OAAO;AAC/E,QAAM,WAAW,SAAU,eAAgB,OAAO,SAAS,KAAM,MAAM;AAEvE,SACE,qBAAC,SAAI,WAAW,GAAG,mBAAmB,SAAS,GAAG,OAAO,EAAE,OAAO,GAAG,MAAK,OAAM,cAAY,WAC1F;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,SAAS,OAAO,CAAC,IAAI,MAAM;AAAA,QAC3B,OAAM;AAAA,QACN;AAAA,QACA,qBAAoB;AAAA,QACpB,MAAK;AAAA,QACL,eAAY;AAAA,QAEZ;AAAA,8BAAC,UAAK,GAAG,MAAM,MAAK,gBAAe,aAAa,KAAK;AAAA,UACrD;AAAA,YAAC;AAAA;AAAA,cACC,GAAG;AAAA,cACH,QAAO;AAAA,cACP,aAAa;AAAA,cACb,eAAc;AAAA,cACd,gBAAe;AAAA,cACf,cAAa;AAAA;AAAA,UACf;AAAA,UACC,UACC;AAAA,YAAC;AAAA;AAAA,cACC,IAAI,cAAe;AAAA,cACnB,IAAI;AAAA,cACJ,IAAI,cAAe;AAAA,cACnB,IAAI;AAAA,cACJ,QAAO;AAAA,cACP,aAAa;AAAA,cACb,cAAa;AAAA;AAAA,UACf;AAAA;AAAA;AAAA,IAEJ;AAAA,IAEC,UACC,iCAEE;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,MAAM,GAAG,QAAQ,KAAK,KAAK,EAAE,OAAO,WAAY,CAAC,EAAE;AAAA,UAC5D,eAAY;AAAA;AAAA,MACd;AAAA,MACC,eACC;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,OAAO,EAAE,MAAM,GAAG,QAAQ,IAAI;AAAA,UAE7B;AAAA;AAAA,MACH;AAAA,OAEJ;AAAA,KAEJ;AAEJ;AACA,UAAU,cAAc;","names":[]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/charts/lib/series.ts
|
|
2
|
+
var chartToken = {
|
|
3
|
+
ink: "var(--sv-sys-chart-ink)",
|
|
4
|
+
muted: "var(--sv-sys-chart-muted)",
|
|
5
|
+
markEdge: "var(--sv-sys-chart-mark-edge)",
|
|
6
|
+
accent: "var(--sv-sys-chart-categorical-2)",
|
|
7
|
+
grid: "var(--sv-sys-chart-grid)",
|
|
8
|
+
axis: "var(--sv-sys-chart-axis)",
|
|
9
|
+
track: "var(--sv-sys-chart-track)"
|
|
10
|
+
};
|
|
11
|
+
var CATEGORICAL = [
|
|
12
|
+
"var(--sv-sys-chart-categorical-1)",
|
|
13
|
+
"var(--sv-sys-chart-categorical-2)",
|
|
14
|
+
"var(--sv-sys-chart-categorical-3)",
|
|
15
|
+
"var(--sv-sys-chart-categorical-4)"
|
|
16
|
+
];
|
|
17
|
+
var SEQUENTIAL = [
|
|
18
|
+
"var(--sv-sys-chart-sequential-1)",
|
|
19
|
+
"var(--sv-sys-chart-sequential-2)",
|
|
20
|
+
"var(--sv-sys-chart-sequential-3)",
|
|
21
|
+
"var(--sv-sys-chart-sequential-4)",
|
|
22
|
+
"var(--sv-sys-chart-sequential-5)"
|
|
23
|
+
];
|
|
24
|
+
var CATEGORICAL_MAX = CATEGORICAL.length;
|
|
25
|
+
var CATEGORICAL_ON = [
|
|
26
|
+
"var(--sv-sys-color-on-primary)",
|
|
27
|
+
// white, on ink
|
|
28
|
+
"var(--sv-sys-color-on-primary)",
|
|
29
|
+
// white, on blue.600 (5.2:1)
|
|
30
|
+
"var(--sv-sys-color-on-surface)",
|
|
31
|
+
// ink, on acid.400 (16:1)
|
|
32
|
+
"var(--sv-sys-color-on-surface)"
|
|
33
|
+
// ink, on neutral.400 (5.6:1)
|
|
34
|
+
];
|
|
35
|
+
var SEQUENTIAL_ON = [
|
|
36
|
+
"var(--sv-sys-color-on-surface)",
|
|
37
|
+
// ink, on blue.100
|
|
38
|
+
"var(--sv-sys-color-on-surface)",
|
|
39
|
+
// ink, on blue.300
|
|
40
|
+
"var(--sv-sys-color-on-primary)",
|
|
41
|
+
// white, on blue.500 (4.8:1)
|
|
42
|
+
"var(--sv-sys-color-on-primary)",
|
|
43
|
+
// white, on blue.700
|
|
44
|
+
"var(--sv-sys-color-on-primary)"
|
|
45
|
+
// white, on blue.900
|
|
46
|
+
];
|
|
47
|
+
function toneFill(tone) {
|
|
48
|
+
return tone === "accent" ? chartToken.accent : chartToken.ink;
|
|
49
|
+
}
|
|
50
|
+
var wrap = (i, n) => (i % n + n) % n;
|
|
51
|
+
var rampIndex = (i, n) => n <= 1 ? SEQUENTIAL.length - 1 : Math.round(Math.min(Math.max(i / (n - 1), 0), 1) * (SEQUENTIAL.length - 1));
|
|
52
|
+
function categorical(i) {
|
|
53
|
+
return CATEGORICAL[wrap(i, CATEGORICAL_MAX)];
|
|
54
|
+
}
|
|
55
|
+
function categoricalOn(i) {
|
|
56
|
+
return CATEGORICAL_ON[wrap(i, CATEGORICAL_MAX)];
|
|
57
|
+
}
|
|
58
|
+
function sequential(i, n) {
|
|
59
|
+
return SEQUENTIAL[rampIndex(i, n)];
|
|
60
|
+
}
|
|
61
|
+
function sequentialOn(i, n) {
|
|
62
|
+
return SEQUENTIAL_ON[rampIndex(i, n)];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
chartToken,
|
|
67
|
+
CATEGORICAL_MAX,
|
|
68
|
+
toneFill,
|
|
69
|
+
categorical,
|
|
70
|
+
categoricalOn,
|
|
71
|
+
sequential,
|
|
72
|
+
sequentialOn
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=chunk-WBTUZO4N.js.map
|