Skip to content

Commit 51ab832

Browse files
committed
Export field
1 parent 700e3fe commit 51ab832

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

src/field/Field.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface FieldProps
2424
Validation {
2525
children: ReactElement;
2626
label?: ReactNode;
27-
labelProps: HTMLAttributes<HTMLElement>;
27+
labelProps?: HTMLAttributes<HTMLElement>;
2828
wrapperClassName?: string;
2929
}
3030

src/field/FieldLabel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ function FieldLabel(props: FieldLabelProps, ref: DOMRef<HTMLLabelElement>) {
5959
htmlFor={ElementType === 'label' ? labelFor || htmlFor : undefined}
6060
css={css`
6161
font-size: ${theme.typography.sizes.small.fontSize}px;
62-
font-weight: ${theme.typography.sizes.small.lineHeight}px;
62+
line-height: ${theme.typography.sizes.small.lineHeight}px;
63+
font-weight: ${theme.typography.weights.heavy};
6364
color: ${theme.textColors.white90};
6465
padding: ${theme.spacing.padding4}px 0;
6566
display: inline-block;

src/field/HelpText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import theme from '../theme';
77

88
export interface HelpTextComponentProps extends HelpTextProps, Validation {
99
/** Props for the help text description element. */
10-
descriptionProps: HTMLAttributes<HTMLElement>;
10+
descriptionProps?: HTMLAttributes<HTMLElement>;
1111
/** Props for the help text error message element. */
12-
errorMessageProps: HTMLAttributes<HTMLElement>;
12+
errorMessageProps?: HTMLAttributes<HTMLElement>;
1313
/** Whether the description is displayed with lighter text. */
1414
isDisabled?: boolean;
1515
/** Whether an error icon is rendered. */

src/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export * from './dropdown';
1515
export * from './listbox';
1616
export * from './picker';
1717
export * from './notification';
18+
export * from './field';
1819
export * from './textfield';
1920
export * from './form';
2021
// export interface Props extends HTMLAttributes<HTMLDivElement> {

stories/Gallery.stories.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
TextField,
1010
Dropdown,
1111
Provider,
12+
Field,
1213
} from '../src';
1314

1415
// @ts-ignore
@@ -99,7 +100,14 @@ const Template: Story = args => {
99100
`}
100101
>
101102
<TextField label="name" placeholder="enter your name" />
102-
<Dropdown menu={<div>Hello</div>}>Action</Dropdown>
103+
<TextField
104+
label="email"
105+
addonBefore="mail"
106+
placeholder="enter your email"
107+
/>
108+
<Field label="Perform action">
109+
<Dropdown menu={<div>Hello</div>}>Action</Dropdown>
110+
</Field>
103111
<Button variant="primary">Submit</Button>
104112
</div>
105113
</Card>

0 commit comments

Comments
 (0)