Skip to content

Commit

Permalink
refactor: replace Field.[SUBCOMPONENT] usage in favor of named imports
Browse files Browse the repository at this point in the history
  • Loading branch information
juliajforesti committed Sep 25, 2023
1 parent e9478fc commit d040f63
Show file tree
Hide file tree
Showing 15 changed files with 413 additions and 346 deletions.
29 changes: 18 additions & 11 deletions packages/fuselage/src/components/FieldGroup/FieldGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@ import { Title, Description, Primary, Stories } from '@storybook/addon-docs';
import type { ComponentStory, ComponentMeta } from '@storybook/react';
import React from 'react';

import { Field, FieldGroup, InputBox } from '../..';
import {
Field,
FieldGroup,
FieldHint,
FieldLabel,
FieldRow,
InputBox,
} from '../..';

export default {
title: 'Inputs/FieldGroup',
Expand All @@ -29,23 +36,23 @@ export default {
export const Default: ComponentStory<typeof FieldGroup> = () => (
<FieldGroup>
<Field>
<Field.Label>Field #1</Field.Label>
<Field.Row>
<FieldLabel>Field #1</FieldLabel>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
</FieldRow>
</Field>
<Field>
<Field.Label>Field #2</Field.Label>
<Field.Row>
<FieldLabel>Field #2</FieldLabel>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Hint>Help text</Field.Hint>
</FieldRow>
<FieldHint>Help text</FieldHint>
</Field>
<Field>
<Field.Label>Field #3</Field.Label>
<Field.Row>
<FieldLabel>Field #3</FieldLabel>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
</FieldRow>
</Field>
</FieldGroup>
);
17 changes: 13 additions & 4 deletions packages/fuselage/src/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ import type { ComponentStory } from '@storybook/react';
import type { ComponentProps } from 'react';
import React from 'react';

import { FieldGroup, Field, TextInput, Button, Modal, Box } from '../..';
import {
FieldGroup,
Field,
TextInput,
Button,
Modal,
Box,
FieldLabel,
FieldRow,
} from '../..';

export default {
title: 'Containers/Modal',
Expand Down Expand Up @@ -193,10 +202,10 @@ export const _WithForm: ComponentStory<typeof Modal> = () => (
<Modal.Content>
<FieldGroup>
<Field>
<Field.Label>Label</Field.Label>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldRow>
<TextInput placeholder='Placeholder' />
</Field.Row>
</FieldRow>
</Field>
</FieldGroup>
</Modal.Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Field, InputBox } from '@rocket.chat/fuselage';
import {
Field,
FieldDescription,
FieldError,
FieldHint,
FieldLabel,
FieldRow,
InputBox,
} from '@rocket.chat/fuselage';
import type { Meta, Story } from '@storybook/react';

import { ActionLink, Form } from '..';
Expand Down Expand Up @@ -45,13 +53,13 @@ export const Default: Story = (props) => (
</Form.Header>
<Form.Container>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldError>Error</FieldError>
<FieldHint>Hint</FieldHint>
</Field>
</Form.Container>
<Form.Footer>footer</Form.Footer>
Expand Down Expand Up @@ -80,112 +88,112 @@ export const WithScroll: Story = (props) => (
</Form.Header>
<Form.Container>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
<Field>
<Field.Label>Label</Field.Label>
<Field.Description>Description</Field.Description>
<Field.Row>
<FieldLabel>Label</FieldLabel>
<FieldDescription>Description</FieldDescription>
<FieldRow>
<InputBox.Skeleton />
</Field.Row>
<Field.Error>Error</Field.Error>
<Field.Hint>Hint</Field.Hint>
</FieldRow>
<FieldRow>Error</FieldRow>
<FieldHint>Hint</FieldHint>
</Field>
</Form.Container>
<Form.Footer>footer</Form.Footer>
Expand Down
Loading

0 comments on commit d040f63

Please sign in to comment.