Skip to content

Commit

Permalink
feat(ui/icons): add settings-switch-app & x-log-logo
Browse files Browse the repository at this point in the history
  • Loading branch information
runjuu committed Mar 9, 2023
1 parent a1f7283 commit 22a823c
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"build": "run-s clean build:icons build:ts",
"build:icons": "svgr --typescript --ref --icon --filename-case kebab --index-template svgr-index-template.js --out-dir src/icons/svgr ../../scripts/unocss/icons",
"build:ts": "tsup",
"clean": "rm -rf ./dist"
"clean": "rm -rf ./dist && rm -rf ./src/icons/svgr"
},
"exports": {
".": {
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/icons/svgr/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export { default as RiskIcon } from "./risk";
export { default as SearchIcon } from "./search";
export { default as SettingsAccountOutlineIcon } from "./settings-account-outline";
export { default as SettingsEyeIcon } from "./settings-eye";
export { default as SettingsSwitchAppIcon } from "./settings-switch-app";
export { default as SettingsXSyncIcon } from "./settings-x-sync";
export { default as ShareIcon } from "./share";
export { default as ShopIcon } from "./shop";
Expand All @@ -56,4 +57,5 @@ export { default as TwitterIcon } from "./twitter";
export { default as TwoStarsIcon } from "./two-stars";
export { default as WidgetsSettingIcon } from "./widgets-setting";
export { default as WidgetsIcon } from "./widgets";
export { default as XLogLogo } from "./x-log-logo";
export { default as YoutubeIcon } from "./youtube";
23 changes: 23 additions & 0 deletions packages/ui/src/icons/svgr/settings-switch-app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import * as React from "react";
import { SVGProps, Ref, forwardRef } from "react";
const SvgSettingsSwitchApp = (
props: SVGProps<SVGSVGElement>,
ref: Ref<SVGSVGElement>
) => (
<svg
width="1em"
height="1em"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
ref={ref}
{...props}
>
<path
d="M21 19.072A1.929 1.929 0 0 1 19.071 21h-3.857a1.929 1.929 0 0 1-1.928-1.928v-3.858c0-1.065.863-1.928 1.928-1.928h3.857c1.066 0 1.929.863 1.929 1.928v3.857Zm-10.286-3.858a1.928 1.928 0 0 0-1.928-1.928H4.929A1.929 1.929 0 0 0 3 15.214v3.857c0 1.066.864 1.93 1.929 1.93h3.857a1.928 1.928 0 0 0 1.928-1.93v-3.857ZM21 4.93A1.928 1.928 0 0 0 19.071 3h-3.857a1.928 1.928 0 0 0-1.928 1.929v3.857c0 1.065.863 1.928 1.928 1.928h3.857A1.928 1.928 0 0 0 21 8.786V4.929Zm-10.286 0A1.928 1.928 0 0 0 8.786 3H4.929A1.929 1.929 0 0 0 3 4.93v3.857c0 1.065.864 1.928 1.929 1.928h3.857a1.928 1.928 0 0 0 1.928-1.928V4.929Z"
fill="#687792"
/>
</svg>
);
const ForwardRef = forwardRef(SvgSettingsSwitchApp);
export default ForwardRef;
49 changes: 49 additions & 0 deletions packages/ui/src/icons/svgr/x-log-logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import * as React from "react";
import { SVGProps, Ref, forwardRef } from "react";
const SvgXLogLogo = (
props: SVGProps<SVGSVGElement>,
ref: Ref<SVGSVGElement>
) => (
<svg
width="1em"
height="1em"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
ref={ref}
{...props}
>
<g clipPath="url(#x-log-logo_svg__a)">
<path
d="M10.494 18.72c0 2.977-2.206 5.144-5.19 5.144-2.982 0-5.242-2.167-5.242-5.144 0-2.978 2.204-5.115 5.231-5.115 3.028 0 5.2 2.167 5.2 5.115ZM22.358 18.867v3.598c-.907.862-2.403 1.416-4.033 1.416-3.416 0-5.59-1.955-5.59-4.975 0-3.02 2.407-5.28 5.789-5.28v5.24h3.834Z"
fill="#000"
/>
<path
d="M22.303 4.002 24 7.175l-8.485 4.54-4.794-8.96L15.869 0l3.097 5.787 3.337-1.785Z"
fill="url(#x-log-logo_svg__b)"
/>
<path
d="m0 11.759 3.082-5.644L.127 1.522H10.43L7.475 6.115l3.08 5.644H0Z"
fill="#000"
/>
</g>
<defs>
<linearGradient
id="x-log-logo_svg__b"
x1={10.721}
y1={5.858}
x2={24}
y2={5.858}
gradientUnits="userSpaceOnUse"
>
<stop stopColor="#FF4D4D" />
<stop offset={0.99} stopColor="#F9CB28" />
</linearGradient>
<clipPath id="x-log-logo_svg__a">
<path fill="#fff" d="M0 0h24v24H0z" />
</clipPath>
</defs>
</svg>
);
const ForwardRef = forwardRef(SvgXLogLogo);
export default ForwardRef;
4 changes: 3 additions & 1 deletion packages/ui/svgr-index-template.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const { pascalCase } = require("pascal-case");
function defaultIndexTemplate(filePaths) {
const exportEntries = filePaths.map((filePath) => {
const basename = path.basename(filePath, path.extname(filePath));
const exportName = `${pascalCase(basename)}Icon`;
const exportName = /^.+logo$/i.test(basename)
? pascalCase(basename)
: `${pascalCase(basename)}Icon`;
return `export { default as ${exportName} } from './${basename}'`;
});
return exportEntries.join("\n");
Expand Down
3 changes: 3 additions & 0 deletions scripts/unocss/icons/settings-switch-app.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions scripts/unocss/icons/x-log-logo.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 22a823c

Please sign in to comment.