-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(fuselage): Field.Link component (#619)
* feat: add field link component * add storybook improvements Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
- Loading branch information
1 parent
9b8c83e
commit 7bce30a
Showing
40 changed files
with
182 additions
and
39 deletions.
There are no files selected for viewing
Binary file added
BIN
+3.26 KB
packages/fuselage/.loki/reference/desktop_Forms_Field_Description.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.72 KB
packages/fuselage/.loki/reference/desktop_Forms_Field_Error_and_Hint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
packages/fuselage/.loki/reference/desktop_Forms_Field_Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.1 KB
packages/fuselage/.loki/reference/desktop_Forms_Field_Hint_and_Link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.71 KB
packages/fuselage/.loki/reference/mobile_Forms_Field_Error_and_Hint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
packages/fuselage/.loki/reference/mobile_Forms_Field_Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+6.22 KB
packages/fuselage/.loki/reference/mobile_Forms_Field_Hint_and_Link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.37 KB
packages/fuselage/.loki/reference/tablet_Forms_Field_Error_and_Hint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+0 Bytes
(100%)
packages/fuselage/.loki/reference/tablet_Forms_Field_Example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.81 KB
packages/fuselage/.loki/reference/tablet_Forms_Field_Hint_and_Link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
packages/fuselage/src/components/Field/Field.Description.spec.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { render } from '@testing-library/react'; | ||
import React from 'react'; | ||
|
||
import Field from '.'; | ||
|
||
it('renders without crashing', () => { | ||
render(<Field.Link />); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,9 @@ | ||
import React, { ComponentPropsWithoutRef, FC } from 'react'; | ||
import React, { ComponentPropsWithoutRef } from 'react'; | ||
|
||
import { Box } from '../Box'; | ||
import { FieldDescription } from './FieldDescription'; | ||
import { FieldError } from './FieldError'; | ||
import { FieldHint } from './FieldHint'; | ||
import { FieldLabel } from './FieldLabel'; | ||
import { FieldRow } from './FieldRow'; | ||
|
||
type FieldProps = ComponentPropsWithoutRef<typeof Box>; | ||
|
||
export const Field: FC<FieldProps> & { | ||
Label: typeof FieldLabel; | ||
Description: typeof FieldDescription; | ||
Row: typeof FieldRow; | ||
Hint: typeof FieldHint; | ||
Error: typeof FieldError; | ||
} = function Field(props: FieldProps) { | ||
export function Field(props: FieldProps) { | ||
return <Box rcx-field {...props} />; | ||
}; | ||
|
||
Field.Label = FieldLabel; | ||
Field.Description = FieldDescription; | ||
Field.Row = FieldRow; | ||
Field.Error = FieldError; | ||
Field.Hint = FieldHint; | ||
} |
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, { ComponentProps, ReactElement } from 'react'; | ||
|
||
import { Box } from '../Box'; | ||
|
||
type FieldLinkProps = ComponentProps<typeof Box>; | ||
|
||
const FieldLink = (props: FieldLinkProps): ReactElement => ( | ||
<Box is='a' target='_blank' rcx-field__link {...props} /> | ||
); | ||
|
||
export default FieldLink; |
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,16 @@ | ||
export * from './Field'; | ||
import { Field } from './Field'; | ||
import { FieldDescription } from './FieldDescription'; | ||
import { FieldError } from './FieldError'; | ||
import { FieldHint } from './FieldHint'; | ||
import { FieldLabel } from './FieldLabel'; | ||
import FieldLink from './FieldLink'; | ||
import { FieldRow } from './FieldRow'; | ||
|
||
export default Object.assign(Field, { | ||
Label: FieldLabel, | ||
Description: FieldDescription, | ||
Row: FieldRow, | ||
Error: FieldError, | ||
Hint: FieldHint, | ||
Link: FieldLink, | ||
}); |
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