@teacss/preset-standard 0.6.7 → 0.6.8

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.
package/README.md CHANGED
@@ -62,10 +62,11 @@ axis needs its own width. To change axes at a breakpoint, set the old width to
62
62
 
63
63
  ## Preflight and themes
64
64
 
65
- Preflight emits low-specificity reset rules and theme variables. Set
66
- `preflight: false` to disable both, or `preflight: "on-demand"` to keep the
67
- reset while limiting variables to referenced keys (including the reset's sans
68
- and monospace families).
65
+ Preflight emits low-specificity reset rules and theme variables. The default,
66
+ `preflight: "on-demand"`, limits variables to referenced keys (including the
67
+ reset's sans and monospace families). Set `preflight: true` to emit every theme
68
+ and `@custom` variable for CSS or inline styles that read them directly, or
69
+ `preflight: false` to disable both.
69
70
 
70
71
  Selecting `@presets "standard"` also normalizes headings, links, lists, media,
71
72
  tables, horizontal rules, code typography, and form-control typography. Headings
@@ -98,7 +99,7 @@ or `section` containers for discoverable content:
98
99
  <section hidden="until-found">Searchable content</section>
99
100
  ```
100
101
 
101
- These rules run in both default and on-demand preflight. With preflight disabled,
102
+ These rules run in both full and on-demand preflight. With preflight disabled,
102
103
  the application supplies its own hiding rules.
103
104
 
104
105
  Native control appearance, focus outlines, disabled state, and disclosure
package/dist/index.d.ts CHANGED
@@ -130,7 +130,7 @@ interface PresetStandardOptions extends PresetOptions {
130
130
  * Unrelated to the `theme.container` sizing scale (`1c…9c`).
131
131
  */
132
132
  containers?: Record<string, string>;
133
- /** Emit the theme/reset preflight. `"on-demand"` emits vars referenced by utilities or the reset itself. @default true */
133
+ /** Emit the theme/reset preflight. `"on-demand"` emits vars referenced by utilities or the reset itself; `true` emits every theme var. @default "on-demand" */
134
134
  preflight?: boolean | "on-demand";
135
135
  /** Namespace for the engine's internal CSS variables. @default "T-" */
136
136
  variablePrefix?: string;
package/dist/index.js CHANGED
@@ -179,4 +179,4 @@ import{$ as e,$i as t,$n as n,$r as r,A as i,Aa as a,Bi as o,Bn as s,Br as c,C a
179
179
  `&&r++;else if(i===`x`||i===`u`){let t=i===`u`&&e[r+1]===`{`,a=r+(t?2:1),o=t?e.indexOf(`}`,a):a+(i===`x`?2:4),s=e.slice(a,o);if(o<a||!t&&o>e.length||!/^[\da-f]+$/i.test(s))return;let c=Number.parseInt(s,16);if(c>1114111)return;n+=String.fromCodePoint(c),r=o-+!t}else n+=Object.hasOwn(U_,i)?U_[i]:i}return n}function K_(e,t){let n=JSON.stringify(e).slice(1,-1);return t!==`"`&&(n=n.replaceAll(t,`\\${t}`)),t==="`"&&(n=n.replaceAll("${","\\${")),n}function q_(e,t){let n=0;for(;e[--t]===`\\`;)n++;return n%2==1}function J_(e,t){if(!e)return t.size===0;if(e.size!==t.size)return!1;for(let[n,r]of t)if(e.get(n)!==r)return!1;return!0}function Y_(e,t,n){return Error(`Duplicated compile class name "${e}". One is "${t}" and the other is "${n}". Please choose different class name or set 'alwaysHash' to 'true'.`)}function X_(e){let t=new Map;for(let n of e){let e=n[0];typeof e==`string`&&!t.has(e)&&t.set(e,n)}return t}function Z_(e,t){let n=0;for(let r of e.keys())t.has(r)||n++;return n}function Q_(e,t){for(let n of e)if(typeof n[0]==`string`&&n[0]===t)return n}function $_(e,t){let n;return t<12?t=>Q_(e,t):t=>(n??=X_(e)).get(t)}function ev(e,t,n,r,i){let a=e.modules.get(n);if(J_(a,r))return!1;let o=Z_(r,e.classes),s=$_(e.config.shortcuts,a?o:o*2);for(let[t,i]of r){let r=e.classes.get(t);if(r){if(r.body!==i&&(!r.shortcut||Array.from(r.owners).some(e=>e!==n)))throw Y_(t,i,r.body);continue}let a=s(t);if(a&&a[1]!==i)throw Y_(t,i,typeof a[1]==`string`?a[1]:`[configured expansion]`)}if(a){for(let t of a.keys()){let r=e.classes.get(t);if(r&&(r.owners.delete(n),!r.owners.size)){if(r.shortcut){let t=e.config.shortcuts.indexOf(r.shortcut);t>=0&&e.config.shortcuts.splice(t,1)}e.classes.delete(t)}}s=$_(e.config.shortcuts,Z_(r,e.classes))}r.size?e.modules.set(n,new Map(r)):e.modules.delete(n);for(let[t,a]of r){let r=e.classes.get(t);if(r){r.owners.add(n);continue}let o=s(t)?void 0:i?[t,a,{layer:i}]:[t,a];o&&e.config.shortcuts.push(o),e.classes.set(t,{body:a,owners:new Set([n]),shortcut:o})}return t.blocked.clear(),t.cache.clear(),!0}function tv(e={}){let{trigger:t=/(["'`])\s*:css-?(?<name>\S+)?:\s((?:\\[\s\S]|(?!\\|\1)[\s\S])*?)\1/g,classPrefix:n=`css-`,hashFn:r=Ti,keepUnknown:i=!0,alwaysHash:a=!1}=e,o=new WeakMap,s=new WeakMap,c=e=>{let t=o.get(e);if(t?.config===e.config)return t;let n={config:e.config,classes:new Map,modules:new Map};return o.set(e,n),n},l=e=>{let t=s.get(e);return t||(t=new Map,s.set(e,t)),t},u=typeof t==`string`,ee=e.trigger===void 0||u,te=u?RegExp(`(["'\`])\\s*${bi(t)}\\s((?:\\\\[\\s\\S]|(?!\\\\|\\1)[\\s\\S])*?)\\1`,`g`):t;return{name:`@teacss/transformer-compile-class`,enforce:`pre`,async transform(t,o,{generator:s,tokens:u,invalidate:ne}){let d=l(s),re={};d.set(o,re);try{let l=new Map;for(let e of t.original.matchAll(te)){let c=e.index;if(ee&&q_(t.original,c))continue;let te=e.length===4&&e.groups?e[3]:e[2];if(e[1]==="`"&&W_(te))continue;let ne=te.includes(`\\`)&&H_(t.original,c,o),d=ne?G_(te,e[1]):te;if(d==null)continue;let re=wi(d.trim()),ie=ki(Si(re)),f=ie.join(` `),ae=[];if(i){let e=await Promise.all(ie.map(async e=>[e,!!await s.parseToken(e)])),t=[],n=[];for(let[r,i]of e)(i?t:n).push(r);ae.push(...n),f=t.join(` `)}if(f){let t;e.groups?.name?(t=e.groups.name,a&&(t+=`-${r(f)}`)):t=r(f);let i=`${n}${t}`,o=l.get(i);if(o!==void 0&&o!==f)throw Y_(i,f,o);l.set(i,f),ae.unshift(i),u&&u.add(i)}let oe=ae.join(` `);t.overwrite(c+1,c+e[0].length-1,ne?K_(oe,e[1]):oe)}if(d.get(o)!==re)return;ev(c(s),s,o,l,e.layer)&&ne()}finally{d.get(o)===re&&d.delete(o)}},onModuleRemoved(t,{generator:n,invalidate:r}){l(n).delete(t),ev(c(n),n,t,new Map,e.layer)&&r()}}}function nv(e){if(Ta(e)==null)return;let t=Di(e),n=`(${t})`;return Mi(n,0)===n.length-1?t:void 0}function rv(e){if(e==null)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57}function iv(e,t){let n=e.indexOf(`*/`,t+2);return n===-1?void 0:n+2}function $(e,t){let n=t,r=!1;for(;n<e.length;){if(p(e[n])){r=!0,n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)break;let t=iv(e,n);if(t==null)return;n=t}return{end:n,whitespace:r}}function av(e,t){let n=e[t];for(let r=t+1;r<e.length;r++){let t=e[r];if(t===n)return r+1;if(t===`
180
180
  `||t===`\r`||t===`\f`)return;if(t!==`\\`)continue;if(e[r+1]===`\r`&&e[r+2]===`
181
181
  `){r+=2;continue}if(e[r+1]===`
182
- `||e[r+1]===`\r`||e[r+1]===`\f`){r++;continue}let i=m(e,r);if(i==null)return;r=i-1}}function ov(e,t,n){let r=t;if(e[r]===`|`){if(e[r+1]===`|`)return;r++}else if(e[r]===`*`){if(r++,e[r]!==`|`||e[r+1]===`|`)return n?r:void 0;r++}else{let t=h(e,r);if(t==null)return;if(r=t,e[r]!==`|`||e[r+1]===`|`||e[r+1]===`=`)return r;r++}return n&&e[r]===`*`?r+1:h(e,r)}function sv(e,t){let n=$(e,t+1);if(n==null)return;let r=n.end,i=ov(e,r,!1);if(i==null||(r=i,n=$(e,r),n==null))return;if(r=n.end,e[r]===`]`)return r+1;if(`~|^$*`.includes(e[r]??``)&&e[r+1]===`=`)r+=2;else if(e[r]===`=`)r++;else return;if(n=$(e,r),n==null)return;if(r=n.end,e[r]===`'`||e[r]===`"`){let t=av(e,r);if(t==null)return;r=t}else{let t=h(e,r);if(t==null)return;r=t}if(n=$(e,r),n==null)return;if(r=n.end,e[r]===`]`)return r+1;let a=h(e,r);if(a!=null&&[`i`,`s`].includes(_(e.slice(r,a)).toLowerCase()))return n=$(e,a),n!=null&&e[n.end]===`]`?n.end+1:void 0}function cv(e){let t;for(let n=0;n<e.length;n++){let r=e[n];if(t!=null){r===`\\`?n=(m(e,n)??n+2)-1:r===t&&(t=void 0);continue}if(r===`'`||r===`"`){t=r;continue}if(r===`\\`){let t=m(e,n);if(t==null)return!0;n=t-1;continue}if(r===`/`&&e[n+1]===`*`){let t=iv(e,n);if(t==null)return!0;n=t-1;continue}if(r===`{`||r===`}`||r===`;`||r===`@`)return!0}return t!=null}function lv(e){let t=0,n;for(let r=0;r<e.length;r++){let i=e[r];if(n!=null){if(i===`\\`){let t=m(e,r);if(t==null)return!1;r=t-1}else i===n&&(n=void 0);continue}if(i===`'`||i===`"`){n=i;continue}if(i===`\\`){let t=m(e,r);if(t==null)return!1;r=t-1;continue}if(i===`/`&&e[r+1]===`*`){let t=iv(e,r);if(t==null)return!1;r=t-1;continue}if(i===`(`){if(t++,t>32)return!1}else if(i===`)`&&(t--,t<0))return!1}return n==null&&t===0}function uv(e){let t=[];for(let n=0;n<e.length;){let r=n;if(e[n]===`'`||e[n]===`"`){let i=av(e,n);if(i==null)return;t.push({start:r,end:i,kind:`delim`,value:e[n]}),n=i;continue}if(p(e[n])||e[n]===`/`&&e[n+1]===`*`){for(;n<e.length;){if(p(e[n])){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)break;let t=iv(e,n);if(t==null)return;n=t}t.push({start:r,end:n,kind:`whitespace`});continue}if(rv(e[n])||(e[n]===`+`||e[n]===`-`)&&rv(e[n+1])){for((e[n]===`+`||e[n]===`-`)&&n++;rv(e[n]);)n++;let i=e.slice(r,n),a=h(e,n);a==null?t.push({start:r,end:n,kind:`number`,value:i}):(t.push({start:r,end:a,kind:`dimension`,number:i,unit:_(e.slice(n,a)).toLowerCase()}),n=a);continue}let i=h(e,n);if(i!=null){t.push({start:r,end:i,kind:`ident`,value:_(e.slice(n,i)).toLowerCase()}),n=i;continue}n++,t.push({start:r,end:n,kind:`delim`,value:e[r]})}return t}function dv(e,t){let n=t;for(;e[n]?.kind===`whitespace`;)n++;return n}function fv(e,t){let n=dv(e,t),r=e[n];if(r?.kind===`number`&&/^[+-]\d+$/.test(r.value))return n+1;if(r?.kind!==`delim`||r.value!==`+`&&r.value!==`-`)return t;n=dv(e,n+1);let i=e[n];return i?.kind===`number`&&/^\d+$/.test(i.value)?n+1:t}function pv(e,t){let n=dv(e,t),r=e[n];return r?.kind===`number`&&/^\d+$/.test(r.value)?n+1:void 0}function mv(e,t,n,r){if(n===`n`||r&&n===`-n`)return fv(e,t);if(/^n-\d+$/.test(n)||r&&/^-n-\d+$/.test(n))return t;if(n===`n-`||r&&n===`-n-`)return pv(e,t)}function hv(e){let t=dv(e,0),n=e[t];if(n==null)return;if(n.kind===`ident`)return n.value===`odd`||n.value===`even`?t+1:mv(e,t+1,n.value,!0);if(n.kind===`dimension`)return/^[+-]?\d+$/.test(n.number)?mv(e,t+1,n.unit,!1):void 0;if(n.kind===`number`)return/^[+-]?\d+$/.test(n.value)?t+1:void 0;if(n.kind!==`delim`||n.value!==`+`)return;let r=e[t+1];return r?.kind===`ident`?mv(e,t+2,r.value,!1):void 0}function gv(e,t,n){if(!lv(t))return!1;let r=uv(t);if(r==null)return!1;let i=hv(r);if(i==null)return!1;let a=dv(r,i);if(a===r.length)return!0;let o=r[a];if(a===i||o?.kind!==`ident`||o.value!==`of`||![`nth`,`nth-last`,`nth-child`,`nth-last-child`].includes(e))return!1;let s=a+1;return a=dv(r,s),a===s||a===r.length?!1:n<=32&&Fv(t.slice(r[a].start),!0,!1,!1,n)}function _v(e,t){return gv(e,t,0)}function vv(e){let t=$(e,0);if(t==null)return;let n=h(e,t.end);if(n==null)return;let r=$(e,n);if(r!=null&&r.end===e.length)return _(e.slice(t.end,n))}function yv(e){let t=Ii(e);return t.length>0&&t.every(e=>{let t=$(e,0);if(t==null)return!1;let n;if(n=e[t.end]===`'`||e[t.end]===`"`?av(e,t.end):h(e,t.end),n==null)return!1;let r=$(e,n);return r!=null&&r.end===e.length})}function bv(e){let t=$(e,0);if(t==null)return!1;let n=t.end,r=0;for(;n<e.length;){let i=h(e,n);if(i==null||(r++,t=$(e,i),t==null)||t.end===i&&t.end!==e.length)return!1;n=t.end}return r>0}function xv(e,t){let n=$(e,0);if(n==null)return!1;let r=Nv(e,n.end,t);if(r==null||r.pseudoElement)return!1;let i=$(e,r.end);return i!=null&&i.end===e.length}function Sv(e,t=!1){if(t){let t=$(e,0);if(t!=null&&e[t.end]===`*`){let n=$(e,t.end+1);return n!=null&&n.end===e.length}}return vv(e)!=null}const Cv=new Set([`default`,`inherit`,`initial`,`revert`,`revert-layer`,`unset`]);function wv(e,t=!1){if(t&&Sv(e,!0)&&vv(e)==null)return!0;let n=vv(e);return n!=null&&!Cv.has(n.toLowerCase())}function Tv(e){let t=Ii(e);return t.length>0&&t.every(e=>wv(e))}const Ev=new Set([`cue`,`cue-region`,`has`,`host`,`nth-child`,`nth-last-child`,`not`,`slotted`]);function Dv(e,t){return e.map(e=>[e,t])}const Ov=new Map([[`not`,(e,t)=>Fv(e,!0,!1,!1,t)],[`has`,(e,t)=>Fv(e,!0,!0,!1,t)],...Dv([`host`,`slotted`],(e,t)=>xv(e,t)),...[`nth-child`,`nth-last-child`,`nth-of-type`,`nth-last-of-type`,`nth-col`,`nth-last-col`].map(e=>[e,(t,n)=>gv(e,t,n)]),[`lang`,e=>yv(e)],[`dir`,e=>kv.has(vv(e)?.toLowerCase()??``)],[`active-view-transition-type`,e=>Tv(e)],[`part`,e=>bv(e)],...Dv([`cue`,`cue-region`],(e,t)=>Fv(e,!1,!1,!0,t)),...Dv([`highlight`,`state`],e=>wv(e)),[`picker`,e=>Sv(e)],...Dv([`view-transition-group`,`view-transition-image-pair`,`view-transition-old`,`view-transition-new`],e=>wv(e,!0))]),kv=new Set([`ltr`,`rtl`]);function Av(e,t,n){let r=e[t+1]===`:`,i=t+(r?2:1);for(;e[i]===`/`&&e[i+1]===`*`;){let t=iv(e,i);if(t==null)return;i=t}let a=h(e,i);if(a==null)return;let o=_(e.slice(i,a)).toLowerCase(),s=r||[`before`,`after`,`first-line`,`first-letter`].includes(o);if(e[a]!==`(`)return{end:a,name:o,pseudoElement:s};let c=Mi(e,a);if(c==null)return;let l=e.slice(a+1,c);if(cv(l))return;let u=n+1;if(u>32&&Ev.has(o))return;let ee=Ov.get(o);if(!ee||ee(l,u))return{end:c+1,name:o,pseudoElement:s}}function jv(e,t){return+(e[t]===`>`||e[t]===`+`||e[t]===`~`)}function Mv(e,t){return e!==`part`&&e!==`slotted`?!1:[`before`,`after`,`marker`,`placeholder`,`file-selector-button`].includes(t)?!0:e===`part`&&(t===`first-line`||t===`first-letter`)}function Nv(e,t,n){let r=t,i=!1,a=!0,o=!1,s;for(;r<e.length;){let t=e[r];if(p(t)||t===`,`||jv(e,r)>0)break;if(t===`/`&&e[r+1]===`*`){let t=iv(e,r);if(t==null)return;r=t;continue}if(t===`.`||t===`#`){if(o)return;let t=h(e,r+1);if(t==null)return;r=t,i=!0,a=!1;continue}if(t===`[`){if(o)return;let t=sv(e,r);if(t==null)return;r=t,i=!0,a=!1;continue}if(t===`:`){let t=Av(e,r,n);if(t==null)return;if(o&&t.pseudoElement){if(!Mv(s,t.name))return;s=void 0}else t.pseudoElement&&(s=t.name===`part`||t.name===`slotted`?t.name:void 0);r=t.end,o||=t.pseudoElement,i=!0,a=!1;continue}if(t===`&`){if(o)return;r++,i=!0,a=!1;continue}if(!a||t===`(`||t===`)`||t===`]`)return;let c=ov(e,r,!0);if(c==null)return;r=c,i=!0,a=!1}return i?{end:r,pseudoElement:o}:void 0}function Pv(e,t,n,r){let i=$(e,0);if(i==null)return!1;let a=i.end;if(t){let t=jv(e,a);if(t>0){if(a+=t,i=$(e,a),i==null)return!1;a=i.end}}for(;a<e.length;){let t=Nv(e,a,r);if(t==null||(a=t.end,i=$(e,a),i==null))return!1;if(a=i.end,a===e.length)return n||!t.pseudoElement;if(t.pseudoElement)return!1;let o=jv(e,a);if(o>0){if(a+=o,i=$(e,a),i==null)return!1;a=i.end}else if(!i.whitespace)return!1}return!1}function Fv(e,t,n,r=!0,i=0){let a=Ii(e);return(t||a.length===1)&&a.length>0&&a.every(e=>Pv(e,n,r,i))}function Iv(e,t=!1){return lv(e)&&Fv(e,t,!1)}function Lv(e){let t=[],n;for(let r=0;r<e.length;r++){let i=e[r];if(n!=null){i===`\\`?r++:i===n&&(n=void 0);continue}if(i===`'`||i===`"`){n=i;continue}if(i===`\\`){r++;continue}if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return;r=t+1;continue}i===`&`&&t.push(r)}return n==null?t:void 0}const Rv=e=>{if(e.kind!==`arbitrary`||!lv(e.value))return;let t=nv(e.value);if(t==null||Ii(t).length!==1)return;let n=Lv(t);if(n==null||n.length>1)return;let r=n.length===0?`&${t}`:t;if(!Iv(r))return;let i=n[0]??0,a=r.slice(0,i),o=r.slice(i+1),s={};return a&&(s.prefix=a),o&&(s.suffix=o),s},zv=new Set([`media`,`supports`,`container`]),Bv=e=>{if(e.kind!==`named`)return;let t=e.value.match(/^([a-z-]+)\((.*)\)$/);if(!t)return;let[,n,r]=t;if(!zv.has(n))return;let i=Ci(r);if(!i.trim())return;let a=`(${i})`;if(Mi(a,0)===a.length-1)return{parent:`@${n} (${i})`}},Vv=new Set([`busy`,`checked`,`disabled`,`expanded`,`grabbed`,`hidden`,`pressed`,`readonly`,`required`,`selected`]);function Hv(e){if(e.startsWith(`"`)&&e.endsWith(`"`))return e;if(e.startsWith(`'`)&&e.endsWith(`'`)){let t=`"`;for(let n=1;n<e.length-1;n++){let r=e[n];if(r===`\\`){let i=e[n+1];i===`'`?(t+=`'`,n++):(t+=r,i!=null&&(t+=i,n++))}else t+=r===`"`?`\\"`:r}return`${t}"`}return`"${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"`}function Uv(e,t){let n=Ni(t,`=`),r=n===-1?t:t.slice(0,n),i=`${e}-${r}`;if(r&&r.trim()===r&&g(i))return n===-1?`[${i}]`:`[${e}-${r}=${Hv(t.slice(n+1))}]`}function Wv(e){for(let t of[`data`,`aria`]){if(!e.startsWith(`${t}-`))continue;let n=e.slice(t.length+1),r=nv(n);return r==null?n.startsWith(`[`)||n.endsWith(`]`)?void 0:t===`aria`?Vv.has(n)?`[aria-${n}="true"]`:void 0:n&&g(`data-${n}`)?`[data-${n}]`:void 0:Uv(t,r)}}const Gv=e=>{if(e.kind!==`named`)return;let t=Wv(e.value);return t==null?void 0:{suffix:t}},Kv=R_,qv={sm:`24rem`,md:`28rem`,lg:`32rem`,xl:`36rem`,"2xl":`42rem`},Jv={"motion-reduce":`@media (prefers-reduced-motion: reduce)`,"motion-safe":`@media (prefers-reduced-motion: no-preference)`,"contrast-more":`@media (prefers-contrast: more)`,"contrast-less":`@media (prefers-contrast: less)`,"forced-colors":`@media (forced-colors: active)`,portrait:`@media (orientation: portrait)`,landscape:`@media (orientation: landscape)`,print:`@media print`,starting:`@starting-style`,"os-dark":`@media (prefers-color-scheme: dark)`,"os-light":`@media (prefers-color-scheme: light)`,"transparency-safe":`@media (prefers-reduced-transparency: no-preference)`,"transparency-reduce":`@media (prefers-reduced-transparency: reduce)`,"hover-hover":`@media (hover: hover)`,"hover-none":`@media (hover: none)`,"any-hover-hover":`@media (any-hover: hover)`,"any-hover-none":`@media (any-hover: none)`,"pointer-coarse":`@media (pointer: coarse)`,"pointer-fine":`@media (pointer: fine)`,"pointer-none":`@media (pointer: none)`,"any-pointer-coarse":`@media (any-pointer: coarse)`,"any-pointer-fine":`@media (any-pointer: fine)`,"any-pointer-none":`@media (any-pointer: none)`,touch:`@media (hover: none) and (pointer: coarse)`,stylus:`@media (hover: none) and (pointer: fine)`,"inverted-colors":`@media (inverted-colors: inverted)`,noscript:`@media (scripting: none)`},Yv={rtl:`[dir="rtl"] `,ltr:`[dir="ltr"] `},Xv={hover:`:hover`,focus:`:focus`,"focus-visible":`:focus-visible`,"focus-within":`:focus-within`,active:`:active`,visited:`:visited`,target:`:target`,checked:`:checked`,disabled:`:disabled`,enabled:`:enabled`,required:`:required`,optional:`:optional`,valid:`:valid`,invalid:`:invalid`,"user-valid":`:user-valid`,"user-invalid":`:user-invalid`,"in-range":`:in-range`,"out-of-range":`:out-of-range`,"read-only":`:read-only`,"read-write":`:read-write`,default:`:default`,indeterminate:`:indeterminate`,"placeholder-shown":`:placeholder-shown`,autofill:`:autofill`,empty:`:empty`,root:`:root`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,"first-of-type":`:first-of-type`,"last-of-type":`:last-of-type`,"only-of-type":`:only-of-type`},Zv={open:`[open]`,inert:`[inert]`},Qv={nth:`:nth-child`,"nth-last":`:nth-last-child`,"nth-of-type":`:nth-of-type`,"nth-last-of-type":`:nth-last-of-type`};function $v(e){return`@media (min-width: ${e})`}function ey(e){return`@media (max-width: ${e})`}const ty=e=>v(e?.theme,`breakpoint`)??Kv,ny=(e,t)=>{if(e.kind!==`named`)return;let n=e.value;if(n.startsWith(`lang-`))return;for(let e of[`min`,`max`]){if(!n.startsWith(`${e}-[`))continue;let t=nv(n.slice(e.length+1));return t!=null&&I(t.trim())?{parent:e===`min`?$v(t):ey(t)}:void 0}let r=ty(t);if(n.startsWith(`max-`)){let e=v(r,n.slice(4));return e&&I(e.trim())?{parent:ey(e)}:void 0}let i=v(r,n);return i&&I(i.trim())?{parent:$v(i)}:void 0},ry=new Set([`none`,`and`,`or`,`not`]);function iy(e,t,n){return`@container ${e?`${e} `:``}(${t}: ${n})`}function ay(e=qv){return t=>{if(t.kind!==`named`||!t.value.startsWith(`container-`))return;let n=t.value.slice(10),r=``,i=Ni(n,`/`);if(i!==-1&&(r=n.slice(i+1),n=n.slice(0,i),T.customIdent(r)==null||ry.has(O(r))))return;for(let e of[`min`,`max`]){if(!n.startsWith(`${e}-[`))continue;let t=nv(n.slice(e.length+1));return t!=null&&I(t.trim())?{parent:iy(r,e===`min`?`min-width`:`max-width`,t)}:void 0}if(n.startsWith(`max-`)){let t=v(e,n.slice(4));return t&&I(t.trim())?{parent:iy(r,`max-width`,t)}:void 0}let a=v(e,n);if(a&&I(a.trim()))return{parent:iy(r,`min-width`,a)}}}const oy=/^(?:[a-z]{2,3}(?:-[a-z]{3}){0,3}|[a-z]{4,8})(?:-[a-z]{4})?(?:-(?:[a-z]{2}|[0-9]{3}))?((?:-(?:[a-z0-9]{5,8}|[0-9][a-z0-9]{3}))*)((?:-[0-9a-wy-z](?:-[a-z0-9]{2,8})+)*)(?:-x(?:-[a-z0-9]{1,8})+)?(?![\s\S])/,sy=/^x(?:-[a-z0-9]{1,8})+(?![\s\S])/,cy=new Set([`en-gb-oed`,`i-ami`,`i-bnn`,`i-default`,`i-enochian`,`i-hak`,`i-klingon`,`i-lux`,`i-mingo`,`i-navajo`,`i-pwn`,`i-tao`,`i-tay`,`i-tsu`,`sgn-be-fr`,`sgn-be-nl`,`sgn-ch-de`]);function ly(e,t=!1){if(!e)return!1;let n=new Set;for(let r of e.slice(1).split(`-`))if(!(t&&r.length!==1)){if(n.has(r))return!0;n.add(r)}return!1}function uy(e){if(cy.has(e)||sy.test(e))return!0;let t=oy.exec(e);return!!t&&!ly(t[1])&&!ly(t[2],!0)}const dy=e=>{if(e.kind!==`named`||!e.value.startsWith(`lang-`))return;let t=e.value.slice(5).replace(/[A-Z]/g,e=>e.toLowerCase());if(!uy(t))return;let n=`:where(html:root)[lang="${t}" i]`;return{suffix:`:is(${n},${n} *)`}};function fy(e={}){return(t,n)=>{if(t.kind!==`named`)return;let r=t.value;if(r===`dark`||r===`light`){let i=n.conditions.filter(e=>e.kind===`named`&&(e.value===`dark`||e.value===`light`));return i.includes(t)&&i[0]!==t?{}:i.some(e=>e.value!==r)?{combinator:`:not(*)`}:{combinator:Io(r,e.modeSelectors)}}let i=v(Jv,r);if(i)return{parent:i};let a=v(Yv,r);if(a)return{prefix:a}}}function py(e){if(!/^@(media|supports|container)\b/.test(e))return;let t=e.indexOf(`(`);if(t===-1){let t=e.match(/^@media\s+(\S+)$/);return t?`@media not ${t[1]}`:void 0}let n=e.slice(0,t),r=e.slice(t);return`${n}not ${/\s(?:and|or)\s/.test(r)?`(${r})`:r}`}function my(e){let t;for(let n=0;n<e.length;n++){let r=e[n];if(r===`\\`){n++;continue}if(t){r===t&&(t=void 0);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`:`&&(e[n+1]===`:`||/^:(?:before|after|first-line|first-letter)(?![\w-])/.test(e.slice(n))))return!0}return!1}function hy(e){return!/^\s|^(?:[>+~]|\|\|)/.test(e)&&!my(e)}function gy(e){return(t,n)=>{if(!t.negate)return e(t,n);let r=e({...t,negate:!1},n);if(r&&!r.parent?.startsWith(`@scope `)&&r.prefix==null&&r.combinator==null&&r.pseudoElement==null){if(r.suffix!=null)return hy(r.suffix)?{...r,suffix:`:not(${r.suffix})`}:void 0;if(r.parent!=null){let e=py(r.parent);return e?{...r,parent:e}:void 0}}}}const _y=e=>{if(e.kind!==`named`)return;let t=v(Xv,e.value);if(t)return{suffix:t};let n=v(Zv,e.value);if(n)return{suffix:n};for(let t of Object.keys(Qv)){if(!e.value.startsWith(`${t}-[`))continue;let n=v(Qv,t),r=e.value.slice(t.length+1);if(!lv(r))return;let i=nv(r);if(n!=null&&i!=null&&_v(t,i))return{suffix:`${n}(${i})`}}};function vy(e){let t=Ii(e);return t.length>0&&t.every(e=>{let t=e.trimStart();return Iv(`:not(${`>+~`.includes(t[0]??``)?t.slice(1):t})`)})}function yy(e){if(e.startsWith(`has-`)){let t=e.slice(4);if(!lv(t))return;let n=nv(t);return n!=null&&vy(n)?`:has(${n})`:void 0}return v(Xv,e)??Wv(e)}const by=e=>{if(e.kind!==`named`)return;let t=e.value;for(let[e,n]of[[`group`,` `],[`peer`,` ~ `]])if(t.startsWith(`${e}-`)){let r=t.slice(e.length+1),i=``,a=Ni(r,`/`);if(a!==-1&&(i=r.slice(a+1),r=r.slice(0,a),!i||/[\t\n\f\r ]/.test(i)||!Ao(i)))return;let o=yy(r);return o==null?void 0:{prefix:`${i?`[data-css-${e}~=${jo(i)}]`:`[data-css-${e}]`}${o}${n}`}}if(t.startsWith(`in-`)){let e=yy(t.slice(3));return e==null?void 0:{prefix:`:where(${e}) `}}};function xy(e={}){return[_y,by,Gv,dy,fy(e),Bv,ay(e.containers),ny,Rv].map(gy)}function Sy(e={}){return _i(xy(e))}function Cy(e){let t=Pi(e,`!`);if(t<0)return!1;let n=e.slice(t+1),r=/^(?:[\t\n\f\r ]|\/\*[\s\S]*?\*\/)*/.exec(n)[0].length,i=h(n,r);return i!=null&&_(n.slice(r,i)).toLowerCase()===`important`&&/^(?:[\t\n\f\r ]|\/\*[\s\S]*?\*\/)*$/.test(n.slice(i))}const wy={name:`important`,order:-10,match(e){if(!e.includes(`!`))return;let t=Oi(e);if(!t.important)return;let n=t.conditions.map(e=>`@${e}`).join(``);return{matcher:`${t.body}${n}`,body:e=>{for(let t of e)t[1]!=null&&!Cy(String(t[1]))&&(t[1]=`${t[1]} !important`);return e}}}};function Ty(e){let t={modeSelectors:e.modeSelectors,containers:{...qv,...e.containers}};return[wy,Sy(t)]}function Ey(e){if(!e.includes(`:$`))return!1;let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(i===`,`)return!0;if(i===`|`||i===`@`||i===`!`||/\s/.test(i))return!1;continue}if(i===`\\`){r++;continue}if(i===`[`){t++;continue}if(i===`]`){t=Math.max(0,t-1);continue}t===0&&i===`:`&&e[r+1]===`$`&&(n=!0,r++)}return!1}const Dy=vi((e={})=>{let t={...e,preflight:e.preflight??!0,variablePrefix:e.variablePrefix??`T-`},n=t.compileClass??!0;return{name:`@teacss/preset-standard`,rules:F_,blocklist:[Ey],theme:z_,variants:Ty(t),preflights:bl(t),postprocess:Yo(t),autocomplete:{shorthands:I_},configResolved(e){Object.defineProperty(e,Symbol.for(`@teacss/preset-standard/physical-palettes`),{value:ul,configurable:!0});let n=Symbol.for(`@teacss/core/config-validators`),r=e,i=[],a,o=e=>{Mo(e.theme),ml(e,t);let n=e.autocomplete.templates;if(n===a)for(let e of i){let t=n.lastIndexOf(e);t>=0&&n.splice(t,1)}i=Wh(e.theme),n.push(...i),a=n};Object.defineProperty(r,n,{value:[...r[n]??[],o],configurable:!0})},...n?{transformers:[tv(typeof n==`object`?n:{})]}:{}}});function Oy(e){return e}export{Dy as default,Dy as presetStandard,Oy as defineConfig,tv as transformerCompileClass};
182
+ `||e[r+1]===`\r`||e[r+1]===`\f`){r++;continue}let i=m(e,r);if(i==null)return;r=i-1}}function ov(e,t,n){let r=t;if(e[r]===`|`){if(e[r+1]===`|`)return;r++}else if(e[r]===`*`){if(r++,e[r]!==`|`||e[r+1]===`|`)return n?r:void 0;r++}else{let t=h(e,r);if(t==null)return;if(r=t,e[r]!==`|`||e[r+1]===`|`||e[r+1]===`=`)return r;r++}return n&&e[r]===`*`?r+1:h(e,r)}function sv(e,t){let n=$(e,t+1);if(n==null)return;let r=n.end,i=ov(e,r,!1);if(i==null||(r=i,n=$(e,r),n==null))return;if(r=n.end,e[r]===`]`)return r+1;if(`~|^$*`.includes(e[r]??``)&&e[r+1]===`=`)r+=2;else if(e[r]===`=`)r++;else return;if(n=$(e,r),n==null)return;if(r=n.end,e[r]===`'`||e[r]===`"`){let t=av(e,r);if(t==null)return;r=t}else{let t=h(e,r);if(t==null)return;r=t}if(n=$(e,r),n==null)return;if(r=n.end,e[r]===`]`)return r+1;let a=h(e,r);if(a!=null&&[`i`,`s`].includes(_(e.slice(r,a)).toLowerCase()))return n=$(e,a),n!=null&&e[n.end]===`]`?n.end+1:void 0}function cv(e){let t;for(let n=0;n<e.length;n++){let r=e[n];if(t!=null){r===`\\`?n=(m(e,n)??n+2)-1:r===t&&(t=void 0);continue}if(r===`'`||r===`"`){t=r;continue}if(r===`\\`){let t=m(e,n);if(t==null)return!0;n=t-1;continue}if(r===`/`&&e[n+1]===`*`){let t=iv(e,n);if(t==null)return!0;n=t-1;continue}if(r===`{`||r===`}`||r===`;`||r===`@`)return!0}return t!=null}function lv(e){let t=0,n;for(let r=0;r<e.length;r++){let i=e[r];if(n!=null){if(i===`\\`){let t=m(e,r);if(t==null)return!1;r=t-1}else i===n&&(n=void 0);continue}if(i===`'`||i===`"`){n=i;continue}if(i===`\\`){let t=m(e,r);if(t==null)return!1;r=t-1;continue}if(i===`/`&&e[r+1]===`*`){let t=iv(e,r);if(t==null)return!1;r=t-1;continue}if(i===`(`){if(t++,t>32)return!1}else if(i===`)`&&(t--,t<0))return!1}return n==null&&t===0}function uv(e){let t=[];for(let n=0;n<e.length;){let r=n;if(e[n]===`'`||e[n]===`"`){let i=av(e,n);if(i==null)return;t.push({start:r,end:i,kind:`delim`,value:e[n]}),n=i;continue}if(p(e[n])||e[n]===`/`&&e[n+1]===`*`){for(;n<e.length;){if(p(e[n])){n++;continue}if(e[n]!==`/`||e[n+1]!==`*`)break;let t=iv(e,n);if(t==null)return;n=t}t.push({start:r,end:n,kind:`whitespace`});continue}if(rv(e[n])||(e[n]===`+`||e[n]===`-`)&&rv(e[n+1])){for((e[n]===`+`||e[n]===`-`)&&n++;rv(e[n]);)n++;let i=e.slice(r,n),a=h(e,n);a==null?t.push({start:r,end:n,kind:`number`,value:i}):(t.push({start:r,end:a,kind:`dimension`,number:i,unit:_(e.slice(n,a)).toLowerCase()}),n=a);continue}let i=h(e,n);if(i!=null){t.push({start:r,end:i,kind:`ident`,value:_(e.slice(n,i)).toLowerCase()}),n=i;continue}n++,t.push({start:r,end:n,kind:`delim`,value:e[r]})}return t}function dv(e,t){let n=t;for(;e[n]?.kind===`whitespace`;)n++;return n}function fv(e,t){let n=dv(e,t),r=e[n];if(r?.kind===`number`&&/^[+-]\d+$/.test(r.value))return n+1;if(r?.kind!==`delim`||r.value!==`+`&&r.value!==`-`)return t;n=dv(e,n+1);let i=e[n];return i?.kind===`number`&&/^\d+$/.test(i.value)?n+1:t}function pv(e,t){let n=dv(e,t),r=e[n];return r?.kind===`number`&&/^\d+$/.test(r.value)?n+1:void 0}function mv(e,t,n,r){if(n===`n`||r&&n===`-n`)return fv(e,t);if(/^n-\d+$/.test(n)||r&&/^-n-\d+$/.test(n))return t;if(n===`n-`||r&&n===`-n-`)return pv(e,t)}function hv(e){let t=dv(e,0),n=e[t];if(n==null)return;if(n.kind===`ident`)return n.value===`odd`||n.value===`even`?t+1:mv(e,t+1,n.value,!0);if(n.kind===`dimension`)return/^[+-]?\d+$/.test(n.number)?mv(e,t+1,n.unit,!1):void 0;if(n.kind===`number`)return/^[+-]?\d+$/.test(n.value)?t+1:void 0;if(n.kind!==`delim`||n.value!==`+`)return;let r=e[t+1];return r?.kind===`ident`?mv(e,t+2,r.value,!1):void 0}function gv(e,t,n){if(!lv(t))return!1;let r=uv(t);if(r==null)return!1;let i=hv(r);if(i==null)return!1;let a=dv(r,i);if(a===r.length)return!0;let o=r[a];if(a===i||o?.kind!==`ident`||o.value!==`of`||![`nth`,`nth-last`,`nth-child`,`nth-last-child`].includes(e))return!1;let s=a+1;return a=dv(r,s),a===s||a===r.length?!1:n<=32&&Fv(t.slice(r[a].start),!0,!1,!1,n)}function _v(e,t){return gv(e,t,0)}function vv(e){let t=$(e,0);if(t==null)return;let n=h(e,t.end);if(n==null)return;let r=$(e,n);if(r!=null&&r.end===e.length)return _(e.slice(t.end,n))}function yv(e){let t=Ii(e);return t.length>0&&t.every(e=>{let t=$(e,0);if(t==null)return!1;let n;if(n=e[t.end]===`'`||e[t.end]===`"`?av(e,t.end):h(e,t.end),n==null)return!1;let r=$(e,n);return r!=null&&r.end===e.length})}function bv(e){let t=$(e,0);if(t==null)return!1;let n=t.end,r=0;for(;n<e.length;){let i=h(e,n);if(i==null||(r++,t=$(e,i),t==null)||t.end===i&&t.end!==e.length)return!1;n=t.end}return r>0}function xv(e,t){let n=$(e,0);if(n==null)return!1;let r=Nv(e,n.end,t);if(r==null||r.pseudoElement)return!1;let i=$(e,r.end);return i!=null&&i.end===e.length}function Sv(e,t=!1){if(t){let t=$(e,0);if(t!=null&&e[t.end]===`*`){let n=$(e,t.end+1);return n!=null&&n.end===e.length}}return vv(e)!=null}const Cv=new Set([`default`,`inherit`,`initial`,`revert`,`revert-layer`,`unset`]);function wv(e,t=!1){if(t&&Sv(e,!0)&&vv(e)==null)return!0;let n=vv(e);return n!=null&&!Cv.has(n.toLowerCase())}function Tv(e){let t=Ii(e);return t.length>0&&t.every(e=>wv(e))}const Ev=new Set([`cue`,`cue-region`,`has`,`host`,`nth-child`,`nth-last-child`,`not`,`slotted`]);function Dv(e,t){return e.map(e=>[e,t])}const Ov=new Map([[`not`,(e,t)=>Fv(e,!0,!1,!1,t)],[`has`,(e,t)=>Fv(e,!0,!0,!1,t)],...Dv([`host`,`slotted`],(e,t)=>xv(e,t)),...[`nth-child`,`nth-last-child`,`nth-of-type`,`nth-last-of-type`,`nth-col`,`nth-last-col`].map(e=>[e,(t,n)=>gv(e,t,n)]),[`lang`,e=>yv(e)],[`dir`,e=>kv.has(vv(e)?.toLowerCase()??``)],[`active-view-transition-type`,e=>Tv(e)],[`part`,e=>bv(e)],...Dv([`cue`,`cue-region`],(e,t)=>Fv(e,!1,!1,!0,t)),...Dv([`highlight`,`state`],e=>wv(e)),[`picker`,e=>Sv(e)],...Dv([`view-transition-group`,`view-transition-image-pair`,`view-transition-old`,`view-transition-new`],e=>wv(e,!0))]),kv=new Set([`ltr`,`rtl`]);function Av(e,t,n){let r=e[t+1]===`:`,i=t+(r?2:1);for(;e[i]===`/`&&e[i+1]===`*`;){let t=iv(e,i);if(t==null)return;i=t}let a=h(e,i);if(a==null)return;let o=_(e.slice(i,a)).toLowerCase(),s=r||[`before`,`after`,`first-line`,`first-letter`].includes(o);if(e[a]!==`(`)return{end:a,name:o,pseudoElement:s};let c=Mi(e,a);if(c==null)return;let l=e.slice(a+1,c);if(cv(l))return;let u=n+1;if(u>32&&Ev.has(o))return;let ee=Ov.get(o);if(!ee||ee(l,u))return{end:c+1,name:o,pseudoElement:s}}function jv(e,t){return+(e[t]===`>`||e[t]===`+`||e[t]===`~`)}function Mv(e,t){return e!==`part`&&e!==`slotted`?!1:[`before`,`after`,`marker`,`placeholder`,`file-selector-button`].includes(t)?!0:e===`part`&&(t===`first-line`||t===`first-letter`)}function Nv(e,t,n){let r=t,i=!1,a=!0,o=!1,s;for(;r<e.length;){let t=e[r];if(p(t)||t===`,`||jv(e,r)>0)break;if(t===`/`&&e[r+1]===`*`){let t=iv(e,r);if(t==null)return;r=t;continue}if(t===`.`||t===`#`){if(o)return;let t=h(e,r+1);if(t==null)return;r=t,i=!0,a=!1;continue}if(t===`[`){if(o)return;let t=sv(e,r);if(t==null)return;r=t,i=!0,a=!1;continue}if(t===`:`){let t=Av(e,r,n);if(t==null)return;if(o&&t.pseudoElement){if(!Mv(s,t.name))return;s=void 0}else t.pseudoElement&&(s=t.name===`part`||t.name===`slotted`?t.name:void 0);r=t.end,o||=t.pseudoElement,i=!0,a=!1;continue}if(t===`&`){if(o)return;r++,i=!0,a=!1;continue}if(!a||t===`(`||t===`)`||t===`]`)return;let c=ov(e,r,!0);if(c==null)return;r=c,i=!0,a=!1}return i?{end:r,pseudoElement:o}:void 0}function Pv(e,t,n,r){let i=$(e,0);if(i==null)return!1;let a=i.end;if(t){let t=jv(e,a);if(t>0){if(a+=t,i=$(e,a),i==null)return!1;a=i.end}}for(;a<e.length;){let t=Nv(e,a,r);if(t==null||(a=t.end,i=$(e,a),i==null))return!1;if(a=i.end,a===e.length)return n||!t.pseudoElement;if(t.pseudoElement)return!1;let o=jv(e,a);if(o>0){if(a+=o,i=$(e,a),i==null)return!1;a=i.end}else if(!i.whitespace)return!1}return!1}function Fv(e,t,n,r=!0,i=0){let a=Ii(e);return(t||a.length===1)&&a.length>0&&a.every(e=>Pv(e,n,r,i))}function Iv(e,t=!1){return lv(e)&&Fv(e,t,!1)}function Lv(e){let t=[],n;for(let r=0;r<e.length;r++){let i=e[r];if(n!=null){i===`\\`?r++:i===n&&(n=void 0);continue}if(i===`'`||i===`"`){n=i;continue}if(i===`\\`){r++;continue}if(i===`/`&&e[r+1]===`*`){let t=e.indexOf(`*/`,r+2);if(t===-1)return;r=t+1;continue}i===`&`&&t.push(r)}return n==null?t:void 0}const Rv=e=>{if(e.kind!==`arbitrary`||!lv(e.value))return;let t=nv(e.value);if(t==null||Ii(t).length!==1)return;let n=Lv(t);if(n==null||n.length>1)return;let r=n.length===0?`&${t}`:t;if(!Iv(r))return;let i=n[0]??0,a=r.slice(0,i),o=r.slice(i+1),s={};return a&&(s.prefix=a),o&&(s.suffix=o),s},zv=new Set([`media`,`supports`,`container`]),Bv=e=>{if(e.kind!==`named`)return;let t=e.value.match(/^([a-z-]+)\((.*)\)$/);if(!t)return;let[,n,r]=t;if(!zv.has(n))return;let i=Ci(r);if(!i.trim())return;let a=`(${i})`;if(Mi(a,0)===a.length-1)return{parent:`@${n} (${i})`}},Vv=new Set([`busy`,`checked`,`disabled`,`expanded`,`grabbed`,`hidden`,`pressed`,`readonly`,`required`,`selected`]);function Hv(e){if(e.startsWith(`"`)&&e.endsWith(`"`))return e;if(e.startsWith(`'`)&&e.endsWith(`'`)){let t=`"`;for(let n=1;n<e.length-1;n++){let r=e[n];if(r===`\\`){let i=e[n+1];i===`'`?(t+=`'`,n++):(t+=r,i!=null&&(t+=i,n++))}else t+=r===`"`?`\\"`:r}return`${t}"`}return`"${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"`}function Uv(e,t){let n=Ni(t,`=`),r=n===-1?t:t.slice(0,n),i=`${e}-${r}`;if(r&&r.trim()===r&&g(i))return n===-1?`[${i}]`:`[${e}-${r}=${Hv(t.slice(n+1))}]`}function Wv(e){for(let t of[`data`,`aria`]){if(!e.startsWith(`${t}-`))continue;let n=e.slice(t.length+1),r=nv(n);return r==null?n.startsWith(`[`)||n.endsWith(`]`)?void 0:t===`aria`?Vv.has(n)?`[aria-${n}="true"]`:void 0:n&&g(`data-${n}`)?`[data-${n}]`:void 0:Uv(t,r)}}const Gv=e=>{if(e.kind!==`named`)return;let t=Wv(e.value);return t==null?void 0:{suffix:t}},Kv=R_,qv={sm:`24rem`,md:`28rem`,lg:`32rem`,xl:`36rem`,"2xl":`42rem`},Jv={"motion-reduce":`@media (prefers-reduced-motion: reduce)`,"motion-safe":`@media (prefers-reduced-motion: no-preference)`,"contrast-more":`@media (prefers-contrast: more)`,"contrast-less":`@media (prefers-contrast: less)`,"forced-colors":`@media (forced-colors: active)`,portrait:`@media (orientation: portrait)`,landscape:`@media (orientation: landscape)`,print:`@media print`,starting:`@starting-style`,"os-dark":`@media (prefers-color-scheme: dark)`,"os-light":`@media (prefers-color-scheme: light)`,"transparency-safe":`@media (prefers-reduced-transparency: no-preference)`,"transparency-reduce":`@media (prefers-reduced-transparency: reduce)`,"hover-hover":`@media (hover: hover)`,"hover-none":`@media (hover: none)`,"any-hover-hover":`@media (any-hover: hover)`,"any-hover-none":`@media (any-hover: none)`,"pointer-coarse":`@media (pointer: coarse)`,"pointer-fine":`@media (pointer: fine)`,"pointer-none":`@media (pointer: none)`,"any-pointer-coarse":`@media (any-pointer: coarse)`,"any-pointer-fine":`@media (any-pointer: fine)`,"any-pointer-none":`@media (any-pointer: none)`,touch:`@media (hover: none) and (pointer: coarse)`,stylus:`@media (hover: none) and (pointer: fine)`,"inverted-colors":`@media (inverted-colors: inverted)`,noscript:`@media (scripting: none)`},Yv={rtl:`[dir="rtl"] `,ltr:`[dir="ltr"] `},Xv={hover:`:hover`,focus:`:focus`,"focus-visible":`:focus-visible`,"focus-within":`:focus-within`,active:`:active`,visited:`:visited`,target:`:target`,checked:`:checked`,disabled:`:disabled`,enabled:`:enabled`,required:`:required`,optional:`:optional`,valid:`:valid`,invalid:`:invalid`,"user-valid":`:user-valid`,"user-invalid":`:user-invalid`,"in-range":`:in-range`,"out-of-range":`:out-of-range`,"read-only":`:read-only`,"read-write":`:read-write`,default:`:default`,indeterminate:`:indeterminate`,"placeholder-shown":`:placeholder-shown`,autofill:`:autofill`,empty:`:empty`,root:`:root`,first:`:first-child`,last:`:last-child`,only:`:only-child`,odd:`:nth-child(odd)`,even:`:nth-child(even)`,"first-of-type":`:first-of-type`,"last-of-type":`:last-of-type`,"only-of-type":`:only-of-type`},Zv={open:`[open]`,inert:`[inert]`},Qv={nth:`:nth-child`,"nth-last":`:nth-last-child`,"nth-of-type":`:nth-of-type`,"nth-last-of-type":`:nth-last-of-type`};function $v(e){return`@media (min-width: ${e})`}function ey(e){return`@media (max-width: ${e})`}const ty=e=>v(e?.theme,`breakpoint`)??Kv,ny=(e,t)=>{if(e.kind!==`named`)return;let n=e.value;if(n.startsWith(`lang-`))return;for(let e of[`min`,`max`]){if(!n.startsWith(`${e}-[`))continue;let t=nv(n.slice(e.length+1));return t!=null&&I(t.trim())?{parent:e===`min`?$v(t):ey(t)}:void 0}let r=ty(t);if(n.startsWith(`max-`)){let e=v(r,n.slice(4));return e&&I(e.trim())?{parent:ey(e)}:void 0}let i=v(r,n);return i&&I(i.trim())?{parent:$v(i)}:void 0},ry=new Set([`none`,`and`,`or`,`not`]);function iy(e,t,n){return`@container ${e?`${e} `:``}(${t}: ${n})`}function ay(e=qv){return t=>{if(t.kind!==`named`||!t.value.startsWith(`container-`))return;let n=t.value.slice(10),r=``,i=Ni(n,`/`);if(i!==-1&&(r=n.slice(i+1),n=n.slice(0,i),T.customIdent(r)==null||ry.has(O(r))))return;for(let e of[`min`,`max`]){if(!n.startsWith(`${e}-[`))continue;let t=nv(n.slice(e.length+1));return t!=null&&I(t.trim())?{parent:iy(r,e===`min`?`min-width`:`max-width`,t)}:void 0}if(n.startsWith(`max-`)){let t=v(e,n.slice(4));return t&&I(t.trim())?{parent:iy(r,`max-width`,t)}:void 0}let a=v(e,n);if(a&&I(a.trim()))return{parent:iy(r,`min-width`,a)}}}const oy=/^(?:[a-z]{2,3}(?:-[a-z]{3}){0,3}|[a-z]{4,8})(?:-[a-z]{4})?(?:-(?:[a-z]{2}|[0-9]{3}))?((?:-(?:[a-z0-9]{5,8}|[0-9][a-z0-9]{3}))*)((?:-[0-9a-wy-z](?:-[a-z0-9]{2,8})+)*)(?:-x(?:-[a-z0-9]{1,8})+)?(?![\s\S])/,sy=/^x(?:-[a-z0-9]{1,8})+(?![\s\S])/,cy=new Set([`en-gb-oed`,`i-ami`,`i-bnn`,`i-default`,`i-enochian`,`i-hak`,`i-klingon`,`i-lux`,`i-mingo`,`i-navajo`,`i-pwn`,`i-tao`,`i-tay`,`i-tsu`,`sgn-be-fr`,`sgn-be-nl`,`sgn-ch-de`]);function ly(e,t=!1){if(!e)return!1;let n=new Set;for(let r of e.slice(1).split(`-`))if(!(t&&r.length!==1)){if(n.has(r))return!0;n.add(r)}return!1}function uy(e){if(cy.has(e)||sy.test(e))return!0;let t=oy.exec(e);return!!t&&!ly(t[1])&&!ly(t[2],!0)}const dy=e=>{if(e.kind!==`named`||!e.value.startsWith(`lang-`))return;let t=e.value.slice(5).replace(/[A-Z]/g,e=>e.toLowerCase());if(!uy(t))return;let n=`:where(html:root)[lang="${t}" i]`;return{suffix:`:is(${n},${n} *)`}};function fy(e={}){return(t,n)=>{if(t.kind!==`named`)return;let r=t.value;if(r===`dark`||r===`light`){let i=n.conditions.filter(e=>e.kind===`named`&&(e.value===`dark`||e.value===`light`));return i.includes(t)&&i[0]!==t?{}:i.some(e=>e.value!==r)?{combinator:`:not(*)`}:{combinator:Io(r,e.modeSelectors)}}let i=v(Jv,r);if(i)return{parent:i};let a=v(Yv,r);if(a)return{prefix:a}}}function py(e){if(!/^@(media|supports|container)\b/.test(e))return;let t=e.indexOf(`(`);if(t===-1){let t=e.match(/^@media\s+(\S+)$/);return t?`@media not ${t[1]}`:void 0}let n=e.slice(0,t),r=e.slice(t);return`${n}not ${/\s(?:and|or)\s/.test(r)?`(${r})`:r}`}function my(e){let t;for(let n=0;n<e.length;n++){let r=e[n];if(r===`\\`){n++;continue}if(t){r===t&&(t=void 0);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`:`&&(e[n+1]===`:`||/^:(?:before|after|first-line|first-letter)(?![\w-])/.test(e.slice(n))))return!0}return!1}function hy(e){return!/^\s|^(?:[>+~]|\|\|)/.test(e)&&!my(e)}function gy(e){return(t,n)=>{if(!t.negate)return e(t,n);let r=e({...t,negate:!1},n);if(r&&!r.parent?.startsWith(`@scope `)&&r.prefix==null&&r.combinator==null&&r.pseudoElement==null){if(r.suffix!=null)return hy(r.suffix)?{...r,suffix:`:not(${r.suffix})`}:void 0;if(r.parent!=null){let e=py(r.parent);return e?{...r,parent:e}:void 0}}}}const _y=e=>{if(e.kind!==`named`)return;let t=v(Xv,e.value);if(t)return{suffix:t};let n=v(Zv,e.value);if(n)return{suffix:n};for(let t of Object.keys(Qv)){if(!e.value.startsWith(`${t}-[`))continue;let n=v(Qv,t),r=e.value.slice(t.length+1);if(!lv(r))return;let i=nv(r);if(n!=null&&i!=null&&_v(t,i))return{suffix:`${n}(${i})`}}};function vy(e){let t=Ii(e);return t.length>0&&t.every(e=>{let t=e.trimStart();return Iv(`:not(${`>+~`.includes(t[0]??``)?t.slice(1):t})`)})}function yy(e){if(e.startsWith(`has-`)){let t=e.slice(4);if(!lv(t))return;let n=nv(t);return n!=null&&vy(n)?`:has(${n})`:void 0}return v(Xv,e)??Wv(e)}const by=e=>{if(e.kind!==`named`)return;let t=e.value;for(let[e,n]of[[`group`,` `],[`peer`,` ~ `]])if(t.startsWith(`${e}-`)){let r=t.slice(e.length+1),i=``,a=Ni(r,`/`);if(a!==-1&&(i=r.slice(a+1),r=r.slice(0,a),!i||/[\t\n\f\r ]/.test(i)||!Ao(i)))return;let o=yy(r);return o==null?void 0:{prefix:`${i?`[data-css-${e}~=${jo(i)}]`:`[data-css-${e}]`}${o}${n}`}}if(t.startsWith(`in-`)){let e=yy(t.slice(3));return e==null?void 0:{prefix:`:where(${e}) `}}};function xy(e={}){return[_y,by,Gv,dy,fy(e),Bv,ay(e.containers),ny,Rv].map(gy)}function Sy(e={}){return _i(xy(e))}function Cy(e){let t=Pi(e,`!`);if(t<0)return!1;let n=e.slice(t+1),r=/^(?:[\t\n\f\r ]|\/\*[\s\S]*?\*\/)*/.exec(n)[0].length,i=h(n,r);return i!=null&&_(n.slice(r,i)).toLowerCase()===`important`&&/^(?:[\t\n\f\r ]|\/\*[\s\S]*?\*\/)*$/.test(n.slice(i))}const wy={name:`important`,order:-10,match(e){if(!e.includes(`!`))return;let t=Oi(e);if(!t.important)return;let n=t.conditions.map(e=>`@${e}`).join(``);return{matcher:`${t.body}${n}`,body:e=>{for(let t of e)t[1]!=null&&!Cy(String(t[1]))&&(t[1]=`${t[1]} !important`);return e}}}};function Ty(e){let t={modeSelectors:e.modeSelectors,containers:{...qv,...e.containers}};return[wy,Sy(t)]}function Ey(e){if(!e.includes(`:$`))return!1;let t=0,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(i===`,`)return!0;if(i===`|`||i===`@`||i===`!`||/\s/.test(i))return!1;continue}if(i===`\\`){r++;continue}if(i===`[`){t++;continue}if(i===`]`){t=Math.max(0,t-1);continue}t===0&&i===`:`&&e[r+1]===`$`&&(n=!0,r++)}return!1}const Dy=vi((e={})=>{let t={...e,preflight:e.preflight??`on-demand`,variablePrefix:e.variablePrefix??`T-`},n=t.compileClass??!0;return{name:`@teacss/preset-standard`,rules:F_,blocklist:[Ey],theme:z_,variants:Ty(t),preflights:bl(t),postprocess:Yo(t),autocomplete:{shorthands:I_},configResolved(e){Object.defineProperty(e,Symbol.for(`@teacss/preset-standard/physical-palettes`),{value:ul,configurable:!0});let n=Symbol.for(`@teacss/core/config-validators`),r=e,i=[],a,o=e=>{Mo(e.theme),ml(e,t);let n=e.autocomplete.templates;if(n===a)for(let e of i){let t=n.lastIndexOf(e);t>=0&&n.splice(t,1)}i=Wh(e.theme),n.push(...i),a=n};Object.defineProperty(r,n,{value:[...r[n]??[],o],configurable:!0})},...n?{transformers:[tv(typeof n==`object`?n:{})]}:{}}});function Oy(e){return e}export{Dy as default,Dy as presetStandard,Oy as defineConfig,tv as transformerCompileClass};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teacss/preset-standard",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "The standard utility vocabulary for TeaCSS — spacing, sizing, color, layout, typography, and more.",
5
5
  "homepage": "https://css.teasim.com",
6
6
  "funding": "https://github.com/sponsors/billgo",
@@ -23,11 +23,11 @@
23
23
  "dev": "tsdown --watch"
24
24
  },
25
25
  "dependencies": {
26
- "@teacss/core": "0.6.7",
27
- "@teacss/rule-helpers": "0.6.7"
26
+ "@teacss/core": "0.6.8",
27
+ "@teacss/rule-helpers": "0.6.8"
28
28
  },
29
29
  "devDependencies": {
30
- "@teacss/classes": "0.6.7",
30
+ "@teacss/classes": "0.6.8",
31
31
  "lightningcss": "^1.33.0",
32
32
  "magic-string": "^1.2.3"
33
33
  },