From b619ac3e08375ab513afe7aa0bae490a4c2135bb Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 26 Sep 2024 16:25:40 +0200 Subject: [PATCH 1/2] :recycle: Move tab-switcher to its own folder inside DS --- frontend/src/app/main/ui/ds.cljs | 2 +- frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.cljs | 2 +- frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.mdx | 2 +- frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.scss | 6 +++--- .../app/main/ui/ds/{ => layout}/tab_switcher.stories.jsx | 2 +- frontend/src/app/main/ui/viewer/inspect/right_sidebar.cljs | 2 +- frontend/src/app/main/ui/workspace/colorpicker.cljs | 2 +- frontend/src/app/main/ui/workspace/libraries.cljs | 2 +- frontend/src/app/main/ui/workspace/sidebar.cljs | 2 +- frontend/src/app/main/ui/workspace/sidebar/options.cljs | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) rename frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.cljs (99%) rename frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.mdx (98%) rename frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.scss (96%) rename frontend/src/app/main/ui/ds/{ => layout}/tab_switcher.stories.jsx (98%) diff --git a/frontend/src/app/main/ui/ds.cljs b/frontend/src/app/main/ui/ds.cljs index ff1a3ca83..84a70e0e3 100644 --- a/frontend/src/app/main/ui/ds.cljs +++ b/frontend/src/app/main/ui/ds.cljs @@ -16,10 +16,10 @@ [app.main.ui.ds.foundations.typography :refer [typography-list]] [app.main.ui.ds.foundations.typography.heading :refer [heading*]] [app.main.ui.ds.foundations.typography.text :refer [text*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.ds.notifications.toast :refer [toast*]] [app.main.ui.ds.product.loader :refer [loader*]] [app.main.ui.ds.storybook :as sb] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] [app.util.i18n :as i18n])) diff --git a/frontend/src/app/main/ui/ds/tab_switcher.cljs b/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs similarity index 99% rename from frontend/src/app/main/ui/ds/tab_switcher.cljs rename to frontend/src/app/main/ui/ds/layout/tab_switcher.cljs index 59f078d1b..ab359c27e 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.cljs +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs @@ -4,7 +4,7 @@ ;; ;; Copyright (c) KALEIDOS INC -(ns app.main.ui.ds.tab-switcher +(ns app.main.ui.ds.layout.tab-switcher (:require-macros [app.common.data.macros :as dm] [app.main.style :as stl]) diff --git a/frontend/src/app/main/ui/ds/tab_switcher.mdx b/frontend/src/app/main/ui/ds/layout/tab_switcher.mdx similarity index 98% rename from frontend/src/app/main/ui/ds/tab_switcher.mdx rename to frontend/src/app/main/ui/ds/layout/tab_switcher.mdx index 30697b851..00e3da85e 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.mdx +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.mdx @@ -2,7 +2,7 @@ import { Canvas, Meta } from '@storybook/blocks'; import * as TabSwitcher from "./tab_switcher.stories"; - + # Tab Switcher diff --git a/frontend/src/app/main/ui/ds/tab_switcher.scss b/frontend/src/app/main/ui/ds/layout/tab_switcher.scss similarity index 96% rename from frontend/src/app/main/ui/ds/tab_switcher.scss rename to frontend/src/app/main/ui/ds/layout/tab_switcher.scss index 0b24f3343..0a8509695 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.scss +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.scss @@ -4,9 +4,9 @@ // // Copyright (c) KALEIDOS INC -@use "./_sizes.scss" as *; -@use "./_borders.scss" as *; -@use "./typography.scss" as *; +@use "../_sizes.scss" as *; +@use "../_borders.scss" as *; +@use "../typography.scss" as *; .tabs { --tabs-bg-color: var(--color-background-secondary); diff --git a/frontend/src/app/main/ui/ds/tab_switcher.stories.jsx b/frontend/src/app/main/ui/ds/layout/tab_switcher.stories.jsx similarity index 98% rename from frontend/src/app/main/ui/ds/tab_switcher.stories.jsx rename to frontend/src/app/main/ui/ds/layout/tab_switcher.stories.jsx index 1148e53e8..daaeada1a 100644 --- a/frontend/src/app/main/ui/ds/tab_switcher.stories.jsx +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.stories.jsx @@ -14,7 +14,7 @@ const Padded = ({ children }) => ( ); export default { - title: "Tab switcher", + title: "Layout/Tab switcher", component: TabSwitcher, args: { tabs: [ diff --git a/frontend/src/app/main/ui/viewer/inspect/right_sidebar.cljs b/frontend/src/app/main/ui/viewer/inspect/right_sidebar.cljs index 1f7d22edf..839adf0bc 100644 --- a/frontend/src/app/main/ui/viewer/inspect/right_sidebar.cljs +++ b/frontend/src/app/main/ui/viewer/inspect/right_sidebar.cljs @@ -11,7 +11,7 @@ [app.common.types.component :as ctk] [app.main.refs :as refs] [app.main.ui.components.shape-icon :as sir] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.icons :as i] [app.main.ui.viewer.inspect.attributes :refer [attributes]] [app.main.ui.viewer.inspect.code :refer [code]] diff --git a/frontend/src/app/main/ui/workspace/colorpicker.cljs b/frontend/src/app/main/ui/workspace/colorpicker.cljs index 08c7bae9c..5eec340c2 100644 --- a/frontend/src/app/main/ui/workspace/colorpicker.cljs +++ b/frontend/src/app/main/ui/workspace/colorpicker.cljs @@ -22,7 +22,7 @@ [app.main.ui.components.file-uploader :refer [file-uploader]] [app.main.ui.components.select :refer [select]] [app.main.ui.ds.foundations.assets.icon :as ic] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.icons :as i] [app.main.ui.workspace.colorpicker.color-inputs :refer [color-inputs]] [app.main.ui.workspace.colorpicker.gradients :refer [gradients]] diff --git a/frontend/src/app/main/ui/workspace/libraries.cljs b/frontend/src/app/main/ui/workspace/libraries.cljs index ed527fac6..0eaca99b4 100644 --- a/frontend/src/app/main/ui/workspace/libraries.cljs +++ b/frontend/src/app/main/ui/workspace/libraries.cljs @@ -25,7 +25,7 @@ [app.main.ui.components.link-button :as lb] [app.main.ui.components.search-bar :refer [search-bar]] [app.main.ui.components.title-bar :refer [title-bar]] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.hooks :as h] [app.main.ui.icons :as i] [app.util.color :as uc] diff --git a/frontend/src/app/main/ui/workspace/sidebar.cljs b/frontend/src/app/main/ui/workspace/sidebar.cljs index 8bfc29ca7..060544b2e 100644 --- a/frontend/src/app/main/ui/workspace/sidebar.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar.cljs @@ -13,7 +13,7 @@ [app.main.store :as st] [app.main.ui.context :as muc] [app.main.ui.ds.foundations.assets.icon :refer [icon*]] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.hooks.resize :refer [use-resize-hook]] [app.main.ui.workspace.comments :refer [comments-sidebar]] [app.main.ui.workspace.left-header :refer [left-header]] diff --git a/frontend/src/app/main/ui/workspace/sidebar/options.cljs b/frontend/src/app/main/ui/workspace/sidebar/options.cljs index df12fa1c3..cc6cef0bc 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options.cljs @@ -16,7 +16,7 @@ [app.main.refs :as refs] [app.main.store :as st] [app.main.ui.context :as ctx] - [app.main.ui.ds.tab-switcher :refer [tab-switcher*]] + [app.main.ui.ds.layout.tab-switcher :refer [tab-switcher*]] [app.main.ui.viewer.inspect.right-sidebar :as hrs] [app.main.ui.workspace.sidebar.options.menus.align :refer [align-options]] [app.main.ui.workspace.sidebar.options.menus.bool :refer [bool-options]] From ca1893164d50d5bb55c16d95793d7ed7747b00b2 Mon Sep 17 00:00:00 2001 From: Eva Marco Date: Thu, 26 Sep 2024 16:41:53 +0200 Subject: [PATCH 2/2] :sparkles: Add the undefied option to props schema enums --- frontend/src/app/main/ui/ds/foundations/assets/icon.cljs | 2 +- frontend/src/app/main/ui/ds/layout/tab_switcher.cljs | 2 +- frontend/src/app/main/ui/ds/notifications/toast.cljs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 b2952e58e..7a231ac2a 100644 --- a/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs +++ b/frontend/src/app/main/ui/ds/foundations/assets/icon.cljs @@ -282,7 +282,7 @@ [:class {:optional true} :string] [:id [:and :string [:fn #(contains? icon-list %)]]] [:size {:optional true} - [:enum "s" "m"]]]) + [:maybe [:enum "s" "m"]]]]) (mf/defc icon* {::mf/props :obj 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 ab359c27e..1228c4c1f 100644 --- a/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs +++ b/frontend/src/app/main/ui/ds/layout/tab_switcher.cljs @@ -114,7 +114,7 @@ [:selected {:optional true} :string] [:action-button {:optional true} some?] [:action-button-position {:optional true} - [:enum "start" "end"]]]) + [:maybe [:enum "start" "end"]]]]) (mf/defc tab-switcher* {::mf/props :obj diff --git a/frontend/src/app/main/ui/ds/notifications/toast.cljs b/frontend/src/app/main/ui/ds/notifications/toast.cljs index e38d25e28..a0597ec7d 100644 --- a/frontend/src/app/main/ui/ds/notifications/toast.cljs +++ b/frontend/src/app/main/ui/ds/notifications/toast.cljs @@ -24,7 +24,7 @@ [:map [:class {:optional true} :string] [:level {:optional true} - [:enum "info" "warning" "error" "success"]] + [:maybe [:enum "info" "warning" "error" "success"]]] [:on-close {:optional true} fn?]]) (mf/defc toast*