Skip to content

Commit

Permalink
add addonafter
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeldking committed Jan 23, 2024
1 parent a42483a commit b9f9ed2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/field/Addon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { css } from '@emotion/react';
import theme from '../theme';
import { Text } from '../content/Text';

const addonBeforeCSS = css`
const addonCSS = css`
background-color: var(--ac-global-color-grey-300);
padding: 0 var(--ac-global-dimension-static-size-100);
flex: none;
Expand All @@ -18,7 +18,20 @@ const addonBeforeCSS = css`
*/
export function AddonBefore({ children }: { children: ReactNode }) {
return (
<div css={addonBeforeCSS} className="ac-addon ac-addon--before">
<div css={addonCSS} className="ac-addon ac-addon--before">
<Text textSize="medium" weight="heavy" color="text-700">
{children}
</Text>
</div>
);
}

/**
* A label element that describes a button or an input field
*/
export function AddonAfter({ children }: { children: ReactNode }) {
return (
<div css={addonCSS} className="ac-addon ac-addon--after">
<Text textSize="medium" weight="heavy" color="text-700">
{children}
</Text>
Expand Down

0 comments on commit b9f9ed2

Please sign in to comment.