Skip to content

Commit dbd869a

Browse files
authored
feat(theme): update components and themes (#4261)
* feat(theming): updated component tokens ready for upcoming theme * feat(docs): added the Elevations url * fix(docs): ci issues * fix(docs): tests and typedocs
1 parent 0ed9f34 commit dbd869a

File tree

16 files changed

+54
-16
lines changed

16 files changed

+54
-16
lines changed

.changeset/brown-zebras-try.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@twilio-paste/button": patch
3+
"@twilio-paste/card": patch
4+
"@twilio-paste/input-box": patch
5+
"@twilio-paste/table": patch
6+
"@twilio-paste/core": patch
7+
---
8+
9+
[Button, Card, InputBox, Table] updated design tokens used for background color in preparation for theme changes

.changeset/neat-dancers-shake.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] added new background token, colorBackgroundWeakest and updated dark mode user shadow token in dark themes

packages/paste-core/components/button/__tests__/button.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ describe("Button", () => {
371371

372372
expect(button).not.toHaveStyleRule("text-align", "left");
373373
expect(button).toHaveStyleRule("color", "colorText");
374-
expect(button).toHaveStyleRule("background-color", "colorBackgroundBody");
374+
expect(button).toHaveStyleRule("background-color", "colorBackgroundWeakest");
375375
expect(button).toHaveStyleRule("box-shadow", "shadowBorderWeak");
376376

377377
expect(getByText("Secondary")).toHaveStyleRule("justify-content", "center");
@@ -430,7 +430,7 @@ describe("Button", () => {
430430
const button = getByTestId("destructive_secondary-styles");
431431
expect(button).not.toHaveStyleRule("text-align", "left");
432432
expect(button).toHaveStyleRule("color", "colorTextDestructive");
433-
expect(button).toHaveStyleRule("background-color", "colorBackgroundBody");
433+
expect(button).toHaveStyleRule("background-color", "colorBackgroundWeakest");
434434
expect(button).toHaveStyleRule("box-shadow", "shadowBorderWeak");
435435

436436
expect(getByText("Destructive secondary")).toHaveStyleRule("justify-content", "center");

packages/paste-core/components/button/src/DestructiveSecondaryButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import type { DirectButtonProps } from "./types";
1212
*/
1313
const defaultStyles: BoxStyleProps = merge(BaseStyles.default, {
1414
color: "colorTextDestructive",
15-
backgroundColor: "colorBackgroundBody",
15+
backgroundColor: "colorBackgroundWeakest",
1616
boxShadow: "shadowBorderWeak",
1717
_hover: {
1818
color: "colorTextDestructive",
19-
backgroundColor: "colorBackgroundBody",
19+
backgroundColor: "colorBackgroundWeakest",
2020
boxShadow: "shadowBorderDestructive",
2121
},
2222
_focus: {

packages/paste-core/components/button/src/PrimaryButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const defaultStyles: BoxStyleProps = merge(BaseStyles.default, {
1616
boxShadow: "shadowBorderPrimary",
1717
_hover: {
1818
color: "colorTextPrimary",
19-
backgroundColor: "colorBackgroundBody",
19+
backgroundColor: "colorBackgroundWeakest",
2020
boxShadow: "shadowBorderPrimary",
2121
},
2222
_focus: {

packages/paste-core/components/button/src/SecondaryButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import type { DirectButtonProps } from "./types";
1212
*/
1313
const defaultStyles: BoxStyleProps = merge(BaseStyles.default, {
1414
color: "colorText",
15-
backgroundColor: "colorBackgroundBody",
15+
backgroundColor: "colorBackgroundWeakest",
1616
boxShadow: "shadowBorderWeak",
1717
_hover: {
1818
color: "colorTextPrimary",
19-
backgroundColor: "colorBackgroundBody",
19+
backgroundColor: "colorBackgroundWeakest",
2020
boxShadow: "shadowBorderPrimary",
2121
},
2222
_focus: {

packages/paste-core/components/card/src/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const Card = React.forwardRef<HTMLElement, CardProps>(
4545
paddingLeft={paddingLeft}
4646
paddingRight={paddingRight}
4747
paddingTop={paddingTop}
48-
backgroundColor="colorBackgroundBody"
48+
backgroundColor="colorBackgroundWeakest"
4949
>
5050
{children}
5151
</Box>

packages/paste-core/components/input-box/src/FauxInput/DefaultFauxInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { FauxInputProps } from "../types";
66

77
const DefaultFauxInput = React.forwardRef<HTMLDivElement, React.PropsWithChildren<FauxInputProps>>(
88
({ disabled, element, hasError, readOnly, children, type, variant }, ref) => {
9-
let backgroundColor = "colorBackgroundBody" as BackgroundColor;
9+
let backgroundColor = "colorBackgroundWeakest" as BackgroundColor;
1010
let boxShadow = "shadowBorder" as BoxShadow;
1111
let boxShadowHover = "shadowBorderPrimary" as BoxShadow;
1212
let boxShadowActive = "shadowBorderPrimaryStronger" as BoxShadow;

packages/paste-core/components/table/src/TBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const bodyCellStyles: BoxStyleProps = {
1111

1212
const StyledTBody = styled.tbody<TBodyProps>(
1313
css({
14-
backgroundColor: "colorBackgroundBody",
14+
backgroundColor: "colorBackgroundWeakest",
1515
"& > tr:last-of-type > td": bodyCellStyles,
1616
"& > tr:last-of-type > th": bodyCellStyles,
1717
}),

packages/paste-core/primitives/box/type-docs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@
727727
"description": "Responsive prop for the CSS `background-attachment` property"
728728
},
729729
"backgroundColor": {
730-
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyElevation\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | ... 65 more ... | { ...; }",
730+
"type": "\"inherit\" | \"none\" | \"colorBackground\" | \"colorBackgroundAvailable\" | \"colorBackgroundBody\" | \"colorBackgroundBodyElevation\" | \"colorBackgroundBodyInverse\" | \"colorBackgroundBrand\" | ... 66 more ... | { ...; }",
731731
"defaultValue": null,
732732
"required": false,
733733
"externalProp": false,

0 commit comments

Comments
 (0)