Skip to content
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

chore(Radio, ToggleGroup): ♻️ Move missed css to correct place #1968

Merged
merged 3 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/css/radio.css
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,10 @@

min-height: var(--fds-sizing-12);
}

.fds-radio-group--horizontal {
display: flex;
flex-direction: row;
gap: var(--fds-spacing-2);
}
}
4 changes: 4 additions & 0 deletions packages/css/togglegroup.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
.fds-togglegroup__input {
display: none;
}

.fds-togglegroup__item:focus-visible {
z-index: 1;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import type { ButtonProps } from '../../Button';
import { Button } from '../../Button';
import { RovingTabindexItem } from '../../../utilities/RovingTabIndex';

import classes from './ToggleGroupItem.module.css';
import { useToggleGroupItem } from './useToggleGroupitem';

export type ToggleGroupItemProps = {
Expand All @@ -25,7 +24,7 @@ export const ToggleGroupItem = forwardRef<
value={rest.value}
>
<Button
className={cl(classes.toggleGroupItem, className)}
className={cl('fds-togglegroup__item', className)}
icon={icon}
color='first'
variant={active ? 'primary' : 'tertiary'}
Expand Down

This file was deleted.

11 changes: 8 additions & 3 deletions packages/react/src/components/form/Radio/Group/Group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import cl from 'clsx';
import type { FieldsetProps } from '../../Fieldset';
import { Fieldset } from '../../Fieldset';

import classes from './Group.module.css';

export type RadioGroupContextProps = {
name?: string;
value?: string;
Expand Down Expand Up @@ -72,7 +70,14 @@ export const RadioGroup = forwardRef<HTMLFieldSetElement, RadioGroupProps>(
required,
}}
>
<div className={cl(inline && classes.inline)}>{children}</div>
<div
className={cl(
'fds-radio-group',
inline && 'fds-radio-group--horizontal',
)}
>
{children}
</div>
</RadioGroupContext.Provider>
</Fieldset>
);
Expand Down
Loading