Skip to content

Commit

Permalink
fix :infotip padding (#133)
Browse files Browse the repository at this point in the history
* fix: contextual help size

* v0.12.2
  • Loading branch information
mikeldking committed Jun 9, 2023
1 parent 3817e21 commit 238ee62
Show file tree
Hide file tree
Showing 5 changed files with 300 additions and 246 deletions.
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.12.1",
"version": "0.12.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -80,11 +80,12 @@
"@types/react": "18",
"@types/react-dom": "18",
"@types/react-transition-group": "^4.4.5",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.39.0",
"babel-loader": "^9.1.2",
"babel-plugin-polished": "^1.1.0",
"chromatic": "^6.5.1",
"eslint": "7.17.0",
"husky": "^8.0.1",
"polished": "^4.2.2",
"react": "18",
Expand All @@ -102,7 +103,8 @@
"react": "^18",
"react-dom": "^18",
"**/@typescript-eslint/eslint-plugin": "^4.1.1",
"**/@typescript-eslint/parser": "^4.1.1"
"**/@typescript-eslint/parser": "^4.1.1",
"eslint": "7.17.0"
},
"dependencies": {
"@emotion/react": "^11.10.5",
Expand Down Expand Up @@ -135,6 +137,7 @@
"@react-stately/virtualizer": "^3.3.1",
"@react-types/shared": "^3.15.0",
"clsx": "^1.1.1",
"eslint-config-prettier": "^8.8.0",
"react-transition-group": "^4.4.5"
},
"description": "Re-usable React components",
Expand Down
3 changes: 1 addition & 2 deletions src/button/ActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function ActionButton(
const quietButtonCSS = css`
border: none;
margin: 0;
padding: 0.2em;
padding: 0 0;
color: inherit;
background: none;
cursor: pointer;
Expand All @@ -62,7 +62,6 @@ const quietButtonCSS = css`
transition: all 0.2s ease-in-out;
&:hover {
opacity: 1;
background-color: ${theme.colors.gray500};
}
svg {
padding: var(--ac-dimension-size-85);
Expand Down
27 changes: 27 additions & 0 deletions src/icon/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -702,3 +702,30 @@ export const SunOutline = () => (
</g>
</svg>
);

export const ArrowDownFilled = () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<g data-name="Layer 2">
<g data-name="arrow-downward">
<rect
width="24"
height="24"
transform="rotate(-90 12 12)"
opacity="0"
/>
<path d="M12 17a1.72 1.72 0 0 1-1.33-.64l-4.21-5.1a2.1 2.1 0 0 1-.26-2.21A1.76 1.76 0 0 1 7.79 8h8.42a1.76 1.76 0 0 1 1.59 1.05 2.1 2.1 0 0 1-.26 2.21l-4.21 5.1A1.72 1.72 0 0 1 12 17z" />
</g>
</g>
</svg>
);

export const ArrowUpFilled = () => (
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<g data-name="Layer 2">
<g data-name="arrow-up">
<rect width="24" height="24" transform="rotate(90 12 12)" opacity="0" />
<path d="M16.21 16H7.79a1.76 1.76 0 0 1-1.59-1 2.1 2.1 0 0 1 .26-2.21l4.21-5.1a1.76 1.76 0 0 1 2.66 0l4.21 5.1A2.1 2.1 0 0 1 17.8 15a1.76 1.76 0 0 1-1.59 1z" />
</g>
</g>
</svg>
);
68 changes: 48 additions & 20 deletions stories/ContextualHelp.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import React, { useState } from 'react';
import { Meta, Story } from '@storybook/react';
import { withDesign } from 'storybook-addon-designs';
import {
ActionButton,
Form,
Provider,
Placement,
ContextualHelp,
Text,
Heading,
theme,
Content,
TextField,
} from '../src';

import css from '@emotion/css';
Expand Down Expand Up @@ -53,11 +54,14 @@ export default meta;

export const Gallery = () => (
<Provider>
<ul style={{ listStyle: 'none', marginLeft: '500px', marginTop: '200px' }}>
{placements.map((placement, index) => {
return (
<li key={index} style={{ margin: '10px 0' }}>
<ContextualHelp placement={placement} variant="info">
<section>
<Heading>Form Horizontal</Heading>
<Form layout="inline">
<TextField label="First Name" />
<TextField
label="Last Name"
labelExtra={
<ContextualHelp variant="info">
<Heading level={3} weight="heavy">
Need help?
</Heading>
Expand All @@ -67,20 +71,44 @@ export const Gallery = () => (
customer support team for help.
</Text>
</Content>
<footer
css={css`
.ac-text {
text-decoration: underline;
color: ${theme.colors.arizeLightBlue};
}
`}
>
<Text textSize="small">Learn more about accounts</Text>
</footer>
</ContextualHelp>
</li>
);
})}
</ul>
}
/>
</Form>
</section>
<section>
<Heading>Placements</Heading>
<ul
style={{ listStyle: 'none', marginLeft: '500px', marginTop: '200px' }}
>
{placements.map((placement, index) => {
return (
<li key={index} style={{ margin: '10px 0' }}>
<ContextualHelp placement={placement} variant="info">
<Heading level={3} weight="heavy">
Need help?
</Heading>
<Content>
<Text elementType="p" textSize="small">
If you're having issues accessing your account, contact our
customer support team for help.
</Text>
</Content>
<footer
css={css`
.ac-text {
text-decoration: underline;
color: ${theme.colors.arizeLightBlue};
}
`}
>
<Text textSize="small">Learn more about accounts</Text>
</footer>
</ContextualHelp>
</li>
);
})}
</ul>
</section>
</Provider>
);
Loading

0 comments on commit 238ee62

Please sign in to comment.