Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
367 changes: 367 additions & 0 deletions assets/scss/_form-styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,367 @@
// Tier 0 Primitive #5 — Form Structural Primitives
// Migrated from webui/assets/scss/_form-styles.scss
// Provides .entity-form/.card-form/.form-input etc. — pure SCSS, consumes _vars tokens only.
@use './_vars' as *;

.entity-form {
display: flex;
flex-direction: column;
gap: 0.75rem;
background: $bg-gray;
width: min(750px, 100%);
height: auto;
overflow-y: auto;
border-radius: 16px;
padding: 2rem 2rem 1.5rem 2rem;
box-shadow: $shadow-sm;
box-sizing: border-box;
align-self: flex-start;

@media (max-width: $breakpoint-md) {
padding: 1.5rem 1.5rem 1.25rem 1.5rem;
border-radius: 12px;
gap: 1rem;
}

@media (max-width: $breakpoint-sm) {
padding: 1rem 1rem 0.75rem 1rem;
border-radius: 8px;
gap: 0.75rem;
width: 100%;
}

@media (max-width: 480px) {
padding: 0.75rem 0.75rem 0.5rem 0.75rem;
border-radius: 6px;
gap: 0.5rem;
}
}

.form-group {
display: flex;
flex-direction: column;
gap: 0.5rem;

@media (max-width: $breakpoint-sm) {
gap: 0.375rem;
}
}

.form-label {
font-weight: 600;
color: $text-primary;
margin: 0;
font-size: 1rem;

@media (max-width: $breakpoint-md) {
font-size: 0.95rem;
}

@media (max-width: $breakpoint-sm) {
font-size: 0.9rem;
}
}

.form-input,
.form-textarea,
.form-select {
width: 100%;
box-sizing: border-box;
padding: 0.75rem 1rem;
border: 1px solid $border-medium;
border-radius: 12px;
font-size: 1rem;
background: $bg-white;
color: $text-primary;
transition:
border-color $duration-fast $easing-standard,
box-shadow $duration-fast $easing-standard,
background-color $duration-fast $easing-standard;

@media (max-width: $breakpoint-md) {
padding: 0.625rem 0.875rem;
font-size: 0.95rem;
border-radius: 10px;
}

@media (max-width: $breakpoint-sm) {
padding: 0.5rem 0.75rem;
font-size: 0.9rem;
border-radius: 10px;
}

@media (max-width: 480px) {
padding: 0.5rem 0.625rem;
font-size: 0.875rem;
}

&::placeholder {
color: $text-muted;
}

&:hover:not(:focus):not(:disabled) {
border-color: $text-muted;
}

&:focus {
border-color: $primary;
outline: none;
box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.18);
}

&:disabled {
background: $bg-light;
color: $text-muted;
cursor: not-allowed;
}

&.error {
border-color: $error-color;

&:focus {
box-shadow: 0 0 0 3px rgba(var(--color-error-rgb, 220, 38, 38), 0.18);
}
}
}

.form-select {
cursor: pointer;
appearance: none;
background-position: right 0.75rem center;
background-repeat: no-repeat;
background-size: 1.5em 1.5em;
padding-right: 2.5rem;

option {
padding: 0.5rem;
}
}

.form-textarea {
resize: vertical;
max-height: 6vh;
}

.submit-btn {
background: $primary;
color: $bg-white;
font-weight: 700;
font-size: 1rem;
border: none;
border-radius: 8px;
width: fit-content;
padding: 0.75rem 1rem;
cursor: pointer;
transition: 0.2s;
margin-top: 0.5rem;

@media (max-width: $breakpoint-md) {
font-size: 0.95rem;
padding: 0.625rem 0.875rem;
border-radius: 6px;
}

@media (max-width: $breakpoint-sm) {
font-size: 0.9rem;
padding: 0.5rem 0.75rem;
width: 100%;
margin-top: 0.75rem;
}

@media (max-width: 480px) {
font-size: 0.875rem;
padding: 0.5rem 0.625rem;
margin-top: 1rem;
}

&:hover {
background: $primary-hover;
}
}

.error-text {
color: $error-color;
font-size: 0.95rem;
margin-top: 0.25rem;
}

.name-icon-row {
display: grid;
grid-template-columns: 1fr auto;
align-items: end;
gap: $spacing-4;
}

.name-col {
min-width: 0;
}

.two-col-row {
display: grid;
grid-template-columns: 1fr;
gap: $spacing-4;
}

@media (min-width: $breakpoint-md) {
.two-col-row {
grid-template-columns: 1fr 1fr;
align-items: start;
}
}

.icon-trigger {
width: 48px;
height: 48px;
border-radius: 9999px;
border: 1px solid $border-light;
background: rgba(var(--color-primary-rgb), 0.12);
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: $transition-base;

&:hover {
background: rgba(var(--color-primary-rgb), 0.18);
border-color: rgba(var(--color-primary-rgb), 0.25);
}
&:focus-visible {
outline: none;
box-shadow: 0 0 0 3px $input-focus;
}
}

.icon-trigger__icon {
width: 22px;
height: 22px;
color: $primary;
}

.icon-popover {
margin-top: $spacing-2;
padding: $spacing-3;
background: $bg-white;
border: 1px solid $border-light;
border-radius: $radius-lg;
box-shadow: $shadow-sm;
}

.card-form {
background: $bg-white;
border-radius: $radius-xl;
border: 1px solid $border-color;
box-shadow: $shadow-md;
padding: 1.5rem;
width: min(750px, 100%);
min-width: 600px;

@media (max-width: $breakpoint-md) {
padding: 1.25rem;
min-width: auto;
}

@media (max-width: $breakpoint-sm) {
padding: 1rem;
}
}

.form-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.5rem;

h2 {
font-size: $font-size-lg;
font-weight: $font-semibold;
color: $text-primary;
margin: 0;
}

@media (max-width: $breakpoint-sm) {
margin-bottom: 1rem;

h2 {
font-size: $font-size-base;
}
}
}

.close-btn {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
background: $bg-gray;
border: none;
cursor: pointer;
transition: background 0.2s;

&:hover {
background: $border-color;
}

svg {
width: 18px;
height: 18px;
color: $text-secondary;
}
}

.form-actions {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
margin-top: 1.5rem;
padding-top: 1rem;
border-top: 1px solid $border-color;

@media (max-width: $breakpoint-sm) {
flex-direction: column-reverse;
gap: 0.5rem;
}
}

.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
padding: 0.75rem 1.25rem;
border-radius: $radius-lg;
font-weight: $font-semibold;
font-size: $font-size-sm;
cursor: pointer;
transition: all 0.2s;
border: none;

@media (max-width: $breakpoint-sm) {
width: 100%;
padding: 0.625rem 1rem;
}

&:disabled {
opacity: 0.6;
cursor: not-allowed;
}
}

.btn-primary {
background: $primary;
color: white;

&:hover:not(:disabled) {
opacity: 0.9;
}
}

.btn-secondary {
background: $bg-gray;
color: $text-primary;

&:hover:not(:disabled) {
background: $border-color;
}
}
Loading
Loading