From 8d444b4b02c2990c141305ebfaf7b6430b812a07 Mon Sep 17 00:00:00 2001 From: Akshay Gupta Date: Thu, 13 Jun 2024 21:33:38 +0530 Subject: [PATCH] Hide non functional token types from UI --- .../app/main/ui/workspace/tokens/core.cljs | 81 ++++++++++--------- 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/frontend/src/app/main/ui/workspace/tokens/core.cljs b/frontend/src/app/main/ui/workspace/tokens/core.cljs index a4c871b20..4b68cc07d 100644 --- a/frontend/src/app/main/ui/workspace/tokens/core.cljs +++ b/frontend/src/app/main/ui/workspace/tokens/core.cljs @@ -128,10 +128,6 @@ (def token-types (ordered-map - [:boolean - {:title "Boolean" - :modal {:key :tokens/boolean - :fields [{:label "Boolean"}]}}] [:border-radius {:title "Border Radius" :attributes ctt/border-radius-keys @@ -146,12 +142,7 @@ :modal {:key :tokens/stroke-width :fields [{:label "Stroke Width" :key :stroke-width}]}}] - [:box-shadow - {:title "Box Shadow" - :modal {:key :tokens/box-shadow - :fields [{:label "Box shadows" - :key :box-shadow - :type :box-shadow}]}}] + [:sizing {:title "Sizing" :attributes ctt/sizing-keys @@ -166,11 +157,7 @@ :modal {:key :tokens/dimensions :fields [{:label "Dimensions" :key :dimensions}]}}] - [:numeric - {:title "Numeric" - :modal {:key :tokens/numeric - :fields [{:label "Numeric" - :key :numeric}]}}] + [:opacity {:title "Opacity" :attributes ctt/opacity-keys @@ -178,11 +165,7 @@ :modal {:key :tokens/opacity :fields [{:label "Opacity" :key :opacity}]}}] - [:other - {:title "Other" - :modal {:key :tokens/other - :fields [{:label "Other" - :key :other}]}}] + [:rotation {:title "Rotation" :attributes ctt/rotation-keys @@ -197,23 +180,47 @@ :modal {:key :tokens/spacing :fields [{:label "Spacing" :key :spacing}]}}] - [:string - {:title "String" - :modal {:key :tokens/string - :fields [{:label "String" - :key :string}]}}] - [:typography - {:title "Typography" - :modal {:key :tokens/typography - :fields [{:label "Font" :key :font-family} - {:label "Weight" :key :weight} - {:label "Font Size" :key :font-size} - {:label "Line Height" :key :line-height} - {:label "Letter Spacing" :key :letter-spacing} - {:label "Paragraph Spacing" :key :paragraph-spacing} - {:label "Paragraph Indent" :key :paragraph-indent} - {:label "Text Decoration" :key :text-decoration} - {:label "Text Case" :key :text-case}]}}])) + (comment + [:boolean + {:title "Boolean" + :modal {:key :tokens/boolean + :fields [{:label "Boolean"}]}}] + + [:box-shadow + {:title "Box Shadow" + :modal {:key :tokens/box-shadow + :fields [{:label "Box shadows" + :key :box-shadow + :type :box-shadow}]}}] + + [:numeric + {:title "Numeric" + :modal {:key :tokens/numeric + :fields [{:label "Numeric" + :key :numeric}]}}] + + [:other + {:title "Other" + :modal {:key :tokens/other + :fields [{:label "Other" + :key :other}]}}] + [:string + {:title "String" + :modal {:key :tokens/string + :fields [{:label "String" + :key :string}]}}] + [:typography + {:title "Typography" + :modal {:key :tokens/typography + :fields [{:label "Font" :key :font-family} + {:label "Weight" :key :weight} + {:label "Font Size" :key :font-size} + {:label "Line Height" :key :line-height} + {:label "Letter Spacing" :key :letter-spacing} + {:label "Paragraph Spacing" :key :paragraph-spacing} + {:label "Paragraph Indent" :key :paragraph-indent} + {:label "Text Decoration" :key :text-decoration} + {:label "Text Case" :key :text-case}]}}]))) (defn token-attributes [token-type] (get-in token-types [token-type :attributes]))