@transferwise/components 45.5.3 → 45.7.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.
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/public-resources/assets/flags/square/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
@@ -1 +1 @@
1
- import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
1
+ import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/web-art/assets/flags/jpy.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/web-art/assets/flags/hrk.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
@@ -1 +1,3 @@
1
- export var Typography=/*#__PURE__*/function(a){return a.DISPLAY_EXTRA_LARGE="display-extra-large",a.DISPLAY_LARGE="display-large",a.DISPLAY_MEDIUM="display-medium",a.DISPLAY_SMALL="display-small",a.TITLE_SCREEN="title-screen",a.TITLE_SECTION="title-section",a.TITLE_SUBSECTION="title-subsection",a.TITLE_BODY="title-body",a.TITLE_GROUP="title-group",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default",a}({});
1
+ export var Typography=/*#__PURE__*/function(a){return a.DISPLAY_EXTRA_LARGE="display-extra-large",a.DISPLAY_LARGE="display-large",a.DISPLAY_MEDIUM="display-medium",a.DISPLAY_SMALL="display-small",a.DISPLAY_NUMBER="display-number",a.TITLE_SCREEN="title-screen",a.TITLE_SECTION="title-section",a.TITLE_SUBSECTION="title-subsection",a.TITLE_BODY="title-body",a.TITLE_GROUP="title-group",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default",a}({});/**
2
+ * @deprecated use {@link Typography.DISPLAY_LARGE} instead
3
+ */
@@ -1,2 +1,2 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Display"};export var Basic=function(){var a="\xC4\xD6\xDC\u1E9EABCDEFGHIJKLMNOPQRSTUVWXYZ",b="\u0410\u0411\u0412\u0413\u0490\u0414\u0415\u0404\u0416\u0417\u0418\u0406\u0407\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042E\u042F",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
- return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Default case, example being \uD83C\uDDEF\uD83C\uDDF5"}),/*#__PURE__*/_jsx("h4",{children:"This is close to the right formatting but to get it perfect, change locale on the right to ja-JP"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{as:"h2",type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{as:"h3",type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{as:"h4",type:Typography.DISPLAY_SMALL,children:c})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"First fallback is \uD83C\uDDEC\uD83C\uDDE7"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Next fallback is many languages including \uD83C\uDDE9\uD83C\uDDEA (only change is line-height being increased)"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Final fallback are Greek and Cyrillic lanugages like \uD83C\uDDFA\uD83C\uDDE6"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]})]})};export var Numbers=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]})};
1
+ /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Display"};export var Basic=function(){var a="\xE4\xF6\xFC\xDFabcdefghijklmnopqrstuvwxyz",b="\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 \u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
+ return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"\uD83C\uDDEC\uD83C\uDDE7"}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Languages with special symbols, e.g \uD83C\uDDE9\uD83C\uDDEA"}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Greek + Cyrillic languages, e.g \uD83C\uDDFA\uD83C\uDDE6"}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Everything eles, e.g \uD83C\uDDEF\uD83C\uDDF5"}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:c})]})]})};export var Numbers=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]})};
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile,k=useTheme(),l=k.theme;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer","np-theme-".concat(l),c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile,k=useTheme(),l=k.theme;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer","np-theme-".concat(l),c),role:"dialog",children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
@@ -1,5 +1,5 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
- import{jsx as _jsx}from"react/jsx-runtime";/**
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import{useTheme}from"@wise/components-theming";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
+ import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";/**
3
3
  * Loader component
4
4
  *
5
5
  * Docs link: https://transferwise.github.io/neptune-web/components/progress/Loader
@@ -8,4 +8,4 @@ import{jsx as _jsx}from"react/jsx-runtime";/**
8
8
  * @param root0.small
9
9
  * @param root0.size
10
10
  * @param root0.classNames
11
- */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useState(f),k=_slicedToArray(j,2),l=k[0],m=k[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||m(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var n=function(a){return h[a]||a},o=void 0!==b&&b?Size.SMALL:d,p=getSupportedSize(o);return/*#__PURE__*/_jsx("div",{className:classnames(n("tw-loader"),n("tw-loader--".concat(p)),{"tw-loader--visible":l}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
11
+ */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useTheme(),k=j.isForestGreenTheme,l=useState(f),m=_slicedToArray(l,2),n=m[0],o=m[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||o(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var p=function(a){return h[a]||a},q=void 0!==b&&b?Size.SMALL:d,r=getSupportedSize(q);return k?(console.warn("Loader is forbidden to use with Forest Green theme. Check the https://wise.design/components/screen-loader for more info."),/*#__PURE__*/_jsx(_Fragment,{})):/*#__PURE__*/_jsx("div",{className:classnames(p("tw-loader"),p("tw-loader--".concat(r)),{"tw-loader--visible":n}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ALLOWED_PHONE_CHARS=/^$|^[\d-\s]+$/,PhoneNumberInput=function(a){var b=a.id,c=a.onChange,d=a.searchPlaceholder,e=a.disabled,f=a.required,g=a.size,h=a.placeholder,i=a.onFocus,j=a.onBlur,k=a.countryCode,l=a.selectProps,m=a.disabledCountries,n=useIntl(),o=n.locale,p=useState(function getInitialValue(){var b=a.initialValue,c=b?cleanNumber(b):null;return c&&isValidPhoneNumber(c)?explodeNumberModel(c):{prefix:setDefaultPrefix(o,k),suffix:""}}()),q=_slicedToArray(p,2),r=q[0],s=q[1],t=useState(null),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(""),y=_slicedToArray(x,2),z=y[0],A=y[1],B=excludeCountries(countries,m),C=groupCountriesByPrefix(sortArrayByProperty(B,"iso3")),D=groupCountriesByPrefix(sortArrayByProperty(B,"phone")),E=function getSelectOptions(){var a=filterOptionsForQuery(isStringNumeric(z)?D:C,z);return a.map(function(a){var b=a.phone,c=a.iso3,d=a.iso2,e="";return c?e=isArray(c)?c.join(", "):c:d&&(e=isArray(d)?d.join(", "):d),{value:b,label:b,note:e}})}();return useEffect(function(){if(null===v)return w(r);var a=r.prefix+r.suffix,b=v.prefix+v.suffix;if(a!==b){var d=isValidPhoneNumber(a)?cleanNumber(a):null;c(d),w(r)}},[c,v,r]),/*#__PURE__*/_jsxs("div",{className:"tw-telephone",children:[/*#__PURE__*/_jsx("div",{className:"tw-telephone__country-select",children:/*#__PURE__*/_jsx(Select,_objectSpread({id:b?"".concat(b,"-select"):void 0,options:E,selected:{value:r.prefix,label:r.prefix},placeholder:"Select an option...",searchPlaceholder:d,dropdownWidth:Size.SMALL,searchValue:z,required:f,disabled:e,size:g,onChange:function onPrefixChange(a){var b=a.value;A(""),s({prefix:b,suffix:r.suffix})},onSearchChange:function onSearchChange(a){return A(a)}},l))}),/*#__PURE__*/_jsx("div",{className:"tw-telephone__number-input",children:/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(g),children:/*#__PURE__*/_jsx("input",{id:b,name:"phoneNumber",inputMode:"numeric",value:r.suffix,className:"form-control",disabled:e,required:f,placeholder:h,onChange:function onSuffixChange(a){var b=a.target.value,c=void 0===b?"":b;ALLOWED_PHONE_CHARS.test(c)&&s({prefix:r.prefix,suffix:c})},onPaste:function onPaste(a){if(a.nativeEvent.clipboardData){var b=(a.nativeEvent.clipboardData.getData("text/plain")||"").replace(/(\s|-)+/g,""),c=explodeNumberModel(b),d=c.prefix,e=c.suffix,f=E.find(function(a){var b=a.value;return b===d});f&&ALLOWED_PHONE_CHARS.test(e)&&s({prefix:d,suffix:e})}},onFocus:i,onBlur:j})})})]})};PhoneNumberInput.propTypes={id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,initialValue:PropTypes.string,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,countryCode:PropTypes.string,searchPlaceholder:PropTypes.string,size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,selectProps:PropTypes.object,/** List of iso3 codes of countries to remove from the list */disabledCountries:PropTypes.arrayOf(PropTypes.string)},PhoneNumberInput.defaultProps={id:null,required:!1,disabled:!1,initialValue:null,onFocus:function onFocus(){},onBlur:function onBlur(){},countryCode:null,searchPlaceholder:"Prefix",size:Size.MEDIUM,placeholder:"",selectProps:{},disabledCountries:[]};export default PhoneNumberInput;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ALLOWED_PHONE_CHARS=/^$|^[\d-\s]+$/,PhoneNumberInput=function(a){var b=a.id,c=a.onChange,d=a.searchPlaceholder,e=a.disabled,f=a.required,g=a.size,h=a.placeholder,i=a.onFocus,j=a.onBlur,k=a.countryCode,l=a.selectProps,m=a.disabledCountries,n=useIntl(),o=n.locale,p=useState(function getInitialValue(){var b=a.initialValue,c=b?cleanNumber(b):null;return c&&isValidPhoneNumber(c)?explodeNumberModel(c):{prefix:setDefaultPrefix(o,k),suffix:""}}()),q=_slicedToArray(p,2),r=q[0],s=q[1],t=useState(null),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(""),y=_slicedToArray(x,2),z=y[0],A=y[1],B=excludeCountries(countries,m),C=groupCountriesByPrefix(sortArrayByProperty(B,"iso3")),D=groupCountriesByPrefix(sortArrayByProperty(B,"phone")),E=function getSelectOptions(){var a=filterOptionsForQuery(isStringNumeric(z)?D:C,z);return a.map(function(a){var b=a.phone,c=a.iso3,d=a.iso2,e="";return c?e=isArray(c)?c.join(", "):c:d&&(e=isArray(d)?d.join(", "):d),{value:b,label:b,note:e}})}();return useEffect(function(){if(null===v)return w(r);var a=r.prefix+r.suffix,b=v.prefix+v.suffix;if(a!==b){var d=isValidPhoneNumber(a)?cleanNumber(a):null;c(d,r.prefix),w(r)}},[c,v,r]),/*#__PURE__*/_jsxs("div",{className:"tw-telephone",children:[/*#__PURE__*/_jsx("div",{className:"tw-telephone__country-select",children:/*#__PURE__*/_jsx(Select,_objectSpread({id:b?"".concat(b,"-select"):void 0,options:E,selected:{value:r.prefix,label:r.prefix},placeholder:"Select an option...",searchPlaceholder:d,dropdownWidth:Size.SMALL,searchValue:z,required:f,disabled:e,size:g,onChange:function onPrefixChange(a){var b=a.value;A(""),s({prefix:b,suffix:r.suffix})},onSearchChange:function onSearchChange(a){return A(a)}},l))}),/*#__PURE__*/_jsx("div",{className:"tw-telephone__number-input",children:/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(g),children:/*#__PURE__*/_jsx("input",{id:b,name:"phoneNumber",inputMode:"numeric",value:r.suffix,className:"form-control",disabled:e,required:f,placeholder:h,onChange:function onSuffixChange(a){var b=a.target.value,c=void 0===b?"":b;ALLOWED_PHONE_CHARS.test(c)&&s({prefix:r.prefix,suffix:c})},onPaste:function onPaste(a){if(a.nativeEvent.clipboardData){var b=(a.nativeEvent.clipboardData.getData("text/plain")||"").replace(/(\s|-)+/g,""),c=explodeNumberModel(b),d=c.prefix,e=c.suffix,f=E.find(function(a){var b=a.value;return b===d});f&&ALLOWED_PHONE_CHARS.test(e)&&s({prefix:d,suffix:e})}},onFocus:i,onBlur:j})})})]})};PhoneNumberInput.propTypes={id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,initialValue:PropTypes.string,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,countryCode:PropTypes.string,searchPlaceholder:PropTypes.string,size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,selectProps:PropTypes.object,/** List of iso3 codes of countries to remove from the list */disabledCountries:PropTypes.arrayOf(PropTypes.string)},PhoneNumberInput.defaultProps={id:null,required:!1,disabled:!1,initialValue:null,onFocus:function onFocus(){},onBlur:function onBlur(){},countryCode:null,searchPlaceholder:"Prefix",size:Size.MEDIUM,placeholder:"",selectProps:{},disabledCountries:[]};export default PhoneNumberInput;
@@ -1 +1 @@
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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/public-resources/assets/flags/square/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
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*as wiseIcons from"@transferwise/icons";import{Size}from"../common";import{storyConfig}from"../test-utils";import Avatar,{AvatarType}from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Avatar,title:"Content/Avatar",tags:["autodocs"]};export var Emoji={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:"\u2708\uFE0F"}))},args:{type:AvatarType.EMOJI,size:Size.MEDIUM}};export var Flag={render:function render(a){return/*#__PURE__*/_jsx(Avatar,_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/gbp.svg",alt:""})}))},args:{type:AvatarType.THUMBNAIL,size:Size.MEDIUM,outlined:!0}};export var Table=storyConfig({render:function render(){var a="https://wise.com/web-art/assets/flags/gbp.svg",b="#d6f5e3",c="\u2708\uFE0F",d="GN",e=wiseIcons.Check;return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs("table",{children:["Outlined",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,outlined:!0,children:/*#__PURE__*/_jsx("img",{src:"https://wise.com/web-art/assets/flags/jpy.svg",alt:""})})})]}),"Image URL",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:a,alt:""})})})]}),"Emoji",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.EMOJI,children:c})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.EMOJI,children:c})})]}),/*#__PURE__*/_jsx("div",{style:{paddingBottom:"20px"},children:/*#__PURE__*/_jsx("span",{style:{position:"absolute"},children:"Custom background and icon"})}),/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.LARGE,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:24})})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:Size.SMALL,type:AvatarType.ICON,backgroundColor:b,children:/*#__PURE__*/_jsx(e,{size:16})})})]}),"Initials",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,children:d})})]}),"Branded",/*#__PURE__*/_jsxs("tr",{children:[/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:72,type:AvatarType.INITIALS,backgroundColorSeed:"1",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:56,type:AvatarType.INITIALS,backgroundColorSeed:"2",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:48,type:AvatarType.INITIALS,backgroundColorSeed:"3",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:40,type:AvatarType.INITIALS,backgroundColorSeed:"4",children:d})}),/*#__PURE__*/_jsx("td",{children:/*#__PURE__*/_jsx(Avatar,{size:24,type:AvatarType.INITIALS,backgroundColorSeed:"5",children:d})})]})]})})}},{variants:["default","dark","rtl"]});
@@ -1 +1 @@
1
- import"core-js/modules/es.object.keys.js";import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/public-resources/assets/flags/square/gbp.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
1
+ import"core-js/modules/es.object.keys.js";import{ProfileType,Sentiment}from"../common";import AvatarWrapper from"./AvatarWrapper";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:AvatarWrapper,title:"Content/AvatarWrapper",argTypes:{profileType:{type:{name:"enum",value:Object.keys(ProfileType)}},badgeStatusIcon:{type:{name:"enum",value:[Sentiment.POSITIVE,Sentiment.NEGATIVE,Sentiment.NEUTRAL,Sentiment.WARNING,Sentiment.PENDING]}}},tags:["autodocs"]};export var WithBadgeUrl={args:{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",avatarProps:{outlined:!0}}};export var WithBadgeStatus={args:{profileType:ProfileType.BUSINESS,badgeStatusIcon:Sentiment.PENDING,avatarProps:{outlined:!1}}};export var All={args:{avatarProps:{outlined:!0}},render:function render(a){var b=a.avatarProps;return/*#__PURE__*/_jsxs("div",{style:{maxWidth:"300px",display:"flex",justifyContent:"space-between"},children:[/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"No Badges"})})," ","Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{url:"https://wise.com/web-art/assets/flags/jpy.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{avatarProps:b})})]}),/*#__PURE__*/_jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx("b",{children:"Badges"})}),"Personal",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeUrl:"https://wise.com/public-resources/assets/brand/fast_flag_badge_personal.svg",badgeAltText:"wise fast flag badge",profileType:ProfileType.PERSONAL,avatarProps:b})}),"Business",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.POSITIVE,profileType:ProfileType.BUSINESS,avatarProps:b})}),"Avatar",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEGATIVE,url:"https://wise.com/web-art/assets/flags/hrk.svg",profileType:ProfileType.BUSINESS,avatarProps:b})}),"Initials",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.NEUTRAL,name:"A A",avatarProps:b})}),"Default",/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(AvatarWrapper,{badgeStatusIcon:Sentiment.PENDING,avatarProps:b})})]})]})}};
@@ -1 +1,3 @@
1
- export var Typography=/*#__PURE__*/function(a){return a.DISPLAY_EXTRA_LARGE="display-extra-large",a.DISPLAY_LARGE="display-large",a.DISPLAY_MEDIUM="display-medium",a.DISPLAY_SMALL="display-small",a.TITLE_SCREEN="title-screen",a.TITLE_SECTION="title-section",a.TITLE_SUBSECTION="title-subsection",a.TITLE_BODY="title-body",a.TITLE_GROUP="title-group",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default",a}({});
1
+ export var Typography=/*#__PURE__*/function(a){return a.DISPLAY_EXTRA_LARGE="display-extra-large",a.DISPLAY_LARGE="display-large",a.DISPLAY_MEDIUM="display-medium",a.DISPLAY_SMALL="display-small",a.DISPLAY_NUMBER="display-number",a.TITLE_SCREEN="title-screen",a.TITLE_SECTION="title-section",a.TITLE_SUBSECTION="title-subsection",a.TITLE_BODY="title-body",a.TITLE_GROUP="title-group",a.BODY_LARGE="body-large",a.BODY_DEFAULT="body-default",a.BODY_DEFAULT_BOLD="body-default-bold",a.BODY_LARGE_BOLD="body-large-bold",a.LINK_LARGE="link-large",a.LINK_DEFAULT="link-default",a}({});/**
2
+ * @deprecated use {@link Typography.DISPLAY_LARGE} instead
3
+ */
@@ -1,2 +1,2 @@
1
- /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Display"};export var Basic=function(){var a="\xC4\xD6\xDC\u1E9EABCDEFGHIJKLMNOPQRSTUVWXYZ",b="\u0410\u0411\u0412\u0413\u0490\u0414\u0415\u0404\u0416\u0417\u0418\u0406\u0407\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042E\u042F",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
- return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Default case, example being \uD83C\uDDEF\uD83C\uDDF5"}),/*#__PURE__*/_jsx("h4",{children:"This is close to the right formatting but to get it perfect, change locale on the right to ja-JP"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{as:"h2",type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{as:"h3",type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{as:"h4",type:Typography.DISPLAY_SMALL,children:c})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"First fallback is \uD83C\uDDEC\uD83C\uDDE7"}),"Extra Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Next fallback is many languages including \uD83C\uDDE9\uD83C\uDDEA (only change is line-height being increased)"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Final fallback are Greek and Cyrillic lanugages like \uD83C\uDDFA\uD83C\uDDE6"}),"Extra Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_EXTRA_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]})]})};export var Numbers=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx("div",{className:"np-text-display-number",children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]})};
1
+ /* eslint-disable jsx-a11y/accessible-emoji */import{Typography}from"../common";import Money from"../money/Money";import Title from"../title/Title";import Display from"./Display";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{title:"Typography/Display"};export var Basic=function(){var a="\xE4\xF6\xFC\xDFabcdefghijklmnopqrstuvwxyz",b="\u041C\u0438 \u0431\u0443\u0434\u0443\u0454\u043C\u043E \u043D\u0430\u0439\u0431\u0456\u043B\u044C\u0448 \u043C\u0456\u0436\u043D\u0430\u0440\u043E\u0434\u043D\u0438\u0439 \u0440\u0430\u0445\u0443\u043D\u043E\u043A \u0443 \u0441\u0432\u0456\u0442\u0456",c="\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B\u305C\u305D\u305E\u305F\u3060\u3061\u3062\u3063\u3064\u3065\u3066\u3067";// Made for hyphenation testing
2
+ return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("div",{lang:"en",children:[/*#__PURE__*/_jsx("h1",{children:"\uD83C\uDDEC\uD83C\uDDE7"}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:"compounding without subscription compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:"compounding without subscription compounding without subscription"}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:"compounding without subscription compounding without subscription"})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"de",children:[/*#__PURE__*/_jsx("h1",{children:"Languages with special symbols, e.g \uD83C\uDDE9\uD83C\uDDEA"}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[a,/*#__PURE__*/_jsx("br",{}),a]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[a,/*#__PURE__*/_jsx("br",{}),a]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"uk",children:[/*#__PURE__*/_jsx("h1",{children:"Greek + Cyrillic languages, e.g \uD83C\uDDFA\uD83C\uDDE6"}),"Large",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_LARGE,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_MEDIUM,children:[b,/*#__PURE__*/_jsx("br",{}),b]}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsxs(Display,{type:Typography.DISPLAY_SMALL,children:[b,/*#__PURE__*/_jsx("br",{}),b]})]}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{lang:"ja",children:[/*#__PURE__*/_jsx("h1",{children:"Everything eles, e.g \uD83C\uDDEF\uD83C\uDDF5"}),"Large",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_LARGE,children:c}),/*#__PURE__*/_jsx("hr",{}),"Medium",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_MEDIUM,children:c}),/*#__PURE__*/_jsx("hr",{}),"Small",/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_SMALL,children:c})]})]})};export var Numbers=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SCREEN,children:"Display Number"}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1050.6,currency:"UAH"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:10.17,currency:"JPY"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:.01,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"EUR"})}),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsx(Display,{type:Typography.DISPLAY_NUMBER,children:/*#__PURE__*/_jsx(Money,{amount:1e6,currency:"GBP"})})]})};
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile,k=useTheme(),l=k.theme;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer","np-theme-".concat(l),c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import{Position,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile,k=useTheme(),l=k.theme;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer","np-theme-".concat(l),c),role:"dialog",children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[e&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,children:e}),/*#__PURE__*/_jsx(CloseButton,{onClick:f})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
@@ -1,5 +1,5 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import"core-js/modules/es.string.small.js";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
- import{jsx as _jsx}from"react/jsx-runtime";/**
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import"core-js/modules/es.string.small.js";import{useTheme}from"@wise/components-theming";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
+ import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";/**
3
3
  * Loader component
4
4
  *
5
5
  * Docs link: https://transferwise.github.io/neptune-web/components/progress/Loader
@@ -8,4 +8,4 @@ import{jsx as _jsx}from"react/jsx-runtime";/**
8
8
  * @param root0.small
9
9
  * @param root0.size
10
10
  * @param root0.classNames
11
- */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useState(f),k=_slicedToArray(j,2),l=k[0],m=k[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||m(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var n=function(a){return h[a]||a},o=void 0!==b&&b?Size.SMALL:d,p=getSupportedSize(o);return/*#__PURE__*/_jsx("div",{className:classnames(n("tw-loader"),n("tw-loader--".concat(p)),{"tw-loader--visible":l}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
11
+ */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useTheme(),k=j.isForestGreenTheme,l=useState(f),m=_slicedToArray(l,2),n=m[0],o=m[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||o(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var p=function(a){return h[a]||a},q=void 0!==b&&b?Size.SMALL:d,r=getSupportedSize(q);return k?(console.warn("Loader is forbidden to use with Forest Green theme. Check the https://wise.design/components/screen-loader for more info."),/*#__PURE__*/_jsx(_Fragment,{})):/*#__PURE__*/_jsx("div",{className:classnames(p("tw-loader"),p("tw-loader--".concat(r)),{"tw-loader--visible":n}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.object.to-string.js";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.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";import{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ALLOWED_PHONE_CHARS=/^$|^[\d-\s]+$/,PhoneNumberInput=function(a){var b=a.id,c=a.onChange,d=a.searchPlaceholder,e=a.disabled,f=a.required,g=a.size,h=a.placeholder,i=a.onFocus,j=a.onBlur,k=a.countryCode,l=a.selectProps,m=a.disabledCountries,n=useIntl(),o=n.locale,p=useState(function getInitialValue(){var b=a.initialValue,c=b?cleanNumber(b):null;return c&&isValidPhoneNumber(c)?explodeNumberModel(c):{prefix:setDefaultPrefix(o,k),suffix:""}}()),q=_slicedToArray(p,2),r=q[0],s=q[1],t=useState(null),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(""),y=_slicedToArray(x,2),z=y[0],A=y[1],B=excludeCountries(countries,m),C=groupCountriesByPrefix(sortArrayByProperty(B,"iso3")),D=groupCountriesByPrefix(sortArrayByProperty(B,"phone")),E=function getSelectOptions(){var a=filterOptionsForQuery(isStringNumeric(z)?D:C,z);return a.map(function(a){var b=a.phone,c=a.iso3,d=a.iso2,e="";return c?e=isArray(c)?c.join(", "):c:d&&(e=isArray(d)?d.join(", "):d),{value:b,label:b,note:e}})}();return useEffect(function(){if(null===v)return w(r);var a=r.prefix+r.suffix,b=v.prefix+v.suffix;if(a!==b){var d=isValidPhoneNumber(a)?cleanNumber(a):null;c(d),w(r)}},[c,v,r]),/*#__PURE__*/_jsxs("div",{className:"tw-telephone",children:[/*#__PURE__*/_jsx("div",{className:"tw-telephone__country-select",children:/*#__PURE__*/_jsx(Select,_objectSpread({id:b?"".concat(b,"-select"):void 0,options:E,selected:{value:r.prefix,label:r.prefix},placeholder:"Select an option...",searchPlaceholder:d,dropdownWidth:Size.SMALL,searchValue:z,required:f,disabled:e,size:g,onChange:function onPrefixChange(a){var b=a.value;A(""),s({prefix:b,suffix:r.suffix})},onSearchChange:function onSearchChange(a){return A(a)}},l))}),/*#__PURE__*/_jsx("div",{className:"tw-telephone__number-input",children:/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(g),children:/*#__PURE__*/_jsx("input",{id:b,name:"phoneNumber",inputMode:"numeric",value:r.suffix,className:"form-control",disabled:e,required:f,placeholder:h,onChange:function onSuffixChange(a){var b=a.target.value,c=void 0===b?"":b;ALLOWED_PHONE_CHARS.test(c)&&s({prefix:r.prefix,suffix:c})},onPaste:function onPaste(a){if(a.nativeEvent.clipboardData){var b=(a.nativeEvent.clipboardData.getData("text/plain")||"").replace(/(\s|-)+/g,""),c=explodeNumberModel(b),d=c.prefix,e=c.suffix,f=E.find(function(a){var b=a.value;return b===d});f&&ALLOWED_PHONE_CHARS.test(e)&&s({prefix:d,suffix:e})}},onFocus:i,onBlur:j})})})]})};PhoneNumberInput.propTypes={id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,initialValue:PropTypes.string,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,countryCode:PropTypes.string,searchPlaceholder:PropTypes.string,size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,selectProps:PropTypes.object,/** List of iso3 codes of countries to remove from the list */disabledCountries:PropTypes.arrayOf(PropTypes.string)},PhoneNumberInput.defaultProps={id:null,required:!1,disabled:!1,initialValue:null,onFocus:function onFocus(){},onBlur:function onBlur(){},countryCode:null,searchPlaceholder:"Prefix",size:Size.MEDIUM,placeholder:"",selectProps:{},disabledCountries:[]};export default PhoneNumberInput;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.object.to-string.js";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.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";import{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ALLOWED_PHONE_CHARS=/^$|^[\d-\s]+$/,PhoneNumberInput=function(a){var b=a.id,c=a.onChange,d=a.searchPlaceholder,e=a.disabled,f=a.required,g=a.size,h=a.placeholder,i=a.onFocus,j=a.onBlur,k=a.countryCode,l=a.selectProps,m=a.disabledCountries,n=useIntl(),o=n.locale,p=useState(function getInitialValue(){var b=a.initialValue,c=b?cleanNumber(b):null;return c&&isValidPhoneNumber(c)?explodeNumberModel(c):{prefix:setDefaultPrefix(o,k),suffix:""}}()),q=_slicedToArray(p,2),r=q[0],s=q[1],t=useState(null),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(""),y=_slicedToArray(x,2),z=y[0],A=y[1],B=excludeCountries(countries,m),C=groupCountriesByPrefix(sortArrayByProperty(B,"iso3")),D=groupCountriesByPrefix(sortArrayByProperty(B,"phone")),E=function getSelectOptions(){var a=filterOptionsForQuery(isStringNumeric(z)?D:C,z);return a.map(function(a){var b=a.phone,c=a.iso3,d=a.iso2,e="";return c?e=isArray(c)?c.join(", "):c:d&&(e=isArray(d)?d.join(", "):d),{value:b,label:b,note:e}})}();return useEffect(function(){if(null===v)return w(r);var a=r.prefix+r.suffix,b=v.prefix+v.suffix;if(a!==b){var d=isValidPhoneNumber(a)?cleanNumber(a):null;c(d,r.prefix),w(r)}},[c,v,r]),/*#__PURE__*/_jsxs("div",{className:"tw-telephone",children:[/*#__PURE__*/_jsx("div",{className:"tw-telephone__country-select",children:/*#__PURE__*/_jsx(Select,_objectSpread({id:b?"".concat(b,"-select"):void 0,options:E,selected:{value:r.prefix,label:r.prefix},placeholder:"Select an option...",searchPlaceholder:d,dropdownWidth:Size.SMALL,searchValue:z,required:f,disabled:e,size:g,onChange:function onPrefixChange(a){var b=a.value;A(""),s({prefix:b,suffix:r.suffix})},onSearchChange:function onSearchChange(a){return A(a)}},l))}),/*#__PURE__*/_jsx("div",{className:"tw-telephone__number-input",children:/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(g),children:/*#__PURE__*/_jsx("input",{id:b,name:"phoneNumber",inputMode:"numeric",value:r.suffix,className:"form-control",disabled:e,required:f,placeholder:h,onChange:function onSuffixChange(a){var b=a.target.value,c=void 0===b?"":b;ALLOWED_PHONE_CHARS.test(c)&&s({prefix:r.prefix,suffix:c})},onPaste:function onPaste(a){if(a.nativeEvent.clipboardData){var b=(a.nativeEvent.clipboardData.getData("text/plain")||"").replace(/(\s|-)+/g,""),c=explodeNumberModel(b),d=c.prefix,e=c.suffix,f=E.find(function(a){var b=a.value;return b===d});f&&ALLOWED_PHONE_CHARS.test(e)&&s({prefix:d,suffix:e})}},onFocus:i,onBlur:j})})})]})};PhoneNumberInput.propTypes={id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,initialValue:PropTypes.string,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,countryCode:PropTypes.string,searchPlaceholder:PropTypes.string,size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,selectProps:PropTypes.object,/** List of iso3 codes of countries to remove from the list */disabledCountries:PropTypes.arrayOf(PropTypes.string)},PhoneNumberInput.defaultProps={id:null,required:!1,disabled:!1,initialValue:null,onFocus:function onFocus(){},onBlur:function onBlur(){},countryCode:null,searchPlaceholder:"Prefix",size:Size.MEDIUM,placeholder:"",selectProps:{},disabledCountries:[]};export default PhoneNumberInput;