Code Monkey home page Code Monkey logo

kolibri-design-system's Introduction

Netlify Status Lint

Kolibri Design System

Note that the Kolibri Design System is not intended to be used as a dependency outside of Kolibri products.

If you are building a Kolibri plugin you should not add the design system as a dependency because it will be made available as a dependency of Kolibri itself.

What is Kolibri Design System?

design-system.learningequality.org is a resource for designers and developers who are building Kolibri products. It includes the design system patterns and the library of UI components.

How can I use it?

Documentation

Refer to design-system.learningequality.org to learn about the design system patterns and components, as well as the detailed technical documentation and guidance for the library components that are available for usage in Kolibri products.

For the latest (not yet released) version, visit the design system website built from the main branch at main--kolibri-design-system.netlify.app/.

Component library

The component library is a npm package. It contains front-end components, utilities, and style definitions supporting the Kolibri Design System and used in Kolibri products.

Components and utilities will be accessible under the lib path. For example:

import KButton from 'kolibri-design-system/lib/KButton';

The library is provided as source code, rather than a pre-built distribution. A project using it needs to supply both build and runtime dependencies.

How do I get help or give feedback?

Contact us at the Kolibri Design System GitHub Discussions.

If you have found a bug, you can create a Github issue following the instructions in the issue template.

How can I contribute?

  1. 💻 Follow the Getting started to set up your development server. At the bottom of the page, you can also find links that will take you to guidelines for the most common tasks.
  2. 🔍 Search for issues tagged as help wanted or good first issue.
  3. 🗣️ Ask us for an assignment in the comments of an issue you've chosen. Please request assignment of a reasonable amount of issues at a time. Once you finish your current issue or two, you are welcome to ask for more.

❓ Where to ask questions

  • For anything development related, refer to the Developer documentation at first. Some answers may already be there.
  • For questions related to a specific issue or assignment requests, use the corresponding issue's comments section.
  • Visit GitHub Discussions to ask about anything related to contributing or to troubleshoot development server issues.

👥 How to connect

  • We encourage you to visit GitHub Discussions to connect with the Learning Equality team as well as with other contributors.
  • If you'd like to contribute on a regular basis, we are happy to invite you to our open-source community Slack channel. Get in touch with us at [email protected] to receive an invitation.

🕖 Please allow us a few days to reply to your comments. If you don't hear from us within a week, reach out via GitHub Discussions.

As soon as you open a pull request, it may take us a week or two to review it as we're a small team. We appreciate your contribution and will provide feedback.


Thank you for your interest in contributing! Learning Equality was founded by volunteers dedicated to helping make educational materials more accessible to those in need, and every contribution makes a difference.

kolibri-design-system's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kolibri-design-system's Issues

KExternalLink opens in current tab

I think KExternalLink ought to either give the option to - or just by default open links with target="_blank" rel="noopener noreferrer" attrs to open external links into a new tab.

Improve API for KDropdownMenu and Icon Buttons

I'm making it work so that KDropdownMenu allows a KIconButton because our specs have required the ability to do so.

The API here ought to be improved though. text is a required prop that isn't required for a KIconButton - but a KIconButton does need some tooltip text.

I think this is likely to be more useful as we near implementation in Studio.

CSV import supports email address as identifier but Users list UI doesn't render it properly

Observed behavior

CSV import instructions at Facility - DATA - Import and export users - View spreadsheet format reference suggests using email address as an Identifier -

image

But an email address overlaps with gender field even for short emails in the Facility - USERS list -

image

Expected behavior

Identifier field's value should not overlap with gender field value.

User-facing consequences

Unreadable data

Errors and logs

Steps to reproduce

Context

Kolibri 0.14.0

'placement' prop of tooltips isn't working as expected

Observed behavior

  • default is supposed to be bottom but is actually top
  • modifying prop does not seem to have an effect

image

Expected behavior

placement should work

User-facing consequences

sub-optimal placement

Steps to reproduce

try to change placement

Context

0.12

refactor search/filter text boxes and consolidate styling

Observed behavior

There are at least three implementations of search boxes.

  • Some of them have shared components, when they shouldn't: for example the search box in the app bar and the search box in the learner content search page
  • Some of them don't have shared components, when they should: for example the search box in the learner content search page, the coach lesson management search box, and the kFilterTextbox

Expected behavior

  • We should have a single re-usable core search box component that is used inside of pages
  • We should have a single special-case search box component for use in the app bar

User-facing consequences

  • inconsistent user experience
  • very hard to maintain code

Context

0.12.3

link to color definition from color block

The DocsColorBlock component has a boolean definition property, which is intended to be:

  • true when the color block is being used on the "Color" page and is the canonical "definition" which gets linked to.
  • false when the color block is being used as an example or illustration

name: 'DocsColorBlock',
props: {
name: {
type: String,
required: true,
},
definition: {
type: Boolean,
default: false,
},
},

Setting definition to false should cross-link to the actual definition in the colors page.

update breadcrumbs usage guidance

In a recent change related to granular import/export (#2610), we added a new prop to the core breadcrumbs component:

+      /**
 +       * When set to 'true', a breadcrumb will be shown for each item in 'items' array.
 +       * Otherwise, the first item will be omitted.
 +       */
 +      showAllCrumbs: {
 +        type: Boolean,
 +        default: false,
 +      },

https://github.com/learningequality/kolibri/pull/2610/files#diff-d37333989ca3443ceed46359f1fab1feR113

We need to update the style guide to give guidance on when this prop is intended to be used.

cc @khangmach @jtamiace @jonboiser @christianmemije

improve dependency management

Currently we have a situation where there is one top-level package.json file, and:

  1. some dependencies used by the shared component library (/lib) are in dependencies
  2. other dependencies used by the shared component library (/lib) are expected/assumed to be provided by the library user
  3. all other design system dependencies are in devDependencies. This includes both build and run-time dependencies

This situation will be hard to maintain. Preferably, we want:

  • Depending on the shared component library be fast and easy:
    • install only the dependencies needed in node_modules
    • support tree shaking in webpack
    • handle situation where dependencies may already be provided by the user (perhaps using peerDependencies?)
  • When managing design system dependencies, we should be able to distinguish between run-time and build dependencies.
  • While using sub-packages might be a good strategy, we've also encountered many developer ergonomics problems with both Lerna and yarn workspaces, so we should approach this strategy with caution

cherry pick latest changes from kolibri repo

k-select input validation needs refinement

Observed behavior

As observed by @jonboiser in learningequality/kolibri#3173 (comment), the k-select component interprets {} as no option selected. If any keys are available it may interpret it as a valid input.

Also, it would be helpful to communicate the fact that input is valid to the wrapping component, so it can handle disabling input buttons.

Expected behavior

Should validate for the two keys value and label that k-select expects, and either expose its current validation state to the parent component, or have an externally accessible validator to check this validity.

User-facing consequences

May implement confusing work flows as demonstrated by learningequality/kolibri#3171..

KButton, KExternalLink, KRouterLink should look identical with identical inputs

I think that, perhaps, the only difference between them ought to really just be how we handle events.

  • KRouterLink takes a :to route which must be a valid router route.
  • KExternalLink takes a download prop (among others) to manage external URL links
  • KButton goes "click" if you click it and you can do what you want with that information.

All of them should have:

  • Primary or no?
  • Appearance basic-link raised-button flat-button
  • icon and iconAfter props & slots w/ a consistent sizing/styling
  • disabled prop

And I'm suggesting that If any of the components receive the same values for these props, they should look 100% identical. The only difference being how they act.

Add `disabled` prop to `buttonMixin`?

I wanted a button to be a router link. The "Create Account" button on the sign in. I wanted to also make that button disabled when the form is submitted.

But KRouterLink does not have the disabled prop that KButton has and I think that it maybe ought to.

<a> and <button> both have common enough uses for being disabled.

My solution was to wrap KButton in a <router-link> - which worked fine - but if KRouterLink can pretend to be a button then let's help it be better at it?

upgrade text boxes to new Material style

Observed behavior

We're currently using the old Material style of textboxes. In addition to having proven UX issues, it also leads to inconsistent vertical rhythm:

image image
image image

Expected behavior

upgrade to the new style:

image

User-facing consequences

According to the study, this has improvements in three dimensions:

  • Identifiability: The number of correct versus incorrect clicks
  • Find-ability / scan-ability: The time it took a participant to find and click on a requested element
  • Preference: Participants rank-ordered each text field variation

Context

0.12.x

KModal forms are not fully keyboard accessible because focus is not trapped

Observed behavior

Similar to learningequality/kolibri#6043, when (shift)-tabbing through a KModal form, keyboard focus will be lost when going out of bounds:

  1. If at first focusable element, Shift-Tab will take you to top of the KModal element outside of the form (but tabbing once will bring you back to the form)
  2. At the last focusable element, Tab will take you to the browser chrome (in Chrome, at least).

Expected behavior

A more convenient keyboard navigation, similar to the fix to learningequality/kolibri#6043 but within KMOdal.

User-facing consequences

Errors and logs

Steps to reproduce

Context

Firefox link issues

Side nav isn't highlighted:

image

The header anchor links don't work in firefox. For some reason the first click goes to the top of the page, and the second click goes to the actual anchor:

2020-02-25 10 40 26

KTooltip will not appear if its `reference` is a disabled button

Example from SyncAllModal.vue in Kolibri . Hovering over the "Sync" button will not cause the tooltip to appear

      <KButtonGroup>
        <KButton
          :text="coreString('cancelAction')"
          @click="$emit('cancel')"
        />
        <KButton
          ref="syncbutton"
          :text="coreString('syncAction')"
          primary
		  :disabled="submitDisabled"
          type="submit"
        />
        <!-- TODO make tooltips appear when hovering over disabled buttons-->
        <KTooltip
          v-if="submitDisabled"
          reference="syncbutton"
          :refs="$refs"
        >
          <span v-if="noRegisteredFacilities">
            {{ $tr('noFacilitiesTooltip') }}
          </span>
          <span v-else>
            {{ $tr('currentlyOfflineTooltip') }}
          </span>
        </KTooltip>
      </KButtonGroup>

select boxes don't work when they appear towards the bottom of a scrolling area

Observed behavior

We've run into on at least two occasions.

First in learningequality/kolibri#3652, the select menu in the language switcher login-page caused major issues:

kolibribeta-peek-ff

More recently in learningequality/kolibri#4016, select boxes that towards the bottom of scrolling areas (or that contain many items) have a very poor user experience because they require the user to scroll down in order to see the pop-up:

add new account have bug

Unfortunately, this behavior is built-in to our current custom select widget, and in fact may be unavoidable for any custom select widget.

Expected behavior

A true native select box appears on top of everything, even the outer window:

image

Since we cannot achieve this and retain our custom styling, we should avoid using select boxes anywhere that they might exhibit this type of behavior. In particular, this means:

  1. Select boxes should always have a maximum number of items that can easily fit on the smallest screen size
  2. Select boxes should never appear at the bottom of a scrolling pane

We should also update our style guide with guidance to this effect

User-facing consequences

Hard to select items

Steps to reproduce

see steps in learningequality/kolibri#4016

Context

0.11


cc @khangmach @jtamiace

implement common grid functionality using composables rather than nesting

Observed behavior

In learningequality/kolibri#5843 we distinguished KGrid from KFixedGrid and KGridItem from KFixedGridItem.

@jonboiser commented

It may make the Vue devtools component view more noisy, as grid items are now nested a level deeper under KGrid > KGridItem > KGridFixedItem.

Expected behavior

We should move common functionality to composables, like we do with mixins for KButton to improve the developer experience

User-facing consequences

none

Context

0.12.7

Add better handling for buttons with long text in modals

We do not have control over the length of text in buttons when they are being translated.

In the (rare?) case that the width of the button group in modals happens to exceed the width of the modal, the buttons should wrap, with the secondary action appearing below the primary action. They should still remain right-aligned.

Screen Shot 2020-07-08 at 11 28 50 AM

Updates to flat button behaviors

Based on a Slack thread

Issue summary: We have inconsistent ways of handling the alignment of flat button components in our products. Should the text or component be aligned to a page container?

A couple of takeaways (copy pasted)

  1. Add the rules “For flat buttons: align button text, not the button component to container content boundaries; in button rows, keep 8px margin between components” to general Button Patterns documentation
  2. Add a new Boolean prop on flat buttons offset which, when set to true, adds -8px left and right margins, which will align the button based on text rather than outer boundary

Implications for 2 current PRs
#16
#21

KDropdownMenu Issues: memory leak and z-index issue

Observed behavior

  1. After closing dropdowns, they don't leave the DOM, they just stick around: notice the many tags with .drop-element. This is from the UserPage, where clicking "Options" opens the drop down menu. They go away after navigating away from User Page, at least.

Screen Shot 2019-09-16 at 3 23 03 PM

  1. The drop elements have a higher z-index of 60 than the AppBar (z-index 4), so they appear over it:

Screen Shot 2019-09-16 at 3 22 58 PM

Expected behavior

  1. Closing dropdowns destroys the UIPopover element in the DOM, so it is not adding to the DOM.
  2. UIPopover's don't appear over the AppBar

Context

Kolibri v0.13 (develop)

DocsPageSection should not require title and anchor

ref: #95 (comment)

Intent was to include an intro paragraph that does not generate a section link and anchor:

image

However the props are required:

https://github.com/learningequality/kolibri-design-system/blob/v0.2.x/docs/common/DocsPageSection.vue#L17-L26

We should update DocsPageSection so that:

  • title and anchor should be optional props, so that they can be omitted entirely. In this case, no title or anchor link is created
  • validation messaging should ensure that if either anchor or title are provided, the other is also required

Note that an alternative might be to omit the DocsPageSection component altogether, like this:

  <DocsPageTemplate>

    <p>These principles allow Learning Equality to apply its core values to the product design process. For non-designers, they also shed light on how the design team makes and prioritizes design decisions internally.</p>
    <p>When making decisions that affect our users, we encourage you to reference these principles during the product development process and to hold yourself accountable to these standards.</p>
    <p>Finally, these principles are a work in progress. The intent is that this is a living set of principles that will evolve to better serve the design team, the product process, and our users.</p>

    <DocsPageSection title="Equitable access" anchor="#equitable">
      <p>Equity is at the heart of Learning Equality’s mission. Our products address barriers of access to educational opportunity that are faced by marginalized populations.</p>
      <ul>
        ...

However this results in the text being full-width because it's the DocsPageSection which provides a max content width:

image

This is desirable so that other components like component examples can be full-width.

KTextbox invalid state won't show unless updated

KTextbox will not show error state - even when the invalid prop is true - if the value of the field has never changed.

This makes a validation like "This field is required" not show up if the user just flat out skipped it. Even if the field was focused at some point, the invalidText won't show unless you've ever entered a value.

Seems that if you have a Boolean where the implementing parent component says whether or not a field is valid that this should be everything you need to determine whether or not the message is shown.

I'm curious where the use cases were that necessitated the changeOrFocused value and why the focus on the element isn't making it show the error as expected.

maintain sidenav state across pages

The text filter and div scroll position should be maintained as you navigate around the site.

This is a bit challenging because every page is intentionally implemented as an independent HTML page, but should still be possible.

KImg component for accessible, responsive image rendering

Currently, some parts of Studio are using the Vuetify VImg component, which produces responsive images, but does so by setting a background image onto a div - this goes against good accessibility practices, and is something that @nucleogenesis did significant work to address in github.com/learningequality/kolibri

It would be good to port that responsive image work to a more general component to allow us to use accessible responsive images across our ecosystem.

Linting errors for lib/styles/trackInputModality.js

SSR-related issue related to #6

Kolibri Linter: Linting errors for lib/styles/trackInputModality.js
Kolibri Linter: 
lib/styles/trackInputModality.js
  116:3  error  Parsing error: 'import' and 'export' may only appear at the top level

Update/Streamline K-Checkbox

Want to give k-checkbox the same treatment I gave k-radio-button in learningequality/kolibri#3472

Some value adds:

  • Allows for use of v-model with k-checkbox the same way we'd use it with a native HTML one
  • Allows for descriptions in checkbox label
  • Allows us to apply display:xxxxxxx to the parent element. Right now, locked into using table.
  • Leverages native HTML behavior for things like click-label-to select, highlight.
  • Simplifies logic of the component

update all references to new .app URL

From Netlify:

A reminder that starting April 14, 2020, sites without a custom domain are being moved from your-site.netlify.com to your-site.netlify.app

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.