Giter VIP home page Giter VIP logo

medly / medly-components Goto Github PK

View Code? Open in Web Editor NEW
78.0 14.0 54.0 24.78 MB

🧩 Medly components provides numerous themable react components, each with multiple varitaions of sizes, colors, position etc.

Home Page: https://medly.github.io/medly-components/

License: MIT License

JavaScript 0.21% TypeScript 66.33% HTML 0.03% MDX 33.43%
react reactjs babel styled-components typescript lerna react-testing-library jest storybook hacktoberfest

medly-components's People

Contributors

abhishekashyap avatar ankitasaxena17 avatar annaleah123 avatar bhimsenp avatar bhusnar5044 avatar deepikasindhi avatar dependabot-preview[bot] avatar dependabot[bot] avatar gmukul01 avatar isyn avatar jaredgiangrasso avatar kapilgorve avatar kunalkindra avatar manish-ranjan avatar mbetances805 avatar minheekangg avatar miqh avatar nicolaebalica avatar phoenixtw avatar pulkitbanta avatar ram-ks avatar ryannylander-medlypharmacy avatar sachidananda-panigrahi avatar saylikadam avatar stefan-medly avatar tajwinder avatar tyrion1920 avatar vaibhaveem11 avatar vitulrana avatar wsameer avatar

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  avatar

Watchers

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

medly-components's Issues

bug: column separator is getting hidden on hide/show column

Describe the bug

bug: column separator is getting hidden on hide/show column

To Reproduce

Steps to reproduce the behavior:

  1. Go to column configuration
  2. Hide column after the nested column

Expected behavior

Should show column separator on hide/show column

Screenshots

If applicable, add screenshots to help explain your problem
Screenshot 2021-02-22 at 5 22 18 PM

feat: TableTheme, Add textColor to row theme of table

Description

Currently TableTheme can be customised to change Table Row's bgColor for even/odd/selected and disabled state, would like to have option to customise Row's TextColor also.
It is very likely for someone to change text-color/foreground-color if the background color is changed, depending upon the color scheme/theme followed in the project

Solution you'd like

Current tableTheme.row object
{ 'bgColor': { 'odd': '#F7F8F9', 'even': '#ffffff', 'selected': '#D0E1FE', 'disabled': '#eff2f4' }, 'selectedBorderColor': '#126AFA' }

add an object field for textColor

{ 'bgColor': { 'odd': '#F7F8F9', 'even': '#ffffff', 'selected': '#D0E1FE', 'disabled': '#eff2f4' }, 'textColor' : { 'odd': '#F7F8F9', 'even': '#ffffff', 'selected': '#D0E1FE', 'disabled': '#eff2f4' }, 'selectedBorderColor': '#126AFA' }

bug: SingleSelect change event fires on initial render

Describe the bug

The SingleSelect component's onChange handler is being invoked with argument undefined on initial render.

To Reproduce

  1. Render SingleSelect component
  2. Print argument passed to change handler to console onChange

Expected behavior

Change event should only fire when value is actively set by the user

Screenshots

recording here

Package versions

@medly-components/[email protected]
@medly-components/[email protected]
@medly-components/[email protected]
@medly-components/[email protected]
@medly-components/[email protected]
@medly-components/[email protected]
@medly-components/[email protected]

feat: redesign Tabs compoent

Description

Tabs component should follow the latest design

In Scope

  • Provide three size option S | M | L
  • Different styles for whiteBackground and darkBackground
  • Different styles for default, hovered, active & disabled states
  • Provide title & helperText prop
  • Provide optional icon prop to show the icon
  • Provide optional superscriptText prop to show count or other helpful info

Figma Link

https://www.figma.com/file/vA4EQdxl0d0ETtYpw2uSjW/Medly-Pattern-Library-B2B-Internal?node-id=1416%3A1225

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating @types/storybook__react in /yarn.lock:
Couldn't find package "storybook__react@*" required by "@types/[email protected]" on the "npm" registry.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

feat: Form component validation groups

Description

Currently, form fields take individual validator functions, but when we have a case where 1 of 3 fields in a form must be filled out, there's no built-in way to do that validation. For example, if one of home, cell, and email must be filled out before submitting a form.

Solution you'd like

To be able to define validation groups for form validations, or some other way to validate related fields together instead of individually.

Alternatives you've considered

You can define a validator function that checks the state of the fields within the context of the component and pass that function as each of the individual fields' validator, but the error messaging behavior becomes confusing for users since the validator runs onBlur of the specific fields.

Additional context

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating @types/storybook__react in /yarn.lock:
Couldn't find package "storybook__react@*" required by "@types/[email protected]" on the "npm" registry.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

bug: hoverBgColor doesnt work on icons

The hoverBgColor prop doesnt seem to do anything.

<DeleteIcon hoverBgColor='#E5E5E5'/>

Version:
"@medly-components/core": "^1.0.0-beta.24",
"@medly-components/forms": "^1.0.0-beta.3",
"@medly-components/layout": "^1.0.0-beta.37",
"@medly-components/theme": "^1.0.0-beta.12",
"@medly-components/icons": "^1.0.0-beta.25",

bug: minWidth props not working in DateRangePicker

Describe the bug

Try to set minWidth props, it is not setting that width.

Cause

we have code like this in DatePicker:

const minWidth = props.minWidth || size === 'S' ? '25rem' : '29rem';

it should be like this:

const minWidth = props.minWidth || (size === 'S' ? '25rem' : '29rem');

Package module

  • @medly-components/core

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating @types/storybook__react in /yarn.lock:
Couldn't find package "storybook__react@*" required by "@types/[email protected]" on the "npm" registry.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

bug: MultiSelect shows value instead of label as the display value in input field

Describe the bug

MultiSelect component shows value instead of label as the display value in input when options are selected. It results in a problem with internal values being exposed in the input fields.

To Reproduce

Steps to reproduce the behavior:

  1. Use MultiSelect component with different values for label and value fields in options.
  2. Select any option.
  3. Check display value in input field.
  4. It will show value as display value instead of label.

Expected behavior

The input display value after selecting any option should be label and not value.

Screenshots

  • Options provided to MultiSelect
    image

  • Notice label starts with capital 'L' in Lorem Pharmacy
    image

  • Though the input display values show selected option Lorem Pharmacy with small 'l' which is the value field lorem pharmacy
    image

Package versions

  • @medly-components/core : 1.46.13
  • @medly-components/forms : 1.19.3
  • @medly-components/icons : 1.5.15
  • @medly-components/layout : 1.20.13
  • @medly-components/loaders : 1.0.53
  • @medly-components/theme : 1.30.8
  • @medly-components/utils : 1.8.15

Additional context

Add any other context about the problem here.

bug: Datepicker exclude MinimumSelectableDate

Describe the bug

Datepicker is disabling minSelectableDate in calendar if minimumSelectableDate is not start of the day.

To Reproduce

Try to set minimumSelectableDate as 'today' like this it will exclude today from calendar

                    <DatePicker
                        variant="outlined"
                        size="S"
                        minSelectableDate={new Date()}
                        ...
                    />

Cause:

in Calendar component this code has been written:

                            <Styled.Date
                                key={index}
                                title={_date.toDateString()}
                                isInActiveMonth={isInActiveMonth}
                                isSelected={isSelected}
                                isCurrentDate={isCurrentDate}
                                disabled={_date > maxSelectableDate || _date < minSelectableDate}
                                onClick={handleDateChange(_date)}
                            >
                                <Text>{_date.getDate()}</Text>
                            </Styled.Date>

here if minSelectableDate's time is other than start of the day '00.00.00', then the condition _date < minSelectableDate become true and it will disable that date. One possible solution might be, we change this condition something like this endOfDay(_date) < minSelectableDate

Package

@medly-components/core

Default Email validator on email field is treating abc.aaa@com as correct

Describe the bug

Default Email validator on email field is treating abc.aaa@com as correct

To Reproduce

Steps to reproduce the behavior:

  1. Enter Email abc.aaa@com in any email field
  2. As above email is not valid still it is being treated as a valid email.

Expected behavior

Email with patterns <something>@<something>.<somthing> should only be treated as valid mails

Package versions

  • @medly-components/forms :

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating @types/storybook__addon-actions in /yarn.lock:
Couldn't find package "storybook__addon-actions@*" required by "@types/[email protected]" on the "npm" registry.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

bug: Hide content of `rowHoverActions` when the table is in `loading` state

Describe the bug

When the table is in loading state (isLoading={true}) then the content passed to rowHoverActions prop should not be visible

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://delivery.dev-medly.io/'
  2. Click on 'User Management in the Side Nav'
  3. Hover over any table row when the table data is still loading
  4. See the bug

Expected behavior

The content passed to rowHoverActions prop should not be visible.

Screenshots

Package versions

  • @medly-components/core : 1.46.0
  • @medly-components/forms : 1.18.0
  • @medly-components/icons : 1.5.6
  • @medly-components/layout : 1.20.0
  • @medly-components/loaders : 1.0.44
  • @medly-components/theme : 1.30.0
  • @medly-components/utils : NA

Dependabot can't resolve your JavaScript dependency files

Dependabot can't resolve your JavaScript dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Error whilst updating @types/storybook__react in /yarn.lock:
Couldn't find package "storybook__react@*" required by "@types/[email protected]" on the "npm" registry.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

feat: masking on text input

Description

Feature Input Masking is mostly related to Credit Cards and Phone Numbers. For Example -

US Phone Numbers are added displayed in 123-456-7891 or (123) 456-7891. Its easy to format number when you are dispalying but Medly UI Mockups suggests to have Text Inputs have this type of Masking also.

Same Case is with Credit Cards 4444-4444-4444-4444

Solution you'd like

Text Input having Props maskPattern where you can define Pattern like above and then Input will consider it automatically.

Alternatives you've considered

I tried an alternative where we override the event.target.value using onInputChange function by the help of a Regex like (\d{3})(\d{3})(\d{4})

But its a very bad solution to override event.target.value on every input change.

Additional context

Need something like this => https://www.npmjs.com/package/react-input-mask

bug: Tooltip not appearing after hovering on ellipses

Describe the bug

Table Component shows ellipses on text wrap, after hovering on ellipses it is not showing the tooltip

To Reproduce

Steps to reproduce the behavior:

  1. Go to Table Component
  2. Resize the columns till you see ellipses
  3. hover on ellipses
  4. tooltip is not appearing

Expected behavior

On hover of ellipses tooltip should be shown

Screenshots

Package versions

  • @medly-components/core : 1.25.2
  • @medly-components/forms : 1.10.9
  • @medly-components/icons : 1.4.0
  • @medly-components/layout : 1.11.8
  • @medly-components/loaders : 1.0.24
  • @medly-components/theme : 1.18.0
  • @medly-components/utils : 1.4.5

Additional context

bug: update to 1.40 causes error for Card Component

Describe the bug

Card.styled.js?5d28:formatted:1 Uncaught TypeError: Cannot read property 'S' of undefined at w (Card.styled.js?5d28:formatted:1) error inside @medly-components/core/dist/es/components/Card/Card.styled.js

Prior to the update, the component above was being used with no error but the update is triggering a TypeError within the package, specifically inside @medly-components/core/dist/es/components/Card/Card.styled.js

To Reproduce

Steps to reproduce the behavior:

  1. Update package.json in noapp to "@medly-components/core": "^1.40.0"
  2. Run yarn install
  3. Run yarn docker:update-deps
  4. Run yarn docker:image-build
  5. Run yarn docker:dev
  6. See error

Expected behavior

Since I am not yet pulling in any new components from medly-components/core, I shouldn't see any errors from just updating the package.

Package versions

    "@medly-components/core": "^1.40.0",
    "@medly-components/forms": "^1.13.2",
    "@medly-components/icons": "^1.4.9",
    "@medly-components/layout": "^1.14.2",
    "@medly-components/loaders": "^1.0.33",
    "@medly-components/theme": "^1.24.1",
    "@medly-components/utils": "^1.6.2",

Additional context

If I change the component being used in NoApp (if I replace import Card to import Modal), the error goes away. So it seems like the error is only within Card component.
If I revert back to the older @medly-components/core package the error is gone.

feat: Multi select component to have creatable options

Description

Ability to create new options along with choosing existing options in multi select component

Solution you'd like

In multi select component we have to provide pre defined options. But if we want to add our custom option on-the-fly there is no way to do it.

Alternatives you've considered

React-select has a creatable component that can be used to achieve the same effect

Additional context

Example: How Trello handles tags

feat: include icons in sidebar so that we can search in storybook

Description

A clear and concise description of the feature request

Solution you'd like

A clear and concise description of what you want to happen.

Alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

bug: Datepicker should not show error message when value already present

Describe the bug

With required property true, while selecting date from datePicker calendar at the first time, error message will be appeared even if value is there.

To Reproduce

  1. Open datePicker's calendar via calendar icon.
  2. select any date
  3. Error message will be there.

Expected behavior

Error message should not be displayed if user selecting value via calendar.

Package / Module

  • @medly-components/core => DatePicker

feat: create HiddenJs and HiddenCss component

Description

Create HiddenJS and HiddenCSS component to hide the children component based on screen sizes.

Solution you'd like

Create HiddenJS and HiddenCSS component which should take props like up|down|between prop to denote the screen sizes and then the component should show and hide the children component based on the current screen size

feat: add search component

Description

Search component to show options matched to input value.

In Scope

  • Provide two sizes option S | M
  • Will accept HTMLInputElement props
  • Will accept options as prop to display search results options
  • Will accept maxHeight as prop to limit the height of search results container
  • Will accept onOptionSelected prop to select the option from search results
  • Will accept size prop to update the size of search box
  • Should follow the design

Figma Link

https://www.figma.com/file/vA4EQdxl0d0ETtYpw2uSjW/Medly-Pattern-Library-B2B-Internal?node-id=176%3A202

Suggestion(refactor): Transformed value should be passed to Cell component

Description (Package: Core/Table):

There should be an override point to alter cell data before passing it to Cell component. like for example we can have a method cellValue in TableColumnConfig, or we can somehow use existing formatter method for this purpose. This will unlock many possibilities i.e. CustomComponent can also receive custom modified data without polluting existing data array.

Example:
Currently we have:

<Cell
    rowId={id}
    key={fieldName}
    rowData={rowData}
    data={rowData[config.field]}
    ...
/>

The new proposal is to pass modified value:

// method format
cellValue: (cellData, rowData) => {
    return 'something'
}

.....

<Cell
    rowId={id}
    key={fieldName}
    rowData={rowData}
    data={cellValue(rowData[config.field], rowData)}
    ...
/>

Real world usecase:

Suppose we have order data:

[
    {
        orderNumber: 'some number',
        amount: 'some number',
        placedOn: 'some date',
        deliveredOn: 'some date',
        receivedOn: 'some date',
    },
...
]

Now we need to construct table with three field => orderNumber, amount, status. We need to calculate status by looking at fields => placedOn, deliveredOn, receivedOn. By using cellValue method we can achieve this easily without polluting original data array, and even if we are using CustomComponent then it can be used there also.

One argument here may be like we are anyway passing rowData to CustomComponent, then why we need this extra cellValue?, we still need this because in that CustomComponent we have to depend upon strings like 'placedOn' etc to extract data from rowData, which will harm CustomComponent's reusability.

bug: Wrong DataType for Cell props 'rowData'

Describe the bug

A wrong type has been mentioned for rowData in Table => Cell component. It should not be list of record, it should be one record itself.

Additional context

  • Current type:
rowData: Data;
Data => {
    [key: string]: any;
}[];
  • Expected:
 rowData: {
    [key: string]: any;
}

feat: Conditionally require/disable form fields

Description

Currently, if a field should be disabled/enabled or required based on the value of another field in the form, I have to check that field's value on every form change and update the fieldSchema to toggle whether it's required or disabled/enabled. For example, if Other is chosen from a Single Select, I may need to change a TextField from disabled to required.

Solution you'd like

Some way of linking dependent fields in the fieldSchema

Alternatives you've considered

As mentioned above, I currently am doing this manually on every form change

feat: Function to be called after both the dates are selected

Description

Currently, the date range picker stays open even when both start and end dates are selected. There is no way to know when both start and end dates are selected. The front-end needs a way to know when the user has finished selecting the date-ranges.

Solution you'd like

A prop which takes a function (A) as a parameter and calls A when both the start and end dates are selected on the calendar.

Alternatives you've considered

The <DateRangePicker> component can call the onChange prop only when both start and end dates are selected. Currently, the onChange props is called on every date selection.

Additional context

The Error Text is shown in the Date Picker even after having the value

Describe the bug

When we use DatePicker component in the Form and have the required set as true. Then Even on selecting the date it shows error message "Please fill in this field."

Although it doesn't have any impact on the Form Submission.

To Reproduce

Steps to reproduce the behavior:

  1. Have a Date component in the Form.
  2. Select a date from the calendar.
  3. It shows the error for the first time only.

Expected behavior

The Error Message should be removed if there is already a value assigned to it.

Screenshots

Screenshot 2021-05-19 at 5 16 05 PM

Package versions

  • @medly-components/core : 1.47.2
  • @medly-components/forms : 1.20.4
  • @medly-components/icons : 1.5.16
  • @medly-components/layout : 1.20.19
  • @medly-components/loaders : 1.0.54
  • @medly-components/theme : 1.30.8

Additional context

Add any other context about the problem here.

Core/Table: Last page of pagination shows incorrect range

Describe the bug

When you navigate to the last page of the <Table/> element, then in pagination the data range shows incorrect end limit.
eg, Viewing 31 - 40 of 34 Results
The pagination shows 31-40 when there are only 34 results.
The end limit number should match the total results count.

To Reproduce

Steps to reproduce the behaviour :

  1. Open a screen which has
  2. Click on the last page number shown in the Pagination
  3. Wait for page to load
  4. See error on the bottom right corner.
  5. Expected behaviour

    The pagination's end-limit number should match with the total results count.
    Eg Viewing 31-34 for 34 Results.

    Screenshots

    image

    Package versions

    • @medly-components/core : 1.43.1
    • @medly-components/forms : 1.17.1
    • @medly-components/icons : 1.5.3
    • @medly-components/layout : 1.18.6
    • @medly-components/loaders : 1.0.41
    • @medly-components/theme : 1.28.0
    • @medly-components/utils : NA

    Additional context

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.