Skip to content

Commit

Permalink
feat(fuselage): StatesLink Component (#1122)
Browse files Browse the repository at this point in the history
Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
  • Loading branch information
dougfabris and tassoevan authored Aug 4, 2023
1 parent 13a2bef commit 61397f8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/fuselage/src/components/States/States.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
StatesSuggestionText,
StatesActions,
StatesAction,
StatesLink,
} from '.';
import { Box, Icon } from '..';

Expand Down Expand Up @@ -94,6 +95,25 @@ export const ActionButtonWithNoSuggestions = () => (
</Box>
);

export const Link = () => (
<Box>
<States>
<StatesIcon name='magnifier' />
<StatesTitle>No app matches</StatesTitle>
<StatesSubtitle>
No app matches for ”search term here” Try searching in the Marketplace
instead.
</StatesSubtitle>
<StatesActions>
<StatesAction>Reload</StatesAction>
</StatesActions>
<StatesLink target='_blank' href='https://go.rocket.chat'>
Link to another page
</StatesLink>
</States>
</Box>
);

export const Variations = () => (
<Box>
<States>
Expand Down
10 changes: 10 additions & 0 deletions packages/fuselage/src/components/States/States.styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,14 @@ $variants: (
}
}
}

&__link {
@include typography.use-font-scale(p2);
margin-block: lengths.margin(16);

text-decoration: none;

color: colors.font(info);
@extend %--with-inline-elements;
}
}
13 changes: 13 additions & 0 deletions packages/fuselage/src/components/States/StatesLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { AllHTMLAttributes, ComponentProps } from 'react';
import React from 'react';

import Box from '../Box/Box';

type StatesLinkProps = ComponentProps<typeof Box> &
AllHTMLAttributes<HTMLAnchorElement>;

const StatesLink = (props: StatesLinkProps) => (
<Box is='a' rcx-states__link {...props} />
);

export default StatesLink;
2 changes: 2 additions & 0 deletions packages/fuselage/src/components/States/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import States from './States';
import StatesAction from './StatesAction';
import StatesActions from './StatesActions';
import StatesIcon from './StatesIcon';
import StatesLink from './StatesLink';
import StatesSubtitle from './StatesSubtitle';
import StatesSuggestion from './StatesSuggestion';
import StatesSuggestionList from './StatesSuggestionList';
Expand All @@ -14,6 +15,7 @@ export {
StatesAction,
StatesActions,
StatesIcon,
StatesLink,
StatesSubtitle,
StatesSuggestion,
StatesSuggestionList,
Expand Down

0 comments on commit 61397f8

Please sign in to comment.