-
-
Notifications
You must be signed in to change notification settings - Fork 2k
fix(slots): extendVariants fn to support slots #5895
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
base: canary
Are you sure you want to change the base?
fix(slots): extendVariants fn to support slots #5895
Conversation
|
|
@deepansh946 is attempting to deploy a commit to the HeroUI Inc Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds slot override capability to Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant extendVariants
participant getSlots
participant Merge
User->>extendVariants: Provide styles with directSlots + variants
extendVariants->>extendVariants: Extract directSlots from styles.slots
extendVariants->>getSlots: Process variants
getSlots-->>extendVariants: Return inferredSlots
extendVariants->>Merge: Merge directSlots + inferredSlots
Merge-->>extendVariants: Return merged slots
extendVariants-->>User: Return component with merged slots
Note over extendVariants,Merge: Direct slots take precedence<br/>but merge with inferred slots
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (1)packages/core/system-rsc/__tests__/extend-variants.test.tsx (2)
🔇 Additional comments (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@heroui/accordion
@heroui/alert
@heroui/autocomplete
@heroui/avatar
@heroui/badge
@heroui/breadcrumbs
@heroui/button
@heroui/calendar
@heroui/card
@heroui/checkbox
@heroui/chip
@heroui/code
@heroui/date-input
@heroui/date-picker
@heroui/divider
@heroui/drawer
@heroui/dropdown
@heroui/form
@heroui/image
@heroui/input
@heroui/input-otp
@heroui/kbd
@heroui/link
@heroui/listbox
@heroui/menu
@heroui/modal
@heroui/navbar
@heroui/number-input
@heroui/pagination
@heroui/popover
@heroui/progress
@heroui/radio
@heroui/ripple
@heroui/scroll-shadow
@heroui/select
@heroui/skeleton
@heroui/slider
@heroui/snippet
@heroui/spacer
@heroui/spinner
@heroui/switch
@heroui/table
@heroui/tabs
@heroui/toast
@heroui/tooltip
@heroui/user
@heroui/react
@heroui/system
@heroui/system-rsc
@heroui/theme
@heroui/use-aria-accordion
@heroui/use-aria-accordion-item
@heroui/use-aria-button
@heroui/use-aria-link
@heroui/use-aria-modal-overlay
@heroui/use-aria-multiselect
@heroui/use-aria-overlay
@heroui/use-callback-ref
@heroui/use-clipboard
@heroui/use-data-scroll-overflow
@heroui/use-disclosure
@heroui/use-draggable
@heroui/use-form-reset
@heroui/use-image
@heroui/use-infinite-scroll
@heroui/use-intersection-observer
@heroui/use-is-mobile
@heroui/use-is-mounted
@heroui/use-measure
@heroui/use-pagination
@heroui/use-real-shape
@heroui/use-ref-state
@heroui/use-resize
@heroui/use-safe-layout-effect
@heroui/use-scroll-position
@heroui/use-ssr
@heroui/use-theme
@heroui/use-update-effect
@heroui/use-viewport-size
@heroui/aria-utils
@heroui/dom-animation
@heroui/framer-utils
@heroui/react-rsc-utils
@heroui/react-utils
@heroui/shared-icons
@heroui/shared-utils
@heroui/stories-utils
@heroui/test-utils
commit: |
|
@wingkwong Please review the PR, I have made the required changes, added tests & also updated the documentation. |
Closes #5785
📝 Description
Adds support for direct slot overrides in
extendVariantsfunction. Users can now override base component slots globally using theslotsoption, which applies styles to specific slots regardless of variants. Variant-based slot overrides continue to work and merge with direct slots.⛳️ Current behavior (updates)
Previously, the
slotsoption inextendVariantswas typed but not implemented. Attempting to override base component slots (e.g.,labelslot in Input component) had no effect, even when using!importantspecifiers.🚀 New behavior
slotsoption now work correctlyExample usage:
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
tv()function as base slots, which then merge with variant-based slotsslotsoption capabilityslotsoption, so no type changes neededSummary by CodeRabbit
Release Notes
New Features
slotsoption. Direct slots now merge seamlessly with variant-based slots for flexible customization.Documentation