@kungal/ui-core
@kungal/ui-core
The framework-agnostic foundation every KunUI render layer is built on. Pure TypeScript — no Vue, no React, no DOM coupling. Ships dual ESM/CJS with type declarations.
What's here
| Export | Purpose |
|---|---|
KunUIVariant, KunUIColor, KunUISize, KunUIRounded |
the design-system type vocabulary |
cn(...inputs) |
clsx + tailwind-merge class merge ("last class wins"), taught KunUI's own rounded-kun-* / shadow-kun-* / z-kun-* / ease-kun-* / duration-kun-* scales so they resolve against Tailwind's |
kunVariantClasses(variant, color) |
the 7×7 variant × color → Tailwind class matrix |
kunBgClasses / kunTextClasses / kunBorderClasses / kunRingClasses / kunSoftBgClasses |
per-color static class maps |
kunRoundedClasses |
radius bucket → rounded-kun-* class map |
resolveRounded(prop, fallback, configDefault) |
pure precedence resolver (prop > built-in > provider) |
KUN_DEFAULT_ROUNDED |
global radius default ('md') |
getKunIcon / hasKunIcon / registerKunIcon(s) / KunIconData |
bundled icon registry (inline SVG, no runtime fetch) seeded with KunUI's own icons; consumers register more |
randomNum, decodeIfEncoded |
small pure helpers |
Icon data is generated from
@iconify-json/*(devDependencies) intosrc/icons-data.tsbyscripts/gen-icons.mjs— runpnpm gen:iconsafter adding a name. The generated literal ships; the@iconify-jsonpackages do not.
Why a separate package
The same class tables and resolution logic must produce byte-identical output in the Vue layer and the React layer. Keeping them here means a color tweak or a new variant is one edit, not one-per-framework — and because there is zero framework code, neither framework drags the other in.
Reactive wrappers belong in the render layers, e.g.:
// Vue
const rounded = computed(() => resolveRounded(props.rounded, 'lg', cfg.rounded))
// React
const rounded = useMemo(() => resolveRounded(rounded, 'lg', cfg.rounded), [rounded, cfg.rounded])
Build
pnpm --filter @kungal/ui-core build # tsup → dist (esm + cjs + d.ts)
pnpm --filter @kungal/ui-core typecheck
Related Packages
KunUI Vue 3 component layer — Nuxt-decoupled. Works in any Vue app; pairs with @...
KunUI Nuxt Layer — wraps @kungal/ui-vue, auto-imports the components, and inject...
Version History
| Version | Released | License |
|---|---|---|
| 2.61.1 | AGPL-3.0-only | |
| 2.61.0 | AGPL-3.0-only | |
| 2.60.1 | AGPL-3.0-only | |
| 2.60.0 | AGPL-3.0-only | |
| 2.59.0 | AGPL-3.0-only | |
| 2.58.1 | AGPL-3.0-only | |
| 2.58.0 | AGPL-3.0-only | |
| 2.57.1 | AGPL-3.0-only | |
| 2.57.0 | AGPL-3.0-only | |
| 2.56.2 | AGPL-3.0-only | |
| 2.56.1 | AGPL-3.0-only | |
| 2.56.0 | AGPL-3.0-only | |
| 2.55.0 | AGPL-3.0-only | |
| 2.54.0 | AGPL-3.0-only | |
| 2.53.0 | AGPL-3.0-only | |
| 2.52.1 | AGPL-3.0-only | |
| 2.52.0 | AGPL-3.0-only | |
| 2.51.1 | AGPL-3.0-only | |
| 2.51.0 | AGPL-3.0-only | |
| 2.50.1 | AGPL-3.0-only | |
| 2.50.0 | AGPL-3.0-only | |
| 2.49.1 | AGPL-3.0-only | |
| 2.49.0 | AGPL-3.0-only | |
| 2.48.0 | AGPL-3.0-only | |
| 2.47.2 | AGPL-3.0-only | |
| 2.47.1 | AGPL-3.0-only | |
| 2.47.0 | AGPL-3.0-only | |
| 2.46.0 | AGPL-3.0-only | |
| 2.45.0 | AGPL-3.0-only | |
| 2.44.0 | AGPL-3.0-only |
Showing the latest 30 of 179. See every release on npm