-
Notifications
You must be signed in to change notification settings - Fork 16
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
Feat: label redesign #1043
base: feat/ui-redesign-v2
Are you sure you want to change the base?
Feat: label redesign #1043
Conversation
Current coverage reportSummary
Tests which was executed
Coverage by files (63%)
|
Jest Unit tests resultsDuration: 216.355 seconds
Outcome: Passed | Total Tests: 315 | Passed: 315 | Failed: 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
|
||
import { BlockExplorer } from './BlockExplorer'; | ||
|
||
export default { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook declaration has changed, take a look at Buttons
parameters: { actions: { argTypesRegex: '^on.*' } }, | ||
} as ComponentMeta<typeof Label>; | ||
|
||
const Template: ComponentStory<typeof Label> = (args) => <Label {...args} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Storybook declaration has changed
|
||
import { Label } from './Label'; | ||
|
||
describe('ui/LabelHelpBox', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe('ui/LabelHelpBox', () => { | |
describe('ui/Label', () => { |
@@ -0,0 +1,17 @@ | |||
export type LabelPallet = 'default' | 'accent' | 'positive' | 'negative' | 'shade'; | |||
|
|||
export const LabelStyle: Record<LabelPallet, string> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like text color on parent component is redundant, because we redeclare text color on <CaptionText />
|
||
export const Label = ({ className, children, pallet = 'default' }: PropsWithChildren<Props>) => ( | ||
<div className={cnTw('rounded-lg py-0.5 px-2 group w-fit', LabelStyle[pallet], className)} data-testid="label"> | ||
<CaptionText className={cnTw('uppercase', LabelTextStyle[pallet])}>{children}</CaptionText> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it's better to declare children: string
, so nobody provides ReactNode
in here
Like you did in <BlockExplorer />
👍
}; | ||
|
||
export const LabelHelpBox = ({ className, children }: PropsWithChildren<Props>) => ( | ||
<div | ||
export const LabelHelpBox = ({ className, children, disabled = false, ...props }: PropsWithChildren<Props>) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of props might come here? Without explicit declaration in Props
it's not clear
Maybe it's not needed at all?
Also I would add children: string
as well 😉
<BodyText>{children}</BodyText> | ||
<Icon name="learn-more" className="group-hover:text-icon-hover group-active:text-icon-active" size={16} /> | ||
</div> | ||
<FootnoteText className={cnTw('text-text-primary', disabled && 'text-text-tertiary')}>{children}</FootnoteText> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is optional, could leave as you've done
<FootnoteText className={cnTw('text-text-primary', disabled && 'text-text-tertiary')}>{children}</FootnoteText> | |
<FootnoteText className={disabled ? 'text-text-tertiary' : 'text-text-primary'}>{children}</FootnoteText> |
type PopoverProps = ComponentProps<typeof Popover> & { pointer?: 'up' | 'down' }; | ||
type PointerDirection = 'up' | 'down'; | ||
type PointerPosition = 'start' | 'center' | 'end'; | ||
type PopoverProps = ComponentProps<typeof Popover> & { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just Props
?
No description provided.