Skip to content

Commit

Permalink
fix(input): update label and text style to scale
Browse files Browse the repository at this point in the history
  • Loading branch information
scottdickerson committed Nov 13, 2024
1 parent f154330 commit 5985308
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/Input/_input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ $lg: #{$px}-input--lg;
}

&__label {
color: $pure-black;
font-size: 0.75rem;
@include text($body2);

font-variation-settings: 'wght' 600;
margin-bottom: 0.5rem;
word-break: break-word;
Expand All @@ -26,10 +26,11 @@ $lg: #{$px}-input--lg;
}

&__input {
@include text($body2);

accent-color: $soft-black;
border: 1px solid $keyline-gray;
border-radius: 0.1875rem;
font-size: 0.8125rem;
font-variation-settings: 'wght' 600;
margin-bottom: 0.25rem;
padding: $padding-xsm;
Expand Down
4 changes: 4 additions & 0 deletions src/patterns/DetailList/utils.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ describe('getDetailKey', () => {
const child = 'Not a valid element';
expect(getDetailKey(child, 0)).toBe('detail-0');
});
it('should return a key if passed directly', () => {
const child = <Detail {...props} key="custom-key" />;
expect(getDetailKey(child, 0)).toBe('custom-key');
});
});
3 changes: 3 additions & 0 deletions src/patterns/DetailList/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { DetailComponent, DetailProps } from '../../components/Detail';

export const getDetailKey = (child: DetailComponent, index: number) => {
if (isValidElement(child)) {
if (child.key) {
return child.key;
}
const { label, value } = child.props as DetailProps;
return `detail-${label}-${value}`;
}
Expand Down

0 comments on commit 5985308

Please sign in to comment.