-
Notifications
You must be signed in to change notification settings - Fork 258
feat: Update Toast and Tooltip styles to match Sana #4053
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RayRedGoose
wants to merge
8
commits into
Workday:prerelease/major
Choose a base branch
from
RayRedGoose:issue3989_toast-tooltip
base: prerelease/major
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+172
−51
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
b2803d3
feat: Update toast styles
RayRedGoose c9c31fe
feat: Update tooltip
RayRedGoose e2df3a9
Merge branch 'prerelease/major' into issue3989_toast-tooltip
RayRedGoose 5d3c75c
fix: Fix icon color to be brandable
RayRedGoose 7c051ec
Merge branch 'issue3989_toast-tooltip' of https://github.com/RayRedGo…
RayRedGoose 658cc0e
Merge branch 'prerelease/major' of https://github.com/Workday/canvas-…
RayRedGoose c7b9df5
fix: Fixes
RayRedGoose c3f22a3
fix: Add high-contrast
RayRedGoose File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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> | ||
| ); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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'; | ||
|
|
@@ -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}`, | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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`, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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())} | ||
| /> | ||
| ); | ||
| }, | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
```shis 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. Thenpxcommand 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
Proposed fix for lines 450–453
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