Split variants (#368)

This commit is contained in:
Pascal Jufer 2023-10-29 00:33:17 +02:00 committed by GitHub
commit d73b7282dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1606 changed files with 3330 additions and 2076 deletions

View file

@ -0,0 +1 @@
../../../icons

View file

@ -1,14 +1,22 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
args:
dependency: transitive
description:
name: args
sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596
url: "https://pub.dev"
source: hosted
version: "2.4.2"
async:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
@ -21,10 +29,10 @@ packages:
dependency: transitive
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
version: "1.3.0"
clock:
dependency: transitive
description:
@ -37,10 +45,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.2"
fake_async:
dependency: transitive
description:
@ -66,10 +74,10 @@ packages:
dependency: transitive
description:
name: flutter_svg
sha256: "6ff9fa12892ae074092de2fa6a9938fb21dbabfdaa2ff57dc697ff912fc8d4b2"
sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338"
url: "https://pub.dev"
source: hosted
version: "1.1.6"
version: "2.0.7"
flutter_test:
dependency: "direct dev"
description: flutter
@ -81,15 +89,7 @@ packages:
path: ".."
relative: true
source: path
version: "6.4.0"
js:
dependency: transitive
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.dev"
source: hosted
version: "0.6.5"
version: "6.11.0"
lints:
dependency: transitive
description:
@ -102,42 +102,34 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
version: "0.12.16"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.5.0"
meta:
dependency: transitive
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.9.1"
path:
dependency: transitive
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.2"
path_drawing:
dependency: transitive
description:
name: path_drawing
sha256: bbb1934c0cbb03091af082a6389ca2080345291ef07a5fa6d6e078ba8682f977
url: "https://pub.dev"
source: hosted
version: "1.0.1"
version: "1.8.3"
path_parsing:
dependency: transitive
description:
@ -150,10 +142,10 @@ packages:
dependency: transitive
description:
name: petitparser
sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4"
sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750
url: "https://pub.dev"
source: hosted
version: "5.1.0"
version: "5.4.0"
sky_engine:
dependency: transitive
description: flutter
@ -163,10 +155,10 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
@ -203,10 +195,34 @@ packages:
dependency: transitive
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.4.16"
version: "0.6.0"
vector_graphics:
dependency: transitive
description:
name: vector_graphics
sha256: b16dadf7eb610e20da044c141b4a0199a5e8082ca21daba68322756f953ce714
url: "https://pub.dev"
source: hosted
version: "1.1.9"
vector_graphics_codec:
dependency: transitive
description:
name: vector_graphics_codec
sha256: a4b01403d5c613db115e30e71eca33f7e9e09f2d3c52c3fb84e16333ecddc539
url: "https://pub.dev"
source: hosted
version: "1.1.9"
vector_graphics_compiler:
dependency: transitive
description:
name: vector_graphics_compiler
sha256: d26c0e2f237476426523eb25512e4c09fa27c6d33ed659a0e69d79e20b5dc47f
url: "https://pub.dev"
source: hosted
version: "1.1.9"
vector_math:
dependency: transitive
description:
@ -215,14 +231,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
web:
dependency: transitive
description:
name: web
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.1.4-beta"
xml:
dependency: transitive
description:
name: xml
sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5"
sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84"
url: "https://pub.dev"
source: hosted
version: "6.2.2"
version: "6.3.0"
sdks:
dart: ">=2.19.4 <3.0.0"
flutter: ">=2.11.0-0.1.pre"
dart: ">=3.1.0-185.0.dev <4.0.0"
flutter: ">=3.7.0-0"

View file

@ -22,4 +22,4 @@ dev_dependencies:
flutter:
assets:
- ../../icons/
- assets/icons/

View file

@ -1,32 +0,0 @@
{
"icon": true,
"ref": true,
"typescript": true,
"native": true,
"svgProps": {
"width": "1.5em",
"height": "1.5em",
"color": "currentColor"
},
"jsx": {
"babelConfig": {
"plugins": [
[
"@svgr/babel-plugin-remove-jsx-attribute",
{
"elements":["Svg"],
"attributes":["xmlns"]
}
],
[
"@svgr/babel-plugin-remove-jsx-attribute",
{
"elements": ["Path"],
"attributes": ["strokeWidth"]
},
"remove-stroke-width"
]
]
}
}
}

View file

@ -73,17 +73,4 @@ return (
## Icon names
For the most part, the React components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`). However, some names have been altered slightly either because they start with numerical digits, which would lead to invalid React component names, or because they are organisations which use PascalCase in their brand names, such as `GitHub`. The altered names are as follows:
| Iconoir Name | React Native Component |
| ---------------- | ---------------------- |
| `1st-medal` | `Medal1St` |
| `4k-display` | `Display4K` |
| `4x4-cell` | `Cell4X4` |
| `360-view` | `View360` |
| `github` | `GitHub` |
| `github-outline` | `GitHubOutline` |
| `gitlab-full` | `GitLabFull` |
| `linkedin` | `LinkedIn` |
| `tiktok` | `TikTok` |
| `youtube` | `YouTube` |
The React components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`).

View file

@ -20,26 +20,32 @@
},
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": "./dist/esm/index.mjs",
"require": "./dist/index.js"
},
"./regular": {
"import": "./dist/esm/regular/index.mjs",
"require": "./dist/regular/index.js"
},
"./solid": {
"import": "./dist/esm/solid/index.mjs",
"require": "./dist/solid/index.js"
}
},
"main": "dist/index.js",
"module": "dist/esm/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"dist": "tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
"prepublishOnly": "npm run dist"
},
"devDependencies": {
"@types/react": "^18.2.22",
"@types/react-native": "^0.72.2",
"react": "^18.2.0",
"react-native-svg": "^13.14.0",
"typescript": "^5.2.2"
"@types/react": "^18.2.33",
"react-native-svg": "^13.14.0"
},
"peerDependencies": {
"react": "^16.8.6 || ^17 || ^18",
"react-native": ">=0.50.0",
"react-native-svg": ">=12.1.1"
"react-native": ">=0.50.0"
}
}

View file

@ -1,13 +0,0 @@
import React from 'react'
import { SvgProps } from 'react-native-svg'
export type IconoirContextValue = Partial<SvgProps>
export const IconoirContext = React.createContext<IconoirContextValue>({})
export interface IconoirProviderProps {
iconProps?: Partial<Omit<SvgProps, 'children'>>
children: React.ReactNode
}
export function IconoirProvider({ iconProps, children }: IconoirProviderProps) {
return <IconoirContext.Provider value={iconProps || {}} children={children} />
}

View file

@ -1,7 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext",
"outDir": "./dist/esm"
}
}

View file

@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"moduleResolution": "node",
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist"
}
}

View file

@ -1,28 +0,0 @@
{
"icon": true,
"ref": true,
"typescript": true,
"svgProps": {
"width": "1.5em",
"height": "1.5em",
"color": "currentColor"
},
"jsx": {
"babelConfig": {
"plugins": [
[
"@svgr/babel-plugin-remove-jsx-attribute",
{
"elements": [
"path"
],
"attributes": [
"strokeWidth"
]
},
"remove-stroke-width"
]
]
}
}
}

View file

@ -67,19 +67,6 @@ return (
## Icon names
For the most part, the React components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`). However, some names have been altered slightly either because they start with numerical digits, which would lead to invalid React component names, or because they are organisations which use PascalCase in their brand names, such as `GitHub`. The altered names are as follows:
| Iconoir Name | React Component |
| ---------------- | --------------- |
| `1st-medal` | `Medal1St` |
| `4k-display` | `Display4K` |
| `4x4-cell` | `Cell4X4` |
| `360-view` | `View360` |
| `github` | `GitHub` |
| `github-outline` | `GitHubOutline` |
| `gitlab-full` | `GitLabFull` |
| `linkedin` | `LinkedIn` |
| `tiktok` | `TikTok` |
| `youtube` | `YouTube` |
The React components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`).
<SuggestLibrary />

View file

@ -22,32 +22,26 @@
"sideEffects": false,
"exports": {
".": {
"react-server": "./dist/esm/server/index.mjs",
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/esm/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"default": "./dist/index.js"
"import": "./dist/esm/index.mjs",
"require": "./dist/index.js"
},
"./regular": {
"import": "./dist/esm/regular/index.mjs",
"require": "./dist/regular/index.js"
},
"./solid": {
"import": "./dist/esm/solid/index.mjs",
"require": "./dist/solid/index.js"
}
},
"main": "dist/index.js",
"module": "dist/esm/index.mjs",
"types": "dist/index.d.ts",
"main": "./dist/index.js",
"module": "./dist/esm/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"dist": "rm -rf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && node scripts/fix-esm.js && rm -rf dist/server",
"prepublishOnly": "npm run dist"
},
"devDependencies": {
"@types/react": "^18.2.22",
"react": "^18.2.0",
"typescript": "^5.2.2"
"@types/react": "^18.2.33"
},
"peerDependencies": {
"react": "^16.8.6 || ^17 || ^18"

View file

@ -1,23 +0,0 @@
const path = require('path');
const fs = require('fs');
function processDirectory(relative) {
const OUTPUT = path.resolve(__dirname, '../dist', relative);
const files = fs.readdirSync(OUTPUT);
for (const file of files) {
if (fs.statSync(path.resolve(OUTPUT, file)).isFile() === false) continue;
const renamed = file.replace(/\.js$/, '.mjs');
fs.renameSync(path.resolve(OUTPUT, file), path.resolve(OUTPUT, renamed));
// Replace all imports without an extension to .mjs
const contents = fs.readFileSync(path.resolve(OUTPUT, renamed), 'utf8');
fs.writeFileSync(
path.resolve(OUTPUT, renamed),
contents.replace(/(\bfrom\s+["']\..*)(["'])/g, '$1.mjs$2')
);
}
}
processDirectory('esm');
processDirectory('esm/server');

View file

@ -1,12 +0,0 @@
import React from 'react'
export type IconoirContextValue = Partial<React.SVGProps<SVGSVGElement>>
export const IconoirContext = React.createContext<IconoirContextValue>({})
export interface IconoirProviderProps {
iconProps?: Partial<React.SVGProps<SVGSVGElement>>
children: React.ReactNode
}
export function IconoirProvider({ iconProps, children }: IconoirProviderProps) {
return <IconoirContext.Provider value={iconProps || {}} children={children} />
}

View file

@ -1,14 +0,0 @@
import React from 'react'
console.warn('Using IconoirContext in server components has no effect, because ' +
'server components do not support React Context. If you would like to use ' +
'IconoirContext, add \'use client\' to the top of your component.')
export interface IconoirContextValue {}
export const IconoirContext = null
interface IconoirProviderProps {
children: React.ReactNode
}
export function IconoirProvider({ children }: IconoirProviderProps) {
return children
}

View file

@ -1,8 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": false,
"module": "esnext",
"outDir": "./dist/esm"
}
}

View file

@ -1,14 +0,0 @@
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"moduleResolution": "node",
"jsx": "react",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist"
}
}

View file

@ -90,19 +90,6 @@ import { IconoirProvider, Check } from '@iconoir/vue';
## Icon names
For the most part, the Vue components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`). However, some names have been altered slightly either because they start with numerical digits, which would lead to invalid Vue component names, or because they are organisations which use PascalCase in their brand names, such as `GitHub`. The altered names are as follows:
| Iconoir Name | Vue Component |
| ---------------- | --------------- |
| `1st-medal` | `Medal1St` |
| `4k-display` | `Display4K` |
| `4x4-cell` | `Cell4X4` |
| `360-view` | `View360` |
| `github` | `GitHub` |
| `github-outline` | `GitHubOutline` |
| `gitlab-full` | `GitLabFull` |
| `linkedin` | `LinkedIn` |
| `tiktok` | `TikTok` |
| `youtube` | `YouTube` |
The Vue components are named as PascalCase variations of their reference names (i.e. `add-circle-outline` becomes `AddCircleOutline`).
<SuggestLibrary />

View file

@ -0,0 +1,13 @@
<script setup lang="ts">
import { provide } from 'vue-demi';
import type { SVGAttributes } from 'vue-demi';
import providerKey from './providerKey';
interface Props {
iconProps: SVGAttributes;
}
const props = defineProps<Props>();
provide(providerKey, props.iconProps);
</script>
<template>
<slot />
</template>

View file

@ -0,0 +1,3 @@
import type { InjectionKey, SVGAttributes } from 'vue-demi';
const providerKey = Symbol() as InjectionKey<SVGAttributes>;
export default providerKey;