@elabs-ai/components-flow 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/canvas-shell/canvas-shell.js +13 -0
- package/dist/canvas-shell/canvas-shell.js.map +1 -0
- package/dist/canvas-shell/clamped-fit-offset.js +8 -0
- package/dist/canvas-shell/clamped-fit-offset.js.map +1 -0
- package/dist/canvas-shell/index.js +14 -0
- package/dist/canvas-shell/index.js.map +1 -0
- package/dist/canvas-shell/use-measured-nodes.js +8 -0
- package/dist/canvas-shell/use-measured-nodes.js.map +1 -0
- package/dist/chunk-3BTU2VWZ.js +42 -0
- package/dist/chunk-3BTU2VWZ.js.map +1 -0
- package/dist/chunk-3LK6OOXE.js +2 -0
- package/dist/chunk-3LK6OOXE.js.map +1 -0
- package/dist/chunk-3M3FQAD4.js +105 -0
- package/dist/chunk-3M3FQAD4.js.map +1 -0
- package/dist/chunk-3Y5TCGC3.js +2 -0
- package/dist/chunk-3Y5TCGC3.js.map +1 -0
- package/dist/chunk-4VYHZM3S.js +108 -0
- package/dist/chunk-4VYHZM3S.js.map +1 -0
- package/dist/chunk-5TVVM4GR.js +45 -0
- package/dist/chunk-5TVVM4GR.js.map +1 -0
- package/dist/chunk-5XT73MQQ.js +2 -0
- package/dist/chunk-5XT73MQQ.js.map +1 -0
- package/dist/chunk-6LQD5Y5R.js +24 -0
- package/dist/chunk-6LQD5Y5R.js.map +1 -0
- package/dist/chunk-6SR26QY2.js +18 -0
- package/dist/chunk-6SR26QY2.js.map +1 -0
- package/dist/chunk-75JJK6BH.js +157 -0
- package/dist/chunk-75JJK6BH.js.map +1 -0
- package/dist/chunk-A66JBW4X.js +2 -0
- package/dist/chunk-A66JBW4X.js.map +1 -0
- package/dist/chunk-A7AFM3LI.js +72 -0
- package/dist/chunk-A7AFM3LI.js.map +1 -0
- package/dist/chunk-ADHLQF56.js +2 -0
- package/dist/chunk-ADHLQF56.js.map +1 -0
- package/dist/chunk-ATO4LXJF.js +75 -0
- package/dist/chunk-ATO4LXJF.js.map +1 -0
- package/dist/chunk-ATXVXTMZ.js +227 -0
- package/dist/chunk-ATXVXTMZ.js.map +1 -0
- package/dist/chunk-B6IUPZU7.js +2 -0
- package/dist/chunk-B6IUPZU7.js.map +1 -0
- package/dist/chunk-BJ7UMCD3.js +53 -0
- package/dist/chunk-BJ7UMCD3.js.map +1 -0
- package/dist/chunk-BWGYV4JZ.js +2 -0
- package/dist/chunk-BWGYV4JZ.js.map +1 -0
- package/dist/chunk-CWNO63LQ.js +109 -0
- package/dist/chunk-CWNO63LQ.js.map +1 -0
- package/dist/chunk-DHPUXKCZ.js +76 -0
- package/dist/chunk-DHPUXKCZ.js.map +1 -0
- package/dist/chunk-DNX7G3KA.js +185 -0
- package/dist/chunk-DNX7G3KA.js.map +1 -0
- package/dist/chunk-DNZRAJAQ.js +41 -0
- package/dist/chunk-DNZRAJAQ.js.map +1 -0
- package/dist/chunk-ELCLRVD4.js +2 -0
- package/dist/chunk-ELCLRVD4.js.map +1 -0
- package/dist/chunk-ELOADZSX.js +2 -0
- package/dist/chunk-ELOADZSX.js.map +1 -0
- package/dist/chunk-EUNV2MR5.js +21 -0
- package/dist/chunk-EUNV2MR5.js.map +1 -0
- package/dist/chunk-FAFQ5KLB.js +43 -0
- package/dist/chunk-FAFQ5KLB.js.map +1 -0
- package/dist/chunk-FIRO6Y3R.js +128 -0
- package/dist/chunk-FIRO6Y3R.js.map +1 -0
- package/dist/chunk-GE73WQUK.js +2 -0
- package/dist/chunk-GE73WQUK.js.map +1 -0
- package/dist/chunk-GIARAOU6.js +39 -0
- package/dist/chunk-GIARAOU6.js.map +1 -0
- package/dist/chunk-HTLTCCFA.js +73 -0
- package/dist/chunk-HTLTCCFA.js.map +1 -0
- package/dist/chunk-I53W3CFN.js +56 -0
- package/dist/chunk-I53W3CFN.js.map +1 -0
- package/dist/chunk-IJVFPUXO.js +2 -0
- package/dist/chunk-IJVFPUXO.js.map +1 -0
- package/dist/chunk-JUPMOISE.js +51 -0
- package/dist/chunk-JUPMOISE.js.map +1 -0
- package/dist/chunk-K5RPSVO6.js +167 -0
- package/dist/chunk-K5RPSVO6.js.map +1 -0
- package/dist/chunk-K6U27YJ6.js +78 -0
- package/dist/chunk-K6U27YJ6.js.map +1 -0
- package/dist/chunk-KDVMGMAK.js +2 -0
- package/dist/chunk-KDVMGMAK.js.map +1 -0
- package/dist/chunk-LQOZCOK3.js +74 -0
- package/dist/chunk-LQOZCOK3.js.map +1 -0
- package/dist/chunk-NAQWNX2A.js +102 -0
- package/dist/chunk-NAQWNX2A.js.map +1 -0
- package/dist/chunk-NVJVWGUS.js +152 -0
- package/dist/chunk-NVJVWGUS.js.map +1 -0
- package/dist/chunk-O2F3R3PV.js +2 -0
- package/dist/chunk-O2F3R3PV.js.map +1 -0
- package/dist/chunk-OMFQHMA6.js +2 -0
- package/dist/chunk-OMFQHMA6.js.map +1 -0
- package/dist/chunk-PE6JXVOX.js +2 -0
- package/dist/chunk-PE6JXVOX.js.map +1 -0
- package/dist/chunk-ROJEIIA4.js +52 -0
- package/dist/chunk-ROJEIIA4.js.map +1 -0
- package/dist/chunk-ROYAQKJA.js +9 -0
- package/dist/chunk-ROYAQKJA.js.map +1 -0
- package/dist/chunk-SHCZK4DO.js +45 -0
- package/dist/chunk-SHCZK4DO.js.map +1 -0
- package/dist/chunk-SXXJV6YJ.js +79 -0
- package/dist/chunk-SXXJV6YJ.js.map +1 -0
- package/dist/chunk-T7S7NJFD.js +287 -0
- package/dist/chunk-T7S7NJFD.js.map +1 -0
- package/dist/chunk-TEZ3OXAY.js +63 -0
- package/dist/chunk-TEZ3OXAY.js.map +1 -0
- package/dist/chunk-TGWPM2CG.js +199 -0
- package/dist/chunk-TGWPM2CG.js.map +1 -0
- package/dist/chunk-TSB6RE7L.js +2 -0
- package/dist/chunk-TSB6RE7L.js.map +1 -0
- package/dist/chunk-UPV2MT4O.js +2 -0
- package/dist/chunk-UPV2MT4O.js.map +1 -0
- package/dist/chunk-UZJZY4A5.js +2 -0
- package/dist/chunk-UZJZY4A5.js.map +1 -0
- package/dist/chunk-W3TQMUGX.js +2 -0
- package/dist/chunk-W3TQMUGX.js.map +1 -0
- package/dist/chunk-WN46RIOC.js +29 -0
- package/dist/chunk-WN46RIOC.js.map +1 -0
- package/dist/chunk-XZFE2YYH.js +70 -0
- package/dist/chunk-XZFE2YYH.js.map +1 -0
- package/dist/chunk-YG3KXTZW.js +2 -0
- package/dist/chunk-YG3KXTZW.js.map +1 -0
- package/dist/chunk-ZATVF42E.js +65 -0
- package/dist/chunk-ZATVF42E.js.map +1 -0
- package/dist/chunk-ZXZTLQIX.js +19 -0
- package/dist/chunk-ZXZTLQIX.js.map +1 -0
- package/dist/flow-button-edge/flow-button-edge.js +10 -0
- package/dist/flow-button-edge/flow-button-edge.js.map +1 -0
- package/dist/flow-button-edge/index.js +11 -0
- package/dist/flow-button-edge/index.js.map +1 -0
- package/dist/flow-edge/flow-edge.js +10 -0
- package/dist/flow-edge/flow-edge.js.map +1 -0
- package/dist/flow-edge/index.js +11 -0
- package/dist/flow-edge/index.js.map +1 -0
- package/dist/flow-edge-path/flow-edge-path.js +12 -0
- package/dist/flow-edge-path/flow-edge-path.js.map +1 -0
- package/dist/flow-edge-path/index.js +13 -0
- package/dist/flow-edge-path/index.js.map +1 -0
- package/dist/flow-edge-tokens/edge-path-sampler.js +10 -0
- package/dist/flow-edge-tokens/edge-path-sampler.js.map +1 -0
- package/dist/flow-edge-tokens/flow-edge-tokens.js +12 -0
- package/dist/flow-edge-tokens/flow-edge-tokens.js.map +1 -0
- package/dist/flow-edge-tokens/index.js +17 -0
- package/dist/flow-edge-tokens/index.js.map +1 -0
- package/dist/flow-floating-edge/floating-edge-geometry.js +8 -0
- package/dist/flow-floating-edge/floating-edge-geometry.js.map +1 -0
- package/dist/flow-floating-edge/flow-floating-edge.js +11 -0
- package/dist/flow-floating-edge/flow-floating-edge.js.map +1 -0
- package/dist/flow-floating-edge/index.js +15 -0
- package/dist/flow-floating-edge/index.js.map +1 -0
- package/dist/flow-group-node/flow-group-node.js +12 -0
- package/dist/flow-group-node/flow-group-node.js.map +1 -0
- package/dist/flow-group-node/index.js +13 -0
- package/dist/flow-group-node/index.js.map +1 -0
- package/dist/flow-handle/flow-handle-anchor.js +8 -0
- package/dist/flow-handle/flow-handle-anchor.js.map +1 -0
- package/dist/flow-handle/index.js +9 -0
- package/dist/flow-handle/index.js.map +1 -0
- package/dist/flow-layout/backbone.js +8 -0
- package/dist/flow-layout/backbone.js.map +1 -0
- package/dist/flow-layout/flow-layout.js +10 -0
- package/dist/flow-layout/flow-layout.js.map +1 -0
- package/dist/flow-layout/index.js +21 -0
- package/dist/flow-layout/index.js.map +1 -0
- package/dist/flow-layout/layout-flow-elk.js +9 -0
- package/dist/flow-layout/layout-flow-elk.js.map +1 -0
- package/dist/flow-layout/layout-graph.js +9 -0
- package/dist/flow-layout/layout-graph.js.map +1 -0
- package/dist/flow-layout/use-auto-layout.js +10 -0
- package/dist/flow-layout/use-auto-layout.js.map +1 -0
- package/dist/flow-layout/use-flow-layout.js +9 -0
- package/dist/flow-layout/use-flow-layout.js.map +1 -0
- package/dist/flow-mini-map/flow-mini-map.js +8 -0
- package/dist/flow-mini-map/flow-mini-map.js.map +1 -0
- package/dist/flow-mini-map/index.js +9 -0
- package/dist/flow-mini-map/index.js.map +1 -0
- package/dist/flow-node/flow-node.js +11 -0
- package/dist/flow-node/flow-node.js.map +1 -0
- package/dist/flow-node/index.js +12 -0
- package/dist/flow-node/index.js.map +1 -0
- package/dist/flow-placeholder-node/flow-placeholder-node.js +9 -0
- package/dist/flow-placeholder-node/flow-placeholder-node.js.map +1 -0
- package/dist/flow-placeholder-node/index.js +10 -0
- package/dist/flow-placeholder-node/index.js.map +1 -0
- package/dist/flow-self-loop-edge/flow-self-loop-edge.js +20 -0
- package/dist/flow-self-loop-edge/flow-self-loop-edge.js.map +1 -0
- package/dist/flow-self-loop-edge/index.js +28 -0
- package/dist/flow-self-loop-edge/index.js.map +1 -0
- package/dist/flow-self-loop-edge/self-loop-geometry.js +12 -0
- package/dist/flow-self-loop-edge/self-loop-geometry.js.map +1 -0
- package/dist/flow-smart-edge/flow-smart-edge.js +11 -0
- package/dist/flow-smart-edge/flow-smart-edge.js.map +1 -0
- package/dist/flow-smart-edge/index.js +25 -0
- package/dist/flow-smart-edge/index.js.map +1 -0
- package/dist/flow-smart-edge/smart-edge-geometry.js +18 -0
- package/dist/flow-smart-edge/smart-edge-geometry.js.map +1 -0
- package/dist/flow-weighted-edge/back-edge-geometry.js +8 -0
- package/dist/flow-weighted-edge/back-edge-geometry.js.map +1 -0
- package/dist/flow-weighted-edge/edge-aria.js +10 -0
- package/dist/flow-weighted-edge/edge-aria.js.map +1 -0
- package/dist/flow-weighted-edge/edge-label-pill.js +8 -0
- package/dist/flow-weighted-edge/edge-label-pill.js.map +1 -0
- package/dist/flow-weighted-edge/flow-weighted-edge.js +16 -0
- package/dist/flow-weighted-edge/flow-weighted-edge.js.map +1 -0
- package/dist/flow-weighted-edge/index.js +34 -0
- package/dist/flow-weighted-edge/index.js.map +1 -0
- package/dist/flow-weighted-edge/weight-scale.js +10 -0
- package/dist/flow-weighted-edge/weight-scale.js.map +1 -0
- package/dist/helper-lines/get-helper-lines.js +8 -0
- package/dist/helper-lines/get-helper-lines.js.map +1 -0
- package/dist/helper-lines/helper-lines.js +9 -0
- package/dist/helper-lines/helper-lines.js.map +1 -0
- package/dist/helper-lines/index.js +17 -0
- package/dist/helper-lines/index.js.map +1 -0
- package/dist/helper-lines/use-helper-lines.js +10 -0
- package/dist/helper-lines/use-helper-lines.js.map +1 -0
- package/dist/index.d.ts +241 -2
- package/dist/index.js +167 -2306
- package/dist/index.js.map +1 -1
- package/dist/inspector-panel/index.js +9 -0
- package/dist/inspector-panel/index.js.map +1 -0
- package/dist/inspector-panel/inspector-panel.js +8 -0
- package/dist/inspector-panel/inspector-panel.js.map +1 -0
- package/dist/legend/index.js +10 -0
- package/dist/legend/index.js.map +1 -0
- package/dist/legend/legend.js +9 -0
- package/dist/legend/legend.js.map +1 -0
- package/dist/use-flow-groups/group-operations.js +20 -0
- package/dist/use-flow-groups/group-operations.js.map +1 -0
- package/dist/use-flow-groups/index.js +25 -0
- package/dist/use-flow-groups/index.js.map +1 -0
- package/dist/use-flow-groups/use-flow-groups.js +9 -0
- package/dist/use-flow-groups/use-flow-groups.js.map +1 -0
- package/dist/zoom-controls/index.js +9 -0
- package/dist/zoom-controls/index.js.map +1 -0
- package/dist/zoom-controls/zoom-controls.js +8 -0
- package/dist/zoom-controls/zoom-controls.js.map +1 -0
- package/package.json +14 -7
- package/src/__contract__/inspector-panel.contract.test.tsx +49 -0
- package/src/__contract__/legend.contract.test.tsx +49 -0
- package/src/canvas-shell/canvas-shell.stories.tsx +1 -0
- package/src/canvas-shell/canvas-shell.tsx +51 -4
- package/src/canvas-shell/clamped-fit-offset.test.ts +25 -0
- package/src/canvas-shell/clamped-fit-offset.ts +30 -0
- package/src/custom-nodes/custom-nodes.stories.tsx +718 -0
- package/src/flow-edge-tokens/edge-path-sampler.test.ts +108 -0
- package/src/flow-edge-tokens/edge-path-sampler.ts +362 -0
- package/src/flow-edge-tokens/flow-edge-tokens.stories.tsx +312 -0
- package/src/flow-edge-tokens/flow-edge-tokens.test.tsx +115 -0
- package/src/flow-edge-tokens/flow-edge-tokens.tsx +94 -0
- package/src/flow-edge-tokens/index.ts +12 -0
- package/src/flow-layout/backbone.test.ts +88 -0
- package/src/flow-layout/backbone.ts +58 -0
- package/src/flow-layout/layout-flow-elk.stories.tsx +154 -0
- package/src/flow-layout/layout-flow-elk.test.ts +152 -0
- package/src/flow-layout/layout-flow-elk.ts +399 -0
- package/src/flow-mini-map/flow-mini-map.stories.tsx +20 -0
- package/src/flow-node/flow-node.stories.tsx +40 -1
- package/src/flow-self-loop-edge/flow-self-loop-edge.test.tsx +38 -0
- package/src/flow-self-loop-edge/flow-self-loop-edge.tsx +7 -0
- package/src/flow-weighted-edge/edge-label-pill.test.tsx +20 -0
- package/src/flow-weighted-edge/flow-weighted-edge.stories.tsx +1 -0
- package/src/flow-weighted-edge/flow-weighted-edge.test.tsx +40 -0
- package/src/flow-weighted-edge/flow-weighted-edge.tsx +7 -0
- package/src/index.ts +13 -0
- package/src/inspector-panel/inspector-panel.tsx +9 -6
- package/src/legend/legend.test.tsx +11 -0
- package/src/legend/legend.tsx +15 -7
- package/src/templates-flow-workspace.stories.tsx +7 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
import { Reveal, useCollapsiblePanel } from "@elabs-ai/components-ui";
|
|
2
|
+
import { Reveal, useCollapsiblePanel, useLocale } from "@elabs-ai/components-ui";
|
|
3
3
|
import { cn } from "@elabs-ai/components-ui/lib/cn";
|
|
4
4
|
|
|
5
5
|
const INSPECTOR_PANEL_WIDTH = "18rem";
|
|
@@ -41,10 +41,10 @@ export interface InspectorPanelProps {
|
|
|
41
41
|
* motion safe) when `open`/`defaultOpen` drive it.
|
|
42
42
|
*/
|
|
43
43
|
export function InspectorPanel({
|
|
44
|
-
title
|
|
44
|
+
title,
|
|
45
45
|
children,
|
|
46
46
|
onClose,
|
|
47
|
-
emptyMessage
|
|
47
|
+
emptyMessage,
|
|
48
48
|
hasSelection = true,
|
|
49
49
|
selectionKey,
|
|
50
50
|
open,
|
|
@@ -54,6 +54,9 @@ export function InspectorPanel({
|
|
|
54
54
|
width = INSPECTOR_PANEL_WIDTH,
|
|
55
55
|
className,
|
|
56
56
|
}: InspectorPanelProps) {
|
|
57
|
+
const { t } = useLocale();
|
|
58
|
+
const resolvedTitle = title ?? t("flow.inspectorPanel.title");
|
|
59
|
+
const resolvedEmptyMessage = emptyMessage ?? t("flow.inspectorPanel.emptyMessage");
|
|
57
60
|
const panel = useCollapsiblePanel({
|
|
58
61
|
side,
|
|
59
62
|
open,
|
|
@@ -84,11 +87,11 @@ export function InspectorPanel({
|
|
|
84
87
|
{/* Detail-tier surface: raised `card` — robust across themes (#193). */}
|
|
85
88
|
<div className="flex h-full w-full flex-col bg-card">
|
|
86
89
|
<div className="flex items-center justify-between border-b px-4 py-3">
|
|
87
|
-
<h3 className="text-body font-semibold text-foreground">{
|
|
90
|
+
<h3 className="text-body font-semibold text-foreground">{resolvedTitle}</h3>
|
|
88
91
|
{onClose ? (
|
|
89
92
|
<button
|
|
90
93
|
type="button"
|
|
91
|
-
aria-label="
|
|
94
|
+
aria-label={t("flow.inspectorPanel.close")}
|
|
92
95
|
onClick={onClose}
|
|
93
96
|
className="rounded-sm p-1 text-muted-foreground hover:text-foreground focus-ring"
|
|
94
97
|
>
|
|
@@ -129,7 +132,7 @@ export function InspectorPanel({
|
|
|
129
132
|
</Reveal>
|
|
130
133
|
) : (
|
|
131
134
|
<div tabIndex={0} className="focus-ring flex-1 overflow-y-auto p-4 text-body">
|
|
132
|
-
<p className="text-muted-foreground">{
|
|
135
|
+
<p className="text-muted-foreground">{resolvedEmptyMessage}</p>
|
|
133
136
|
</div>
|
|
134
137
|
)}
|
|
135
138
|
</div>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocaleProvider } from "@elabs-ai/components-ui";
|
|
1
2
|
import { cleanup, render, screen } from "@testing-library/react";
|
|
2
3
|
import { afterEach, describe, expect, it } from "vitest";
|
|
3
4
|
import { computeEdgeWeightScale, type WeightedEdgeLike } from "../flow-weighted-edge/weight-scale";
|
|
@@ -212,4 +213,14 @@ describe('Legend variant="scale", kind="color"', () => {
|
|
|
212
213
|
});
|
|
213
214
|
expect(group).toHaveAttribute("tabindex", "0");
|
|
214
215
|
});
|
|
216
|
+
|
|
217
|
+
it("formats the default tick label with the active LocaleProvider locale, not the host locale", () => {
|
|
218
|
+
render(
|
|
219
|
+
<LocaleProvider locale="de-DE">
|
|
220
|
+
<Legend variant="scale" kind="color" domain={[0, 1000]} />
|
|
221
|
+
</LocaleProvider>,
|
|
222
|
+
);
|
|
223
|
+
// de-DE groups thousands with a period, never a comma.
|
|
224
|
+
expect(screen.getByText("1.000")).toBeInTheDocument();
|
|
225
|
+
});
|
|
215
226
|
});
|
package/src/legend/legend.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useLocale } from "@elabs-ai/components-ui";
|
|
1
2
|
import { cn } from "@elabs-ai/components-ui/lib/cn";
|
|
2
3
|
import { computeEdgeWeightScale, type WeightedEdgeLike } from "../flow-weighted-edge/weight-scale";
|
|
3
4
|
|
|
@@ -33,7 +34,11 @@ export interface LegendScaleProps {
|
|
|
33
34
|
kind: "width" | "color";
|
|
34
35
|
/** `[min, max]` of the underlying value the ramp represents. */
|
|
35
36
|
domain: [number, number];
|
|
36
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Formats a domain value for display at a tick.
|
|
39
|
+
* @default the active `LocaleProvider` locale's `formatNumber` (host locale
|
|
40
|
+
* when no provider is mounted) — never a hardcoded `toLocaleString()`.
|
|
41
|
+
*/
|
|
37
42
|
format?: (value: number) => string;
|
|
38
43
|
/**
|
|
39
44
|
* Sample count for `kind: "width"`: `"minmax"` draws a min/max pair of
|
|
@@ -51,8 +56,6 @@ export interface LegendScaleProps {
|
|
|
51
56
|
|
|
52
57
|
export type LegendProps = LegendCategoricalProps | LegendScaleProps;
|
|
53
58
|
|
|
54
|
-
const defaultFormat = (value: number): string => value.toLocaleString();
|
|
55
|
-
|
|
56
59
|
/**
|
|
57
60
|
* Small legend mapping colors/types to labels for a canvas or chart
|
|
58
61
|
* (`variant: "categorical"`, the default), or — via `variant="scale"` — a
|
|
@@ -121,16 +124,21 @@ function scaleKindLabel(kind: "width" | "color"): string {
|
|
|
121
124
|
function LegendScale({
|
|
122
125
|
kind,
|
|
123
126
|
domain,
|
|
124
|
-
format
|
|
127
|
+
format,
|
|
125
128
|
ticks = "minmax",
|
|
126
129
|
title,
|
|
127
130
|
className,
|
|
128
131
|
}: LegendScaleProps) {
|
|
132
|
+
// The active `LocaleProvider` locale, not a hardcoded `toLocaleString()` —
|
|
133
|
+
// otherwise a `de-DE`-configured app still reads the domain ticks in the
|
|
134
|
+
// browser's host locale.
|
|
135
|
+
const { formatNumber } = useLocale();
|
|
136
|
+
const format_ = format ?? formatNumber;
|
|
129
137
|
const [min, max] = domain;
|
|
130
138
|
// e.g. "Edge width scale, 2 to 48, minimum to maximum" — a single accessible
|
|
131
139
|
// name for the whole reading key, since it is one keyboard tab stop, not one
|
|
132
140
|
// per tick.
|
|
133
|
-
const ariaLabel = `Edge ${scaleKindLabel(kind)} scale, ${
|
|
141
|
+
const ariaLabel = `Edge ${scaleKindLabel(kind)} scale, ${format_(min)} to ${format_(max)}, minimum to maximum`;
|
|
134
142
|
|
|
135
143
|
return (
|
|
136
144
|
<div
|
|
@@ -145,9 +153,9 @@ function LegendScale({
|
|
|
145
153
|
>
|
|
146
154
|
{title ? <div className="text-body font-medium text-foreground">{title}</div> : null}
|
|
147
155
|
{kind === "width" ? (
|
|
148
|
-
<LegendScaleWidth domain={domain} format={
|
|
156
|
+
<LegendScaleWidth domain={domain} format={format_} ticks={ticks} />
|
|
149
157
|
) : (
|
|
150
|
-
<LegendScaleColor domain={domain} format={
|
|
158
|
+
<LegendScaleColor domain={domain} format={format_} />
|
|
151
159
|
)}
|
|
152
160
|
</div>
|
|
153
161
|
);
|
|
@@ -10,8 +10,10 @@ import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
|
10
10
|
import { useState } from "react";
|
|
11
11
|
import {
|
|
12
12
|
Button,
|
|
13
|
+
NavUser,
|
|
13
14
|
Sidebar,
|
|
14
15
|
SidebarContent,
|
|
16
|
+
SidebarFooter,
|
|
15
17
|
SidebarGroup,
|
|
16
18
|
SidebarGroupContent,
|
|
17
19
|
SidebarHeader,
|
|
@@ -131,9 +133,12 @@ function FlowWorkspaceTemplate() {
|
|
|
131
133
|
</SidebarGroupContent>
|
|
132
134
|
</SidebarGroup>
|
|
133
135
|
</SidebarContent>
|
|
136
|
+
<SidebarFooter>
|
|
137
|
+
<NavUser user={{ name: "Avery Rao", email: "avery@example.com" }} />
|
|
138
|
+
</SidebarFooter>
|
|
134
139
|
</Sidebar>
|
|
135
140
|
<SidebarInset className="flex flex-col overflow-hidden">
|
|
136
|
-
<header className="flex h-
|
|
141
|
+
<header className="flex h-header shrink-0 items-center gap-2 border-b px-4">
|
|
137
142
|
<SidebarTrigger />
|
|
138
143
|
<h1 className="text-body font-medium capitalize">{active}</h1>
|
|
139
144
|
</header>
|
|
@@ -159,7 +164,7 @@ function FlowWorkspaceTemplate() {
|
|
|
159
164
|
}
|
|
160
165
|
|
|
161
166
|
const meta = {
|
|
162
|
-
title: "Patterns/Templates/Flow Workspace",
|
|
167
|
+
title: "Patterns/Templates/Starters/Flow Workspace",
|
|
163
168
|
parameters: { layout: "fullscreen" },
|
|
164
169
|
tags: ["autodocs"],
|
|
165
170
|
} satisfies Meta;
|