-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1719 from natura-cosmeticos/DSY-999-debug
Dsy 999 debug
- Loading branch information
Showing
7 changed files
with
94 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export interface DebugProps { | ||
/** | ||
* Specify an optional className to be added to your Debug | ||
*/ | ||
className?: string | ||
|
||
/** | ||
* Optional ID for testing | ||
*/ | ||
testID?: string; | ||
} |
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,31 @@ | ||
import React from 'react' | ||
import { Story, Meta } from '@storybook/react' | ||
import { Debug, DebugProps } from '.' | ||
|
||
const componentStatus = ` | ||
- - - | ||
**NOTE FOR UXs**: This component is available in the following variants: | ||
- ❌ Standard | ||
With the following attribute statuses: | ||
- **Attributes:** | ||
- ❌ \`Types\` | ||
- - - | ||
` | ||
|
||
export default { | ||
title: 'Components/Debug', | ||
component: Debug, | ||
parameters: { | ||
componentSubtitle: '', | ||
docs: { description: { component: componentStatus } } | ||
} | ||
} as Meta | ||
|
||
export const Playground: Story<DebugProps> = (args) => ( | ||
<Debug {...args} /> | ||
) |
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,10 @@ | ||
import { createUseStyles } from 'react-jss' | ||
import { Theme } from '@naturacosmeticos/natds-themes' | ||
|
||
const styles = createUseStyles((theme: Theme) => ({ | ||
example: { | ||
display: 'flex' | ||
} | ||
})) | ||
|
||
export default styles |
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,11 @@ | ||
import React from 'react' | ||
import Debug from '.' | ||
import renderWithTheme from '../../helpers/renderWithTheme' | ||
|
||
describe('Debug component', () => { | ||
it('should render correctly with default props', () => { | ||
const { styles, component } = renderWithTheme(<Debug />) | ||
|
||
expect([styles.toString(), component.container]).toMatchSnapshot() | ||
}) | ||
}) |
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,25 @@ | ||
import React from 'react' | ||
import styles from './Debug.styles' | ||
import { DebugProps } from './Debug.props' | ||
|
||
const Debug = React.forwardRef<HTMLElement, DebugProps>( | ||
(props, ref) => { | ||
const { | ||
className = '', | ||
...rest | ||
} = props | ||
const { example } = styles() | ||
|
||
return ( | ||
<span | ||
className={`${className} ${example}`} | ||
ref={ref} | ||
{...rest} | ||
> | ||
Debug | ||
</span> | ||
) | ||
} | ||
) | ||
|
||
export default Debug |
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,5 @@ | ||
import Debug from './Debug' | ||
|
||
export { Debug } | ||
export { DebugProps } from './Debug.props' | ||
export default Debug |
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