-
-
Notifications
You must be signed in to change notification settings - Fork 53
fixes to radiogroup themed #1206
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
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c0f4109
fixes
GoldGroove06 4f99b21
fixed + added support for color,soze and variant
GoldGroove06 e19c470
linting
GoldGroove06 ea0f11a
Merge branch 'main' into radiogroup-theme-fix
GoldGroove06 213cf94
build fix
GoldGroove06 0ed70a0
merge changes
GoldGroove06 968376a
radio cards fix
GoldGroove06 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import { createContext } from 'react'; | ||
|
|
||
| export const RadioCardsContext = createContext({ | ||
| defaultChecked: null, | ||
|
|
||
| rootClass: '', | ||
| onChange: null | ||
|
|
||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| import { createContext } from 'react'; | ||
| import { createContext, RefObject } from 'react'; | ||
|
|
||
| export const RadioGroupContext = createContext({ | ||
| defaultChecked: null, | ||
| customRootClass: null, | ||
| onChange: null | ||
| interface RadioGroupContextType { | ||
| rootClass: string; | ||
| } | ||
|
|
||
| export const RadioGroupContext = createContext<RadioGroupContextType>({ | ||
| rootClass: '' | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,15 @@ | ||
| import React, { useContext } from 'react'; | ||
| import RadioGroupPrimitive from '~/core/primitives/RadioGroup/RadioGroupPrimitive'; | ||
| import RadioGroupPrimitive, { RadioGroupPrimitiveTypes } from '~/core/primitives/RadioGroup/RadioGroupPrimitive'; | ||
| import { RadioGroupContext } from '../context/RadioGroupContext'; | ||
| import clsx from 'clsx'; | ||
|
|
||
| const RadioGroupItem = ({ children, className = '', ...props }: { children: React.ReactNode } & RadioGroupPrimitive.ItemProps) => { | ||
| export type RadioGroupItemProps ={ | ||
|
|
||
| } & RadioGroupPrimitiveTypes.Item; | ||
|
|
||
| const RadioGroupItem = ({ children, className = '', value, ...props }:RadioGroupItemProps) => { | ||
| const { rootClass } = useContext(RadioGroupContext); | ||
| return <RadioGroupPrimitive.Item className={clsx(`${rootClass}-item`, className)} {...props}>{children}</RadioGroupPrimitive.Item>; | ||
| return <RadioGroupPrimitive.Item className={clsx(`${rootClass}-item`, className)} value={value} {...props}>{children}</RadioGroupPrimitive.Item>; | ||
| }; | ||
|
|
||
| export default RadioGroupItem; |
27 changes: 16 additions & 11 deletions
27
src/components/ui/RadioGroup/fragments/RadioGroupRoot.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,4 +35,3 @@ | |
| background-color: var(--rad-ui-color-accent-400); | ||
| } | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the breaking changes in default prop values
The default values for
orientationandloophave been changed:orientation:'horizontal'→'both'loop:false→trueThese changes could potentially break existing implementations that rely on the previous defaults.
Please verify that these default value changes are intentional and documented, and ensure backward compatibility is maintained:
🏁 Script executed:
Length of output: 95216
Document and Communicate Updated RadioGroupPrimitive Defaults
Verified that the defaults for
orientation('horizontal'→'both') andloop(false→true) in RadioGroupPrimitiveRoot are intentional and no internal code or tests depend on the old values. To ensure users aren’t caught off-guard, please:src/core/primitives/RadioGroup/fragments/RadioGroupPrimitiveRoot.tsx• Reflect defaults:
orientation = 'both',loop = truedocs/app/docs/components/primitives/RadioGroupor your docs directory) to call out the new defaults🤖 Prompt for AI Agents