Skip to content

feat(ui-view,emotion): add shared design token values to View v2 style props#2604

Open
HerrTopi wants to merge 1 commit into
masterfrom
view
Open

feat(ui-view,emotion): add shared design token values to View v2 style props#2604
HerrTopi wants to merge 1 commit into
masterfrom
view

Conversation

@HerrTopi

@HerrTopi HerrTopi commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Description

Extends View v2 (and the shared ThemeablePropValues enums) so the style props accept the new shared design tokens in addition to the existing legacy values. All legacy values keep working, so this is purely additive for consumers.

New values now accepted by View v2:

  • shadowelevation1, elevation2, elevation3, elevation4 (alongside legacy resting / above / topmost / none).
  • borderWidthsm, md, lg (alongside legacy small / medium / large).
  • borderRadius — the shared radius scale xs, sm, md, lg, xl, xxl, full plus the card radii card.sm / card.md / card.lg and card.nestedContainer.sm / .md / .lg (alongside legacy small / medium / large, circle, pill, and raw CSS lengths).
  • borderColor — the shared stroke tokens strongColor, visualSeparator and the accent palette (accentAsh, accentAurora, accentBlue, accentGreen, accentGrey, accentHoney, accentOrange, accentPlum, accentRed, accentSea, accentSky, accentStone, accentViolet) — in addition to the legacy contextual colors and any valid CSS color string.

Supporting changes:

  • packages/emotion — added the new elevation1elevation4 shadow values and sm / md / lg border-width values to ThemeablePropValues.
  • v1 components (View v1, ContextView, Popover, Expandable) — the shadow prop type is inlined to the legacy union ('resting' | 'above' | 'topmost' | 'none') so the v1 API stays unchanged and does not surface the new elevation values.
  • View/v2/styles.ts — maps each new value to the corresponding sharedTokens entry.
  • Updated the View v2 README with examples and prop documentation for the new values.

No breaking changes — existing prop values are preserved.

Test plan

  • pnpm run test:vitest ui-view passes.
  • In the docs app (pnpm run dev), open the View page and verify the shadow, borderWidth, borderRadius, and borderColor examples render, including the newly added elevation4, card.md, lg radius, and accent color examples.
  • Legacy values (shadow="resting", borderWidth="small", borderRadius="medium", borderColor="primary") still render identically to before.
  • New values apply the expected shared-token styles (elevation shadows, stroke widths, radius scale, accent stroke colors).
  • v1 View / ContextView / Popover / Expandable still type-check and their shadow prop only accepts the legacy values.
  • TypeScript build is clean (pnpm run ts:check / references check).

INSTUI-4945

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://instructure.design/pr-preview/pr-2604/

Built to branch gh-pages at 2026-06-25 11:15 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

Copy link
Copy Markdown

Visual regression report

No changes.

Status Count
Unchanged 32
Changed 0
New 0
Removed 0

📊 View full report

Baselines come from the visual-baselines branch. They refresh on every merge to master.

github-actions Bot pushed a commit that referenced this pull request Jun 25, 2026
@HerrTopi HerrTopi requested a review from balzss June 29, 2026 10:12
@HerrTopi HerrTopi changed the title feat(many): add prop most shared tokens to prop options in view feat(ui-view,emotion): add shared design token values to View v2 style props Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant