@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/agent-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"library": "sprint",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"conventions": {
|
|
5
5
|
"componentAttribute": "data-sprint",
|
|
6
6
|
"partAttribute": "data-sprint-part",
|
|
@@ -728,6 +728,116 @@
|
|
|
728
728
|
}
|
|
729
729
|
]
|
|
730
730
|
},
|
|
731
|
+
{
|
|
732
|
+
"name": "Image",
|
|
733
|
+
"category": "display",
|
|
734
|
+
"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.",
|
|
735
|
+
"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.",
|
|
736
|
+
"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.",
|
|
737
|
+
"status": "experimental",
|
|
738
|
+
"props": {
|
|
739
|
+
"src": {
|
|
740
|
+
"kind": "string",
|
|
741
|
+
"description": "Where the pixels are. Published as data-sprint-src so an agent that can see can fetch the file itself.",
|
|
742
|
+
"required": true
|
|
743
|
+
},
|
|
744
|
+
"alt": {
|
|
745
|
+
"kind": "string",
|
|
746
|
+
"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.",
|
|
747
|
+
"required": true
|
|
748
|
+
},
|
|
749
|
+
"caption": {
|
|
750
|
+
"kind": "string",
|
|
751
|
+
"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."
|
|
752
|
+
},
|
|
753
|
+
"ratio": {
|
|
754
|
+
"kind": "enum",
|
|
755
|
+
"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.",
|
|
756
|
+
"values": [
|
|
757
|
+
"1:1",
|
|
758
|
+
"4:3",
|
|
759
|
+
"3:2",
|
|
760
|
+
"16:9",
|
|
761
|
+
"auto"
|
|
762
|
+
],
|
|
763
|
+
"default": "auto"
|
|
764
|
+
},
|
|
765
|
+
"fit": {
|
|
766
|
+
"kind": "enum",
|
|
767
|
+
"description": "How the picture fills a slot of a fixed ratio. cover crops it, contain letterboxes it. Ignored when ratio is auto.",
|
|
768
|
+
"values": [
|
|
769
|
+
"cover",
|
|
770
|
+
"contain"
|
|
771
|
+
],
|
|
772
|
+
"default": "cover"
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
"state": {
|
|
776
|
+
"src": {
|
|
777
|
+
"description": "The image source, so an agent can fetch the file without the DOM.",
|
|
778
|
+
"attribute": "data-sprint-src"
|
|
779
|
+
},
|
|
780
|
+
"status": {
|
|
781
|
+
"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.",
|
|
782
|
+
"attribute": "data-sprint-status",
|
|
783
|
+
"values": [
|
|
784
|
+
"loading",
|
|
785
|
+
"ready",
|
|
786
|
+
"error"
|
|
787
|
+
]
|
|
788
|
+
},
|
|
789
|
+
"ratio": {
|
|
790
|
+
"description": "The shape the slot holds.",
|
|
791
|
+
"attribute": "data-sprint-ratio",
|
|
792
|
+
"values": [
|
|
793
|
+
"1:1",
|
|
794
|
+
"4:3",
|
|
795
|
+
"3:2",
|
|
796
|
+
"16:9",
|
|
797
|
+
"auto"
|
|
798
|
+
]
|
|
799
|
+
},
|
|
800
|
+
"fit": {
|
|
801
|
+
"description": "Whether a fixed-ratio slot crops the picture or letterboxes it.",
|
|
802
|
+
"attribute": "data-sprint-fit",
|
|
803
|
+
"values": [
|
|
804
|
+
"cover",
|
|
805
|
+
"contain"
|
|
806
|
+
]
|
|
807
|
+
},
|
|
808
|
+
"decorative": {
|
|
809
|
+
"description": "Present when the image was declared meaningless with an empty alt and no caption. It renders nothing at all in agent view.",
|
|
810
|
+
"attribute": "data-sprint-decorative"
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"agentView": {
|
|
814
|
+
"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\""
|
|
815
|
+
},
|
|
816
|
+
"examples": [
|
|
817
|
+
{
|
|
818
|
+
"title": "A described picture",
|
|
819
|
+
"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.",
|
|
820
|
+
"code": "<Image\n src=\"media/pad-39b.svg\"\n alt=\"Launch pad 39B under floodlights, gantry retracted\"\n ratio=\"16:9\"\n/>"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
"title": "A captioned figure",
|
|
824
|
+
"description": "The caption is read as well as seen, and arrives as its own part, so it can say what alt should not repeat.",
|
|
825
|
+
"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/>"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
"title": "A picture that means nothing",
|
|
829
|
+
"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.",
|
|
830
|
+
"code": "<Image src=\"media/grain.svg\" alt=\"\" ratio=\"1:1\" />"
|
|
831
|
+
}
|
|
832
|
+
],
|
|
833
|
+
"a11y": {
|
|
834
|
+
"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."
|
|
835
|
+
},
|
|
836
|
+
"relatedComponents": [
|
|
837
|
+
"Card",
|
|
838
|
+
"Panel"
|
|
839
|
+
]
|
|
840
|
+
},
|
|
731
841
|
{
|
|
732
842
|
"name": "Link",
|
|
733
843
|
"category": "navigation",
|