Skip to content

Commit 61397f8

Browse files
feat(fuselage): StatesLink Component (#1122)
Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
1 parent 13a2bef commit 61397f8

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

packages/fuselage/src/components/States/States.stories.tsx

+20
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
StatesSuggestionText,
1212
StatesActions,
1313
StatesAction,
14+
StatesLink,
1415
} from '.';
1516
import { Box, Icon } from '..';
1617

@@ -94,6 +95,25 @@ export const ActionButtonWithNoSuggestions = () => (
9495
</Box>
9596
);
9697

98+
export const Link = () => (
99+
<Box>
100+
<States>
101+
<StatesIcon name='magnifier' />
102+
<StatesTitle>No app matches</StatesTitle>
103+
<StatesSubtitle>
104+
No app matches for ”search term here” Try searching in the Marketplace
105+
instead.
106+
</StatesSubtitle>
107+
<StatesActions>
108+
<StatesAction>Reload</StatesAction>
109+
</StatesActions>
110+
<StatesLink target='_blank' href='https://go.rocket.chat'>
111+
Link to another page
112+
</StatesLink>
113+
</States>
114+
</Box>
115+
);
116+
97117
export const Variations = () => (
98118
<Box>
99119
<States>

packages/fuselage/src/components/States/States.styles.scss

+10
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,14 @@ $variants: (
9393
}
9494
}
9595
}
96+
97+
&__link {
98+
@include typography.use-font-scale(p2);
99+
margin-block: lengths.margin(16);
100+
101+
text-decoration: none;
102+
103+
color: colors.font(info);
104+
@extend %--with-inline-elements;
105+
}
96106
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import type { AllHTMLAttributes, ComponentProps } from 'react';
2+
import React from 'react';
3+
4+
import Box from '../Box/Box';
5+
6+
type StatesLinkProps = ComponentProps<typeof Box> &
7+
AllHTMLAttributes<HTMLAnchorElement>;
8+
9+
const StatesLink = (props: StatesLinkProps) => (
10+
<Box is='a' rcx-states__link {...props} />
11+
);
12+
13+
export default StatesLink;

packages/fuselage/src/components/States/index.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import States from './States';
22
import StatesAction from './StatesAction';
33
import StatesActions from './StatesActions';
44
import StatesIcon from './StatesIcon';
5+
import StatesLink from './StatesLink';
56
import StatesSubtitle from './StatesSubtitle';
67
import StatesSuggestion from './StatesSuggestion';
78
import StatesSuggestionList from './StatesSuggestionList';
@@ -14,6 +15,7 @@ export {
1415
StatesAction,
1516
StatesActions,
1617
StatesIcon,
18+
StatesLink,
1719
StatesSubtitle,
1820
StatesSuggestion,
1921
StatesSuggestionList,

0 commit comments

Comments
 (0)