Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@brighthr/component-avatar

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brighthr/component-avatar - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

2

dist/index.d.ts
import * as React from 'react';
declare type AvatarSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl';
declare type AvatarSize = 'xs' | 'sm' | 'base' | 'lg' | 'xl' | 'xxl';
declare type Presence = 'in' | 'out' | 'absent';

@@ -4,0 +4,0 @@ declare type BaseAvatarProps = {

@@ -1,2 +0,2 @@

import*as e from"react";import t from"classnames";import s from"@brighthr/component-icon";const a=e=>t("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e},{"w-9 h-9 text-xs":"sm"===e},{"w-12 h-12 text-base":"base"===e},{"w-16 h-16 text-base":"lg"===e},{"w-20 h-20 text-2xl":"xl"===e}),r=(e,s)=>t("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===s},{"w-2 h-2":"sm"===s},{"w-3 h-3":"base"===s},{"w-4 h-4":"lg"===s},{"w-5 h-5":"xl"===s},{"bg-success-600 rounded-full":"in"===e},{"bg-neutral-400 rounded-full":"out"===e},{"bg-error-500 rounded-sm":"absent"===e}),l=e=>{switch(e){case"xs":return 9;case"sm":return 14;case"base":default:return 22;case"lg":return 28;case"xl":return 38}},n=({name:r,size:n})=>e.createElement("div",{className:t(a(n))},r?r.split(" ").map(e=>e.match(/[A-Za-z]/)).slice(0,3).join("").toUpperCase():e.createElement(s,{iconName:"user",className:t("fill-white flex justify-center items-center"),size:l(n)})),m=({name:s,imageHref:l,size:m,presence:c})=>e.createElement("div",{className:"relative inline-block"},l?e.createElement("img",{src:l,className:t(a(m)),title:`${s}'s profile`,alt:`${s}'s profile`}):e.createElement(n,{name:s,size:m}),c&&e.createElement("span",{className:t(r(c,m))}," "));export{m as default};
import*as e from"react";import t from"classnames";import s from"@brighthr/component-icon";const l=e=>t("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e,"w-9 h-9 text-xs":"sm"===e,"w-12 h-12 text-base":"base"===e,"w-16 h-16 text-base":"lg"===e,"w-20 h-20 text-2xl":"xl"===e,"w-32 h-32 text-3xl":"xxl"===e}),a=(e,s)=>t("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===s,"w-2 h-2":"sm"===s,"w-3 h-3":"base"===s,"w-4 h-4":"lg"===s,"w-5 h-5":"xl"===s,"w-8 h-8":"xxl"===s,"bg-success-600 rounded-full":"in"===e,"bg-neutral-400 rounded-full":"out"===e,"bg-error-500 rounded-full":"absent"===e}),r={xs:9,sm:14,base:22,lg:28,xl:38,xxl:48},m=({name:a,size:m="base"})=>e.createElement("div",{className:t(l(m))},a?a.split(" ").map(e=>e.match(/[A-Za-z]/)).slice(0,3).join("").toUpperCase():e.createElement(s,{iconName:"user",className:t("fill-white flex justify-center items-center"),size:r[m]||22})),i=({name:s,imageHref:r,size:i,presence:n})=>e.createElement("div",{className:"relative inline-block"},r?e.createElement("img",{src:r,className:t(l(i)),title:`${s}'s profile`,alt:`${s}'s profile`}):e.createElement(m,{name:s,size:i}),n&&e.createElement("span",{className:t(a(n,i))}," "));export{i as default};
//# sourceMappingURL=index.modern.js.map

@@ -1,2 +0,2 @@

import*as e from"react";import t from"classnames";import r from"@brighthr/component-icon";var s=function(e){return t("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e},{"w-9 h-9 text-xs":"sm"===e},{"w-12 h-12 text-base":"base"===e},{"w-16 h-16 text-base":"lg"===e},{"w-20 h-20 text-2xl":"xl"===e})},n=function(e,r){return t("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===r},{"w-2 h-2":"sm"===r},{"w-3 h-3":"base"===r},{"w-4 h-4":"lg"===r},{"w-5 h-5":"xl"===r},{"bg-success-600 rounded-full":"in"===e},{"bg-neutral-400 rounded-full":"out"===e},{"bg-error-500 rounded-sm":"absent"===e})},a=function(e){switch(e){case"xs":return 9;case"sm":return 14;case"base":default:return 22;case"lg":return 28;case"xl":return 38}},l=function(n){var l=n.name,i=n.size;return e.createElement("div",{className:t(s(i))},l?l.split(" ").map(function(e){return e.match(/[A-Za-z]/)}).slice(0,3).join("").toUpperCase():e.createElement(r,{iconName:"user",className:t("fill-white flex justify-center items-center"),size:a(i)}))},i=function(r){var a=r.name,i=r.imageHref,c=r.size,m=r.presence;return e.createElement("div",{className:"relative inline-block"},i?e.createElement("img",{src:i,className:t(s(c)),title:a+"'s profile",alt:a+"'s profile"}):e.createElement(l,{name:a,size:c}),m&&e.createElement("span",{className:t(n(m,c))}," "))};export{i as default};
import*as e from"react";import t from"classnames";import r from"@brighthr/component-icon";var s=function(e){return t("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e,"w-9 h-9 text-xs":"sm"===e,"w-12 h-12 text-base":"base"===e,"w-16 h-16 text-base":"lg"===e,"w-20 h-20 text-2xl":"xl"===e,"w-32 h-32 text-3xl":"xxl"===e})},a=function(e,r){return t("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===r,"w-2 h-2":"sm"===r,"w-3 h-3":"base"===r,"w-4 h-4":"lg"===r,"w-5 h-5":"xl"===r,"w-8 h-8":"xxl"===r,"bg-success-600 rounded-full":"in"===e,"bg-neutral-400 rounded-full":"out"===e,"bg-error-500 rounded-full":"absent"===e})},l={xs:9,sm:14,base:22,lg:28,xl:38,xxl:48},n=function(a){var n=a.name,i=a.size,m=void 0===i?"base":i;return e.createElement("div",{className:t(s(m))},n?n.split(" ").map(function(e){return e.match(/[A-Za-z]/)}).slice(0,3).join("").toUpperCase():e.createElement(r,{iconName:"user",className:t("fill-white flex justify-center items-center"),size:l[m]||22}))},i=function(r){var l=r.name,i=r.imageHref,m=r.size,c=r.presence;return e.createElement("div",{className:"relative inline-block"},i?e.createElement("img",{src:i,className:t(s(m)),title:l+"'s profile",alt:l+"'s profile"}):e.createElement(n,{name:l,size:m}),c&&e.createElement("span",{className:t(a(c,m))}," "))};export{i as default};
//# sourceMappingURL=index.module.js.map

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("classnames"),require("@brighthr/component-icon")):"function"==typeof define&&define.amd?define(["react","classnames","@brighthr/component-icon"],t):(e||self).componentAvatar=t(e.react,e.classnames,e.Icon)}(this,function(e,t,n){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var s=/*#__PURE__*/a(e),l=/*#__PURE__*/r(t),u=/*#__PURE__*/r(n),c=function(e){return l.default("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e},{"w-9 h-9 text-xs":"sm"===e},{"w-12 h-12 text-base":"base"===e},{"w-16 h-16 text-base":"lg"===e},{"w-20 h-20 text-2xl":"xl"===e})},i=function(e,t){return l.default("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===t},{"w-2 h-2":"sm"===t},{"w-3 h-3":"base"===t},{"w-4 h-4":"lg"===t},{"w-5 h-5":"xl"===t},{"bg-success-600 rounded-full":"in"===e},{"bg-neutral-400 rounded-full":"out"===e},{"bg-error-500 rounded-sm":"absent"===e})},o=function(e){switch(e){case"xs":return 9;case"sm":return 14;case"base":default:return 22;case"lg":return 28;case"xl":return 38}},f=function(e){var t=e.name,n=e.size;return s.createElement("div",{className:l.default(c(n))},t?t.split(" ").map(function(e){return e.match(/[A-Za-z]/)}).slice(0,3).join("").toUpperCase():s.createElement(u.default,{iconName:"user",className:l.default("fill-white flex justify-center items-center"),size:o(n)}))};return function(e){var t=e.name,n=e.imageHref,r=e.size,a=e.presence;return s.createElement("div",{className:"relative inline-block"},n?s.createElement("img",{src:n,className:l.default(c(r)),title:t+"'s profile",alt:t+"'s profile"}):s.createElement(f,{name:t,size:r}),a&&s.createElement("span",{className:l.default(i(a,r))}," "))}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react"),require("classnames"),require("@brighthr/component-icon")):"function"==typeof define&&define.amd?define(["react","classnames","@brighthr/component-icon"],t):(e||self).componentAvatar=t(e.react,e.classnames,e.Icon)}(this,function(e,t,n){function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,t}var l=/*#__PURE__*/a(e),s=/*#__PURE__*/r(t),i=/*#__PURE__*/r(n),u=function(e){return s.default("bg-primary-400 text-white rounded-full flex justify-center items-center max-w-none",{"w-5 h-5 text-xs":"xs"===e,"w-9 h-9 text-xs":"sm"===e,"w-12 h-12 text-base":"base"===e,"w-16 h-16 text-base":"lg"===e,"w-20 h-20 text-2xl":"xl"===e,"w-32 h-32 text-3xl":"xxl"===e})},c=function(e,t){return s.default("absolute bottom-0 right-0",{"w-1.5 h-1.5":"xs"===t,"w-2 h-2":"sm"===t,"w-3 h-3":"base"===t,"w-4 h-4":"lg"===t,"w-5 h-5":"xl"===t,"w-8 h-8":"xxl"===t,"bg-success-600 rounded-full":"in"===e,"bg-neutral-400 rounded-full":"out"===e,"bg-error-500 rounded-full":"absent"===e})},o={xs:9,sm:14,base:22,lg:28,xl:38,xxl:48},f=function(e){var t=e.name,n=e.size,r=void 0===n?"base":n;return l.createElement("div",{className:s.default(u(r))},t?t.split(" ").map(function(e){return e.match(/[A-Za-z]/)}).slice(0,3).join("").toUpperCase():l.createElement(i.default,{iconName:"user",className:s.default("fill-white flex justify-center items-center"),size:o[r]||22}))};return function(e){var t=e.name,n=e.imageHref,r=e.size,a=e.presence;return l.createElement("div",{className:"relative inline-block"},n?l.createElement("img",{src:n,className:s.default(u(r)),title:t+"'s profile",alt:t+"'s profile"}):l.createElement(f,{name:t,size:r}),a&&l.createElement("span",{className:s.default(c(a,r))}," "))}});
//# sourceMappingURL=index.umd.js.map
{
"name": "@brighthr/component-avatar",
"version": "0.0.4",
"version": "0.0.5",
"license": "MIT",

@@ -40,3 +40,3 @@ "type": "module",

},
"gitHead": "029c2f35f6846df08a74293cc1b53088a95af10c"
"gitHead": "7a05524c0428af8850fa60ce4ecc03ee294665d9"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc