Skip to content

Commit

Permalink
Merge branch 'master' of github.com:carbon-design-system/carbon into …
Browse files Browse the repository at this point in the history
…feat/add-react-hooks-package
  • Loading branch information
joshblack committed Sep 4, 2019
2 parents 1d3e098 + 548a041 commit 6c0f2f2
Show file tree
Hide file tree
Showing 31 changed files with 110 additions and 360 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-addons-5.1.9.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-api-5.1.9.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-channels-5.1.9.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-client-api-5.1.9.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-core-5.1.9.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-react-5.1.9.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-router-5.1.9.tgz
Binary file not shown.
Binary file removed .yarn/offline-mirror/@storybook-ui-5.1.9.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/marked-0.7.0.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/react-is-16.9.0.tgz
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/offline-mirror/storybook-readme-5.0.5.tgz
Binary file not shown.
Binary file added .yarn/offline-mirror/storybook-readme-5.0.8.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@
"postcss-loader": "^2.1.0",
"promise": "^8.0.1",
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react": "^16.8.6",
"react-copy-to-clipboard": "^5.0.0",
"react-dom": "^16.2.0",
"react-dom": "^16.8.6",
"react-ga": "^2.4.0",
"rollup": "^1.0.0",
"rollup-plugin-babel": "^4.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
},
},
{
name: 'low-contrast',
name: 'inline-low-contrast',
label: 'Inline Notification (Low contrast)',
context: {
variant: 'inline',
Expand All @@ -75,7 +75,7 @@ module.exports = {
},
},
{
name: 'low-contrast',
name: 'toast-low-contrast',
label: 'Toast Notification (Low contrast)',
notes: `
Toast notifications are typically passive, meaning they won't affect the user's workflow if not addressed.
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/globals/scss/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
padding: if(
$tooltip-type == 'definition',
rem(8px) rem(16px),
rem(2px) rem(16px)
rem(3px) rem(16px)
);
border-radius: rem(2px);
color: $inverse-01;
Expand Down
18 changes: 9 additions & 9 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@
"@babel/plugin-transform-object-assign": "^7.2.0",
"@babel/preset-env": "^7.4.3",
"@babel/preset-react": "^7.0.0",
"@storybook/addon-a11y": "^5.1.3",
"@storybook/addon-actions": "^5.1.3",
"@storybook/addon-info": "^5.1.3",
"@storybook/addon-knobs": "^5.1.3",
"@storybook/addon-links": "^5.1.3",
"@storybook/addon-storysource": "^5.1.3",
"@storybook/addons": "^5.1.3",
"@storybook/react": "^5.1.3",
"@storybook/addon-a11y": "^5.1.11",
"@storybook/addon-actions": "^5.1.11",
"@storybook/addon-info": "^5.1.11",
"@storybook/addon-knobs": "^5.1.11",
"@storybook/addon-links": "^5.1.11",
"@storybook/addon-storysource": "^5.1.11",
"@storybook/addons": "^5.1.11",
"@storybook/react": "^5.1.11",
"all-contributors-cli": "^5.2.1",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^23.6.0",
Expand Down Expand Up @@ -110,7 +110,7 @@
"rollup-plugin-terser": "^4.0.0",
"rtlcss": "^2.4.0",
"sass-loader": "^7.1.0",
"storybook-readme": "^5.0.3",
"storybook-readme": "^5.0.8",
"string-replace-loader": "^2.1.0",
"terser-webpack-plugin": "^1.1.0",
"webpack": "^4.25.1",
Expand Down
30 changes: 13 additions & 17 deletions packages/react/src/components/TooltipIcon/TooltipIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,30 @@ import cx from 'classnames';
import React from 'react';
import PropTypes from 'prop-types';
import { settings } from 'carbon-components';
import setupGetInstanceId from '../../tools/setupGetInstanceId';

const { prefix } = settings;
const getInstanceId = setupGetInstanceId();
const TooltipIcon = ({
id,
className,
children,
direction,
align,
tooltipText,
...rest
}) => {
const tooltipId = id || `definition-tooltip-${getInstanceId()}`;
const tooltipClassName = cx(`${prefix}--tooltip--icon`, className);
const tooltipTriggerClasses = cx(`${prefix}--tooltip__trigger`, {
[`${prefix}--tooltip--${direction}`]: direction,
[`${prefix}--tooltip--align-${align}`]: align,
});
const tooltipTriggerClasses = cx(
`${prefix}--tooltip__trigger`,
`${prefix}--tooltip--a11y`,
{
[`${prefix}--tooltip--${direction}`]: direction,
[`${prefix}--tooltip--align-${align}`]: align,
className,
}
);
return (
<div {...rest} className={tooltipClassName}>
<button
className={tooltipTriggerClasses}
aria-describedby={tooltipId}
aria-label={tooltipText}>
{children}
</button>
</div>
<button {...rest} className={tooltipTriggerClasses}>
<span className={`${prefix}--assistive-text`}>{tooltipText}</span>
{children}
</button>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@ exports[`TooltipIcon should allow the user to specify the direction 1`] = `
direction="top"
tooltipText="tooltip text"
>
<div
className="bx--tooltip--icon custom-class"
<button
className="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--top bx--tooltip--align-center className"
>
<button
aria-describedby="definition-tooltip-2"
aria-label="tooltip text"
className="bx--tooltip__trigger bx--tooltip--top bx--tooltip--align-center"
<span
className="bx--assistive-text"
>
<svg />
</button>
</div>
tooltip text
</span>
<svg />
</button>
</TooltipIcon>
`;

Expand All @@ -28,16 +27,15 @@ exports[`TooltipIcon should render 1`] = `
direction="bottom"
tooltipText="tooltip text"
>
<div
className="bx--tooltip--icon custom-class"
<button
className="bx--tooltip__trigger bx--tooltip--a11y bx--tooltip--bottom bx--tooltip--align-center className"
>
<button
aria-describedby="definition-tooltip-1"
aria-label="tooltip text"
className="bx--tooltip__trigger bx--tooltip--bottom bx--tooltip--align-center"
<span
className="bx--assistive-text"
>
<svg />
</button>
</div>
tooltip text
</span>
<svg />
</button>
</TooltipIcon>
`;
Loading

0 comments on commit 6c0f2f2

Please sign in to comment.