Skip to content

feat: NucleusIcons#25

Open
Priva28 wants to merge 4 commits intonucleusfontsfrom
nucleus-icons
Open

feat: NucleusIcons#25
Priva28 wants to merge 4 commits intonucleusfontsfrom
nucleus-icons

Conversation

@Priva28
Copy link
Copy Markdown
Contributor

@Priva28 Priva28 commented May 6, 2026

Summary

Adds icon tokens to nucleus. Source SVGs live in tokens/definitions/icons/{outline,regular,solid} (140-ish per variant, 141 unique icons total — most ship in all three variants, a handful are variant-specific). The build pipeline now emits per-platform icon outputs alongside the existing colors and fonts.

Almost all of it is auto-generated icon assets. Per icon, per variant we emit:

  • iOS: an .imageset directory with Contents.json + the SVG (≈ 832 files)
  • Android: a vector drawable XML (≈ 416 files)
  • Web: the raw SVG copy (≈ 416 files, only if build/ is tracked)

iOS

  • New NucleusIcons SPM library with Resources/Icons.xcassets (one .imageset per icon × variant, all template-rendered with vector preservation).
  • NucleusIcon is a String-rawValue enum where the raw value is the kebab-case icon name. .image(_:) and .uiImage(_:) return a SwiftUI Image? / UIImage? for a given Variant, returning nil if the icon doesn't ship in that variant. availableVariants exposes which variants exist per case.
  • API is intentionally minimal/raw for now.

Android

  • 416 vector drawables generated from the SVGs and dropped into android/nucleus/src/main/res/drawable/ with a nucleus_icon_ prefix.
  • NucleusIcons.kt is an enum class with nullable @DrawableRes fields per variant, plus drawableRes(variant) and @Composable painter(variant). We tint at the call site (Icon(painter, tint = …)) — drawables ship with a black placeholder fill.
  • Wrote a tiny SVG → VectorDrawable converter in tokens/formats/icons-android.ts. Most icons are pure paths, but gift.svg uses <rect>/<circle>/matrix transforms, so the converter handles those by flattening to path data.

Web

  • All SVGs copied to build/web/icons/{name}-{variant}.svg.
  • New build/web/nucleus-icons.json manifest indexed by icon name with both file paths and inlined SVG strings per variant.
  • package.json template updated to ship icons/*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant