mirror of
https://github.com/penpot/penpot.git
synced 2026-01-15 09:50:23 -05:00
Compare commits
1 Commits
develop
...
luis-panel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f223672fca |
@@ -17,7 +17,6 @@
|
||||
|
||||
--app-background: var(--color-background-primary);
|
||||
--loader-background: var(--color-background-primary);
|
||||
--panel-title-background-color: var(--color-background-secondary);
|
||||
|
||||
// BUTTONS
|
||||
--button-foreground-hover: var(--color-accent-primary);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
[app.main.ui.ds.product.loader :refer [loader*]]
|
||||
[app.main.ui.ds.product.milestone :refer [milestone*]]
|
||||
[app.main.ui.ds.product.milestone-group :refer [milestone-group*]]
|
||||
[app.main.ui.ds.product.panel-title :refer [panel-title*]]
|
||||
[app.main.ui.ds.storybook :as sb]
|
||||
[app.main.ui.ds.tooltip.tooltip :refer [tooltip*]]
|
||||
[app.main.ui.ds.utilities.date :refer [date*]]
|
||||
@@ -81,6 +82,7 @@
|
||||
:Milestone milestone*
|
||||
:MilestoneGroup milestone-group*
|
||||
:Date date*
|
||||
:PanelTitle panel-title*
|
||||
|
||||
:set-default-translations
|
||||
(fn [data]
|
||||
|
||||
34
frontend/src/app/main/ui/ds/product/panel_title.cljs
Normal file
34
frontend/src/app/main/ui/ds/product/panel_title.cljs
Normal file
@@ -0,0 +1,34 @@
|
||||
;; This Source Code Form is subject to the terms of the Mozilla Public
|
||||
;; License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
;;
|
||||
;; Copyright (c) KALEIDOS INC
|
||||
|
||||
(ns app.main.ui.ds.product.panel-title
|
||||
(:require-macros
|
||||
[app.main.style :as stl])
|
||||
(:require
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :as i]
|
||||
[app.util.i18n :refer [tr]]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(def ^:private schema:panel-title
|
||||
[:map
|
||||
[:class {:optional true} :string]
|
||||
[:text :string]
|
||||
[:on-close {:optional true} fn?]])
|
||||
|
||||
(mf/defc panel-title*
|
||||
{::mf/schema schema:panel-title}
|
||||
[{:keys [class text on-close] :rest props}]
|
||||
(let [props
|
||||
(mf/spread-props props {:class [class (stl/css :panel-title)]})]
|
||||
|
||||
[:> :div props
|
||||
[:span {:class (stl/css :panel-title-text)} text]
|
||||
(when on-close
|
||||
[:> icon-button* {:variant "ghost"
|
||||
:aria-label (tr "labels.close")
|
||||
:on-click on-close
|
||||
:icon i/close}])]))
|
||||
26
frontend/src/app/main/ui/ds/product/panel_title.mdx
Normal file
26
frontend/src/app/main/ui/ds/product/panel_title.mdx
Normal file
@@ -0,0 +1,26 @@
|
||||
{ /* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
Copyright (c) KALEIDOS INC */ }
|
||||
|
||||
import { Canvas, Meta } from '@storybook/addon-docs/blocks';
|
||||
import * as PanelTitle from "./panel_title.stories";
|
||||
|
||||
<Meta title="Product/PanelTitle" />
|
||||
|
||||
# PanelTitle
|
||||
|
||||
The `panel-title*` is used as a header for some sidebar sections.
|
||||
|
||||
<Canvas of={PanelTitle.Default} />
|
||||
|
||||
## Technical notes
|
||||
|
||||
The only mandatory parameter is `text`. Usually you'll want to pass a function property `on-close` that will be called when the user clicks on the close button on the right.
|
||||
|
||||
```clj
|
||||
[:> panel-title* {:class class
|
||||
:text text
|
||||
:on-close on-close}]
|
||||
```
|
||||
25
frontend/src/app/main/ui/ds/product/panel_title.scss
Normal file
25
frontend/src/app/main/ui/ds/product/panel_title.scss
Normal file
@@ -0,0 +1,25 @@
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
//
|
||||
// Copyright (c) KALEIDOS INC
|
||||
|
||||
@use "ds/_sizes.scss" as *;
|
||||
@use "ds/_borders.scss" as *;
|
||||
@use "ds/typography.scss" as t;
|
||||
|
||||
.panel-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
block-size: $sz-32;
|
||||
border-radius: $br-8;
|
||||
background-color: var(--color-background-secondary);
|
||||
}
|
||||
|
||||
.panel-title-text {
|
||||
@include t.use-typography("headline-small");
|
||||
flex-grow: 1;
|
||||
text-align: center;
|
||||
color: var(--color-foreground-primary);
|
||||
}
|
||||
21
frontend/src/app/main/ui/ds/product/panel_title.stories.jsx
Normal file
21
frontend/src/app/main/ui/ds/product/panel_title.stories.jsx
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as React from "react";
|
||||
import Components from "@target/components";
|
||||
|
||||
const { PanelTitle } = Components;
|
||||
|
||||
export default {
|
||||
title: "Product/PanelTitle",
|
||||
component: PanelTitle,
|
||||
argTypes: {
|
||||
text: {
|
||||
control: { type: "text" },
|
||||
},
|
||||
},
|
||||
args: {
|
||||
text: "Lorem ipsum",
|
||||
onClose: () => null,
|
||||
},
|
||||
render: ({ ...args }) => <PanelTitle {...args} />,
|
||||
};
|
||||
|
||||
export const Default = {};
|
||||
@@ -16,9 +16,9 @@
|
||||
[app.main.ui.comments :as cmt]
|
||||
[app.main.ui.components.dropdown :refer [dropdown]]
|
||||
[app.main.ui.context :as ctx]
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :as i]
|
||||
[app.main.ui.ds.product.empty-state :refer [empty-state*]]
|
||||
[app.main.ui.ds.product.panel-title :refer [panel-title*]]
|
||||
[app.main.ui.icons :as deprecated-icon]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
@@ -121,15 +121,12 @@
|
||||
(st/emit! (with-meta (dcmt/open-thread thread) {::ev/origin "viewer"}))
|
||||
(st/emit! (dwcm/navigate-to-comment thread)))))]
|
||||
|
||||
[:div {:class (stl/css-case :comments-section true
|
||||
:from-viewer from-viewer)}
|
||||
[:div {:class (stl/css-case :comments-section-title true
|
||||
:viewer-title from-viewer)}
|
||||
[:span (tr "labels.comments")]
|
||||
[:> icon-button* {:variant "ghost"
|
||||
:aria-label (tr "labels.close")
|
||||
:on-click close-section
|
||||
:icon i/close}]]
|
||||
[:div {:class (stl/css-case :comments-section true
|
||||
:from-viewer from-viewer)}
|
||||
|
||||
[:> panel-title* {:class (stl/css :comments-title)
|
||||
:text (tr "labels.comments")
|
||||
:on-close close-section}]
|
||||
|
||||
[:button {:class (stl/css :mode-dropdown-wrapper)
|
||||
:on-click toggle-mode-selector}
|
||||
|
||||
@@ -18,25 +18,8 @@
|
||||
padding: 0 deprecated.$s-8;
|
||||
}
|
||||
|
||||
.comments-section-title {
|
||||
@include deprecated.flexCenter;
|
||||
@include deprecated.uppercaseTitleTipography;
|
||||
position: relative;
|
||||
height: deprecated.$s-32;
|
||||
min-height: deprecated.$s-32;
|
||||
margin: deprecated.$s-8 deprecated.$s-8 0 deprecated.$s-8;
|
||||
border-radius: deprecated.$br-8;
|
||||
background-color: var(--panel-title-background-color);
|
||||
span {
|
||||
@include deprecated.flexCenter;
|
||||
flex-grow: 1;
|
||||
color: var(--title-foreground-color-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.viewer-title {
|
||||
margin: 0;
|
||||
margin-block-start: deprecated.$s-8;
|
||||
.comments-title {
|
||||
margin: var(--sp-s) var(--sp-s) 0 var(--sp-s);
|
||||
}
|
||||
|
||||
.mode-dropdown-wrapper {
|
||||
|
||||
@@ -11,12 +11,11 @@
|
||||
[app.common.data.macros :as dm]
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :as i]
|
||||
[app.main.ui.ds.product.panel-title :refer [panel-title*]]
|
||||
[app.main.ui.icons :as deprecated-icon]
|
||||
[app.util.debug :as dbg]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :as i18n :refer [tr]]
|
||||
[app.util.i18n :refer [tr]]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc debug-panel*
|
||||
@@ -35,12 +34,9 @@
|
||||
(st/emit! (dw/remove-layout-flag :debug-panel))))]
|
||||
|
||||
[:div {:class (dm/str class " " (stl/css :debug-panel))}
|
||||
[:div {:class (stl/css :panel-title)}
|
||||
[:span "Debugging tools"]
|
||||
[:> icon-button* {:variant "ghost"
|
||||
:aria-label (tr "labels.close")
|
||||
:on-click handle-close
|
||||
:icon i/close}]]
|
||||
[:> panel-title* {:class (stl/css :debug-panel-title)
|
||||
:text (tr "workspace.debug.title")
|
||||
:on-close handle-close}]
|
||||
|
||||
[:div {:class (stl/css :debug-panel-inner)}
|
||||
(for [option (sort-by d/name dbg/options)]
|
||||
|
||||
@@ -12,21 +12,12 @@
|
||||
background-color: var(--panel-background-color);
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
@include deprecated.flexCenter;
|
||||
@include deprecated.uppercaseTitleTipography;
|
||||
position: relative;
|
||||
height: deprecated.$s-32;
|
||||
min-height: deprecated.$s-32;
|
||||
margin: deprecated.$s-8 deprecated.$s-8 0 deprecated.$s-8;
|
||||
border-radius: deprecated.$br-8;
|
||||
background-color: var(--panel-title-background-color);
|
||||
.debug-panel-title {
|
||||
margin: var(--sp-s) var(--sp-s) 0 var(--sp-s);
|
||||
}
|
||||
|
||||
span {
|
||||
@include deprecated.flexCenter;
|
||||
flex-grow: 1;
|
||||
color: var(--title-foreground-color-hover);
|
||||
}
|
||||
.debug-panel-inner {
|
||||
padding: deprecated.$s-16 deprecated.$s-8;
|
||||
}
|
||||
|
||||
.checkbox-wrapper {
|
||||
@@ -39,7 +30,3 @@
|
||||
@extend .checkbox-icon;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.debug-panel-inner {
|
||||
padding: deprecated.$s-16 deprecated.$s-8;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
[app.main.data.workspace :as dw]
|
||||
[app.main.refs :as refs]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.icons :as deprecated-icon]
|
||||
[app.main.ui.ds.product.panel-title :refer [panel-title*]]
|
||||
[debug :as dbg]
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
@@ -125,11 +125,9 @@
|
||||
(map (d/getf objects)))]
|
||||
|
||||
[:div {:class (stl/css :shape-info)}
|
||||
[:div {:class (stl/css :shape-info-title)}
|
||||
[:span "Debug"]
|
||||
[:div {:class (stl/css :close-button)
|
||||
:on-click #(dbg/disable! :shape-panel)}
|
||||
deprecated-icon/close]]
|
||||
[:> panel-title* {:class (stl/css :shape-info-title)
|
||||
:text "Debug"
|
||||
:on-close #(dbg/disable! :shape-panel)}]
|
||||
|
||||
(if (empty? selected)
|
||||
[:div {:class (stl/css :attrs-container)} "No shapes selected"]
|
||||
|
||||
@@ -16,34 +16,7 @@
|
||||
}
|
||||
|
||||
.shape-info-title {
|
||||
@include deprecated.flexCenter;
|
||||
@include deprecated.uppercaseTitleTipography;
|
||||
position: relative;
|
||||
height: deprecated.$s-32;
|
||||
min-height: deprecated.$s-32;
|
||||
margin: deprecated.$s-8 deprecated.$s-8 0 deprecated.$s-8;
|
||||
border-radius: deprecated.$br-8;
|
||||
background-color: var(--panel-title-background-color);
|
||||
|
||||
span {
|
||||
@include deprecated.flexCenter;
|
||||
flex-grow: 1;
|
||||
color: var(--title-foreground-color-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.close-button {
|
||||
@extend .button-tertiary;
|
||||
position: absolute;
|
||||
right: deprecated.$s-2;
|
||||
top: deprecated.$s-2;
|
||||
height: deprecated.$s-28;
|
||||
width: deprecated.$s-28;
|
||||
border-radius: deprecated.$br-6;
|
||||
svg {
|
||||
@extend .button-icon;
|
||||
stroke: var(--icon-foreground);
|
||||
}
|
||||
margin: var(--sp-s) var(--sp-s) 0 var(--sp-s);
|
||||
}
|
||||
|
||||
.attrs-container {
|
||||
|
||||
@@ -13,23 +13,6 @@
|
||||
background-color: var(--panel-background-color);
|
||||
}
|
||||
|
||||
.history-toolbox-title {
|
||||
@include deprecated.flexCenter;
|
||||
@include deprecated.uppercaseTitleTipography;
|
||||
position: relative;
|
||||
height: deprecated.$s-32;
|
||||
min-height: deprecated.$s-32;
|
||||
margin: deprecated.$s-8 deprecated.$s-8 0 deprecated.$s-8;
|
||||
border-radius: deprecated.$br-8;
|
||||
background-color: var(--panel-title-background-color);
|
||||
|
||||
span {
|
||||
@include deprecated.flexCenter;
|
||||
flex-grow: 1;
|
||||
color: var(--title-foreground-color-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.history-entry-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
[app.main.data.workspace.shortcuts]
|
||||
[app.main.store :as st]
|
||||
[app.main.ui.components.search-bar :refer [search-bar*]]
|
||||
[app.main.ui.ds.buttons.icon-button :refer [icon-button*]]
|
||||
[app.main.ui.ds.foundations.assets.icon :as i :refer [icon*]]
|
||||
[app.main.ui.ds.product.panel-title :refer [panel-title*]]
|
||||
[app.util.dom :as dom]
|
||||
[app.util.i18n :refer [tr]]
|
||||
[app.util.strings :refer [matches-search]]
|
||||
@@ -487,13 +487,9 @@
|
||||
(dom/focus! (dom/get-element "shortcut-search")))
|
||||
|
||||
[:div {:class (dm/str class " " (stl/css :shortcuts))}
|
||||
[:div {:class (stl/css :shortcuts-header)}
|
||||
[:div {:class (stl/css :shortcuts-title)} (tr "shortcuts.title")]
|
||||
[:> icon-button* {:variant "ghost"
|
||||
:icon i/close
|
||||
:class (stl/css :shortcuts-close-button)
|
||||
:on-click close-fn
|
||||
:aria-label (tr "labels.close")}]]
|
||||
[:> panel-title* {:class (stl/css :shortcuts-title)
|
||||
:text (tr "shortcuts.title")
|
||||
:on-close close-fn}]
|
||||
|
||||
[:div {:class (stl/css :search-field)}
|
||||
[:> search-bar* {:on-change on-search-term-change-2
|
||||
|
||||
@@ -18,27 +18,8 @@
|
||||
margin: deprecated.$s-16 deprecated.$s-12 deprecated.$s-4 deprecated.$s-12;
|
||||
}
|
||||
|
||||
.shortcuts-header {
|
||||
@include deprecated.flexCenter;
|
||||
@include deprecated.uppercaseTitleTipography;
|
||||
position: relative;
|
||||
height: deprecated.$s-32;
|
||||
padding: deprecated.$s-2 deprecated.$s-2 deprecated.$s-2 0;
|
||||
margin: deprecated.$s-4 deprecated.$s-4 0 deprecated.$s-4;
|
||||
border-radius: deprecated.$br-6;
|
||||
background-color: var(--panel-title-background-color);
|
||||
|
||||
.shortcuts-title {
|
||||
@include deprecated.flexCenter;
|
||||
flex-grow: 1;
|
||||
color: var(--title-foreground-color-hover);
|
||||
}
|
||||
|
||||
.shortcuts-close-button {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
}
|
||||
.shortcuts-title {
|
||||
margin: var(--sp-s) var(--sp-s) 0 var(--sp-s);
|
||||
}
|
||||
|
||||
.section {
|
||||
|
||||
@@ -228,7 +228,7 @@
|
||||
:class (stl/css :main-toolbar-options-button)
|
||||
:icon i/bug
|
||||
:aria-pressed (contains? layout :debug-panel)
|
||||
:aria-label "Debugging tool"
|
||||
:aria-label (tr "workspace.toolbar.debug")
|
||||
:tooltip-placement "bottom"
|
||||
:on-click toggle-debug-panel}]])]]
|
||||
|
||||
|
||||
@@ -5471,6 +5471,10 @@ msgstr "Delete row and shapes"
|
||||
msgid "workspace.context-menu.grid-track.row.duplicate"
|
||||
msgstr "Duplicate row"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/debug.cljs:37
|
||||
msgid "workspace.debug.title"
|
||||
msgstr "Debugging tools"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/layers.cljs:512
|
||||
msgid "workspace.focus.focus-mode"
|
||||
msgstr "Focus mode"
|
||||
@@ -8412,6 +8416,10 @@ msgstr "Comments (%s)"
|
||||
msgid "workspace.toolbar.curve"
|
||||
msgstr "Curve (%s)"
|
||||
|
||||
#: src/app/main/ui/workspace/top_toolbar.cljs:231
|
||||
msgid "workspace.toolbar.debug"
|
||||
msgstr "Debugging tools"
|
||||
|
||||
#: src/app/main/ui/workspace/top_toolbar.cljs:172
|
||||
msgid "workspace.toolbar.ellipse"
|
||||
msgstr "Ellipse (%s)"
|
||||
|
||||
@@ -5452,6 +5452,10 @@ msgstr "Borrar fila con el contenido"
|
||||
msgid "workspace.context-menu.grid-track.row.duplicate"
|
||||
msgstr "Duplicar fila"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/debug.cljs:37
|
||||
msgid "workspace.debug.title"
|
||||
msgstr "Herramientas de depuración"
|
||||
|
||||
#: src/app/main/ui/workspace/sidebar/layers.cljs:512
|
||||
msgid "workspace.focus.focus-mode"
|
||||
msgstr "Modo foco"
|
||||
@@ -8273,6 +8277,10 @@ msgstr "Comentarios (%s)"
|
||||
msgid "workspace.toolbar.curve"
|
||||
msgstr "Curva (%s)"
|
||||
|
||||
#: src/app/main/ui/workspace/top_toolbar.cljs:231
|
||||
msgid "workspace.toolbar.debug"
|
||||
msgstr "Herramientas de depuración"
|
||||
|
||||
#: src/app/main/ui/workspace/top_toolbar.cljs:172
|
||||
msgid "workspace.toolbar.ellipse"
|
||||
msgstr "Elipse (%s)"
|
||||
|
||||
Reference in New Issue
Block a user