MishkaChelekom.Kit.Dsl (Mishka Chelekom v0.0.9-beta.2)

Copy Markdown View Source

The MishkaChelekom.Kit Spark DSL — one verb, customize, to reuse and restyle any existing Mishka Chelekom component (styled or headless). It never builds HTML from scratch.

customize :my_button do
  from :button                 # styled — you'll use color/variant/size
  color :brand, "…"            #   add a new color
  variant :glow, "…"           #   add a new variant
  default color: :brand
end

customize :confirm_dialog do
  from :dialog                 # headless — you'll use `part`
  part :popup, "…"
  part :title, "…"
end

The macro decides styled vs headless from the rules you write (color/variant/… vs part), so a name that exists in both worlds is never ambiguous. Each customize generates a thin wrapper that delegates to the real component — its file is never touched.

This module only assembles the DSL; supporting modules live alongside it: structs in MishkaChelekom.Kit.Entities.*, code-gen in MishkaChelekom.Kit.Transformers.Generate, compile-time checks in MishkaChelekom.Kit.Verifiers.*.