Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCard Technical Specification #528

Closed
MisRob opened this issue Jan 24, 2024 · 2 comments
Closed

KCard Technical Specification #528

MisRob opened this issue Jan 24, 2024 · 2 comments

Comments

@MisRob
Copy link
Member

MisRob commented Jan 24, 2024

Summary

KCard provides an accessible base card component. Furthermore, it offers the most frequently used card content and thumbnail layouts, as well as other customization options.

It is not meant to be the final card displayed in the Learning Equality Products. Rather, it offers a logic that is common to all of them and makes creation of final card components easier, faster, and consistent. The Products are expected to build their many card components, such as lesson card, resource card, and channel card, by importing and configuring KCard, and providing product specific logic to its slots. For illustration, here are some Kolibri cards that will be built on top of KCard:

Example 1 Example 2 Example 3 Example 4 Example 5
ex-1 ex-2 ex-3 ex-4 ex-5

Here for example, KCard will provide the #footer slot and positions it. In the Kolibri codebase, we will then implement ResourceCard.vue, LessonCard.vue, etc. Each of them will use KCard and provide its #footer slot with its own logic such as progress bar, context menu, leave it empty, etc.

Available layouts for card content and thumbnails

  • These are the main layouts that KCard will support (labels containing # correspond to slots, layout and thumbnailDisplay are props)

available-layouts

  • Note that except of the title prop/slot, all slots are optional. Therefore, a variety of layouts can be achieved for each layout and thumbnailDisplay combination. Relatedly, slots are not fixed in their place (for example, see #title slot taking place of #aboveTitle when #aboveTitle is not used). Few examples:
  • Depending on the thumbnail image dimensions and thumbnailScaleType prop, the image can span across the whole thumbnail area or it can be letterboxed. Scale types correspond to KImg's scaleTypes.
  • Depending on the availability of the thumbnail image and thumbnailDisplay prop, a thumbnail area can be filled with light gray color acting as a placeholder area. #thumbnailPlaceholder slot can be used to place content to this area (e.g. learning activity icon).
  • All layouts support RTL (right-to-left) languages, for example:

High-level implementation

KCard will consist of two components:

  • KCard
    • BaseCard.vue
    • index.vue (this is KCard itself, imports BaseCard)

BaseCard

is a private helper component. It encapsulates the basic logic related to semantic structure, accessibility, shadow, hover, and focus states. Since it won't be exposed as a public component, it won't have a documentation page and the Products won't be allowed to import it. Its purpose is to help with readability and separation of concerns (a11y vs layout). It represents a general card base that won't change even if we completely refactored all layouts implemented in KCard.

KCard

is a final public card component. It will have a page in the documentation. It is built on top of the BaseCard and adds logic related specifically to card content and thumbnails layout.

See issues below for detailed specification of both these components.

Issues

Out of scope

  • Final implementation of the outer dimensions of the card component, card's behavior within a grid (will be part of the card grid specification and work)
  • The final implementation of Product card components (products will have their own issues for that)

References

Resources

@MisRob
Copy link
Member Author

MisRob commented Jan 27, 2024

Not for contribution - already assigned to a team member

@MisRob
Copy link
Member Author

MisRob commented Jul 26, 2024

Closed by #625. There's couple of minor follow-ups that are now filled in new issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants