mirror of
https://github.com/penpot/penpot.git
synced 2026-08-01 19:06:18 +00:00
💄 Replace current themes switch with DS switch (#8131)
This commit is contained in:
parent
bbe6ee2e19
commit
6cd5bc76d7
@ -14,6 +14,8 @@
|
|||||||
- Tokens panel nested path view [Taiga #9966](https://tree.taiga.io/project/penpot/us/9966)
|
- Tokens panel nested path view [Taiga #9966](https://tree.taiga.io/project/penpot/us/9966)
|
||||||
- Improve usability of lock and hide buttons in the layer panel. [Taiga #12916](https://tree.taiga.io/project/penpot/issue/12916)
|
- Improve usability of lock and hide buttons in the layer panel. [Taiga #12916](https://tree.taiga.io/project/penpot/issue/12916)
|
||||||
- Optimize sidebar performance for deeply nested shapes [Taiga #13017](https://tree.taiga.io/project/penpot/task/13017)
|
- Optimize sidebar performance for deeply nested shapes [Taiga #13017](https://tree.taiga.io/project/penpot/task/13017)
|
||||||
|
- Remove tokens path node and bulk remove tokens [Taiga #13007](https://tree.taiga.io/project/penpot/us/13007)
|
||||||
|
- Replace themes management modal radio buttons for switches [Taiga #9215](https://tree.taiga.io/project/penpot/us/9215)
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
||||||
@ -23,7 +25,6 @@
|
|||||||
- Fix error message on components doesn't close automatically [Taiga #12012](https://tree.taiga.io/project/penpot/issue/12012)
|
- Fix error message on components doesn't close automatically [Taiga #12012](https://tree.taiga.io/project/penpot/issue/12012)
|
||||||
- Fix incorrect default option on tokens import dialog [Github #8051](https://github.com/penpot/penpot/pull/8051)
|
- Fix incorrect default option on tokens import dialog [Github #8051](https://github.com/penpot/penpot/pull/8051)
|
||||||
|
|
||||||
|
|
||||||
## 2.13.0 (Unreleased)
|
## 2.13.0 (Unreleased)
|
||||||
|
|
||||||
### :boom: Breaking changes & Deprecations
|
### :boom: Breaking changes & Deprecations
|
||||||
@ -170,7 +171,6 @@ example. It's still usable as before, we just removed the example.
|
|||||||
|
|
||||||
- Deprecated configuration variables with the prefix `PENPOT_ASSETS_*`, and will be
|
- Deprecated configuration variables with the prefix `PENPOT_ASSETS_*`, and will be
|
||||||
removed in future versions:
|
removed in future versions:
|
||||||
|
|
||||||
- The `PENPOT_ASSETS_STORAGE_BACKEND` becomes `PENPOT_OBJECTS_STORAGE_BACKEND` and its
|
- The `PENPOT_ASSETS_STORAGE_BACKEND` becomes `PENPOT_OBJECTS_STORAGE_BACKEND` and its
|
||||||
values passes from (`assets-fs` or `assets-s3`) to (`fs` or `s3`)
|
values passes from (`assets-fs` or `assets-s3`) to (`fs` or `s3`)
|
||||||
- The `PENPOT_STORAGE_ASSETS_FS_DIRECTORY` becomes `PENPOT_OBJECTS_STORAGE_FS_DIRECTORY`
|
- The `PENPOT_STORAGE_ASSETS_FS_DIRECTORY` becomes `PENPOT_OBJECTS_STORAGE_FS_DIRECTORY`
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||||
[app.main.ui.ds.controls.combobox :refer [combobox*]]
|
[app.main.ui.ds.controls.combobox :refer [combobox*]]
|
||||||
[app.main.ui.ds.controls.input :refer [input*]]
|
[app.main.ui.ds.controls.input :refer [input*]]
|
||||||
[app.main.ui.ds.controls.radio-buttons :refer [radio-buttons*]]
|
[app.main.ui.ds.controls.switch :refer [switch*]]
|
||||||
[app.main.ui.ds.controls.utilities.label :refer [label*]]
|
[app.main.ui.ds.controls.utilities.label :refer [label*]]
|
||||||
[app.main.ui.ds.foundations.assets.icon :refer [icon*] :as i]
|
[app.main.ui.ds.foundations.assets.icon :refer [icon*] :as i]
|
||||||
[app.main.ui.ds.foundations.typography.heading :refer [heading*]]
|
[app.main.ui.ds.foundations.typography.heading :refer [heading*]]
|
||||||
@ -85,21 +85,6 @@
|
|||||||
:on-click create-theme}
|
:on-click create-theme}
|
||||||
(tr "workspace.tokens.add-new-theme")]]]]))
|
(tr "workspace.tokens.add-new-theme")]]]]))
|
||||||
|
|
||||||
(mf/defc switch*
|
|
||||||
[{:keys [selected? name on-change]}]
|
|
||||||
(let [selected (if selected? :on :off)]
|
|
||||||
[:> radio-buttons* {:selected selected
|
|
||||||
:on-change on-change
|
|
||||||
:name name
|
|
||||||
:options [{:id "on"
|
|
||||||
:icon i/tick
|
|
||||||
:label (tr "workspace.tokens.theme.enable")
|
|
||||||
:value :on}
|
|
||||||
{:id "off"
|
|
||||||
:icon i/close
|
|
||||||
:label (tr "workspace.tokens.theme.disable")
|
|
||||||
:value :off}]}]))
|
|
||||||
|
|
||||||
(mf/defc themes-overview
|
(mf/defc themes-overview
|
||||||
[{:keys [change-view]}]
|
[{:keys [change-view]}]
|
||||||
(let [active-theme-paths (mf/deref refs/workspace-active-theme-paths)
|
(let [active-theme-paths (mf/deref refs/workspace-active-theme-paths)
|
||||||
@ -137,6 +122,9 @@
|
|||||||
(dom/prevent-default e)
|
(dom/prevent-default e)
|
||||||
(dom/stop-propagation e)
|
(dom/stop-propagation e)
|
||||||
(st/emit! (dwtl/delete-token-theme id)))
|
(st/emit! (dwtl/delete-token-theme id)))
|
||||||
|
on-switch-theme
|
||||||
|
(fn []
|
||||||
|
(st/emit! (dwtl/toggle-token-theme-active id)))
|
||||||
on-edit-theme
|
on-edit-theme
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(dom/prevent-default e)
|
(dom/prevent-default e)
|
||||||
@ -146,16 +134,10 @@
|
|||||||
:class (stl/css :theme-row)}
|
:class (stl/css :theme-row)}
|
||||||
[:div {:class (stl/css :theme-switch-row)}
|
[:div {:class (stl/css :theme-switch-row)}
|
||||||
|
|
||||||
;; FIXME: FIREEEEEEEEEE THIS
|
[:> switch* {:id name
|
||||||
[:div {:on-click (fn [e]
|
:label name
|
||||||
(dom/prevent-default e)
|
:on-change on-switch-theme
|
||||||
(dom/stop-propagation e)
|
:default-checked selected?}]]
|
||||||
(st/emit! (dwtl/toggle-token-theme-active id)))}
|
|
||||||
[:> switch* {:name (tr "workspace.tokens.theme-name" name)
|
|
||||||
:on-change (constantly nil)
|
|
||||||
:selected? selected?}]]]
|
|
||||||
[:div {:class (stl/css :theme-name-row)}
|
|
||||||
[:> text* {:as "span" :typography "body-medium" :class (stl/css :theme-name) :title name} name]]
|
|
||||||
|
|
||||||
|
|
||||||
[:div {:class (stl/css :theme-actions-row)}
|
[:div {:class (stl/css :theme-actions-row)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user