@almadar/ui 5.77.0 → 5.78.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/avl/index.cjs +857 -92
- package/dist/avl/index.js +857 -92
- package/dist/components/core/atoms/index.d.ts +2 -1
- package/dist/components/core/molecules/index.d.ts +4 -0
- package/dist/components/index.cjs +2201 -1519
- package/dist/components/index.js +991 -309
- package/dist/components/learning/atoms/LearningCanvas.d.ts +80 -0
- package/dist/components/learning/molecules/BiologyCanvas.d.ts +47 -0
- package/dist/components/learning/molecules/ChemistryCanvas.d.ts +55 -0
- package/dist/components/learning/molecules/MathCanvas.d.ts +61 -0
- package/dist/components/learning/molecules/PhysicsCanvas.d.ts +54 -0
- package/dist/components/marketing/atoms/MarketingStatCard.d.ts +2 -2
- package/dist/providers/index.cjs +857 -92
- package/dist/providers/index.js +857 -92
- package/dist/runtime/index.cjs +857 -92
- package/dist/runtime/index.js +857 -92
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LearningCanvas
|
|
3
|
+
*
|
|
4
|
+
* A pure, declarative HTML5 canvas atom for math and science visualizations.
|
|
5
|
+
* Accepts a list of primitive shapes (line, arrow, circle, rect, polygon, path,
|
|
6
|
+
* text, axis, grid) and renders them. Optional interactivity emits click/hover
|
|
7
|
+
* events, and optional animation drives a continuous render loop.
|
|
8
|
+
*
|
|
9
|
+
* This is the foundational atom for the `learning/` behavior family.
|
|
10
|
+
*
|
|
11
|
+
* @packageDocumentation
|
|
12
|
+
*/
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import type { UiError } from '../../core/atoms/types';
|
|
15
|
+
export type LearningShapeType = 'line' | 'arrow' | 'circle' | 'rect' | 'polygon' | 'path' | 'text' | 'axis' | 'grid';
|
|
16
|
+
export interface LearningPoint {
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
}
|
|
20
|
+
export interface LearningShape {
|
|
21
|
+
type: LearningShapeType;
|
|
22
|
+
/** Optional stable id for interaction payloads. */
|
|
23
|
+
id?: string;
|
|
24
|
+
x?: number;
|
|
25
|
+
y?: number;
|
|
26
|
+
x1?: number;
|
|
27
|
+
y1?: number;
|
|
28
|
+
x2?: number;
|
|
29
|
+
y2?: number;
|
|
30
|
+
radius?: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
height?: number;
|
|
33
|
+
points?: LearningPoint[];
|
|
34
|
+
path?: string;
|
|
35
|
+
text?: string;
|
|
36
|
+
label?: string;
|
|
37
|
+
fontSize?: number;
|
|
38
|
+
align?: 'left' | 'center' | 'right';
|
|
39
|
+
axis?: 'x' | 'y';
|
|
40
|
+
min?: number;
|
|
41
|
+
max?: number;
|
|
42
|
+
step?: number;
|
|
43
|
+
color?: string;
|
|
44
|
+
fill?: string;
|
|
45
|
+
lineWidth?: number;
|
|
46
|
+
opacity?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface LearningCanvasProps {
|
|
49
|
+
/** Additional CSS classes. */
|
|
50
|
+
className?: string;
|
|
51
|
+
/** Canvas width in CSS pixels. */
|
|
52
|
+
width?: number;
|
|
53
|
+
/** Canvas height in CSS pixels. */
|
|
54
|
+
height?: number;
|
|
55
|
+
/** Background color (default transparent). */
|
|
56
|
+
backgroundColor?: string;
|
|
57
|
+
/** Declarative shapes to draw. */
|
|
58
|
+
shapes?: LearningShape[];
|
|
59
|
+
/** Enable pointer interaction (click/hover). */
|
|
60
|
+
interactive?: boolean;
|
|
61
|
+
/** Enable continuous redraw loop. */
|
|
62
|
+
animate?: boolean;
|
|
63
|
+
/** Clicked shape payload: { id?, type?, index }. */
|
|
64
|
+
onShapeClick?: (payload: {
|
|
65
|
+
id?: string;
|
|
66
|
+
type?: string;
|
|
67
|
+
index: number;
|
|
68
|
+
}) => void;
|
|
69
|
+
/** Hovered shape payload: { id?, type?, index }. */
|
|
70
|
+
onShapeHover?: (payload: {
|
|
71
|
+
id?: string;
|
|
72
|
+
type?: string;
|
|
73
|
+
index: number;
|
|
74
|
+
}) => void;
|
|
75
|
+
/** Loading state. */
|
|
76
|
+
isLoading?: boolean;
|
|
77
|
+
/** Error state. */
|
|
78
|
+
error?: UiError | null;
|
|
79
|
+
}
|
|
80
|
+
export declare const LearningCanvas: React.FC<LearningCanvasProps>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BiologyCanvas
|
|
3
|
+
*
|
|
4
|
+
* A field-scoped learning molecule for biology. Renders cells, organelles,
|
|
5
|
+
* membranes, and connections on top of the declarative `LearningCanvas` atom.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import type { LearningShape } from '../atoms/LearningCanvas';
|
|
11
|
+
import type { UiError } from '../../core/atoms/types';
|
|
12
|
+
export interface BiologyNode {
|
|
13
|
+
id?: string;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
radius?: number;
|
|
17
|
+
color?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
kind?: 'cell' | 'organelle' | 'molecule' | 'organism';
|
|
20
|
+
}
|
|
21
|
+
export interface BiologyEdge {
|
|
22
|
+
from: string;
|
|
23
|
+
to: string;
|
|
24
|
+
color?: string;
|
|
25
|
+
label?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface BiologyCanvasProps {
|
|
28
|
+
className?: string;
|
|
29
|
+
width?: number;
|
|
30
|
+
height?: number;
|
|
31
|
+
title?: string;
|
|
32
|
+
backgroundColor?: string;
|
|
33
|
+
nodes?: BiologyNode[];
|
|
34
|
+
edges?: BiologyEdge[];
|
|
35
|
+
/** Extra declarative shapes in canvas pixel coordinates. */
|
|
36
|
+
shapes?: LearningShape[];
|
|
37
|
+
interactive?: boolean;
|
|
38
|
+
animate?: boolean;
|
|
39
|
+
onShapeClick?: (payload: {
|
|
40
|
+
id?: string;
|
|
41
|
+
type?: string;
|
|
42
|
+
index: number;
|
|
43
|
+
}) => void;
|
|
44
|
+
isLoading?: boolean;
|
|
45
|
+
error?: UiError | null;
|
|
46
|
+
}
|
|
47
|
+
export declare const BiologyCanvas: React.FC<BiologyCanvasProps>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChemistryCanvas
|
|
3
|
+
*
|
|
4
|
+
* A field-scoped learning molecule for chemistry. Renders atoms, bonds, and
|
|
5
|
+
* reaction arrows on top of the declarative `LearningCanvas` atom.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
import type { LearningShape } from '../atoms/LearningCanvas';
|
|
11
|
+
import type { UiError } from '../../core/atoms/types';
|
|
12
|
+
export interface ChemistryAtom {
|
|
13
|
+
id?: string;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
element?: string;
|
|
17
|
+
radius?: number;
|
|
18
|
+
color?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ChemistryBond {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
type?: 'single' | 'double' | 'triple';
|
|
24
|
+
color?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ChemistryArrow {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
angle?: number;
|
|
30
|
+
length?: number;
|
|
31
|
+
color?: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ChemistryCanvasProps {
|
|
35
|
+
className?: string;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
title?: string;
|
|
39
|
+
backgroundColor?: string;
|
|
40
|
+
atoms?: ChemistryAtom[];
|
|
41
|
+
bonds?: ChemistryBond[];
|
|
42
|
+
arrows?: ChemistryArrow[];
|
|
43
|
+
/** Extra declarative shapes in canvas pixel coordinates. */
|
|
44
|
+
shapes?: LearningShape[];
|
|
45
|
+
interactive?: boolean;
|
|
46
|
+
animate?: boolean;
|
|
47
|
+
onShapeClick?: (payload: {
|
|
48
|
+
id?: string;
|
|
49
|
+
type?: string;
|
|
50
|
+
index: number;
|
|
51
|
+
}) => void;
|
|
52
|
+
isLoading?: boolean;
|
|
53
|
+
error?: UiError | null;
|
|
54
|
+
}
|
|
55
|
+
export declare const ChemistryCanvas: React.FC<ChemistryCanvasProps>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MathCanvas
|
|
3
|
+
*
|
|
4
|
+
* A field-scoped learning molecule for mathematics. Renders a coordinate plane
|
|
5
|
+
* with axes, grid, curves (sampled points), scatter points, and vectors on top
|
|
6
|
+
* of the declarative `LearningCanvas` atom.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import type { LearningShape, LearningPoint } from '../atoms/LearningCanvas';
|
|
12
|
+
import type { UiError } from '../../core/atoms/types';
|
|
13
|
+
export interface MathCurve {
|
|
14
|
+
label?: string;
|
|
15
|
+
color?: string;
|
|
16
|
+
/** Sampled {x,y} points in math coordinates. */
|
|
17
|
+
samples: LearningPoint[];
|
|
18
|
+
}
|
|
19
|
+
export interface MathPoint {
|
|
20
|
+
x: number;
|
|
21
|
+
y: number;
|
|
22
|
+
label?: string;
|
|
23
|
+
color?: string;
|
|
24
|
+
radius?: number;
|
|
25
|
+
}
|
|
26
|
+
export interface MathVector {
|
|
27
|
+
x: number;
|
|
28
|
+
y: number;
|
|
29
|
+
vx: number;
|
|
30
|
+
vy: number;
|
|
31
|
+
color?: string;
|
|
32
|
+
label?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface MathCanvasProps {
|
|
35
|
+
className?: string;
|
|
36
|
+
width?: number;
|
|
37
|
+
height?: number;
|
|
38
|
+
title?: string;
|
|
39
|
+
xMin?: number;
|
|
40
|
+
xMax?: number;
|
|
41
|
+
yMin?: number;
|
|
42
|
+
yMax?: number;
|
|
43
|
+
showAxes?: boolean;
|
|
44
|
+
showGrid?: boolean;
|
|
45
|
+
gridStep?: number;
|
|
46
|
+
curves?: MathCurve[];
|
|
47
|
+
points?: MathPoint[];
|
|
48
|
+
vectors?: MathVector[];
|
|
49
|
+
/** Extra declarative shapes in canvas pixel coordinates. */
|
|
50
|
+
shapes?: LearningShape[];
|
|
51
|
+
interactive?: boolean;
|
|
52
|
+
animate?: boolean;
|
|
53
|
+
onShapeClick?: (payload: {
|
|
54
|
+
id?: string;
|
|
55
|
+
type?: string;
|
|
56
|
+
index: number;
|
|
57
|
+
}) => void;
|
|
58
|
+
isLoading?: boolean;
|
|
59
|
+
error?: UiError | null;
|
|
60
|
+
}
|
|
61
|
+
export declare const MathCanvas: React.FC<MathCanvasProps>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PhysicsCanvas
|
|
3
|
+
*
|
|
4
|
+
* A field-scoped learning molecule for physics. Renders bodies, constraints,
|
|
5
|
+
* velocity arrows, and force arrows on top of the declarative `LearningCanvas`
|
|
6
|
+
* atom.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
import * as React from 'react';
|
|
11
|
+
import type { LearningShape } from '../atoms/LearningCanvas';
|
|
12
|
+
import type { UiError } from '../../core/atoms/types';
|
|
13
|
+
export interface LearningPhysicsBody {
|
|
14
|
+
id?: string;
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
radius?: number;
|
|
18
|
+
color?: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
vx?: number;
|
|
21
|
+
vy?: number;
|
|
22
|
+
fx?: number;
|
|
23
|
+
fy?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface LearningPhysicsConstraint {
|
|
26
|
+
from: string;
|
|
27
|
+
to: string;
|
|
28
|
+
color?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface PhysicsCanvasProps {
|
|
31
|
+
className?: string;
|
|
32
|
+
width?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
title?: string;
|
|
35
|
+
backgroundColor?: string;
|
|
36
|
+
bodies?: LearningPhysicsBody[];
|
|
37
|
+
constraints?: LearningPhysicsConstraint[];
|
|
38
|
+
showVelocity?: boolean;
|
|
39
|
+
showForces?: boolean;
|
|
40
|
+
velocityScale?: number;
|
|
41
|
+
forceScale?: number;
|
|
42
|
+
/** Extra declarative shapes in canvas pixel coordinates. */
|
|
43
|
+
shapes?: LearningShape[];
|
|
44
|
+
interactive?: boolean;
|
|
45
|
+
animate?: boolean;
|
|
46
|
+
onShapeClick?: (payload: {
|
|
47
|
+
id?: string;
|
|
48
|
+
type?: string;
|
|
49
|
+
index: number;
|
|
50
|
+
}) => void;
|
|
51
|
+
isLoading?: boolean;
|
|
52
|
+
error?: UiError | null;
|
|
53
|
+
}
|
|
54
|
+
export declare const PhysicsCanvas: React.FC<PhysicsCanvasProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export type StatCardSize = "sm" | "md" | "lg";
|
|
3
|
-
export interface
|
|
3
|
+
export interface MarketingStatCardProps {
|
|
4
4
|
/** The stat value to display prominently */
|
|
5
5
|
value: string;
|
|
6
6
|
/** Label describing the value */
|
|
@@ -10,4 +10,4 @@ export interface StatCardProps {
|
|
|
10
10
|
/** Additional class names */
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
-
export declare const MarketingStatCard: React.FC<
|
|
13
|
+
export declare const MarketingStatCard: React.FC<MarketingStatCardProps>;
|