-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: apply new typography and refactor flex or grid system props (#59)
- Loading branch information
Showing
115 changed files
with
994 additions
and
758 deletions.
There are no files selected for viewing
This file contains 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 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
27 changes: 0 additions & 27 deletions
27
__tests__/helpers/systemPropsHelper/flexBoxSystemClassName.test.ts
This file was deleted.
Oops, something went wrong.
23 changes: 23 additions & 0 deletions
23
__tests__/helpers/systemPropsHelper/flexOrGridSystemClassName.test.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { flexOrGridSystemClassName } from '@/helpers/systemPropsHelper'; | ||
import { FlexOrGridSystemProps } from '@/types'; | ||
|
||
describe('Test method flexBoxClassName', () => { | ||
test.each([ | ||
{ | ||
props: { | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
gap: { | ||
xs: 'xs', | ||
md: 's', | ||
}, | ||
}, | ||
expected: 'items-center@xs justify-center@xs gap-xs@xs gap-s@md', | ||
}, | ||
] as { props: FlexOrGridSystemProps; expected: string }[])( | ||
'return flex or grid class name $expected', | ||
({ props, expected }) => { | ||
expect(flexOrGridSystemClassName(props)).toEqual(expected); | ||
} | ||
); | ||
}); |
18 changes: 0 additions & 18 deletions
18
__tests__/helpers/systemPropsHelper/hiddenSystemClassName.test.ts
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
__tests__/helpers/systemPropsHelper/layoutSystemClassName.test.ts
This file contains 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { layoutSystemClassName } from '@/helpers/systemPropsHelper'; | ||
import { LayoutSystemProps } from '@/types/SystemProps'; | ||
|
||
describe('Test method ', () => { | ||
test.each([ | ||
{ | ||
props: { | ||
hiddenBelow: 'md', | ||
}, | ||
expected: 'hidden-below@md', | ||
}, | ||
] as { props: LayoutSystemProps; expected: string }[])( | ||
'return layout class name $expected', | ||
({ props, expected }) => { | ||
expect(layoutSystemClassName(props)).toEqual(expected); | ||
} | ||
); | ||
}); |
This file contains 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 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 +1,3 @@ | ||
import './name/cti/kebab-only-category-item'; | ||
import './value/math'; | ||
import './value/size'; |
This file contains 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import StyleDictionary from 'style-dictionary'; | ||
|
||
StyleDictionary.registerTransform({ | ||
name: 'math', | ||
type: 'value', | ||
transitive: true, | ||
matcher: token => typeof token.value === 'string' && /(\+|-|\*|\/)(\s|\d)/.test(token.value), | ||
transformer: token => { | ||
const cleanExpression = token.value.replace(/[a-z]+/gi, ''); | ||
return eval(cleanExpression); | ||
}, | ||
}); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import StyleDictionary from 'style-dictionary'; | ||
|
||
StyleDictionary.registerTransform({ | ||
name: 'size/px', | ||
type: 'value', | ||
transitive: true, | ||
matcher: token => token?.type !== 'scale' && ['spacing', 'font-size'].some(name => token.path.includes(name)), | ||
transformer: token => `${parseInt(token.value)}px`, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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,15 +1,15 @@ | ||
import classNames from 'classnames'; | ||
import React from 'react'; | ||
|
||
import { Box } from '@/components'; | ||
import { Text } from '@/components'; | ||
import type { ComponentPropsWithoutRef, MarginSystemProps } from '@/types'; | ||
|
||
import './Blockquote.scss'; | ||
|
||
export interface BlockquoteProps extends MarginSystemProps, Omit<ComponentPropsWithoutRef<'blockquote'>, 'align'> {} | ||
|
||
export const Blockquote: React.FC<BlockquoteProps> = ({ children, className, ...props }) => ( | ||
<Box as="blockquote" {...props} pl="m" italic className={classNames('blockquote', className)}> | ||
<Text as="blockquote" {...props} pl="m" size="m" italic className={classNames('blockquote', className)}> | ||
{children} | ||
</Box> | ||
</Text> | ||
); |
This file contains 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 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 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 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 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.