Skip to content
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

fix(fuselage): States Component Font Style #579

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
2 changes: 1 addition & 1 deletion packages/fuselage/src/components/Options/Option/Option.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import OptionIcon from './OptionIcon';
type OptionProps = {
is?: ComponentProps<typeof Box>['is'];
id?: string;
children: ReactNode;
children?: ReactNode;
label?: string;
focus?: boolean;
selected?: boolean;
Expand Down
5 changes: 4 additions & 1 deletion packages/fuselage/src/components/States/States.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from 'react';

import {
States,
StatesSubtitle,
StatesIcon,
StatesTitle,
StatesSuggestionList,
StatesSuggestionListItem,
StatesSuggestion,
Expand All @@ -9,7 +13,6 @@ import {
StatesAction,
} from '.';
import { Box } from '..';
import { States, StatesSubtitle, StatesIcon, StatesTitle } from './States';

export default {
title: 'States/States',
Expand Down
4 changes: 2 additions & 2 deletions packages/fuselage/src/components/States/States.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
margin-block-end: lengths.margin(8);

color: colors.foreground(default);
@include typography.use-font-scale(h1);
@include typography.use-font-scale(h2);
}

&__subtitle,
&__list,
&__suggestion {
@include typography.use-font-scale(p2);
@include typography.use-font-scale(p4);

display: flex;
flex-direction: column;
Expand Down
49 changes: 3 additions & 46 deletions packages/fuselage/src/components/States/States.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,9 @@
import React, { FC, ComponentProps } from 'react';
import React, { FC } from 'react';

import { Button } from '..';
import { ButtonGroup } from '../ButtonGroup';
import { Icon } from '../Icon';
import './States.styles.scss';

export const States: FC = ({ children }) => (
const States: FC = ({ children }) => (
<div className='rcx-states'>{children}</div>
);

export const StatesIcon: FC<{
name: ComponentProps<typeof Icon>['name'];
// variation?: 'danger';
}> = ({ name }) => (
<div className='rcx-states__icon'>
<Icon name={name} size='x32' />
</div>
);

export const StatesTitle: FC = ({ children }) => (
<div className='rcx-states__title'>{children}</div>
);
export const StatesSubtitle: FC = ({ children }) => (
<div className='rcx-states__subtitle'>{children}</div>
);

export const StatesSuggestion: FC = ({ children }) => (
<div className='rcx-states__suggestion'>{children}</div>
);
export const StatesSuggestionText: FC = ({ children }) => (
<div className='rcx-states__suggestion-text'>{children}</div>
);

export const StatesSuggestionList: FC = ({ children }) => (
<ul className='rcx-states__list'>{children}</ul>
);

export const StatesSuggestionListItem: FC = ({ children }) => (
<li className='rcx-states__list-item'>
<span className='rcx-states__list-item-wrapper'>{children}</span>
</li>
);

export const StatesActions: FC<ComponentProps<typeof ButtonGroup>> = ({
children,
...props
}) => <ButtonGroup {...props}> {children} </ButtonGroup>;

export const StatesAction: FC<ComponentProps<typeof Button>> = ({
...props
}) => <Button primary {...props} />;
export default States;
9 changes: 9 additions & 0 deletions packages/fuselage/src/components/States/StatesAction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React, { FC, ComponentProps } from 'react';

import { Button } from '..';

const StatesAction: FC<ComponentProps<typeof Button>> = ({ ...props }) => (
<Button primary {...props} />
);

export default StatesAction;
10 changes: 10 additions & 0 deletions packages/fuselage/src/components/States/StatesActions.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import React, { FC, ComponentProps } from 'react';

import { ButtonGroup } from '../ButtonGroup';

const StatesActions: FC<ComponentProps<typeof ButtonGroup>> = ({
children,
...props
}) => <ButtonGroup {...props}> {children} </ButtonGroup>;

export default StatesActions;
14 changes: 14 additions & 0 deletions packages/fuselage/src/components/States/StatesIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React, { FC, ComponentProps } from 'react';

import { Icon } from '../Icon';

const StatesIcon: FC<{
name: ComponentProps<typeof Icon>['name'];
// variation?: 'danger';
}> = ({ name }) => (
<div className='rcx-states__icon'>
<Icon name={name} size='x32' />
</div>
);

export default StatesIcon;
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/States/StatesSubtitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { FC } from 'react';

const StatesSubtitle: FC = ({ children }) => (
<div className='rcx-states__subtitle'>{children}</div>
);

export default StatesSubtitle;
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/States/StatesSuggestion.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { FC } from 'react';

const StatesSuggestion: FC = ({ children }) => (
<div className='rcx-states__suggestion'>{children}</div>
);

export default StatesSuggestion;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { FC } from 'react';

const StatesSuggestionList: FC = ({ children }) => (
<ul className='rcx-states__list'>{children}</ul>
);

export default StatesSuggestionList;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React, { FC } from 'react';

const StatesSuggestionListItem: FC = ({ children }) => (
<li className='rcx-states__list-item'>
<span className='rcx-states__list-item-wrapper'>{children}</span>
</li>
);

export default StatesSuggestionListItem;
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { FC } from 'react';

const StatesSuggestionText: FC = ({ children }) => (
<div className='rcx-states__suggestion-text'>{children}</div>
);

export default StatesSuggestionText;
7 changes: 7 additions & 0 deletions packages/fuselage/src/components/States/StatesTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import React, { FC } from 'react';

const StatesTitle: FC = ({ children }) => (
<div className='rcx-states__title'>{children}</div>
);

export default StatesTitle;
24 changes: 23 additions & 1 deletion packages/fuselage/src/components/States/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
export * from './States';
import States from './States';
import StatesAction from './StatesAction';
import StatesActions from './StatesActions';
import StatesIcon from './StatesIcon';
import StatesSubtitle from './StatesSubtitle';
import StatesSuggestion from './StatesSuggestion';
import StatesSuggestionList from './StatesSuggestionList';
import StatesSuggestionListItem from './StatesSuggestionListItem';
import StatesSuggestionText from './StatesSuggestionText';
import StatesTitle from './StatesTitle';

export {
States,
StatesAction,
StatesActions,
StatesIcon,
StatesSubtitle,
StatesSuggestion,
StatesSuggestionList,
StatesSuggestionListItem,
StatesSuggestionText,
StatesTitle,
};
2 changes: 1 addition & 1 deletion packages/fuselage/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export * from './Chevron';
export { default as Chip } from './Chip';
export * from './Divider';
export * from './EmailInput';
export * from './States';
export * from './Field';
export * from './FieldGroup';
export * from './Grid';
Expand All @@ -38,6 +37,7 @@ export * from './SelectPaginated';
export * from './SelectInput';
export * from './Sidebar';
export * from './Skeleton';
export * from './States';
export * from './Table';
export * from './Tabs';
export * from './Tag';
Expand Down