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

KCardGrid part 2: Add KCardGrid with the base layouts + Add selection controls + Final documentation for KCard and KCardGrid + Few KCard bugfixes and improvements #785

Merged
merged 44 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bcb8bad
Move playground to a directory
MisRob Sep 16, 2024
9b95613
Add higher quality sample picture
MisRob Sep 16, 2024
406dcf9
Add space below the belowTitle slot
MisRob Sep 16, 2024
ed26c35
Increase documentation content area size
MisRob Sep 16, 2024
9294705
Fine-tune spacing and make it robust
MisRob Sep 16, 2024
1fa9648
Fix unprecise calculation
MisRob Sep 16, 2024
9b39614
Coordinates space taken by the thumbnail area and
MisRob Sep 16, 2024
ef31f68
Hide the placeholder after the thumbnail image is loaded
MisRob Sep 16, 2024
1f3cbf6
Add KCardGrid with base layouts
MisRob Sep 16, 2024
4c6ccbe
Add new documentation components
MisRob Sep 16, 2024
4ea1fb2
Add new KCardGrid docs and improve KCard docs
MisRob Sep 16, 2024
f7b7031
Rename titleLines to titleMaxLines
MisRob Sep 16, 2024
6ee11aa
Rename layout to orientation
MisRob Sep 16, 2024
3c84ce1
Use available constants
MisRob Sep 16, 2024
c528ae0
Add support for selection controls
MisRob Sep 16, 2024
0cb34f2
Remove uneccessary doc folders
MisRob Sep 16, 2024
dd8163c
Fix component name
MisRob Sep 16, 2024
166314b
Fix screenreaders announcing all card content
MisRob Sep 16, 2024
ac8a309
Fix bookmark button's purpose not being announced
MisRob Sep 16, 2024
52cd595
Move card components to one directory
MisRob Sep 16, 2024
58b3adb
Reset playground
MisRob Sep 16, 2024
c11966e
Overview and Guidelines sections writing improvements
MisRob Sep 17, 2024
cb1ca39
Allow the docs toggle button be displayed inline next to related text
MisRob Sep 17, 2024
bfcf923
Usage sections writing improvements
MisRob Sep 17, 2024
ae80bab
Remove duplicate information of API documentation sections
MisRob Sep 17, 2024
de61587
Specify the direction of cards stretching in docs
MisRob Sep 17, 2024
1e6fd25
Do not use links for API references on a same page
MisRob Sep 18, 2024
abede1c
Condense related info to the same paragraph
MisRob Sep 18, 2024
9bfb21f
More realistict cards sample and add more content variety
MisRob Sep 18, 2024
4c2359e
Comment on gridItemStyle
MisRob Sep 20, 2024
80dbcb1
Fix docs typo
MisRob Sep 20, 2024
3f42452
Remove redundant documentation
MisRob Sep 20, 2024
619ff8c
Always use annotation color
MisRob Sep 24, 2024
cc9ca8a
Center placeholder content by default
MisRob Sep 24, 2024
175744b
More noticeable show more button
MisRob Sep 24, 2024
a0994de
Fix incorrect number of cards displayed
MisRob Sep 26, 2024
be5554c
Fix typo
MisRob Sep 26, 2024
17ebf92
Link doc cards to the same page
MisRob Sep 26, 2024
dacae5d
Align sample cards with designs
MisRob Sep 26, 2024
8724a68
Improve doc live and code examples display
MisRob Sep 26, 2024
011320c
Remove unused class
MisRob Sep 26, 2024
6a8d0f2
Reduce space between below title and footer
MisRob Sep 26, 2024
38a9322
Consistent style for pills
MisRob Sep 26, 2024
f5d897f
Revert unwanted style change
MisRob Sep 26, 2024
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
15 changes: 14 additions & 1 deletion dev_docs/04_how_to_update_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,33 @@ Layout:
* `<DocsPageTemplate />` - the main page template used by all pages
* `<DocsPageSection />` - sections within the page template with auto-generated anchor links

Navigation:

* `<DocsSubNav />` - for showing sub-navigation as a list of links

Links:

* `<DocsAnchorTarget />` - for creating anchor link targets
* `<DocsExternalLink />` - links to an external website
* `<DocsInternalLink />` - links to pages within the design system
* `<DocsLibraryLink />` - links to library components with `<code>` formatting

Content:

* `<DocsToggleButton />` with `<DocsToggleContent />` - toggles visibility of content
* `<DocsTable />` - for showing styled table

Illustration:

* `<DocsShow />` - for showing a component
* `<DocsShow />` - for showing live examples
* `<DocsShowCode />` - for showing code
* `<DocsDoNot />` - for showing side-by-side "Do" and "Do not" illustrations
* `<DocsColorBlock />` - for showing a theme color
* `<DocsIconBlock />` - for showing an icon




All Kolibri shared components (for example `KButton`) are also available to be used within content. However, this should be limited to using them for _examples of usage_ only.

## Updating the library components documentation
Expand Down
Binary file added docs/assets/hummingbird-large-cc-by-sa-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/common/DocsPageSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
computed: {
style() {
return this.fullwidth ? {} : { maxWidth: '700px' };
return this.fullwidth ? {} : { maxWidth: '900px' };
},
},
mounted() {
Expand Down
48 changes: 48 additions & 0 deletions docs/common/DocsSubNav.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<template>

<nav class="nav">
<ol>
<li
v-for="(item, key) in items"
:key="key"
>
<a :href="item.href">{{ item.text }}</a>
</li>
</ol>
</nav>

</template>


<script>

/**
* Displays sub-navigation as a list of links
*/
export default {
name: 'DocsSubNav',
props: {
/**
* List of navigation items { text, href}
*/
items: {
type: Array,
required: true,
},
},
};

</script>


<style lang="scss" scoped>

ol {
padding-left: 22px;
}

.nav {
margin: 12px 0;
}

</style>
37 changes: 37 additions & 0 deletions docs/common/DocsTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<template>

<table>
<slot></slot>
</table>

</template>


<script>

/**
* A table component
*/
export default {
name: 'DocsTable',
};

</script>


<style lang="scss" scoped>

@import '~/assets/definitions';

table {
border-collapse: collapse;
}

th,
td {
padding: 8px;
text-align: left;
border: 1px solid $border-color;
}

</style>
91 changes: 91 additions & 0 deletions docs/common/DocsToggleButton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<template>

<button class="toggle" @click="onClick">
<span v-if="show">{{ hideText }}<KIcon icon="dropup" /></span>
<span v-else>{{ showText }}<KIcon icon="dropdown" /></span>
</button>

</template>


<script>

/**
* Button that toggles the content of 'DocsToggleContent'
*/
export default {
name: 'DocsToggleButton',
props: {
/**
* id of the corresponding 'DocsToggleContent'
*/
contentId: {
type: String,
required: true,
},
/**
* Label for the toggle button
* for showing the content
*/
showText: {
type: String,
required: false,
default: 'Show more',
},
/**
* Label for the toggle button
* for hiding the content
*/
hideText: {
type: String,
required: false,
default: 'Hide',
},
},
data() {
return {
show: false,
};
},
methods: {
onClick() {
this.show = !this.show;
if (this.show) {
document.getElementById(this.contentId).style.display = 'block';
} else {
document.getElementById(this.contentId).style.display = 'none';
}
},
},
};

</script>


<style lang="scss" scoped>

@import '~/assets/definitions';

.toggle {
display: inline-block; // prevents trailing spaces
color: $link-color;
text-decoration: underline;
cursor: pointer;
background: none;
border: 0;
transition: $basic-transition;

svg {
fill: $link-color !important;
transition: $basic-transition;
}

&:hover {
color: $link-hover-color;
svg {
fill: $link-hover-color;
}
}
}

</style>
45 changes: 45 additions & 0 deletions docs/common/DocsToggleContent.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<template>

<div class="content">
<slot></slot>
</div>

</template>


<script>

/**
* `DocsToggleButton` toggles the visibility
* of content provided via the default slot
* of its corresponding `DocsToggleContent`
*
* These two components are linked with `id`
* set on the `DocsToggleContent`. This `id`
* is then provided to `DocsToggleButton`
* via its `contentId` prop.
*/
export default {
name: 'DocsToggleContent',
};

</script>


<style lang="scss" scoped>

@import '~/assets/definitions';

.content {
display: none;
padding: 16px 24px;
margin: 12px 0;
border: 1px solid $border-color;

ul,
ol {
padding-left: 20px;
}
}

</style>
Loading
Loading