@westonkd/sprint 0.1.2 → 0.2.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/agent-manifest.json +111 -1
- package/dist/index.cjs +62 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +1082 -946
- package/dist/index.js.map +1 -1
- package/dist/sprint.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -868,6 +868,105 @@ export declare interface HeadingProps extends ComponentPropsWithRef<"h2"> {
|
|
|
868
868
|
level?: HeadingLevel;
|
|
869
869
|
}
|
|
870
870
|
|
|
871
|
+
declare function Image_2(props: ImageProps): JSX.Element | null;
|
|
872
|
+
export { Image_2 as Image }
|
|
873
|
+
|
|
874
|
+
export declare type ImageFit = "cover" | "contain";
|
|
875
|
+
|
|
876
|
+
export declare const imageMeta: {
|
|
877
|
+
readonly name: "Image";
|
|
878
|
+
readonly category: "display";
|
|
879
|
+
readonly summary: "A framed picture in a slot that holds its shape. It is the one component whose content an agent cannot read, so alt is not decoration: it is the whole of what the agent gets, and the source URL is published beside it for an agent that can fetch pixels of its own.";
|
|
880
|
+
readonly whenToUse: "Use it for any picture that carries meaning: a screenshot, a diagram, a photograph, a logo in running content. Describe it in alt as if to someone on the phone. Pass alt=\"\" only for a picture that adds nothing, which then disappears from the agent view entirely.";
|
|
881
|
+
readonly whenNotToUse: "Do not use it for a decorative texture; that is the ornament vocabulary, which costs no request and no description. Do not use it for an icon whose meaning is already in adjacent text.";
|
|
882
|
+
readonly status: "experimental";
|
|
883
|
+
readonly props: {
|
|
884
|
+
readonly src: {
|
|
885
|
+
readonly kind: "string";
|
|
886
|
+
readonly description: "Where the pixels are. Published as data-sprint-src so an agent that can see can fetch the file itself.";
|
|
887
|
+
readonly required: true;
|
|
888
|
+
};
|
|
889
|
+
readonly alt: {
|
|
890
|
+
readonly kind: "string";
|
|
891
|
+
readonly description: "What the picture shows, in a sentence. This is the entire agent rendering of the image, so write it for a reader who will never see it. Empty means \"this picture carries no meaning\", and the component then renders nothing in agent view.";
|
|
892
|
+
readonly required: true;
|
|
893
|
+
};
|
|
894
|
+
readonly caption: {
|
|
895
|
+
readonly kind: "string";
|
|
896
|
+
readonly description: "A visible line under the frame, for a credit, a date, or a figure number. It is read as well as seen, so it does not repeat alt.";
|
|
897
|
+
};
|
|
898
|
+
readonly ratio: {
|
|
899
|
+
readonly kind: "enum";
|
|
900
|
+
readonly description: "The shape the slot holds while the picture loads and if it fails. auto lets the file decide its own height once it arrives.";
|
|
901
|
+
readonly values: readonly ["1:1", "4:3", "3:2", "16:9", "auto"];
|
|
902
|
+
readonly default: "auto";
|
|
903
|
+
};
|
|
904
|
+
readonly fit: {
|
|
905
|
+
readonly kind: "enum";
|
|
906
|
+
readonly description: "How the picture fills a slot of a fixed ratio. cover crops it, contain letterboxes it. Ignored when ratio is auto.";
|
|
907
|
+
readonly values: readonly ["cover", "contain"];
|
|
908
|
+
readonly default: "cover";
|
|
909
|
+
};
|
|
910
|
+
};
|
|
911
|
+
readonly state: {
|
|
912
|
+
readonly src: {
|
|
913
|
+
readonly description: "The image source, so an agent can fetch the file without the DOM.";
|
|
914
|
+
readonly attribute: "data-sprint-src";
|
|
915
|
+
};
|
|
916
|
+
readonly status: {
|
|
917
|
+
readonly description: "Whether the pixels have arrived. Present only in the human rendering, because in agent view nothing is fetched and any value would be a guess.";
|
|
918
|
+
readonly attribute: "data-sprint-status";
|
|
919
|
+
readonly values: readonly ["loading", "ready", "error"];
|
|
920
|
+
};
|
|
921
|
+
readonly ratio: {
|
|
922
|
+
readonly description: "The shape the slot holds.";
|
|
923
|
+
readonly attribute: "data-sprint-ratio";
|
|
924
|
+
readonly values: readonly ["1:1", "4:3", "3:2", "16:9", "auto"];
|
|
925
|
+
};
|
|
926
|
+
readonly fit: {
|
|
927
|
+
readonly description: "Whether a fixed-ratio slot crops the picture or letterboxes it.";
|
|
928
|
+
readonly attribute: "data-sprint-fit";
|
|
929
|
+
readonly values: readonly ["cover", "contain"];
|
|
930
|
+
};
|
|
931
|
+
readonly decorative: {
|
|
932
|
+
readonly description: "Present when the image was declared meaningless with an empty alt and no caption. It renders nothing at all in agent view.";
|
|
933
|
+
readonly attribute: "data-sprint-decorative";
|
|
934
|
+
};
|
|
935
|
+
};
|
|
936
|
+
readonly agentView: {
|
|
937
|
+
readonly example: "- **Image** \"Launch pad 39B under floodlights, gantry retracted\" [fit=cover, ratio=16:9, src=media/pad-39b.svg]\n - part `caption` \"Pad 39B, T-minus 4h\"";
|
|
938
|
+
};
|
|
939
|
+
readonly examples: readonly [{
|
|
940
|
+
readonly title: "A described picture";
|
|
941
|
+
readonly description: "The alt text is the agent rendering. It registers no WebMCP tool: there is nothing to do to a picture, and the source URL is already on the element.";
|
|
942
|
+
readonly code: "<Image\n src=\"media/pad-39b.svg\"\n alt=\"Launch pad 39B under floodlights, gantry retracted\"\n ratio=\"16:9\"\n/>";
|
|
943
|
+
}, {
|
|
944
|
+
readonly title: "A captioned figure";
|
|
945
|
+
readonly description: "The caption is read as well as seen, and arrives as its own part, so it can say what alt should not repeat.";
|
|
946
|
+
readonly code: "<Image\n src=\"media/telemetry.svg\"\n alt=\"Line chart of chamber pressure holding flat for nine minutes, then dropping\"\n caption=\"Static fire 04, chamber pressure\"\n ratio=\"3:2\"\n fit=\"contain\"\n/>";
|
|
947
|
+
}, {
|
|
948
|
+
readonly title: "A picture that means nothing";
|
|
949
|
+
readonly description: "An empty alt is a claim, not an omission: it says this picture carries no meaning. The component then renders nothing in agent view, the way Stack does.";
|
|
950
|
+
readonly code: "<Image src=\"media/grain.svg\" alt=\"\" ratio=\"1:1\" />";
|
|
951
|
+
}];
|
|
952
|
+
readonly a11y: {
|
|
953
|
+
readonly notes: "The frame is a figure named by its alt text, and the picture inside carries the same alt natively, so a fallback still reads when the file fails. A caption is a figcaption. While the picture is loading or after it has failed, the slot keeps its border and states its condition rather than collapsing; that band is aria-hidden, because on failure it shows the alt text a screen reader has already been given.";
|
|
954
|
+
};
|
|
955
|
+
readonly relatedComponents: readonly ["Card", "Panel"];
|
|
956
|
+
};
|
|
957
|
+
|
|
958
|
+
export declare interface ImageProps extends Omit<ComponentPropsWithRef<"figure">, "children"> {
|
|
959
|
+
src: string;
|
|
960
|
+
alt: string;
|
|
961
|
+
caption?: string;
|
|
962
|
+
ratio?: ImageRatio;
|
|
963
|
+
fit?: ImageFit;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
export declare type ImageRatio = "1:1" | "4:3" | "3:2" | "16:9" | "auto";
|
|
967
|
+
|
|
968
|
+
export declare type ImageStatus = "loading" | "ready" | "error";
|
|
969
|
+
|
|
871
970
|
export declare function isModelContextAvailable(): boolean;
|
|
872
971
|
|
|
873
972
|
export declare interface JsonSchemaObject {
|
|
@@ -1766,7 +1865,7 @@ export declare interface SprintProviderProps {
|
|
|
1766
1865
|
theme?: SprintTheme;
|
|
1767
1866
|
}
|
|
1768
1867
|
|
|
1769
|
-
export declare type SprintTheme = "dark" | "light";
|
|
1868
|
+
export declare type SprintTheme = "dark" | "light" | "calorie" | "calorie-dark";
|
|
1770
1869
|
|
|
1771
1870
|
export declare type SprintView = "human" | "agent";
|
|
1772
1871
|
|