Skip to content

Commit 874cae2

Browse files
authored
Merge pull request #133 from rebeccaalpert/filedetails-updates
fix(FileDetails/FileDetailsLabel): Update styles to use Kayla's tokens
2 parents 445dc30 + 050d07a commit 874cae2

File tree

4 files changed

+43
-18
lines changed

4 files changed

+43
-18
lines changed

packages/module/src/FileDetails/FileDetails.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
}
77

88
.pf-chatbot__code-icon {
9-
background-color: #37a3a3;
10-
border-radius: var(--pf-t--global--border--radius--tiny);
9+
color: var(--pf-t--global--icon--color--status--custom--default);
1110
width: 24px;
1211
height: 24px;
1312
}
@@ -16,8 +15,9 @@
1615
font-size: var(--pf-t--global--font--size--body--default);
1716
}
1817

18+
// This is used in demos only
1919
.pf-chatbot__file-details-example {
20-
background: gray;
20+
background: var(--pf-t--global--background--color--secondary--default);
2121
height: 100px;
2222
display: flex;
2323
justify-content: center;

packages/module/src/FileDetails/FileDetails.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { PropsWithChildren } from 'react';
2-
import { Icon, Flex, Stack, StackItem } from '@patternfly/react-core';
3-
import { CodeIcon } from '@patternfly/react-icons';
2+
import { Flex, Stack, StackItem } from '@patternfly/react-core';
43
import path from 'path';
54
interface FileDetailsProps {
65
/** Name of file, including extension */
@@ -928,16 +927,30 @@ export const extensionToLanguage = {
928927
export const FileDetails = ({ fileName }: PropsWithChildren<FileDetailsProps>) => {
929928
const language = extensionToLanguage[path.extname(fileName).slice(1)]?.toUpperCase();
930929
return (
931-
<Flex>
930+
<Flex gap={{ default: 'gapSm' }}>
932931
<Flex
933932
className="pf-chatbot__code-icon"
934933
justifyContent={{ default: 'justifyContentCenter' }}
935934
alignItems={{ default: 'alignItemsCenter' }}
936935
alignSelf={{ default: 'alignSelfCenter' }}
937936
>
938-
<Icon>
939-
<CodeIcon color="white" />
940-
</Icon>
937+
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
938+
<path
939+
d="M0 4C0 1.79086 1.79086 0 4 0H20C22.2091 0 24 1.79086 24 4V20C24 22.2091 22.2091 24 20 24H4C1.79086 24 0 22.2091 0 20V4Z"
940+
fill="currentColor"
941+
/>
942+
<g clipPath="url(#clip0_3280_27505)">
943+
<path
944+
d="M13.8204 5.63002C13.3954 5.50752 12.9529 5.75502 12.8304 6.18002L9.63035 17.38C9.50785 17.805 9.75535 18.2475 10.1804 18.37C10.6054 18.4925 11.0479 18.245 11.1704 17.82L14.3704 6.62002C14.4929 6.19502 14.2454 5.75252 13.8204 5.63002ZM15.8354 8.63252C15.5229 8.94502 15.5229 9.45252 15.8354 9.76502L18.0679 12L15.8329 14.235C15.5204 14.5475 15.5204 15.055 15.8329 15.3675C16.1454 15.68 16.6529 15.68 16.9654 15.3675L19.7654 12.5675C20.0779 12.255 20.0779 11.7475 19.7654 11.435L16.9654 8.63502C16.6529 8.32252 16.1454 8.32252 15.8329 8.63502L15.8354 8.63252ZM8.16785 8.63252C7.85535 8.32002 7.34785 8.32002 7.03535 8.63252L4.23535 11.4325C3.92285 11.745 3.92285 12.2525 4.23535 12.565L7.03535 15.365C7.34785 15.6775 7.85535 15.6775 8.16785 15.365C8.48035 15.0525 8.48035 14.545 8.16785 14.2325L5.93285 12L8.16785 9.76502C8.48035 9.45252 8.48035 8.94502 8.16785 8.63252Z"
945+
fill="white"
946+
/>
947+
</g>
948+
<defs>
949+
<clipPath>
950+
<rect width="16" height="12.8" fill="white" transform="translate(4 5.60001)" />
951+
</clipPath>
952+
</defs>
953+
</svg>
941954
</Flex>
942955
<Stack>
943956
<StackItem>
Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
.pf-chatbot__file-label {
22
padding: var(--pf-t--global--spacer--sm) var(--pf-t--global--spacer--md) var(--pf-t--global--spacer--sm)
33
var(--pf-t--global--spacer--md);
4-
gap: var(--pf-t--global--spacer--md);
4+
gap: var(--pf-t--global--spacer--sm);
5+
--pf-v6-c-label--m-clickable--hover--BackgroundColor: var(--pf-t--global--background--color--primary--hover);
6+
border: var(--pf-t--global--border--width--strong) solid transparent;
57
}
68

79
.pf-v6-c-label.pf-chatbot__file-label {
8-
--pf-v6-c-label--BackgroundColor: rgba(255, 255, 255, 1);
10+
--pf-v6-c-label--BackgroundColor: var(--pf-t--global--background--color--primary--default);
911
--pf-v6-c-label--BorderRadius: var(--pf-t--global--border--radius--small);
12+
--pf-v6-c-label--Color: var(--pf-t--global--text--color--regular);
1013

1114
.pf-chatbot__file-label > .pf-v6-c-label__content {
12-
--pf-v6-c-label--Color: rgba(255, 255, 255, 1);
15+
--pf-v6-c-label--Color: var(--pf-t--global--background--color--primary--default);
1316
}
1417
}
1518

1619
.pf-v6-theme-dark {
1720
.pf-v6-c-label.pf-chatbot__file-label {
18-
--pf-v6-c-label--BackgroundColor: rgba(41, 41, 41, 1);
19-
--pf-v6-c-label--m-clickable--hover--BackgroundColor: rgba(41, 41, 41, 1);
20-
--pf-v6-c-label--Color: rgba(255, 255, 255, 1);
21-
--pf-v6-c-label--m-clickable--hover--Color: rgba(255, 255, 255, 1);
21+
--pf-v6-c-label--m-clickable--hover--Color: var(--pf-t--global--text--color--regular);
22+
--pf-v6-c-label--m-clickable--hover--BackgroundColor: var(--pf-t--global--background--color--secondary--hover);
2223
}
2324

2425
.pf-chatbot__file-label > .pf-v6-c-label__actions > .pf-v6-c-button.pf-m-plain > .pf-v6-c-button__icon {
25-
--pf-v6-c-button__icon--Color: rgba(199, 199, 199, 1);
26+
--pf-v6-c-button__icon--Color: var(--pf-t--global--icon--color--regular);
27+
}
28+
}
29+
30+
.pf-chatbot__file-label.pf-m-clickable:hover,
31+
.pf-chatbot__file-label.pf-m-clickable:focus-within {
32+
border: var(--pf-t--global--border--width--strong) solid var(--pf-t--global--border--color--on-secondary);
33+
--pf-v6-c-label--BackgroundColor: var(--pf-t--global--background--color--primary--hover);
34+
--pf-v6-c-label--m-clickable--hover--BackgroundColor: var(--pf-t--global--background--color--primary--hover);
35+
36+
.pf-chatbot__code-icon {
37+
color: var(--pf-t--global--icon--color--status--custom--hover);
2638
}
2739
}

packages/module/src/FileDetailsLabel/FileDetailsLabel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const FileDetailsLabel = ({
2424
<Flex
2525
justifyContent={{ default: 'justifyContentCenter' }}
2626
alignItems={{ default: 'alignItemsCenter' }}
27-
gap={{ default: 'gapLg' }}
27+
gap={{ default: 'gapMd' }}
2828
>
2929
<FlexItem>
3030
<FileDetails fileName={fileName} />

0 commit comments

Comments
 (0)