@dynamic-labs/iconic 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/dist/package.json +1 -1
- package/dist/src/components/SocialIcon.d.ts +3 -1
- package/dist/src/components/SocialIcon.js +3 -27
- package/dist/src/components/getSocialIcon.d.ts +3 -0
- package/dist/src/components/getSocialIcon.js +40 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/index.js +1 -0
- package/dist/src/icons/social/index.d.ts +2 -0
- package/dist/src/icons/social/index.js +11 -1
- package/dist/src/icons/wallets/index.d.ts +1 -0
- package/dist/src/icons/wallets/index.js +6 -1
- package/dist/src/types.d.ts +1 -0
- package/dist/src/types.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
### Adding an icon
|
|
2
2
|
|
|
3
3
|
1. Add the SVG file to the appropriate folder
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
1. Add a `createIconic` compomenent to the `index.ts` in that folder for that icon
|
|
5
|
+
1. Bump the version in package.json
|
|
6
|
+
1. run `nvm use`
|
|
7
|
+
1. run `yarn install` if not yet
|
|
8
|
+
1. run `yarn test -u` to update test fixtures
|
|
9
|
+
1. Open a PR
|
|
10
|
+
1. After merge, release
|
|
9
11
|
|
|
10
12
|
### Updating an icon
|
|
11
13
|
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { ThemeVariant } from '../types';
|
|
2
3
|
type SocialIconProps = React.SVGProps<SVGSVGElement> & {
|
|
3
4
|
name: string;
|
|
5
|
+
variant?: ThemeVariant;
|
|
4
6
|
};
|
|
5
|
-
export declare const SocialIcon: ({ name, ...props }: SocialIconProps) => JSX.Element;
|
|
7
|
+
export declare const SocialIcon: ({ name, variant, ...props }: SocialIconProps) => JSX.Element;
|
|
6
8
|
export {};
|
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
2
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
26
3
|
var t = {};
|
|
27
4
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -36,11 +13,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
36
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
14
|
exports.SocialIcon = void 0;
|
|
38
15
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const
|
|
16
|
+
const getSocialIcon_1 = require("./getSocialIcon");
|
|
40
17
|
const SocialIcon = (_a) => {
|
|
41
|
-
var { name } = _a, props = __rest(_a, ["name"]);
|
|
42
|
-
const
|
|
43
|
-
const Icon = map[name.toLowerCase()];
|
|
18
|
+
var { name, variant } = _a, props = __rest(_a, ["name", "variant"]);
|
|
19
|
+
const Icon = (0, getSocialIcon_1.getSocialIcon)(name, variant);
|
|
44
20
|
if (!Icon)
|
|
45
21
|
return null;
|
|
46
22
|
return (0, jsx_runtime_1.jsx)(Icon, Object.assign({}, props));
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.getSocialIcon = void 0;
|
|
27
|
+
const socials = __importStar(require("../icons/social"));
|
|
28
|
+
const getSocialIcon = (name, variant = 'light') => {
|
|
29
|
+
const map = Object.fromEntries(Object.values(socials).map((icon) => [icon.iconName, icon]));
|
|
30
|
+
if (variant === 'dark') {
|
|
31
|
+
const darkIcon = map[`${name.toLowerCase()}-dark`];
|
|
32
|
+
if (darkIcon)
|
|
33
|
+
return darkIcon;
|
|
34
|
+
}
|
|
35
|
+
const icon = map[name.toLowerCase()];
|
|
36
|
+
if (icon)
|
|
37
|
+
return icon;
|
|
38
|
+
return null;
|
|
39
|
+
};
|
|
40
|
+
exports.getSocialIcon = getSocialIcon;
|
|
@@ -3,6 +3,7 @@ export declare const BitbucketIcon: Iconic;
|
|
|
3
3
|
export declare const DiscordIcon: Iconic;
|
|
4
4
|
export declare const FacebookIcon: Iconic;
|
|
5
5
|
export declare const GithubIcon: Iconic;
|
|
6
|
+
export declare const GithubDarkIcon: Iconic;
|
|
6
7
|
export declare const GitlabIcon: Iconic;
|
|
7
8
|
export declare const GoogleIcon: Iconic;
|
|
8
9
|
export declare const HelpdeskIcon: Iconic;
|
|
@@ -11,6 +12,7 @@ export declare const MicrosoftIcon: Iconic;
|
|
|
11
12
|
export declare const SlackIcon: Iconic;
|
|
12
13
|
export declare const TelegramIcon: Iconic;
|
|
13
14
|
export declare const TwitchIcon: Iconic;
|
|
15
|
+
export declare const TwitchDarkIcon: Iconic;
|
|
14
16
|
export declare const TwitterIcon: Iconic;
|
|
15
17
|
export declare const AppleSocialIcon: Iconic;
|
|
16
18
|
export declare const AppleDarkSocialIcon: Iconic;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.YouTubeIcon = exports.InstagramIcon = exports.AppleDarkSocialIcon = exports.AppleSocialIcon = exports.TwitterIcon = exports.TwitchIcon = exports.TelegramIcon = exports.SlackIcon = exports.MicrosoftIcon = exports.LinkedinIcon = exports.HelpdeskIcon = exports.GoogleIcon = exports.GitlabIcon = exports.GithubIcon = exports.FacebookIcon = exports.DiscordIcon = exports.BitbucketIcon = void 0;
|
|
3
|
+
exports.YouTubeIcon = exports.InstagramIcon = exports.AppleDarkSocialIcon = exports.AppleSocialIcon = exports.TwitterIcon = exports.TwitchDarkIcon = exports.TwitchIcon = exports.TelegramIcon = exports.SlackIcon = exports.MicrosoftIcon = exports.LinkedinIcon = exports.HelpdeskIcon = exports.GoogleIcon = exports.GitlabIcon = exports.GithubDarkIcon = exports.GithubIcon = exports.FacebookIcon = exports.DiscordIcon = exports.BitbucketIcon = void 0;
|
|
4
4
|
const Iconic_1 = require("../../Iconic");
|
|
5
5
|
exports.BitbucketIcon = (0, Iconic_1.createIconic)({
|
|
6
6
|
iconName: 'bitbucket',
|
|
@@ -22,6 +22,11 @@ exports.GithubIcon = (0, Iconic_1.createIconic)({
|
|
|
22
22
|
alt: 'Github',
|
|
23
23
|
sourcePath: 'icons/social/github.svg'
|
|
24
24
|
});
|
|
25
|
+
exports.GithubDarkIcon = (0, Iconic_1.createIconic)({
|
|
26
|
+
iconName: 'github-dark',
|
|
27
|
+
alt: 'Github',
|
|
28
|
+
sourcePath: 'icons/social/github-dark.svg'
|
|
29
|
+
});
|
|
25
30
|
exports.GitlabIcon = (0, Iconic_1.createIconic)({
|
|
26
31
|
iconName: 'gitlab',
|
|
27
32
|
alt: 'Gitlab',
|
|
@@ -62,6 +67,11 @@ exports.TwitchIcon = (0, Iconic_1.createIconic)({
|
|
|
62
67
|
alt: 'Twitch',
|
|
63
68
|
sourcePath: 'icons/social/twitch.svg'
|
|
64
69
|
});
|
|
70
|
+
exports.TwitchDarkIcon = (0, Iconic_1.createIconic)({
|
|
71
|
+
iconName: 'twitch-dark',
|
|
72
|
+
alt: 'Twitch',
|
|
73
|
+
sourcePath: 'icons/social/twitch-dark.svg'
|
|
74
|
+
});
|
|
65
75
|
exports.TwitterIcon = (0, Iconic_1.createIconic)({
|
|
66
76
|
iconName: 'twitter',
|
|
67
77
|
alt: 'Twitter',
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ZengoIcon = exports.MagicLinkIcon = exports.WalletConnectIcon = exports.VenlyIcon = exports.UnstoppableIcon = exports.TrustIcon = exports.TorusIcon = exports.TerraIcon = exports.TallyCashIcon = exports.StrokeIcon = exports.SpotIcon = exports.SolflareIcon = exports.SlopeIcon = exports.SequenceIcon = exports.SafeIcon = exports.RainbowIcon = exports.PhantomIcon = exports.OpeanSeaIcon = exports.OmniIcon = exports.MyalgoIcon = exports.MissingIcon = exports.MetaMaskIcon = exports.MaticIcon = exports.LinenIcon = exports.LilicoIcon = exports.LedgerIcon = exports.KeplrIcon = exports.InjectedWalletIcon = exports.ImTokenWallet = exports.GlowIcon = exports.GamestopIcon = exports.FrameIcon = exports.FortmaticIcon = exports.FireblocksIcon = exports.ExodusIcon = exports.SignInWithEmailIcon = exports.EmailSignIcon = exports.DawnIcon = exports.DapperIcon = exports.CryptoIcon = exports.CoinbaseIcon = exports.Coin90Icon = exports.BraavosIcon = exports.BloctoIcon = exports.BitPayIcon = exports.BinanceIcon = exports.ArgentXIcon = exports.OneInchIcon = void 0;
|
|
3
|
+
exports.SuperbIcon = exports.ZengoIcon = exports.MagicLinkIcon = exports.WalletConnectIcon = exports.VenlyIcon = exports.UnstoppableIcon = exports.TrustIcon = exports.TorusIcon = exports.TerraIcon = exports.TallyCashIcon = exports.StrokeIcon = exports.SpotIcon = exports.SolflareIcon = exports.SlopeIcon = exports.SequenceIcon = exports.SafeIcon = exports.RainbowIcon = exports.PhantomIcon = exports.OpeanSeaIcon = exports.OmniIcon = exports.MyalgoIcon = exports.MissingIcon = exports.MetaMaskIcon = exports.MaticIcon = exports.LinenIcon = exports.LilicoIcon = exports.LedgerIcon = exports.KeplrIcon = exports.InjectedWalletIcon = exports.ImTokenWallet = exports.GlowIcon = exports.GamestopIcon = exports.FrameIcon = exports.FortmaticIcon = exports.FireblocksIcon = exports.ExodusIcon = exports.SignInWithEmailIcon = exports.EmailSignIcon = exports.DawnIcon = exports.DapperIcon = exports.CryptoIcon = exports.CoinbaseIcon = exports.Coin90Icon = exports.BraavosIcon = exports.BloctoIcon = exports.BitPayIcon = exports.BinanceIcon = exports.ArgentXIcon = exports.OneInchIcon = void 0;
|
|
4
4
|
const Iconic_1 = require("../../Iconic");
|
|
5
5
|
exports.OneInchIcon = (0, Iconic_1.createIconic)({
|
|
6
6
|
iconName: '1inch.svg',
|
|
@@ -242,3 +242,8 @@ exports.ZengoIcon = (0, Iconic_1.createIconic)({
|
|
|
242
242
|
alt: 'Zengo Wallet',
|
|
243
243
|
sourcePath: 'icons/wallets/zengo.svg'
|
|
244
244
|
});
|
|
245
|
+
exports.SuperbIcon = (0, Iconic_1.createIconic)({
|
|
246
|
+
iconName: 'superb',
|
|
247
|
+
alt: 'Superb Wallet',
|
|
248
|
+
sourcePath: 'icons/wallets/superb.svg'
|
|
249
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ThemeVariant = 'light' | 'dark';
|