diff --git a/.changeset/gorgeous-adults-lay.md b/.changeset/gorgeous-adults-lay.md new file mode 100644 index 0000000000..aa61f00516 --- /dev/null +++ b/.changeset/gorgeous-adults-lay.md @@ -0,0 +1,7 @@ +--- +"@khanacademy/wonder-blocks-birthday-picker": patch +"@khanacademy/wonder-blocks-accordion": patch +"@khanacademy/wonder-blocks-banner": patch +--- + +Replace `color` with `semanticColor` tokens diff --git a/__docs__/wonder-blocks-accordion/accordion.stories.tsx b/__docs__/wonder-blocks-accordion/accordion.stories.tsx index d208ed7257..9357ecd9be 100644 --- a/__docs__/wonder-blocks-accordion/accordion.stories.tsx +++ b/__docs__/wonder-blocks-accordion/accordion.stories.tsx @@ -611,6 +611,10 @@ export const BackgroundColorExample: StoryComponentType = { render: () => { const accordionSectionStyle = { backgroundColor: tokens.color.fadedBlue, + // NOTE: This border color uses the opacity token to match the + // background color. By default, the border color is + // `fadedOffBlack16`, which is the HEX value of `offBlack16`. + borderColor: tokens.color.offBlack16, }; const sections = [ diff --git a/packages/wonder-blocks-accordion/src/components/accordion-section-header.tsx b/packages/wonder-blocks-accordion/src/components/accordion-section-header.tsx index 4c07ab9dcf..bed43b6e85 100644 --- a/packages/wonder-blocks-accordion/src/components/accordion-section-header.tsx +++ b/packages/wonder-blocks-accordion/src/components/accordion-section-header.tsx @@ -6,7 +6,7 @@ import Clickable from "@khanacademy/wonder-blocks-clickable"; import {View} from "@khanacademy/wonder-blocks-core"; import {PhosphorIcon} from "@khanacademy/wonder-blocks-icon"; import {HeadingSmall} from "@khanacademy/wonder-blocks-typography"; -import * as tokens from "@khanacademy/wonder-blocks-tokens"; +import {spacing, semanticColor} from "@khanacademy/wonder-blocks-tokens"; import type {StyleType} from "@khanacademy/wonder-blocks-core"; import type {AccordionCornerKindType} from "./accordion"; @@ -125,7 +125,7 @@ const AccordionSectionHeader = React.forwardRef(function AccordionSectionHeader( {collapsible && ( { switch (kind) { case "success": return { - color: color.green, + color: semanticColor.status.success.foreground, icon: successIcon, role: "status", }; case "warning": return { - color: color.gold, + color: semanticColor.status.warning.foreground, icon: warningIcon, role: "alert", ariaLive: "polite", }; case "critical": return { - color: color.red, + color: semanticColor.status.critical.foreground, icon: criticalIcon, role: "alert", }; default: return { - color: color.blue, + color: semanticColor.status.notice.foreground, icon: infoIcon, role: "status", }; @@ -313,7 +313,9 @@ const styles = StyleSheet.create({ // the base color needs to be hard-coded as white for the // intended pastel background color to show up correctly // on dark backgrounds. - backgroundColor: color.white, + // TODO(WB-1865): Verify if we can change this to use semanticColor + // status tokens. + backgroundColor: semanticColor.surface.primary, }, containerInner: { flexDirection: "row", @@ -328,7 +330,7 @@ const styles = StyleSheet.create({ marginInlineStart: spacing.xxxxSmall_2, marginInlineEnd: spacing.xSmall_8, alignSelf: "flex-start", - color: color.offBlack64, + color: semanticColor.icon.primary, }, labelAndButtonsContainer: { flex: 1, @@ -359,7 +361,7 @@ const styles = StyleSheet.create({ justifyContent: "center", }, link: { - fontSize: 14, + fontSize: font.size.small, }, dismiss: { flexShrink: 1, diff --git a/packages/wonder-blocks-birthday-picker/src/components/birthday-picker.tsx b/packages/wonder-blocks-birthday-picker/src/components/birthday-picker.tsx index a53f6f8d0e..aeab09e0fa 100644 --- a/packages/wonder-blocks-birthday-picker/src/components/birthday-picker.tsx +++ b/packages/wonder-blocks-birthday-picker/src/components/birthday-picker.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import {StyleSheet} from "aphrodite"; import {StyleType, View} from "@khanacademy/wonder-blocks-core"; import {Strut} from "@khanacademy/wonder-blocks-layout"; -import {color, spacing} from "@khanacademy/wonder-blocks-tokens"; +import {semanticColor, spacing} from "@khanacademy/wonder-blocks-tokens"; import {Body} from "@khanacademy/wonder-blocks-typography"; import {PhosphorIcon} from "@khanacademy/wonder-blocks-icon"; import {SingleSelect, OptionItem} from "@khanacademy/wonder-blocks-dropdown"; @@ -284,11 +284,17 @@ export default class BirthdayPicker extends React.Component {