New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jouwomgeving/ui-avatar

Package Overview
Dependencies
Maintainers
4
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jouwomgeving/ui-avatar - npm Package Compare versions

Comparing version 0.0.1-alpha.92691fe3 to 0.0.1-alpha.977f75f5

7

package.json
{
"name": "@jouwomgeving/ui-avatar",
"version": "0.0.1-alpha.92691fe3",
"version": "0.0.1-alpha.977f75f5",
"description": "",

@@ -18,4 +18,7 @@ "main": "dist/bundle.js",

"react-dom": "^15.2.0",
"@jouwomgeving/ui-icon": "^0.0.1-alpha.92691fe3"
"@jouwomgeving/ui-icon": "^0.0.1-alpha.977f75f5",
"@jouwomgeving/ui-popover": "^0.0.1-alpha.977f75f5",
"@jouwomgeving/ui-list": "^0.0.1-alpha.977f75f5",
"@jouwomgeving/ui-typography": "^0.0.1-alpha.977f75f5"
}
}

@@ -1,21 +0,55 @@

import React, { PropTypes, Children } from 'react';
import mapProps from 'recompose/mapProps';
import React, { PropTypes, Children, cloneElement } from 'react';
import withProps from 'recompose/withProps';
import classNames from 'classnames/bind';
import { PopOverContainer } from '@jouwomgeving/ui-popover/index';
import { Text } from '@jouwomgeving/ui-typography/index';
import List from '@jouwomgeving/ui-list/index';
import styles from './../styles.css';
const enhance = mapProps(({ children, showMax }) => {
const cx = classNames.bind(styles);
const enhance = withProps(({ children, showMax }) => {
const childrenArray = Children.toArray(children);
return {
show: childrenArray.slice(0, showMax - 1),
hide: childrenArray.slice(showMax - 1),
show: childrenArray.slice(0, showMax),
hide: childrenArray.slice(showMax),
};
});
const Group = enhance(({ show, hide }) => (
<div className={styles.Group}>
const Group = enhance(({ show, hide, overlap }) => (
<div className={cx('Group', { overlap })}>
{show}
{hide.length > 0 &&
<div>
{hide}
</div>
<PopOverContainer
content={(
<List.Container>
{hide.map(avatar => (
<List.Row spacing="thin">
<List.Cell
vertical="center"
size="2rem"
>
{cloneElement(avatar, { size: 'small' })}
</List.Cell>
<List.Cell vertical="center">
<Text>
{avatar.props.name}
</Text>
</List.Cell>
</List.Row>
))}
</List.Container>
)}
>
<div className={cx('ShowMore', show[show.length - 1].props.size)}>
<Text
size="small"
color="link"
>
+{hide.length}
</Text>
</div>
</PopOverContainer>
}

@@ -28,2 +62,3 @@ </div>

showMax: PropTypes.number,
overlap: PropTypes.bool,
};

@@ -33,2 +68,3 @@

showMax: 3,
overlap: true,
};

@@ -35,0 +71,0 @@

import React from 'react';
import { storiesOf } from '@kadira/storybook';
import Faker from 'faker';
import times from 'lodash/times';

@@ -13,15 +15,11 @@ import Avatar from 'ui-avatar/index';

const avatars = [
'https://placekitten.com/g/55/55',
'https://placekitten.com/g/56/56',
'https://placekitten.com/g/57/57',
];
function generate() {
return {
name: Faker.name.findName(),
src: Faker.image.avatar(),
};
}
const avatarsShowMax = avatars.concat([
'https://placekitten.com/g/55/55',
'https://placekitten.com/g/56/56',
'https://placekitten.com/g/57/57',
'https://placekitten.com/g/58/58',
'https://placekitten.com/g/59/59',
]);
const avatars = times(3, generate);
const avatarsShowMax = times(8, generate);

@@ -36,3 +34,3 @@ storiesOf('<Avatar.Group />', module)

size="small"
src={avatar}
{...avatar}
/>

@@ -43,3 +41,3 @@ ))}

)
.addWithInfo('showMax', '',
.addWithInfo('Show 3 max', '',
() => (

@@ -51,3 +49,3 @@ <Avatar.Group showMax={3}>

size="small"
src={avatar}
{...avatar}
/>

@@ -57,2 +55,18 @@ ))}

), settings
)
.addWithInfo('Don\'t overlap', '',
() => (
<Avatar.Group
showMax={3}
overlap={false}
>
{avatarsShowMax.map((avatar, index) => (
<Avatar.default
key={index}
size="small"
{...avatar}
/>
))}
</Avatar.Group>
), settings
);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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