update defoult styling

This commit is contained in:
MeghdadFadaee committed 2026-09-09 20:03:56 +03:30
1 parent 9a28ff7354
commit 5c83f59332
8 files changed
+126 -67

No files matched your search

+5
View File
@@ -4,9 +4,14 @@ All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
### Changed
- Make the selector palette, overview, surfaces, typography, focus states, and default tenant styling inherit Nova's configured brand and neutral colors.
### Fixed ### Fixed
- Ignore a persisted tenant cookie while Nova is serving an unauthenticated page, such as the login screen. - Ignore a persisted tenant cookie while Nova is serving an unauthenticated page, such as the login screen.
- Keep controls readable when a tenant uses a light accent color such as white.
## [1.0.0] - 2026-09-09 ## [1.0.0] - 2026-09-09
+2
View File
@@ -180,6 +180,8 @@ Selection uses Nova's authenticated request client, stores the authorized tenant
The package overrides Nova's `AppLogo` component with the selected tenant's logo and title. The image source remains the fixed authenticated endpoint `/nova-vendor/nova-tenancy/current/logo`; remote images are redirected to rather than fetched by the server. Only root-relative, HTTP, and HTTPS logo URLs are accepted by the default response and tenant list payload. The package overrides Nova's `AppLogo` component with the selected tenant's logo and title. The image source remains the fixed authenticated endpoint `/nova-vendor/nova-tenancy/current/logo`; remote images are redirected to rather than fetched by the server. Only root-relative, HTTP, and HTTPS logo URLs are accepted by the default response and tenant list payload.
The selector inherits Nova's configured `brand.colors` palette, neutral card surfaces, typography, and dark-mode colors. A tenant accent overrides Nova's primary color only for that tenant's identity elements, with an automatically selected foreground color for accessible light and dark accents.
If another package also replaces `AppLogo`, the last component registered by Nova wins. If another package also replaces `AppLogo`, the last component registered by Nova wins.
## Customization ## Customization
+1 -1
View File
@@ -1 +1 @@
.nova-tenancy-page{--nt-primary:#7c3aed;--nt-primary-strong:#5b21b6;--nt-surface:hsla(0,0%,100%,.88);--nt-border:rgba(226,232,240,.9);--nt-muted:#64748b;display:flex;flex-direction:column;gap:1.5rem;padding-bottom:3rem}.nova-tenancy-hero{align-items:flex-end;background:radial-gradient(circle at 12% 10%,rgba(167,139,250,.48),transparent 34%),radial-gradient(circle at 88% 85%,rgba(56,189,248,.3),transparent 38%),linear-gradient(135deg,#251259,#4c1d95 48%,#172554);border:1px solid hsla(0,0%,100%,.16);border-radius:1.5rem;box-shadow:0 24px 60px rgba(49,46,129,.22);color:#fff;display:flex;gap:2rem;justify-content:space-between;min-height:15rem;overflow:hidden;padding:clamp(1.5rem,4vw,3rem);position:relative}.nova-tenancy-hero:after{background-image:linear-gradient(hsla(0,0%,100%,.04) 1px,transparent 0),linear-gradient(90deg,hsla(0,0%,100%,.04) 1px,transparent 0);background-size:32px 32px;content:"";inset:0;-webkit-mask-image:linear-gradient(180deg,#000,transparent);mask-image:linear-gradient(180deg,#000,transparent);pointer-events:none;position:absolute}.nova-tenancy-hero__glow{background:hsla(0,0%,100%,.09);border-radius:9999px;filter:blur(2px);height:22rem;position:absolute;right:-5rem;top:-8rem;width:22rem}.nova-tenancy-current,.nova-tenancy-hero__content{position:relative;z-index:1}.nova-tenancy-hero__content{max-width:42rem}.nova-tenancy-kicker{color:#c4b5fd;font-size:.72rem;font-weight:800;letter-spacing:.16em;margin:0 0 .65rem;text-transform:uppercase}.nova-tenancy-title{font-size:clamp(2rem,5vw,3.5rem);font-weight:750;letter-spacing:-.045em;line-height:1;margin:0}.nova-tenancy-description{color:rgba(237,233,254,.82);font-size:1rem;line-height:1.7;margin:1rem 0 0;max-width:35rem}.nova-tenancy-current{align-items:center;backdrop-filter:blur(14px);background:hsla(0,0%,100%,.1);border:1px solid hsla(0,0%,100%,.16);border-radius:1rem;display:flex;gap:.8rem;min-width:min(100%,17rem);padding:.8rem}.nova-tenancy-card__logo,.nova-tenancy-current__logo{border-radius:.9rem;display:grid;flex:none;font-weight:800;overflow:hidden;place-items:center}.nova-tenancy-current__logo{background:#fff;color:#4c1d95;height:3rem;width:3rem}.nova-tenancy-card__logo img,.nova-tenancy-current__logo img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.nova-tenancy-current__copy{display:flex;flex:1;flex-direction:column;min-width:0}.nova-tenancy-current__copy span{color:rgba(237,233,254,.7);font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.nova-tenancy-current__copy strong{margin-top:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-pulse{background:#34d399;border:2px solid hsla(0,0%,100%,.8);border-radius:9999px;box-shadow:0 0 0 4px rgba(52,211,153,.2);height:.55rem;width:.55rem}.nova-tenancy-toolbar{align-items:center;display:flex;gap:1rem}.nova-tenancy-search{align-items:center;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.9rem;box-shadow:0 4px 18px rgba(15,23,42,.04);display:flex;flex:1;gap:.75rem;max-width:34rem;min-width:0;padding-inline:1rem;transition:border-color .16s,box-shadow .16s}.nova-tenancy-search:focus-within{border-color:rgba(124,58,237,.55);box-shadow:0 0 0 3px rgba(124,58,237,.12)}.nova-tenancy-search svg{fill:none;stroke:var(--nt-muted);stroke-linecap:round;stroke-width:1.8;width:1.2rem}.nova-tenancy-search input{background:transparent;border:0;color:#0f172a;outline:0;padding:.85rem 0;width:100%}.nova-tenancy-count{background:#ede9fe;border-radius:9999px;color:var(--nt-primary-strong);display:grid;font-size:.78rem;font-weight:800;height:2.5rem;min-width:2.5rem;place-items:center}.nova-tenancy-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr))}.nova-tenancy-card{--tenant-accent:#7c3aed;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:1.25rem;box-shadow:0 10px 32px rgba(15,23,42,.055);display:flex;flex-direction:column;min-height:17rem;overflow:hidden;padding:1.25rem;position:relative;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.nova-tenancy-card:hover{border-color:color-mix(in srgb,var(--tenant-accent) 42%,transparent);box-shadow:0 18px 42px rgba(15,23,42,.1);transform:translateY(-3px)}.nova-tenancy-card--selected{border-color:color-mix(in srgb,var(--tenant-accent) 70%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--tenant-accent) 16%,transparent),0 18px 42px rgba(15,23,42,.09)}.nova-tenancy-card__accent{background:linear-gradient(90deg,var(--tenant-accent),color-mix(in srgb,var(--tenant-accent) 25%,#fff));height:.26rem;inset:0 0 auto;position:absolute}.nova-tenancy-card__header{align-items:flex-start;display:flex;gap:1rem;justify-content:space-between}.nova-tenancy-card__logo{background:color-mix(in srgb,var(--tenant-accent) 11%,#fff);color:var(--tenant-accent);font-size:1.35rem;height:4rem;width:4rem}.nova-tenancy-badge{background:color-mix(in srgb,var(--tenant-accent) 10%,#fff);border-radius:9999px;Line truncated .nova-tenancy-page{--nt-primary:rgba(var(--colors-primary-500,14,165,233),1);--nt-primary-soft:rgba(var(--colors-primary-500,14,165,233),0.12);--nt-primary-strong:rgba(var(--colors-primary-600,2,132,199),1);--nt-surface:rgba(var(--colors-white,255,255,255),1);--nt-border:rgba(var(--colors-gray-200,226,232,240),1);--nt-text:rgba(var(--colors-gray-900,15,23,42),1);--nt-muted:rgba(var(--colors-gray-500,100,116,139),1);--nt-shadow:rgba(var(--colors-gray-900,15,23,42),0.08);display:flex;flex-direction:column;gap:1.5rem;padding-bottom:3rem}.nova-tenancy-hero{align-items:flex-end;background:radial-gradient(circle at 12% 10%,rgba(var(--colors-primary-400,56,189,248),.58),transparent 34%),radial-gradient(circle at 88% 85%,rgba(var(--colors-primary-500,14,165,233),.38),transparent 38%),linear-gradient(135deg,color-mix(in srgb,var(--nt-primary-strong) 68%,#0f172a) 0,var(--nt-primary-strong) 50%,color-mix(in srgb,var(--nt-primary) 48%,#0f172a) 100%);border:1px solid hsla(0,0%,100%,.16);border-radius:1rem;box-shadow:0 24px 60px color-mix(in srgb,var(--nt-primary) 24%,transparent);color:#fff;display:flex;gap:2rem;justify-content:space-between;min-height:15rem;overflow:hidden;padding:clamp(1.5rem,4vw,3rem);position:relative}.nova-tenancy-hero:after{background-image:linear-gradient(hsla(0,0%,100%,.04) 1px,transparent 0),linear-gradient(90deg,hsla(0,0%,100%,.04) 1px,transparent 0);background-size:32px 32px;content:"";inset:0;-webkit-mask-image:linear-gradient(180deg,#000,transparent);mask-image:linear-gradient(180deg,#000,transparent);pointer-events:none;position:absolute}.nova-tenancy-hero__glow{background:hsla(0,0%,100%,.09);border-radius:9999px;filter:blur(2px);height:22rem;position:absolute;right:-5rem;top:-8rem;width:22rem}.nova-tenancy-current,.nova-tenancy-hero__content{position:relative;z-index:1}.nova-tenancy-hero__content{max-width:42rem}.nova-tenancy-kicker{color:color-mix(in srgb,var(--nt-primary) 24%,#fff);font-size:.72rem;font-weight:800;letter-spacing:.16em;margin:0 0 .65rem;text-transform:uppercase}.nova-tenancy-title{font-size:clamp(2rem,5vw,3.5rem);font-weight:750;letter-spacing:-.045em;line-height:1;margin:0}.nova-tenancy-description{color:hsla(0,0%,100%,.82);font-size:1rem;line-height:1.7;margin:1rem 0 0;max-width:35rem}.nova-tenancy-current{align-items:center;backdrop-filter:blur(14px);background:hsla(0,0%,100%,.1);border:1px solid hsla(0,0%,100%,.16);border-radius:.5rem;display:flex;gap:.8rem;min-width:min(100%,17rem);padding:.8rem}.nova-tenancy-card__logo,.nova-tenancy-current__logo{border-radius:.9rem;display:grid;flex:none;font-weight:800;overflow:hidden;place-items:center}.nova-tenancy-current__logo{background:#fff;color:var(--nt-primary-strong);height:3rem;width:3rem}.nova-tenancy-card__logo img,.nova-tenancy-current__logo img{height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.nova-tenancy-current__copy{display:flex;flex:1;flex-direction:column;min-width:0}.nova-tenancy-current__copy span{color:hsla(0,0%,100%,.7);font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.nova-tenancy-current__copy strong{margin-top:.15rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nova-tenancy-pulse{background:rgba(var(--colors-green-400,74,222,128),1);border:2px solid hsla(0,0%,100%,.8);border-radius:9999px;box-shadow:0 0 0 4px rgba(var(--colors-green-400,74,222,128),.2);height:.55rem;width:.55rem}.nova-tenancy-toolbar{align-items:center;display:flex;gap:1rem}.nova-tenancy-search{align-items:center;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex:1;gap:.75rem;max-width:34rem;min-width:0;padding-inline:1rem;transition:border-color .16s,box-shadow .16s}.nova-tenancy-search:focus-within{border-color:rgba(var(--colors-primary-400,56,189,248),.7);box-shadow:0 0 0 3px var(--nt-primary-soft)}.nova-tenancy-search svg{fill:none;stroke:var(--nt-muted);stroke-linecap:round;stroke-width:1.8;width:1.2rem}.nova-tenancy-search input{background:transparent;border:0;color:var(--nt-text);outline:0;padding:.85rem 0;width:100%}.nova-tenancy-count{background:var(--nt-primary-soft);border-radius:9999px;color:var(--nt-primary-strong);display:grid;font-size:.78rem;font-weight:800;height:2.5rem;min-width:2.5rem;place-items:center}.nova-tenancy-grid{display:grid;gap:1rem;grid-template-columns:repeat(auto-fill,minmax(min(100%,16rem),1fr))}.nova-tenancy-card{--tenant-accent:var(--nt-primary);--tenant-accent-contrast:#fff;background:var(--nt-surface);border:1px solid var(--nt-border);border-radius:.5rem;box-shadow:0 1px 3px var(--nt-shadow);display:flex;flex-direction:column;min-height:17rem;overflow:hidden;padding:1.25rem;position:relative;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.nova-tenancy-card:hover{border-color:color-mix(in srgb,var(--tenant-accent) 42%,transparent);box-shadow:0 10px 24px var(--nt-shadow);transform:translateY(-3px)}.nova-tenancy-card--selected{bordeLine truncated
+1 -1
View File
@@ -1,2 +1,2 @@
/*! For license information please see tool.js.LICENSE.txt */ /*! For license information please see tool.js.LICENSE.txt */
(()=>{"use strict";var e,n={733(){const e=Vue;var n=function(e,n){return null!==e&&null!==n&&String(e)===String(n)},t=function(e){return String(e||"T").trim().charAt(0).toLocaleUpperCase()},r=function(e){return{"--tenant-accent":e.accent||"#7c3aed"}};function a(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return o(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function c(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function o(t,r,a,o){var c=r&&r.prototype instanceof u?r:u,s=Object.create(c.prototype);return l(s,"_invoke",function(t,r,a){var o,c,l,u=0,s=a||[],v=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(n,t){return o=n,c=0,l=e,d.n=t,i}};function p(t,r){for(c=t,l=r,n=0;!v&&u&&!a&&n<s.length;n++){var a,o=s[n],p=d.p,f=o[2];t>3?(a=f===r)&&(l=o[(c=o[4])?5:(c=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=t<2&&p<o[1])?(c=0,d.v=r,d.n=o[1]):p<f&&(a=t<3||o[0]>r||r>f)&&(o[4]=t,o[5]=r,d.n=f,c=0))}if(a||t>1)return i;throw v=!0,r}return function(a,s,f){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&p(s,f),c=s,l=f;(n=c<2?e:l)||!v;){o||(c?c<3?(c>1&&(d.n=-1),p(c,l)):d.n=l:d.v=l);try{if(u=2,o){if(c||(a="next"),n=o[a]){if(!(n=n.call(o,l)))throw TypeError("iterator result is not an object");if(!n.done)return n;l=n.value,c<2&&(c=0)}else 1===c&&(n=o.return)&&n.call(o),c<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),c=1);o=e}else if((n=(v=d.n<0)?l:t.call(r,d))!==i)break}catch(n){o=e,c=1,l=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),s}var i={};function u(){}function s(){}function v(){}n=Object.getPrototypeOf;var d=[][r]?n(n([][r]())):(l(n={},r,function(){return this}),n),p=v.prototype=u.prototype=Object.create(d);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,l(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return s.prototype=v,l(p,"constructor",v),l(v,"constructor",s),s.displayName="GeneratorFunction",l(v,a,"GeneratorFunction"),l(p),l(p,a,"Generator"),l(p,r,function(){return this}),l(p,"toString",function(){return"[object Generator]"}),(c=function(){return{w:o,m:f}})()}function l(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}l=function(e,n,t,r){function o(n,t){l(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},l(e,n,t,r)}function i(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}function u(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){i(o,r,a,c,l,"next",e)}function l(e){i(o,r,a,c,l,"throw",e)}c(void 0)})}}var s={class:"nova-tenancy-page"},v={class:"nova-tenancy-hero"},d={class:"nova-tenancy-hero__content"},p={class:"nova-tenancy-kicker"},f={class:"nova-tenancy-title"},y={class:"nova-tenancy-description"},m={key:0,class:"nova-tenancy-current"},g={class:"nova-tenancy-current__logo"},k=["src"],h={key:1},b={class:"nova-tenancy-current__copy"},E=["aria-label"],N={class:"nova-tenancy-search"},B={class:"nova-tenancy-sr-only"},V=["placeholder"],_={key:0,class:"nova-tenancy-count"},S={key:0,class:"nova-tenancy-grid","aria-busy":"true"},w={key:1,class:"nova-tenancy-state",role:"alert"},P={key:2,class:"nova-tenancy-state"},O={key:3,class:"nova-tenancy-grid"},T=["aria-current"],D={class:"nova-tenancy-card__header"},j={class:"nova-tenancy-card__logo"},C=["src","onError"],x={key:1},M={key:0,class:"nova-tenancy-badge"},G=["title"],U={class:"nova-tenancy-card__body"},A={key:0},F={key:1,class:"nova-tenancy-card__key"},L=["disabled","aria-busy","onClick"],q={key:0,class:"nova-tenancy-spinner","aria-hidden":"true"},I={key:1,viewBox:"0 0 20 20","aria-hidden":"true"},$={key:4,class:"nova-tenancy-pagination","aria-label":"Pagination"},z=["disabled"],K=["disabled"];const H={__name:"NovaTenancy",setup:function(o){var l,i,H,R=Nova.config("novaTenancy")||{},W=R.copy||{},Z=(0,e.ref)([]),J=(0,e.ref)(null!==(l=null===(i=R.current)||void 0===i?void 0:i.key)&&void 0!==l?l:null),Q=(0,e.ref)(""),X=(0,e.ref)(!0),Y=(0,e.ref)(!1),ee=(0,e.ref)(null),ne=(0,e.reactive)(new Set),te=(0,e.reactive)({currentPage:1,lastPage:1,perPage:Number(R.perPage||12),total:0}),re=0,ae=(0,e.computed)(function(){var e,t;return Z.value.find(function(e){return ie(e)})||(n(null!==(e=Line truncated (()=>{"use strict";var e,n={733(){const e=Vue;var n=function(e,n){return null!==e&&null!==n&&String(e)===String(n)},t=function(e){return String(e||"T").trim().charAt(0).toLocaleUpperCase()},r=function(e){if(!/^#[0-9a-f]{6}$/i.test(e||""))return"#ffffff";var n=e.slice(1).match(/.{2}/g).map(function(e){return Number.parseInt(e,16)/255}).map(function(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}),t=.2126*n[0]+.7152*n[1]+.0722*n[2];return(t+.05)/.068>1.05/(t+.05)?"#0f172a":"#ffffff"},a=function(e){return e.accent?{"--tenant-accent":e.accent,"--tenant-accent-contrast":r(e.accent)}:{}};function o(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(e){if("string"==typeof e)return c(e,n);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,n):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=Array(n);t<n;t++)r[t]=e[t];return r}function l(){var e,n,t="function"==typeof Symbol?Symbol:{},r=t.iterator||"@@iterator",a=t.toStringTag||"@@toStringTag";function o(t,r,a,o){var l=r&&r.prototype instanceof u?r:u,s=Object.create(l.prototype);return i(s,"_invoke",function(t,r,a){var o,l,i,u=0,s=a||[],v=!1,d={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(n,t){return o=n,l=0,i=e,d.n=t,c}};function f(t,r){for(l=t,i=r,n=0;!v&&u&&!a&&n<s.length;n++){var a,o=s[n],f=d.p,p=o[2];t>3?(a=p===r)&&(i=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=f&&((a=t<2&&f<o[1])?(l=0,d.v=r,d.n=o[1]):f<p&&(a=t<3||o[0]>r||r>p)&&(o[4]=t,o[5]=r,d.n=p,l=0))}if(a||t>1)return c;throw v=!0,r}return function(a,s,p){if(u>1)throw TypeError("Generator is already running");for(v&&1===s&&f(s,p),l=s,i=p;(n=l<2?e:i)||!v;){o||(l?l<3?(l>1&&(d.n=-1),f(l,i)):d.n=i:d.v=i);try{if(u=2,o){if(l||(a="next"),n=o[a]){if(!(n=n.call(o,i)))throw TypeError("iterator result is not an object");if(!n.done)return n;i=n.value,l<2&&(l=0)}else 1===l&&(n=o.return)&&n.call(o),l<2&&(i=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((n=(v=d.n<0)?i:t.call(r,d))!==c)break}catch(n){o=e,l=1,i=n}finally{u=1}}return{value:n,done:v}}}(t,a,o),!0),s}var c={};function u(){}function s(){}function v(){}n=Object.getPrototypeOf;var d=[][r]?n(n([][r]())):(i(n={},r,function(){return this}),n),f=v.prototype=u.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=v,i(f,"constructor",v),i(v,"constructor",s),s.displayName="GeneratorFunction",i(v,a,"GeneratorFunction"),i(f),i(f,a,"Generator"),i(f,r,function(){return this}),i(f,"toString",function(){return"[object Generator]"}),(l=function(){return{w:o,m:p}})()}function i(e,n,t,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}i=function(e,n,t,r){function o(n,t){i(e,n,function(e){return this._invoke(n,t,e)})}n?a?a(e,n,{value:t,enumerable:!r,configurable:!r,writable:!r}):e[n]=t:(o("next",0),o("throw",1),o("return",2))},i(e,n,t,r)}function u(e,n,t,r,a,o,c){try{var l=e[o](c),i=l.value}catch(e){return void t(e)}l.done?n(i):Promise.resolve(i).then(r,a)}function s(e){return function(){var n=this,t=arguments;return new Promise(function(r,a){var o=e.apply(n,t);function c(e){u(o,r,a,c,l,"next",e)}function l(e){u(o,r,a,c,l,"throw",e)}c(void 0)})}}var v={class:"nova-tenancy-page"},d={class:"nova-tenancy-hero"},f={class:"nova-tenancy-hero__content"},p={class:"nova-tenancy-kicker"},y={class:"nova-tenancy-title"},m={class:"nova-tenancy-description"},g={key:0,class:"nova-tenancy-current"},k={class:"nova-tenancy-current__logo"},h=["src"],b={key:1},E={class:"nova-tenancy-current__copy"},N=["aria-label"],B={class:"nova-tenancy-search"},V={class:"nova-tenancy-sr-only"},_=["placeholder"],S={key:0,class:"nova-tenancy-count"},w={key:0,class:"nova-tenancy-grid","aria-busy":"true"},P={key:1,class:"nova-tenancy-state",role:"alert"},O={key:2,class:"nova-tenancy-state"},T={key:3,class:"nova-tenancy-grid"},D=["aria-current"],j={class:"nova-tenancy-card__header"},C={class:"nova-tenancy-card__logo"},x=["src","onError"],M={key:1},G={key:0,class:"nova-tenancy-badge"},U=["title"],A={class:"nova-tenancy-card__body"},F={key:0},L={key:1,class:"nova-tenancy-card__key"},I=["disabled","aria-busy","onClick"],$={key:0,class:"nova-tenancy-spinner","aria-hidden":"true"},q={key:1,viewBox:"0 0 20 20","aria-hidden":"true"},z={key:4,class:"nova-tenancy-pagination","aria-label":"Pagination"},K=["disabled"],H=["disabled"];const R={__name:"NovaTenancy",setup:function(r){var c,i,u,R=Nova.config("novaTenancy")||{},W=R.copy||{},Z=(0,e.ref)([]),J=(0,e.ref)(null!==(c=Line truncated
+2 -2
View File
@@ -1,4 +1,4 @@
{ {
"/js/tool.js": "/js/tool.js?id=c0dece73f13546b93269b715fbe0c31e", "/js/tool.js": "/js/tool.js?id=288485568c9de20942b23e046929bbc5",
"/css/tool.css": "/css/tool.css?id=52168e338d44c342bde21e45f3b08f9e" "/css/tool.css": "/css/tool.css?id=5cf63c35ace8a0beb48a7c1b2782b62e"
} }
+82 -59
View File
@@ -1,9 +1,12 @@
.nova-tenancy-page { .nova-tenancy-page {
--nt-primary: #7c3aed; --nt-primary: rgba(var(--colors-primary-500, 14, 165, 233), 1);
--nt-primary-strong: #5b21b6; --nt-primary-soft: rgba(var(--colors-primary-500, 14, 165, 233), 0.12);
--nt-surface: rgb(255 255 255 / 0.88); --nt-primary-strong: rgba(var(--colors-primary-600, 2, 132, 199), 1);
--nt-border: rgb(226 232 240 / 0.9); --nt-surface: rgba(var(--colors-white, 255, 255, 255), 1);
--nt-muted: #64748b; --nt-border: rgba(var(--colors-gray-200, 226, 232, 240), 1);
--nt-text: rgba(var(--colors-gray-900, 15, 23, 42), 1);
--nt-muted: rgba(var(--colors-gray-500, 100, 116, 139), 1);
--nt-shadow: rgba(var(--colors-gray-900, 15, 23, 42), 0.08);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1.5rem; gap: 1.5rem;
@@ -19,14 +22,19 @@
gap: 2rem; gap: 2rem;
overflow: hidden; overflow: hidden;
border: 1px solid rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.16);
border-radius: 1.5rem; border-radius: 1rem;
padding: clamp(1.5rem, 4vw, 3rem); padding: clamp(1.5rem, 4vw, 3rem);
color: white; color: white;
background: background:
radial-gradient(circle at 12% 10%, rgb(167 139 250 / 0.48), transparent 34%), radial-gradient(circle at 12% 10%, rgba(var(--colors-primary-400, 56, 189, 248), 0.58), transparent 34%),
radial-gradient(circle at 88% 85%, rgb(56 189 248 / 0.3), transparent 38%), radial-gradient(circle at 88% 85%, rgba(var(--colors-primary-500, 14, 165, 233), 0.38), transparent 38%),
linear-gradient(135deg, #251259 0%, #4c1d95 48%, #172554 100%); linear-gradient(
box-shadow: 0 24px 60px rgb(49 46 129 / 0.22); 135deg,
color-mix(in srgb, var(--nt-primary-strong) 68%, #0f172a) 0%,
var(--nt-primary-strong) 50%,
color-mix(in srgb, var(--nt-primary) 48%, #0f172a) 100%
);
box-shadow: 0 24px 60px color-mix(in srgb, var(--nt-primary) 24%, transparent);
} }
.nova-tenancy-hero::after { .nova-tenancy-hero::after {
@@ -63,7 +71,7 @@
.nova-tenancy-kicker { .nova-tenancy-kicker {
margin: 0 0 0.65rem; margin: 0 0 0.65rem;
color: #c4b5fd; color: color-mix(in srgb, var(--nt-primary) 24%, white);
font-size: 0.72rem; font-size: 0.72rem;
font-weight: 800; font-weight: 800;
letter-spacing: 0.16em; letter-spacing: 0.16em;
@@ -81,7 +89,7 @@
.nova-tenancy-description { .nova-tenancy-description {
max-width: 35rem; max-width: 35rem;
margin: 1rem 0 0; margin: 1rem 0 0;
color: rgb(237 233 254 / 0.82); color: rgb(255 255 255 / 0.82);
font-size: 1rem; font-size: 1rem;
line-height: 1.7; line-height: 1.7;
} }
@@ -92,7 +100,7 @@
align-items: center; align-items: center;
gap: 0.8rem; gap: 0.8rem;
border: 1px solid rgb(255 255 255 / 0.16); border: 1px solid rgb(255 255 255 / 0.16);
border-radius: 1rem; border-radius: 0.5rem;
padding: 0.8rem; padding: 0.8rem;
background: rgb(255 255 255 / 0.1); background: rgb(255 255 255 / 0.1);
backdrop-filter: blur(14px); backdrop-filter: blur(14px);
@@ -111,7 +119,7 @@
.nova-tenancy-current__logo { .nova-tenancy-current__logo {
width: 3rem; width: 3rem;
height: 3rem; height: 3rem;
color: #4c1d95; color: var(--nt-primary-strong);
background: white; background: white;
} }
@@ -130,7 +138,7 @@
} }
.nova-tenancy-current__copy span { .nova-tenancy-current__copy span {
color: rgb(237 233 254 / 0.7); color: rgb(255 255 255 / 0.7);
font-size: 0.68rem; font-size: 0.68rem;
font-weight: 700; font-weight: 700;
letter-spacing: 0.08em; letter-spacing: 0.08em;
@@ -149,8 +157,8 @@
height: 0.55rem; height: 0.55rem;
border: 2px solid rgb(255 255 255 / 0.8); border: 2px solid rgb(255 255 255 / 0.8);
border-radius: 9999px; border-radius: 9999px;
background: #34d399; background: rgba(var(--colors-green-400, 74, 222, 128), 1);
box-shadow: 0 0 0 4px rgb(52 211 153 / 0.2); box-shadow: 0 0 0 4px rgba(var(--colors-green-400, 74, 222, 128), 0.2);
} }
.nova-tenancy-toolbar { .nova-tenancy-toolbar {
@@ -167,16 +175,16 @@
align-items: center; align-items: center;
gap: 0.75rem; gap: 0.75rem;
border: 1px solid var(--nt-border); border: 1px solid var(--nt-border);
border-radius: 0.9rem; border-radius: 0.5rem;
padding-inline: 1rem; padding-inline: 1rem;
background: var(--nt-surface); background: var(--nt-surface);
box-shadow: 0 4px 18px rgb(15 23 42 / 0.04); box-shadow: 0 1px 3px var(--nt-shadow);
transition: border-color 160ms, box-shadow 160ms; transition: border-color 160ms, box-shadow 160ms;
} }
.nova-tenancy-search:focus-within { .nova-tenancy-search:focus-within {
border-color: rgb(124 58 237 / 0.55); border-color: rgba(var(--colors-primary-400, 56, 189, 248), 0.7);
box-shadow: 0 0 0 3px rgb(124 58 237 / 0.12); box-shadow: 0 0 0 3px var(--nt-primary-soft);
} }
.nova-tenancy-search svg { .nova-tenancy-search svg {
@@ -192,7 +200,7 @@
border: 0; border: 0;
outline: 0; outline: 0;
padding: 0.85rem 0; padding: 0.85rem 0;
color: #0f172a; color: var(--nt-text);
background: transparent; background: transparent;
} }
@@ -205,7 +213,7 @@
color: var(--nt-primary-strong); color: var(--nt-primary-strong);
font-size: 0.78rem; font-size: 0.78rem;
font-weight: 800; font-weight: 800;
background: #ede9fe; background: var(--nt-primary-soft);
} }
.nova-tenancy-grid { .nova-tenancy-grid {
@@ -215,30 +223,31 @@
} }
.nova-tenancy-card { .nova-tenancy-card {
--tenant-accent: #7c3aed; --tenant-accent: var(--nt-primary);
--tenant-accent-contrast: white;
position: relative; position: relative;
display: flex; display: flex;
min-height: 17rem; min-height: 17rem;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
border: 1px solid var(--nt-border); border: 1px solid var(--nt-border);
border-radius: 1.25rem; border-radius: 0.5rem;
padding: 1.25rem; padding: 1.25rem;
background: var(--nt-surface); background: var(--nt-surface);
box-shadow: 0 10px 32px rgb(15 23 42 / 0.055); box-shadow: 0 1px 3px var(--nt-shadow);
transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
} }
.nova-tenancy-card:hover { .nova-tenancy-card:hover {
transform: translateY(-3px); transform: translateY(-3px);
border-color: color-mix(in srgb, var(--tenant-accent) 42%, transparent); border-color: color-mix(in srgb, var(--tenant-accent) 42%, transparent);
box-shadow: 0 18px 42px rgb(15 23 42 / 0.1); box-shadow: 0 10px 24px var(--nt-shadow);
} }
.nova-tenancy-card--selected { .nova-tenancy-card--selected {
border-color: color-mix(in srgb, var(--tenant-accent) 70%, transparent); border-color: color-mix(in srgb, var(--tenant-accent) 70%, transparent);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--tenant-accent) 16%, transparent), box-shadow: 0 0 0 2px color-mix(in srgb, var(--tenant-accent) 16%, transparent),
0 18px 42px rgb(15 23 42 / 0.09); 0 10px 24px var(--nt-shadow);
} }
.nova-tenancy-card__accent { .nova-tenancy-card__accent {
@@ -258,15 +267,16 @@
.nova-tenancy-card__logo { .nova-tenancy-card__logo {
width: 4rem; width: 4rem;
height: 4rem; height: 4rem;
color: var(--tenant-accent); color: color-mix(in srgb, var(--tenant-accent) 72%, var(--nt-text));
font-size: 1.35rem; font-size: 1.35rem;
border-radius: 0.5rem;
background: color-mix(in srgb, var(--tenant-accent) 11%, white); background: color-mix(in srgb, var(--tenant-accent) 11%, white);
} }
.nova-tenancy-badge { .nova-tenancy-badge {
border-radius: 9999px; border-radius: 9999px;
padding: 0.35rem 0.65rem; padding: 0.35rem 0.65rem;
color: var(--tenant-accent); color: color-mix(in srgb, var(--tenant-accent) 72%, var(--nt-text));
font-size: 0.68rem; font-size: 0.68rem;
font-weight: 800; font-weight: 800;
background: color-mix(in srgb, var(--tenant-accent) 10%, white); background: color-mix(in srgb, var(--tenant-accent) 10%, white);
@@ -278,7 +288,7 @@
height: 1.8rem; height: 1.8rem;
place-items: center; place-items: center;
border-radius: 9999px; border-radius: 9999px;
color: white; color: var(--tenant-accent-contrast);
background: var(--tenant-accent); background: var(--tenant-accent);
} }
@@ -298,9 +308,9 @@
.nova-tenancy-card__body h2 { .nova-tenancy-card__body h2 {
margin: 0; margin: 0;
color: #0f172a; color: var(--nt-text);
font-size: 1.05rem; font-size: 1rem;
font-weight: 750; font-weight: 700;
line-height: 1.4; line-height: 1.4;
} }
@@ -316,7 +326,7 @@
} }
.nova-tenancy-card__body .nova-tenancy-card__key { .nova-tenancy-card__body .nova-tenancy-card__key {
color: color-mix(in srgb, var(--tenant-accent) 68%, #64748b); color: color-mix(in srgb, var(--tenant-accent) 68%, var(--nt-muted));
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
} }
@@ -328,8 +338,8 @@
justify-content: center; justify-content: center;
gap: 0.55rem; gap: 0.55rem;
border: 0; border: 0;
border-radius: 0.75rem; border-radius: 0.5rem;
font-weight: 750; font-weight: 700;
cursor: pointer; cursor: pointer;
transition: transform 150ms, background-color 150ms, opacity 150ms; transition: transform 150ms, background-color 150ms, opacity 150ms;
} }
@@ -337,7 +347,7 @@
.nova-tenancy-select { .nova-tenancy-select {
width: 100%; width: 100%;
min-height: 2.7rem; min-height: 2.7rem;
color: white; color: var(--tenant-accent-contrast);
background: var(--tenant-accent); background: var(--tenant-accent);
} }
@@ -348,7 +358,7 @@
} }
.nova-tenancy-select--selected { .nova-tenancy-select--selected {
color: var(--tenant-accent); color: color-mix(in srgb, var(--tenant-accent) 72%, var(--nt-text));
background: color-mix(in srgb, var(--tenant-accent) 10%, white); background: color-mix(in srgb, var(--tenant-accent) 10%, white);
} }
@@ -370,8 +380,8 @@
.nova-tenancy-spinner { .nova-tenancy-spinner {
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
border: 2px solid rgb(255 255 255 / 0.4); border: 2px solid color-mix(in srgb, currentColor 40%, transparent);
border-top-color: white; border-top-color: currentColor;
border-radius: 9999px; border-radius: 9999px;
animation: nova-tenancy-spin 650ms linear infinite; animation: nova-tenancy-spin 650ms linear infinite;
} }
@@ -385,7 +395,12 @@
display: block; display: block;
height: 1rem; height: 1rem;
border-radius: 9999px; border-radius: 9999px;
background: linear-gradient(90deg, #f1f5f9, #e2e8f0, #f1f5f9); background: linear-gradient(
90deg,
rgba(var(--colors-gray-100, 241, 245, 249), 1),
rgba(var(--colors-gray-200, 226, 232, 240), 1),
rgba(var(--colors-gray-100, 241, 245, 249), 1)
);
background-size: 220% 100%; background-size: 220% 100%;
animation: nova-tenancy-shimmer 1.4s ease infinite; animation: nova-tenancy-shimmer 1.4s ease infinite;
} }
@@ -406,7 +421,7 @@
justify-content: center; justify-content: center;
flex-direction: column; flex-direction: column;
border: 1px dashed var(--nt-border); border: 1px dashed var(--nt-border);
border-radius: 1.25rem; border-radius: 0.5rem;
padding: 2rem; padding: 2rem;
text-align: center; text-align: center;
background: var(--nt-surface); background: var(--nt-surface);
@@ -418,15 +433,15 @@
height: 3.5rem; height: 3.5rem;
place-items: center; place-items: center;
border-radius: 1rem; border-radius: 1rem;
color: #be123c; color: rgba(var(--colors-red-700, 185, 28, 28), 1);
font-size: 1.5rem; font-size: 1.5rem;
font-weight: 800; font-weight: 800;
background: #ffe4e6; background: rgba(var(--colors-red-100, 254, 226, 226), 1);
} }
.nova-tenancy-state__icon--empty { .nova-tenancy-state__icon--empty {
color: var(--nt-primary); color: var(--nt-primary);
background: #ede9fe; background: var(--nt-primary-soft);
} }
.nova-tenancy-state__icon svg { .nova-tenancy-state__icon svg {
@@ -440,7 +455,7 @@
.nova-tenancy-state h2 { .nova-tenancy-state h2 {
margin: 1rem 0 0; margin: 1rem 0 0;
color: #0f172a; color: var(--nt-text);
font-size: 1.1rem; font-size: 1.1rem;
} }
@@ -467,7 +482,7 @@
.nova-tenancy-pagination button { .nova-tenancy-pagination button {
border: 1px solid var(--nt-border); border: 1px solid var(--nt-border);
padding: 0.55rem 0.9rem; padding: 0.55rem 0.9rem;
color: #334155; color: var(--nt-text);
background: var(--nt-surface); background: var(--nt-surface);
} }
@@ -485,7 +500,7 @@
gap: 0.65rem; gap: 0.65rem;
border: 0; border: 0;
padding: 0; padding: 0;
color: #334155; color: var(--nt-text);
background: transparent; background: transparent;
cursor: pointer; cursor: pointer;
} }
@@ -494,9 +509,9 @@
width: 2.5rem; width: 2.5rem;
height: 2.5rem; height: 2.5rem;
flex: none; flex: none;
border-radius: 0.7rem; border-radius: 0.5rem;
object-fit: cover; object-fit: cover;
box-shadow: 0 3px 12px rgb(15 23 42 / 0.12); box-shadow: 0 3px 12px rgba(var(--colors-gray-900, 15, 23, 42), 0.12);
} }
.nova-tenancy-brand__title { .nova-tenancy-brand__title {
@@ -525,9 +540,12 @@
} }
.dark .nova-tenancy-page { .dark .nova-tenancy-page {
--nt-surface: rgb(30 41 59 / 0.84); --nt-primary-soft: rgba(var(--colors-primary-500, 14, 165, 233), 0.2);
--nt-border: rgb(71 85 105 / 0.72); --nt-surface: rgba(var(--colors-gray-800, 30, 41, 59), 1);
--nt-muted: #94a3b8; --nt-border: rgba(var(--colors-gray-700, 51, 65, 85), 1);
--nt-text: rgba(var(--colors-gray-100, 241, 245, 249), 1);
--nt-muted: rgba(var(--colors-gray-400, 148, 163, 184), 1);
--nt-shadow: rgb(0 0 0 / 0.22);
} }
.dark .nova-tenancy-search input, .dark .nova-tenancy-search input,
@@ -535,23 +553,28 @@
.dark .nova-tenancy-state h2, .dark .nova-tenancy-state h2,
.dark .nova-tenancy-brand, .dark .nova-tenancy-brand,
.dark .nova-tenancy-pagination button { .dark .nova-tenancy-pagination button {
color: #f8fafc; color: var(--nt-text);
} }
.dark .nova-tenancy-count, .dark .nova-tenancy-count,
.dark .nova-tenancy-state__icon--empty { .dark .nova-tenancy-state__icon--empty {
color: #c4b5fd; color: rgba(var(--colors-primary-400, 56, 189, 248), 1);
background: rgb(91 33 182 / 0.3); background: var(--nt-primary-soft);
} }
.dark .nova-tenancy-card__logo, .dark .nova-tenancy-card__logo,
.dark .nova-tenancy-badge, .dark .nova-tenancy-badge,
.dark .nova-tenancy-select--selected { .dark .nova-tenancy-select--selected {
background: color-mix(in srgb, var(--tenant-accent) 22%, #0f172a); background: color-mix(in srgb, var(--tenant-accent) 22%, var(--nt-surface));
} }
.dark .nova-tenancy-card--skeleton span { .dark .nova-tenancy-card--skeleton span {
background: linear-gradient(90deg, #1e293b, #334155, #1e293b); background: linear-gradient(
90deg,
rgba(var(--colors-gray-800, 30, 41, 59), 1),
rgba(var(--colors-gray-700, 51, 65, 85), 1),
rgba(var(--colors-gray-800, 30, 41, 59), 1)
);
background-size: 220% 100%; background-size: 220% 100%;
} }
+26 -3
View File
@@ -4,9 +4,32 @@ export const sameTenant = (left, right) =>
export const tenantInitial = title => export const tenantInitial = title =>
String(title || 'T').trim().charAt(0).toLocaleUpperCase() String(title || 'T').trim().charAt(0).toLocaleUpperCase()
export const tenantStyle = tenant => ({ export const accentContrast = accent => {
'--tenant-accent': tenant.accent || '#7c3aed', if (!/^#[0-9a-f]{6}$/i.test(accent || '')) return '#ffffff'
})
const channels = accent
.slice(1)
.match(/.{2}/g)
.map(channel => Number.parseInt(channel, 16) / 255)
.map(channel =>
channel <= 0.04045
? channel / 12.92
: ((channel + 0.055) / 1.055) ** 2.4
)
const luminance = channels[0] * 0.2126 + channels[1] * 0.7152 + channels[2] * 0.0722
const lightContrast = 1.05 / (luminance + 0.05)
const darkContrast = (luminance + 0.05) / 0.068
return darkContrast > lightContrast ? '#0f172a' : '#ffffff'
}
export const tenantStyle = tenant =>
tenant.accent
? {
'--tenant-accent': tenant.accent,
'--tenant-accent-contrast': accentContrast(tenant.accent),
}
: {}
export const currentLogoUrl = (apiBase, tenantKey, revision) => export const currentLogoUrl = (apiBase, tenantKey, revision) =>
`${apiBase}/current/logo?tenant=${encodeURIComponent(tenantKey ?? 'none')}&v=${revision}` `${apiBase}/current/logo?tenant=${encodeURIComponent(tenantKey ?? 'none')}&v=${revision}`
+7 -1
View File
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest' import { describe, expect, it } from 'vitest'
import { import {
accentContrast,
currentLogoUrl, currentLogoUrl,
sameTenant, sameTenant,
tenantInitial, tenantInitial,
@@ -14,7 +15,12 @@ describe('tenant state helpers', () => {
it('builds safe presentation fallbacks', () => { it('builds safe presentation fallbacks', () => {
expect(tenantInitial(' alpha')).toBe('A') expect(tenantInitial(' alpha')).toBe('A')
expect(tenantStyle({ accent: null })).toEqual({ '--tenant-accent': '#7c3aed' }) expect(tenantStyle({ accent: null })).toEqual({})
expect(tenantStyle({ accent: '#ffffff' })).toEqual({
'--tenant-accent': '#ffffff',
'--tenant-accent-contrast': '#0f172a',
})
expect(accentContrast('#2563eb')).toBe('#ffffff')
}) })
it('creates a cache-busted fixed logo endpoint', () => { it('creates a cache-busted fixed logo endpoint', () => {