Skip to content

Commit

Permalink
fix: Do not render RadioGroupLabel as label. It should be a div
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas-C committed Dec 6, 2024
1 parent 966b9fb commit d3116fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/primitives/src/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { RadioGroup, radioGroupAnatomy } from "@ark-ui/react";
import { sva } from "@ndla/styled-system/css";
import type { JsxStyleProps } from "@ndla/styled-system/types";
import { createStyleContext } from "./createStyleContext";
import { Label } from "./Label";
import { Text, type TextProps } from "./Text";

const radioGroupRecipe = sva({
Expand Down Expand Up @@ -142,9 +141,11 @@ export const InternalRadioGroupLabel = withContext<HTMLLabelElement, RadioGroup.
);

export const RadioGroupLabel = forwardRef<HTMLLabelElement, RadioGroup.LabelProps & TextProps & JsxStyleProps>(
({ textStyle = "label.large", children, ...props }, ref) => (
<InternalRadioGroupLabel ref={ref} {...props} asChild>
<Label textStyle={textStyle}>{children}</Label>
({ textStyle = "label.large", fontWeight = "bold", children, ...props }, ref) => (
<InternalRadioGroupLabel {...props} asChild ref={ref}>
<Text textStyle={textStyle} fontWeight={fontWeight}>
{children}
</Text>
</InternalRadioGroupLabel>
),
);
Expand Down

0 comments on commit d3116fc

Please sign in to comment.