From 603e41bbfd765483e59031676e246e46f7e7ec83 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Fri, 23 May 2025 12:57:02 +0200 Subject: [PATCH] :recycle: Remove mf/props obj from DS components --- frontend/src/app/main/ui/ds/buttons/button.cljs | 3 +-- frontend/src/app/main/ui/ds/buttons/icon_button.cljs | 3 +-- frontend/src/app/main/ui/ds/controls/combobox.cljs | 3 +-- frontend/src/app/main/ui/ds/controls/input.cljs | 3 +-- frontend/src/app/main/ui/ds/controls/select.cljs | 3 +-- .../src/app/main/ui/ds/controls/shared/options_dropdown.cljs | 3 +-- .../src/app/main/ui/ds/controls/utilities/hint_message.cljs | 3 +-- .../src/app/main/ui/ds/controls/utilities/input_field.cljs | 3 +-- frontend/src/app/main/ui/ds/controls/utilities/label.cljs | 3 +-- frontend/src/app/main/ui/ds/foundations/assets/icon.cljs | 3 +-- frontend/src/app/main/ui/ds/foundations/assets/raw_svg.cljs | 1 - .../src/app/main/ui/ds/foundations/typography/heading.cljs | 3 +-- frontend/src/app/main/ui/ds/foundations/typography/text.cljs | 3 +-- .../main/ui/ds/foundations/utilities/token/token_status.cljs | 3 +-- frontend/src/app/main/ui/ds/layout/tab_switcher.cljs | 3 +-- .../app/main/ui/ds/notifications/context_notification.cljs | 3 +-- .../src/app/main/ui/ds/notifications/context_notification.css | 0 .../main/ui/ds/notifications/shared/notification_pill.cljs | 3 +-- frontend/src/app/main/ui/ds/notifications/toast.cljs | 3 +-- frontend/src/app/main/ui/ds/product/autosaved_milestone.cljs | 3 +-- frontend/src/app/main/ui/ds/product/avatar.cljs | 3 +-- frontend/src/app/main/ui/ds/product/cta.cljs | 3 +-- frontend/src/app/main/ui/ds/product/empty_placeholder.cljs | 3 +-- frontend/src/app/main/ui/ds/product/input_with_meta.cljs | 3 +-- frontend/src/app/main/ui/ds/product/user_milestone.cljs | 3 +-- frontend/src/app/main/ui/ds/storybook.cljs | 4 ---- frontend/src/app/main/ui/ds/tooltip/tooltip.cljs | 3 +-- frontend/src/app/main/ui/ds/utilities/date.cljs | 3 +-- 28 files changed, 25 insertions(+), 55 deletions(-) delete mode 100644 frontend/src/app/main/ui/ds/notifications/context_notification.css diff --git a/frontend/src/app/main/ui/ds/buttons/button.cljs b/frontend/src/app/main/ui/ds/buttons/button.cljs index a7eb02621..37adcd41d 100644 --- a/frontend/src/app/main/ui/ds/buttons/button.cljs +++ b/frontend/src/app/main/ui/ds/buttons/button.cljs @@ -22,8 +22,7 @@ [:maybe [:enum "primary" "secondary" "ghost" "destructive"]]]]) (mf/defc button* - {::mf/props :obj - ::mf/schema schema:button} + {::mf/schema schema:button} [{:keys [variant icon children class on-ref] :rest props}] (let [variant (or variant "primary") class (dm/str class " " (stl/css-case :button true diff --git a/frontend/src/app/main/ui/ds/buttons/icon_button.cljs b/frontend/src/app/main/ui/ds/buttons/icon_button.cljs index 49dd60fc1..d5c6015a7 100644 --- a/frontend/src/app/main/ui/ds/buttons/icon_button.cljs +++ b/frontend/src/app/main/ui/ds/buttons/icon_button.cljs @@ -24,8 +24,7 @@ [:maybe [:enum "primary" "secondary" "ghost" "destructive" "action"]]]]) (mf/defc icon-button* - {::mf/props :obj - ::mf/schema schema:icon-button} + {::mf/schema schema:icon-button} [{:keys [class icon icon-class variant aria-label children tooltip-id] :rest props}] (let [variant (or variant "primary") class (dm/str class " " (stl/css-case :icon-button true diff --git a/frontend/src/app/main/ui/ds/controls/combobox.cljs b/frontend/src/app/main/ui/ds/controls/combobox.cljs index c418df3cc..a37325dc0 100644 --- a/frontend/src/app/main/ui/ds/controls/combobox.cljs +++ b/frontend/src/app/main/ui/ds/controls/combobox.cljs @@ -62,8 +62,7 @@ [:has-error {:optional true} :boolean]]) (mf/defc combobox* - {::mf/props :obj - ::mf/schema schema:combobox} + {::mf/schema schema:combobox} [{:keys [id options class placeholder disabled has-error default-selected max-length on-change] :rest props}] (let [is-open* (mf/use-state false) is-open (deref is-open*) diff --git a/frontend/src/app/main/ui/ds/controls/input.cljs b/frontend/src/app/main/ui/ds/controls/input.cljs index 48fa730c0..ec26c8431 100644 --- a/frontend/src/app/main/ui/ds/controls/input.cljs +++ b/frontend/src/app/main/ui/ds/controls/input.cljs @@ -33,8 +33,7 @@ [:hint-type {:optional true} [:maybe [:enum "hint" "error" "warning"]]]]) (mf/defc input* - {::mf/props :obj - ::mf/forward-ref true + {::mf/forward-ref true ::mf/schema schema:input} [{:keys [id class label is-optional type max-length variant hint-message hint-type] :rest props} ref] (let [id (or id (mf/use-id)) diff --git a/frontend/src/app/main/ui/ds/controls/select.cljs b/frontend/src/app/main/ui/ds/controls/select.cljs index b74ac575d..1bf64706e 100644 --- a/frontend/src/app/main/ui/ds/controls/select.cljs +++ b/frontend/src/app/main/ui/ds/controls/select.cljs @@ -69,8 +69,7 @@ [:on-change {:optional true} fn?]]) (mf/defc select* - {::mf/props :obj - ::mf/schema schema:select} + {::mf/schema schema:select} [{:keys [options class disabled default-selected on-change] :rest props}] (let [open* (mf/use-state false) open (deref open*) diff --git a/frontend/src/app/main/ui/ds/controls/shared/options_dropdown.cljs b/frontend/src/app/main/ui/ds/controls/shared/options_dropdown.cljs index 5518111d1..83f50e29c 100644 --- a/frontend/src/app/main/ui/ds/controls/shared/options_dropdown.cljs +++ b/frontend/src/app/main/ui/ds/controls/shared/options_dropdown.cljs @@ -13,8 +13,7 @@ [rumext.v2 :as mf])) (mf/defc option* - {::mf/props :obj - ::mf/private true} + {::mf/private true} [{:keys [id label icon aria-label on-click selected set-ref focused] :rest props}] [:> :li {:value id diff --git a/frontend/src/app/main/ui/ds/controls/utilities/hint_message.cljs b/frontend/src/app/main/ui/ds/controls/utilities/hint_message.cljs index cff5571eb..04b3aaaaf 100644 --- a/frontend/src/app/main/ui/ds/controls/utilities/hint_message.cljs +++ b/frontend/src/app/main/ui/ds/controls/utilities/hint_message.cljs @@ -19,8 +19,7 @@ [:class {:optional true} :string]]) (mf/defc hint-message* - {::mf/props :obj - ::mf/schema schema::hint-message} + {::mf/schema schema::hint-message} [{:keys [id class message type] :rest props}] (let [type (d/nilv type :hint)] [:> "div" {:class (dm/str class " " (stl/css-case diff --git a/frontend/src/app/main/ui/ds/controls/utilities/input_field.cljs b/frontend/src/app/main/ui/ds/controls/utilities/input_field.cljs index d98fe5545..938376bc1 100644 --- a/frontend/src/app/main/ui/ds/controls/utilities/input_field.cljs +++ b/frontend/src/app/main/ui/ds/controls/utilities/input_field.cljs @@ -30,8 +30,7 @@ [:slot-end {:optional true} [:maybe some?]]]) (mf/defc input-field* - {::mf/props :obj - ::mf/forward-ref true + {::mf/forward-ref true ::mf/schema schema:input-field} [{:keys [id icon has-hint hint-type class type max-length variant slot-start slot-end] :rest props} ref] (let [input-ref (mf/use-ref) diff --git a/frontend/src/app/main/ui/ds/controls/utilities/label.cljs b/frontend/src/app/main/ui/ds/controls/utilities/label.cljs index 1b5e06ced..17f45a771 100644 --- a/frontend/src/app/main/ui/ds/controls/utilities/label.cljs +++ b/frontend/src/app/main/ui/ds/controls/utilities/label.cljs @@ -17,8 +17,7 @@ [:class {:optional true} :string]]) (mf/defc label* - {::mf/props :obj - ::mf/schema schema::label} + {::mf/schema schema::label} [{:keys [class for is-optional children] :rest props}] (let [is-optional (or is-optional false) props (mf/spread-props props {:class (dm/str class " " (stl/css :label)) diff --git a/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs b/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs index 13cabc34a..a17e5b5bd 100644 --- a/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs +++ b/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs @@ -300,8 +300,7 @@ [:maybe [:enum "s" "m"]]]]) (mf/defc icon* - {::mf/props :obj - ::mf/schema schema:icon} + {::mf/schema schema:icon} [{:keys [icon-id size class] :rest props}] (let [class (dm/str (or class "") " " (stl/css :icon)) props (mf/spread-props props {:class class :width icon-size-m :height icon-size-m}) diff --git a/frontend/src/app/main/ui/ds/foundations/assets/raw_svg.cljs b/frontend/src/app/main/ui/ds/foundations/assets/raw_svg.cljs index c74188edb..bacf967e5 100644 --- a/frontend/src/app/main/ui/ds/foundations/assets/raw_svg.cljs +++ b/frontend/src/app/main/ui/ds/foundations/assets/raw_svg.cljs @@ -33,7 +33,6 @@ (def raw-svg-list "A collection of all raw SVG assets" (collect-raw-svgs)) (mf/defc raw-svg* - {::mf/props :obj} [{:keys [id] :rest props}] (assert (contains? raw-svg-list id) "invalid raw svg id") [:> "svg" props diff --git a/frontend/src/app/main/ui/ds/foundations/typography/heading.cljs b/frontend/src/app/main/ui/ds/foundations/typography/heading.cljs index 9b3898b6c..f58a78fa4 100644 --- a/frontend/src/app/main/ui/ds/foundations/typography/heading.cljs +++ b/frontend/src/app/main/ui/ds/foundations/typography/heading.cljs @@ -26,8 +26,7 @@ [:typography [:and :string [:fn #(valid-typography? (dm/str %))]]]]) (mf/defc heading* - {::mf/props :obj - ::mf/schema schema:heading} + {::mf/schema schema:heading} [{:keys [level typography class children] :rest props}] (let [level (or level "1") diff --git a/frontend/src/app/main/ui/ds/foundations/typography/text.cljs b/frontend/src/app/main/ui/ds/foundations/typography/text.cljs index 9ae781dc3..669a0db63 100644 --- a/frontend/src/app/main/ui/ds/foundations/typography/text.cljs +++ b/frontend/src/app/main/ui/ds/foundations/typography/text.cljs @@ -22,8 +22,7 @@ [:typography [:and :string [:fn #(valid-typography? (dm/str %))]]]]) (mf/defc text* - {::mf/props :obj - ::mf/schema schema:text} + {::mf/schema schema:text} [{:keys [as typography children class] :rest props}] (let [as (if (or (empty? as) (nil? as)) "p" as) diff --git a/frontend/src/app/main/ui/ds/foundations/utilities/token/token_status.cljs b/frontend/src/app/main/ui/ds/foundations/utilities/token/token_status.cljs index cda69abcd..f59273bda 100644 --- a/frontend/src/app/main/ui/ds/foundations/utilities/token/token_status.cljs +++ b/frontend/src/app/main/ui/ds/foundations/utilities/token/token_status.cljs @@ -18,8 +18,7 @@ [:icon-id [:and :string [:fn #(contains? token-status-list %)]]]]) (mf/defc token-status-icon* - {::mf/props :obj - ::mf/schema schema:token-status-icon} + {::mf/schema schema:token-status-icon} [{:keys [icon-id class] :rest props}] (let [class (dm/str (or class "") " " (stl/css :token-icon)) props (mf/spread-props props {:class class :width "14px" :height "14px"}) diff --git a/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs b/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs index 5871c61d3..78f837fe8 100644 --- a/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs @@ -17,8 +17,7 @@ [rumext.v2 :as mf])) (mf/defc tab* - {::mf/props :obj - ::mf/private true} + {::mf/private true} [{:keys [selected icon label aria-label id on-ref] :rest props}] (let [class (stl/css-case :tab true :selected selected) diff --git a/frontend/src/app/main/ui/ds/notifications/context_notification.cljs b/frontend/src/app/main/ui/ds/notifications/context_notification.cljs index 2b2cd6c48..0cb0deb58 100644 --- a/frontend/src/app/main/ui/ds/notifications/context_notification.cljs +++ b/frontend/src/app/main/ui/ds/notifications/context_notification.cljs @@ -23,8 +23,7 @@ (mf/defc context-notification* "Persistent notifications, they do not disappear. These are contextual messages in specific areas of the tool, usually in modals and Dashboard area, and are mainly informative." - {::mf/props :obj - ::mf/schema schema:context-notification} + {::mf/schema schema:context-notification} [{:keys [class type appearance level is-html children] :rest props}] (let [class (dm/str class " " (stl/css-case :contextual-notification true :contain-html is-html diff --git a/frontend/src/app/main/ui/ds/notifications/context_notification.css b/frontend/src/app/main/ui/ds/notifications/context_notification.css deleted file mode 100644 index e69de29bb..000000000 diff --git a/frontend/src/app/main/ui/ds/notifications/shared/notification_pill.cljs b/frontend/src/app/main/ui/ds/notifications/shared/notification_pill.cljs index 9cbba3d8c..1e47a2d41 100644 --- a/frontend/src/app/main/ui/ds/notifications/shared/notification_pill.cljs +++ b/frontend/src/app/main/ui/ds/notifications/shared/notification_pill.cljs @@ -34,8 +34,7 @@ [:on-toggle-detail {:optional true} [:maybe fn?]]]) (mf/defc notification-pill* - {::mf/props :obj - ::mf/schema schema:notification-pill} + {::mf/schema schema:notification-pill} [{:keys [level type is-html appearance detail children show-detail on-toggle-detail]}] (let [class (stl/css-case :appearance-neutral (= appearance :neutral) :appearance-ghost (= appearance :ghost) diff --git a/frontend/src/app/main/ui/ds/notifications/toast.cljs b/frontend/src/app/main/ui/ds/notifications/toast.cljs index e100cd0c7..3c2e76eee 100644 --- a/frontend/src/app/main/ui/ds/notifications/toast.cljs +++ b/frontend/src/app/main/ui/ds/notifications/toast.cljs @@ -26,8 +26,7 @@ [:on-toggle-detail {:optional true} [:maybe fn?]]]) (mf/defc toast* - {::mf/props :obj - ::mf/schema schema:toast} + {::mf/schema schema:toast} [{:keys [class level appearance type is-html children detail show-detail on-close on-toggle-detail] :rest props}] (let [class (dm/str class " " (stl/css :toast)) level (if (string? level) diff --git a/frontend/src/app/main/ui/ds/product/autosaved_milestone.cljs b/frontend/src/app/main/ui/ds/product/autosaved_milestone.cljs index fcb4f788d..c3eb610ed 100644 --- a/frontend/src/app/main/ui/ds/product/autosaved_milestone.cljs +++ b/frontend/src/app/main/ui/ds/product/autosaved_milestone.cljs @@ -29,8 +29,7 @@ [:snapshots [:vector [:fn valid-date?]]]]) (mf/defc autosaved-milestone* - {::mf/props :obj - ::mf/schema schema:milestone} + {::mf/schema schema:milestone} [{:keys [class active versionToggled label autosavedMessage snapshots onClickSnapshotMenu onToggleExpandSnapshots] :rest props}] (let [class (d/append-class class (stl/css-case :milestone true :is-selected active)) diff --git a/frontend/src/app/main/ui/ds/product/avatar.cljs b/frontend/src/app/main/ui/ds/product/avatar.cljs index 8b8017ccb..fe52a47ab 100644 --- a/frontend/src/app/main/ui/ds/product/avatar.cljs +++ b/frontend/src/app/main/ui/ds/product/avatar.cljs @@ -24,8 +24,7 @@ [:maybe [:enum "S" "M" "L"]]]]) (mf/defc avatar* - {::mf/props :obj - ::mf/schema schema:avatar} + {::mf/schema schema:avatar} [{:keys [tag class name color url selected variant] :rest props}] (let [variant (or variant "S") diff --git a/frontend/src/app/main/ui/ds/product/cta.cljs b/frontend/src/app/main/ui/ds/product/cta.cljs index 96f7597de..c2e384151 100644 --- a/frontend/src/app/main/ui/ds/product/cta.cljs +++ b/frontend/src/app/main/ui/ds/product/cta.cljs @@ -19,8 +19,7 @@ [:title :string]]) (mf/defc cta* - {::mf/props :obj - ::mf/schema schema:cta} + {::mf/schema schema:cta} [{:keys [class title children] :rest props}] (let [class (d/append-class class (stl/css :cta)) diff --git a/frontend/src/app/main/ui/ds/product/empty_placeholder.cljs b/frontend/src/app/main/ui/ds/product/empty_placeholder.cljs index 40b9fdc1b..a07fd8b0e 100644 --- a/frontend/src/app/main/ui/ds/product/empty_placeholder.cljs +++ b/frontend/src/app/main/ui/ds/product/empty_placeholder.cljs @@ -22,8 +22,7 @@ [:type {:optional true} [:maybe [:enum 1 2]]]]) (mf/defc empty-placeholder* - {::mf/props :obj - ::mf/schema schema:empty-placeholder} + {::mf/schema schema:empty-placeholder} [{:keys [class title subtitle type children] :rest props}] (let [class (dm/str class " " (stl/css :empty-placeholder)) diff --git a/frontend/src/app/main/ui/ds/product/input_with_meta.cljs b/frontend/src/app/main/ui/ds/product/input_with_meta.cljs index 4b191fa8b..5e0cd65cf 100644 --- a/frontend/src/app/main/ui/ds/product/input_with_meta.cljs +++ b/frontend/src/app/main/ui/ds/product/input_with_meta.cljs @@ -20,8 +20,7 @@ [:on-blur {:optional true} fn?]]) (mf/defc input-with-meta* - {::mf/props :obj - ::mf/schema schema:input-with-meta} + {::mf/schema schema:input-with-meta} [{:keys [value meta on-blur] :rest props}] (let [editing* (mf/use-state false) editing? (deref editing*) diff --git a/frontend/src/app/main/ui/ds/product/user_milestone.cljs b/frontend/src/app/main/ui/ds/product/user_milestone.cljs index 2764c12d3..df8e28fa1 100644 --- a/frontend/src/app/main/ui/ds/product/user_milestone.cljs +++ b/frontend/src/app/main/ui/ds/product/user_milestone.cljs @@ -38,8 +38,7 @@ [:onKeyDownInput {:optional true} [:maybe [:fn fn?]]]]) (mf/defc user-milestone* - {::mf/props :obj - ::mf/schema schema:milestone} + {::mf/schema schema:milestone} [{:keys [class active editing user label date onOpenMenu onFocusInput onBlurInput onKeyDownInput] :rest props}] (let [class (d/append-class class (stl/css-case :milestone true :is-selected active)) diff --git a/frontend/src/app/main/ui/ds/storybook.cljs b/frontend/src/app/main/ui/ds/storybook.cljs index bec97b7b0..bb0f7600e 100644 --- a/frontend/src/app/main/ui/ds/storybook.cljs +++ b/frontend/src/app/main/ui/ds/storybook.cljs @@ -12,7 +12,6 @@ [rumext.v2 :as mf])) (mf/defc story-grid* - {::mf/props :obj} [{:keys [children size style] :rest other}] (let [class (stl/css :story-grid) size (or size 16) @@ -22,21 +21,18 @@ [:> "article" props children])) (mf/defc story-grid-cell* - {::mf/props :obj} [{:keys [children] :rest other}] (let [class (stl/css :story-grid-cell) props (mf/spread-props other {:class class})] [:> "article" props children])) (mf/defc story-header* - {::mf/props :obj} [{:keys [children] :rest other}] (let [class (stl/css :story-header) props (mf/spread-props other {:class class})] [:> "header" props children])) (mf/defc story-grid-row* - {::mf/props :obj} [{:keys [children] :rest other}] (let [class (stl/css :story-grid-row) props (mf/spread-props other {:class class})] diff --git a/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs b/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs index caea4c4cf..5cc5b1c7e 100644 --- a/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs +++ b/frontend/src/app/main/ui/ds/tooltip/tooltip.cljs @@ -116,8 +116,7 @@ [:maybe [:enum "top" "bottom" "left" "right" "top-right" "bottom-right" "bottom-left" "top-left"]]]]) (mf/defc tooltip* - {::mf/props :obj - ::mf/schema schema:tooltip} + {::mf/schema schema:tooltip} [{:keys [class id children tooltip-content placement offset delay] :rest props}] (let [placement* (mf/use-state #(d/nilv placement "top")) placement (deref placement*) diff --git a/frontend/src/app/main/ui/ds/utilities/date.cljs b/frontend/src/app/main/ui/ds/utilities/date.cljs index 88041d51a..716d465e4 100644 --- a/frontend/src/app/main/ui/ds/utilities/date.cljs +++ b/frontend/src/app/main/ui/ds/utilities/date.cljs @@ -28,8 +28,7 @@ [:typography {:optional true} :string]]) (mf/defc date* - {::mf/props :obj - ::mf/schema schema:date} + {::mf/schema schema:date} [{:keys [class date selected typography] :rest props}] (let [class (d/append-class class (stl/css-case :date true :is-selected selected)) date (cond-> date (not (dt/datetime? date)) dt/datetime)