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

Made the KLogo component #460

Merged
merged 21 commits into from
Oct 23, 2023
Merged
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
16 changes: 13 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ Changelog is rather internal in nature. See release notes for the public overvie

## Upcoming version

<!-- All new changelog items should come here -->

## Version 2.0.0

- [#460]
- **Description:** Implement KLogo
- **Products impact:** new API
- **Addresses:** https://github.com/learningequality/kolibri-design-system/issues/373
- **Components:** KLogo
- **Breaking:** no
- **Impacts a11y:** no
- **Guidance:** -

[#460]: https://github.com/learningequality/kolibri-design-system/pull/460

- [#470]
- **Description:** Fix bug and add test guard in MediaQuery implementation
Expand Down Expand Up @@ -50,8 +62,6 @@ Changelog is rather internal in nature. See release notes for the public overvie

[#463]: https://github.com/learningequality/kolibri-design-system/pull/463

## Version 2.0.0-beta0 (released - do not add new items)

- [#462]
- **Description:** Fix internal links in design system documentation
- **Products impact:** none
Expand Down
51 changes: 51 additions & 0 deletions docs/pages/klogo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<template>

<DocsPageTemplate apiDocs>
<DocsPageSection title="Overview" anchor="#overview">
<p>Shows Kolibri logo.</p>

<DocsShow>
<KLogo
altText="Kolibri Logo"
:height="150"
width="100%"
:maxWidth="150"
/>
</DocsShow>
<DocsShowCode language="html">
<KLogo
altText="Kolibri logo"
:height="150"
width="100%"
:maxWidth="150"
/>
</DocsShowCode>
</DocsPageSection>

<DocsPageSection title="Usage" anchor="#usage">
<h3>Alternative text</h3>

<p>Alternative text (<code>altText</code>) is required for the logo image. When creating it, consider the following:</p>
<ul>
<li>If the logo is used as a flat image, you can use the string "Kolibri logo"</li>
<li>If the the logo is used as a link, then the alternative text needs to give the context where the link is leading (for example "Go to home page", or similar)</li>
</ul>
</DocsPageSection>

<DocsPageSection title="Related" anchor="#related">
<ul>
<li>
<code>KLogo</code> is derived from <DocsLibraryLink component="KImg" /> and provides a subset of <code>KImg</code>'s API.
</li>
</ul>
</DocsPageSection>
</DocsPageTemplate>

</template>


<script>

export default {};

</script>
5 changes: 5 additions & 0 deletions docs/tableOfContents.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ export default [
isCode: true,
keywords: ['image', 'img'],
}),
new Page({
path: '/klogo',
title: 'KLogo',
isCode: true,
}),
new Page({
path: '/klabeledicon',
title: 'KLabeledIcon',
Expand Down
2 changes: 1 addition & 1 deletion lib/KImg.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,4 @@
</script>


<style scoped></style>
<style scoped></style>
82 changes: 82 additions & 0 deletions lib/KLogo/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template>

<KImg
:src="logo"
:altText="altText"
:height="height"
:width="width"
:maxHeight="maxHeight"
:minHeight="minHeight"
:maxWidth="maxWidth"
:minWidth="minWidth"
/>

</template>


<script>

import kolibriLogo from './kolibri-logo.svg';

export default {
name: 'KLogo',
props: {
/**
* Alternative text for the logo
*/
altText: {
type: String,
required: true,
default: '',
},
/**
* Sets the height for the logo
*/
height: {
type: [Number, String],
default: undefined,
},
/**
* Sets the width for the logo
*/
width: {
type: [Number, String],
default: undefined,
},
/**
* Sets the maximum height for the logo
*/
maxHeight: {
type: [Number, String],
default: undefined,
},
/**
* Sets the minimum height for the logo
*/
minHeight: {
type: [Number, String],
default: undefined,
},
/**
* Sets the maximum width for the logo
*/
maxWidth: {
type: [Number, String],
default: undefined,
},
/**
* Sets the minimum width for the logo
*/
minWidth: {
type: [Number, String],
default: undefined,
},
},
computed: {
logo() {
return kolibriLogo;
},
},
};

</script>
178 changes: 178 additions & 0 deletions lib/KLogo/kolibri-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/KThemePlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import KTabsPanel from './tabs/KTabsPanel';
import KTextbox from './KTextbox';
import KTooltip from './KTooltip';
import KTransition from './KTransition';
import KLogo from './KLogo';

import { themeTokens, themeBrand, themePalette, themeOutlineStyle } from './styles/theme';
import globalThemeState from './styles/globalThemeState';
Expand Down Expand Up @@ -108,6 +109,7 @@ export default function KThemePlugin(Vue) {
Vue.component('KImg', KImg);
Vue.component('KLabeledIcon', KLabeledIcon);
Vue.component('KLinearLoader', KLinearLoader);
Vue.component('KLogo', KLogo);
Vue.component('KModal', KModal);
Vue.component('KOptionalText', KOptionalText);
Vue.component('KPageContainer', KPageContainer);
Expand Down
Loading