diff --git a/.changeset/lovely-zebras-destroy.md b/.changeset/lovely-zebras-destroy.md new file mode 100644 index 0000000000..4908e2aeb7 --- /dev/null +++ b/.changeset/lovely-zebras-destroy.md @@ -0,0 +1,6 @@ +--- +'@toptal/picasso-user-badge': minor +'@toptal/picasso-avatar': minor +--- + +- export Avatar.Wrapper to support custom icons diff --git a/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap b/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap index 8fc9ece907..7142c77fc5 100644 --- a/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap +++ b/packages/base/AccountSelect/src/AccountSelect/__snapshots__/test.tsx.snap @@ -34,20 +34,22 @@ exports[`AccountSelect renders 1`] = `
-
+
-

- PL -

+

+ PL +

+
@@ -110,20 +112,22 @@ exports[`AccountSelect renders 1`] = `
-
+
-

- PL -

+

+ PL +

+
@@ -186,17 +190,19 @@ exports[`AccountSelect renders 1`] = `
-
+
- Phil Leif 3 +
+ Phil Leif 3 +
{ const AvatarLogo = ({ size }: Pick) => (
) => (
) -const AvatarWrapper = (props: Props) => { +export const AvatarWrapper = (props: Props) => { const { children, className, @@ -55,26 +55,25 @@ const AvatarWrapper = (props: Props) => { } = props return ( -
+
- {children} +
+ {children} +
+ {showLogo(size, showEmblem) && }
- - {showLogo(size, showEmblem) && }
) } diff --git a/packages/base/Avatar/src/Avatar/IconAvatar/IconAvatar.tsx b/packages/base/Avatar/src/Avatar/IconAvatar/IconAvatar.tsx index 4be65d0c5a..cf020bd3f8 100644 --- a/packages/base/Avatar/src/Avatar/IconAvatar/IconAvatar.tsx +++ b/packages/base/Avatar/src/Avatar/IconAvatar/IconAvatar.tsx @@ -19,11 +19,7 @@ const IconAvatar = ({ }: Props) => { return ( { {alt (
diff --git a/packages/base/Avatar/src/Avatar/index.ts b/packages/base/Avatar/src/Avatar/index.ts index cba0f11dfa..402720a4b4 100644 --- a/packages/base/Avatar/src/Avatar/index.ts +++ b/packages/base/Avatar/src/Avatar/index.ts @@ -3,4 +3,5 @@ import type { OmitInternalProps } from '@toptal/picasso-shared' import type { Props } from './Avatar' export { default as Avatar } from './Avatar' +export { AvatarWrapper } from './AvatarWrapper/AvatarWrapper' export type AvatarProps = OmitInternalProps diff --git a/packages/base/Avatar/src/Avatar/story/LongName.example.tsx b/packages/base/Avatar/src/Avatar/story/LongName.example.tsx index 8c951767ba..2600ce95c6 100644 --- a/packages/base/Avatar/src/Avatar/story/LongName.example.tsx +++ b/packages/base/Avatar/src/Avatar/story/LongName.example.tsx @@ -3,22 +3,12 @@ import { Avatar, Container } from '@toptal/picasso' import { SPACING_4 } from '@toptal/picasso-utils' const Example = () => ( - - - - - - - - - - - - - - - - + + + + + + ) diff --git a/packages/base/Avatar/src/Avatar/story/Sizes.example.tsx b/packages/base/Avatar/src/Avatar/story/Sizes.example.tsx index f920012e5b..ff9b1436bc 100644 --- a/packages/base/Avatar/src/Avatar/story/Sizes.example.tsx +++ b/packages/base/Avatar/src/Avatar/story/Sizes.example.tsx @@ -4,83 +4,53 @@ import { SPACING_4 } from '@toptal/picasso-utils' const Example = () => (
- - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - + + + + + +
) diff --git a/packages/base/Avatar/src/Avatar/story/ToptalLogo.example.tsx b/packages/base/Avatar/src/Avatar/story/ToptalLogo.example.tsx index 6520e40f52..89fd75ed85 100644 --- a/packages/base/Avatar/src/Avatar/story/ToptalLogo.example.tsx +++ b/packages/base/Avatar/src/Avatar/story/ToptalLogo.example.tsx @@ -3,33 +3,19 @@ import { Avatar, Container } from '@toptal/picasso' import { SPACING_4 } from '@toptal/picasso-utils' const Example = () => ( -
- - - - - - - - - - - - - - - - - - - -
+ + + + + + + ) export default Example diff --git a/packages/base/Avatar/src/Avatar/story/Variants.example.tsx b/packages/base/Avatar/src/Avatar/story/Variants.example.tsx index a5529e57b9..e049962f13 100644 --- a/packages/base/Avatar/src/Avatar/story/Variants.example.tsx +++ b/packages/base/Avatar/src/Avatar/story/Variants.example.tsx @@ -3,31 +3,23 @@ import { Avatar, Container } from '@toptal/picasso' import { SPACING_4 } from '@toptal/picasso-utils' const Example = () => ( -
- - - - - - - - - - - - -
+ + + + + + ) export default Example diff --git a/packages/base/Avatar/src/AvatarCompound/index.ts b/packages/base/Avatar/src/AvatarCompound/index.ts index 359610c778..ffc5b99c29 100644 --- a/packages/base/Avatar/src/AvatarCompound/index.ts +++ b/packages/base/Avatar/src/AvatarCompound/index.ts @@ -1,6 +1,7 @@ -import { Avatar } from '../Avatar' +import { Avatar, AvatarWrapper } from '../Avatar' import { AvatarGroup } from '../AvatarGroup' export const AvatarCompound = Object.assign(Avatar, { Group: AvatarGroup, + Wrapper: AvatarWrapper, }) diff --git a/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap b/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap index 33b98bddc1..3e400bb25c 100644 --- a/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap +++ b/packages/base/Page/src/PageTopBarMenu/__snapshots__/test.tsx.snap @@ -14,17 +14,19 @@ exports[`PageTopBarMenu renders 1`] = `
-
+
- Jacqueline Roque +
+ Jacqueline Roque +
-
+
-

- JD -

+

+ JD +

+
@@ -51,20 +53,22 @@ exports[`UserBadge custom name 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -97,20 +101,22 @@ exports[`UserBadge custom title 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -148,20 +154,22 @@ exports[`UserBadge invert render 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -196,20 +204,22 @@ exports[`UserBadge manual center alignment 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -244,20 +254,22 @@ exports[`UserBadge override auto center alignment 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -287,20 +299,22 @@ exports[`UserBadge renders 1`] = `
-
+
-

- JD -

+

+ JD +

+
@@ -335,20 +349,22 @@ exports[`UserBadge small size 1`] = `
-
+
-

- JD -

+

+ JD +

+
diff --git a/packages/base/UserBadge/src/UserBadge/story/WithIcon.example.tsx b/packages/base/UserBadge/src/UserBadge/story/WithIcon.example.tsx new file mode 100644 index 0000000000..840b7f44f7 --- /dev/null +++ b/packages/base/UserBadge/src/UserBadge/story/WithIcon.example.tsx @@ -0,0 +1,18 @@ +import React from 'react' +import { UserBadge, Support16, Avatar } from '@toptal/picasso' + +const Example = () => ( +
+ + + + } + /> +
+) + +export default Example diff --git a/packages/base/UserBadge/src/UserBadge/story/index.jsx b/packages/base/UserBadge/src/UserBadge/story/index.jsx index f1b14eb788..dbbfaed3b7 100644 --- a/packages/base/UserBadge/src/UserBadge/story/index.jsx +++ b/packages/base/UserBadge/src/UserBadge/story/index.jsx @@ -4,7 +4,7 @@ import PicassoBook from '~/.storybook/components/PicassoBook' const page = PicassoBook.section('Components').createPage( 'UserBadge', `Show user avatar and name along with addition content - + ${PicassoBook.createSourceLink(__filename)} ` ) @@ -33,3 +33,8 @@ page 'With Title', 'base/UserBadge' ) + .addExample( + 'UserBadge/story/WithIcon.example.tsx', + 'With Icon', + 'base/UserBadge' + )