mirror of
https://github.com/iconify/iconify.git
synced 2024-11-09 23:00:56 +00:00
Minor fixes
This commit is contained in:
parent
8bd6d0768c
commit
0045b0e403
@ -4,7 +4,7 @@
|
|||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"declarationMap": true,
|
"declarationMap": true,
|
||||||
"sourceMap": true,
|
"sourceMap": false,
|
||||||
"composite": true,
|
"composite": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
|
4
packages/react-demo/src/App.js
vendored
4
packages/react-demo/src/App.js
vendored
@ -7,7 +7,7 @@ import {
|
|||||||
addIcon as addOnlineIcon,
|
addIcon as addOnlineIcon,
|
||||||
addCollection as addOnlineCollection,
|
addCollection as addOnlineCollection,
|
||||||
disableCache,
|
disableCache,
|
||||||
} from '@iconify/react/dist/iconify';
|
} from '@iconify/react';
|
||||||
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
||||||
import playIcon from '@iconify-icons/mdi-light/play';
|
import playIcon from '@iconify-icons/mdi-light/play';
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ addOfflineIcon('demo', presentationPlay);
|
|||||||
// Add 'mdi-light:play' as 'demo' for full module
|
// Add 'mdi-light:play' as 'demo' for full module
|
||||||
addOnlineIcon('demo', playIcon);
|
addOnlineIcon('demo', playIcon);
|
||||||
|
|
||||||
// Add custom icon as 'experiment'
|
// Add different custom icons as 'experiment2' for offline and online modes
|
||||||
addOfflineIcon('experiment2', {
|
addOfflineIcon('experiment2', {
|
||||||
width: 16,
|
width: 16,
|
||||||
height: 16,
|
height: 16,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon as OfflineIcon } from '@iconify/react/dist/offline';
|
import { Icon as OfflineIcon } from '@iconify/react/dist/offline';
|
||||||
import { Icon as FullIcon } from '@iconify/react/dist/iconify';
|
import { Icon as FullIcon } from '@iconify/react';
|
||||||
|
|
||||||
export function InlineDemo() {
|
export function InlineDemo() {
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon } from '@iconify/react/dist/iconify';
|
import { Icon } from '@iconify/react';
|
||||||
|
|
||||||
export function FullUsageDemo() {
|
export function FullUsageDemo() {
|
||||||
return (
|
return (
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Icon } from '@iconify/react/dist/iconify';
|
import { Icon } from '@iconify/react';
|
||||||
import accountIcon from '@iconify-icons/mdi-light/account';
|
import accountIcon from '@iconify-icons/mdi-light/account';
|
||||||
import alertIcon from '@iconify-icons/mdi-light/alert';
|
import alertIcon from '@iconify-icons/mdi-light/alert';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { InlineIcon, addAPIProvider, _api } from '@iconify/react/dist/iconify';
|
import { InlineIcon, addAPIProvider, _api } from '@iconify/react';
|
||||||
import { mockAPIModule, mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
import { mockAPIModule, mockAPIData } from '@iconify/core/lib/api/modules/mock';
|
||||||
import { TestIcons, toggleTest } from './TestIcons';
|
import { TestIcons, toggleTest } from './TestIcons';
|
||||||
import playIcon from '@iconify-icons/mdi-light/map-marker';
|
import playIcon from '@iconify-icons/mdi-light/map-marker';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { InlineIcon } from '@iconify/react/dist/iconify';
|
import { InlineIcon } from '@iconify/react';
|
||||||
import { TestIcons, toggleTest } from './TestIcons';
|
import { TestIcons, toggleTest } from './TestIcons';
|
||||||
|
|
||||||
export function TestsFullOffline() {
|
export function TestsFullOffline() {
|
||||||
|
@ -104,7 +104,7 @@ export const render = (
|
|||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
customisations[key] = rotateFromString(value);
|
customisations[key] = rotateFromString(value);
|
||||||
} else if (typeof value === 'number') {
|
} else if (typeof value === 'number') {
|
||||||
componentProps[key] = value;
|
customisations[key] = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
addIcon as addOnlineIcon,
|
addIcon as addOnlineIcon,
|
||||||
addCollection as addOnlineCollection,
|
addCollection as addOnlineCollection,
|
||||||
disableCache,
|
disableCache,
|
||||||
} from '@iconify/svelte/dist/iconify';
|
} from '@iconify/svelte';
|
||||||
|
|
||||||
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
import presentationPlay from '@iconify-icons/mdi-light/presentation-play';
|
||||||
import playIcon from '@iconify-icons/mdi-light/play';
|
import playIcon from '@iconify-icons/mdi-light/play';
|
||||||
|
@ -288,22 +288,6 @@ if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
.
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get icon status
|
* Function to get icon status
|
||||||
*/
|
*/
|
||||||
|
@ -83,7 +83,7 @@ export function render(
|
|||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
customisations[key] = rotateFromString(value);
|
customisations[key] = rotateFromString(value);
|
||||||
} else if (typeof value === 'number') {
|
} else if (typeof value === 'number') {
|
||||||
componentProps[key] = value;
|
customisations[key] = value;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -80,31 +80,6 @@ export function addCollection(
|
|||||||
/**
|
/**
|
||||||
* Component
|
* Component
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
// Currently this cannot be used because in functional component style is inherited, overriding style generated by render()
|
|
||||||
export function Icon(props: Record<string, unknown>, context): VNode {
|
|
||||||
// Check icon
|
|
||||||
const icon =
|
|
||||||
typeof props.icon === 'string'
|
|
||||||
? storage[props.icon]
|
|
||||||
: typeof props.icon === 'object'
|
|
||||||
? fullIcon(props.icon as IconifyIcon)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
// Validate icon object
|
|
||||||
if (
|
|
||||||
icon === null ||
|
|
||||||
typeof icon !== 'object' ||
|
|
||||||
typeof icon.body !== 'string'
|
|
||||||
) {
|
|
||||||
return context.slots.default ? context.slots.default() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Valid icon: render it
|
|
||||||
return render(icon, context.attrs as IconProps);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
export const Icon = defineComponent({
|
export const Icon = defineComponent({
|
||||||
// Do not inherit other attributes: it is handled by render()
|
// Do not inherit other attributes: it is handled by render()
|
||||||
inheritAttrs: false,
|
inheritAttrs: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user