@webority/tokens 0.161.0 → 0.164.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.161.0",
5
+ "version": "0.164.0",
6
6
  "brand": null,
7
7
  "platform": "phone",
8
8
  "width": null
@@ -2,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.161.0",
5
+ "version": "0.164.0",
6
6
  "brand": null,
7
7
  "platform": "web",
8
8
  "width": 390
@@ -2,7 +2,7 @@
2
2
  "format": "webority-theme-tokens/2",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.161.0",
5
+ "version": "0.164.0",
6
6
  "brand": null,
7
7
  "platform": "web",
8
8
  "width": 1440
package/dist/emit/web.js CHANGED
@@ -7,18 +7,24 @@ import{isObjectLike as e}from"../guards.js";import{BREAKPOINT_PX as t,TOUCH_MEDI
7
7
  :root[data-theme="auto"] [data-bs-theme="light"]`,x=`[data-theme="dark"]:not(:root) [data-theme="light"],
8
8
  [data-theme="dark"]:not(:root) [data-bs-theme="light"],
9
9
  [data-bs-theme="dark"]:not(:root) [data-theme="light"],
10
- [data-bs-theme="dark"]:not(:root) [data-bs-theme="light"]`,S=`// var() resolves where a name is declared, so the html copies keep the light values for a light box.`,C=`/* var() resolves where a name is declared, so the html copies keep the light values for a light box. */`,w=`// Zero specificity, so a component's own class on a themed section or inside it keeps its colour.`,T=`/* Zero specificity, so a component's own class on a themed section or inside it keeps its colour. */`,E=`// A light box under a dark page root takes literal light values: var() would resolve against the dark root.`,D=`/* A light box under a dark page root takes literal light values: var() would resolve against the dark root. */`;function O(e){return String(Number(e.toFixed(4)))}function k(e,t){return s(e.tokens.get(t),`token ${t}`)}function ae(e){if(e==null)return 1440;if(typeof e==`number`)return e;throw Error(`emitWeb: fluidUntil must be a number`)}function A(t,n){if(typeof n==`string`)return n.replace(d,(e,t)=>`var(${o(t)})`);if(typeof n==`number`)return O(n);if(Array.isArray(n)){if(t.type===`cubicBezier`&&n.length===4&&n.every(e=>typeof e==`number`))return`cubic-bezier(${n.map(e=>O(e)).join(`, `)})`;if(t.type===`fontFamily`&&n.every(e=>typeof e==`string`))return n.map(e=>/\s/.test(e)?`"${e}"`:e).join(`, `)}else if(e(n)){if(`unit`in n&&typeof n.value==`number`)return`${O(n.value)}${String(n.unit)}`;if(`color`in n)return[n.offsetX,n.offsetY,n.blur,n.spread,n.color].map(e=>A(t,e)).join(` `)}throw Error(`emitWeb: ${t.path}: cannot write a ${t.type} value as CSS.`)}function j(e,t,n){return A(k(e,t),e.valueIn(t,n))}function M(t,n){if(e(n)&&n.unit===`px`&&typeof n.value==`number`)return n.value;throw Error(`emitWeb: ${t}: a text size must be a px dimension.`)}function N(e,t){let n=k(e,t),a=o(t);if(n.group===`text`){if(r(n).length>0)throw Error(`emitWeb: ${t}: a text size cannot carry breakpoints.`);let o=M(t,e.valueIn(t,u)),s=M(t,e.valueIn(t,c)),l=n.extensions?.fluidUntil;if(o!==s&&l===void 0)throw Error(`emitWeb: ${t}: the 390 and 1440 sizes differ but no fluidUntil is recorded.`);return{path:t,name:a,root:i(o,s,ae(l)),tiers:[]}}let s=r(n);return s.length>0?{path:t,name:a,root:j(e,t,u),tiers:s.map(e=>({tier:e.tier,text:A(n,e.value)}))}:{path:t,name:a,root:j(e,t,c),tiers:[]}}function P(e){let t=[];for(let n of e.tokens.keys())e.existsIn(n,c)&&t.push(N(e,n));return t}function F(e,t){let n=[];for(let[i,a]of e.tokens){if(!e.existsIn(i,l)||!e.existsIn(i,c)||r(a).length>0)continue;let s=j(e,i,l);if(a.group===`text`){if(s!==j(e,i,c))throw Error(`emitWeb: ${i}: a text size cannot change with the mode.`)}else t(i,s)&&n.push({path:i,name:o(i),text:s,light:j(e,i,c)})}return n}function I(e){let t=Number.parseInt(e.slice(1),16);return`${t>>16&255}, ${t>>8&255}, ${t&255}`}function L(e,t){let n=[],r=(r,i)=>{for(let[a,o]of r){let r=`color.${o}`,s=U(e,r,l);if(t(r,s)){let t=i?I(U(e,r,c)):null;n.push({name:a,text:I(s),light:t})}}};return r(p,!0),r(ne,!1),n}function R(e,t,n){return!e.tokens.has(`color.primary`)||!t.tokens.has(`color.primary`)||e.resolvedIn(`color.primary`,n)===t.resolvedIn(`color.primary`,n)?[]:z(e,n)}function z(e,t){let n=U(e,`color.primary`,t);return[{name:`--bs-primary`,text:n},{name:`--bs-primary-rgb`,text:I(n)}]}function B(e,t,n){return!_.every(n=>e.tokens.has(n)&&t.tokens.has(n))||_.every(r=>e.resolvedIn(r,n)===t.resolvedIn(r,n))?[]:V(e,n)}function V(e,t){let n=U(e,`color.link`,t),r=U(e,`color.link-hover`,t);return[{name:`--bs-link-color`,text:n},{name:`--bs-link-color-rgb`,text:I(n)},{name:`--bs-link-hover-color`,text:r},{name:`--bs-link-hover-color-rgb`,text:I(r)}]}function H(e){return _.every(t=>e.tokens.has(t))?[{name:`--bs-link-color`,text:`var(--color-link)`,light:`var(--color-link)`},{name:`--bs-link-color-rgb`,text:I(U(e,`color.link`,l)),light:I(U(e,`color.link`,c))},{name:`--bs-link-hover-color`,text:`var(--color-link-hover)`,light:`var(--color-link-hover)`},{name:`--bs-link-hover-color-rgb`,text:I(U(e,`color.link-hover`,l)),light:I(U(e,`color.link-hover`,c))}]:[]}function U(e,t,n){let r=e.resolvedIn(t,n);if(typeof r!=`string`||!te.test(r))throw Error(`emitWeb: ${t}: a Bootstrap rgb triplet needs an opaque colour.`);return r}function W(e,t){let n=F(e,t?(e,n)=>!t.tokens.has(e)||!t.existsIn(e,l)||n!==j(t,e,l):(t,n)=>n!==j(e,t,c)),r=L(e,t?(e,n)=>n!==t.resolvedIn(e,l):()=>!0);if(t){let i=B(e,t,c).length>0?V(e,l):B(e,t,l);return[...n,...r,...i]}let i=f.map(([e,t])=>{let n=`var(${o(`color.${t}`)})`;return{name:e,text:n,light:n}});return[...n,...i,...r,...H(e)]}function G(e,t,n){return e.tokens.has(n)&&t.tokens.has(n)&&e.resolvedIn(n,c)!==t.resolvedIn(n,c)}function K(e,t){let n=f.filter(([n,r])=>n!==`--bs-primary`&&G(e,t,`color.${r}`)).map(([e,t])=>({name:e,text:`var(${o(`color.${t}`)})`})),r=p.filter(([n,r])=>n!==`--bs-primary-rgb`&&G(e,t,`color.${r}`)).map(([t,n])=>({name:t,text:I(U(e,`color.${n}`,c))}));return[...n,...r]}function q(e,t){return`${e} {\n${t.join(`
10
+ [data-bs-theme="dark"]:not(:root) [data-bs-theme="light"]`,S=`// var() resolves where a name is declared, so the html copies keep the light values for a light box.`,C=`/* var() resolves where a name is declared, so the html copies keep the light values for a light box. */`,w=`// Zero specificity, so a component's own class on a themed section or inside it keeps its colour.`,T=`/* Zero specificity, so a component's own class on a themed section or inside it keeps its colour. */`,E=`// A light box under a dark page root takes literal light values: var() would resolve against the dark root.`,ae=`/* A light box under a dark page root takes literal light values: var() would resolve against the dark root. */`;function D(e){return String(Number(e.toFixed(4)))}function O(e,t){return s(e.tokens.get(t),`token ${t}`)}function oe(e){if(e==null)return 1440;if(typeof e==`number`)return e;throw Error(`emitWeb: fluidUntil must be a number`)}function k(t,n){if(typeof n==`string`)return n.replace(d,(e,t)=>`var(${o(t)})`);if(typeof n==`number`)return D(n);if(Array.isArray(n)){if(t.type===`cubicBezier`&&n.length===4&&n.every(e=>typeof e==`number`))return`cubic-bezier(${n.map(e=>D(e)).join(`, `)})`;if(t.type===`fontFamily`&&n.every(e=>typeof e==`string`))return n.map(e=>/\s/.test(e)?`"${e}"`:e).join(`, `)}else if(e(n)){if(`unit`in n&&typeof n.value==`number`)return`${D(n.value)}${String(n.unit)}`;if(`color`in n)return[n.offsetX,n.offsetY,n.blur,n.spread,n.color].map(e=>k(t,e)).join(` `)}throw Error(`emitWeb: ${t.path}: cannot write a ${t.type} value as CSS.`)}function A(e,t,n){return k(O(e,t),e.valueIn(t,n))}function j(t,n){if(e(n)&&n.unit===`px`&&typeof n.value==`number`)return n.value;throw Error(`emitWeb: ${t}: a text size must be a px dimension.`)}function M(e,t){let n=O(e,t),a=o(t);if(n.group===`text`){if(r(n).length>0)throw Error(`emitWeb: ${t}: a text size cannot carry breakpoints.`);let o=j(t,e.valueIn(t,u)),s=j(t,e.valueIn(t,c)),l=n.extensions?.fluidUntil;if(o!==s&&l===void 0)throw Error(`emitWeb: ${t}: the 390 and 1440 sizes differ but no fluidUntil is recorded.`);return{path:t,name:a,root:i(o,s,oe(l)),tiers:[]}}let s=r(n);return s.length>0?{path:t,name:a,root:A(e,t,u),tiers:s.map(e=>({tier:e.tier,text:k(n,e.value)}))}:{path:t,name:a,root:A(e,t,c),tiers:[]}}function N(e){let t=[];for(let n of e.tokens.keys())e.existsIn(n,c)&&t.push(M(e,n));return t}function P(e,t){let n=[];for(let[i,a]of e.tokens){if(!e.existsIn(i,l)||!e.existsIn(i,c)||r(a).length>0)continue;let s=A(e,i,l);if(a.group===`text`){if(s!==A(e,i,c))throw Error(`emitWeb: ${i}: a text size cannot change with the mode.`)}else t(i,s)&&n.push({path:i,name:o(i),text:s,light:A(e,i,c)})}return n}function F(e){let t=Number.parseInt(e.slice(1),16);return`${t>>16&255}, ${t>>8&255}, ${t&255}`}function I(e,t){let n=[],r=(r,i)=>{for(let[a,o]of r){let r=`color.${o}`,s=U(e,r,l);if(t(r,s)){let t=i?F(U(e,r,c)):null;n.push({name:a,text:F(s),light:t})}}};return r(p,!0),r(ne,!1),n}function L(e,t,n){return!e.tokens.has(`color.primary`)||!t.tokens.has(`color.primary`)||e.resolvedIn(`color.primary`,n)===t.resolvedIn(`color.primary`,n)?[]:R(e,n)}function R(e,t){let n=U(e,`color.primary`,t);return[{name:`--bs-primary`,text:n},{name:`--bs-primary-rgb`,text:F(n)}]}function z(e){return!e.tokens.has(`color.primary-text`)||!e.tokens.has(`color.primary`)?!1:[c,l].some(t=>U(e,`color.primary-text`,t)!==U(e,`color.primary`,t))}function B(e,t,n){return!_.every(n=>e.tokens.has(n)&&t.tokens.has(n))||_.every(r=>e.resolvedIn(r,n)===t.resolvedIn(r,n))?[]:V(e,n)}function V(e,t){let n=U(e,`color.link`,t),r=U(e,`color.link-hover`,t);return[{name:`--bs-link-color`,text:n},{name:`--bs-link-color-rgb`,text:F(n)},{name:`--bs-link-hover-color`,text:r},{name:`--bs-link-hover-color-rgb`,text:F(r)}]}function H(e){return _.every(t=>e.tokens.has(t))?[{name:`--bs-link-color`,text:`var(--color-link)`,light:`var(--color-link)`},{name:`--bs-link-color-rgb`,text:F(U(e,`color.link`,l)),light:F(U(e,`color.link`,c))},{name:`--bs-link-hover-color`,text:`var(--color-link-hover)`,light:`var(--color-link-hover)`},{name:`--bs-link-hover-color-rgb`,text:F(U(e,`color.link-hover`,l)),light:F(U(e,`color.link-hover`,c))}]:[]}function U(e,t,n){let r=e.resolvedIn(t,n);if(typeof r!=`string`||!te.test(r))throw Error(`emitWeb: ${t}: a Bootstrap rgb triplet needs an opaque colour.`);return r}function W(e,t){let n=P(e,t?(e,n)=>!t.tokens.has(e)||!t.existsIn(e,l)||n!==A(t,e,l):(t,n)=>n!==A(e,t,c)),r=I(e,t?(e,n)=>n!==t.resolvedIn(e,l):()=>!0);if(t){let i=B(e,t,c).length>0?V(e,l):B(e,t,l);return[...n,...r,...i]}let i=f.map(([e,t])=>{let n=`var(${o(`color.${t}`)})`;return{name:e,text:n,light:n}});return[...n,...i,...r,...H(e)]}function G(e,t,n){return e.tokens.has(n)&&t.tokens.has(n)&&e.resolvedIn(n,c)!==t.resolvedIn(n,c)}function K(e,t){let n=f.filter(([n,r])=>n!==`--bs-primary`&&G(e,t,`color.${r}`)).map(([e,t])=>({name:e,text:`var(${o(`color.${t}`)})`})),r=p.filter(([n,r])=>n!==`--bs-primary-rgb`&&G(e,t,`color.${r}`)).map(([t,n])=>({name:t,text:F(U(e,`color.${n}`,c))}));return[...n,...r]}function q(e,t){return`${e} {\n${t.join(`
11
11
  `).split(`
12
12
  `).map(e=>e===``?e:` ${e}`).join(`
13
- `)}\n}`}function J(e){return e.split(`,
13
+ `)}\n}`}var se=`/* Bootstrap's text and link helpers read --bs-primary-rgb, the fill; these read the primary text token. */`,ce=[q(`.text-primary`,[`color: color-mix(in srgb, var(--color-primary-text) calc(var(--bs-text-opacity, 1) * 100%), transparent) !important;`]),q(`.link-primary`,[`color: color-mix(in srgb, var(--color-primary-text) calc(var(--bs-link-opacity, 1) * 100%), transparent) !important;`,`text-decoration-color: color-mix(
14
+ in srgb,
15
+ var(--color-primary-text) calc(var(--bs-link-underline-opacity, 1) * 100%),
16
+ transparent
17
+ ) !important;`])].join(`
18
+
19
+ `);function J(e){return e.split(`,
14
20
  `).map(e=>`:where(${e})`).join(`,
15
- `)}function oe(e,t){let n=W(e,null).filter(e=>e.light!=null);if(!t)return n;let r=new Map(W(t,null).filter(e=>e.light!=null).map(e=>[e.name,e.light]));return n.filter(e=>r.get(e.name)!==e.light)}function se(e,t){if(e.length===0)return[];let n=e.map(e=>`${e.name}: ${String(e.light)};`);return[t?D:E,q(y,n),q(J(y),[`color-scheme: light;`,`color: var(--color-text);`]),q(`@media (prefers-color-scheme: dark)`,[q(b,n),q(J(b),[`color-scheme: light;`,`color: var(--color-text);`])])]}function ce(e){let t=[];for(let n=0;n<e.length;n+=6)t.push(e.slice(n,n+6).join(`, `));return[`$wui-dark-layer-names: (\n${t.map((e,n)=>` ${e}${n<t.length-1?`,`:``}`).join(`
21
+ `)}function le(e,t){let n=W(e,null).filter(e=>e.light!=null);if(!t)return n;let r=new Map(W(t,null).filter(e=>e.light!=null).map(e=>[e.name,e.light]));return n.filter(e=>r.get(e.name)!==e.light)}function ue(e,t){if(e.length===0)return[];let n=e.map(e=>`${e.name}: ${String(e.light)};`);return[t?ae:E,q(y,n),q(J(y),[`color-scheme: light;`,`color: var(--color-text);`]),q(`@media (prefers-color-scheme: dark)`,[q(b,n),q(J(b),[`color-scheme: light;`,`color: var(--color-text);`])])]}function Y(e){let t=[];for(let n=0;n<e.length;n+=6)t.push(e.slice(n,n+6).join(`, `));return[`$wui-dark-layer-names: (\n${t.map((e,n)=>` ${e}${n<t.length-1?`,`:``}`).join(`
16
22
  `)}\n);`,S,q(`html`,[`@each $name in $wui-dark-layer-names {`,` --wui-light-#{$name}: var(--#{$name});`,`}`]),q(x,[`@each $name in $wui-dark-layer-names {`,` --#{$name}: var(--wui-light-#{$name});`,`}`]),q(J(x),[`color-scheme: light;`,`color: var(--color-text);`])].join(`
17
23
 
18
- `)}function le(e){return[C,q(`html`,e.map(e=>`--wui-light-${e}: var(--${e});`)),q(x,e.map(e=>`--${e}: var(--wui-light-${e});`)),q(J(x),[`color-scheme: light;`,`color: var(--color-text);`])].join(`
24
+ `)}function de(e){return[C,q(`html`,e.map(e=>`--wui-light-${e}: var(--${e});`)),q(x,e.map(e=>`--${e}: var(--wui-light-${e});`)),q(J(x),[`color-scheme: light;`,`color: var(--color-text);`])].join(`
19
25
 
20
- `)}function Y(e,t,n=!1){let{package:r,version:i,brand:a}=e.source,o=t?`Generated by ${r} ${i} for the ${a} brand. Do not edit; run webority brand.`:`Generated by ${r} ${i} from its token source. Do not edit; run webority brand --library.`;return n?`/* ${o} */`:`// ${o}`}function X(e,r){let i=P(e),o=new Map((r?P(r):[]).map(e=>[e.path,e])),s=[],l=i.filter(e=>o.get(e.path)?.root!==e.root).map(e=>`${e.name}: ${e.root};`);r&&(l.push(...R(e,r,c).map(e=>`${e.name}: ${e.text};`)),l.push(...B(e,r,c).map(e=>`${e.name}: ${e.text};`)),l.push(...K(e,r).map(e=>`${e.name}: ${e.text};`))),l.length>0&&s.push(q(`:root`,l));for(let[e,n]of Object.entries(t)){let t=[];for(let n of i)for(let r of n.tiers)r.tier===e&&o.get(n.path)?.tiers.find(t=>t.tier===e)?.text!==r.text&&t.push(`${n.name}: ${r.text};`);t.length>0&&s.push(q(`@media (min-width: ${n}px)`,[q(`:root`,t)]))}let u=[];for(let t of i){let n=k(e,t.path),i=a(n);if(i===null)continue;let o=A(n,i),s=r?.tokens.get(t.path),c=s?a(s):null;s&&c!==null&&A(s,c)===o||u.push(`${t.name}: ${o};`)}u.length>0&&s.push(q(`@media ${n}`,[q(`:root`,u)]));let d=W(e,r);if(d.length>0){let t=d.map(e=>`${e.name}: ${e.text};`),n=r?T:w;s.push(q(re,[...t,`color-scheme: dark;`]),q(v,t),`${n}\n${q(J(v),[`color-scheme: dark;`,`color: var(--color-text);`])}`);let i=d.map(e=>e.name.slice(2));if(r){let e=new Set(W(r,null).map(e=>e.name.slice(2))),t=i.filter(t=>!e.has(t));t.length>0&&s.push(le(t))}else s.push(ce(i));s.push(q(`@media (prefers-color-scheme: dark)`,[q(ie,[...t,`color-scheme: dark;`])])),s.push(...se(oe(e,r),r!==null))}return`${[Y(e,r!==null,r!==null),...s].join(`
26
+ `)}function X(e,t,n=!1){let{package:r,version:i,brand:a}=e.source,o=t?`Generated by ${r} ${i} for the ${a} brand. Do not edit; run webority brand.`:`Generated by ${r} ${i} from its token source. Do not edit; run webority brand --library.`;return n?`/* ${o} */`:`// ${o}`}function Z(e,r){let i=N(e),o=new Map((r?N(r):[]).map(e=>[e.path,e])),s=[],l=i.filter(e=>o.get(e.path)?.root!==e.root).map(e=>`${e.name}: ${e.root};`);r&&(l.push(...L(e,r,c).map(e=>`${e.name}: ${e.text};`)),l.push(...B(e,r,c).map(e=>`${e.name}: ${e.text};`)),l.push(...K(e,r).map(e=>`${e.name}: ${e.text};`))),l.length>0&&s.push(q(`:root`,l));for(let[e,n]of Object.entries(t)){let t=[];for(let n of i)for(let r of n.tiers)r.tier===e&&o.get(n.path)?.tiers.find(t=>t.tier===e)?.text!==r.text&&t.push(`${n.name}: ${r.text};`);t.length>0&&s.push(q(`@media (min-width: ${n}px)`,[q(`:root`,t)]))}let u=[];for(let t of i){let n=O(e,t.path),i=a(n);if(i===null)continue;let o=k(n,i),s=r?.tokens.get(t.path),c=s?a(s):null;s&&c!==null&&k(s,c)===o||u.push(`${t.name}: ${o};`)}u.length>0&&s.push(q(`@media ${n}`,[q(`:root`,u)]));let d=W(e,r);if(d.length>0){let t=d.map(e=>`${e.name}: ${e.text};`),n=r?T:w;s.push(q(re,[...t,`color-scheme: dark;`]),q(v,t),`${n}\n${q(J(v),[`color-scheme: dark;`,`color: var(--color-text);`])}`);let i=d.map(e=>e.name.slice(2));if(r){let e=new Set(W(r,null).map(e=>e.name.slice(2))),t=i.filter(t=>!e.has(t));t.length>0&&s.push(de(t))}else s.push(Y(i));s.push(q(`@media (prefers-color-scheme: dark)`,[q(ie,[...t,`color-scheme: dark;`])])),s.push(...ue(le(e,r),r!==null))}return r!==null&&z(e)&&s.push(`${se}\n${ce}`),`${[X(e,r!==null,r!==null),...s].join(`
21
27
 
22
- `)}\n`}function Z(e,t){let n=k(e,t);if(n.type===`color`)return String(e.resolvedIn(t,c));let r=e.valueIn(t,c),i=(typeof r==`string`?ee.exec(r):null)?.[1];if(i!==void 0)return Z(e,i);let a=A(n,r);if(a.includes(`var(`))throw Error(`emitWeb: ${t}: a Bootstrap variable needs a literal.`);return a}function Q(e,t,n){return n===null?g[t]:Z(e,n)}function $(e){let t=m.map(([t,n])=>`${t}: ${String(Q(e,t,n))} !default;`);return`${[Y(e,!1),...t].join(`
23
- `)}\n`}function ue(e,t){let n=[...h,...m].filter(([n,r])=>Q(e,n,r)!==Q(t,n,r)),r=n.map(([t,n])=>`${t}: ${String(Q(e,t,n))};`),i=n.map(([e])=>e),a=i.length===0?[]:[`@use "@webority/theme/scss/config" with (`,...i.map((e,t)=>` ${e}: ${e}${t<i.length-1?`,`:``}`),`);`];return`${[Y(e,!0),...r,...a].join(`
24
- `)}\n`}function de(e,t){return t===void 0?{tokens:X(e,null),bootstrap:$(e)}:{css:X(e,t.library),variables:ue(e,t.library)}}export{de as emitWeb};
28
+ `)}\n`}function Q(e,t){let n=O(e,t);if(n.type===`color`)return String(e.resolvedIn(t,c));let r=e.valueIn(t,c),i=(typeof r==`string`?ee.exec(r):null)?.[1];if(i!==void 0)return Q(e,i);let a=k(n,r);if(a.includes(`var(`))throw Error(`emitWeb: ${t}: a Bootstrap variable needs a literal.`);return a}function $(e,t,n){return n===null?g[t]:Q(e,n)}function fe(e){let t=m.map(([t,n])=>`${t}: ${String($(e,t,n))} !default;`);return`${[X(e,!1),...t].join(`
29
+ `)}\n`}function pe(e,t){let n=[...h,...m].filter(([n,r])=>$(e,n,r)!==$(t,n,r)),r=n.map(([t,n])=>`${t}: ${String($(e,t,n))};`),i=n.map(([e])=>e),a=i.length===0?[]:[`@use "@webority/theme/scss/config" with (`,...i.map((e,t)=>` ${e}: ${e}${t<i.length-1?`,`:``}`),`);`];return`${[X(e,!0),...r,...a].join(`
30
+ `)}\n`}function me(e,t){return t===void 0?{tokens:Z(e,null),bootstrap:fe(e)}:{css:Z(e,t.library),variables:pe(e,t.library)}}export{me as emitWeb};
@@ -2,7 +2,7 @@
2
2
  "format": "webority-meanings/1",
3
3
  "source": {
4
4
  "package": "@webority/tokens",
5
- "version": "0.161.0"
5
+ "version": "0.164.0"
6
6
  },
7
7
  "color": {
8
8
  "bg": {
@@ -1,5 +1,5 @@
1
1
  import{present as e}from"../present.js";import{readRazorAttributes as t,tagOccurrences as n}from"./tagScan.js";import{applyEdits as r}from"./themeReads.js";var i=new Set([`.cshtml`,`.razor`]),a=/^([1-9]\d*)(?:px)?$/i,o=/^([ \t]*)@addTagHelper[ \t]+\*[ \t]*,[ \t]*Webority\.Ui\.Razor[ \t]*\r?$/m,s=/^[ \t]*@using[ \t]+Webority\.Ui\.Razor(?![\w.])/m,c=`@using Webority.Ui.Razor`,l=`()[]{},:`,u=e=>{let t=/\.[^./]*$/.exec(e);return t?t[0].toLowerCase():``},d=(e,t)=>e.slice(0,t).split(`
2
- `).length;function f(e,t){return Object.hasOwn(e.values,t)?e.values[t]:Object.values(e.values).find(e=>e.toLowerCase()===t)}function p(e){return Object.values(e.values).join(`, `)}function m(e,t){return`${t} is not a ${e.enum}. Use one of: ${p(e)}.`}function h(e,t){return`takes a ${e.enum} now; change the type that "${t}" returns from string to ${e.enum}.`}function g(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(/\s/.test(r)){n++;continue}let i=n,a=`word`;if(r===`"`){for(i=n+1;i<e.length&&e.charAt(i)!==`"`;)i+=e.charAt(i)===`\\`?2:1;if(i>=e.length)return null;i+=1,a=`str`}else if(r===`?`&&(e.charAt(n+1)===`?`||e.charAt(n+1)===`.`))i=n+2;else if(r===`?`||l.includes(r))i=n+1,a=`punct`;else for(;i<e.length&&!/[\s"?:()[\]{},]/.test(e.charAt(i));)i++;t.push({kind:a,text:e.slice(n,i),start:n,end:i}),n=i}return t}function _(e){let t=e.map(()=>-1),n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i?.kind===`punct`){if(`([{`.includes(i.text))n.push(r);else if(`)]}`.includes(i.text)){let e=n.pop();if(e===void 0)return null;t[e]=r}}}return n.length===0?t:null}var v=e=>e?.kind===`punct`&&`([{`.includes(e.text);function y(e,t,n,r,i){if(r-n>=2&&e[n]?.text===`(`&&t[n]===r-1)return y(e,t,n+1,r-1,i);let a=-1;for(let i=n;i<r&&a===-1;i++){let n=e[i];v(n)?i=t[i]??r:n?.kind===`punct`&&n.text===`?`&&(a=i)}if(a===-1)return i.push({lo:n,hi:r}),!1;let o=0,s=-1;for(let n=a+1;n<r&&s===-1;n++){let i=e[n];v(i)?n=t[n]??r:i?.kind===`punct`&&i.text===`?`?o++:i?.kind===`punct`&&i.text===`:`&&(o===0?s=n:o--)}return s===-1?(i.push({lo:n,hi:r}),!1):(y(e,t,a+1,s,i),y(e,t,s+1,r,i),!0)}function b(e,t,n,r,i){let a=n.hi-n.lo===1?t[n.lo]:void 0;if(a?.kind===`str`&&!a.text.includes(`\\`)&&!a.text.includes(`@`)){let t=f(e,a.text.slice(1,-1).toLowerCase());return t===void 0?{problem:m(e,a.text)}:{replace:{start:r+a.start,end:r+a.end,text:`${e.enum}.${t}`}}}return a?.kind===`word`&&Object.values(e.values).some(t=>a.text===`${e.enum}.${t}`)?{}:{problem:h(e,i)}}function x(e,t){let n=g(t.value.slice(1)),r=n===null?null:_(n);if(n===null||r===null)return{edits:[],message:h(e,t.value)};let i=[];y(n,r,0,n.length,i);let a=[],o;for(let r of i){let i=b(e,n,r,t.valueStart+1,t.value);i.problem===void 0?i.replace!==void 0&&a.push(i.replace):o??=i.problem}return o===void 0?{edits:a}:{edits:[],message:o}}function S(t,n,r,i){if(r.kind!==`quoted`)return{edits:[],message:`write it as ${r.name}="<member>"; one of: ${p(t)}.`};let o=t.numberAttribute===void 0?null:a.exec(r.value);if(t.numberAttribute!==void 0&&o!==null){if(i.has(t.numberAttribute))return{edits:[],message:`<${n}> already sets ${t.numberAttribute}; merge ${t.attribute} into it by hand`};let a=e(o[1],`the pixel count`),s=[{start:r.nameStart,end:r.nameEnd,text:t.numberAttribute}];return a!==r.value&&s.push({start:r.valueStart,end:r.valueEnd,text:a}),{edits:s}}if(r.value.startsWith(`@`))return t.keepExpressions===!0?{edits:[]}:x(t,r);let s=Object.values(t.values).some(e=>r.value===`${t.enum}.${e}`);if(s&&t.nullable===!0)return{edits:[]};let c=s?r.value.slice(t.enum.length+1):f(t,r.value.toLowerCase());if(c===void 0)return{edits:[],message:m(t,`"${r.value}"`)};let l=t.nullable===!0?`${t.enum}.${c}`:c;return l===r.value?{edits:[]}:{edits:[{start:r.valueStart,end:r.valueEnd,text:l}]}}function C(e,a,l){if(l.length===0||!i.has(u(a)))return{text:e,hits:[],findings:[]};let f=[],p=[],m=[];for(let i of l)for(let o of i.tags)for(let{nameEnd:s,end:c}of n(e,o)){if(c===-1){m.push({file:a,line:d(e,s),path:`<${o}>`,message:`the tag could not be read (a quote in an attribute value does not pair up); set it by hand`});continue}let n=t(e,s,c),l=new Set(n.map(e=>e.name));for(let t of n){if(t.name!==i.attribute)continue;let n=d(e,t.nameStart),s=S(i,o,t,l);if(s.message!==void 0){m.push({file:a,line:n,path:`<${o}> ${i.attribute}`,message:s.message});continue}if(s.edits.length===0)continue;f.push(...s.edits);let c=r(e.slice(t.nameStart,t.attrEnd),s.edits.map(e=>({start:e.start-t.nameStart,end:e.end-t.nameStart,text:e.text})),a);p.push({line:n,from:e.slice(t.nameStart,t.attrEnd),to:c.replace(/\n\s*/g,` `)})}}if((a.split(`/`).pop()??``).toLowerCase()===`_viewimports.cshtml`){let t=o.exec(e);if(t!==null&&!s.test(e)){let n=e.includes(`\r
2
+ `).length;function f(e,t){return Object.hasOwn(e.values,t)?e.values[t]:Object.values(e.values).find(e=>e.toLowerCase()===t)}function p(e){return Object.values(e.values).join(`, `)}function m(e,t){return`${t} is not a ${e.enum}. Use one of: ${p(e)}.`}function h(e,t){return`takes a ${e.enum} now; change the type that "${t}" returns from string to ${e.enum}.`}function g(e){let t=[],n=0;for(;n<e.length;){let r=e.charAt(n);if(/\s/.test(r)){n++;continue}let i=n,a=`word`;if(r===`"`){for(i=n+1;i<e.length&&e.charAt(i)!==`"`;)i+=e.charAt(i)===`\\`?2:1;if(i>=e.length)return null;i+=1,a=`str`}else if(r===`?`&&(e.charAt(n+1)===`?`||e.charAt(n+1)===`.`))i=n+2;else if(r===`?`||l.includes(r))i=n+1,a=`punct`;else for(;i<e.length&&!/[\s"?:()[\]{},]/.test(e.charAt(i));)i++;t.push({kind:a,text:e.slice(n,i),start:n,end:i}),n=i}return t}function _(e){let t=e.map(()=>-1),n=[];for(let r=0;r<e.length;r++){let i=e[r];if(i?.kind===`punct`){if(`([{`.includes(i.text))n.push(r);else if(`)]}`.includes(i.text)){let e=n.pop();if(e===void 0)return null;t[e]=r}}}return n.length===0?t:null}var v=e=>e?.kind===`punct`&&`([{`.includes(e.text);function y(e,t,n,r,i){if(r-n>=2&&e[n]?.text===`(`&&t[n]===r-1)return y(e,t,n+1,r-1,i);let a=-1;for(let i=n;i<r&&a===-1;i++){let n=e[i];v(n)?i=t[i]??r:n?.kind===`punct`&&n.text===`?`&&(a=i)}if(a===-1)return i.push({lo:n,hi:r}),!1;let o=0,s=-1;for(let n=a+1;n<r&&s===-1;n++){let i=e[n];v(i)?n=t[n]??r:i?.kind===`punct`&&i.text===`?`?o++:i?.kind===`punct`&&i.text===`:`&&(o===0?s=n:o--)}return s===-1?(i.push({lo:n,hi:r}),!1):(y(e,t,a+1,s,i),y(e,t,s+1,r,i),!0)}function b(e,t,n,r,i){let a=n.hi-n.lo===1?t[n.lo]:void 0;if(a?.kind===`str`&&!a.text.includes(`\\`)&&!a.text.includes(`@`)){let t=f(e,a.text.slice(1,-1).toLowerCase());return t===void 0?{problem:m(e,a.text)}:{replace:{start:r+a.start,end:r+a.end,text:`${e.enum}.${t}`}}}return a?.kind===`word`&&Object.values(e.values).some(t=>a.text===`${e.enum}.${t}`)?{}:{problem:h(e,i)}}function x(e,t){let n=g(t.value.slice(1)),r=n===null?null:_(n);if(n===null||r===null)return{edits:[],message:h(e,t.value)};let i=[];y(n,r,0,n.length,i);let a=[],o;for(let r of i){let i=b(e,n,r,t.valueStart+1,t.value);i.problem===void 0?i.replace!==void 0&&a.push(i.replace):o??=i.problem}return o===void 0?{edits:a}:{edits:[],message:o}}function S(t,n,r,i){let o=t.nullableTags?.includes(n)===!0;if(r.kind!==`quoted`)return{edits:[],message:`write it as ${r.name}="<member>"; one of: ${p(t)}.`};let s=t.numberAttribute===void 0?null:a.exec(r.value);if(t.numberAttribute!==void 0&&s!==null){if(i.has(t.numberAttribute))return{edits:[],message:`<${n}> already sets ${t.numberAttribute}; merge ${t.attribute} into it by hand`};let a=e(s[1],`the pixel count`),o=[{start:r.nameStart,end:r.nameEnd,text:t.numberAttribute}];return a!==r.value&&o.push({start:r.valueStart,end:r.valueEnd,text:a}),{edits:o}}if(r.value.startsWith(`@`))return t.keepExpressions===!0?{edits:[]}:x(t,r);let c=Object.values(t.values).some(e=>r.value===`${t.enum}.${e}`);if(c&&o)return{edits:[]};let l=c?r.value.slice(t.enum.length+1):f(t,r.value.toLowerCase());if(l===void 0)return{edits:[],message:m(t,`"${r.value}"`)};let u=o?`${t.enum}.${l}`:l;return u===r.value?{edits:[]}:{edits:[{start:r.valueStart,end:r.valueEnd,text:u}]}}function C(e,a,l){if(l.length===0||!i.has(u(a)))return{text:e,hits:[],findings:[]};let f=[],p=[],m=[];for(let i of l)for(let o of i.tags)for(let{nameEnd:s,end:c}of n(e,o)){if(c===-1){m.push({file:a,line:d(e,s),path:`<${o}>`,message:`the tag could not be read (a quote in an attribute value does not pair up); set it by hand`});continue}let n=t(e,s,c),l=new Set(n.map(e=>e.name));for(let t of n){if(t.name!==i.attribute)continue;let n=d(e,t.nameStart),s=S(i,o,t,l);if(s.message!==void 0){m.push({file:a,line:n,path:`<${o}> ${i.attribute}`,message:s.message});continue}if(s.edits.length===0)continue;f.push(...s.edits);let c=r(e.slice(t.nameStart,t.attrEnd),s.edits.map(e=>({start:e.start-t.nameStart,end:e.end-t.nameStart,text:e.text})),a);p.push({line:n,from:e.slice(t.nameStart,t.attrEnd),to:c.replace(/\n\s*/g,` `)})}}if((a.split(`/`).pop()??``).toLowerCase()===`_viewimports.cshtml`){let t=o.exec(e);if(t!==null&&!s.test(e)){let n=e.includes(`\r
3
3
  `)?`\r
4
4
  `:`
5
5
  `,r=t.index;f.push({start:r,end:r,text:`${t[1]??``}${c}${n}`}),p.push({line:d(e,r),from:``,to:c})}}return p.sort((e,t)=>e.line-t.line||(e.from<t.from?-1:+(e.from>t.from))),m.sort((e,t)=>e.line-t.line||(e.path<t.path?-1:+(e.path>t.path))),{text:r(e,f,a),hits:p,findings:m}}export{C as applyRazorEnumAttributes};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webority/tokens",
3
- "version": "0.161.0",
3
+ "version": "0.164.0",
4
4
  "description": "The Webority design tokens in one W3C Design Tokens source (palette, scale, meaning and component tiers, with light and dark, web and phone, and 390 and 1440 widths), and the webority command that brands a product, upgrades it between releases and checks it against the token source.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -41,7 +41,7 @@
41
41
  "devDependencies": {
42
42
  "@babel/types": "7.29.8",
43
43
  "@types/node": "25.6.0",
44
- "@webority/biome-config": "0.161.0",
44
+ "@webority/biome-config": "0.164.0",
45
45
  "ajv": "8.20.0",
46
46
  "typescript": "^7.0.2",
47
47
  "vite": "^8.3.6"
@@ -34,7 +34,7 @@
34
34
  "values": {
35
35
  "danger": "Danger"
36
36
  },
37
- "nullable": true
37
+ "nullableTags": ["app-action-icon", "app-button"]
38
38
  },
39
39
  {
40
40
  "tags": ["app-action-icon", "app-form-section", "app-select", "app-shell"],
@@ -43,7 +43,8 @@
43
43
  "values": {
44
44
  "comfortable": "Comfortable",
45
45
  "compact": "Compact"
46
- }
46
+ },
47
+ "nullableTags": ["app-select"]
47
48
  },
48
49
  {
49
50
  "tags": ["app-action-icon", "app-alert", "app-avatar", "app-button", "app-kpi-tile", "app-shell", "app-stepper", "app-wizard"],
@@ -56,7 +57,8 @@
56
57
  "bulk": "Bulk",
57
58
  "broken": "Broken",
58
59
  "twotone": "Twotone"
59
- }
60
+ },
61
+ "nullableTags": ["app-action-icon", "app-alert", "app-avatar", "app-button", "app-stepper", "app-wizard"]
60
62
  },
61
63
  {
62
64
  "tags": ["app-timeline"],
@@ -70,7 +72,7 @@
70
72
  "broken": "Broken",
71
73
  "twotone": "Twotone"
72
74
  },
73
- "nullable": true
75
+ "nullableTags": ["app-timeline"]
74
76
  },
75
77
  {
76
78
  "tags": ["app-action-icon"],
@@ -80,7 +82,7 @@
80
82
  "danger": "Danger",
81
83
  "neutral": "Neutral"
82
84
  },
83
- "nullable": true
85
+ "nullableTags": ["app-action-icon"]
84
86
  },
85
87
  {
86
88
  "tags": [
@@ -152,7 +154,8 @@
152
154
  "sm": "Sm",
153
155
  "md": "Md",
154
156
  "lg": "Lg"
155
- }
157
+ },
158
+ "nullableTags": ["app-checkbox", "app-input", "app-radio", "app-search", "app-select", "app-switch", "app-textarea"]
156
159
  },
157
160
  {
158
161
  "tags": [
@@ -171,7 +174,15 @@
171
174
  "md": "Md",
172
175
  "lg": "Lg"
173
176
  },
174
- "nullable": true
177
+ "nullableTags": [
178
+ "app-date-picker",
179
+ "app-date-range-picker",
180
+ "app-file-picker",
181
+ "app-mention-input",
182
+ "app-otp-input",
183
+ "app-slider",
184
+ "app-time-picker"
185
+ ]
175
186
  },
176
187
  {
177
188
  "tags": ["app-alert", "app-banner", "app-meter", "app-metric"],
@@ -196,7 +207,7 @@
196
207
  "danger": "Danger",
197
208
  "neutral": "Neutral"
198
209
  },
199
- "nullable": true
210
+ "nullableTags": ["app-timeline-item"]
200
211
  },
201
212
  {
202
213
  "tags": ["app-analytics-head"],
@@ -204,7 +215,8 @@
204
215
  "enum": "AppAnalyticsHeadLoadDelay",
205
216
  "values": {
206
217
  "idle": "Idle"
207
- }
218
+ },
219
+ "nullableTags": ["app-analytics-head"]
208
220
  },
209
221
  {
210
222
  "tags": ["app-avatar-group"],
@@ -238,6 +250,7 @@
238
250
  "xl": "Xl",
239
251
  "2xl": "TwoXl"
240
252
  },
253
+ "nullableTags": ["app-avatar"],
241
254
  "numberAttribute": "size-px"
242
255
  },
243
256
  {
@@ -253,7 +266,7 @@
253
266
  "2xl": "TwoXl"
254
267
  },
255
268
  "numberAttribute": "size-px",
256
- "nullable": true
269
+ "nullableTags": ["app-avatar-group"]
257
270
  },
258
271
  {
259
272
  "tags": ["app-avatar"],
@@ -305,7 +318,8 @@
305
318
  "danger": "Danger",
306
319
  "info": "Info",
307
320
  "neutral": "Neutral"
308
- }
321
+ },
322
+ "nullableTags": ["app-context-menu-item", "app-context-menu-submenu", "app-dropdown-item", "app-split-button-item"]
309
323
  },
310
324
  {
311
325
  "tags": ["app-button"],
@@ -319,7 +333,7 @@
319
333
  "roll": "Roll",
320
334
  "none": "None"
321
335
  },
322
- "nullable": true
336
+ "nullableTags": ["app-button"]
323
337
  },
324
338
  {
325
339
  "tags": ["app-button", "app-toast"],
@@ -340,7 +354,8 @@
340
354
  "md": "Md",
341
355
  "lg": "Lg",
342
356
  "xl": "Xl"
343
- }
357
+ },
358
+ "nullableTags": ["app-button"]
344
359
  },
345
360
  {
346
361
  "tags": ["app-button", "app-split-button"],
@@ -375,7 +390,7 @@
375
390
  "day": "Day",
376
391
  "list": "List"
377
392
  },
378
- "nullable": true
393
+ "nullableTags": ["app-calendar"]
379
394
  },
380
395
  {
381
396
  "tags": ["app-card"],
@@ -387,6 +402,7 @@
387
402
  "md": "Md",
388
403
  "lg": "Lg"
389
404
  },
405
+ "nullableTags": ["app-card"],
390
406
  "numberAttribute": "max-width-px"
391
407
  },
392
408
  {
@@ -432,7 +448,7 @@
432
448
  "danger": "Danger",
433
449
  "info": "Info"
434
450
  },
435
- "nullable": true
451
+ "nullableTags": ["app-wizard"]
436
452
  },
437
453
  {
438
454
  "tags": ["app-card"],
@@ -458,7 +474,7 @@
458
474
  "duration": "Duration",
459
475
  "date": "Date"
460
476
  },
461
- "nullable": true
477
+ "nullableTags": ["app-chart-series"]
462
478
  },
463
479
  {
464
480
  "tags": ["app-chart-series"],
@@ -471,7 +487,7 @@
471
487
  "datetime": "Datetime",
472
488
  "time": "Time"
473
489
  },
474
- "nullable": true
490
+ "nullableTags": ["app-chart-series"]
475
491
  },
476
492
  {
477
493
  "tags": ["app-chart-series"],
@@ -485,7 +501,7 @@
485
501
  "min": "Min",
486
502
  "h": "H"
487
503
  },
488
- "nullable": true
504
+ "nullableTags": ["app-chart-series"]
489
505
  },
490
506
  {
491
507
  "tags": ["app-chart"],
@@ -496,7 +512,7 @@
496
512
  "svg": "Svg",
497
513
  "canvas": "Canvas"
498
514
  },
499
- "nullable": true
515
+ "nullableTags": ["app-chart"]
500
516
  },
501
517
  {
502
518
  "tags": ["app-chart"],
@@ -510,7 +526,7 @@
510
526
  "duration": "Duration",
511
527
  "date": "Date"
512
528
  },
513
- "nullable": true
529
+ "nullableTags": ["app-chart"]
514
530
  },
515
531
  {
516
532
  "tags": ["app-chart"],
@@ -523,7 +539,7 @@
523
539
  "datetime": "Datetime",
524
540
  "time": "Time"
525
541
  },
526
- "nullable": true
542
+ "nullableTags": ["app-chart"]
527
543
  },
528
544
  {
529
545
  "tags": ["app-chart"],
@@ -537,7 +553,7 @@
537
553
  "min": "Min",
538
554
  "h": "H"
539
555
  },
540
- "nullable": true
556
+ "nullableTags": ["app-chart"]
541
557
  },
542
558
  {
543
559
  "tags": ["app-chart"],
@@ -548,7 +564,7 @@
548
564
  "stacked": "Stacked",
549
565
  "percent": "Percent"
550
566
  },
551
- "nullable": true
567
+ "nullableTags": ["app-chart"]
552
568
  },
553
569
  {
554
570
  "tags": ["app-chart"],
@@ -560,7 +576,7 @@
560
576
  "empty": "Empty",
561
577
  "error": "Error"
562
578
  },
563
- "nullable": true
579
+ "nullableTags": ["app-chart"]
564
580
  },
565
581
  {
566
582
  "tags": ["app-chart"],
@@ -582,7 +598,8 @@
582
598
  "scatter": "Scatter",
583
599
  "bubble": "Bubble",
584
600
  "multiples": "Multiples"
585
- }
601
+ },
602
+ "nullableTags": ["app-chart"]
586
603
  },
587
604
  {
588
605
  "tags": ["app-chart"],
@@ -592,7 +609,7 @@
592
609
  "chart": "Chart",
593
610
  "table": "Table"
594
611
  },
595
- "nullable": true
612
+ "nullableTags": ["app-chart"]
596
613
  },
597
614
  {
598
615
  "tags": ["app-chart"],
@@ -606,7 +623,7 @@
606
623
  "duration": "Duration",
607
624
  "date": "Date"
608
625
  },
609
- "nullable": true
626
+ "nullableTags": ["app-chart"]
610
627
  },
611
628
  {
612
629
  "tags": ["app-chart"],
@@ -617,7 +634,7 @@
617
634
  "time": "Time",
618
635
  "value": "Value"
619
636
  },
620
- "nullable": true
637
+ "nullableTags": ["app-chart"]
621
638
  },
622
639
  {
623
640
  "tags": ["app-chart"],
@@ -629,7 +646,7 @@
629
646
  "rotate": "Rotate",
630
647
  "ellipsis": "Ellipsis"
631
648
  },
632
- "nullable": true
649
+ "nullableTags": ["app-chart"]
633
650
  },
634
651
  {
635
652
  "tags": ["app-chart"],
@@ -642,7 +659,7 @@
642
659
  "datetime": "Datetime",
643
660
  "time": "Time"
644
661
  },
645
- "nullable": true
662
+ "nullableTags": ["app-chart"]
646
663
  },
647
664
  {
648
665
  "tags": ["app-chart"],
@@ -656,7 +673,7 @@
656
673
  "min": "Min",
657
674
  "h": "H"
658
675
  },
659
- "nullable": true
676
+ "nullableTags": ["app-chart"]
660
677
  },
661
678
  {
662
679
  "tags": ["app-chart"],
@@ -670,7 +687,7 @@
670
687
  "duration": "Duration",
671
688
  "date": "Date"
672
689
  },
673
- "nullable": true
690
+ "nullableTags": ["app-chart"]
674
691
  },
675
692
  {
676
693
  "tags": ["app-chart"],
@@ -683,7 +700,7 @@
683
700
  "datetime": "Datetime",
684
701
  "time": "Time"
685
702
  },
686
- "nullable": true
703
+ "nullableTags": ["app-chart"]
687
704
  },
688
705
  {
689
706
  "tags": ["app-chart"],
@@ -697,7 +714,7 @@
697
714
  "min": "Min",
698
715
  "h": "H"
699
716
  },
700
- "nullable": true
717
+ "nullableTags": ["app-chart"]
701
718
  },
702
719
  {
703
720
  "tags": ["app-chip-group"],
@@ -734,7 +751,7 @@
734
751
  "values": {
735
752
  "filled": "Filled"
736
753
  },
737
- "nullable": true
754
+ "nullableTags": ["app-choice-card"]
738
755
  },
739
756
  {
740
757
  "tags": ["app-choice-chip"],
@@ -789,7 +806,7 @@
789
806
  "warn": "Warn",
790
807
  "partial": "Partial"
791
808
  },
792
- "nullable": true
809
+ "nullableTags": ["app-compare-cell"]
793
810
  },
794
811
  {
795
812
  "tags": ["app-compare-column"],
@@ -837,6 +854,7 @@
837
854
  "lg": "Lg",
838
855
  "xl": "Xl"
839
856
  },
857
+ "nullableTags": ["app-confirm-dialog"],
840
858
  "numberAttribute": "size-px"
841
859
  },
842
860
  {
@@ -906,7 +924,7 @@
906
924
  "lg": "Lg",
907
925
  "xl": "Xl"
908
926
  },
909
- "nullable": true
927
+ "nullableTags": ["app-dropdown-item"]
910
928
  },
911
929
  {
912
930
  "tags": ["app-dropdown", "app-split-button"],
@@ -927,7 +945,7 @@
927
945
  "lg": "Lg",
928
946
  "fit": "Fit"
929
947
  },
930
- "nullable": true
948
+ "nullableTags": ["app-dropdown"]
931
949
  },
932
950
  {
933
951
  "tags": ["app-dropdown"],
@@ -936,7 +954,7 @@
936
954
  "values": {
937
955
  "neutral": "Neutral"
938
956
  },
939
- "nullable": true
957
+ "nullableTags": ["app-dropdown"]
940
958
  },
941
959
  {
942
960
  "tags": ["app-due-date"],
@@ -961,7 +979,7 @@
961
979
  "offline": "Offline",
962
980
  "error": "Error"
963
981
  },
964
- "nullable": true
982
+ "nullableTags": ["app-empty-state"]
965
983
  },
966
984
  {
967
985
  "tags": ["app-empty-state"],
@@ -990,7 +1008,8 @@
990
1008
  "multienum": "MultiEnum",
991
1009
  "daterange": "DateRange",
992
1010
  "text": "Text"
993
- }
1011
+ },
1012
+ "nullableTags": ["app-filter-facet"]
994
1013
  },
995
1014
  {
996
1015
  "tags": ["app-form-section"],
@@ -1046,6 +1065,7 @@
1046
1065
  "md": "Md",
1047
1066
  "lg": "Lg"
1048
1067
  },
1068
+ "nullableTags": ["app-image-picker", "app-splash", "app-timeline"],
1049
1069
  "numberAttribute": "size-px"
1050
1070
  },
1051
1071
  {
@@ -1056,7 +1076,7 @@
1056
1076
  "initials": "Initials",
1057
1077
  "avatar": "Avatar"
1058
1078
  },
1059
- "nullable": true
1079
+ "nullableTags": ["app-image-picker"]
1060
1080
  },
1061
1081
  {
1062
1082
  "tags": ["app-info-tip", "app-popover", "app-tooltip"],
@@ -1134,7 +1154,7 @@
1134
1154
  "values": {
1135
1155
  "bare": "Bare"
1136
1156
  },
1137
- "nullable": true
1157
+ "nullableTags": ["app-input"]
1138
1158
  },
1139
1159
  {
1140
1160
  "tags": ["app-kanban-column"],
@@ -1147,7 +1167,7 @@
1147
1167
  "xl": "Xl",
1148
1168
  "fullscreen": "Fullscreen"
1149
1169
  },
1150
- "nullable": true
1170
+ "nullableTags": ["app-kanban-column"]
1151
1171
  },
1152
1172
  {
1153
1173
  "tags": ["app-kanban"],
@@ -1167,7 +1187,7 @@
1167
1187
  "currency": "Currency",
1168
1188
  "compact": "Compact"
1169
1189
  },
1170
- "nullable": true
1190
+ "nullableTags": ["app-kanban"]
1171
1191
  },
1172
1192
  {
1173
1193
  "tags": ["app-kanban"],
@@ -1177,7 +1197,7 @@
1177
1197
  "rupees": "Rupees",
1178
1198
  "paise": "Paise"
1179
1199
  },
1180
- "nullable": true
1200
+ "nullableTags": ["app-kanban"]
1181
1201
  },
1182
1202
  {
1183
1203
  "tags": ["app-kpi-tile"],
@@ -1188,7 +1208,7 @@
1188
1208
  "down": "Down",
1189
1209
  "flat": "Flat"
1190
1210
  },
1191
- "nullable": true
1211
+ "nullableTags": ["app-kpi-tile"]
1192
1212
  },
1193
1213
  {
1194
1214
  "tags": ["app-kpi-tile"],
@@ -1199,7 +1219,7 @@
1199
1219
  "danger": "Danger",
1200
1220
  "neutral": "Neutral"
1201
1221
  },
1202
- "nullable": true
1222
+ "nullableTags": ["app-kpi-tile"]
1203
1223
  },
1204
1224
  {
1205
1225
  "tags": ["app-kpi-tile"],
@@ -1222,7 +1242,7 @@
1222
1242
  "info": "Info",
1223
1243
  "neutral": "Neutral"
1224
1244
  },
1225
- "nullable": true
1245
+ "nullableTags": ["app-kpi-tile"]
1226
1246
  },
1227
1247
  {
1228
1248
  "tags": ["app-kpi-tile"],
@@ -1330,6 +1350,7 @@
1330
1350
  "xl": "Xl",
1331
1351
  "fullscreen": "Fullscreen"
1332
1352
  },
1353
+ "nullableTags": ["app-modal", "app-modal-content"],
1333
1354
  "numberAttribute": "size-px"
1334
1355
  },
1335
1356
  {
@@ -1370,7 +1391,7 @@
1370
1391
  "offline": "Offline",
1371
1392
  "error": "Error"
1372
1393
  },
1373
- "nullable": true
1394
+ "nullableTags": ["app-table-rows"]
1374
1395
  },
1375
1396
  {
1376
1397
  "tags": ["app-nav-link"],
@@ -1384,7 +1405,7 @@
1384
1405
  "info": "Info",
1385
1406
  "neutral": "Neutral"
1386
1407
  },
1387
- "nullable": true
1408
+ "nullableTags": ["app-nav-link"]
1388
1409
  },
1389
1410
  {
1390
1411
  "tags": ["app-nav-link"],
@@ -1406,7 +1427,8 @@
1406
1427
  "danger": "Danger",
1407
1428
  "info": "Info",
1408
1429
  "neutral": "Neutral"
1409
- }
1430
+ },
1431
+ "nullableTags": ["app-nav-list-item"]
1410
1432
  },
1411
1433
  {
1412
1434
  "tags": ["app-onboarding-step"],
@@ -1417,7 +1439,8 @@
1417
1439
  "current": "Current",
1418
1440
  "skipped": "Skipped",
1419
1441
  "todo": "Todo"
1420
- }
1442
+ },
1443
+ "nullableTags": ["app-onboarding-step"]
1421
1444
  },
1422
1445
  {
1423
1446
  "tags": ["app-otp-input"],
@@ -1508,7 +1531,8 @@
1508
1531
  "values": {
1509
1532
  "default": "Default",
1510
1533
  "card": "Card"
1511
- }
1534
+ },
1535
+ "nullableTags": ["app-radio-group"]
1512
1536
  },
1513
1537
  {
1514
1538
  "tags": ["app-rich-text"],
@@ -1518,7 +1542,7 @@
1518
1542
  "html": "Html",
1519
1543
  "markdown": "Markdown"
1520
1544
  },
1521
- "nullable": true
1545
+ "nullableTags": ["app-rich-text"]
1522
1546
  },
1523
1547
  {
1524
1548
  "tags": ["app-rolling-number"],
@@ -1537,7 +1561,8 @@
1537
1561
  "values": {
1538
1562
  "rupees": "Rupees",
1539
1563
  "paise": "Paise"
1540
- }
1564
+ },
1565
+ "nullableTags": ["app-rolling-number"]
1541
1566
  },
1542
1567
  {
1543
1568
  "tags": ["app-saved-views"],
@@ -1546,7 +1571,8 @@
1546
1571
  "values": {
1547
1572
  "browser": "Browser",
1548
1573
  "server": "Server"
1549
- }
1574
+ },
1575
+ "nullableTags": ["app-saved-views"]
1550
1576
  },
1551
1577
  {
1552
1578
  "tags": [
@@ -1623,7 +1649,7 @@
1623
1649
  "info": "Info",
1624
1650
  "neutral": "Neutral"
1625
1651
  },
1626
- "nullable": true
1652
+ "nullableTags": ["app-section-hero"]
1627
1653
  },
1628
1654
  {
1629
1655
  "tags": ["app-select"],
@@ -1635,7 +1661,8 @@
1635
1661
  "search": "Search",
1636
1662
  "tag": "Tag",
1637
1663
  "country": "Country"
1638
- }
1664
+ },
1665
+ "nullableTags": ["app-select"]
1639
1666
  },
1640
1667
  {
1641
1668
  "tags": ["app-shell-user-menu"],
@@ -1662,7 +1689,7 @@
1662
1689
  "values": {
1663
1690
  "moderate": "Moderate"
1664
1691
  },
1665
- "nullable": true
1692
+ "nullableTags": ["app-shell"]
1666
1693
  },
1667
1694
  {
1668
1695
  "tags": ["app-shell"],
@@ -1689,7 +1716,8 @@
1689
1716
  "values": {
1690
1717
  "horizontal": "Horizontal",
1691
1718
  "vertical": "Vertical"
1692
- }
1719
+ },
1720
+ "nullableTags": ["app-sortable-list"]
1693
1721
  },
1694
1722
  {
1695
1723
  "tags": ["app-timeline"],
@@ -1699,7 +1727,7 @@
1699
1727
  "horizontal": "Horizontal",
1700
1728
  "vertical": "Vertical"
1701
1729
  },
1702
- "nullable": true
1730
+ "nullableTags": ["app-timeline"]
1703
1731
  },
1704
1732
  {
1705
1733
  "tags": ["app-spinner"],
@@ -1709,6 +1737,7 @@
1709
1737
  "sm": "Sm",
1710
1738
  "md": "Md"
1711
1739
  },
1740
+ "nullableTags": ["app-spinner"],
1712
1741
  "numberAttribute": "size-px"
1713
1742
  },
1714
1743
  {
@@ -1761,7 +1790,7 @@
1761
1790
  "pending": "Pending",
1762
1791
  "error": "Error"
1763
1792
  },
1764
- "nullable": true
1793
+ "nullableTags": ["app-step"]
1765
1794
  },
1766
1795
  {
1767
1796
  "tags": ["app-table-pagination"],
@@ -1800,7 +1829,7 @@
1800
1829
  "danger": "Danger",
1801
1830
  "info": "Info"
1802
1831
  },
1803
- "nullable": true
1832
+ "nullableTags": ["app-tab"]
1804
1833
  },
1805
1834
  {
1806
1835
  "tags": ["app-theme-toggle"],
@@ -1837,7 +1866,7 @@
1837
1866
  "cancelled": "Cancelled",
1838
1867
  "skipped": "Skipped"
1839
1868
  },
1840
- "nullable": true
1869
+ "nullableTags": ["app-timeline-item"]
1841
1870
  },
1842
1871
  {
1843
1872
  "tags": ["app-timeline"],
@@ -1902,7 +1931,7 @@
1902
1931
  "values": {
1903
1932
  "inverse": "Inverse"
1904
1933
  },
1905
- "nullable": true
1934
+ "nullableTags": ["app-tooltip"]
1906
1935
  },
1907
1936
  {
1908
1937
  "tags": ["app-tour-step"],
@@ -1911,7 +1940,7 @@
1911
1940
  "values": {
1912
1941
  "click": "Click"
1913
1942
  },
1914
- "nullable": true
1943
+ "nullableTags": ["app-tour-step"]
1915
1944
  },
1916
1945
  {
1917
1946
  "tags": ["app-tour-step"],
@@ -1921,7 +1950,7 @@
1921
1950
  "image": "Image",
1922
1951
  "video": "Video"
1923
1952
  },
1924
- "nullable": true
1953
+ "nullableTags": ["app-tour-step"]
1925
1954
  },
1926
1955
  {
1927
1956
  "tags": ["app-tour"],
@@ -1930,7 +1959,7 @@
1930
1959
  "values": {
1931
1960
  "local": "Local"
1932
1961
  },
1933
- "nullable": true
1962
+ "nullableTags": ["app-tour"]
1934
1963
  },
1935
1964
  {
1936
1965
  "tags": ["app-tree-node"],
@@ -1944,7 +1973,7 @@
1944
1973
  "info": "Info",
1945
1974
  "neutral": "Neutral"
1946
1975
  },
1947
- "nullable": true
1976
+ "nullableTags": ["app-tree-node"]
1948
1977
  },
1949
1978
  {
1950
1979
  "tags": ["app-tree-view"],
@@ -1964,7 +1993,7 @@
1964
1993
  "dot": "Dot",
1965
1994
  "count": "Count"
1966
1995
  },
1967
- "nullable": true
1996
+ "nullableTags": ["app-whats-new"]
1968
1997
  },
1969
1998
  {
1970
1999
  "tags": ["app-wizard-step"],
@@ -1977,7 +2006,7 @@
1977
2006
  "error": "Error",
1978
2007
  "skipped": "Skipped"
1979
2008
  },
1980
- "nullable": true
2009
+ "nullableTags": ["app-wizard-step"]
1981
2010
  },
1982
2011
  {
1983
2012
  "tags": ["app-wizard"],
@@ -1999,7 +2028,7 @@
1999
2028
  "danger": "Danger",
2000
2029
  "info": "Info"
2001
2030
  },
2002
- "nullable": true
2031
+ "nullableTags": ["app-wizard"]
2003
2032
  },
2004
2033
  {
2005
2034
  "tags": ["app-wizard"],
@@ -2020,7 +2049,7 @@
2020
2049
  "overlay": "Overlay",
2021
2050
  "buttons": "Buttons"
2022
2051
  },
2023
- "nullable": true
2052
+ "nullableTags": ["app-image-picker"]
2024
2053
  },
2025
2054
  {
2026
2055
  "tags": ["app-image-picker"],
@@ -2030,7 +2059,7 @@
2030
2059
  "keep": "Keep",
2031
2060
  "image/webp": "ImageWebp"
2032
2061
  },
2033
- "nullable": true
2062
+ "nullableTags": ["app-image-picker"]
2034
2063
  },
2035
2064
  {
2036
2065
  "tags": ["app-image-picker"],
@@ -2060,7 +2089,7 @@
2060
2089
  "pill": "Pill",
2061
2090
  "circle": "Circle"
2062
2091
  },
2063
- "nullable": true
2092
+ "nullableTags": ["app-checkbox", "app-radio", "app-switch"]
2064
2093
  },
2065
2094
  {
2066
2095
  "tags": ["app-data-table"],
@@ -30,7 +30,7 @@
30
30
  "broken": "Broken",
31
31
  "twotone": "Twotone"
32
32
  },
33
- "nullable": true,
33
+ "nullableTags": ["app-action-icon", "app-alert", "app-avatar", "app-button", "app-stepper", "app-wizard"],
34
34
  "keepExpressions": true
35
35
  },
36
36
  {
@@ -40,7 +40,7 @@
40
40
  "values": {
41
41
  "idle": "Idle"
42
42
  },
43
- "nullable": true,
43
+ "nullableTags": ["app-analytics-head"],
44
44
  "keepExpressions": true
45
45
  },
46
46
  {
@@ -56,7 +56,7 @@
56
56
  "2xl": "TwoXl"
57
57
  },
58
58
  "numberAttribute": "size-px",
59
- "nullable": true,
59
+ "nullableTags": ["app-avatar"],
60
60
  "keepExpressions": true
61
61
  },
62
62
  {
@@ -69,7 +69,7 @@
69
69
  "lg": "Lg",
70
70
  "xl": "Xl"
71
71
  },
72
- "nullable": true,
72
+ "nullableTags": ["app-button"],
73
73
  "keepExpressions": true
74
74
  },
75
75
  {
@@ -83,7 +83,7 @@
83
83
  "lg": "Lg"
84
84
  },
85
85
  "numberAttribute": "max-width-px",
86
- "nullable": true,
86
+ "nullableTags": ["app-card"],
87
87
  "keepExpressions": true
88
88
  },
89
89
  {
@@ -107,7 +107,7 @@
107
107
  "bubble": "Bubble",
108
108
  "multiples": "Multiples"
109
109
  },
110
- "nullable": true,
110
+ "nullableTags": ["app-chart"],
111
111
  "keepExpressions": true
112
112
  },
113
113
  {
@@ -119,7 +119,7 @@
119
119
  "md": "Md",
120
120
  "lg": "Lg"
121
121
  },
122
- "nullable": true,
122
+ "nullableTags": ["app-checkbox", "app-input", "app-radio", "app-search", "app-select", "app-switch", "app-textarea"],
123
123
  "keepExpressions": true
124
124
  },
125
125
  {
@@ -132,7 +132,7 @@
132
132
  "lg": "Lg"
133
133
  },
134
134
  "numberAttribute": "size-px",
135
- "nullable": true,
135
+ "nullableTags": ["app-image-picker", "app-splash", "app-timeline"],
136
136
  "keepExpressions": true
137
137
  },
138
138
  {
@@ -146,7 +146,7 @@
146
146
  "xl": "Xl"
147
147
  },
148
148
  "numberAttribute": "size-px",
149
- "nullable": true,
149
+ "nullableTags": ["app-confirm-dialog"],
150
150
  "keepExpressions": true
151
151
  },
152
152
  {
@@ -161,7 +161,7 @@
161
161
  "info": "Info",
162
162
  "neutral": "Neutral"
163
163
  },
164
- "nullable": true,
164
+ "nullableTags": ["app-context-menu-item", "app-context-menu-submenu", "app-dropdown-item", "app-split-button-item"],
165
165
  "keepExpressions": true
166
166
  },
167
167
  {
@@ -174,7 +174,7 @@
174
174
  "daterange": "DateRange",
175
175
  "text": "Text"
176
176
  },
177
- "nullable": true,
177
+ "nullableTags": ["app-filter-facet"],
178
178
  "keepExpressions": true
179
179
  },
180
180
  {
@@ -189,7 +189,7 @@
189
189
  "fullscreen": "Fullscreen"
190
190
  },
191
191
  "numberAttribute": "size-px",
192
- "nullable": true,
192
+ "nullableTags": ["app-modal", "app-modal-content"],
193
193
  "keepExpressions": true
194
194
  },
195
195
  {
@@ -204,7 +204,7 @@
204
204
  "info": "Info",
205
205
  "neutral": "Neutral"
206
206
  },
207
- "nullable": true,
207
+ "nullableTags": ["app-nav-list-item"],
208
208
  "keepExpressions": true
209
209
  },
210
210
  {
@@ -217,7 +217,7 @@
217
217
  "skipped": "Skipped",
218
218
  "todo": "Todo"
219
219
  },
220
- "nullable": true,
220
+ "nullableTags": ["app-onboarding-step"],
221
221
  "keepExpressions": true
222
222
  },
223
223
  {
@@ -228,7 +228,7 @@
228
228
  "default": "Default",
229
229
  "card": "Card"
230
230
  },
231
- "nullable": true,
231
+ "nullableTags": ["app-radio-group"],
232
232
  "keepExpressions": true
233
233
  },
234
234
  {
@@ -239,7 +239,7 @@
239
239
  "rupees": "Rupees",
240
240
  "paise": "Paise"
241
241
  },
242
- "nullable": true,
242
+ "nullableTags": ["app-rolling-number"],
243
243
  "keepExpressions": true
244
244
  },
245
245
  {
@@ -250,7 +250,7 @@
250
250
  "browser": "Browser",
251
251
  "server": "Server"
252
252
  },
253
- "nullable": true,
253
+ "nullableTags": ["app-saved-views"],
254
254
  "keepExpressions": true
255
255
  },
256
256
  {
@@ -264,7 +264,7 @@
264
264
  "tag": "Tag",
265
265
  "country": "Country"
266
266
  },
267
- "nullable": true,
267
+ "nullableTags": ["app-select"],
268
268
  "keepExpressions": true
269
269
  },
270
270
  {
@@ -275,7 +275,7 @@
275
275
  "comfortable": "Comfortable",
276
276
  "compact": "Compact"
277
277
  },
278
- "nullable": true,
278
+ "nullableTags": ["app-select"],
279
279
  "keepExpressions": true
280
280
  },
281
281
  {
@@ -286,7 +286,7 @@
286
286
  "horizontal": "Horizontal",
287
287
  "vertical": "Vertical"
288
288
  },
289
- "nullable": true,
289
+ "nullableTags": ["app-sortable-list"],
290
290
  "keepExpressions": true
291
291
  },
292
292
  {
@@ -298,7 +298,7 @@
298
298
  "md": "Md"
299
299
  },
300
300
  "numberAttribute": "size-px",
301
- "nullable": true,
301
+ "nullableTags": ["app-spinner"],
302
302
  "keepExpressions": true
303
303
  }
304
304
  ],
@@ -0,0 +1,32 @@
1
+ {
2
+ "version": "0.164.0",
3
+ "css": {
4
+ "rename": [],
5
+ "reads": [],
6
+ "choose": {},
7
+ "checkRole": []
8
+ },
9
+ "classes": [],
10
+ "themeReads": [],
11
+ "props": [],
12
+ "propValues": [],
13
+ "propSplits": [],
14
+ "razorAttributes": [],
15
+ "componentProps": [],
16
+ "valueSplits": [],
17
+ "components": [],
18
+ "razorValueSplits": [],
19
+ "razorTags": [
20
+ {
21
+ "from": "app-check",
22
+ "to": "app-checkbox",
23
+ "addAttributes": {},
24
+ "renameAttributes": {},
25
+ "valueMaps": {},
26
+ "removeAttributes": {}
27
+ }
28
+ ],
29
+ "razorEnumAttributes": [],
30
+ "razorListAttributes": [],
31
+ "csharpEnumArguments": []
32
+ }
@@ -102,8 +102,8 @@ export interface RazorEnumAttributeRule {
102
102
  values: Readonly<Record<string, string>>;
103
103
  /** When given, a positive integer literal in `attribute` moves to this attribute unchanged (`size="640"` becomes `size-px="640"`). */
104
104
  numberAttribute?: string;
105
- /** The property is a nullable enum, where Razor reads the value as C#, so a literal is written as `Enum.Member` instead of the bare member. */
106
- nullable?: boolean;
105
+ /** The tags whose property is a nullable enum, sorted: Razor reads their value as C#, so a literal is written as `Enum.Member` there and as the bare member on every other tag. Omitted when no tag's property is nullable. Kept equal to the tag helper types by razorEnumNullability.test.ts. */
106
+ nullableTags?: readonly string[];
107
107
  /** The property took the enum before this version, so an `@expression` already returns it and is left as written, with no finding. */
108
108
  keepExpressions?: boolean;
109
109
  }