Skip to content

Commit

Permalink
feat: css changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasdano committed May 16, 2024
1 parent 8a19c4e commit 62c0d71
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 14 deletions.
44 changes: 42 additions & 2 deletions src/__storyshots__/Updated Components/Table/Table-Sorting.snap
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,16 @@
opacity: 0;
}

.emotion-9:hover,
.emotion-9:focus-visible {
color: #111530;
font-family: Roboto;
font-weight: 500;
line-height: 1.25rem;
font-size: 0.875rem;
letter-spacing: 0.015625rem;
}

.emotion-9:hover [data-header-role='options'] button,
.emotion-9:focus-visible [data-header-role='options'] button {
opacity: 1;
Expand Down Expand Up @@ -247,6 +257,36 @@
fill: #194DCC!important;
}

.emotion-21 {
width: 150%;
height: 2.75rem;
-webkit-align-content: center;
-ms-flex-line-pack: center;
align-content: center;
text-align: left;
box-sizing: border-box;
padding: 8px 16px;
color: #52567a;
font-family: Roboto;
font-weight: 400;
line-height: 1.25rem;
font-size: 0.875rem;
letter-spacing: 0.015625rem;
}

.emotion-21 [data-header-role='options'] button {
opacity: 0;
}

.emotion-21:hover [data-header-role='options'] button,
.emotion-21:focus-visible [data-header-role='options'] button {
opacity: 1;
}

.emotion-21 button:focus-visible {
opacity: 1;
}

.emotion-39 {
height: 2.75rem;
padding: 8px 16px;
Expand Down Expand Up @@ -406,7 +446,7 @@
</div>
</th>
<th
class="emotion-9"
class="emotion-21"
colspan="1"
>
<div
Expand Down Expand Up @@ -499,7 +539,7 @@
</div>
</th>
<th
class="emotion-9"
class="emotion-21"
colspan="1"
>
<div
Expand Down
14 changes: 12 additions & 2 deletions src/components/Table/components/TH/TH.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export const thContainer =
rowSize,
width,
hasVisibleOptions,
}: Pick<TableProps<any>, 'rowSize'> & { width?: number; hasVisibleOptions?: boolean }) =>
isSortable,
}: Pick<TableProps<any>, 'rowSize'> & {
width?: number;
hasVisibleOptions?: boolean;
isSortable?: boolean;
}) =>
(theme: Theme): SerializedStyles => {
return css`
width: ${width ? `${width}%` : undefined};
Expand All @@ -21,7 +26,9 @@ export const thContainer =
text-align: left;
box-sizing: border-box;
padding: 8px 16px;
color: ${theme.tokens.colors.get('textColor.default.secondary')};
color: ${theme.tokens.colors.get(
`textColor.default.${hasVisibleOptions ? 'primary' : 'secondary'}`
)};
${generateStylesFromTokens(theme.tokens.typography.get('normal.body02'))};
[data-header-role='options'] {
Expand All @@ -32,6 +39,9 @@ export const thContainer =
&:hover,
&:focus-visible {
color: ${isSortable && theme.tokens.colors.get('textColor.default.primary')};
${isSortable && generateStylesFromTokens(theme.tokens.typography.get('normal.label02'))};
[data-header-role='options'] {
button {
opacity: 1;
Expand Down
12 changes: 2 additions & 10 deletions src/components/Table/components/TH/TH.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { DivProps } from 'utils/common';

import { THOptions } from './components';
import { thContainer, optionsContainer } from './TH.style';
import type { PrimitiveButtonTypes } from 'components/Button/Button.types';
import type { AcceptedIconNames } from 'components/Icon';
import IconButton from 'components/IconButton';
import type { RowSize } from 'components/Table/types';
Expand Down Expand Up @@ -62,15 +61,7 @@ const TH: React.FCC<Props & Pick<DivProps, 'onClick'>> = ({
return 'arrowDown';
};

const getIconType = (): PrimitiveButtonTypes => {
if (isDesc === true || isDesc === false) return 'secondary';

return 'tertiary';
};

return (
<IconButton iconName={getIcon()} type={getIconType()} size="compact" onClick={handleClick} />
);
return <IconButton iconName={getIcon()} type="tertiary" size="compact" onClick={handleClick} />;
};

return (
Expand All @@ -79,6 +70,7 @@ const TH: React.FCC<Props & Pick<DivProps, 'onClick'>> = ({
rowSize,
width,
hasVisibleOptions: hasVisibleOptions || Boolean(colSortingState),
isSortable,
})}
{...rest}
>
Expand Down

0 comments on commit 62c0d71

Please sign in to comment.