From 6febe2a7a378fe093086cb7949237f3512d7bbc1 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Mon, 23 Jun 2025 13:25:41 +0100 Subject: [PATCH] Convert more components Signed-off-by: Charles de Dreuille --- packages/canon/src/components/Box/Box.tsx | 4 +- .../src/components/Checkbox/Checkbox.tsx | 4 +- .../components/Collapsible/Collapsible.tsx | 55 ++-- .../src/components/Container/Container.tsx | 5 +- .../src/components/FieldLabel/FieldLabel.tsx | 14 +- packages/canon/src/components/Flex/Flex.tsx | 4 +- packages/canon/src/components/Grid/Grid.tsx | 8 +- .../canon/src/components/Heading/Heading.tsx | 15 +- packages/canon/src/components/Icon/Icon.tsx | 5 +- packages/canon/src/components/Link/Link.tsx | 10 +- packages/canon/src/components/Menu/Menu.tsx | 281 +++++++++++------- .../canon/src/utils/componentDefinitions.ts | 140 +++++---- 12 files changed, 315 insertions(+), 230 deletions(-) diff --git a/packages/canon/src/components/Box/Box.tsx b/packages/canon/src/components/Box/Box.tsx index 8718c77724..4273ee86f9 100644 --- a/packages/canon/src/components/Box/Box.tsx +++ b/packages/canon/src/components/Box/Box.tsx @@ -24,6 +24,7 @@ import { widthPropDefs } from '../../props/width.props'; import { heightPropDefs } from '../../props/height.props'; import { positionPropDefs } from '../../props/position.props'; import { displayPropDefs } from '../../props/display.props'; +import { useStyles } from '../../hooks/useStyles'; /** @public */ export const Box = forwardRef((props, ref) => { @@ -38,11 +39,12 @@ export const Box = forwardRef((props, ref) => { ...boxPropDefs, }; + const { classNames } = useStyles('Box'); const { className, style } = extractProps(props, propDefs); return createElement(props.as || 'div', { ref, - className: clsx('canon-Box', className), + className: clsx(classNames.root, className), style, children, }); diff --git a/packages/canon/src/components/Checkbox/Checkbox.tsx b/packages/canon/src/components/Checkbox/Checkbox.tsx index 8fbb4d40af..aaa6fb105b 100644 --- a/packages/canon/src/components/Checkbox/Checkbox.tsx +++ b/packages/canon/src/components/Checkbox/Checkbox.tsx @@ -50,14 +50,14 @@ export const Checkbox = forwardRef( value={value} style={style} > - + ); return label ? ( -