Skip to content

feat: add new variants and update agent docs for tokens#3791

Open
adithyaakrishna wants to merge 2 commits intosimstudioai:stagingfrom
adithyaakrishna:feat/update-variants
Open

feat: add new variants and update agent docs for tokens#3791
adithyaakrishna wants to merge 2 commits intosimstudioai:stagingfrom
adithyaakrishna:feat/update-variants

Conversation

@adithyaakrishna
Copy link
Contributor

Summary

  • New variants for some components
  • Created a semantic-tokens.md file for agents.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: Updating of components.

Testing

  • Go to /playground
  • Check for Skeleton, FormField, Banner components

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@cursor
Copy link

cursor bot commented Mar 26, 2026

PR Summary

Medium Risk
Introduces new styling variants and new/changed props on shared UI components (Input, Switch, Slider, Label, Skeleton), which may require consumer updates (notably Input now reserves size). Mostly UI-only changes with limited blast radius beyond component usage.

Overview
Adds a comprehensive .claude/rules/semantic-tokens.md reference documenting EMCN semantic tokens, Tailwind extensions, component APIs, and styling guidelines.

Extends several emcn components with new variants/props and exports: Input and Textarea gain error/ghost variants (and Input adds sm/md sizing), Switch and Slider gain size variants, Label adds size variants plus a required asterisk, and Skeleton adds shape variants. Banner expands beyond default/destructive to include warning/info/success, and Combobox disallows passing the native size attribute through inputProps.

Updates the /playground page to showcase the new variants and adds sections for FormField, Banner, and Skeleton.

Written by Cursor Bugbot for commit 3c28b33. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Mar 26, 2026

@adithyaakrishna is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 26, 2026

Greptile Summary

This PR expands the EMCN component library with new visual variants and sizes across six components (Input, Textarea, Label, Skeleton, Switch, Slider) and adds three semantic variants (warning, info, success) to Banner. It also ships a comprehensive semantic-tokens.md agent reference document covering all design tokens, Tailwind configuration, and per-component API docs. The playground page is updated to demonstrate all new variants.\n\nKey changes:\n- Input — added error/ghost variants and sm/md size variants (with correct Omit<…, 'size'> on InputHTMLAttributes to prevent type conflicts)\n- Textarea — added error/ghost variants; padding is duplicated across all three variant definitions rather than hoisted to the base class\n- Label — added sm/md/lg size variants and a required prop (renders a red asterisk)\n- Skeleton — added line/circle/rectangle shape variants via CVA\n- Switch — added sm/md/lg size variants with mathematically correct thumb translation values for each size\n- Slider — added sm/md/lg size variants via a typed config object (reasonable choice given the multi-element composition)\n- Banner — added warning, info, success variants using raw Tailwind palette classes instead of semantic tokens, inconsistent with the guidelines documented in this very PR\n- index.ts — updated to re-export newly added types and variant functions

Confidence Score: 4/5

Safe to merge; all variant logic is additive and non-breaking with two minor style clean-ups worth addressing.

The component changes are well-implemented, type-safe, and consistent with the existing CVA patterns. Switch thumb translations, Slider size configs, and Input/Textarea type omissions are all correct. The only two concerns are both P2 style suggestions: Banner's new variants use raw Tailwind color classes instead of semantic tokens (in a PR that explicitly documents the 'always use semantic tokens' rule), and Textarea has duplicated padding across variants. Neither blocks a merge.

apps/sim/components/emcn/components/banner/banner.tsx — new variants use raw Tailwind colors rather than semantic tokens

Important Files Changed

Filename Overview
.claude/rules/semantic-tokens.md New agent documentation file covering semantic tokens, Tailwind config, and complete EMCN component reference — no code issues, comprehensive and accurate.
apps/sim/app/playground/page.tsx Added playground demos for Banner, Skeleton, FormField, Switch sizes, Slider sizes, Input/Textarea/Label variants — follows existing VariantRow patterns correctly throughout.
apps/sim/components/emcn/components/banner/banner.tsx Added warning, info, success variants; new variants use raw Tailwind color classes instead of semantic tokens, inconsistent with the design system guidelines documented in this very PR.
apps/sim/components/emcn/components/combobox/combobox.tsx Added size to the omitted native HTML attributes in inputProps to prevent collision with the Input component's custom size variant prop — correct fix.
apps/sim/components/emcn/components/input/input.tsx Added error/ghost variants and sm/md size variants via CVA; correctly omits native size from InputHTMLAttributes to avoid type conflicts.
apps/sim/components/emcn/components/label/label.tsx Added sm/md/lg size variants via CVA and a required prop that renders a red asterisk; exports LabelProps and labelVariants as required by the index update.
apps/sim/components/emcn/components/skeleton/skeleton.tsx Added line/circle/rectangle shape variants via CVA with correct border-radius classes; exports SkeletonProps and skeletonVariants.
apps/sim/components/emcn/components/slider/slider.tsx Added sm/md/lg size variants using a typed SLIDER_SIZES config object; thumb translation values are mathematically correct for each size.
apps/sim/components/emcn/components/switch/switch.tsx Added sm/md/lg size variants for both root and thumb via separate CVA definitions; thumb translate values are mathematically correct; React.memo wrapper preserved.
apps/sim/components/emcn/components/textarea/textarea.tsx Added error/ghost variants via CVA; px-2 py-2 padding is duplicated in all three variants rather than hoisted to the base class.
apps/sim/components/emcn/components/index.ts Updated re-exports for Label, Skeleton, Switch, and Textarea to include newly-added types and variant functions — all additions are consistent and complete.

Comments Outside Diff (1)

  1. apps/sim/components/emcn/components/textarea/textarea.tsx, line 14-31 (link)

    P2 Duplicated padding across all variants

    px-2 py-2 is repeated identically in all three variant definitions. Since the padding is the same regardless of variant, it should live in the base class string to reduce repetition and make future changes simpler.

Reviews (1): Last reviewed commit: "feat: add new variants and create docs f..." | Re-trigger Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

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