Skip to content

Commit 0ed9f34

Browse files
Elevation component changes (#4226)
* feat(side-panel): add elevation changes * feat(minimizable-dialog): add elevation changes * feat(side-modal): add elevation changes * feat(input): add elevation changes * feat(tooltip): add elevation changes * feat(callout): add elevation changes * feat(topbar): add elevation changes * feat(side-panel): update footer and header tokens * feat(chat-composer): update tokens for elevation * feat(chat-log): update tokens for elevation * feat(side-panel): remove background color from header and footer * feat(topbar): remove border bottom * feat(sidebar): update tokens for elevation * feat(menu): update tokens for elevation * feat(user-dialog): update tokens for elevation * feat(combobox): update tokens for elevation * feat(popover): update tokens for elevation * feat(toast): update tokens for elevation * feat(modal): update tokens for elevation * feat(sidebar): remove commented code * feat(paste): add changeset * feat(input): update default background token * feat(input): update increament and decreament background token * feat(minimizable-dialog): remove unused import * feat(side-modal): remove extra tokens * feat(input-box): removed unused import * feat(side-panel): update hover token * feat(elevation): changes from review * feat(sidepanel): update tokens * feat(sidebar): update tokens * feat(tokens): add shadow-elevation-top-20 token * feat(elevation): update componets to use new token * feat(elevation): add new token color-background-strong-elevation * feat(chat-log): update background color * feat(elevation): add changeset * feat(elevation): update typedocs * feat(tokens): add color-background-strong-elevation for dark theme * feat(tokens): update comments * feat(elevation): implement changes from chromatic review * feat(chat-composer): fix disable text color * feat(elevation): update sidepanel box shadow * feat(elevation): fix chat composer placeholder text color * feat(elevation): update combobox item background and tokens * feat(elevation): update background tokens * feat(elevation): update test * feat(elevation): update tokens --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent 0b80d20 commit 0ed9f34

File tree

52 files changed

+191
-180
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+191
-180
lines changed

.changeset/great-singers-stare.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@twilio-paste/design-tokens": minor
3+
"@twilio-paste/core": minor
4+
---
5+
6+
[Design Tokens] Add new box shadow and background color tokens for elevation

.changeset/red-mirrors-play.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
"@twilio-paste/callout": patch
3+
"@twilio-paste/chat-composer": patch
4+
"@twilio-paste/chat-log": patch
5+
"@twilio-paste/combobox": patch
6+
"@twilio-paste/input": patch
7+
"@twilio-paste/input-box": patch
8+
"@twilio-paste/menu": patch
9+
"@twilio-paste/minimizable-dialog": patch
10+
"@twilio-paste/modal": patch
11+
"@twilio-paste/popover": patch
12+
"@twilio-paste/side-modal": patch
13+
"@twilio-paste/side-panel": patch
14+
"@twilio-paste/sidebar": patch
15+
"@twilio-paste/toast": patch
16+
"@twilio-paste/tooltip": patch
17+
"@twilio-paste/topbar": patch
18+
"@twilio-paste/user-dialog": patch
19+
"@twilio-paste/core": patch
20+
---
21+
22+
[Callout, ChatComposer, ChatLog, Combobox, Input, InputBox, Menu, MinimizableDialog, Modal, Popover, SideModal, SidePanel, Sidebar, Toast, Tooltip, Topbar, UserDialog]: Update styles to implement new elevation tokens

packages/paste-core/components/callout/src/Callout.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface CalloutProps extends HTMLPasteProps<"div"> {
6464

6565
const variantStyles: Record<CalloutVariants, BoxStyleProps> = {
6666
success: {
67-
backgroundColor: "colorBackgroundWeak",
67+
backgroundColor: "colorBackgroundBodyElevation",
6868
color: "colorTextSuccess",
6969
borderColor: "colorBorderSuccessWeak",
7070
},
@@ -74,17 +74,17 @@ const variantStyles: Record<CalloutVariants, BoxStyleProps> = {
7474
borderColor: "colorBorderErrorWeak",
7575
},
7676
warning: {
77-
backgroundColor: "colorBackgroundWeak",
77+
backgroundColor: "colorBackgroundBodyElevation",
7878
color: "colorTextWarningStrong",
7979
borderColor: "colorBorderWarningWeak",
8080
},
8181
new: {
82-
backgroundColor: "colorBackgroundWeak",
82+
backgroundColor: "colorBackgroundBodyElevation",
8383
color: "colorTextNew",
8484
borderColor: "colorBorderNewWeak",
8585
},
8686
neutral: {
87-
backgroundColor: "colorBackgroundWeak",
87+
backgroundColor: "colorBackgroundBodyElevation",
8888
color: "colorTextNeutral",
8989
borderColor: "colorBorderNeutralWeak",
9090
},

packages/paste-core/components/chat-composer/src/ChatComposerAttachmentCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,8 @@ const ChatComposerAttachmentCard = React.forwardRef<HTMLDivElement, ChatComposer
8383
ref={ref}
8484
paddingY="space30"
8585
paddingX="space40"
86-
borderStyle="solid"
87-
borderColor="colorBorderWeaker"
8886
borderRadius="borderRadius30"
89-
borderWidth="borderWidth10"
90-
boxShadow="shadowLow"
87+
backgroundColor="colorBackgroundBodyElevation"
9188
position="relative"
9289
display="inline-block"
9390
width="100%"

packages/paste-core/components/chat-composer/src/ChatComposerContainer.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import * as React from "react";
55
import { ChatComposerContext } from "./ChatComposerContext";
66

77
const Styles: Record<string, BoxStyleProps> = {
8-
default: {},
8+
default: {
9+
backgroundColor: "colorBackgroundWeaker",
10+
},
911
contained: {
10-
borderWidth: "borderWidth10",
11-
borderStyle: "solid",
1212
borderRadius: "borderRadius30",
13-
borderColor: "colorBorderWeaker",
14-
boxShadow: "shadowLow",
15-
backgroundColor: "colorBackgroundBody",
13+
boxShadow: "shadowElevation10",
14+
backgroundColor: "colorBackgroundWeaker",
1615
},
1716
};
1817

packages/paste-core/components/chat-composer/src/PlaceholderWrapper.tsx

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,33 @@ import { Box } from "@twilio-paste/box";
33
import * as React from "react";
44

55
import type { ChatComposerProps } from ".";
6+
import { ChatComposerContext } from "./ChatComposerContext";
67

78
export const PlaceholderWrapper: React.FC<
89
React.PropsWithChildren<{
910
placeholder: ChatComposerProps["placeholder"];
1011
element?: BoxProps["element"];
1112
}>
12-
> = ({ placeholder, element }) => (
13-
<Box
14-
position="absolute"
15-
top="space30"
16-
left="space40"
17-
right="space40"
18-
display="flex"
19-
alignItems="center"
20-
color="colorTextWeak"
21-
pointerEvents="none"
22-
userSelect="none"
23-
fontStyle="italic"
24-
element={element}
25-
>
26-
{placeholder}
27-
</Box>
28-
);
13+
> = ({ placeholder, element }) => {
14+
const { isDisabled } = React.useContext(ChatComposerContext);
15+
16+
return (
17+
<Box
18+
position="absolute"
19+
top="space30"
20+
left="space40"
21+
right="space40"
22+
display="flex"
23+
alignItems="center"
24+
color={isDisabled ? "colorTextWeaker" : "colorTextWeak"}
25+
pointerEvents="none"
26+
userSelect="none"
27+
fontStyle="italic"
28+
element={element}
29+
>
30+
{placeholder}
31+
</Box>
32+
);
33+
};
2934

3035
PlaceholderWrapper.displayName = "PlaceholderWrapper";

packages/paste-core/components/chat-log/src/ChatBubble.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ const bubbleVariantStyles: {
2222
[key in MessageVariants]: BoxStyleProps;
2323
} = {
2424
inbound: {
25-
backgroundColor: "colorBackground",
25+
backgroundColor: "colorBackgroundElevation",
2626
alignSelf: "flex-start",
2727
},
2828
outbound: {
29-
backgroundColor: "colorBackgroundInverseStronger",
29+
backgroundColor: "colorBackgroundInverseStrongerElevation",
3030
alignSelf: "flex-end",
3131
color: "colorTextInverse",
3232
},

packages/paste-core/components/chat-log/src/ComposerAttachmentCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ const ComposerAttachmentCard = React.forwardRef<HTMLDivElement, ComposerAttachme
6262
ref={ref}
6363
paddingY="space30"
6464
paddingX="space40"
65-
borderStyle="solid"
66-
borderColor="colorBorderWeaker"
6765
borderRadius="borderRadius30"
68-
borderWidth="borderWidth10"
69-
boxShadow="shadowLow"
66+
backgroundColor="colorBackgroundBodyElevation"
7067
position="relative"
7168
display="inline-block"
7269
width="100%"

packages/paste-core/components/combobox/src/styles/ComboboxListbox.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,9 @@ const ComboboxListbox = React.forwardRef<HTMLUListElement, ComboboxListboxProps>
3838
<Box
3939
{...safelySpreadBoxProps(props)}
4040
as="div"
41-
backgroundColor="colorBackgroundBody"
41+
backgroundColor="colorBackgroundWeaker"
4242
borderRadius="borderRadius20"
43-
borderColor="colorBorderWeak"
44-
borderWidth="borderWidth10"
45-
borderStyle="solid"
46-
boxShadow="shadow"
43+
boxShadow="shadowElevation10"
4744
element={element}
4845
listStyleType="none"
4946
margin="space0"

packages/paste-core/components/combobox/src/styles/ComboboxListboxOption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ const ComboboxListboxOption = React.forwardRef<HTMLLIElement, ComboboxListboxOpt
9999
as="li"
100100
position="relative"
101101
element={`${element}_LIST_ITEM`}
102-
backgroundColor={highlighted ? "colorBackgroundPrimaryWeakest" : "colorBackgroundBody"}
102+
backgroundColor={highlighted ? "colorBackgroundPrimaryWeakest" : "colorBackgroundWeaker"}
103103
color={
104104
highlighted
105105
? "colorTextPrimary"

0 commit comments

Comments
 (0)