diff --git a/apps/storybook/assets/images/defaultAvatar.svg b/apps/storybook/assets/images/defaultAvatar.svg index 6463f308..61a6f90f 100644 --- a/apps/storybook/assets/images/defaultAvatar.svg +++ b/apps/storybook/assets/images/defaultAvatar.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/packages/syntax-core/src/Avatar/Avatar.module.css b/packages/syntax-core/src/Avatar/Avatar.module.css index 0f46ad2b..b407b245 100644 --- a/packages/syntax-core/src/Avatar/Avatar.module.css +++ b/packages/syntax-core/src/Avatar/Avatar.module.css @@ -15,7 +15,12 @@ } .avatarImageOutlineCambio { - border: 2px solid var(--color-cambio-gray-100); + border: 1px solid var(--color-cambio-gray-100); +} + +.xs { + width: 24px; + height: 24px; } .sm { @@ -38,6 +43,11 @@ height: 129px; } +.xsCambio { + width: 24px; + height: 24px; +} + .smCambio { width: 32px; height: 32px; diff --git a/packages/syntax-core/src/Avatar/Avatar.stories.tsx b/packages/syntax-core/src/Avatar/Avatar.stories.tsx index b13c3666..cbdd1857 100644 --- a/packages/syntax-core/src/Avatar/Avatar.stories.tsx +++ b/packages/syntax-core/src/Avatar/Avatar.stories.tsx @@ -13,7 +13,7 @@ export default { }, argTypes: { size: { - options: ["sm", "md", "lg", "xl"], + options: ["xs", "sm", "md", "lg", "xl"], control: { type: "radio" }, }, }, diff --git a/packages/syntax-core/src/Avatar/Avatar.tsx b/packages/syntax-core/src/Avatar/Avatar.tsx index 63fc36af..6f61fe56 100644 --- a/packages/syntax-core/src/Avatar/Avatar.tsx +++ b/packages/syntax-core/src/Avatar/Avatar.tsx @@ -6,6 +6,7 @@ import { useAvatarGroup } from "../AvatarGroup/AvatarGroup"; import { useTheme } from "../ThemeProvider/ThemeProvider"; const sizeToIconStyles = { + xs: { bottom: 6, marginInlineEnd: 2, height: 4, width: 4 }, sm: { bottom: 6, marginInlineEnd: 2, height: 4, width: 4 }, md: { bottom: 6, marginInlineEnd: 2, height: 8, width: 8 }, lg: { bottom: 6, marginInlineEnd: 6, height: 12, width: 12 }, @@ -13,6 +14,7 @@ const sizeToIconStyles = { } as const; const sizeToMarginClassic = { + xs: -16, sm: -16, md: -28, lg: -48, @@ -20,8 +22,9 @@ const sizeToMarginClassic = { } as const; const sizeToMarginCambio = { - sm: -12, - md: -20, + xs: -10, + sm: -14, + md: -22, lg: -28, xl: -28, } as const; @@ -36,7 +39,7 @@ function AvatarInternal({ accessibilityLabel: string; icon?: React.ReactElement; outline?: boolean; - size?: "sm" | "md" | "lg" | "xl"; + size?: "xs" | "sm" | "md" | "lg" | "xl"; src: string; }): ReactElement { const { themeName } = useTheme(); @@ -110,6 +113,7 @@ const Avatar = ({ * * `xl`: 128px * * Cambio: + * * `xs`: 24px (Cambio only) * * `sm`: 32px * * `md`: 48px * * `lg`: 64px @@ -117,7 +121,7 @@ const Avatar = ({ * * @defaultValue `md` */ - size?: "sm" | "md" | "lg" | "xl"; + size?: "xs" | "sm" | "md" | "lg" | "xl"; /** * URL of the image to display as the avatar. */ diff --git a/packages/syntax-core/src/AvatarGroup/AvatarGroup.stories.tsx b/packages/syntax-core/src/AvatarGroup/AvatarGroup.stories.tsx index 43bd715a..71e7e5f8 100644 --- a/packages/syntax-core/src/AvatarGroup/AvatarGroup.stories.tsx +++ b/packages/syntax-core/src/AvatarGroup/AvatarGroup.stories.tsx @@ -18,7 +18,7 @@ export default { }, argTypes: { size: { - options: ["sm", "md", "lg", "xl"], + options: ["xs", "sm", "md", "lg", "xl"], control: { type: "radio" }, }, orientation: { diff --git a/packages/syntax-core/src/AvatarGroup/AvatarGroup.tsx b/packages/syntax-core/src/AvatarGroup/AvatarGroup.tsx index 1f56955e..44a57f74 100644 --- a/packages/syntax-core/src/AvatarGroup/AvatarGroup.tsx +++ b/packages/syntax-core/src/AvatarGroup/AvatarGroup.tsx @@ -8,6 +8,7 @@ import Box from "../Box/Box"; import { useTheme } from "../ThemeProvider/ThemeProvider"; type Size = + | "xs" | "sm" | "md" | "lg" @@ -56,6 +57,7 @@ export default function AvatarGroup({ * * `xl`: 128px * * Cambio: + * * `xs`: 24px (Cambio only) * * `sm`: 32px * * `md`: 48px * * `lg`: 64px diff --git a/packages/syntax-core/src/Button/Button.tsx b/packages/syntax-core/src/Button/Button.tsx index b1dfea4b..3f0ceb47 100644 --- a/packages/syntax-core/src/Button/Button.tsx +++ b/packages/syntax-core/src/Button/Button.tsx @@ -99,12 +99,10 @@ type ButtonProps = { fullWidth?: boolean; /** * The icon to be displayed at the start of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round) - * Note: startIcon is not supported in the Cambio theme */ startIcon?: React.ComponentType<{ className?: string }>; /** * The icon to be displayed at the end of the button. Please use a [Rounded Material Icon](https://material.io/resources/icons/?style=round) - * Note: endIcon is not supported in the Cambio theme */ endIcon?: React.ComponentType<{ className?: string }>; /** @@ -189,7 +187,7 @@ const Button = forwardRef( }, )} > - {!loading && StartIcon && themeName === "classic" && ( + {!loading && StartIcon && ( )} {((loading && loadingText) || (!loading && text)) && ( @@ -209,7 +207,7 @@ const Button = forwardRef( )} - {!loading && EndIcon && themeName === "classic" && ( + {!loading && EndIcon && ( )} {loading && ( diff --git a/packages/syntax-core/src/Checkbox/Checkbox.tsx b/packages/syntax-core/src/Checkbox/Checkbox.tsx index 33d047c7..48e06029 100644 --- a/packages/syntax-core/src/Checkbox/Checkbox.tsx +++ b/packages/syntax-core/src/Checkbox/Checkbox.tsx @@ -119,14 +119,22 @@ const Checkbox = ({ )} >
- {checked && ( + {checked && themeName === "classic" && ( )} + {checked && themeName === "cambio" && ( + + )}
( themeName === "classic" ? typographySize[transformedSize] : 100 } color={color} + weight={themeName === "classic" ? "regular" : "medium"} > {text} diff --git a/packages/syntax-core/src/Dialog/Dialog.tsx b/packages/syntax-core/src/Dialog/Dialog.tsx index 8d22609a..cfaff2db 100644 --- a/packages/syntax-core/src/Dialog/Dialog.tsx +++ b/packages/syntax-core/src/Dialog/Dialog.tsx @@ -15,6 +15,7 @@ import styles from "./Dialog.module.css"; import { Dialog as ReactAriaDialog } from "react-aria-components"; import classNames from "classnames"; import type Box from "../Box/Box"; +import { useTheme } from "../ThemeProvider/ThemeProvider"; type DialogSize = "sm" | "md" | "lg"; type DialogRounding = "lg" | "xl"; @@ -71,6 +72,7 @@ const Dialog = forwardRef(function Dialog( } = props; const { padding } = useContext(DialogContext); + const { themeName } = useTheme(); return ( (function Dialog( colorStyles.whiteBackgroundColor, paddingStyles[`paddingX${padding ?? sizeToPadding[size]}`], paddingStyles[`paddingY${padding ?? sizeToPadding[size]}`], - roundingStyles[`rounding${sizeToRounding[size]}`], + roundingStyles[ + themeName === "classic" + ? (`rounding${sizeToRounding[size]}` as const) + : "roundingmdCambio" + ], elevationStyles.elevation400BoxShadow, layoutStyles.fullMaxHeight, layoutStyles.visibilityVisible, diff --git a/packages/syntax-core/src/Modal/Modal.tsx b/packages/syntax-core/src/Modal/Modal.tsx index 82698b97..ce30db69 100644 --- a/packages/syntax-core/src/Modal/Modal.tsx +++ b/packages/syntax-core/src/Modal/Modal.tsx @@ -136,7 +136,11 @@ export default function Modal({ /** * The size of the card * - * * `sm`: 400px + * Classic: + * * `sm`: 400px (Classic only) + * * `lg`: 600px + * + * Cambio: * * `lg`: 600px * * @@ -177,8 +181,10 @@ export default function Modal({ rounding={themeName === "classic" ? "xl" : "md"} display="flex" direction="column" + marginStart={4} + marginEnd={4} minWidth={240} - maxWidth={sizeWidth[size]} + maxWidth={sizeWidth[themeName === "classic" ? size : "lg"]} width="100%" dangerouslySetInlineStyle={{ __style: { overflow: "hidden" } }} > @@ -218,13 +224,13 @@ export default function Modal({ {image && {image}} {header} @@ -237,6 +243,7 @@ export default function Modal({ display="flex" direction="column" gap={3} + marginTop={themeName === "classic" ? 0 : 2} smDirection="row" smJustifyContent="end" lgDirection="row" diff --git a/packages/syntax-core/src/RadioButton/RadioButton.tsx b/packages/syntax-core/src/RadioButton/RadioButton.tsx index 1d9ceec3..3b4c619c 100644 --- a/packages/syntax-core/src/RadioButton/RadioButton.tsx +++ b/packages/syntax-core/src/RadioButton/RadioButton.tsx @@ -123,7 +123,7 @@ const RadioButton = ({
{themeName === "cambio" && checked && ( {label && ( -
{(helperText || errorText) && ( - + ( }} position={themeName === "cambio" ? "relative" : undefined} > -