From 6ec16bc15cc78e62cb94e131699625fa5363437c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Fri, 15 Apr 2022 15:34:21 +0200 Subject: chore: add a Widget component --- .../molecules/buttons/heading-button.module.scss | 2 +- src/components/molecules/buttons/heading-button.tsx | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/components/molecules/buttons') diff --git a/src/components/molecules/buttons/heading-button.module.scss b/src/components/molecules/buttons/heading-button.module.scss index d068001..1d16410 100644 --- a/src/components/molecules/buttons/heading-button.module.scss +++ b/src/components/molecules/buttons/heading-button.module.scss @@ -11,7 +11,7 @@ justify-content: space-between; gap: var(--spacing-md); width: 100%; - padding: 0; + padding: 0 var(--spacing-2xs); position: sticky; top: 0; background: inherit; diff --git a/src/components/molecules/buttons/heading-button.tsx b/src/components/molecules/buttons/heading-button.tsx index 700b3e1..fc79749 100644 --- a/src/components/molecules/buttons/heading-button.tsx +++ b/src/components/molecules/buttons/heading-button.tsx @@ -1,10 +1,14 @@ import Heading, { type HeadingProps } from '@components/atoms/headings/heading'; import PlusMinus from '@components/atoms/icons/plus-minus'; -import { FC, SetStateAction } from 'react'; +import { SetStateAction, VFC } from 'react'; import { useIntl } from 'react-intl'; import styles from './heading-button.module.scss'; export type HeadingButtonProps = Pick & { + /** + * Set additional classnames to the button. + */ + className?: string; /** * Accordion state. */ @@ -24,7 +28,8 @@ export type HeadingButtonProps = Pick & { * * Render a button as accordion title to toggle body. */ -const HeadingButton: FC = ({ +const HeadingButton: VFC = ({ + className = '', expanded, level, setExpanded, @@ -47,18 +52,14 @@ const HeadingButton: FC = ({ return ( ); }; -- cgit v1.2.3