-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [M3-7490] - Improve NodeBalancer Restricted User Experience (#1…
…0095) Co-authored-by: Jaalah Ramos <jaalah.ramos@gmail.com>
- Loading branch information
1 parent
3937bc7
commit b11bff9
Showing
25 changed files
with
331 additions
and
100 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/manager/.changeset/pr-10095-tech-stories-1706069306820.md
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 @@ | ||
--- | ||
"@linode/manager": Tech Stories | ||
--- | ||
|
||
Improve NodeBalancer Restricted User Experience ([#10095](https://github.com/linode/manager/pull/10095)) |
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
37 changes: 37 additions & 0 deletions
37
packages/manager/src/components/Button/StyledTagButton.stories.tsx
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,37 @@ | ||
import { action } from '@storybook/addon-actions'; | ||
import React from 'react'; | ||
|
||
import { StyledPlusIcon, StyledTagButton } from './StyledTagButton'; | ||
|
||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
const meta: Meta<typeof StyledTagButton> = { | ||
args: { | ||
children: 'Tag', | ||
disabled: false, | ||
onClick: () => null, | ||
}, | ||
component: StyledTagButton, | ||
title: 'Components/TagButton', | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof StyledTagButton>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
buttonType: 'outlined', | ||
children: 'Tag', | ||
disabled: false, | ||
onClick: action('onClick'), | ||
}, | ||
render: (args) => ( | ||
<StyledTagButton | ||
{...args} | ||
endIcon={<StyledPlusIcon disabled={args.disabled} />} | ||
> | ||
Add a Tag | ||
</StyledTagButton> | ||
), | ||
}; |
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,38 @@ | ||
import { styled } from '@mui/material/styles'; | ||
|
||
import Plus from 'src/assets/icons/plusSign.svg'; | ||
|
||
import { Button } from './Button'; | ||
|
||
/** | ||
* A button for Tags. Eventually this treatment will go away, | ||
* but the sake of the MUI migration we need to keep it around for now, and as a styled component in order to get rid of | ||
* spreading excessive styles for everywhere this is used. | ||
* | ||
*/ | ||
export const StyledTagButton = styled(Button, { | ||
label: 'StyledTagButton', | ||
})(({ theme, ...props }) => ({ | ||
border: 'none', | ||
fontSize: '0.875rem', | ||
...(!props.disabled && { | ||
'&:hover, &:focus': { | ||
backgroundColor: theme.color.tagButton, | ||
border: 'none', | ||
}, | ||
backgroundColor: theme.color.tagButton, | ||
color: theme.textColors.linkActiveLight, | ||
}), | ||
})); | ||
|
||
export const StyledPlusIcon = styled(Plus, { | ||
label: 'StyledPlusIcon', | ||
})(({ theme, ...props }) => ({ | ||
color: props.disabled | ||
? theme.name === 'dark' | ||
? '#5c6470' | ||
: theme.color.disabledText | ||
: theme.color.tagIcon, | ||
height: '10px', | ||
width: '10px', | ||
})); |
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
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
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,6 @@ | ||
import { grantTypeMap } from 'src/features/Account/constants'; | ||
|
||
// A useful type for getting the values of an object | ||
export type ObjectValues<T> = T[keyof T]; | ||
|
||
export type GrantTypeMap = ObjectValues<typeof grantTypeMap>; |
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
Oops, something went wrong.