From 1043503c39b0717ea696a50fd2f379a9605c8740 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 13:36:19 +0200 Subject: [PATCH 1/4] Update dependency @vitest/browser to v4.1.10 [SECURITY] (#39915) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Claire --- package.json | 4 +- yarn.lock | 138 +++++++++++++++++++++++++++++---------------------- 2 files changed, 81 insertions(+), 61 deletions(-) diff --git a/package.json b/package.json index 93549b1ed1..745f3ae721 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,7 @@ "@types/redux-immutable": "^4.0.3", "@types/requestidlecallback": "^0.3.5", "@vitest/browser": "^4.1.0", - "@vitest/browser-playwright": "^4.1.7", + "@vitest/browser-playwright": "^4.1.10", "@vitest/coverage-v8": "^4.1.0", "@vitest/ui": "^4.1.0", "chromatic": "^18.0.0", @@ -183,7 +183,7 @@ "typescript": "~6.0.0", "typescript-eslint": "^8.55.0", "typescript-plugin-css-modules": "^5.2.0", - "vitest": "^4.1.7" + "vitest": "^4.1.10" }, "resolutions": { "kind-of": "^6.0.3" diff --git a/yarn.lock b/yarn.lock index c64be50ca7..8c069adae5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2989,7 +2989,7 @@ __metadata: "@vitejs/plugin-legacy": "npm:^8.0.0" "@vitejs/plugin-react": "npm:^6.0.0" "@vitest/browser": "npm:^4.1.0" - "@vitest/browser-playwright": "npm:^4.1.7" + "@vitest/browser-playwright": "npm:^4.1.10" "@vitest/coverage-v8": "npm:^4.1.0" "@vitest/ui": "npm:^4.1.0" arrow-key-navigation: "npm:^1.2.0" @@ -3083,7 +3083,7 @@ __metadata: vite: "npm:^8.0.0" vite-plugin-manifest-sri: "npm:^0.2.0" vite-plugin-svgr: "npm:^5.0.0" - vitest: "npm:^4.1.7" + vitest: "npm:^4.1.10" wicg-inert: "npm:^3.1.2" peerDependenciesMeta: react: @@ -5407,38 +5407,38 @@ __metadata: languageName: node linkType: hard -"@vitest/browser-playwright@npm:^4.1.7": - version: 4.1.9 - resolution: "@vitest/browser-playwright@npm:4.1.9" +"@vitest/browser-playwright@npm:^4.1.10": + version: 4.1.10 + resolution: "@vitest/browser-playwright@npm:4.1.10" dependencies: - "@vitest/browser": "npm:4.1.9" - "@vitest/mocker": "npm:4.1.9" + "@vitest/browser": "npm:4.1.10" + "@vitest/mocker": "npm:4.1.10" tinyrainbow: "npm:^3.1.0" peerDependencies: playwright: "*" - vitest: 4.1.9 + vitest: 4.1.10 peerDependenciesMeta: playwright: optional: false - checksum: 10c0/4c042c980bb0aa950646d4d1f0f131f44156141d86f54eb96f5f69863ed05720cac7ef1a0901ab71e18929a62c41e5d64a428b2612ea708905bf423ff961dcf4 + checksum: 10c0/161530da4da9c061875c0e80c2c94e93658bf92514f2e5173c04299e17a6021feb209ef8fb5e14e880c8c8b2b9e7fc4f3ec7a346c8c4a77831864597331257fc languageName: node linkType: hard -"@vitest/browser@npm:4.1.9, @vitest/browser@npm:^4.1.0": - version: 4.1.9 - resolution: "@vitest/browser@npm:4.1.9" +"@vitest/browser@npm:4.1.10, @vitest/browser@npm:^4.1.0": + version: 4.1.10 + resolution: "@vitest/browser@npm:4.1.10" dependencies: "@blazediff/core": "npm:1.9.1" - "@vitest/mocker": "npm:4.1.9" - "@vitest/utils": "npm:4.1.9" + "@vitest/mocker": "npm:4.1.10" + "@vitest/utils": "npm:4.1.10" magic-string: "npm:^0.30.21" pngjs: "npm:^7.0.0" sirv: "npm:^3.0.2" tinyrainbow: "npm:^3.1.0" ws: "npm:^8.19.0" peerDependencies: - vitest: 4.1.9 - checksum: 10c0/9ff634e56b0bd5a3727f2eec7666f97a089b92fb596d5b9e4fbe2a2e4fd988aa7a7bd2a7b98d7cf14790717db69db8f72bae6dc007f2fac613b9bb93d8e8edfb + vitest: 4.1.10 + checksum: 10c0/61c86b8c0fcc78bd01de559914525e768dc16d565ee8a40a41d51ef6d99595c3c5e976defe32d090b3dda5f77a980caa11a2072e9c4d279cfb8d55d31c565fc7 languageName: node linkType: hard @@ -5479,25 +5479,25 @@ __metadata: languageName: node linkType: hard -"@vitest/expect@npm:4.1.9": - version: 4.1.9 - resolution: "@vitest/expect@npm:4.1.9" +"@vitest/expect@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/expect@npm:4.1.10" dependencies: "@standard-schema/spec": "npm:^1.1.0" "@types/chai": "npm:^5.2.2" - "@vitest/spy": "npm:4.1.9" - "@vitest/utils": "npm:4.1.9" + "@vitest/spy": "npm:4.1.10" + "@vitest/utils": "npm:4.1.10" chai: "npm:^6.2.2" tinyrainbow: "npm:^3.1.0" - checksum: 10c0/243bacaed2cba5e0ea4ec7465662fcec465a358a0e06381e337fac49426aa67a73b104fbb9d65d8bccadfba8f70e27f57ffb897aacfa140f579a556367357875 + checksum: 10c0/a817ad0d9bd6a039776a7228d54fb8319c17e4af15917407f5566ac61781a8511f591d302519d6999217399915bc3c0290028189fc73f5c38f80cb01b6f19c8d languageName: node linkType: hard -"@vitest/mocker@npm:4.1.9": - version: 4.1.9 - resolution: "@vitest/mocker@npm:4.1.9" +"@vitest/mocker@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/mocker@npm:4.1.10" dependencies: - "@vitest/spy": "npm:4.1.9" + "@vitest/spy": "npm:4.1.10" estree-walker: "npm:^3.0.3" magic-string: "npm:^0.30.21" peerDependencies: @@ -5508,7 +5508,7 @@ __metadata: optional: true vite: optional: true - checksum: 10c0/707353b7435bbfd441cc754e4ee7bc5921b70d07b051c6e414b6bbe4ca369154702b0ddeb603389469fe87ca1983e002eb2d55044582661f54a1945dd27e5c82 + checksum: 10c0/4aa70b0df58681652e2e28093437fb2e8f4d02a6d03f5619abc266ac1c5ae5f43326148061d13ae6e071e0f6cfcf7634659af63644de8ce098a7c98949a3d1ad languageName: node linkType: hard @@ -5521,6 +5521,15 @@ __metadata: languageName: node linkType: hard +"@vitest/pretty-format@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/pretty-format@npm:4.1.10" + dependencies: + tinyrainbow: "npm:^3.1.0" + checksum: 10c0/1a5daba730ffe23f2000bff484b4b2842f3b178d93663cb487b215516b8d3b62caa3e2bb2a3c63307b61a9fe58fb9bfff38559bc0c5e49d8aa403d6803a1d918 + languageName: node + linkType: hard + "@vitest/pretty-format@npm:4.1.9": version: 4.1.9 resolution: "@vitest/pretty-format@npm:4.1.9" @@ -5530,25 +5539,25 @@ __metadata: languageName: node linkType: hard -"@vitest/runner@npm:4.1.9": - version: 4.1.9 - resolution: "@vitest/runner@npm:4.1.9" +"@vitest/runner@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/runner@npm:4.1.10" dependencies: - "@vitest/utils": "npm:4.1.9" + "@vitest/utils": "npm:4.1.10" pathe: "npm:^2.0.3" - checksum: 10c0/d206b4891a64b1f55c346f832b0a7b489108094d8ae34438d3b53e78be7b45b139fa95ffa027c98c357bd532268ee573168de1943235b7eed32a9236ed5978bb + checksum: 10c0/554b72639de9694271b99be8ae273fe12ec793093ec91cce143816cd1187d40b7138a4d9d4de4f456cfca9567de986825bff97e107c05b9eb4abc130e854286d languageName: node linkType: hard -"@vitest/snapshot@npm:4.1.9": - version: 4.1.9 - resolution: "@vitest/snapshot@npm:4.1.9" +"@vitest/snapshot@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/snapshot@npm:4.1.10" dependencies: - "@vitest/pretty-format": "npm:4.1.9" - "@vitest/utils": "npm:4.1.9" + "@vitest/pretty-format": "npm:4.1.10" + "@vitest/utils": "npm:4.1.10" magic-string: "npm:^0.30.21" pathe: "npm:^2.0.3" - checksum: 10c0/c3099df12ad1f9c1e180441856c9eb82f1990f87ff16aafedd6fa19978eaff20bc59220b692a99fcc822daef86eab256ba3dadb49544b7bd625b57c49cd9d995 + checksum: 10c0/e71398725f51af5fd0c07bb4b957d0f987daf9b4c564ac24cb2a4d1afde1a6939f535ac17761a32dcc41b0a1e6d4088af66dc44df89fdebebb92aabed1a92b5f languageName: node linkType: hard @@ -5561,10 +5570,10 @@ __metadata: languageName: node linkType: hard -"@vitest/spy@npm:4.1.9": - version: 4.1.9 - resolution: "@vitest/spy@npm:4.1.9" - checksum: 10c0/e51f328f55b76e8ba66e5e18f183484a8dc0a092685b101112d3e9fb8e989ddca162c98ddf00254476502c25bc05c4ec1e277fd6ad8bfc702464c08f6b5dd115 +"@vitest/spy@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/spy@npm:4.1.10" + checksum: 10c0/e5c08012560af6727fd66741c5cda25560d7c5442103d0c83e4276a9b0dd90b9da6cdf823a461195229a16c6ff87768ce788a68d0fa29dea73ee285618668178 languageName: node linkType: hard @@ -5596,6 +5605,17 @@ __metadata: languageName: node linkType: hard +"@vitest/utils@npm:4.1.10": + version: 4.1.10 + resolution: "@vitest/utils@npm:4.1.10" + dependencies: + "@vitest/pretty-format": "npm:4.1.10" + convert-source-map: "npm:^2.0.0" + tinyrainbow: "npm:^3.1.0" + checksum: 10c0/05b0ecec6997ec22fc08377e57dbd8fa37992e05961f3a7a916d98b1ab56d15c2a87dbd83d392b628242bdc156b1705e7fa60a3bf0c54bdb51158c153e05fc5d + languageName: node + linkType: hard + "@vitest/utils@npm:4.1.9": version: 4.1.9 resolution: "@vitest/utils@npm:4.1.9" @@ -14771,17 +14791,17 @@ __metadata: languageName: node linkType: hard -"vitest@npm:^4.1.7": - version: 4.1.9 - resolution: "vitest@npm:4.1.9" +"vitest@npm:^4.1.10": + version: 4.1.10 + resolution: "vitest@npm:4.1.10" dependencies: - "@vitest/expect": "npm:4.1.9" - "@vitest/mocker": "npm:4.1.9" - "@vitest/pretty-format": "npm:4.1.9" - "@vitest/runner": "npm:4.1.9" - "@vitest/snapshot": "npm:4.1.9" - "@vitest/spy": "npm:4.1.9" - "@vitest/utils": "npm:4.1.9" + "@vitest/expect": "npm:4.1.10" + "@vitest/mocker": "npm:4.1.10" + "@vitest/pretty-format": "npm:4.1.10" + "@vitest/runner": "npm:4.1.10" + "@vitest/snapshot": "npm:4.1.10" + "@vitest/spy": "npm:4.1.10" + "@vitest/utils": "npm:4.1.10" es-module-lexer: "npm:^2.0.0" expect-type: "npm:^1.3.0" magic-string: "npm:^0.30.21" @@ -14799,12 +14819,12 @@ __metadata: "@edge-runtime/vm": "*" "@opentelemetry/api": ^1.9.0 "@types/node": ^20.0.0 || ^22.0.0 || >=24.0.0 - "@vitest/browser-playwright": 4.1.9 - "@vitest/browser-preview": 4.1.9 - "@vitest/browser-webdriverio": 4.1.9 - "@vitest/coverage-istanbul": 4.1.9 - "@vitest/coverage-v8": 4.1.9 - "@vitest/ui": 4.1.9 + "@vitest/browser-playwright": 4.1.10 + "@vitest/browser-preview": 4.1.10 + "@vitest/browser-webdriverio": 4.1.10 + "@vitest/coverage-istanbul": 4.1.10 + "@vitest/coverage-v8": 4.1.10 + "@vitest/ui": 4.1.10 happy-dom: "*" jsdom: "*" vite: ^6.0.0 || ^7.0.0 || ^8.0.0 @@ -14835,7 +14855,7 @@ __metadata: optional: false bin: vitest: ./vitest.mjs - checksum: 10c0/1ac80ef4991be82822a52aea48415f1bc64ddf8fd88ee24c172ec368f1d480fefacbde622c3c951982f7961a1d07313e18deaafc774d29e42ad6f6ffa63334a7 + checksum: 10c0/ff07294a57f9c62f3b503f7cf88a52ee0753ed26389a49cda430387a3898f39d80af47180b0af19e27acab5bd11ae95706bd4b44ce8befc97d3ae49af6ca4fc1 languageName: node linkType: hard From 3d51d8bc288312d5e9f4003326a5874bc900b64e Mon Sep 17 00:00:00 2001 From: Echo Date: Wed, 22 Jul 2026 15:56:27 +0200 Subject: [PATCH 2/4] Redesign buttons (#39898) --- .../components/button/redesign.module.scss | 150 ++++++++++++++++++ .../components/button/redesign.stories.tsx | 100 ++++++++++++ .../mastodon/components/button/redesign.tsx | 133 ++++++++++++++++ .../mastodon/components/circular_progress.tsx | 9 +- 4 files changed, 390 insertions(+), 2 deletions(-) create mode 100644 app/javascript/mastodon/components/button/redesign.module.scss create mode 100644 app/javascript/mastodon/components/button/redesign.stories.tsx create mode 100644 app/javascript/mastodon/components/button/redesign.tsx diff --git a/app/javascript/mastodon/components/button/redesign.module.scss b/app/javascript/mastodon/components/button/redesign.module.scss new file mode 100644 index 0000000000..92a12a79b2 --- /dev/null +++ b/app/javascript/mastodon/components/button/redesign.module.scss @@ -0,0 +1,150 @@ +.base { + --bg: transparent; + --fg: var(--color-text-primary); + + background-color: var(--bg); + border-radius: var(--radius-round); + color: var(--fg); + transition: + background-color 200ms, + color 200ms; + border: 0; + appearance: none; + cursor: pointer; + display: inline-flex; + justify-content: center; + align-items: center; + font-size: var(--fs-sm); + line-height: 1; + box-sizing: border-box; + gap: var(--space-2xs); + + &:focus-visible, + &:focus-within { + outline: 2px solid var(--fg); + } + + &:disabled, + &:hover:disabled { + cursor: auto; + } +} + +// Override default anchor styles +a.base { + &:focus { + border-radius: var(--radius-round); + } + + &:hover { + text-decoration: inherit; + } +} + +.xs { + padding: var(--space-3xs) var(--space-xs); + font-size: var(--fs-2xs); + min-height: 24px; +} + +.sm { + padding: var(--space-xs); + min-height: 32px; +} + +.md { + padding: var(--space-xs) var(--space-sm); + min-height: 40px; +} + +.lg { + padding: var(--space-sm) var(--space-md); + min-height: 48px; +} + +.solid { + --bg: var(--color-bg-inverted); + --bg-hover: color-mix(in srgb, var(--bg) 90%, var(--fg)); + --fg: var(--color-text-inverted); + + background-color: var(--bg); + border-radius: var(--radius-round); + color: var(--fg); + transition: + background-color 200ms, + color 200ms; + + &:hover { + background-color: var(--bg-hover); + } + + &:active { + background-color: color-mix(in srgb, var(--bg-hover) 80%, var(--fg)); + } + + &.accent { + --bg: var(--color-bg-brand-base); + --bg-hover: var(--color-bg-brand-base-hover); + } + + &.tonal { + --bg: var(--color-bg-highlight); + --fg: var(--color-text-primary); + } + + &.destructive { + --bg: var(--color-bg-error-base); + --bg-hover: var(--color-bg-error-base-hover); + } + + &:disabled { + --bg: var(--color-bg-disabled); + --bg-hover: var(--bg); + --fg: var(--color-text-primary); + } +} + +.text { + &.accent { + --fg: var(--color-text-brand); + + &:hover { + --fg: var(--color-text-brand-soft); + } + } + + &.neutral, + &.tonal { + &:hover { + --fg: rgb(from var(--color-text-primary) r g b / 80%); + } + } + + &.destructive { + --fg: var(--color-text-error); + } + + &:disabled, + &:hover:disabled { + --fg: var(--color-text-disabled); + } +} + +.icon { + width: var(--fs-lg); +} + +.iconOnly { + aspect-ratio: 1; +} + +.loading { + color: inherit; + height: 0.8em; + width: 0.8em; + + .iconOnly & { + height: 1em; + width: 1em; + } +} diff --git a/app/javascript/mastodon/components/button/redesign.stories.tsx b/app/javascript/mastodon/components/button/redesign.stories.tsx new file mode 100644 index 0000000000..12aae037b8 --- /dev/null +++ b/app/javascript/mastodon/components/button/redesign.stories.tsx @@ -0,0 +1,100 @@ +import type { Meta, StoryObj } from '@storybook/react-vite'; +import { fn } from 'storybook/test'; + +import ChatIcon from '@/material-icons/400-24px/chat.svg?react'; +import DownloadIcon from '@/material-icons/400-24px/download.svg?react'; +import HeadphonesIcon from '@/material-icons/400-24px/headphones.svg?react'; + +import { Button, IconButton } from './redesign'; + +const iconArgType = { + control: 'select', + options: ['chat', 'download', 'audio'], + mapping: { + chat: ChatIcon, + download: DownloadIcon, + audio: HeadphonesIcon, + }, +} as const; + +const meta = { + title: 'Redesign/Button', + component: Button, + args: { + children: 'Action', + size: 'md', + variant: 'solid', + color: 'neutral', + disabled: false, + loading: false, + as: 'button', + onClick: fn(), + }, + argTypes: { + children: { + control: 'text', + }, + as: { + control: 'inline-radio', + options: ['button', 'a', 'link'], + }, + size: { + control: 'inline-radio', + options: ['xs', 'sm', 'md', 'lg'], + }, + variant: { + control: 'inline-radio', + options: ['solid', 'text'], + }, + color: { + control: 'inline-radio', + options: ['neutral', 'accent', 'tonal', 'destructive'], + }, + leadingIcon: iconArgType, + trailingIcon: iconArgType, + onClick: { + table: { + disable: true, + }, + }, + }, +} satisfies Meta; + +export default meta; + +type Story = StoryObj; + +export const Default: Story = {}; + +export const IconLeading: Story = { + args: { + leadingIcon: ChatIcon, + }, +}; + +export const IconTrailing: Story = { + args: { + trailingIcon: HeadphonesIcon, + }, +}; + +export const IconOnly: Story = { + render(args) { + return ; + }, + args: { + leadingIcon: ChatIcon, + }, +}; + +export const Link: Story = { + render(args) { + if (args.as === 'link') { + return