-
Notifications
You must be signed in to change notification settings - Fork 0
/
components-avatar-avatar-web-stories.5d0d5d20.iframe.bundle.js
1 lines (1 loc) · 12.5 KB
/
components-avatar-avatar-web-stories.5d0d5d20.iframe.bundle.js
1
"use strict";(self.webpackChunk_leather_io_ui=self.webpackChunk_leather_io_ui||[]).push([[2766],{"./src/components/avatar/avatar.web.stories.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Avatar:()=>Avatar,Thumbnail:()=>Thumbnail,WithDefaultIcon:()=>WithDefaultIcon,WithSmallIcon:()=>WithSmallIcon,WithSvg:()=>WithSvg,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js"),_icons_placeholder_icon_web__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./src/icons/placeholder-icon.web.tsx"),_avatar_web__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./src/components/avatar/avatar.web.tsx");const __WEBPACK_DEFAULT_EXPORT__={component:_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Root,tags:["autodocs"],title:"Avatar",argTypes:{size:{options:["sm","md","lg","xl","xxl"],control:{type:"radio"},defaultValue:"lg"}}},Avatar={parameters:{controls:{include:["size"]}},args:{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Image,{alt:"ST",src:""}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Fallback,{children:"ST"})]}),size:"lg",variant:"circle"}},Thumbnail={parameters:{controls:{include:["size"]}},args:{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Fallback,{children:"B"})}),size:"lg",variant:"square"}},WithSvg={parameters:{controls:{include:["size"]}},args:{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Svg,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect",{width:"100%",height:"100%",rx:"16",fill:"#F59300"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path",{d:"M21.966 13.8343C22.2365 12.048 20.8598 11.0878 18.9774 10.4472L19.588 8.02739L18.0971 7.66032L17.5026 10.0163C17.1107 9.91982 16.7081 9.82879 16.3081 9.7386L16.9068 7.36708L15.4168 7L14.8057 9.41892C14.4813 9.34592 14.1628 9.27378 13.8537 9.19784L13.8554 9.19029L11.7992 8.68309L11.4026 10.2563C11.4026 10.2563 12.5088 10.5067 12.4855 10.5222C13.0893 10.6712 13.1984 11.0659 13.1802 11.3789L12.4846 14.1355C12.5262 14.146 12.5802 14.1611 12.6396 14.1846C12.5899 14.1724 12.5369 14.159 12.4821 14.146L11.5071 18.0077C11.4332 18.1889 11.2459 18.4607 10.8238 18.3575C10.8387 18.3789 9.74016 18.0903 9.74016 18.0903L9 19.7763L10.9402 20.2541C11.3011 20.3435 11.6549 20.4371 12.0031 20.5252L11.3861 22.9726L12.8753 23.3397L13.4863 20.9182C13.8932 21.0273 14.2881 21.128 14.6745 21.2228L14.0656 23.6329L15.5565 24L16.1735 21.5572C18.7158 22.0325 20.6276 21.8408 21.4323 19.5691C22.0807 17.74 21.4 16.6849 20.0624 15.9969C21.0365 15.775 21.7703 15.1419 21.966 13.8343ZM18.5595 18.5534C18.0988 20.3825 14.9815 19.3937 13.9709 19.1458L14.7896 15.9034C15.8002 16.1525 19.0411 16.6459 18.5595 18.5534ZM19.0207 13.8079C18.6003 15.4717 16.0057 14.6264 15.1641 14.4191L15.9064 11.4783C16.748 11.6856 19.4585 12.0724 19.0207 13.8079Z",fill:"white"})]}),size:"lg",variant:"circle"}},WithDefaultIcon={parameters:{controls:{include:[]}},args:{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Icon,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons_placeholder_icon_web__WEBPACK_IMPORTED_MODULE_1__.X,{})}),size:"lg",variant:"circle"}},WithSmallIcon={parameters:{controls:{include:[]}},args:{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_avatar_web__WEBPACK_IMPORTED_MODULE_2__.eu.Icon,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_icons_placeholder_icon_web__WEBPACK_IMPORTED_MODULE_1__.X,{variant:"small"})}),size:"md",variant:"circle"}},__namedExportsOrder=["Avatar","Thumbnail","WithSvg","WithDefaultIcon","WithSmallIcon"]},"./src/components/avatar/avatar.web.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{eu:()=>Avatar});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/index.js"),_radix_ui_react_avatar__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("../../node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/@radix-ui/react-avatar/dist/index.mjs"),leather_styles_css__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./leather-styles/css/index.js"),leather_styles_jsx__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./leather-styles/jsx/index.js");function getAvatarFallback(val){return val.slice(0,2)}const avatarRecipe=(0,leather_styles_css__WEBPACK_IMPORTED_MODULE_2__.Fj)({base:{alignItems:"center",bg:"ink.background-secondary",display:"inline-flex",justifyContent:"center",overflow:"hidden",userSelect:"none",verticalAlign:"middle"},variants:{size:{sm:{width:"sm",height:"sm"},md:{width:"md",height:"md"},lg:{width:"lg",height:"lg"},xl:{width:"xl",height:"xl"},xxl:{width:"xxl",height:"xxl"}},variant:{circle:{rounded:"100%"},square:{rounded:"xs"}}},defaultVariants:{size:"xl",variant:"circle"}});const avatarImageStyles=(0,leather_styles_css__WEBPACK_IMPORTED_MODULE_2__.AH)({aspectRatio:"1 / 1",height:"100%",objectFit:"cover",rounded:"inherit",width:"100%"}),Image=(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(((props,ref)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_radix_ui_react_avatar__WEBPACK_IMPORTED_MODULE_4__._V,{className:avatarImageStyles,ref,...props}))),avatarFallbackStyles=(0,leather_styles_css__WEBPACK_IMPORTED_MODULE_2__.AH)({alignItems:"center",bg:"inherit",border:"1px solid",borderColor:"ink.border-default",color:"ink.text-primary",display:"flex",fontWeight:500,height:"100%",justifyContent:"center",rounded:"inherit",textStyle:"label.02",width:"100%"}),Fallback=(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(((props,ref)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_radix_ui_react_avatar__WEBPACK_IMPORTED_MODULE_4__.H4,{className:avatarFallbackStyles,ref,...props}))),avatarIconStyles=(0,leather_styles_css__WEBPACK_IMPORTED_MODULE_2__.AH)({alignItems:"center",bg:"inherit",border:"1px solid",borderColor:"ink.border-default",display:"flex",height:"100%",justifyContent:"center",rounded:"inherit",width:"100%"});const avatarSvgStyles=(0,leather_styles_css__WEBPACK_IMPORTED_MODULE_2__.AH)({alignItems:"center",display:"flex",height:"100%",justifyContent:"center",rounded:"inherit",width:"100%"});const Avatar={Root:function Root({size,variant,...props}){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_radix_ui_react_avatar__WEBPACK_IMPORTED_MODULE_4__.bL,{className:avatarRecipe({size,variant}),...props})},Image,Fallback,Icon:function Icon(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(leather_styles_jsx__WEBPACK_IMPORTED_MODULE_3__.I4.span,{className:avatarIconStyles,...props})},Svg:function Svg({children,...props}){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(leather_styles_jsx__WEBPACK_IMPORTED_MODULE_3__.I4.span,{className:avatarSvgStyles,...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(leather_styles_jsx__WEBPACK_IMPORTED_MODULE_3__.I4.svg,{width:"100%",height:"100%",viewBox:"0 0 32 32",fill:"none",children})})}};try{getAvatarFallback.displayName="getAvatarFallback",getAvatarFallback.__docgenInfo={description:"",displayName:"getAvatarFallback",props:{}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/components/avatar/avatar.web.tsx#getAvatarFallback"]={docgenInfo:getAvatarFallback.__docgenInfo,name:"getAvatarFallback",path:"src/components/avatar/avatar.web.tsx#getAvatarFallback"})}catch(__react_docgen_typescript_loader_error){}},"./src/icons/icon/icon.web.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{I:()=>Icon});var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js"),react__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/index.js"),leather_styles_tokens__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./leather-styles/tokens/index.js");const Icon=(0,react__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((({children,...props},ref)=>{const child=react__WEBPACK_IMPORTED_MODULE_1__.Children.only(children);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment,{children:react__WEBPACK_IMPORTED_MODULE_1__.cloneElement(child,{color:(0,leather_styles_tokens__WEBPACK_IMPORTED_MODULE_2__.S)("colors.ink.action-primary-default"),ref,...props})})}));try{Icon.displayName="Icon",Icon.__docgenInfo={description:"",displayName:"Icon",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"default"'},{value:'"small"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/icons/icon/icon.web.tsx#Icon"]={docgenInfo:Icon.__docgenInfo,name:"Icon",path:"src/icons/icon/icon.web.tsx#Icon"})}catch(__react_docgen_typescript_loader_error){}},"./src/icons/placeholder-icon.web.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{__webpack_require__.d(__webpack_exports__,{X:()=>PlaceholderIcon});var _path,jsx_runtime=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js"),react=__webpack_require__("../../node_modules/.pnpm/[email protected]/node_modules/react/index.js");function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}const placeholder_16_16=function SvgPlaceholder1616(props){return react.createElement("svg",_extends({xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16"},props),_path||(_path=react.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M3 4.167v-1c0-.369.298-.667.667-.667h1m7.666 0h1c.368 0 .667.298.667.667v1m0 7.666v1a.667.667 0 0 1-.667.667h-1m-7.666 0h-1A.667.667 0 0 1 3 12.833v-1m0-2.666V6.833M7.333 2.5h2.334M14 6.833v2.334M9.667 13.5H7.333"})))};var placeholder_24_24_path;function placeholder_24_24_extends(){return placeholder_24_24_extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},placeholder_24_24_extends.apply(null,arguments)}const placeholder_24_24=function SvgPlaceholder2424(props){return react.createElement("svg",placeholder_24_24_extends({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24"},props),placeholder_24_24_path||(placeholder_24_24_path=react.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4.5 6V5a1 1 0 0 1 1-1h1m12 0h1a1 1 0 0 1 1 1v1m0 12v1a1 1 0 0 1-1 1h-1m-12 0h-1a1 1 0 0 1-1-1v-1m0-4.5v-3M11 4h3m6.5 6.5v3M14 20h-3"})))};var icon_web=__webpack_require__("./src/icons/icon/icon.web.tsx");const PlaceholderIcon=(0,react.forwardRef)((({variant,...props},ref)=>"small"===variant?(0,jsx_runtime.jsx)(icon_web.I,{ref,...props,children:(0,jsx_runtime.jsx)(placeholder_16_16,{})}):(0,jsx_runtime.jsx)(icon_web.I,{ref,...props,children:(0,jsx_runtime.jsx)(placeholder_24_24,{})})));try{PlaceholderIcon.displayName="PlaceholderIcon",PlaceholderIcon.__docgenInfo={description:"",displayName:"PlaceholderIcon",props:{variant:{defaultValue:null,description:"",name:"variant",required:!1,type:{name:"enum",value:[{value:'"default"'},{value:'"small"'}]}}}},"undefined"!=typeof STORYBOOK_REACT_CLASSES&&(STORYBOOK_REACT_CLASSES["src/icons/placeholder-icon.web.tsx#PlaceholderIcon"]={docgenInfo:PlaceholderIcon.__docgenInfo,name:"PlaceholderIcon",path:"src/icons/placeholder-icon.web.tsx#PlaceholderIcon"})}catch(__react_docgen_typescript_loader_error){}}}]);