-
Notifications
You must be signed in to change notification settings - Fork 0
Major fixes. Design and Functionality #76
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
f920c35
Minor fixes
anitnilay20 3bf6d60
Fix divider test case
anitnilay20 5e04857
Fix row gutter styles
prateekshourya29 511b470
Merge branch 'hotfix/minor' of https://github.com/sha-el/sha-el-desig…
prateekshourya29 97be1d5
Fix Calendar error
prateekshourya29 5cef5d7
Fix lint fail error
prateekshourya29 3eb3d68
Fix test fail error
prateekshourya29 cdca9ee
Fix stepper styles
prateekshourya29 7cc3e78
Add suggested changes
prateekshourya29 d0841cf
Change storybook grid preview
prateekshourya29 22d1ff3
Fix input component style
prateekshourya29 9212c2e
Add global margin and padding.
anitnilay20 91bdc50
Fix child.type undefined error
prateekshourya29 dca6dbc
Fix list styles
prateekshourya29 0324d84
Add padding & margin and some style fix
prateekshourya29 f689274
Fix performance slow issue in `padding` and `margin` global.
anitnilay20 d9b2592
Fix failing test cases.
anitnilay20 19ac617
Use SurfaceProp interface and fix linter errors.
anitnilay20 573898a
Test cases for Calendar (#77)
prateekshourya29 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,58 @@ | ||
import * as React from 'react'; | ||
import { classes } from '../../helpers'; | ||
import { flexPosition, rowStyle } from './style'; | ||
import { gutterStyle, rowStyle } from './style'; | ||
|
||
export const Row: React.FC<RowProps> = (props) => { | ||
const { | ||
className, | ||
onClick, | ||
style, | ||
children, | ||
children: __children, | ||
gutter: __gutter, | ||
justifyContent: __justifyContent, | ||
alignItems: __alignItems, | ||
wrap: __wrap, | ||
flexDirection: __flexDirection, | ||
...rest | ||
} = props; | ||
|
||
const children: React.ReactElement[] = Array.isArray(__children) | ||
? (__children as React.ReactElement[]) | ||
: [__children]; | ||
|
||
const [RowGutterStyles, ColPadding] = gutterStyle(props); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable name should follow camel casing. |
||
return ( | ||
<div | ||
onClick={onClick} | ||
className={classes(rowStyle, flexPosition(props), className, 'sha-el-row')} | ||
className={classes(rowStyle(props), RowGutterStyles, className, 'sha-el-row')} | ||
style={style} | ||
{...rest} | ||
> | ||
{children} | ||
{children | ||
.filter((child) => child !== undefined) | ||
.map((child, i) => React.cloneElement(child, { key: i, style: { ...ColPadding, ...child.props.style } }))} | ||
</div> | ||
); | ||
}; | ||
|
||
Row.defaultProps = { | ||
justifyContent: 'flex-start', | ||
gutter: ['10px 0', '.5rem'], | ||
gutter: [0, 0], | ||
wrap: 'wrap', | ||
flexDirection: 'row', | ||
}; | ||
|
||
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; | ||
export type Gutter = number | Partial<Record<Breakpoint, number>>; | ||
|
||
export interface RowProps extends React.HtmlHTMLAttributes<HTMLDivElement> { | ||
children: React.ReactNode; | ||
children: React.ReactElement | React.ReactElement[]; | ||
style?: React.CSSProperties; | ||
/** | ||
* Spacing between elements | ||
* [Row, Col] | ||
*/ | ||
gutter?: [React.CSSProperties['padding'], React.CSSProperties['padding']]; | ||
gutter?: Gutter | [Gutter, Gutter]; | ||
justifyContent?: React.CSSProperties['justifyContent']; | ||
alignItems?: React.CSSProperties['alignItems']; | ||
className?: string; | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -60,8 +60,8 @@ const Inner: React.FC<InnerProps> = (props) => { | |||||
onMouseEnter={() => updateDrawerButton(true)} | ||||||
onMouseLeave={() => updateDrawerButton(false)} | ||||||
> | ||||||
<Row gutter={[0, '0 5px 0 5px']} style={{ overflowX: 'hidden', maxWidth: width + 'px' }} wrap="nowrap"> | ||||||
<Col flex="0 0 60px" className={elevationCss(3)}> | ||||||
<Row gutter={[0, 0]} style={{ overflowX: 'hidden', maxWidth: width + 'px' }} wrap="nowrap"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<Col style={{ padding: '0 5px' }} flex="0 0 60px" className={elevationCss(3)}> | ||||||
{props.logo && <div className={css.logo}>{props.logo}</div>} | ||||||
{children.map((v, i) => ( | ||||||
<div className={css.item} key={`item-${i}`} onClick={() => onOpen(v, i, false, toggle)}> | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.