Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 43 additions & 12 deletions modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Soon to be...
- [KBD](#kbd)
- [Component Updates](#component-updates)
- [Avatar](#avatar)
- [Buttons](#buttons) - [Delete Button Outline Variant](#delete-button-outline-variant)
- [Buttons](#buttons)
- [Delete Button Outline Variant](#delete-button-outline-variant)
- [Card](#card)
- [Inputs](#inputs)
- [Accessibility: Checked-State Contrast](#accessibility-checked-state-contrast)
Expand Down Expand Up @@ -69,9 +70,10 @@ our team. We'd be very happy to walk you through the process to set you up for s

### Instructions

The easiest way to run our codemod is to use `npx` in your terminal.```sh
npx @workday/canvas-kit-codemod v16 [path]
```
The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
@workday/canvas-kit-codemod v16 [path]

````
Comment on lines +73 to +76

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Fix broken code fence formatting in codemod instructions.

The opening code fence ```sh is concatenated with the preceding text on the same line (e.g., ...in your terminal.```sh npx), which prevents markdown parsers from recognizing it as a fenced code block. The npx command text is also on the same line as the fence opening. This appears in both the first codemod instructions section (lines 73–76) and the second one (lines 450–453).

📝 Proposed fix for lines 73–76
-The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
-@workday/canvas-kit-codemod v16 [path]
-
-````
+The easiest way to run our codemod is to use `npx` in your terminal.
+
+```sh
+npx `@workday/canvas-kit-codemod` v16 [path]
+```

Proposed fix for lines 450–453

-The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
-@workday/canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]
-
-````
+The easiest way to run our codemod is to use `npx` in your terminal.
+
+```sh
+npx `@workday/canvas-kit-codemod` v${canvasKitMajorVersionNumber} [path]
+```

Also applies to: 450-453

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 76-76: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md` around lines 73 - 76,
Fix both codemod instruction sections by placing the opening ```sh fence on its
own line, putting the complete npx command on the following line, and closing
with a standard ``` fence; update both the v16 command section and the
${canvasKitMajorVersionNumber} section.


Be sure to provide specific directories that need to be updated via the `[path]` argument. This
decreases the amount of AST the codemod needs to traverse and reduces the chances of the script
Expand All @@ -87,7 +89,7 @@ finished.
yarn add @workday/canvas-kit-codemod --dev
yarn canvas-kit-codemod v16 [path]
yarn remove @workday/canvas-kit-codemod
```
````

> **Note:** The codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` files. You'll need to
> manually edit other file types (`.json`, `.mdx`, `.md`, etc.). You may need to run your linter
Expand Down Expand Up @@ -328,6 +330,34 @@ If you customize `brand.success.base` in your theme, please verify the following
- Error and caution states no longer display a status background color; only the standard background
is shown.

### Toast

**PR:** [#4053](https://github.com/Workday/canvas-kit/pull/4053)

#### Visual Updates

- Padding is now applied to the `Toast` container itself instead of being distributed across
`Toast.Body` and `Toast.Icon`.
- Gap between the icon, body, and close icon is now `base.size150` (12px).
- Shape uses `system.shape.xl`.
- `Toast.Body` no longer has a gap between text and link.
- `Toast.CloseIcon` is set to have absolute positioning and aligned with the top-right corner (in
LTR).
- `Toast.CloseIcon` was changed to be `extraSmall` tertiary button.

Comment thread
RayRedGoose marked this conversation as resolved.
### Tooltip

**PR:** [#4053](https://github.com/Workday/canvas-kit/pull/4053)

#### Visual Updates

- The default tooltip has been restyled from a dark surface to a light surface.
- A visible border (`system.color.border.default`) is now applied to the container, replacing the
Comment thread
RayRedGoose marked this conversation as resolved.
previous transparent outline.
- Shape is now fully rounded using `system.shape.full`.
- Type level is now `subtext.lg` (previously `subtext.md`).
- Padding and spacing have been adjusted to accommodate the new styling.

## New Utilities

### cornerShapeStencil
Expand Down Expand Up @@ -403,8 +433,8 @@ things you'll want to keep in mind.
dependencies on your own.
- We recommend upgrading dependencies before running the codemod.
- Always review your `package.json` files to make sure your dependency versions look correct.
- The codemod will not handle every breaking change in this upgrade. You will likely need to make some manual
changes to be compatible. Use our Upgrade Guide as a checklist.
- The codemod will not handle every breaking change in this upgrade. You will likely need to make
some manual changes to be compatible. Use our Upgrade Guide as a checklist.
- Codemods are not bulletproof.
- Conduct a thorough PR and QA review of all changes to ensure no regressions were introduced.
- As a safety precaution, we recommend committing the changes from the codemod as a single
Expand All @@ -417,9 +447,10 @@ our team. We'd be very happy to walk you through the process to set you up for s

### Instructions

The easiest way to run our codemod is to use `npx` in your terminal.```sh
npx @workday/canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]
```
The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
@workday/canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]

````

Be sure to provide specific directories that need to be updated via the `[path]` argument. This
decreases the amount of AST the codemod needs to traverse and reduces the chances of the script
Expand All @@ -435,11 +466,11 @@ finished.
yarn add @workday/canvas-kit-codemod --dev
yarn canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]
yarn remove @workday/canvas-kit-codemod
```
````

> **Note**: The codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` files. You'll need to
> manually edit other file types (`.json`, `.mdx`, `.md`, etc.). You may need to run your linter
> after executing the codemod, as its resulting formatting (spacing, quotes, etc.) may not match
> your project conventions.

No codemod transformations available for v16.
No codemod transformations available for v16.
33 changes: 32 additions & 1 deletion modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ Soon to be...
- [KBD](#kbd)
- [Component Updates](#component-updates)
- [Avatar](#avatar)
- [Buttons](#buttons) - [Delete Button Outline Variant](#delete-button-outline-variant)
- [Buttons](#buttons)
- [Delete Button Outline Variant](#delete-button-outline-variant)
- [Card](#card)
- [Inputs](#inputs)
- [Accessibility: Checked-State Contrast](#accessibility-checked-state-contrast)
Expand Down Expand Up @@ -334,6 +335,36 @@ If you customize `brand.success.base` in your theme, please verify the following
- Error and caution states no longer display a status background color; only the standard background
is shown.

### Toast

**PR:** [#4053](https://github.com/Workday/canvas-kit/pull/4053)

#### Visual Updates

- Padding is now applied to the `Toast` container itself instead of being distributed across
`Toast.Body` and `Toast.Icon`.
- Gap between the icon, body, and close icon is now `base.size150` (12px).
- Shape uses `system.shape.xl`.
- `Toast.Body` no longer has a gap between text and link.
- `Toast.CloseIcon` is set to have absolute positioning and aligned with the top-right corner (in
LTR).
- `Toast.CloseIcon` was changed to be `extraSmall` tertiary button.

Comment thread
RayRedGoose marked this conversation as resolved.
### Tooltip
Comment thread
RayRedGoose marked this conversation as resolved.

**PR:** [#4053](https://github.com/Workday/canvas-kit/pull/4053)

#### Visual Updates

- The default tooltip has been restyled from a dark surface to a light surface.
- A visible border (`system.color.border.default`) is now applied to the container, replacing the
Comment thread
RayRedGoose marked this conversation as resolved.
previous transparent outline.
- Tooltip boundaries remain visible in Windows High Contrast mode: when High Contrast is detected,
Tooltip uses a solid outline (`outline: solid 1px CanvasText`) to ensure clear visibility.
- Shape is now fully rounded using `system.shape.full`.
- Type level is now `subtext.lg` (previously `subtext.md`).
- Padding and spacing have been adjusted to accommodate the new styling.

## New Utilities

### cornerShapeStencil
Expand Down
8 changes: 8 additions & 0 deletions modules/labs-react/kbd/stories/KBD.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {KBD} from '@workday/canvas-kit-labs-react/kbd';

import KBDStoriesMeta from './KBD.stories';
import {Basic} from './examples/Basic';
import {InTooltip} from './examples/InTooltip';
import {Items} from './examples/Items';
import {RTL} from './examples/RTL';
import {Size} from './examples/Size';
Expand Down Expand Up @@ -71,6 +72,13 @@ standard style or `plain` for a more minimal appearance. The `variant` is shared

<ExampleCodeBlock code={Variant} />

### In Tooltip

`KBD` can be used inside a `Tooltip` to communicate the keyboard shortcut associated with an
interactive control. Pair it with descriptive text so the shortcut is easy to understand.

<ExampleCodeBlock code={InTooltip} />

## Accessibility

`KBD` is **presentational and semantic text**. It renders a `kbd` element so assistive technology
Expand Down
5 changes: 5 additions & 0 deletions modules/labs-react/kbd/stories/KBD.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Meta} from '@storybook/react';

import mdxDoc from './KBD.mdx';
import {Basic as BasicExample} from './examples/Basic';
import {InTooltip as InTooltipExample} from './examples/InTooltip';
import {Items as ItemsExample} from './examples/Items';
import {RTL as RTLExample} from './examples/RTL';
import {Size as SizeExample} from './examples/Size';
Expand Down Expand Up @@ -36,3 +37,7 @@ export const Variant = {
export const Items = {
render: ItemsExample,
};

export const InTooltip = {
render: InTooltipExample,
};
38 changes: 38 additions & 0 deletions modules/labs-react/kbd/stories/examples/InTooltip.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {KBD} from '@workday/canvas-kit-labs-react/kbd';
import {SecondaryButton} from '@workday/canvas-kit-react/button';
import {Subtext} from '@workday/canvas-kit-react/text';
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
import {createStyles} from '@workday/canvas-kit-styling';
import {copyIcon} from '@workday/canvas-system-icons-web';
import {system} from '@workday/canvas-tokens-web';

const flexContainer = createStyles({
display: 'flex',
alignItems: 'center',
gap: system.gap.xs,
p: {
margin: 0,
},
});

export const InTooltip = () => {
return (
<Tooltip
title={
<div className={flexContainer}>
<Subtext size="large">Copy to clipboard</Subtext>
<KBD>
<KBD.Item>
<KBD variant="plain">
<KBD.Item aria-label="Command">⌘</KBD.Item>
<KBD.Item>C</KBD.Item>
</KBD>
</KBD.Item>
</KBD>
</div>
}
>
<SecondaryButton icon={copyIcon} aria-keyshortcuts="Command+C" />
</Tooltip>
);
};
1 change: 0 additions & 1 deletion modules/react/checkbox/lib/CheckboxContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const checkboxContainerStencil = createStencil({
modifiers: {
disabled: {
true: ({labelPart}) => ({
opacity: system.opacity.disabled,
[labelPart]: {
cursor: 'default',
},
Expand Down
14 changes: 11 additions & 3 deletions modules/react/toast/lib/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {ExtractProps, createContainer} from '@workday/canvas-kit-react/common';
import {mergeStyles} from '@workday/canvas-kit-react/layout';
import {Popup} from '@workday/canvas-kit-react/popup';
import {createStencil, px2rem} from '@workday/canvas-kit-styling';
import {system} from '@workday/canvas-tokens-web';
import {base, system} from '@workday/canvas-tokens-web';

import {ToastBody} from './ToastBody';
import {ToastCloseIcon} from './ToastCloseIcon';
Expand Down Expand Up @@ -52,9 +52,17 @@ const toastStencil = createStencil({
display: 'flex',
flexDirection: 'row',
width: px2rem(360),
padding: 0,
gap: system.legacy.gap.xs,
paddingBlock: system.legacy.padding.sm,
paddingInline: `${system.legacy.padding.md} ${system.legacy.padding.xl}`,
gap: base.legacy.size150,
borderRadius: system.legacy.shape.xl,
border: `${px2rem(1)} solid ${system.color.border.default}`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to same comment about forced color fall-back on TooltipContainer.tsx

backgroundColor: system.legacy.color.surface.default,
boxShadow: system.depth[3],

'@media (forced-colors: active)': {
outline: `${px2rem(1)} solid CanvasText`,
},
},
});

Expand Down
4 changes: 1 addition & 3 deletions modules/react/toast/lib/ToastBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {ExtractProps, createComponent} from '@workday/canvas-kit-react/common';
import {Flex, mergeStyles} from '@workday/canvas-kit-react/layout';
import {Popup} from '@workday/canvas-kit-react/popup';
import {createStencil} from '@workday/canvas-kit-styling';
import {system} from '@workday/canvas-tokens-web';

export interface ToastBodyProps extends ExtractProps<typeof Popup.Body> {}

Expand All @@ -11,9 +10,8 @@ export const toastBodyStencil = createStencil({
alignItems: 'flex-start',
flexDirection: 'column',
justifyContent: 'center',
paddingBlock: system.legacy.padding.md,
flexGrow: 1,
gap: system.legacy.gap.xs,
gap: 0,
},
});

Expand Down
8 changes: 5 additions & 3 deletions modules/react/toast/lib/ToastCloseIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import {ExtractProps, createComponent} from '@workday/canvas-kit-react/common';
import {mergeStyles} from '@workday/canvas-kit-react/layout';
import {Popup} from '@workday/canvas-kit-react/popup';
import {createStencil} from '@workday/canvas-kit-styling';
import {createStencil, px2rem} from '@workday/canvas-kit-styling';

export interface ToastCloseIconProps extends ExtractProps<typeof Popup.CloseIcon, never> {}

export const toastCloseIconStencil = createStencil({
base: {
position: 'relative',
position: 'absolute',
insetBlockStart: px2rem(2),
insetInlineEnd: px2rem(2),
},
});

Expand All @@ -18,7 +20,7 @@ export const ToastCloseIcon = createComponent('button')({
<Popup.CloseIcon
as={Element}
ref={ref}
size="small"
size="extraSmall"
{...mergeStyles(elemProps, toastCloseIconStencil())}
/>
);
Expand Down
12 changes: 9 additions & 3 deletions modules/react/toast/lib/ToastIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import {createComponent} from '@workday/canvas-kit-react/common';
import {SystemIcon, SystemIconProps} from '@workday/canvas-kit-react/icon';
import {createStencil, handleCsProp} from '@workday/canvas-kit-styling';
import {base, system} from '@workday/canvas-tokens-web';
import {component} from '@workday/canvas-tokens-web';

export interface ToastIconProps extends Omit<SystemIconProps, 'colorHover'> {}

export const toastIconStencil = createStencil({
base: {
alignSelf: 'start',
margin: `${system.legacy.gap.md} ${base.legacy.size150}`,
},
});

export const ToastIcon = createComponent('div')({
displayName: 'Toast.Icon',
Component: (elemProps: ToastIconProps, ref, Element) => {
return <SystemIcon ref={ref} as={Element} {...handleCsProp(elemProps, toastIconStencil())} />;
return (
<SystemIcon
ref={ref}
as={Element}
size={component.legacy.systemIcon.size.md}
{...handleCsProp(elemProps, toastIconStencil())}
/>
);
},
});
2 changes: 1 addition & 1 deletion modules/react/toast/stories/examples/Basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {system} from '@workday/canvas-tokens-web';
export const Basic = () => {
return (
<Toast>
<Toast.Icon icon={checkIcon} color={system.color.fg.success.default} />
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
<Toast.Body>
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
</Toast.Body>
Expand Down
2 changes: 1 addition & 1 deletion modules/react/toast/stories/examples/RTL.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const RTL = () => {
return (
<CanvasProvider dir="rtl">
<Toast>
<Toast.Icon icon={checkIcon} color={system.color.fg.success.default} />
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
<Toast.Body>
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
</Toast.Body>
Expand Down
2 changes: 1 addition & 1 deletion modules/react/toast/stories/examples/ToastAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {system} from '@workday/canvas-tokens-web';

export const ToastAlert = () => (
<Toast mode="alert">
<Toast.Icon icon={exclamationCircleIcon} color={system.color.fg.warning.default} />
<Toast.Icon icon={exclamationCircleIcon} color={system.color.brand.fg.caution.default} />
<Toast.Body>
<Toast.Message>There was an error with your workbook.</Toast.Message>
</Toast.Body>
Expand Down
2 changes: 1 addition & 1 deletion modules/react/toast/stories/examples/ToastDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {system} from '@workday/canvas-tokens-web';

export const ToastDialog = () => (
<Toast mode="dialog" aria-label="notification">
<Toast.Icon icon={checkIcon} color={system.color.fg.success.default} />
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
<Toast.Body>
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
<Toast.Link href="#hreflink">Custom Link</Toast.Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const WithActionLinkAndCloseIcon = () => {

return (
<Toast mode="dialog" aria-label="notification">
<Toast.Icon icon={checkIcon} color={system.color.fg.success.default} />
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
<Toast.Body>
<Toast.Message>Your workbook was successfully</Toast.Message>
<Toast.Link href="#hyperlink">Custom Link</Toast.Link>
Expand Down
2 changes: 1 addition & 1 deletion modules/react/toast/stories/examples/WithPopper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const WithPopper = () => {
<SecondaryButton onClick={handleOpen}>Show Toast</SecondaryButton>
<Popper placement="bottom-end" open={open} anchorElement={containerRef}>
<Toast mode="dialog" aria-label="notification">
<Toast.Icon icon={checkIcon} color={system.color.fg.success.default} />
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
<Toast.Body>
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
</Toast.Body>
Expand Down
Loading