@morphos/icons
Changelog for @morphos/icons.
2.0.4
- Declares the
@morphos/corepeer dependency as a caret range (^0.1.6) instead of an exact version, so npm no longer installs a second copy or fails with a peer conflict when the Morphos packages are released at different patch versions.
2.0.3
- Requires
@praxisjs/runtimeand@praxisjs/jsx0.8.1, which write booleanaria-*attributes as"true"and"false"instead of an empty attribute (or none forfalse).
2.0.2
- Opts into
@praxisjs/vite-plugin's library optimization: with vite-plugin 4.2 or later, apps compile these components from their sources like their own code (compiled templates, keyed lists, decorated fields in fast properties), so they mount about 25 to 40% faster. The published package no longer includes its tests.
2.0.0
- Breaking:
LucideSource(and theLucideIconNametype) moved out of@morphos/iconsinto a new subpath,@morphos/icons/lucide. The main entry no longer importslucide, so apps that use only their own icon set don't need it installed or bundled. Update imports:import { LucideSource } from '@morphos/icons/lucide'. lucideis now an optional peer dependency — install it only if you useLucideSource.Icon'snameautocompletes lucide's names once@morphos/icons/lucideis imported (it augments the newIconNameRegistryinterface). The main entry's types no longer depend onlucide, so type-checking works withskipLibCheck: falseeven when it isn't installed.iconsPlugin()now trims the built-in"lucide"set in production builds. It scans your source for lucide icon names and bundles only those, instead of all ~2,100 icons (~500 kB). Automatic onceiconsPlugin()is in your Vite config — no new setup. Dev is unchanged. Configure withiconsPlugin({ lucide: { include, scan } }), or opt out withiconsPlugin({ lucide: false }).
1.0.1
- Test coverage for
Icon's structured-shape rendering (circle,rect,line,polyline,ellipse, and unrecognized tags) and forIconProvider's error path when a decorated source's resolver was unregistered before use. No behavior change.
1.0.0
Breaking redesign around a single Icon component that resolves icons by name, plus a provider
system for choosing which icon set name resolves against:
- Breaking:
LucideIconandPhosphorIconare removed.Iconno longer takes asvg/icondata prop — it now takes a typedname, resolved against the configured icon provider.lucideis a realpeerDependency— its icon data is read live (import { icons } from "lucide"), no per-icon data wiring needed. - Breaking:
IconProvideris now mandatory. There is no default provider — not even for"lucide". Every app must apply@IconProvider(...)somewhere, orIconlogs a warning and renders nothing. IconProvider— a class decorator, same pattern as@Router, applied directly to the root component to configure the app-wide provider. Takes anIconSourceclass directly (not a string), or an array to register several at once, defaulting to the first. Runs at class-decoration time, before the class is ever instantiated, so there's no ordering caveat to work around.setIconProvider/getIconProviderdo the same thing without decorating a class.RegisterIconProvider+IconSource— registers a custom icon provider as a class, decorator-first, consistent with every other Morphos/PraxisJS component. Takes an optional second argument,defaultIcons(Record<name, svg>, or a glob path string via@morphos/icons/vite'siconsPlugin()) —resolveno longer needs implementing for the common case.Icon'sproviderprop andsetIconProvidertake the registered name, exactly like the built-in"lucide";RegisterIconProvideralso tags the class itself soIconProvidercan read the name back."lucide"isn't special-cased anywhere: it'sLucideSource, a built-inIconSource— a pre-configured wrapper, registered and activated the same way a custom provider is (@IconProvider(LucideSource), never automatic).resolvecan return structured{ nodes, viewBox? }data — the same[tag, attrs][]formatlucideuses — instead of an{ svg }string, for any provider whose source data is already shaped that way.IconInstance— a PraxisJSComposablewrappinggetIconProvider/setIconProvider, for changing the provider from inside a component via@Compose(IconInstance), same pattern as@praxisjs/composables'WindowSize.provider(onIcon/setIconProvider) andIcon'snameare typed asLiteralUnions — autocomplete still suggests the known values, but any string is accepted, so custom provider names and their icon names type-check too.
0.1.0
Initial release.
Icon— generic, framework-agnostic SVG icon primitive for raw markup.LucideIcon— renders icon data from thelucidepackage's[tag, attrs][]node format.PhosphorIcon— renders a raw SVG asset from@phosphor-icons/core, withmirroredsupport.