-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(widgets): add refresh icon and className to Tooltip component (#…
…5251) ### Description <!-- What's included in this PR? --> - Export new Refresh Icon - Add tooltipClassName as a prop to Tooltip and added the default value to be the one used in this [PR](hyperlane-xyz/hyperlane-explorer#147) ### Drive-by changes <!-- Are there any minor or drive-by changes also included? --> No ### Related issues <!-- - Fixes #[issue number here] --> Refresh button will be used to add refresh functionality to explorer ### Backward compatibility <!-- Are these changes backward compatible? Are there any infrastructure implications, e.g. changes that would prohibit deploying older commits using this infra tooling? Yes/No --> Yes ### Testing <!-- What kind of testing have these changes undergone? None/Manual/Unit Tests --> Storybook
- Loading branch information
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
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,5 @@ | ||
--- | ||
'@hyperlane-xyz/widgets': minor | ||
--- | ||
|
||
Refresh Icon and Tooltip class Name |
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,18 @@ | ||
import React, { memo } from 'react'; | ||
|
||
import { ColorPalette } from '../color.js'; | ||
|
||
import { DefaultIconProps } from './types.js'; | ||
|
||
function _RefreshIcon({ color, ...rest }: DefaultIconProps) { | ||
return ( | ||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" {...rest}> | ||
<path | ||
d="M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z" | ||
fill={color || ColorPalette.Black} | ||
/> | ||
</svg> | ||
); | ||
} | ||
|
||
export const RefreshIcon = memo(_RefreshIcon); |
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,27 @@ | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Tooltip } from '../components/Tooltip.js'; | ||
|
||
const meta = { | ||
title: 'Tooltip', | ||
component: Tooltip, | ||
} satisfies Meta<typeof Tooltip>; | ||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const DefaultTooltip = { | ||
args: { | ||
id: 'id-01', | ||
content: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mattis odio ac sem dictum tincidunt. Suspendisse interdum purus et quam ornare, at tempor risus pretium.', | ||
}, | ||
} satisfies Story; | ||
|
||
export const WithTooltipClassnameTooltip = { | ||
args: { | ||
id: 'id-01', | ||
content: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut mattis odio ac sem dictum tincidunt. Suspendisse interdum purus et quam ornare, at tempor risus pretium.', | ||
tooltipClassName: 'sm:htw-max-w-[300px]', | ||
}, | ||
} satisfies Story; |