@transferwise/components 45.3.0 → 45.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/es/no-polyfill/accordion/Accordion.story.js +1 -0
- package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/no-polyfill/button/Button.story.js +1 -0
- package/build/es/no-polyfill/checkbox/Checkbox.story.js +1 -0
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -0
- package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/no-polyfill/common/hooks/index.js +1 -1
- package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +1 -1
- package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -0
- package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/no-polyfill/decision/Decision.js +2 -2
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/no-polyfill/index.js +1 -1
- package/build/es/no-polyfill/info/Info.story.js +1 -0
- package/build/es/no-polyfill/modal/Modal.story.js +2 -1
- package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +8 -0
- package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/index.js +1 -0
- package/build/es/no-polyfill/phoneNumberInput/utils/index.js +1 -1
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/polyfill/accordion/Accordion.story.js +1 -0
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/polyfill/button/Button.story.js +1 -0
- package/build/es/polyfill/checkbox/Checkbox.story.js +1 -0
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -0
- package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/polyfill/common/hooks/index.js +1 -1
- package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +1 -1
- package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/polyfill/dateInput/DateInput.story.js +1 -0
- package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/polyfill/decision/Decision.js +2 -2
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/polyfill/index.js +1 -1
- package/build/es/polyfill/info/Info.story.js +1 -0
- package/build/es/polyfill/modal/Modal.story.js +2 -1
- package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +8 -0
- package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/index.js +1 -0
- package/build/es/polyfill/phoneNumberInput/utils/index.js +1 -1
- package/build/es/polyfill/select/option/Option.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/main.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/popover/Popover.css +1 -1
- package/build/styles/select/Select.css +1 -1
- package/build/styles/snackbar/Snackbar.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/types/accordion/Accordion.story.d.ts +46 -0
- package/build/types/actionButton/ActionButton.d.ts +3 -0
- package/build/types/actionButton/ActionButton.story.d.ts +1 -1
- package/build/types/avatar/Avatar.story.d.ts +3 -1
- package/build/types/button/Button.story.d.ts +4586 -0
- package/build/types/checkbox/Checkbox.story.d.ts +54 -0
- package/build/types/circularButton/CircularButton.d.ts +1 -1
- package/build/types/common/bottomSheet/BottomSheet.story.d.ts +29 -0
- package/build/types/common/flowHeader/FlowHeader.d.ts +10 -1
- package/build/types/common/hooks/index.d.ts +1 -1
- package/build/types/common/hooks/useClientWidth/useClientWidth.d.ts +9 -8
- package/build/types/dateInput/DateInput.story.d.ts +71 -0
- package/build/types/decision/Decision.d.ts +1 -1
- package/build/types/definitionList/DefinitionList.d.ts +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts +16 -34
- package/build/types/index.d.ts +2 -2
- package/build/types/info/Info.story.d.ts +39 -0
- package/build/types/listItem/ListItem.d.ts +1 -1
- package/build/types/listItem/ListItem.story.d.ts +1 -1
- package/build/types/modal/Modal.story.d.ts +20 -3
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +4 -0
- package/build/types/phoneNumberInput/utils/excludeCountries/excludeCountries.d.ts +1 -0
- package/build/types/phoneNumberInput/utils/excludeCountries/index.d.ts +1 -0
- package/build/types/phoneNumberInput/utils/index.d.ts +1 -0
- package/build/types/snackbar/Snackbar.d.ts +1 -1
- package/build/types/stepper/Stepper.d.ts +13 -18
- package/build/types/test-utils/VariantDecorator.d.ts +18 -0
- package/build/types/test-utils/story-config.d.ts +18 -50
- package/build/types/tooltip/Tooltip.story.d.ts +17 -9
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +7 -13
- package/scripts/generate-type-declarations.js +0 -2
- package/build/es/no-polyfill/common/flowHeader/index.js +0 -1
- package/build/es/no-polyfill/common/hooks/useClientWidth/index.js +0 -1
- package/build/es/no-polyfill/flowNavigation/index.js +0 -1
- package/build/es/no-polyfill/stepper/index.js +0 -1
- package/build/es/polyfill/common/flowHeader/index.js +0 -1
- package/build/es/polyfill/common/hooks/useClientWidth/index.js +0 -1
- package/build/es/polyfill/flowNavigation/index.js +0 -1
- package/build/es/polyfill/stepper/index.js +0 -1
- package/build/types/common/flowHeader/index.d.ts +0 -1
- package/build/types/common/hooks/useClientWidth/index.d.ts +0 -1
- package/build/types/flowNavigation/index.d.ts +0 -1
- package/build/types/stepper/index.d.ts +0 -2
- package/build/types/test-utils/GlobalsDecorator.d.ts +0 -4
- package/scripts/neptune-upgrader.js +0 -114
- package/upgrades/2021-02-v34-35.js +0 -193
- package/upgrades/2021-04-v35-36-typescript-support.js +0 -290
- package/upgrades/utils/index.js +0 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{Component,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var CSS_TRANSITION_DURATION=400;export var Snackbar=/*#__PURE__*/function(a){/** @type {RefObject<HTMLSpanElement>} */function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"bodyRef",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(a),"setLeaveTimeout",function(){var b=a.props.timeout;a.timeout=setTimeout(function(){a.setState({visible:!1})},b)}),a.state={visible:!1,text:""},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}},{key:"componentDidUpdate",value:function componentDidUpdate(a){var b=this,c=this.props,d=c.action,e=c.text,f=c.theme,g=c.timestamp;a.text?a.timestamp!==g&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},function(){b.transitionTimeout=setTimeout(function(){b.setState({visible:!0,action:d,text:e,theme:f}),b.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:d,text:e,theme:f}),this.setLeaveTimeout())):this.setState({visible:!0,action:d,text:e,theme:f},function(){b.setLeaveTimeout()})}},{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.visible,f=this.props.timeout;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:e,classNames:"snackbar__text-container",timeout:{appear:0,enter:f,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:"snackbar__text snackbar__text--".concat(d),children:[c,b?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:b.onClick,children:b.label}):null]})})})}}]),b}(Component);Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func
|
|
1
|
+
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{Component,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var CSS_TRANSITION_DURATION=400;export var Snackbar=/*#__PURE__*/function(a){/** @type {RefObject<HTMLSpanElement>} */function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"bodyRef",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(a),"setLeaveTimeout",function(){var b=a.props.timeout;a.timeout=setTimeout(function(){a.setState({visible:!1})},b)}),a.state={visible:!1,text:""},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}},{key:"componentDidUpdate",value:function componentDidUpdate(a){var b=this,c=this.props,d=c.action,e=c.text,f=c.theme,g=c.timestamp;a.text?a.timestamp!==g&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},function(){b.transitionTimeout=setTimeout(function(){b.setState({visible:!0,action:d,text:e,theme:f}),b.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:d,text:e,theme:f}),this.setLeaveTimeout())):this.setState({visible:!0,action:d,text:e,theme:f},function(){b.setLeaveTimeout()})}},{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.visible,f=this.props.timeout;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:e,classNames:"snackbar__text-container",timeout:{appear:0,enter:f,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:"snackbar__text snackbar__text--".concat(d),children:[c,b?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:b.onClick,children:b.label}):null]})})})}}]),b}(Component);Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func}),text:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"]),timeout:PropTypes.number.isRequired,timestamp:PropTypes.number.isRequired},Snackbar.defaultProps={action:null,theme:Theme.LIGHT};export default withNextPortal(Snackbar);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"core-js/modules/es.array.map.js";import classNames from"classnames";import
|
|
1
|
+
import"core-js/modules/es.array.map.js";import classNames from"classnames";import*as React from"react";import Body from"../body/Body";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=void 0===c?0:c,e=a.className,f=useDirection(),g=f.isRTL;if(0===b.length)return null;var h=clamp(0,b.length-1,d),i=1/(b.length-1),j=h/(b.length-1);return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",e),children:[/*#__PURE__*/_jsx("div",{className:"progress",children:/*#__PURE__*/_jsx("div",{className:"progress-bar",style:{width:"".concat(100*j,"%")}})}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===h,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){var b;return d&&(null===(b=a.onClick)||void 0===b?void 0:b.call(a))},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx(Body,{as:"span",className:"tw-stepper__step-label small",children:a.label});return/*#__PURE__*/_jsx("li",{className:classNames("hidden-xs","tw-stepper__step",c&&"tw-stepper__step--active",d&&"tw-stepper__step--clickable",a.hoverLabel&&"tw-stepper__step--has-tooltip"),style:g?{right:"".concat(100*(b*i),"%")}:{left:"".concat(100*(b*i),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Size,Key,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Tile=function(a){var b=a.className,c=a.description,d=a.disabled,e=a.href,f=a.target,g=a.media,h=a.onClick,i=a.size,j=a.title,k=i===Size.SMALL,l=useTheme(),m=l.isModern,n=e?"a":"button";return/*#__PURE__*/_jsxs(n,{className:classNames("decision","flex-column","np-tile","text-no-decoration","text-xs-center",b,{"p-a-3":!k&&m,"p-y-5 p-x-4":!k&&!m,"p-a-2":k,"np-tile--small":k,disabled:d}),href:e,target:f,"aria-label":j,onClick:d?null:h,onKeyDown:d?null:function(a){var b=a.key;(b===Key.ENTER||Key.SPACE.includes(b))&&h()},children:[/*#__PURE__*/_jsx("div",{className:"np-tile__media d-flex justify-content-center",children:g}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,className:classNames(k?"m-t-1":"m-t-2"),children:j}),m&&c&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"m-t-1",children:c}),!m&&c&&/*#__PURE__*/_jsx("div",{className:"np-tile__description",children:c})]})};Tile.propTypes={/** Classes to apply to the Tile container */className:PropTypes.string,description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string.isRequired,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),/** Accepts only Avatar and images */media:PropTypes.node.isRequired,/** Function called onClick or onKeyDown */onClick:PropTypes.func
|
|
1
|
+
import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Size,Key,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Tile=function(a){var b=a.className,c=a.description,d=a.disabled,e=a.href,f=a.target,g=a.media,h=a.onClick,i=a.size,j=a.title,k=i===Size.SMALL,l=useTheme(),m=l.isModern,n=e?"a":"button";return/*#__PURE__*/_jsxs(n,{className:classNames("decision","flex-column","np-tile","text-no-decoration","text-xs-center",b,{"p-a-3":!k&&m,"p-y-5 p-x-4":!k&&!m,"p-a-2":k,"np-tile--small":k,disabled:d}),href:e,target:f,"aria-label":j,onClick:d?null:h,onKeyDown:d?null:function(a){var b=a.key;(b===Key.ENTER||Key.SPACE.includes(b))&&h()},children:[/*#__PURE__*/_jsx("div",{className:"np-tile__media d-flex justify-content-center",children:g}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,className:classNames(k?"m-t-1":"m-t-2"),children:j}),m&&c&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"m-t-1",children:c}),!m&&c&&/*#__PURE__*/_jsx("div",{className:"np-tile__description",children:c})]})};Tile.propTypes={/** Classes to apply to the Tile container */className:PropTypes.string,description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string.isRequired,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),/** Accepts only Avatar and images */media:PropTypes.node.isRequired,/** Function called onClick or onKeyDown */onClick:PropTypes.func,/** The size applied to Tile */size:PropTypes.oneOf(["sm","md"]),title:PropTypes.node.isRequired},Tile.defaultProps={className:"",description:null,disabled:!1,size:Size.MEDIUM,target:void 0};export default Tile;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{userEvent,within}from"@storybook/testing-library";import Button from"../button";import{storyConfig}from"../test-utils";import Tooltip from"./Tooltip";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Tooltip,title:"Dialogs/Tooltip",args:{label:"This is the content",position:"bottom"},render:function render(a){return/*#__PURE__*/_jsx("div",{className:"text-xs-center",style:{flexBasis:"150px"},children:/*#__PURE__*/_jsx(Tooltip,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx(Button,{children:"Hover me"})}))})},tags:["autodocs"]};export var Basic={};export var OpenedTooltip={parameters:{chromatic:{delay:1e3}},play:function play(a){var b=a.canvasElement,c=within(b);userEvent.hover(c.getByRole("button"))}};export var OpenedTooltipDark=storyConfig(OpenedTooltip,{variants:["dark"]});
|