feat: update client navigation and first-leg orders
This commit is contained in:
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
:root { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; color: #172033; background: #f5f7f8; font-synthesis: none; --primary: #075e54; --primary-dark: #064b44; --navy: #17324d; --border: #e1e7ea; --muted: #687780; }
|
||||
:root { font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif; color: #172033; background: #f5f7fa; font-synthesis: none; --primary: #667eea; --primary-dark: #596fd3; --topbar: rgba(102, 126, 234, .95); --navy: #1e293b; --border: #e2e5ef; --muted: #71717a; --el-color-primary: #667eea; --el-color-primary-dark-2: #5265bb; --el-color-primary-light-3: #94a5f0; --el-color-primary-light-5: #b3bff5; --el-color-primary-light-7: #d1d8f9; --el-color-primary-light-8: #e0e5fb; --el-color-primary-light-9: #f0f2fd; }
|
||||
* { box-sizing: border-box; }
|
||||
html, body, #app { min-width: 320px; min-height: 100%; margin: 0; }
|
||||
body { min-height: 100vh; background: #f5f7f8; }
|
||||
body { min-height: 100vh; background: #f5f7fa; }
|
||||
button, input { font: inherit; }
|
||||
a { color: inherit; }
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
@media (max-width: 720px) {
|
||||
.top-header { inset: 0; width: 100%; max-width: 100vw; padding: 0 14px; }
|
||||
.client-sidebar { display: flex; width: min(286px, 86vw); padding: 20px 14px 18px; visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; z-index: 21; }
|
||||
.client-sidebar { display: flex; width: min(286px, 86vw); padding: 0 14px 18px; visibility: hidden; pointer-events: none; transform: translateX(-100%); transition: transform .2s ease, visibility 0s linear .2s; z-index: 21; }
|
||||
.mobile-menu-open .client-sidebar { visibility: visible; pointer-events: auto; transform: translateX(0); transition-delay: 0s; }
|
||||
.client-sidebar-scrim { position: fixed; inset: 0; z-index: 20; display: block; padding: 0; border: 0; background: rgba(7, 18, 34, .56); }
|
||||
.client-sidebar-brand button { display: grid; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; place-items: center; }
|
||||
|
||||
@@ -10,13 +10,13 @@ const mobileStyles = compact.slice(compact.indexOf('@media (max-width: 720px)'))
|
||||
|
||||
test('style source contract: constrains the desktop sidebar and gives the menu its own scroll region', () => {
|
||||
assert.match(compact, /\.client-shell\s*\{[^}]*overflow-x:\s*hidden/)
|
||||
assert.match(compact, /\.client-sidebar\s*\{[^}]*inset:\s*0 auto 0 0[^}]*width:\s*250px[^}]*overflow:\s*hidden[^}]*background:\s*linear-gradient\(180deg, #0b1f3a 0%, #0c2a52 100%\)/)
|
||||
assert.match(compact, /\.client-sidebar\s*\{[^}]*inset:\s*0 auto 0 0[^}]*width:\s*250px[^}]*overflow:\s*hidden[^}]*background:\s*rgba\(255, 255, 255, \.98\)/)
|
||||
assert.match(compact, /\.top-header\s*\{[^}]*inset:\s*0 0 auto 250px[^}]*max-width:\s*calc\(100vw - 250px\)/)
|
||||
assert.match(compact, /\.client-sidebar nav\s*\{[^}]*flex:\s*1[^}]*min-height:\s*0[^}]*overflow-y:\s*auto/)
|
||||
assert.match(compact, /\.client-sidebar nav\s*\{[^}]*scrollbar-color:\s*rgba\(206, 222, 238, \.46\) transparent[^}]*scrollbar-width:\s*thin/)
|
||||
assert.match(compact, /\.client-sidebar nav\s*\{[^}]*scrollbar-color:\s*rgba\(102, 126, 234, \.3\) transparent[^}]*scrollbar-width:\s*thin/)
|
||||
assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar\s*\{[^}]*width:\s*10px[^}]*background:\s*transparent/)
|
||||
assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-track\s*\{[^}]*background:\s*transparent/)
|
||||
assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-thumb\s*\{[^}]*border:\s*3px solid transparent[^}]*background:\s*rgba\(206, 222, 238, \.46\)[^}]*background-clip:\s*padding-box/)
|
||||
assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-thumb\s*\{[^}]*border:\s*3px solid transparent[^}]*background:\s*rgba\(102, 126, 234, \.3\)[^}]*background-clip:\s*padding-box/)
|
||||
assert.match(compact, /\.client-sidebar nav::\-webkit-scrollbar-button\s*\{[^}]*display:\s*none[^}]*width:\s*0[^}]*height:\s*0/)
|
||||
assert.match(compact, /\.client-nav-menu,[^\{]*\.client-nav-submenu\s*\{[^}]*min-width:\s*0/)
|
||||
assert.match(compact, /\.client-nav-menu\s*\{[^}]*flex:\s*1[^}]*background:\s*transparent/)
|
||||
@@ -26,11 +26,12 @@ test('style source contract: constrains the desktop sidebar and gives the menu i
|
||||
test('style source contract: presents native grouped rows matching the prototype active and divider states', () => {
|
||||
assert.doesNotMatch(compact, /\.client-sidebar \.el-menu|\.el-menu-item|\.el-sub-menu/)
|
||||
assert.match(compact, /\.client-nav-menu,[^\{]*\.client-nav-submenu\s*\{[^}]*margin:\s*0[^}]*padding:\s*0[^}]*list-style:\s*none/)
|
||||
assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px[^}]*border-radius:\s*10px[^}]*color:\s*rgba\(255, 255, 255, \.72\)/)
|
||||
assert.match(compact, /\.client-sidebar-link\[aria-current="page"\]\s*\{[^}]*background:\s*linear-gradient\(90deg, #1565c0, #1e88e5\)[^}]*color:\s*#fff/)
|
||||
assert.match(compact, /\.client-nav-node\.is-active-parent > \.client-sidebar-group-trigger\s*\{[^}]*background:\s*rgba\(255, 255, 255, \.08\)[^}]*color:\s*#fff/)
|
||||
assert.match(compact, /\.client-nav-node\.has-divider-before\s*\{[^}]*border-top:\s*1px solid rgba\(255, 255, 255, \.1\)/)
|
||||
assert.match(compact, /\.client-nav-submenu\s*\{[^}]*padding-left:\s*34px/)
|
||||
assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px[^}]*border-radius:\s*0 12px 12px 0[^}]*color:\s*#595959/)
|
||||
assert.match(compact, /\.client-nav-submenu \.client-sidebar-link\[aria-current="page"\]\s*\{[^}]*background:\s*rgba\(102, 126, 234, \.12\)[^}]*box-shadow:\s*none[^}]*color:\s*var\(--primary\)/)
|
||||
assert.match(compact, /\.client-nav-node\.is-active-parent > \.client-sidebar-group-trigger\s*\{[^}]*background:\s*transparent[^}]*color:\s*#52525b/)
|
||||
assert.match(compact, /\.client-nav-node\.has-divider-before\s*\{[^}]*border-top:\s*1px solid rgba\(102, 126, 234, \.12\)/)
|
||||
assert.match(compact, /\.client-nav-submenu\s*\{[^}]*padding:\s*4px 0/)
|
||||
assert.match(compact, /\.client-nav-submenu \.client-sidebar-link\s*\{[^}]*height:\s*42px[^}]*margin:\s*0 12px[^}]*padding:\s*0 20px 0 54px[^}]*border-radius:\s*10px/)
|
||||
assert.match(compact, /\.client-sidebar-group-trigger\s*\{[^}]*border:\s*0[^}]*background:\s*transparent/)
|
||||
assert.match(compact, /\.client-sidebar-link\s*\{[^}]*text-decoration:\s*none/)
|
||||
assert.match(compact, /\.client-sidebar (?:\.client-sidebar-group-trigger|\.client-sidebar-link) svg[^\{]*\{[^}]*flex:\s*0 0 18px/)
|
||||
@@ -39,8 +40,8 @@ test('style source contract: presents native grouped rows matching the prototype
|
||||
|
||||
test('style source contract: makes navigation and drawer controls touch sized with visible keyboard focus', () => {
|
||||
assert.match(compact, /\.client-sidebar-group-trigger,[^\{]*\.client-sidebar-link\s*\{[^}]*height:\s*44px/)
|
||||
assert.match(compact, /\.client-sidebar-group-trigger:focus-visible,\s*\.client-sidebar-link:focus-visible,[\s\S]*?\.client-sidebar-logout:focus-visible\s*\{[^}]*outline:\s*2px solid #8ed8cf[^}]*outline-offset:\s*2px/)
|
||||
assert.match(compact, /\.client-sidebar-logout\s*\{[^}]*height:\s*44px[^}]*background:\s*rgba\(239, 68, 68, \.12\)/)
|
||||
assert.match(compact, /\.client-sidebar-group-trigger:focus-visible,\s*\.client-sidebar-link:focus-visible,[\s\S]*?\.client-sidebar-logout:focus-visible\s*\{[^}]*outline:\s*2px solid var\(--primary\)[^}]*outline-offset:\s*2px/)
|
||||
assert.match(compact, /\.client-sidebar-logout\s*\{[^}]*height:\s*44px[^}]*background:\s*#fff1f0/)
|
||||
})
|
||||
|
||||
test('style source contract: turns the sidebar into a layered drawer at 720px and below', () => {
|
||||
|
||||
+28
-25
@@ -1,57 +1,60 @@
|
||||
.client-shell { min-height: 100vh; overflow-x: hidden; }
|
||||
.top-header { position: fixed; inset: 0 0 auto 250px; z-index: 20; display: flex; width: auto; max-width: calc(100vw - 250px); height: 68px; align-items: center; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); }
|
||||
.client-header-menu-button { display: none; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--navy); place-items: center; }
|
||||
.top-header { position: fixed; inset: 0 0 auto 250px; z-index: 20; display: flex; width: auto; max-width: calc(100vw - 250px); height: 68px; align-items: center; gap: 16px; padding: 0 24px; background: var(--topbar); box-shadow: 0 8px 32px rgba(0, 0, 0, .15), 0 2px 8px rgba(0, 0, 0, .1); backdrop-filter: blur(20px); }
|
||||
.client-header-menu-button { display: none; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .1); color: #fff; place-items: center; }
|
||||
.client-header-heading { min-width: 0; flex: 1; }
|
||||
.client-header-heading h1 { overflow: hidden; margin: 0; color: var(--navy); font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.client-header-heading p { overflow: hidden; margin: 2px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.client-header-heading h1 { overflow: hidden; margin: 0; color: #fff; font-size: 18px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.client-header-heading p { overflow: hidden; margin: 2px 0 0; color: rgba(255, 255, 255, .72); font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.client-user { display: flex; align-items: center; gap: 10px; }
|
||||
.client-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #e7f3f1; color: var(--primary); font-weight: 750; }
|
||||
.client-avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #fff; color: var(--primary); font-weight: 750; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
|
||||
.client-user-copy { display: flex; flex-direction: column; }
|
||||
.client-user-copy strong { font-size: 12px; }
|
||||
.client-user-copy small { color: var(--muted); font-size: 10px; }
|
||||
.client-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 21; display: flex; width: 250px; flex-direction: column; overflow: hidden; padding: 20px 14px; background: linear-gradient(180deg, #0b1f3a 0%, #0c2a52 100%); color: #fff; }
|
||||
.client-sidebar-brand { display: flex; flex: 0 0 auto; min-height: 68px; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 0 14px; padding: 0 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
|
||||
.client-user-copy strong { color: #fff; font-size: 12px; }
|
||||
.client-user-copy small { color: rgba(255, 255, 255, .68); font-size: 10px; }
|
||||
.client-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 21; display: flex; width: 250px; flex-direction: column; overflow: hidden; padding: 0 14px 20px; background: rgba(255, 255, 255, .98); box-shadow: 4px 0 32px rgba(0, 0, 0, .08); color: var(--navy); }
|
||||
.client-sidebar-brand { display: flex; flex: 0 0 68px; min-height: 68px; align-items: center; justify-content: space-between; gap: 10px; margin: 0 -14px 14px; padding: 0 18px; background: var(--topbar); }
|
||||
.client-sidebar-brand-link { display: flex; min-width: 0; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
|
||||
.client-sidebar-brand-mark { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border-radius: 9px; background: #fff; box-shadow: 0 5px 14px rgba(0, 0, 0, .18); }
|
||||
.client-sidebar-brand-mark { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid rgba(102, 126, 234, .14); border-radius: 9px; background: #fff; box-shadow: 0 3px 10px rgba(30, 41, 59, .08); }
|
||||
.client-sidebar-brand-mark img { display: block; width: 28px; height: 28px; object-fit: contain; }
|
||||
.client-sidebar-brand-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
|
||||
.client-sidebar-brand-copy strong { font-size: 15px; letter-spacing: .02em; line-height: 1.2; }
|
||||
.client-sidebar-brand-copy small { color: rgba(255, 255, 255, .56); font-size: 10px; letter-spacing: .12em; }
|
||||
.client-sidebar nav { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; overflow-x: hidden; overflow-y: auto; scrollbar-color: rgba(206, 222, 238, .46) transparent; scrollbar-width: thin; }
|
||||
.client-sidebar-brand-copy small { color: rgba(255, 255, 255, .76); font-size: 10px; letter-spacing: .12em; }
|
||||
.client-sidebar nav { display: flex; flex: 1; min-width: 0; min-height: 0; flex-direction: column; overflow-x: hidden; overflow-y: auto; scrollbar-color: rgba(102, 126, 234, .3) transparent; scrollbar-width: thin; }
|
||||
.client-sidebar nav::-webkit-scrollbar { width: 10px; background: transparent; }
|
||||
.client-sidebar nav::-webkit-scrollbar-track { background: transparent; }
|
||||
.client-sidebar nav::-webkit-scrollbar-thumb { min-height: 40px; border: 3px solid transparent; border-radius: 999px; background: rgba(206, 222, 238, .46); background-clip: padding-box; }
|
||||
.client-sidebar nav::-webkit-scrollbar-thumb:hover { background-color: rgba(235, 244, 252, .72); }
|
||||
.client-sidebar nav::-webkit-scrollbar-thumb { min-height: 40px; border: 3px solid transparent; border-radius: 999px; background: rgba(102, 126, 234, .3); background-clip: padding-box; }
|
||||
.client-sidebar nav::-webkit-scrollbar-thumb:hover { background-color: rgba(102, 126, 234, .5); }
|
||||
.client-sidebar nav::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
|
||||
.client-sidebar nav::-webkit-scrollbar-corner { background: transparent; }
|
||||
.client-nav-menu,
|
||||
.client-nav-submenu { min-width: 0; margin: 0; padding: 0; list-style: none; }
|
||||
.client-nav-menu { flex: 1; background: transparent; }
|
||||
.client-nav-submenu { padding-left: 34px; }
|
||||
.client-nav-submenu { padding: 4px 0; background: linear-gradient(180deg, rgba(102, 126, 234, .03), transparent); }
|
||||
.client-nav-node { min-width: 0; }
|
||||
.client-nav-node.has-divider-before { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
|
||||
.client-nav-node.has-divider-before { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(102, 126, 234, .12); }
|
||||
.client-sidebar-group-trigger,
|
||||
.client-sidebar-link { display: flex; width: 100%; height: 44px; min-width: 0; align-items: center; gap: 11px; margin: 2px 0; padding: 0 10px; border-radius: 10px; color: rgba(255, 255, 255, .72); }
|
||||
.client-sidebar-link { display: flex; width: 100%; height: 44px; min-width: 0; align-items: center; gap: 11px; margin: 2px 0; padding: 0 10px; border-radius: 0 12px 12px 0; color: #595959; transition: color .2s ease, background .2s ease, transform .2s ease; }
|
||||
.client-sidebar-group-trigger { border: 0; background: transparent; cursor: pointer; text-align: left; }
|
||||
.client-sidebar-link { text-decoration: none; }
|
||||
.client-sidebar-group-trigger:hover,
|
||||
.client-sidebar-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
|
||||
.client-sidebar-link[aria-current="page"] { background: linear-gradient(90deg, #1565c0, #1e88e5); box-shadow: 0 6px 18px rgba(21, 101, 192, .4); color: #fff; font-weight: 650; }
|
||||
.client-nav-node.is-active-parent > .client-sidebar-group-trigger { background: rgba(255, 255, 255, .08); color: #fff; font-weight: 600; }
|
||||
.client-sidebar-link:hover { background: linear-gradient(135deg, rgba(102, 126, 234, .1), rgba(240, 147, 251, .08)); color: var(--primary); transform: translateX(3px); }
|
||||
.client-nav-menu > .client-nav-node > .client-sidebar-link[aria-current="page"] { background: linear-gradient(135deg, rgba(102, 126, 234, .18), rgba(240, 147, 251, .12)); box-shadow: inset 3px 0 var(--primary), 0 2px 8px rgba(102, 126, 234, .1); color: var(--primary); font-weight: 700; }
|
||||
.client-nav-submenu .client-sidebar-link { height: 42px; margin: 0 12px; padding: 0 20px 0 54px; border-radius: 10px; color: #71717a; }
|
||||
.client-nav-submenu .client-sidebar-link:hover { background: rgba(102, 126, 234, .08); color: var(--primary); transform: translateX(4px); }
|
||||
.client-nav-submenu .client-sidebar-link[aria-current="page"] { background: rgba(102, 126, 234, .12); box-shadow: none; color: var(--primary); font-weight: 700; }
|
||||
.client-nav-node.is-active-parent > .client-sidebar-group-trigger { background: transparent; color: #52525b; font-weight: 400; }
|
||||
.client-sidebar .client-sidebar-group-trigger svg,
|
||||
.client-sidebar .client-sidebar-link svg { flex: 0 0 18px; }
|
||||
.client-sidebar .client-sidebar-group-chevron { width: 16px; height: 16px; flex: 0 0 16px; margin-left: auto; transition: transform .2s ease; }
|
||||
.client-sidebar-group-trigger[aria-expanded="true"] .client-sidebar-group-chevron { transform: rotate(180deg); }
|
||||
.client-sidebar .client-sidebar-group-chevron { width: 16px; height: 16px; flex: 0 0 16px; margin-left: auto; transform: rotate(-90deg); transition: transform .2s ease; }
|
||||
.client-sidebar-group-trigger[aria-expanded="true"] .client-sidebar-group-chevron { transform: rotate(0); }
|
||||
.client-sidebar-group-trigger span,
|
||||
.client-sidebar-link span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.client-sidebar-group-trigger:focus-visible,
|
||||
.client-sidebar-link:focus-visible,
|
||||
.client-header-menu-button:focus-visible,
|
||||
.client-sidebar-brand button:focus-visible,
|
||||
.client-sidebar-logout:focus-visible { outline: 2px solid #8ed8cf; outline-offset: 2px; }
|
||||
.client-sidebar-logout:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
|
||||
.client-sidebar-brand button,
|
||||
.client-sidebar-scrim { display: none; }
|
||||
.client-sidebar-logout { display: flex; width: 100%; height: 44px; align-items: center; justify-content: flex-start; gap: 11px; margin: 2px 0 0; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(239, 68, 68, .12); color: #fca5a5; cursor: pointer; font-weight: 600; text-align: left; }
|
||||
.client-sidebar-logout:hover { background: rgba(239, 68, 68, .22); color: #fff; }
|
||||
.client-sidebar-logout { display: flex; width: 100%; height: 44px; align-items: center; justify-content: flex-start; gap: 11px; margin: 2px 0 0; padding: 0 10px; border: 0; border-radius: 10px; background: #fff1f0; color: #d94b50; cursor: pointer; font-weight: 600; text-align: left; }
|
||||
.client-sidebar-logout:hover { background: #ffe3e1; color: #b52f35; }
|
||||
.client-sidebar-logout svg { flex: 0 0 18px; }
|
||||
.client-main { width: calc(100% - 250px); max-width: 100%; min-height: 100vh; margin-left: 250px; padding: 88px 20px 40px; }
|
||||
|
||||
Reference in New Issue
Block a user