Skip to content

Commit

Permalink
style: Updated styles on Checkbox Overview
Browse files Browse the repository at this point in the history
  • Loading branch information
shindigira committed Jan 26, 2024
1 parent 1b76e62 commit 722ad14
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/components/Checkbox/CheckboxOverview.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { Meta } from '@storybook/addon-docs';
import { List, Link, ListLink, Heading } from '~/src/index';
import { List, Link, ListLink, Heading, Paragraph } from '~/src/index';

<Meta title='Components (Verified)/Checkboxes/Overview' />

<Heading type='1'>Checkboxes</Heading>

Use checkboxes when the user can select more than one option from a list. Make clear with helper text that this is the case. Use [radio buttons](https://cfpb.github.io/design-system/components/radio-buttons) when the user can choose only one option from a list.
<Paragraph>Use checkboxes when the user can select more than one option from a list. Make clear with helper text that this is the case. Use [radio buttons](https://cfpb.github.io/design-system/components/radio-buttons) when the user can choose only one option from a list.</Paragraph>

Source: <Link href='https://cfpb.github.io/design-system/components/checkboxes'>https://cfpb.github.io/design-system/components/checkboxes</Link>
<Paragraph>Source: <Link href='https://cfpb.github.io/design-system/components/checkboxes'>https://cfpb.github.io/design-system/components/checkboxes</Link></Paragraph>

<Heading type='3'>Types</Heading>
<br />

<List isLinks>
<Heading type='4'>Types</Heading>

<List forceListStyleOverride className="cfpb-list-style-override" isLinks>
<ListLink href='/?path=/docs/components-verified-checkboxes-checkbox--overview'>Checkbox</ListLink>
<ListLink href='/?path=/docs/components-verified-checkboxes-large-target-area--overview'>Large target area</ListLink>
</List>
8 changes: 8 additions & 0 deletions src/components/List/List.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.cfpb-list-style-override {
padding-left: 1.125em !important;
list-style: square !important;

a {
font-size: 16px;
}
}
7 changes: 6 additions & 1 deletion src/components/List/List.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import classnames from 'classnames';
import './List.less';

interface ListProperties {
children: JSX.Element | JSX.Element[];
Expand All @@ -8,6 +9,7 @@ interface ListProperties {
isOrdered?: boolean;
isSpaced?: boolean;
isUnstyled?: boolean;
forceListStyleOverride?: boolean;
}

export default function List({
Expand All @@ -17,13 +19,16 @@ export default function List({
isLinks = false,
isOrdered,
isSpaced,
forceListStyleOverride,
isUnstyled
}: ListProperties): JSX.Element {
const cnames = [className, 'm-list'];
const cnames = ['m-list'];
if (isHorizontal) cnames.push('m-list__horizontal');
if (isLinks) cnames.push('m-list__links');
if (isSpaced) cnames.push('m-list__spaced');
if (isUnstyled) cnames.push('m-list__unstyled');
if (forceListStyleOverride) cnames.push('cfpb-list-style-override');
if (className) cnames.push(className);

if (isOrdered) return <ol className={classnames(cnames)}>{children}</ol>;
return <ul className={classnames(cnames)}>{children}</ul>;
Expand Down

0 comments on commit 722ad14

Please sign in to comment.