Skip to content

Commit

Permalink
✨ feat: Add midjourney
Browse files Browse the repository at this point in the history
  • Loading branch information
canisminor1990 authored Feb 1, 2024
1 parent 76742dc commit 49f2030
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/Midjourney/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { memo } from 'react';

import IconAvatar, { type IconAvatarProps } from '@/IconAvatar';

import { COLOR_PRIMARY } from '../style';
import Mono from './Mono';

export type AvatarProps = Omit<IconAvatarProps, 'Icon'>;

const Avatar = memo<AvatarProps>(({ background, ...rest }) => {
return (
<IconAvatar Icon={Mono} background={background || COLOR_PRIMARY} color={'#000'} {...rest} />
);
});

export default Avatar;
23 changes: 23 additions & 0 deletions src/Midjourney/components/Combine.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { memo } from 'react';

import IconCombine, { type IconCombineProps } from '@/IconCombine';

import { SPACE_MULTIPLE, TEXT_MULTIPLE } from '../style';
import Mono from './Mono';
import Text from './Text';

export type CombineProps = Omit<IconCombineProps, 'Icon' | 'Text'>;

const Combine = memo<CombineProps>(({ ...rest }) => {
return (
<IconCombine
Icon={Mono}
Text={Text as any}
spaceMultiple={SPACE_MULTIPLE}
textMultiple={TEXT_MULTIPLE}
{...rest}
/>
);
});

export default Combine;
23 changes: 23 additions & 0 deletions src/Midjourney/components/Mono.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { forwardRef } from 'react';

import type { IconType } from '@/types';

const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
return (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, ...style }}
viewBox="0 0 24 24"
width={size}
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<path d="M22.369 17.676c-1.387 1.259-3.17 2.378-5.332 3.417.044.03.086.057.13.083l.018.01.019.012c.216.123.42.184.641.184.222 0 .426-.061.642-.184l.018-.011.019-.011c.14-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.304-.174.612-.266.949-.266.337 0 .645.092.949.266l.023.014c.188.109.334.219.602.442l.178.148c.221.184.346.278.483.36l.028.017.018.01c.21.12.407.181.62.185h.022a.31.31 0 110 .618c-.337 0-.645-.092-.95-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.02-.014a5.356 5.356 0 01-.49-.377l-.159-.132a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.641.184l-.02.011-.018.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.95.266c-.337 0-.644-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.026-.017a4.881 4.881 0 01-.425-.325.308.308 0 01-.12-.1l-.098-.081a3.836 3.836 0 00-.483-.36l-.027-.017-.019-.01a1.256 1.256 0 00-.641-.185c-.222 0-.426.061-.642.184l-.018.011-.019.011c-.14.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.51.39l-.023.014-.022.014-.09.054A1.868 1.868 0 0112 22c-.337 0-.645-.092-.949-.266a3.137 3.137 0 01-.09-.054l-.022-.014-.022-.013-.021-.014a5.356 5.356 0 01-.49-.377l-.158-.132a3.836 3.836 0 00-.483-.36l-.028-.017-.018-.01a1.256 1.256 0 00-.642-.185c-.221 0-.425.061-.641.184l-.019.011-.018.011c-.141.084-.266.178-.492.366l-.158.132a5.125 5.125 0 01-.511.39l-.022.014-.022.014-.09.054a1.868 1.868 0 01-.986.264c-.746-.09-1.319-.38-1.89-.866l-.035-.03c-.047-.041-.118-.106-.192-.174l-.196-.181-.107-.1-.011-.01a1.531 1.531 0 00-.336-.253.313.313 0 00-.095-.03h-.005c-.119.022-.238.059-.361.11a.308.308 0 01-.077.061l-.008.005a.309.309 0 01-.126.034 5.66 5.66 0 00-.774.518l-.416.324-.055.043a6.542 6.542 0 01-.324.236c-.305.207-.552.315-.8.315a.31.31 0 01-.01-.618h.01c.09 0 .235-.062.438-.198l.04-.027c.077-.054.163-.117.27-.199l.385-.301.06-.047c.268-.206.506-.373.73-.505l-.633-1.21a.309.309 0 01.254-.451l20.287-1.305a.309.309 0 01.228.537zm-1.118.14L2.369 19.03l.423.809c.128-.045.256-.078.388-.1a.31.31 0 01.052-.005c.132 0 .26.032.386.093.153.073.294.179.483.35l.016.015.092.086.144.134.097.089c.065.06.125.114.16.144.485.418.948.658 1.554.736h.011a1.25 1.25 0 00.6-.172l.021-.011.019-.011.018-.011c.141-.084.266-.178.492-.366l.178-.148c.279-.232.426-.342.625-.456.305-.174.612-.266.95-.266.336 0 .644.092.948.266l.023.014c.188.109.335.219.603.442l.177.148c.222.184.346.278.484.36l.027.017.019.01c.215.124.42.185.641.185.222 0 .426-.061.641-.184l.019-.011.018-.011c.141-.084.267-.178.493-.366l.177-.148c.28-.232.427-.342.626-.456.304-.174.612-.266.949-.266.337 0 .644.092.949.266l.025.015c.187.109.334.22.603.443 1.867-.878 3.448-1.811 4.73-2.832l.02-.016zM3.653 2.026C6.073 3.06 8.69 4.941 10.8 7.258c2.46 2.7 4.109 5.828 4.637 9.149a.31.31 0 01-.421.335c-2.348-.945-4.54-1.258-6.59-1.02-1.739.2-3.337.792-4.816 1.703-.294.182-.62-.182-.405-.454 1.856-2.355 2.581-4.99 2.343-7.794-.195-2.292-1.031-4.61-2.284-6.709a.31.31 0 01.388-.442zM10.04 4.45c1.778.543 3.892 2.102 5.782 4.243 1.984 2.248 3.552 4.934 4.347 7.582a.31.31 0 01-.401.38l-.022-.01-.386-.154a10.594 10.594 0 00-.291-.112l-.016-.006c-.68-.247-1.199-.291-1.944-.101a.31.31 0 01-.375-.218C15.378 11.123 13.073 7.276 9.775 5c-.291-.201-.072-.653.266-.55zM4.273 2.996l.008.015c1.028 1.94 1.708 4.031 1.885 6.113.213 2.513-.31 4.906-1.673 7.092l-.02.031.003-.001c1.198-.581 2.47-.969 3.825-1.132l.055-.006c1.981-.23 4.083.029 6.309.837l.066.025-.007-.039c-.593-2.95-2.108-5.737-4.31-8.179l-.07-.078c-1.785-1.96-3.944-3.6-6.014-4.65l-.057-.028zm7.92 3.238l.048.048c2.237 2.295 3.885 5.431 4.974 9.191l.038.132.022-.004c.71-.133 1.284-.063 1.963.18l.027.01.066.024.046.018-.025-.073c-.811-2.307-2.208-4.62-3.936-6.594l-.058-.065c-1.02-1.155-2.103-2.132-3.15-2.856l-.015-.011z"></path>
</svg>
);
});

export default Icon;
22 changes: 22 additions & 0 deletions src/Midjourney/components/Text.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { forwardRef } from 'react';

import type { IconType } from '@/types';

const Icon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
return (
<svg
fill="currentColor"
fillRule="evenodd"
height={size}
ref={ref}
style={{ flex: 'none', lineHeight: 1, width: 'fit-content', ...style }}
viewBox="0 0 134 24"
xmlns="http://www.w3.org/2000/svg"
{...rest}
>
<path d="M2 19.87V3.125h3.217l2.068 7.226 2.16-7.226h3.239v16.747h-2.183v-7.685c0-.811.016-1.71.046-2.696.03-.986.073-1.973.127-2.96l.083-1.407c.029-.446.058-.867.089-1.265l-2.62 8.58h-1.93L3.77 4.065c.138 1.116.238 2.359.299 3.727.061 1.37.092 2.834.092 4.394v7.685H2zm13.556 0v-2.064h4.434V9.318h-3.974V7.253h6.25v10.553h4.158v2.065H15.556zM20.91 5.029c-.521 0-.935-.134-1.241-.401-.307-.268-.46-.631-.46-1.09 0-.474.153-.849.46-1.124.306-.275.72-.413 1.24-.413.521 0 .935.138 1.241.413.307.275.46.65.46 1.124 0 .459-.153.822-.46 1.09-.306.267-.72.401-1.24.401zM32.926 20.1c-1.271 0-2.282-.424-3.033-1.273-.75-.849-1.126-2-1.126-3.453V11.75c0-1.453.376-2.604 1.126-3.453.75-.849 1.762-1.273 3.033-1.273.934 0 1.712.237 2.332.711.564.431.929 1.008 1.094 1.73l.044.22-.046-2.936V3.124h2.274v16.747h-2.251v-2.455c-.138.841-.514 1.499-1.126 1.973-.613.474-1.387.711-2.32.711zm.781-1.973c.812 0 1.455-.252 1.93-.757.475-.505.713-1.216.713-2.133v-3.35c0-.917-.238-1.628-.713-2.133-.475-.505-1.118-.757-1.93-.757-.842 0-1.497.218-1.964.654-.467.436-.7 1.143-.7 2.122v3.578c0 .98.233 1.687.7 2.122.467.436 1.122.654 1.964.654zM42.094 24v-2.065h2.964c.903 0 1.604-.248 2.102-.745.498-.497.747-1.19.747-2.076V9.318h-5.928V7.253h8.202v11.884c0 1.483-.46 2.665-1.378 3.544-.92.88-2.152 1.319-3.7 1.319h-3.01zm6.755-18.972c-.521 0-.935-.134-1.241-.401-.306-.268-.46-.631-.46-1.09 0-.474.154-.849.46-1.124.306-.275.72-.413 1.24-.413.522 0 .935.138 1.241.413.307.275.46.65.46 1.124 0 .459-.153.822-.46 1.09-.306.267-.72.401-1.24.401zm11.327 15.026c-1.547 0-2.776-.443-3.688-1.33-.911-.887-1.367-2.126-1.367-3.717v-2.89c0-1.59.456-2.83 1.367-3.717.912-.887 2.141-1.33 3.688-1.33 1.547 0 2.776.443 3.688 1.33.911.887 1.367 2.126 1.367 3.717v2.89c0 1.59-.456 2.83-1.367 3.717-.912.887-2.14 1.33-3.688 1.33zm0-1.996c.858 0 1.536-.24 2.033-.722.498-.482.747-1.19.747-2.122V11.91c0-.933-.249-1.64-.747-2.122-.497-.481-1.175-.722-2.033-.722-.858 0-1.536.24-2.033.722-.498.482-.747 1.19-.747 2.122v3.304c0 .933.249 1.64.747 2.122.497.482 1.175.722 2.033.722zM73.364 20.1c-1.485 0-2.672-.436-3.56-1.308-.89-.871-1.334-2.057-1.334-3.555V7.253h2.275v7.984c0 .887.234 1.586.7 2.099.468.512 1.108.768 1.92.768.827 0 1.478-.256 1.952-.768.475-.513.713-1.212.713-2.1V7.254h2.274v7.984c0 1.498-.448 2.684-1.344 3.555-.896.872-2.094 1.308-3.596 1.308zm8.823-.23V7.254h2.252v2.432h.023c.123-.826.479-1.476 1.068-1.95.59-.474 1.375-.711 2.355-.711 1.302 0 2.313.401 3.033 1.204.72.803 1.08 1.931 1.08 3.384v1.101h-2.274v-1.078c0-1.759-.866-2.638-2.597-2.638-.873 0-1.535.252-1.987.757-.452.505-.678 1.223-.678 2.156v7.96h-2.275zm12.752 0V7.254h2.252v2.41h.023c.107-.827.456-1.473 1.045-1.94.59-.466 1.367-.699 2.332-.699 1.256 0 2.26.398 3.01 1.193s1.126 1.866 1.126 3.212v8.442h-2.275v-8.075c0-.918-.23-1.622-.689-2.11-.46-.49-1.087-.735-1.884-.735-.827 0-1.478.256-1.953.768-.475.513-.712 1.228-.712 2.145v8.007h-2.275zm18.083.23c-1.517 0-2.738-.451-3.665-1.353-.927-.903-1.39-2.134-1.39-3.694v-2.982c0-1.56.463-2.791 1.39-3.694.927-.902 2.148-1.353 3.665-1.353 1.01 0 1.895.203 2.653.608a4.396 4.396 0 011.77 1.698c.42.726.631 1.57.631 2.534v2.272h-7.88v1.1c0 .918.252 1.637.758 2.157.505.52 1.194.78 2.068.78.735 0 1.34-.138 1.815-.413.475-.275.758-.657.85-1.147h2.274c-.153 1.07-.681 1.92-1.585 2.547-.904.627-2.022.94-3.354.94zm-2.827-8.236v.597h5.653v-.597c0-.963-.245-1.705-.736-2.225-.49-.52-1.187-.78-2.09-.78-.904 0-1.601.26-2.091.78-.49.52-.736 1.262-.736 2.225zM123.361 24l1.838-4.886-4.71-11.86h2.412l2.85 7.455c.122.321.245.665.367 1.032.123.367.207.689.253.964a8.49 8.49 0 01.23-.964c.107-.367.222-.71.344-1.032l2.642-7.456H132L125.727 24h-2.366z"></path>
</svg>
);
});

export default Icon;
69 changes: 69 additions & 0 deletions src/Midjourney/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
nav: Components
group: Icons
title: Midjourney
atomId: Midjourney
description: https://midjourney.com
---

## Icons

```tsx
import { Midjourney } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => <Midjourney size={64} />;
```

## Text

```tsx
import { Midjourney } from '@lobehub/icons';

export default () => <Midjourney.Text size={48} />;
```

## Combine

```tsx
import { Midjourney } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16}>
<Midjourney.Combine size={64} />
</Flexbox>
);
```

## Avatars

```tsx
import { Midjourney } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

export default () => (
<Flexbox gap={16} horizontal>
<Midjourney.Avatar size={64} />
<Midjourney.Avatar size={64} shape={'square'} />
</Flexbox>
);
```

## Colors

```tsx
/**
* inline: true
*/
import { Midjourney } from '@lobehub/icons';
import { Flexbox } from 'react-layout-kit';

import ColorPreview from '../components/ColorPreview';

export default () => (
<Flexbox gap={16} horizontal>
<ColorPreview color={Midjourney.colorPrimary} />
</Flexbox>
);
```
20 changes: 20 additions & 0 deletions src/Midjourney/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Avatar from './components/Avatar';
import Combine from './components/Combine';
import Mono from './components/Mono';
import Text from './components/Text';
import { COLOR_PRIMARY } from './style';

export type CompoundedIcon = typeof Mono & {
Avatar: typeof Avatar;
Combine: typeof Combine;
Mono: typeof Mono;
Text: typeof Text;
colorPrimary: string;
};

const Icons = Mono as CompoundedIcon;
Icons.Text = Text;
Icons.Combine = Combine;
Icons.Avatar = Avatar;
Icons.colorPrimary = COLOR_PRIMARY;
export default Icons;
3 changes: 3 additions & 0 deletions src/Midjourney/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const TEXT_MULTIPLE = 0.6;
export const SPACE_MULTIPLE = 0.2;
export const COLOR_PRIMARY = '#fff';
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export { default as Dalle, type CompoundedIcon as DalleProps } from './Dalle';
export { default as Gemini, type CompoundedIcon as GeminiProps } from './Gemini';
export { default as IconAvatar, type IconAvatarProps } from './IconAvatar';
export { default as IconCombine, type IconCombineProps } from './IconCombine';
export { default as Midjourney, type CompoundedIcon as MidjourneyProps } from './Midjourney';
export { default as Minimax, type CompoundedIcon as MinimaxProps } from './Minimax';
export { default as Mistral, type CompoundedIcon as MistralProps } from './Mistral';
export { default as Ollama, type CompoundedIcon as OllamaProps } from './Ollama';
Expand Down

0 comments on commit 49f2030

Please sign in to comment.