0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-08 16:00:19 -05:00

Hide non functional token types from UI

This commit is contained in:
Akshay Gupta 2024-06-13 21:33:38 +05:30
parent dc36f4f6d3
commit 8d444b4b02
No known key found for this signature in database

View file

@ -128,10 +128,6 @@
(def token-types (def token-types
(ordered-map (ordered-map
[:boolean
{:title "Boolean"
:modal {:key :tokens/boolean
:fields [{:label "Boolean"}]}}]
[:border-radius [:border-radius
{:title "Border Radius" {:title "Border Radius"
:attributes ctt/border-radius-keys :attributes ctt/border-radius-keys
@ -146,12 +142,7 @@
:modal {:key :tokens/stroke-width :modal {:key :tokens/stroke-width
:fields [{:label "Stroke Width" :fields [{:label "Stroke Width"
:key :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 [:sizing
{:title "Sizing" {:title "Sizing"
:attributes ctt/sizing-keys :attributes ctt/sizing-keys
@ -166,11 +157,7 @@
:modal {:key :tokens/dimensions :modal {:key :tokens/dimensions
:fields [{:label "Dimensions" :fields [{:label "Dimensions"
:key :dimensions}]}}] :key :dimensions}]}}]
[:numeric
{:title "Numeric"
:modal {:key :tokens/numeric
:fields [{:label "Numeric"
:key :numeric}]}}]
[:opacity [:opacity
{:title "Opacity" {:title "Opacity"
:attributes ctt/opacity-keys :attributes ctt/opacity-keys
@ -178,11 +165,7 @@
:modal {:key :tokens/opacity :modal {:key :tokens/opacity
:fields [{:label "Opacity" :fields [{:label "Opacity"
:key :opacity}]}}] :key :opacity}]}}]
[:other
{:title "Other"
:modal {:key :tokens/other
:fields [{:label "Other"
:key :other}]}}]
[:rotation [:rotation
{:title "Rotation" {:title "Rotation"
:attributes ctt/rotation-keys :attributes ctt/rotation-keys
@ -197,23 +180,47 @@
:modal {:key :tokens/spacing :modal {:key :tokens/spacing
:fields [{:label "Spacing" :fields [{:label "Spacing"
:key :spacing}]}}] :key :spacing}]}}]
[:string (comment
{:title "String" [:boolean
:modal {:key :tokens/string {:title "Boolean"
:fields [{:label "String" :modal {:key :tokens/boolean
:key :string}]}}] :fields [{:label "Boolean"}]}}]
[:typography
{:title "Typography" [:box-shadow
:modal {:key :tokens/typography {:title "Box Shadow"
:fields [{:label "Font" :key :font-family} :modal {:key :tokens/box-shadow
{:label "Weight" :key :weight} :fields [{:label "Box shadows"
{:label "Font Size" :key :font-size} :key :box-shadow
{:label "Line Height" :key :line-height} :type :box-shadow}]}}]
{:label "Letter Spacing" :key :letter-spacing}
{:label "Paragraph Spacing" :key :paragraph-spacing} [:numeric
{:label "Paragraph Indent" :key :paragraph-indent} {:title "Numeric"
{:label "Text Decoration" :key :text-decoration} :modal {:key :tokens/numeric
{:label "Text Case" :key :text-case}]}}])) :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] (defn token-attributes [token-type]
(get-in token-types [token-type :attributes])) (get-in token-types [token-type :attributes]))