Skip to content

feat(tokens): Dropdown, Modal and Toast on the design tokens - #256

Merged
aktasmehmet merged 11 commits into
mainfrom
feat/design-tokens-batch-9
Nov 30, 2026
Merged

aktasmehmet merged 11 commits into
mainfrom
feat/design-tokens-batch-9

Conversation

@aktasmehmet

@aktasmehmet aktasmehmet commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Batch 9 of the design token migration: Dropdown, Modal and Toast, each migrated in place with its old styles kept as a compare baseline. It also brings in #250 (textOnly variant support for Dropdown) and moves it onto the tokens.

What this PR does

  • Token migration: the three components take their colors, spacing, radius, elevation and text styles from the tokens and work in dark mode.
  • Compare screens: Token Compare → Dropdown, Modal and Toast (Today · Legacy Light · Legacy Dark · Basic Light). The overlays are drawn open and in place, without the portal.
  • Figma: new Dropdown, Modal and Toast pages in the "Motif UI Components" library, with their notes in docs/figma/*.md.
  • Lint: the stricter CSS rules cover Dropdown, Modal and Toast.

Dropdown

  • variant takes VariantV2. The default is primary for shape="solid" and neutral for shape="textOnly"; a textOnly Dropdown with a variant takes that variant's text color (fix(Dropdown): variant support for textOnly shape #250).
  • The button is Button's box and colors: heights 24 / 32 / 40 / 48, text-{size} stronger, sizing/icon/{size}, Button's solid and textonly fills, its disabled look and its focus ring. It keeps its own markup.
  • The menu: surface-raised, border-default, radius-md, elevation-2; the items are Select's options (text-stronger, hover neutral-soft, a border-soft divider), the header text-softer strong, disabled text-disabled. The callout caret keeps its geometry.

Modal

  • AlertModal's surface: surface-raised, radius-lg, elevation-4, backdrop color/backdrop, z-layer("modal").
  • Header heading-h4 text-strong, subtitle body-lg text-soft, content text-default; border-soft dividers; widths sizing-320 · 480 · 720 · 960.
  • The hard-coded white, black and #f1f1f1 are gone; the scrollbar uses scrollbar-color with the border tokens.

Toast

  • ToastVariant is VariantV2, so useToast() returns neutral, primary, secondary, accent, info, success, warning and danger.
  • The soft variant fill sits on surface-raised (it is translucent and the toast floats over the page), elevation-3, radius radius-md; title label-xl stronger, content body-md; padding 10 / 16.
  • The icon and the close button are 24px and sit on the title's line.
  • Fix: the close IconButton no longer shrinks to 15px (flex-shrink: 0; IconButton clips its icon).

💥 BREAKING CHANGE: Dropdown and Toast secondary is the theme's second color, no longer the light gray. Use neutral for the gray look (variant="neutral", toast.neutral()).

Visible changes (in the change notes)

  • Dropdown: Button's heights and weight, textOnly takes the variant's color, the menu items look like Select's options.
  • Modal: radius 4 → 8px, backdrop 50% → 64%, works in dark mode, lighter subtitle.
  • Toast: icon 32 → 24px on the title line, a shadow, horizontal padding 20 → 16px, title and content lines 24 → 28 and 22 → 24px.

Type of Change

  • 🆕 New Component
  • ✨ Feature / Enhancement
  • 🐛 Bug Fix
  • 💥 Breaking Change
  • 📦 Build / Dependency / Docs Update
  • 🧹 Code Refactoring

Screenshots / Preview

Token compare screens (Today · Legacy Light · Legacy Dark · Basic Light):

Dropdown

dropdown

Modal

modal

Toast

toast

Checklist

  • Self-reviewed, no leftover logs or debug code
  • Uses design tokens — no hardcoded style values
  • Accessible (keyboard nav, ARIA, contrast)
  • Tests added/updated and passing
  • Storybook story added/updated

How to Test

  1. npm run storybook: Token Compare → Dropdown, Modal and Toast.
  2. Dropdown "Sizes, beside a Button": the Dropdown and the Button have the same height at every size.
  3. Toast with a close button: the close icon is 24px.
  4. npm test: all suites pass.
  5. npm run lint, npm run check:type, npm run check:scss, npm run check:mtf-tokens: no errors.

Closes #EDKUI-1252

atakanbayrak and others added 6 commits November 24, 2026 17:00
Dropdown's button takes Button's box and colors and its menu items Select's options; variant is VariantV2
(solid defaults to primary, textOnly to neutral). Modal takes AlertModal's surface. Toast takes the soft fill on the
raised surface with elevation-3, a 24px icon on the title line and VariantV2 (useToast returns a function per
variant); its close button no longer shrinks. Compare screens with baselines, Figma notes for the three new pages.
@aktasmehmet
aktasmehmet requested a review from a team November 26, 2026 13:59
@claude

claude Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @aktasmehmet's task in 18s —— View job


Review of PR #256 (Dropdown, Modal and Toast tokens)

I found no new blocking issues. I read the diff and the rules in docs/review/. I did not run tests, lint or the type check.

Checks

  • .Root is still compiled in Dropdown.module.scss, Modal.module.scss and Toast.module.scss (css.md §0).
  • The earlier review threads are addressed in the current code:
    • Disabled Dropdown hover: .Root:disabled { pointer-events: none } keeps the hover and active fills off a disabled button. The selectors stay at 0,3,0. The .textOnly:disabled background that repeated .Root.textOnly is gone.
    • Dropdown defaults: the variant default is derived from shape (primary for solid, neutral for textOnly). Both defaults are now in assertDefaults.
    • Toast variants test: it covers all eight VariantV2 values.
    • Duplicate icon color rule in Toast: it is removed.
    • Toast stacking: z-layer("toast") (1001) puts the toast container above both modal (999) and anchored (1000).
    • Stale layers.scss comment: it was dropped in the last commit, 08f6d28. Modal, AlertModal and Tooltip all use z-layer(...) now, so nothing is left to fix there.
  • The breaking change is documented: Dropdown and Toast secondary now means the theme's second color, and neutral gives the gray look. DaysDropdown was moved to neutral and its snapshot updated, so the existing consumer keeps its look.

Non-blocking notes

  • In Dropdown.module.scss, .Root has cursor: pointer unconditionally, since the :not(:disabled) guard was removed. This is harmless because disabled buttons take no pointer events. A :disabled { cursor: not-allowed } would only matter if pointer-events: none is dropped later.
  • Toast .Container moving from z-index: 5 to 1001 is a visible behavior change: toasts now show over modals. It is worth a line in the change notes if it isn't there already.

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Size Change: +263 B (+0.09%)

Total Size: 284 kB

📦 View Changed
Filename Size Change
dist/index.cjs 141 kB +130 B (+0.09%)
dist/index.es.js 140 kB +133 B (+0.09%)
ℹ️ View Unchanged
Filename Size
dist/chunks/useToggle-1pe2WRaw.js 800 B
dist/chunks/useToggle-B6kbi656.cjs 769 B
dist/hooks.cjs 225 B
dist/hooks.es.js 219 B

compressed-size-action

Comment thread src/lib/components/Toast/Toast.test.tsx Resolved
…tch-9

# Conflicts:
#	docs/figma/README.md
#	stylelint.config.mjs
- Dropdown: a disabled button takes no pointer, so hover and active colors never reach it; drop the repeated textOnly disabled background
- Toast: the icon takes its variant color from Icon; drop the repeated rule
- Toast: new "toast" overlay layer above modal and anchored, so a toast is never behind a modal's backdrop
- Toast test: variants typed as VariantV2[]
@aktasmehmet
aktasmehmet requested review from a team and hatesalp November 30, 2026 11:41
Comment thread src/lib/styles/layers.scss Resolved
hatesalp
hatesalp previously approved these changes Nov 30, 2026
@aktasmehmet
aktasmehmet requested a review from hatesalp November 30, 2026 13:35
@aktasmehmet
aktasmehmet merged commit f5da5b6 into main Nov 30, 2026
16 checks passed
@aktasmehmet
aktasmehmet deleted the feat/design-tokens-batch-9 branch November 30, 2026 13:39

This branch was successfully deployed

1 active deployment
development — 08f6d280 Deployed Nov 30, 2026 by aktasmehmet via Chromatic #579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants