Skip to content

Commit

Permalink
feat: improvements for Icon, InputControl, MenuItem and PanelHeader c…
Browse files Browse the repository at this point in the history
…omponents.
  • Loading branch information
soslayando committed Nov 15, 2023
1 parent d56d45b commit 2e2fa1d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/core/src/components/Icon/Icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const Icon: React.FC<IconProps> = ({
}),
size: getIconSize(theme)(size),
title: tooltip,
style: { position: 'relative' },
}}
>
{children}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ export const StyledInputControl = styled.input<StyledInputControlProps>`
const inputBorderRadius = fieldTokens.shape.borderRadius;
const inputHeight = fieldTokens.size.height[$size];
const inputHorPadding = fieldTokens.space.padding.hor[$size];
const inputWithIconPadding = hasIcon
? css`calc(${iconSize} + ${inputHorPadding} * 2)`
: '0rem';
const inputWithIconPadding =
hasIcon || hasTypeIcon
? css`calc(${iconSize} + ${inputHorPadding} * 2)`
: '0rem';
const inputWithShowPasswordPadding =
type === 'password'
? css`calc(${showPasswordSize} + ${inputHorPadding} * 2)`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const StyledInputControlShowPassword = styled.span<StyledInputControlShow
right: ${({ $size, theme }) => css`
${theme.alias.fields.space.padding.hor[$size]}
`};
display: flex;
transform: translate(0, -50%);
z-index: 1;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Badge } from '../../../Badge';
import { Typography } from '../../../Typography';
import { VFlex } from '../../../VFlex';
import { ProgressBar } from '../../../ProgressBar';
import { Box } from '../../../Box';
import { GITimeZone } from '@devoinc/genesys-icons';

const meta: Meta<typeof Menu.Item> = {
Expand Down Expand Up @@ -66,9 +67,9 @@ export const WithAppendPrependAndBottomContent: Story = {
</Flex>
),
bottomContent: (
<Flex as="span" paddingTop="cmp-xs">
<Box marginTop="cmp-xs">
<ProgressBar percent={48} />
</Flex>
</Box>
),
prependContent: (
<Flex as="span" paddingRight="cmp-xs">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export const MenuItem: React.FC<MenuItemProps> = ({
justifyContent="center"
childrenFitFullWidth
spacing="0"
minWidth="0"
>
<HFlex
as="span"
Expand All @@ -183,8 +184,8 @@ export const MenuItem: React.FC<MenuItemProps> = ({
: null
}
size={iconSize}
tooltip="pepepe"
role={'img'}
tooltip={ariaLabel || (isLabelString ? label : null)}
>
{!isFontIcon ? icon : null}
</Icon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as React from 'react';

import { StyledOverloadCssProps } from '../../../../declarations';
import {
StyledOverloadCssProps,
StyledPolymorphicProps,
} from '../../../../declarations';
import { PanelFooterProps } from '../PanelFooter';
import { HeaderSettingsProps, PanelSize } from '../../declarations';

Expand All @@ -20,6 +23,7 @@ import {

export interface PanelHeaderProps
extends StyledOverloadCssProps,
Pick<StyledPolymorphicProps, 'as'>,
Omit<HeaderSettingsProps, 'renderContent'>,
Pick<PanelHeaderContainerProps, 'hasBoxShadow'>,
Pick<
Expand All @@ -46,6 +50,7 @@ export interface PanelHeaderProps

export const InternalPanelHeader: React.FC<PanelHeaderProps> = ({
actions,
as,
bordered,
children,
closeSettings,
Expand All @@ -64,6 +69,7 @@ export const InternalPanelHeader: React.FC<PanelHeaderProps> = ({
}) => {
return (
<PanelHeaderContainer
as={as}
hasBoxShadow={hasBoxShadow}
bordered={bordered}
hasSubtitle={Boolean(subtitle)}
Expand Down

0 comments on commit 2e2fa1d

Please sign in to comment.