style(design-system): apply typography/spacing/radius tokens to shared/ui component library

Normalized the 18 shared/ui components (button, input, select, badge,
card, section-card, table, dialog, empty-state, form-field, pagination,
toggle, image-field, key-value-editor, locale-tabs, color-picker,
code-editor, skeleton) — these are the reusable primitives consumed
across storefront/builder/backoffice — to use the new
--font-size-*/--font-weight-*/--line-height-* tokens and the
--radius-xs/--radius-full tokens introduced in the previous commit,
replacing one-off literal values (0.875rem, 13px, 999px, 12px, etc.).

Fixes found along the way:
- code-editor.component.scss: focus border/shadow used a hardcoded
  #497671 (the dexar tenant's primary color) instead of
  var(--primary-color) — would not adapt to the lavero/novo tenant
  themes. Now theme-aware.
- section-card.component.scss used raw 16px/18px/14px radius/padding
  instead of the --radius-lg/--space-* tokens the sibling card
  component already used, so cards and section-cards had slightly
  different rounding/padding for no reason. Aligned to the same scale.
- toggle/badge/item-tag: raw 999px pill radius replaced with the new
  --radius-full token.

Deferred: syntax-highlighting colors in code-editor (.cm-*) are
intentional and left untouched; tenant brand colors in the three
theme.scss files are intentional per-tenant palettes, left untouched.
This commit is contained in:
sdarbinyan
2026-07-20 03:23:22 +04:00
parent 68d679759d
commit aaa3604cd4
16 changed files with 59 additions and 58 deletions

View File

@@ -3,10 +3,10 @@
align-items: center; align-items: center;
gap: var(--space-xs, 0.25rem); gap: var(--space-xs, 0.25rem);
padding: 0.125rem var(--space-sm, 0.5rem); padding: 0.125rem var(--space-sm, 0.5rem);
border-radius: var(--radius-sm, 4px); border-radius: var(--radius-sm, 8px);
font-size: 0.75rem; font-size: var(--font-size-xs, 0.75rem);
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
line-height: 1.4; line-height: var(--line-height-normal, 1.5);
white-space: nowrap; white-space: nowrap;
} }

View File

@@ -16,7 +16,7 @@
border: 1px solid transparent; border: 1px solid transparent;
border-radius: var(--radius-md, 6px); border-radius: var(--radius-md, 6px);
font-family: inherit; font-family: inherit;
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
transition: background-color var(--transition-fast, 120ms ease), transition: background-color var(--transition-fast, 120ms ease),
@@ -38,19 +38,19 @@
.app-button--sm { .app-button--sm {
height: 32px; height: 32px;
padding: 0 var(--space-sm, 0.5rem); padding: 0 var(--space-sm, 0.5rem);
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
} }
.app-button--md { .app-button--md {
height: 40px; height: 40px;
padding: 0 var(--space-md, 1rem); padding: 0 var(--space-md, 1rem);
font-size: 0.9375rem; font-size: var(--font-size-md, 0.9375rem);
} }
.app-button--lg { .app-button--lg {
height: 48px; height: 48px;
padding: 0 var(--space-lg, 1.5rem); padding: 0 var(--space-lg, 1.5rem);
font-size: 1rem; font-size: var(--font-size-lg, 1rem);
} }
.app-button--primary { .app-button--primary {

View File

@@ -5,7 +5,7 @@
.code-editor { .code-editor {
position: relative; position: relative;
border: 1px solid var(--border-color, #d3dad9); border: 1px solid var(--border-color, #d3dad9);
border-radius: 10px; border-radius: var(--radius-md, 12px);
overflow: hidden; overflow: hidden;
} }
@@ -14,17 +14,17 @@
} }
.code-editor--focused { .code-editor--focused {
border-color: #497671; border-color: var(--primary-color, #497671);
box-shadow: 0 0 0 2px rgba(73, 118, 113, 0.15); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #497671) 15%, transparent);
} }
.code-editor-highlight, .code-editor-highlight,
.code-editor-input { .code-editor-input {
margin: 0; margin: 0;
padding: 10px 12px; padding: var(--space-sm, 0.5rem) var(--space-sm, 0.75rem);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 13px; font-size: var(--font-size-sm, 0.8125rem);
line-height: 1.5; line-height: var(--line-height-normal, 1.5);
white-space: pre; white-space: pre;
overflow: auto; overflow: auto;
} }

View File

@@ -32,7 +32,7 @@
background: var(--bg-primary, #fff); background: var(--bg-primary, #fff);
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
font-family: inherit; font-family: inherit;
font-size: 0.9375rem; font-size: var(--font-size-md, 0.9375rem);
transition: border-color var(--transition-fast, 120ms ease), transition: border-color var(--transition-fast, 120ms ease),
box-shadow var(--transition-fast, 120ms ease); box-shadow var(--transition-fast, 120ms ease);

View File

@@ -47,8 +47,8 @@
.app-dialog-panel__title { .app-dialog-panel__title {
margin: 0; margin: 0;
font-size: 1.125rem; font-size: var(--font-size-xl, 1.125rem);
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
} }
@@ -56,7 +56,7 @@
border: none; border: none;
background: transparent; background: transparent;
color: var(--text-secondary, #6b7280); color: var(--text-secondary, #6b7280);
font-size: 1.5rem; font-size: var(--font-size-3xl, 1.5rem);
line-height: 1; line-height: 1;
cursor: pointer; cursor: pointer;
padding: var(--space-xs, 0.25rem); padding: var(--space-xs, 0.25rem);

View File

@@ -21,15 +21,15 @@
.app-empty-state__title { .app-empty-state__title {
margin: 0; margin: 0;
font-size: 1.0625rem; font-size: var(--font-size-xl, 1.125rem);
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
} }
.app-empty-state__description { .app-empty-state__description {
margin: 0; margin: 0;
max-width: 32rem; max-width: 32rem;
font-size: 0.875rem; font-size: var(--font-size-base, 0.875rem);
} }
.app-empty-state__actions { .app-empty-state__actions {

View File

@@ -5,8 +5,8 @@
} }
.app-form-field__label { .app-form-field__label {
font-size: 0.875rem; font-size: var(--font-size-base, 0.875rem);
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
} }
@@ -21,12 +21,12 @@
.app-form-field__hint { .app-form-field__hint {
margin: 0; margin: 0;
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
color: var(--text-secondary, #6b7280); color: var(--text-secondary, #6b7280);
} }
.app-form-field__error { .app-form-field__error {
margin: 0; margin: 0;
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
color: var(--error-color, #c0392b); color: var(--error-color, #c0392b);
} }

View File

@@ -4,14 +4,14 @@
.image-field { .image-field {
display: flex; display: flex;
gap: 12px; gap: var(--space-sm, 0.5rem);
align-items: flex-start; align-items: flex-start;
} }
.image-field__thumb { .image-field__thumb {
width: 56px; width: 56px;
height: 56px; height: 56px;
border-radius: 10px; border-radius: var(--radius-md, 12px);
border: 1px solid var(--border-color, #d3dad9); border: 1px solid var(--border-color, #d3dad9);
object-fit: cover; object-fit: cover;
background: #fbfcfc; background: #fbfcfc;
@@ -25,10 +25,10 @@
.image-field__controls { .image-field__controls {
flex: 1; flex: 1;
display: grid; display: grid;
gap: 8px; gap: var(--space-sm, 0.5rem);
} }
.image-field__actions { .image-field__actions {
display: flex; display: flex;
gap: 8px; gap: var(--space-sm, 0.5rem);
} }

View File

@@ -41,19 +41,19 @@
.app-input--sm { .app-input--sm {
height: 32px; height: 32px;
padding: 0 var(--space-sm, 0.5rem); padding: 0 var(--space-sm, 0.5rem);
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
} }
.app-input--md { .app-input--md {
height: 40px; height: 40px;
padding: 0 var(--space-md, 1rem); padding: 0 var(--space-md, 1rem);
font-size: 0.9375rem; font-size: var(--font-size-md, 0.9375rem);
} }
.app-input--lg { .app-input--lg {
height: 48px; height: 48px;
padding: 0 var(--space-lg, 1.5rem); padding: 0 var(--space-lg, 1.5rem);
font-size: 1rem; font-size: var(--font-size-lg, 1rem);
} }
.app-input--error { .app-input--error {

View File

@@ -4,21 +4,21 @@
.app-key-value-editor { .app-key-value-editor {
display: grid; display: grid;
gap: 10px; gap: var(--space-sm, 0.5rem);
} }
.app-key-value-editor-row { .app-key-value-editor-row {
display: flex; display: flex;
gap: 8px; gap: var(--space-sm, 0.5rem);
align-items: flex-start; align-items: flex-start;
border: 1px solid var(--border-color, #d3dad9); border: 1px solid var(--border-color, #d3dad9);
border-radius: 12px; border-radius: var(--radius-md, 12px);
padding: 12px; padding: var(--space-sm, 0.5rem);
background: var(--bg-secondary, #fbfcfc); background: var(--bg-secondary, #fbfcfc);
} }
.app-key-value-editor-row-content { .app-key-value-editor-row-content {
flex: 1; flex: 1;
display: grid; display: grid;
gap: 8px; gap: var(--space-sm, 0.5rem);
} }

View File

@@ -9,13 +9,13 @@
} }
.app-locale-tab { .app-locale-tab {
padding: 8px 16px; padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
border: none; border: none;
border-bottom: 2px solid transparent; border-bottom: 2px solid transparent;
background: transparent; background: transparent;
color: var(--text-secondary, #5f6e6a); color: var(--text-secondary, #5f6e6a);
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
font-size: 0.875rem; font-size: var(--font-size-base, 0.875rem);
text-transform: uppercase; text-transform: uppercase;
cursor: pointer; cursor: pointer;
transition: color var(--transition-fast, 120ms ease), transition: color var(--transition-fast, 120ms ease),

View File

@@ -12,7 +12,7 @@
border-radius: var(--radius-md, 6px); border-radius: var(--radius-md, 6px);
background: transparent; background: transparent;
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
cursor: pointer; cursor: pointer;
transition: background-color var(--transition-fast, 120ms ease), transition: background-color var(--transition-fast, 120ms ease),
border-color var(--transition-fast, 120ms ease); border-color var(--transition-fast, 120ms ease);

View File

@@ -5,30 +5,31 @@
.app-section-card { .app-section-card {
background: var(--bg-primary, #fff); background: var(--bg-primary, #fff);
border: 1px solid var(--border-color, #d3dad9); border: 1px solid var(--border-color, #d3dad9);
border-radius: 16px; border-radius: var(--radius-lg, 13px);
padding: 18px; padding: var(--space-lg, 1.5rem);
display: grid; display: grid;
gap: 14px; gap: var(--space-md, 1rem);
} }
.app-section-card-header { .app-section-card-header {
display: grid; display: grid;
gap: 4px; gap: var(--space-xs, 0.25rem);
} }
.app-section-card-header h2 { .app-section-card-header h2 {
margin: 0; margin: 0;
font-size: 1.125rem; font-size: var(--font-size-xl, 1.125rem);
font-weight: var(--font-weight-semibold, 600);
color: var(--text-primary, #1e3c38); color: var(--text-primary, #1e3c38);
} }
.app-section-card-description { .app-section-card-description {
margin: 0; margin: 0;
font-size: 0.875rem; font-size: var(--font-size-base, 0.875rem);
color: var(--text-secondary, #5f6e6a); color: var(--text-secondary, #5f6e6a);
} }
.app-section-card-body { .app-section-card-body {
display: grid; display: grid;
gap: 14px; gap: var(--space-md, 1rem);
} }

View File

@@ -53,28 +53,28 @@
.app-select--sm { .app-select--sm {
height: 32px; height: 32px;
padding: 0 var(--space-sm, 0.5rem); padding: 0 var(--space-sm, 0.5rem);
font-size: 0.8125rem; font-size: var(--font-size-sm, 0.8125rem);
} }
.app-select--md { .app-select--md {
height: 40px; height: 40px;
padding: 0 var(--space-md, 1rem); padding: 0 var(--space-md, 1rem);
font-size: 0.9375rem; font-size: var(--font-size-md, 0.9375rem);
} }
.app-select--lg { .app-select--lg {
height: 48px; height: 48px;
padding: 0 var(--space-lg, 1.5rem); padding: 0 var(--space-lg, 1.5rem);
font-size: 1rem; font-size: var(--font-size-lg, 1rem);
} }
.app-select-description { .app-select-description {
display: block; display: block;
font-weight: 400; font-weight: var(--font-weight-normal, 400);
font-size: 12px; font-size: var(--font-size-xs, 0.75rem);
line-height: 1.4; line-height: var(--line-height-normal, 1.5);
color: var(--text-secondary, #6b7280); color: var(--text-secondary, #6b7280);
margin-top: 4px; margin-top: var(--space-xs, 0.25rem);
} }
@media (prefers-reduced-motion: reduce) { @media (prefers-reduced-motion: reduce) {

View File

@@ -20,7 +20,7 @@ app-table {
.app-table { .app-table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
font-size: 0.875rem; font-size: var(--font-size-base, 0.875rem);
color: var(--text-primary, #1f322d); color: var(--text-primary, #1f322d);
thead { thead {
@@ -29,7 +29,7 @@ app-table {
th { th {
text-align: left; text-align: left;
font-weight: 600; font-weight: var(--font-weight-semibold, 600);
color: var(--text-secondary, #6b7280); color: var(--text-secondary, #6b7280);
padding: var(--space-sm, 0.5rem) var(--space-md, 1rem); padding: var(--space-sm, 0.5rem) var(--space-md, 1rem);
border-bottom: 1px solid var(--border-color, #e4e4e7); border-bottom: 1px solid var(--border-color, #e4e4e7);

View File

@@ -6,7 +6,7 @@
position: relative; position: relative;
width: 42px; width: 42px;
height: 24px; height: 24px;
border-radius: 999px; border-radius: var(--radius-full, 999px);
border: 1px solid var(--border-color, #d3dad9); border: 1px solid var(--border-color, #d3dad9);
background: var(--bg-secondary, #e4e4e7); background: var(--bg-secondary, #e4e4e7);
cursor: pointer; cursor: pointer;