@asanchez-sa/abby 0.3.0 → 0.5.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.
Files changed (51) hide show
  1. package/dist/components/badge/badge.d.ts +3 -2
  2. package/dist/components/badge/badge.js +27 -11
  3. package/dist/components/calendar/calendar.d.ts +26 -5
  4. package/dist/components/calendar/calendar.js +387 -72
  5. package/dist/components/chart/chart.d.ts +7 -0
  6. package/dist/components/chart/chart.js +7 -0
  7. package/dist/components/chart/parts/bar.d.ts +32 -0
  8. package/dist/components/chart/parts/bar.js +348 -0
  9. package/dist/components/chart/parts/categories.d.ts +32 -0
  10. package/dist/components/chart/parts/categories.js +212 -0
  11. package/dist/components/chart/parts/legend.d.ts +16 -0
  12. package/dist/components/chart/parts/legend.js +82 -0
  13. package/dist/components/chart/parts/line.d.ts +43 -0
  14. package/dist/components/chart/parts/line.js +266 -0
  15. package/dist/components/chart/parts/scale.js +96 -0
  16. package/dist/components/chart/parts/scatter.d.ts +67 -0
  17. package/dist/components/chart/parts/scatter.js +157 -0
  18. package/dist/components/chart/parts/surface.d.ts +26 -0
  19. package/dist/components/chart/parts/surface.js +76 -0
  20. package/dist/components/chart/parts/table.js +105 -0
  21. package/dist/components/chart/parts/types.d.ts +44 -0
  22. package/dist/components/chart/parts/types.js +12 -0
  23. package/dist/components/filter-chip/filter-chip.d.ts +36 -0
  24. package/dist/components/filter-chip/filter-chip.js +97 -0
  25. package/dist/components/graph/graph.d.ts +151 -0
  26. package/dist/components/graph/graph.js +959 -0
  27. package/dist/components/model-selector/model-selector.d.ts +38 -3
  28. package/dist/components/model-selector/model-selector.js +331 -73
  29. package/dist/components/number-input/number-input.d.ts +14 -3
  30. package/dist/components/number-input/number-input.js +193 -34
  31. package/dist/components/spinner/spinner.d.ts +7 -1
  32. package/dist/components/spinner/spinner.js +86 -26
  33. package/dist/components/toast/toast.d.ts +19 -2
  34. package/dist/components/toast/toast.js +211 -49
  35. package/dist/components/toggle/toggle.d.ts +18 -4
  36. package/dist/components/toggle/toggle.js +167 -32
  37. package/dist/components/week-strip/week-strip.d.ts +27 -5
  38. package/dist/components/week-strip/week-strip.js +288 -134
  39. package/dist/styles/components.css +66 -0
  40. package/package.json +5 -1
  41. package/skills/agent-ready-ui/SKILL.md +1 -1
  42. package/skills/blocks/SKILL.md +1 -1
  43. package/skills/compose-screens/SKILL.md +48 -5
  44. package/skills/compose-screens/references/calendar-week.md +77 -0
  45. package/skills/compose-screens/references/charts-and-maps.md +298 -0
  46. package/skills/compose-screens/references/filter-chips.md +61 -0
  47. package/skills/compose-screens/references/number-units.md +52 -0
  48. package/skills/note-editor/SKILL.md +1 -1
  49. package/skills/note-status/SKILL.md +1 -1
  50. package/skills/setup/SKILL.md +1 -1
  51. package/skills/theming/SKILL.md +1 -1
@@ -0,0 +1,151 @@
1
+ import { ChangeDetails, PartProps } from "../../core/ui-sdk.js";
2
+ import "../../core/index.js";
3
+ import { ReactNode } from "react";
4
+ /** The colors a node's swatch can take. A swatch never says something by color alone: the name does. */
5
+ type GraphTone = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5";
6
+ /** How a line looks: `solid`, `dashed` (weaker) or `warning` (dashed and amber, for a clash). */
7
+ type GraphEdgeVariant = "solid" | "dashed" | "warning";
8
+ type GraphNodeData = {
9
+ /** Unique within the graph. A repeated id is ignored. */
10
+ id: string;
11
+ /** What the node says, and its accessible name. */
12
+ name: string;
13
+ /** The node's center, in map units (px at zoom 1). Larger `y` is farther down. */
14
+ x: number;
15
+ y: number;
16
+ /** A swatch before `meta`. */
17
+ color?: GraphTone;
18
+ /** A second, quieter line, like who wrote it and when. */
19
+ meta?: string;
20
+ /** The node the map is about: wider, with a firmer edge. */
21
+ current?: boolean;
22
+ /** A node that was replaced: its name is struck through and faded. */
23
+ replaced?: boolean;
24
+ };
25
+ type GraphEdgeData = {
26
+ /** The id of the node the line starts at. */
27
+ from: string;
28
+ /** The id of the node the line ends at. */
29
+ to: string;
30
+ /** Said on the line, and in the text list: "Contradicts". */
31
+ label?: string;
32
+ /** The line's width in px, 1.2 by default. Under 1.2 the line is fainter. */
33
+ weight?: number;
34
+ /** `solid` by default. */
35
+ variant?: GraphEdgeVariant;
36
+ };
37
+ type GraphChangeReason = "item-press" | "imperative";
38
+ /** Drives a graph from anywhere. Pass it as the `controller` prop. */
39
+ type GraphController = {
40
+ /** The selected node's id, or `null`. */
41
+ getSelected: () => string | null;
42
+ /** Selects a node, or clears the selection with `null`. False when the node doesn't exist or the app refused it. */
43
+ setSelected: (id: string | null) => boolean;
44
+ /** The zoom now, from 0.5 to 2. */
45
+ getZoom: () => number;
46
+ /** Zooms in a step. */
47
+ zoomIn: () => boolean;
48
+ /** Zooms out a step. */
49
+ zoomOut: () => boolean;
50
+ /** Focuses a node, or the one with the tab stop. */
51
+ focus: (id?: string) => void;
52
+ };
53
+ type GraphOptions = {
54
+ /** The selected node's id, or `null`. Pass it to control the graph. */
55
+ selected?: string | null;
56
+ /** The node selected at first, when uncontrolled. */
57
+ defaultSelected?: string | null;
58
+ /** Runs when a node is pressed, with Enter too, or a controller or agent selects one. `details.cancel()` keeps the selection. */
59
+ onSelectedChange?: (id: string | null, details: ChangeDetails<GraphChangeReason>) => void;
60
+ /** The points. The app places them: this component never moves them. */
61
+ nodes?: readonly GraphNodeData[];
62
+ /** The lines. One that names a node that isn't in `nodes`, or the same one twice, is ignored. */
63
+ edges?: readonly GraphEdgeData[];
64
+ /** Drives the graph from anywhere. Create one with `createGraphController()`. */
65
+ controller?: GraphController;
66
+ };
67
+ type GraphRootState = {
68
+ selected: string | null;
69
+ zoom: number;
70
+ };
71
+ type GraphNodeState = {
72
+ id: string;
73
+ node: GraphNodeData;
74
+ selected: boolean;
75
+ };
76
+ type GraphZoomState = {
77
+ /** Whether the zoom is already at its limit in this direction. */
78
+ disabled: boolean;
79
+ };
80
+ /** Drives a graph from anywhere: pass it as `controller`. */
81
+ declare function createGraphController(): GraphController;
82
+ /**
83
+ * The graph's state and the methods that change it, for a component inside
84
+ * `Graph`. It re-renders when the state changes.
85
+ */
86
+ declare function useGraph(): {
87
+ selected: string | null;
88
+ zoom: number;
89
+ nodes: GraphNodeData[];
90
+ edges: GraphEdgeData[];
91
+ setSelected: (id: string | null) => boolean;
92
+ zoomIn: () => boolean;
93
+ zoomOut: () => boolean;
94
+ focus: (id?: string) => void;
95
+ };
96
+ type GraphProps = GraphOptions & Omit<PartProps<"div", GraphRootState>, "defaultValue"> & {
97
+ /** Names the graph for screen readers and agents. Set it in the page's language. */
98
+ label?: string;
99
+ };
100
+ /** Without children it renders the canvas, the zoom buttons, the legend and the text list. */
101
+ declare function Graph({ selected, defaultSelected, onSelectedChange, nodes, edges, controller, label, className, children, ...props }: GraphProps): import("react").JSX.Element | null;
102
+ /**
103
+ * The map: the lines and their labels under the nodes. It scrolls when the
104
+ * zoomed map is bigger than its box. The box takes its height from `className`.
105
+ */
106
+ declare function GraphCanvas({ className, children }: {
107
+ className?: string;
108
+ children?: ReactNode;
109
+ }): import("react").JSX.Element;
110
+ type GraphNodeProps = Omit<PartProps<"button", GraphNodeState>, "value"> & {
111
+ /** The node's id. */
112
+ value: string;
113
+ };
114
+ /**
115
+ * One node, a button named by the node's name. Without children it draws the
116
+ * name and, under it, the swatch and `meta`. A `value` that isn't in `nodes`
117
+ * draws nothing, so an app's own list can lag a render behind.
118
+ */
119
+ declare function GraphNode(props: GraphNodeProps): import("react").JSX.Element | null;
120
+ type GraphZoomProps = {
121
+ className?: string;
122
+ /** The zoom-in button's accessible name. Set it in the page's language. */
123
+ zoomInLabel?: string;
124
+ /** The zoom-out button's accessible name. Set it in the page's language. */
125
+ zoomOutLabel?: string;
126
+ };
127
+ /** The + and − buttons, stacked at the map's end corner. The keys + and − zoom too. */
128
+ declare function GraphZoom({ className, zoomInLabel, zoomOutLabel }: GraphZoomProps): import("react").JSX.Element;
129
+ type GraphLegendProps = {
130
+ className?: string;
131
+ /** The styles to name, in order. All three by default. */
132
+ variants?: readonly GraphEdgeVariant[];
133
+ /** What each style means. Set them in the page's language. */
134
+ labels?: Partial<Record<GraphEdgeVariant, ReactNode>>;
135
+ /** The legend's accessible name. */
136
+ label?: string;
137
+ };
138
+ /** Names each line style with a sample of it, at the map's start corner. */
139
+ declare function GraphLegend({ className, variants, labels, label }: GraphLegendProps): import("react").JSX.Element;
140
+ type GraphListProps = {
141
+ /** What a node without a label on its lines says: "Related to". */
142
+ relatedLabel?: string;
143
+ /** The list's accessible name. */
144
+ label?: string;
145
+ };
146
+ /**
147
+ * The same map as text, for people who read it with a screen reader: every
148
+ * node once, with its lines as "Contradicts: Other node". Hidden from sight.
149
+ */
150
+ declare function GraphList({ relatedLabel, label }: GraphListProps): import("react").JSX.Element;
151
+ export { Graph, GraphCanvas, type GraphChangeReason, type GraphController, type GraphEdgeData, type GraphEdgeVariant, GraphLegend, type GraphLegendProps, GraphList, type GraphListProps, GraphNode, type GraphNodeData, type GraphNodeProps, type GraphNodeState, type GraphOptions, type GraphProps, type GraphRootState, type GraphTone, GraphZoom, type GraphZoomProps, type GraphZoomState, createGraphController, useGraph };