@asanchez-sa/abby 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/chart/chart.d.ts +5 -74
- package/dist/components/chart/chart.js +5 -563
- package/dist/components/chart/parts/bar.d.ts +32 -0
- package/dist/components/chart/parts/bar.js +348 -0
- package/dist/components/chart/parts/{frame.d.ts → categories.d.ts} +5 -4
- package/dist/components/chart/parts/categories.js +212 -0
- package/dist/components/chart/parts/line.d.ts +43 -0
- package/dist/components/chart/parts/line.js +266 -0
- package/dist/components/chart/parts/scale.js +1 -44
- package/dist/components/chart/parts/scatter.d.ts +67 -0
- package/dist/components/chart/parts/scatter.js +157 -0
- package/dist/components/chart/parts/surface.d.ts +26 -0
- package/dist/components/chart/parts/surface.js +76 -0
- package/dist/components/chart/parts/types.js +5 -1
- package/dist/components/dialog/dialog.d.ts +21 -3
- package/dist/components/dialog/dialog.js +60 -12
- package/dist/components/sidebar/sidebar.d.ts +1 -1
- package/dist/components/sidebar/sidebar.js +50 -49
- package/dist/styles/components.css +80 -0
- package/package.json +2 -1
- package/skills/agent-ready-ui/SKILL.md +1 -1
- package/skills/blocks/SKILL.md +1 -1
- package/skills/compose-screens/SKILL.md +10 -7
- package/skills/compose-screens/references/charts-and-maps.md +119 -4
- package/skills/note-editor/SKILL.md +1 -1
- package/skills/note-status/SKILL.md +1 -1
- package/skills/setup/SKILL.md +1 -1
- package/skills/theming/SKILL.md +1 -1
- package/dist/components/chart/parts/axes.js +0 -126
- package/dist/components/chart/parts/frame.js +0 -278
- package/dist/components/chart/parts/points.d.ts +0 -1
- package/dist/components/chart/parts/points.js +0 -139
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Tooltip as Tooltip$1, TooltipContent as TooltipContent$1 } from "../../tooltip/tooltip.js";
|
|
3
|
-
import { cn } from "../../../utilities/cn/index.js";
|
|
4
|
-
import { c } from "react/compiler-runtime";
|
|
5
|
-
import { useState } from "react";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
-
import { TooltipTrigger, createTooltipController } from "@ui-sdk/react/tooltip";
|
|
8
|
-
// src/components/chart/parts/points.tsx
|
|
9
|
-
/** The controller of the chart's one tooltip. */
|
|
10
|
-
function useChartTooltip() {
|
|
11
|
-
const [tooltip] = useState(_temp);
|
|
12
|
-
return tooltip;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* The chart has one tab stop: the active point takes `tabIndex` 0 and the
|
|
16
|
-
* others -1. Arrows, Home and End move focus to another point; focusing one
|
|
17
|
-
* (by click too) makes it the active. The chart isn't mirrored right to left
|
|
18
|
-
* (a time axis keeps its direction), so the arrows follow the screen there
|
|
19
|
-
* too: ArrowRight goes to the point on the right.
|
|
20
|
-
*/
|
|
21
|
-
function _temp() {
|
|
22
|
-
return createTooltipController();
|
|
23
|
-
}
|
|
24
|
-
function useRovingPoints(count) {
|
|
25
|
-
const $ = c(3);
|
|
26
|
-
const [chosen, setChosen] = useState(0);
|
|
27
|
-
const active = Math.min(chosen, Math.max(0, count - 1));
|
|
28
|
-
let t0;
|
|
29
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30
|
-
t0 = function onKeyDown(event) {
|
|
31
|
-
const points = Array.from(event.currentTarget.querySelectorAll("[data-chart-point]"));
|
|
32
|
-
const current = points.indexOf(event.target);
|
|
33
|
-
if (current < 0 || points.length === 0) return;
|
|
34
|
-
const next = event.key === "ArrowRight" ? current + 1 : event.key === "ArrowLeft" ? current - 1 : event.key === "Home" ? 0 : event.key === "End" ? points.length - 1 : null;
|
|
35
|
-
if (next === null) return;
|
|
36
|
-
event.preventDefault();
|
|
37
|
-
points[Math.min(points.length - 1, Math.max(0, next))]?.focus();
|
|
38
|
-
};
|
|
39
|
-
$[0] = t0;
|
|
40
|
-
} else t0 = $[0];
|
|
41
|
-
const onKeyDown = t0;
|
|
42
|
-
let t1;
|
|
43
|
-
if ($[1] !== active) {
|
|
44
|
-
t1 = {
|
|
45
|
-
active,
|
|
46
|
-
setChosen,
|
|
47
|
-
onKeyDown
|
|
48
|
-
};
|
|
49
|
-
$[1] = active;
|
|
50
|
-
$[2] = t1;
|
|
51
|
-
} else t1 = $[2];
|
|
52
|
-
return t1;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* The transparent area of one mark that takes the pointer and the focus. The
|
|
56
|
-
* mark is drawn under it, so a bar of zero height can still be reached. It is
|
|
57
|
-
* an image for a screen reader, named "category: value".
|
|
58
|
-
*/
|
|
59
|
-
function ChartPoint(t0) {
|
|
60
|
-
const $ = c(14);
|
|
61
|
-
const { controller, index, active, onActivate, label, x, width, height } = t0;
|
|
62
|
-
let t1;
|
|
63
|
-
if ($[0] !== height || $[1] !== width || $[2] !== x) {
|
|
64
|
-
t1 = /* @__PURE__ */ jsx("rect", {
|
|
65
|
-
x,
|
|
66
|
-
y: 0,
|
|
67
|
-
width,
|
|
68
|
-
height,
|
|
69
|
-
strokeWidth: 1
|
|
70
|
-
});
|
|
71
|
-
$[0] = height;
|
|
72
|
-
$[1] = width;
|
|
73
|
-
$[2] = x;
|
|
74
|
-
$[3] = t1;
|
|
75
|
-
} else t1 = $[3];
|
|
76
|
-
const t2 = index === active ? 0 : -1;
|
|
77
|
-
let t3;
|
|
78
|
-
if ($[4] !== index || $[5] !== onActivate) {
|
|
79
|
-
t3 = () => onActivate(index);
|
|
80
|
-
$[4] = index;
|
|
81
|
-
$[5] = onActivate;
|
|
82
|
-
$[6] = t3;
|
|
83
|
-
} else t3 = $[6];
|
|
84
|
-
let t4;
|
|
85
|
-
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
86
|
-
t4 = cn("cursor-default fill-transparent outline-none transition-colors hover:fill-accent focus-visible:fill-accent motion-reduce:transition-none", "focus-visible:stroke-(--focus-ring,var(--ring))");
|
|
87
|
-
$[7] = t4;
|
|
88
|
-
} else t4 = $[7];
|
|
89
|
-
let t5;
|
|
90
|
-
if ($[8] !== controller || $[9] !== label || $[10] !== t1 || $[11] !== t2 || $[12] !== t3) {
|
|
91
|
-
t5 = /* @__PURE__ */ jsx(TooltipTrigger, {
|
|
92
|
-
controller,
|
|
93
|
-
payload: label,
|
|
94
|
-
render: t1,
|
|
95
|
-
role: "img",
|
|
96
|
-
"aria-label": label,
|
|
97
|
-
tabIndex: t2,
|
|
98
|
-
"data-chart-point": "",
|
|
99
|
-
"data-agent-hidden": "",
|
|
100
|
-
onFocus: t3,
|
|
101
|
-
className: t4
|
|
102
|
-
});
|
|
103
|
-
$[8] = controller;
|
|
104
|
-
$[9] = label;
|
|
105
|
-
$[10] = t1;
|
|
106
|
-
$[11] = t2;
|
|
107
|
-
$[12] = t3;
|
|
108
|
-
$[13] = t5;
|
|
109
|
-
} else t5 = $[13];
|
|
110
|
-
return t5;
|
|
111
|
-
}
|
|
112
|
-
/** The one tooltip, showing the payload of the point that opened it. */
|
|
113
|
-
function ChartTooltip(t0) {
|
|
114
|
-
const $ = c(4);
|
|
115
|
-
const { controller, children } = t0;
|
|
116
|
-
let t1;
|
|
117
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
118
|
-
t1 = /* @__PURE__ */ jsx(TooltipContent$1, {
|
|
119
|
-
"data-agent-hidden": "",
|
|
120
|
-
children: _temp2
|
|
121
|
-
});
|
|
122
|
-
$[0] = t1;
|
|
123
|
-
} else t1 = $[0];
|
|
124
|
-
let t2;
|
|
125
|
-
if ($[1] !== children || $[2] !== controller) {
|
|
126
|
-
t2 = /* @__PURE__ */ jsxs(Tooltip$1, {
|
|
127
|
-
controller,
|
|
128
|
-
children: [t1, children]
|
|
129
|
-
});
|
|
130
|
-
$[1] = children;
|
|
131
|
-
$[2] = controller;
|
|
132
|
-
$[3] = t2;
|
|
133
|
-
} else t2 = $[3];
|
|
134
|
-
return t2;
|
|
135
|
-
}
|
|
136
|
-
function _temp2(state) {
|
|
137
|
-
return state.payload ?? "";
|
|
138
|
-
}
|
|
139
|
-
export { ChartPoint, ChartTooltip, useChartTooltip, useRovingPoints };
|