♻️ Replace buttons on workspace

♻️ Replace buttons on workspace

♻️ Format files

🐛 Fix pull request issues
This commit is contained in:
luisddm 2024-10-15 21:06:37 +02:00
parent 9064b9f849
commit e45fa1380d
53 changed files with 495 additions and 560 deletions

View file

@ -18,7 +18,7 @@
(def ^:private schema:icon-button
[:map
[:class {:optional true} :string]
[:icon {:optional true}
[:icon
[:and :string [:fn #(contains? icon-list %)]]]
[:aria-label :string]
[:variant {:optional true}
@ -27,7 +27,7 @@
(mf/defc icon-button*
{::mf/props :obj
::mf/schema schema:icon-button}
[{:keys [class icon variant aria-label] :rest props}]
[{:keys [class icon variant aria-label children] :rest props}]
(let [variant (or variant "primary")
class (dm/str class " " (stl/css-case :icon-button true
:icon-button-primary (= variant "primary")
@ -35,4 +35,4 @@
:icon-button-ghost (= variant "ghost")
:icon-button-destructive (= variant "destructive")))
props (mf/spread-props props {:class class :title aria-label})]
[:> "button" props [:> icon* {:id icon :aria-label aria-label}]]))
[:> "button" props [:> icon* {:id icon :aria-label aria-label}] children]))