@egoist/tailwindcss-icons
Advanced tools
Comparing version 1.3.3 to 1.4.0
@@ -263,4 +263,5 @@ import * as tailwindcss_types_config from 'tailwindcss/types/config'; | ||
declare const availableCollectionNames: readonly ["material-symbols", "ic", "mdi", "ph", "solar", "tabler", "ri", "bi", "carbon", "iconamoon", "ion", "uil", "teenyicons", "mingcute", "clarity", "iconoir", "majesticons", "zondicons", "ant-design", "bx", "bxs", "gg", "octicon", "cil", "lucide", "basil", "pixelarticons", "system-uicons", "ci", "akar-icons", "memory", "typcn", "radix-icons", "ep", "circum", "mdi-light", "fe", "eos-icons", "charm", "prime", "humbleicons", "uiw", "uim", "uit", "uis", "maki", "gridicons", "mi", "quill", "gala", "fluent", "icon-park-outline", "icon-park-solid", "icon-park-twotone", "icon-park", "vscode-icons", "jam", "heroicons", "codicon", "pajamas", "pepicons-pop", "pepicons-print", "pepicons-pencil", "bytesize", "ei", "streamline", "guidance", "fa6-solid", "fa6-regular", "ooui", "nimbus", "formkit", "line-md", "svg-spinners", "openmoji", "twemoji", "noto", "fluent-emoji", "fluent-emoji-flat", "fluent-emoji-high-contrast", "noto-v1", "emojione", "emojione-monotone", "emojione-v1", "fxemoji", "streamline-emojis", "bxl", "logos", "simple-icons", "cib", "fa6-brands", "nonicons", "arcticons", "file-icons", "devicon", "devicon-plain", "skill-icons", "brandico", "entypo-social", "cryptocurrency", "cryptocurrency-color", "flag", "circle-flags", "flagpack", "cif", "gis", "map", "geo", "game-icons", "fad", "academicons", "wi", "healthicons", "medical-icon", "covid", "la", "eva", "dashicons", "flat-color-icons", "entypo", "foundation", "raphael", "icons8", "iwwa", "heroicons-outline", "heroicons-solid", "fa-solid", "fa-regular", "fa-brands", "fa", "fluent-mdl2", "fontisto", "icomoon-free", "ps", "subway", "oi", "wpf", "simple-line-icons", "et", "el", "vaadin", "grommet-icons", "whh", "si-glyph", "zmdi", "ls", "bpmn", "flat-ui", "vs", "topcoat", "il", "websymbol", "fontelico", "feather", "mono-icons", "pepicons"]; | ||
/** All the available icon collections when you have `@iconify/json` installed */ | ||
type CollectionNames = "material-symbols" | "ic" | "mdi" | "ph" | "solar" | "tabler" | "ri" | "bi" | "carbon" | "iconamoon" | "ion" | "uil" | "teenyicons" | "mingcute" | "clarity" | "iconoir" | "majesticons" | "zondicons" | "ant-design" | "bx" | "bxs" | "gg" | "octicon" | "cil" | "lucide" | "basil" | "pixelarticons" | "system-uicons" | "ci" | "akar-icons" | "memory" | "typcn" | "radix-icons" | "ep" | "circum" | "mdi-light" | "fe" | "eos-icons" | "charm" | "prime" | "humbleicons" | "uiw" | "uim" | "uit" | "uis" | "maki" | "gridicons" | "mi" | "quill" | "gala" | "fluent" | "icon-park-outline" | "icon-park-solid" | "icon-park-twotone" | "icon-park" | "vscode-icons" | "jam" | "heroicons" | "codicon" | "pajamas" | "pepicons-pop" | "pepicons-print" | "pepicons-pencil" | "bytesize" | "ei" | "streamline" | "guidance" | "fa6-solid" | "fa6-regular" | "ooui" | "nimbus" | "formkit" | "line-md" | "svg-spinners" | "openmoji" | "twemoji" | "noto" | "fluent-emoji" | "fluent-emoji-flat" | "fluent-emoji-high-contrast" | "noto-v1" | "emojione" | "emojione-monotone" | "emojione-v1" | "fxemoji" | "streamline-emojis" | "bxl" | "logos" | "simple-icons" | "cib" | "fa6-brands" | "nonicons" | "arcticons" | "file-icons" | "devicon" | "devicon-plain" | "skill-icons" | "brandico" | "entypo-social" | "cryptocurrency" | "cryptocurrency-color" | "flag" | "circle-flags" | "flagpack" | "cif" | "gis" | "map" | "geo" | "game-icons" | "fad" | "academicons" | "wi" | "healthicons" | "medical-icon" | "covid" | "la" | "eva" | "dashicons" | "flat-color-icons" | "entypo" | "foundation" | "raphael" | "icons8" | "iwwa" | "heroicons-outline" | "heroicons-solid" | "fa-solid" | "fa-regular" | "fa-brands" | "fa" | "fluent-mdl2" | "fontisto" | "icomoon-free" | "ps" | "subway" | "oi" | "wpf" | "simple-line-icons" | "et" | "el" | "vaadin" | "grommet-icons" | "whh" | "si-glyph" | "zmdi" | "ls" | "bpmn" | "flat-ui" | "vs" | "topcoat" | "il" | "websymbol" | "fontelico" | "feather" | "mono-icons" | "pepicons"; | ||
type CollectionNames = typeof availableCollectionNames[number]; | ||
@@ -295,5 +296,5 @@ type GenerateOptions = { | ||
type IconsPluginOptions = { | ||
collections: Record<string, Optional<IconifyJSONIconsData, "prefix">>; | ||
collections?: Record<string, Optional<IconifyJSONIconsData, "prefix">>; | ||
} & IconsOptions; | ||
declare const iconsPlugin: ({ collections, ...options }: IconsPluginOptions) => { | ||
declare const iconsPlugin: (iconsPluginOptions?: IconsPluginOptions) => { | ||
handler: tailwindcss_types_config.PluginCreator; | ||
@@ -300,0 +301,0 @@ config?: Partial<tailwindcss_types_config.Config> | undefined; |
@@ -71,2 +71,7 @@ "use strict"; | ||
} | ||
var isPackageExists = (id) => { | ||
const p = callerPath(); | ||
const cwd = p ? import_path.default.dirname(p) : process.cwd(); | ||
return Boolean(localResolve(cwd, id)); | ||
}; | ||
var getIconCollections = (include = "all") => { | ||
@@ -121,8 +126,18 @@ const p = callerPath(); | ||
// types.ts | ||
var availableCollectionNames = ["material-symbols", "ic", "mdi", "ph", "solar", "tabler", "ri", "bi", "carbon", "iconamoon", "ion", "uil", "teenyicons", "mingcute", "clarity", "iconoir", "majesticons", "zondicons", "ant-design", "bx", "bxs", "gg", "octicon", "cil", "lucide", "basil", "pixelarticons", "system-uicons", "ci", "akar-icons", "memory", "typcn", "radix-icons", "ep", "circum", "mdi-light", "fe", "eos-icons", "charm", "prime", "humbleicons", "uiw", "uim", "uit", "uis", "maki", "gridicons", "mi", "quill", "gala", "fluent", "icon-park-outline", "icon-park-solid", "icon-park-twotone", "icon-park", "vscode-icons", "jam", "heroicons", "codicon", "pajamas", "pepicons-pop", "pepicons-print", "pepicons-pencil", "bytesize", "ei", "streamline", "guidance", "fa6-solid", "fa6-regular", "ooui", "nimbus", "formkit", "line-md", "svg-spinners", "openmoji", "twemoji", "noto", "fluent-emoji", "fluent-emoji-flat", "fluent-emoji-high-contrast", "noto-v1", "emojione", "emojione-monotone", "emojione-v1", "fxemoji", "streamline-emojis", "bxl", "logos", "simple-icons", "cib", "fa6-brands", "nonicons", "arcticons", "file-icons", "devicon", "devicon-plain", "skill-icons", "brandico", "entypo-social", "cryptocurrency", "cryptocurrency-color", "flag", "circle-flags", "flagpack", "cif", "gis", "map", "geo", "game-icons", "fad", "academicons", "wi", "healthicons", "medical-icon", "covid", "la", "eva", "dashicons", "flat-color-icons", "entypo", "foundation", "raphael", "icons8", "iwwa", "heroicons-outline", "heroicons-solid", "fa-solid", "fa-regular", "fa-brands", "fa", "fluent-mdl2", "fontisto", "icomoon-free", "ps", "subway", "oi", "wpf", "simple-line-icons", "et", "el", "vaadin", "grommet-icons", "whh", "si-glyph", "zmdi", "ls", "bpmn", "flat-ui", "vs", "topcoat", "il", "websymbol", "fontelico", "feather", "mono-icons", "pepicons"]; | ||
// src/index.ts | ||
var iconsPlugin = ({ | ||
collections, | ||
...options | ||
}) => { | ||
const { scale = 1, prefix = "i", extraProperties = {} } = options ?? {}; | ||
var iconsPlugin = (iconsPluginOptions) => { | ||
const { | ||
collections: propsCollections, | ||
scale = 1, | ||
prefix = "i", | ||
extraProperties = {} | ||
} = iconsPluginOptions ?? {}; | ||
const collections = propsCollections ?? getIconCollections( | ||
availableCollectionNames.filter( | ||
(name) => isPackageExists(`@iconify-json/${name}`) | ||
) | ||
); | ||
const components = {}; | ||
@@ -129,0 +144,0 @@ for (const prefix2 of Object.keys(collections)) { |
{ | ||
"name": "@egoist/tailwindcss-icons", | ||
"version": "1.3.3", | ||
"version": "1.4.0", | ||
"description": "Icons utility for TailwindCSS", | ||
@@ -24,3 +24,4 @@ "publishConfig": { | ||
"prepublishOnly": "pnpm run build", | ||
"gen-types": "node ./gen-types.mjs" | ||
"gen-types": "node ./gen-types.mjs", | ||
"prepare": "pnpm run gen-types" | ||
}, | ||
@@ -27,0 +28,0 @@ "license": "MIT", |
@@ -30,2 +30,3 @@ **💛 You can help the author become a full-time open-source maintainer by [sponsoring him on GitHub](https://github.com/sponsors/egoist).** | ||
// Select the icon collections you want to use | ||
// You can also ignore this option to automatically discover all icon collections you have installed | ||
collections: getIconCollections(["mdi", "lucide"]), | ||
@@ -48,2 +49,10 @@ }), | ||
### Plugin Options | ||
| Option | Type | Default | Description | | ||
| --------------- | ---------------------- | ------- | -------------------------------------------------- | | ||
| prefix | string | `i` | Class prefix for matching icon rules | | ||
| scale | number | `1` | Scale relative to the current font size | | ||
| extraProperties | Record<string, string> | `{}` | Extra CSS properties applied to the generated CSS. | | ||
### Custom Icons | ||
@@ -50,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
27266
575
91