0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 05:34:23 -05:00

💄 add removed labeled input CSS and improve component slot

This commit is contained in:
Xaviju 2024-11-21 13:52:57 +01:00 committed by Xaviju
parent 0a70f3ccfc
commit 0294695acf
2 changed files with 24 additions and 3 deletions

View file

@ -6,6 +6,22 @@
@import "refactor/common-refactor.scss";
.input {
@extend .input-element;
}
.labeled-input {
@extend .input-element;
.label {
width: auto;
text-wrap: nowrap;
}
}
.labeled-input-error {
border: 1px solid var(--status-color-error-500) !important;
}
.button {
@extend .button-primary;
}

View file

@ -283,6 +283,11 @@ Token names should only contain letters and digits separated by . characters.")}
(set! (.-value (mf/ref-val value-input-ref)) hex-value)
(on-update-value-debounced hex-value)))
on-display-colorpicker (mf/use-fn
(mf/deps color-ramp-open?)
(fn []
(swap! color-ramp-open? not)))
value-error? (seq (:errors @token-resolve-result))
valid-value-field? (and
(not value-error?)
@ -393,9 +398,9 @@ Token names should only contain letters and digits separated by . characters.")}
:external-ref value-input-ref
:on-change on-update-value
:on-blur on-update-value}
(when color?
[:> input-token-color-bullet*
{:color @color :on-click #(swap! color-ramp-open? not)}])]
[:> input-token-color-bullet*
{:color @color :on-click on-display-colorpicker}]]
(when @color-ramp-open?
[:& ramp {:color (some-> (or @token-resolve-result (:value token))
(tinycolor/valid-color))