Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions BrazilianPlantCard/8f3ddb4d-5afe-44b7-a726-c1a6e311a27e.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"data": {
"type": "card",
"attributes": {
"commonName": null,
"scientificName": null,
"description": null,
"habitat": null,
"conservationStatus": null,
"uses": null,
"images": [],
"growthConditions": null,
"cardInfo": {
"title": null,
"description": null,
"thumbnailURL": null,
"notes": null
}
},
"meta": {
"adoptsFrom": {
"module": "../brazilianPlants",
"name": "BrazilianPlantCard"
}
}
}
}
69 changes: 69 additions & 0 deletions CardListing/a6f78262-f031-4bb1-b8be-453a4e1648a4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"data": {
"meta": {
"adoptsFrom": {
"name": "CardListing",
"module": "https://realms-staging.stack.cards/catalog/catalog-app/listing/listing"
}
},
"type": "card",
"attributes": {
"name": "Brazilian Plant Card",
"images": [],
"summary": "The BrazilianPlantCard defines a structured schema for representing information about Brazilian plants, including common and scientific names, descriptive details, habitat, conservation status, uses, images, and growth conditions. It serves as a standardized data model for cataloging plant characteristics and related information in a card-based format.",
"cardInfo": {
"name": null,
"notes": null,
"summary": null,
"cardThumbnailURL": null
}
},
"relationships": {
"specs.0": {
"links": {
"self": "../Spec/48dbd34f-c7fb-49a9-b02f-07c0904941ce"
}
},
"skills": {
"links": {
"self": null
}
},
"tags.0": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/Tag/f21d95da-0728-46a8-8622-6c157716c26c"
}
},
"license": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/License/4c5a023b-a72c-4f90-930b-da60a1de5b2d"
}
},
"publisher": {
"links": {
"self": null
}
},
"examples.0": {
"links": {
"self": "../BrazilianPlantCard/8f3ddb4d-5afe-44b7-a726-c1a6e311a27e"
}
},
"categories.0": {
"links": {
"self": "https://realms-staging.stack.cards/catalog/Category/science-discovery"
}
},
"cardInfo.theme": {
"links": {
"self": null
}
},
"cardInfo.cardThumbnail": {
"links": {
"self": null
}
}
}
}
}
45 changes: 45 additions & 0 deletions Spec/48dbd34f-c7fb-49a9-b02f-07c0904941ce.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"data": {
"meta": {
"adoptsFrom": {
"name": "Spec",
"module": "https://cardstack.com/base/spec"
}
},
"type": "card",
"attributes": {
"ref": {
"name": "BrazilianPlantCard",
"module": "../brazilianPlants"
},
"readMe": "# BrazilianPlantCard\n\n## Summary\nThe `BrazilianPlantCard` is a card definition that represents information about a Brazilian plant. It contains fields for the common name, scientific name, description, habitat, conservation status, uses, images, and growth conditions of the plant.\n\n## Import\n```gts\nimport { BrazilianPlantCard } from 'https://realms-staging.stack.cards/experiments/brazilianPlants';\n```\n\n## Usage as a Field\nYou can use the `BrazilianPlantCard` as a field within a consuming card or field definition:\n\n```gts\n@field brazilianPlant = linksTo(BrazilianPlantCard);\n```\n\n## Template Usage\nTo use the `BrazilianPlantCard` within a template, you can delegate to its fields:\n\n```hbs\n<article>\n <h2><@fields.commonName /></h2>\n <p><@fields.scientificName /></p>\n <@fields.description />\n <section>\n <h3>Habitat</h3>\n <p><@fields.habitat /></p>\n </section>\n <section>\n <h3>Conservation Status</h3>\n <p><@fields.conservationStatus /></p>\n </section>\n <section>\n <h3>Uses</h3>\n <@fields.uses />\n </section>\n <section>\n <h3>Growth Conditions</h3>\n <@fields.growthConditions />\n </section>\n <section>\n <h3>Images</h3>\n <@fields.images @format=\"embedded\" />\n </section>\n</article>\n```",
"cardInfo": {
"name": null,
"notes": null,
"summary": null,
"cardThumbnailURL": null
},
"specType": "card",
"cardTitle": "BrazilianPlantCard",
"cardDescription": null,
"containedExamples": []
},
"relationships": {
"cardInfo.theme": {
"links": {
"self": null
}
},
"linkedExamples": {
"links": {
"self": null
}
},
"cardInfo.cardThumbnail": {
"links": {
"self": null
}
}
}
}
}
39 changes: 39 additions & 0 deletions brazilianPlants.gts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { CardDef, FieldDef, field, contains, containsMany } from 'https://cardstack.com/base/card-api';
import StringField from 'https://cardstack.com/base/string';
import MarkdownField from 'https://cardstack.com/base/markdown';

class ImageLinksField extends FieldDef {
@field imageUrl = contains(StringField);
}

export class BrazilianPlantCard extends CardDef {
static displayName = 'BrazilianPlantCard';

@field commonName = contains(StringField);
@field scientificName = contains(StringField);
@field description = contains(MarkdownField);
@field habitat = contains(StringField);
@field conservationStatus = contains(StringField);
@field uses = contains(MarkdownField);
@field images = containsMany(ImageLinksField);
@field growthConditions = contains(MarkdownField);
}


/*
static isolated = class Isolated extends Component<typeof this> {
<template></template>
}

static embedded = class Embedded extends Component<typeof this> {
<template></template>
}

static atom = class Atom extends Component<typeof this> {
<template></template>
}

static edit = class Edit extends Component<typeof this> {
<template></template>
}
*/
Loading