diff --git a/packages/canon/src/components/RadioGroup/RadioGroup.tsx b/packages/canon/src/components/RadioGroup/RadioGroup.tsx index d1d7451a92..4363477c1a 100644 --- a/packages/canon/src/components/RadioGroup/RadioGroup.tsx +++ b/packages/canon/src/components/RadioGroup/RadioGroup.tsx @@ -22,6 +22,7 @@ import { import clsx from 'clsx'; import { FieldLabel } from '../FieldLabel'; import { FieldError } from '../FieldError'; +import { useStyles } from '../../hooks/useStyles'; import type { RadioGroupProps, RadioProps } from './types'; @@ -40,6 +41,8 @@ export const RadioGroup = forwardRef( ...rest } = props; + const { classNames } = useStyles('RadioGroup'); + useEffect(() => { if (!label && !ariaLabel && !ariaLabelledBy) { console.warn( @@ -54,7 +57,7 @@ export const RadioGroup = forwardRef( return ( ( secondaryLabel={secondaryLabelText} description={description} /> -
{children}
+
{children}
); @@ -78,8 +81,14 @@ RadioGroup.displayName = 'RadioGroup'; export const Radio = forwardRef((props, ref) => { const { className, ...rest } = props; + const { classNames } = useStyles('RadioGroup'); + return ( - + ); }); diff --git a/packages/canon/src/components/ScrollArea/ScrollArea.tsx b/packages/canon/src/components/ScrollArea/ScrollArea.tsx index e96e76c29b..44722fbd12 100644 --- a/packages/canon/src/components/ScrollArea/ScrollArea.tsx +++ b/packages/canon/src/components/ScrollArea/ScrollArea.tsx @@ -17,53 +17,70 @@ import { forwardRef } from 'react'; import { ScrollArea as ScrollAreaPrimitive } from '@base-ui-components/react/scroll-area'; import clsx from 'clsx'; +import { useStyles } from '../../hooks/useStyles'; const ScrollAreaRoot = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +>(({ className, ...props }, ref) => { + const { classNames } = useStyles('ScrollArea'); + + return ( + + ); +}); ScrollAreaRoot.displayName = ScrollAreaPrimitive.Root.displayName; const ScrollAreaViewport = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +>(({ className, ...props }, ref) => { + const { classNames } = useStyles('ScrollArea'); + + return ( + + ); +}); ScrollAreaViewport.displayName = ScrollAreaPrimitive.Viewport.displayName; const ScrollAreaScrollbar = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +>(({ className, ...props }, ref) => { + const { classNames } = useStyles('ScrollArea'); + + return ( + + ); +}); ScrollAreaScrollbar.displayName = ScrollAreaPrimitive.Scrollbar.displayName; const ScrollAreaThumb = forwardRef< React.ElementRef, React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)); +>(({ className, ...props }, ref) => { + const { classNames } = useStyles('ScrollArea'); + + return ( + + ); +}); ScrollAreaThumb.displayName = ScrollAreaPrimitive.Thumb.displayName; /** @public */ diff --git a/packages/canon/src/components/Select/Select.tsx b/packages/canon/src/components/Select/Select.tsx index 3f25ac26de..7710d8d587 100644 --- a/packages/canon/src/components/Select/Select.tsx +++ b/packages/canon/src/components/Select/Select.tsx @@ -21,6 +21,7 @@ import clsx from 'clsx'; import './Select.styles.css'; import { SelectProps } from './types'; import { useResponsiveValue } from '../../hooks/useResponsiveValue'; +import { useStyles } from '../../hooks/useStyles'; /** @public */ export const Select = forwardRef((props, ref) => { @@ -37,8 +38,7 @@ export const Select = forwardRef((props, ref) => { ...rest } = props; - // Get the responsive value for the variant - const responsiveSize = useResponsiveValue(size); + const { classNames, dataAttributes } = useStyles('Select'); // Generate unique IDs for accessibility const selectId = useId(); @@ -58,7 +58,7 @@ export const Select = forwardRef((props, ref) => { ); return ( -
+
{label && (