Giter Club home page Giter Club logo

innovaccer / design-system Goto Github PK

View Code? Open in Web Editor NEW
77.0 11.0 71.0 675.91 MB

Masala Design System (MDS) is an open-source design system built at Innovaccer. This is a simple and customisable component library to build faster, beautiful, and more accessible React applications on the guidelines and principles of Masala Design System.

Home Page: https://mds.innovaccer.com

License: MIT License

JavaScript 39.03% HTML 0.01% TypeScript 55.31% CSS 5.62% Shell 0.03%
hacktoberfest hacktoberfest2020 innovaccer css bem css-variable react javascript typescript design-system

design-system's Introduction

Masala Design System

Masala Design System (MDS) is an open-source design system built at Innovaccer. This is a simple and customizable component library to build faster, beautiful, and more accessible React applications on the guidelines and principles of Masala Design System.


codecov GitHub GitHub top language Snyk Vulnerabilities for GitHub Repo


πŸš€ Get Up and Running

To install @innovaccer/design-system in your project, you will need to run the following command using npm:

npm install @innovaccer/design-system

If you prefer Yarn, use the following command instead:

yarn add @innovaccer/design-system

Adding style:

Import style at your app's root, it is not included in library bundle and shipped as a single css file. For more details see our styling section

import '@innovaccer/design-system/css';

If you want to try out @innovaccer/design-system, you can also use CodeSandbox.

Edit @innovaccer/design-system

Usage

import { Button } from '@innovaccer/design-system';
const App = () => {
  return <Button>Done</Button>;
};

For more information about each component, check out our Storybook. Check out our Tutorial to guide you in creating an awesome app.

CDN

If you prefer to include library globally by marking it as external in your application, library provides various single-file distributions, which can be used as following:

<!-- style -->
<link href="https://unpkg.com/@innovaccer/[email protected]/css/dist/index.css" rel="stylesheet" />

<!-- un-compressed UMD -->
<script src="https://unpkg.com/browse/@innovaccer/[email protected]/dist/index.umd.js"></script>

<!-- brotli compressed UMD -->
<script src="https://unpkg.com/@innovaccer/[email protected]/dist/index.umd.js.br"></script>

<!-- gzip compressed UMD -->
<script src="https://unpkg.com/@innovaccer/[email protected]/dist/index.umd.js.gz"></script>

Styling

As this component library is part of a framework-agnostic design system used at Innovaccer the styling is done with CSS using CSS variables for theming and BEM methodology for reusable and modular styling. So it requires you to include CSS in your project by either importing or serving it as a static file. The complete stylesheet is published as part of the component library at path @innovaccer/design-system/css. You can include css by importing it or loading it from cdn.

πŸ‘‰ Using Font

The css sets the font family as 'Nunito Sans' for the body. To add this font in your project you need to load this font. The recommended way to do it is by adding the following google font cdn link to your app's head.

<link
  href="https://fonts.googleapis.com/css?family=Nunito+Sans:300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap"
  rel="stylesheet"
/>

πŸ‘‰ Updating Font:

If you don't add the font described above font family will not be affected by css. However, if you want to update the font family update it via the following css variable.

--font-family

πŸ‘‰ Reset Styles

As BEM is used reset.css is not used and no style reset is done.

πŸ‘‰ Polyfill for IE

For css variables to work on IE we use a polyfill at runtime to achieve dynamic theming through variables. Please add the following polyfill in your page.

<script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
<script>
  cssVars({
    onlyLegacy: true,
  });
</script>

πŸ—ƒοΈ Repos

Here are the supporting repositories.

  • MDS Rich Text Editor - Feature-rich WYSIWYG (What You See Is What You Get) HTML editor and WYSIWYG Markdown editor. It is used to create blogs, notes sections, comment sections etc. It has a variety of tools to edit and format rich content.
  • MDS Docs - Documentation site for Masala design system.
  • MDS Helpers - Alert Service.

πŸ“š Documentation

❗ Code of Conduct

We expect everyone participating in the community to abide by our Code of Conduct. Please read it. Please follow it. We work hard to build each other up and create amazing things together. πŸ’ͺπŸ’œ

🀝 How to Contribute

Whether you're helping us fix bugs, improve the docs, or spread the word, we'd love to have you as part of the community! πŸ’ͺπŸ’œ

Check out our Contributing Guide for ideas on contributing and setup steps for getting our repositories up and running on your local machine.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Aditya Kumawat

πŸ’»

Riya Lohia

πŸ’»

Satyam Yadav

πŸ’» πŸ“– πŸ‘€

sandeshchoudhary

πŸ’»

adityajhajharia

πŸ’»

Anuradha Aggarwal

πŸ’»

Sidharth

πŸ’»

stuti1090

πŸ’»

Vikas Singh

πŸ’»

SaniyaGupta

πŸ’»

Parth Chauhan

πŸ’»

Stuti Pandey

πŸ’»

Shivam Dwivedi

πŸ’»

Rahul Gaur

πŸ’»

atifzaidi92

πŸ’»

Sumit Dhyani

πŸ’»

Tanmay Sharma

πŸ’»

Rashi Gupta

πŸ’»

Varnika Jain

πŸ’»

Aman Verma

πŸ’»

SAMYAK JAIN

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

πŸ“ License

Licensed under the MIT License.

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  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  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  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

design-system's Issues

Fix duplicate test snapshot file

I've seen errors in the past (in different modules, obv.), which nobody would have thought, occurred because a file with the same name but difference case existed.

Screenshot 2020-08-30 at 1 23 42 PM

Table: Cannot specify min-width and width in percentage for cell

Description

For responsive layouts, need the option to specify cell width in percentage and also give min-width. As of now, cell width can only be given in pixels values.

Steps to reproduce

Expected result

Cells can be better adapted to the available table width.

Actual result

Table: General fixes

Description

  • GridCell overflow: 'hidden' not required.
  • Extra space before/after Table Body Rows(need to reproduce).
  • Table: support for default page number, totalRecords(not sure yet).
  • Table: update default minWidth of GridCell.

Steps to reproduce

Clear steps describing how to reproduce the issue.

Expected result

What should happen?

Actual result

What happened.

Table Pagination should NOT be fixed on footer

Table footer with pagination should be there at the end of table items.
Right now it is fixed on footer (like header) which may give an illusion to the user that the table has only the items which are there above the footer and they may go to the next page without even scrolling to hidden items.

Add "type" attribute for Dropdown and Button component

  1. Dropdown component from design-system is a button with "no" type attribute. The default value of "type" attr for button is Submit. So when I am clicking on the dropdown, its is submitting the form as the Dropdown is being used in a form (SS attached).

Screenshot 2020-08-21 at 8 48 17 PM

  1. Also there is no prop to add type attribute for Button component.

Grid - Select All Button

Summary

Select All Button is missing to select all Records in case of Pagination.

Basic example

Motivation

There should be a way to select all Records in case of Pagination.

Table: breaks when there's a null value for one of the columns

Description

Table throws an error while rendering when the value present for one of the column name's is null. This can obviously be fixed by custom cell and all those options but i still feel that this should not break the Ui at the component level

image
image

Grid - Support for no previous state for Sorting

Summary

Support for no previous state for Sorting

Basic example

Motivation

Right now we receive sortingList which contains history of sorting done. There should be a way to fetch only the last sorted column.

Multi-select Dropdown: Entire row should be clickable

Description

In the case of multi-select dropdowns, the clickable area is restricted to checkbox and corresponding labels. Clicking on the right of a dropdown item doesn't toggle the checkbox state.

Steps to reproduce

  1. Open a multi-select dropdown
  2. Click on a dropdown item, outside of the checkbox or label
  3. Checkbox will not get selected

Expected result

The entire dropdown item should be clickable

DatePicker issues

Unintended behavior:

  1. Getting typescript error on setting icon and placeholder in inputOptions. Also mask is a compulsory prop but in my case I don't want to use it.
<DatePicker            
   inputOptions={{ icon: 'event', placeholder: 'MM/DD/YYYY' }}
/>

Feature requests:

  1. The Datepicker is huge right now and its looking very bad. Give the option to set its size (like small/medium/large).
  2. Like Select control type, give option to closeOnSelect

Datepicker: Clicking on year should open year picker

Description

DatePicker shows Month and Year in the top center. Clicking on the year should take the user to year list. Currently goes to Month list in that year.

Steps to reproduce

Click on the year (2020)
image

Expected result

The following view should open
image

Actual result

It is going to the month list view
image

Table state is not getting cleared properly

This is happening with Async table. If I sort the table on any column, then the corresponding down/up arrow comes for ascending/descending sort respectively besides its name in the header.
Next, I navigate away from the component containing the table and its componentWillUnmount is triggered. And I return to this component, then the first column is always sorted in descending order with the down arrow icon visible in the table.
I checked the same on Storybook also. It is happening there as well.

Issue gif:
351

Grid - No callback available for onSearchChange

Description

No callback available for onSearchChange

Steps to reproduce

Expected result

There should be a callback which should be used when there is updated searchTerm in updateData argument

Actual result

Grid - hover/selected state is limited to last column

Description

hover/selected state is limited to last column

Steps to reproduce

Clear steps describing how to reproduce the issue.

Expected result

Entire row needs to be highlighted in case of hover/active/selected.

Actual result

Row highlight is limited to last column.

Dropdown: Active state not implemented correctly

Description

Dropdown button should be in the active state during mouse down

Expected result

On mouse click, dropdown button goes into active state

Actual result

On mouse click, dropdown button moved to focus state

Table: Default Scrollbar Position

The scrollbar should begin after the column header row.

Right now scrollbar starts at the same vertical position with the column header:

image-20200825-191334(1)

Expected:

DM 2 - Incompleted

Don't call onChange on Cancel event in checkbox component

Description

OnChange event should not be called when user presses cancel button in Dropdown(checkboxes)

Steps to reproduce

1.Open dropdown
2.Select/unselect and press cancel or simply press cancel
3.onChange event is called which is causing modal to popup

Expected result

Cancel should close the dropdown

Actual result

Cancel did not close the dropdown

Grid - withCheckbox: true is not supported with loaderSchema

Description

withCheckbox: true is not supported with loaderSchema

Steps to reproduce

Clear steps describing how to reproduce the issue.

Expected result

Placeholders for row checkboxes should be present.

Actual result

Placeholders for row checkboxes are missing.

Table: Infinite scrolling

Summary

Just like the async table fetches data when page changes in infinite scrolling it can fetch when few rows are left which can have some default and changeable through props.

Basic example

<Table
    {...props}
    infiniteScroll
/>

Motivation

Some pages have infinite scrolling, like the Care protocol audit

Checkbox horizontally stacked instead of vertically stacked

Suddenly options in the checkbox group are horizontally stacked instead of being vertically stacked which is breaking our design. It is because of below change:

.Checkbox { display: flex} => .Checkbox { display: inline-flex}

Before
Screenshot 2020-09-23 at 7 12 18 AM

After
Screenshot 2020-09-23 at 7 12 33 AM

ID prop not exposed for Controls

Cannot set ID for the following Control Types.

  1. Radio
  2. Checkbox
  3. Select (no option to set ID in options list)
  4. Input
  5. Textarea

For some control types (like Radio), ID is set equal to the value supplied. Due to this if 2 different Radio items (present in separate Radio groups) on a page have the same value, on clicking the Label of the second one, the first one is getting selected.

Grid - Dropdowns are not as per the design

Description

Dropdown triggers needs to be transparent.

Steps to reproduce

Expected result

Dropdown triggers needs to be transparent.

Actual result

Dropdown triggers appearance is 'basic'

Pre select all selected values in options not working

Description

When Dropdown is passed a list in options. When then item in list having selected true/false should be respectively checked/unchecked(pre-selected). Which is not working

Steps to reproduce

1.Populate list with options as a list which some pre selected or pre selected
2. Open dropdown.
3. Selected values for not checked/unchecked

Expected result

Values show be checked appropriately

Actual result

Values were not checked at all.

Search Input: search clear button is not visible

Description

While using the SearchInput, the search clear btn is not visible after typing text in the input box. The input was not disabled and I also provided the onClear prop.

Steps to reproduce

Provide the onClear prop to Search Input. Enter text into input field.

Expected result

After entering some text into the input field and defining the onClear callback, the input clear btn should be made visible.

Actual result

After entering some text into the input field and defining the onClear callback, the input clear btn is NOT visible.

Dropdown: add support for min-width of Popover.

Summary

  • width, max-width should only apply to Popover.
  • Add min-width support.
  • Add default min-width for showApplyButton case.

Basic example

If the proposal involves a new or changed API, include a basic code example. Omit this section if it's not applicable.

Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?

Table: add prop to configure horizontal and vertical borders πŸ’‘

Summary

Brief explanation of the feature.

As per the current docs, there's no config to draw vertical grid lines(border) in the table. The table by default comes with horizontal lines for each row and that too is non-configurable as of now. all I'm asking is to allow both horizontal and verticals grid lines with the option to configure from outside.

Basic example

Our design has both kinds of table:

with
image

without
image

Table: Bugs and Feature requests

  • Hide nested row trigger icon when there is no nested child of a parent (to be discussed with design team, design screen attached)
  • Disable nested row scrolling horizontally independent of parent (issue screenshot attached)
  • Add (cursor:pointer) to nested row trigger icon on parent row
  • Give option to hide pagination dynamically or when fetched results are less than defined page count
  • Fix spacing issues due to overflow-x on table footer
  • If loadingSchema is not provided, the loading key in cell prop is always false. Hence cannot show loading state in cell
  • Give the option to set empty search template when a search returns 0 results (like error template)
  • Increase the debounce delay from 250ms to a higher value or expose a prop to set the same
  • Give an option to set β€œShowing x items” count in the table header. This is required because the result count currently does not take into account the nested results.

Screenshot 2020-07-24 at 7 39 05 PM

Screenshot 2020-07-26 at 2 55 49 PM

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.