@n3e/styled 1.0.1 → 1.0.2
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 +6 -8
- package/package.json +1 -1
- package/react/cjs/index.d.ts +114 -115
- package/react/cjs/index.js +1 -2
- package/react/cjs/index.js.br +0 -0
- package/react/esm/index.d.ts +114 -115
- package/react/esm/index.js +1 -2
- package/react/esm/index.js.br +0 -0
- package/solid/cjs/index.d.ts +116 -115
- package/solid/cjs/index.js +0 -1
- package/solid/cjs/index.js.br +0 -0
- package/solid/esm/index.d.ts +116 -115
- package/solid/esm/index.js +0 -1
- package/solid/esm/index.js.br +0 -0
package/solid/cjs/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/** @license styled v1.0.0. Copyright (c) N3E. */
|
|
2
1
|
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var e=require('solid-js'),t=require('solid-js/web');const r='undefined'!=typeof window,n=e=>t=>typeof t===e,o=n('function'),s=n('number'),a=n('string'),i=n('object'),l=e=>t=>t===e,c=l(!0),d=l(!1),u=l(null),p=l(void 0),m=e=>i(e)&&!u(e)&&!Array.isArray(e),h=e=>a(e)||s(e),f=e=>u(e)||p(e),{stringify:y}=JSON,g=e=>(...t)=>`${e}-${(e=>(e=>{let t=-2128831035;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=16777619*t>>>0;return t})(y(e,((e,t)=>o(t)?`[Function ${e}]`:t))).toString(36))(t)}`,b=g('e'),v=g('s'),S=g('d'),w=g('c'),$=(...e)=>e.join(''),C=e=>t=>$(t,e),j=e=>t=>$(e,t),O=j('.'),x=(e,t)=>{return t.split('||').flatMap((r=e,e=>r.map(C(e))));var r},k=e=>e.join('||'),R=e=>(...t)=>t.filter(Boolean).join(e),E=R(' '),T=e=>`(${e})`,_=(e,t)=>Object.entries(t).reduce(((t,[r,n])=>({...t,[r]:m(n)&&r in e?_(e[r],n):n})),{...e}),M=e=>e.trim().replace(/([A-Z])+/g,'-$1').toLowerCase(),A=(...e)=>t=>e.some((e=>t.startsWith(e))),L=e=>e.replace(/ {2}|\r\n|\n|\r/gm,'').trim(),P='@media',q=['print','screen'],W=['host','lang','is','not','where','nthChild','nthLastChild','nthLastOfType','nthOfType'],N='all',D='any',I='not',B='only',H='data-styled-sheet',F=(e,t)=>{const n=r?window:global,o=`__STYLED_${e}_REGISTER`;return o in n||Object.defineProperty(n,o,{value:Object.freeze(t())}),n[o]},G=e=>({add:(t,r)=>e.get(t)||e.set(t,{...r(),toString:()=>t}).get(t),get:t=>e.get(t),has:t=>e.has(t),__getDataStore:()=>new Map(e)}),Y=F('CACHE',(()=>G(new Map))),z=F('SHEET',(()=>{const e=new Map,t=([e,t])=>`<style ${H}="${e}">${t.css()}</style>`;return{...G(e),getStyles:()=>[...e].map(t).join('')}})),J=F('PROPS',(()=>({...G(new Map),names:new Set}))),{getStyles:U}=z,V=l('content'),Z=A('@container',P,'@supports'),K=A(':','[',' ','>','~','+','.'),Q=e=>()=>e,X=(e,t)=>{const r=V(e)||s(t)?y:L;return`${M(e)}:${r(t)};`},ee=e=>(t,r)=>r.reduceRight(e,t),te=(e,t)=>`${t}{${e}}`,re=ee(te),ne=ee(((e,t)=>({[t]:{...e}}))),oe=(e,t,r)=>n=>{const o=1===r.length?n[r[0]]:n,s=t(o);return m(s)?ne(s,e):{}},se=(...e)=>{const[t]=e,r=[e.map(O).join('')],n=(e,r,s,a)=>{const i=o(e),l=!J.has(s),c=J.get(s),[d,u]=(p=e,Object.entries(p).reduce((([e,t],[r,n])=>[h(n)?$(e,X(r,n)):e,m(n)||o(n)?{...t,[r]:n}:t]),['',{}]));var p;const f=Z(s)?[...a,s]:a,y=K(s)?x(r,s):r;return Object.entries(u).reduce(((e,[r,o])=>{if(!l)return e;const{computables:s,rules:a}=n(o,y,r,f);return{baseClassName:t,computables:[...e.computables,...s],rules:[...e.rules,...a]}}),{baseClassName:t,computables:l?[]:[{...c,identity:i?w:Q(S(e)),yield:i?oe(a,e,c.keys):Q(e)}],rules:l&&d?[re(te(d,y.join()),f)]:[]})};return e=>n(e,r,'',[])},ae=(e,t=H)=>'undefined'==typeof document?void 0:document.querySelector(`style[${t}=${e}]`)||(e=>{const t=document.createElement(e),r={appendTo:e=>e.appendChild(t)&&r,withAttribute:(e,n)=>t.setAttribute(e,n)||r,unwrap:()=>t};return r})('style').withAttribute(t,e).appendTo(document.head).unwrap(),ie=(e,t)=>(t.textContent||'').includes(e),le=e=>t=>{if(!ie(t,e)){const r=document.createTextNode(t);e.appendChild(r)}},ce=(e,t=e.sheet)=>r=>{try{if(t&&!ie(r,e)){const e=t.cssRules.length;t.insertRule(r,e)}}catch(e){console.error(`DOMException: Failed to parse "${r}"`)}},de=(e,t)=>n=>{const o=Y.has(e),{baseClassName:s,computables:a,globals:i=[],rules:l}=Y.add(e,t);if(!o){const t=()=>((e,t=ae(e))=>{const n=new Map,o=r&&c(window.__STYLED_SLOW_MODE)?le:ce;return{inject:(e,r)=>{n.has(e)||(t&&r.forEach(o(t)),n.set(e,r))},css:()=>[...n.values()].flat().join('')}})(s);z.add(s,t).inject(e,[...l,...i])}return a.length?n(e):[]},ue=e=>{const t=r=>Y.get(r).computables.reduce(((n,o)=>{if(!o.predicate(e))return n;const s=o.yield(e),a=o.identity(s),i=`${a} (${r})`;return[...n,a,...de(i,(()=>se(Y.get(r).baseClassName,a)(s)))(t)]}),[]);return t},pe=(e,t,r=[])=>(n={})=>{const o=b({name:e,...n}),s=s=>((e,t)=>{for(const r in t)Object.defineProperty(e,r,{value:t[r]});return e})(s,{styles:n,toString:()=>O(o),extend:(...o)=>{const s=(a=n,o.reduce(((e,t)=>{const r=t||{},n=r.styles||r;return _(e,n)}),a));var a;return pe(e,t,r)(s)},withCSS:(...r)=>pe(e,t,r)(n)});return s(t?t({classIdentity:o,displayName:`styled.${e}`,styleRules:n,plainStyles:r}):t=>pe(e,me(t),r)(n))},me=r=>({classIdentity:n,styleRules:o,plainStyles:s})=>{const i=((e,t)=>{const r=v(e),n=()=>({...se(r)(e),...t.length&&{globals:t.map(L)}});return e=>[r,...de(r,n)(ue(e))]})(o,s);return o=>{const s=[...a(r)?[...J.names]:[],'class','component'],[,l]=e.splitProps(o,s),c=e.mergeProps({component:r,get class(){return E(n,...i(o),o.class)}},l);return t.Dynamic(c)}},he=['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','dialog','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','label','legend','li','link','main','map','mark','math','menu','meta','meter','nav','noscript','object','ol','optgroup','option','output','p','picture','portal','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','svg','table','tbody','td','textarea','tfoot','th','thead','time','title','tr','track','u','ul','var','video','wbr'].reduce(((e,t)=>({...e,[t]:pe(t,me(t))})),{generic:pe('generic')}),fe=C('px'),ye=[...q,'anyPointer','colorGamut','displayMode','orientation','overflowBlock','pointer','prefersColorScheme','prefersContrast','scripting','update','anyHover','hover','forcedColors','grid','invertedColors','overflowInline','prefersReducedMotion',...((...e)=>t=>t.reduce(((t,r)=>{return[...t,...e.map(C((n=r,n.charAt(0).toUpperCase()+n.slice(1)))),r];var n}),[]))('min','max')(['height','width','aspectRatio','color','colorIndex','monochrome','resolution'])],ge=R(' and '),be=R(', '),ve=e=>t=>!f(e[t])&&!d(e[t]),Se=(e,t)=>{const r={[N]:e=>t.every(ve(e)),[D]:e=>t.some(ve(e)),[I]:e=>t.every((e=>t=>f(e[t]))(e)),[B]:e=>ve(e)(t[0])};return t.forEach((e=>J.names.add(e))),{keys:t,predicate:r[e]}},we=e=>(...t)=>J.add(`props.${e}(${t})`,(()=>Se(e,t))).toString(),$e=e=>(...t)=>k(t.map(e)),Ce={and:(...e)=>k(e.reduce(x,[''])),or:(...e)=>k(e)},je=e=>(t,r)=>[...t,...r].reduce(((t,n)=>{const o=$(e,M(n)),s=r.includes(n);return{...t,[n]:s?(...e)=>$(o,T(e)):o}}),{}),Oe=je('::')(['after','backdrop','before','cue','cueRegion','firstLetter','firstLine','fileSelectorButton','marker','placeholder','selection'],['part','slotted']),xe=je(':')(['active','anyLink','autofill','checked','default','defined','disabled','empty','enabled','first','firstChild','firstOfType','fullscreen','focus','focusVisible','focusWithin','hover','indeterminate','inRange','invalid','lastChild','lastOfType','left','link','modal','onlyChild','onlyOfType','optional','outOfRange','pictureInPicture','placeholderShown','paused','playing','readOnly','readWrite','required','right','root','scope','target','valid','visited'],W),ke=e=>`[${e}]`,Re=e=>{const t=M(e),r=e=>r=>ke($(t,e,y(r)));return{equals:$e(r('=')),contains:$e(r('~=')),containsAny:$e(r('*=')),startsWith:$e(r('^=')),endsWith:$e(r('$=')),toString:()=>ke(t)}},Ee={...Ce,...Oe,...xe,attribute:Re,data:e=>Re(`data-${e}`),selector:$e(j(' ')),prop:we(B),props:{[N]:we(N),[D]:we(D),[I]:we(I)}};exports.default=he,exports.getStyles=U,exports.mq=(...e)=>{const t=new Set(e),r=new Set,n=(e,t)=>r.add(T([M(e),t].filter(h).join(':'))),o={...ye.reduce(((e,r)=>({...e,[r]:q.includes(r)?()=>t.add(r)&&o:e=>n(r,e)&&o})),{}),feature:(e,t)=>n(e,t)&&o,from:e=>o.minWidth(fe(e)),to:e=>o.maxWidth(fe(e)),toString:()=>E(P,ge(be(...t),...r))};return o},exports.style=Ee;
|
package/solid/cjs/index.js.br
CHANGED
|
Binary file
|
package/solid/esm/index.d.ts
CHANGED
|
@@ -363,9 +363,10 @@ interface EnhancedProps<T, P> {
|
|
|
363
363
|
*/
|
|
364
364
|
withCSS(...styles: string[]): EnhancedType<T, P>;
|
|
365
365
|
}
|
|
366
|
-
type
|
|
366
|
+
type AnyRecord = Record<string, any>;
|
|
367
|
+
type StyledComponent<P = UnknownProp> = Component<P & AnyRecord> & EnhancedProps<StyledComponent, P>;
|
|
367
368
|
interface FactoryHOC<P> {
|
|
368
|
-
<K>(C: Component<K>): StyledComponent<P & K>;
|
|
369
|
+
<K>(C: Component<K & AnyRecord>): StyledComponent<P & K>;
|
|
369
370
|
}
|
|
370
371
|
type GenericComponent<P = UnknownProp> = FactoryHOC<P> & EnhancedProps<GenericComponent, P>;
|
|
371
372
|
type ExtendableItem = CSSProperties | GenericComponent | StyledComponent;
|
|
@@ -374,119 +375,119 @@ type ExtendableItem = CSSProperties | GenericComponent | StyledComponent;
|
|
|
374
375
|
* API for creating React styled component(s)
|
|
375
376
|
*/
|
|
376
377
|
declare const styled: {
|
|
377
|
-
generic: <P = UnknownProp>(arg?: CSSProperties
|
|
378
|
-
object: <
|
|
379
|
-
a: <
|
|
380
|
-
abbr: <
|
|
381
|
-
address: <
|
|
382
|
-
area: <
|
|
383
|
-
article: <
|
|
384
|
-
aside: <
|
|
385
|
-
audio: <
|
|
386
|
-
b: <
|
|
387
|
-
base: <
|
|
388
|
-
bdi: <
|
|
389
|
-
bdo: <
|
|
390
|
-
blockquote: <
|
|
391
|
-
body: <
|
|
392
|
-
br: <
|
|
393
|
-
button: <
|
|
394
|
-
canvas: <
|
|
395
|
-
caption: <
|
|
396
|
-
cite: <
|
|
397
|
-
code: <
|
|
398
|
-
col: <
|
|
399
|
-
colgroup: <
|
|
400
|
-
data: <
|
|
401
|
-
datalist: <
|
|
402
|
-
dd: <
|
|
403
|
-
del: <
|
|
404
|
-
details: <
|
|
405
|
-
dfn: <
|
|
406
|
-
dialog: <
|
|
407
|
-
div: <
|
|
408
|
-
dl: <
|
|
409
|
-
dt: <
|
|
410
|
-
em: <
|
|
411
|
-
embed: <
|
|
412
|
-
fieldset: <
|
|
413
|
-
figcaption: <
|
|
414
|
-
figure: <
|
|
415
|
-
footer: <
|
|
416
|
-
form: <
|
|
417
|
-
h1: <
|
|
418
|
-
h2: <
|
|
419
|
-
h3: <
|
|
420
|
-
h4: <
|
|
421
|
-
h5: <
|
|
422
|
-
h6: <
|
|
423
|
-
head: <
|
|
424
|
-
header: <
|
|
425
|
-
hgroup: <
|
|
426
|
-
hr: <
|
|
427
|
-
html: <
|
|
428
|
-
i: <
|
|
429
|
-
iframe: <
|
|
430
|
-
img: <
|
|
431
|
-
input: <
|
|
432
|
-
ins: <
|
|
433
|
-
kbd: <
|
|
434
|
-
label: <
|
|
435
|
-
legend: <
|
|
436
|
-
li: <
|
|
437
|
-
link: <
|
|
438
|
-
main: <
|
|
439
|
-
map: <
|
|
440
|
-
mark: <
|
|
441
|
-
math: <
|
|
442
|
-
menu: <
|
|
443
|
-
meta: <
|
|
444
|
-
meter: <
|
|
445
|
-
nav: <
|
|
446
|
-
noscript: <
|
|
447
|
-
ol: <
|
|
448
|
-
optgroup: <
|
|
449
|
-
option: <
|
|
450
|
-
output: <
|
|
451
|
-
p: <
|
|
452
|
-
picture: <
|
|
453
|
-
portal: <
|
|
454
|
-
pre: <
|
|
455
|
-
progress: <
|
|
456
|
-
q: <
|
|
457
|
-
rp: <
|
|
458
|
-
rt: <
|
|
459
|
-
ruby: <
|
|
460
|
-
s: <
|
|
461
|
-
samp: <
|
|
462
|
-
script: <
|
|
463
|
-
section: <
|
|
464
|
-
select: <
|
|
465
|
-
small: <
|
|
466
|
-
source: <
|
|
467
|
-
span: <
|
|
468
|
-
strong: <
|
|
469
|
-
style: <
|
|
470
|
-
sub: <
|
|
471
|
-
summary: <
|
|
472
|
-
sup: <
|
|
473
|
-
svg: <
|
|
474
|
-
table: <
|
|
475
|
-
tbody: <
|
|
476
|
-
td: <
|
|
477
|
-
textarea: <
|
|
478
|
-
tfoot: <
|
|
479
|
-
th: <
|
|
480
|
-
thead: <
|
|
481
|
-
time: <
|
|
482
|
-
title: <
|
|
483
|
-
tr: <
|
|
484
|
-
track: <
|
|
485
|
-
u: <
|
|
486
|
-
ul: <
|
|
487
|
-
var: <
|
|
488
|
-
video: <
|
|
489
|
-
wbr: <
|
|
378
|
+
generic: <P = UnknownProp>(arg?: CSSProperties) => GenericComponent<P>;
|
|
379
|
+
object: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
380
|
+
a: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
381
|
+
abbr: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
382
|
+
address: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
383
|
+
area: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
384
|
+
article: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
385
|
+
aside: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
386
|
+
audio: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
387
|
+
b: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
388
|
+
base: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
389
|
+
bdi: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
390
|
+
bdo: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
391
|
+
blockquote: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
392
|
+
body: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
393
|
+
br: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
394
|
+
button: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
395
|
+
canvas: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
396
|
+
caption: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
397
|
+
cite: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
398
|
+
code: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
399
|
+
col: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
400
|
+
colgroup: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
401
|
+
data: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
402
|
+
datalist: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
403
|
+
dd: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
404
|
+
del: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
405
|
+
details: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
406
|
+
dfn: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
407
|
+
dialog: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
408
|
+
div: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
409
|
+
dl: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
410
|
+
dt: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
411
|
+
em: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
412
|
+
embed: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
413
|
+
fieldset: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
414
|
+
figcaption: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
415
|
+
figure: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
416
|
+
footer: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
417
|
+
form: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
418
|
+
h1: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
419
|
+
h2: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
420
|
+
h3: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
421
|
+
h4: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
422
|
+
h5: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
423
|
+
h6: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
424
|
+
head: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
425
|
+
header: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
426
|
+
hgroup: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
427
|
+
hr: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
428
|
+
html: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
429
|
+
i: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
430
|
+
iframe: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
431
|
+
img: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
432
|
+
input: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
433
|
+
ins: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
434
|
+
kbd: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
435
|
+
label: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
436
|
+
legend: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
437
|
+
li: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
438
|
+
link: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
439
|
+
main: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
440
|
+
map: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
441
|
+
mark: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
442
|
+
math: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
443
|
+
menu: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
444
|
+
meta: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
445
|
+
meter: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
446
|
+
nav: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
447
|
+
noscript: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
448
|
+
ol: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
449
|
+
optgroup: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
450
|
+
option: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
451
|
+
output: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
452
|
+
p: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
453
|
+
picture: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
454
|
+
portal: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
455
|
+
pre: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
456
|
+
progress: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
457
|
+
q: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
458
|
+
rp: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
459
|
+
rt: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
460
|
+
ruby: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
461
|
+
s: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
462
|
+
samp: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
463
|
+
script: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
464
|
+
section: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
465
|
+
select: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
466
|
+
small: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
467
|
+
source: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
468
|
+
span: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
469
|
+
strong: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
470
|
+
style: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
471
|
+
sub: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
472
|
+
summary: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
473
|
+
sup: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
474
|
+
svg: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
475
|
+
table: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
476
|
+
tbody: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
477
|
+
td: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
478
|
+
textarea: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
479
|
+
tfoot: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
480
|
+
th: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
481
|
+
thead: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
482
|
+
time: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
483
|
+
title: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
484
|
+
tr: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
485
|
+
track: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
486
|
+
u: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
487
|
+
ul: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
488
|
+
var: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
489
|
+
video: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
490
|
+
wbr: <P = UnknownProp>(arg?: CSSProperties) => StyledComponent<P>;
|
|
490
491
|
};
|
|
491
492
|
|
|
492
493
|
declare const mq: (...mediaTypes: MediaTypes[]) => MediaQueryAPI;
|
package/solid/esm/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
/** @license styled v1.0.0. Copyright (c) N3E. */
|
|
2
1
|
import{splitProps as e,mergeProps as t}from'solid-js';import{Dynamic as r}from'solid-js/web';const n='undefined'!=typeof window,o=e=>t=>typeof t===e,s=o('function'),a=o('number'),i=o('string'),l=o('object'),c=e=>t=>t===e,d=c(!0),u=c(!1),p=c(null),m=c(void 0),h=e=>l(e)&&!p(e)&&!Array.isArray(e),f=e=>i(e)||a(e),y=e=>p(e)||m(e),{stringify:g}=JSON,b=e=>(...t)=>`${e}-${(e=>(e=>{let t=-2128831035;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=16777619*t>>>0;return t})(g(e,((e,t)=>s(t)?`[Function ${e}]`:t))).toString(36))(t)}`,v=b('e'),w=b('s'),S=b('d'),$=b('c'),C=(...e)=>e.join(''),j=e=>t=>C(t,e),O=e=>t=>C(e,t),k=O('.'),R=(e,t)=>{return t.split('||').flatMap((r=e,e=>r.map(j(e))));var r},E=e=>e.join('||'),T=e=>(...t)=>t.filter(Boolean).join(e),x=T(' '),A=e=>`(${e})`,M=(e,t)=>Object.entries(t).reduce(((t,[r,n])=>({...t,[r]:h(n)&&r in e?M(e[r],n):n})),{...e}),_=e=>e.trim().replace(/([A-Z])+/g,'-$1').toLowerCase(),L=(...e)=>t=>e.some((e=>t.startsWith(e))),W=e=>e.replace(/ {2}|\r\n|\n|\r/gm,'').trim(),N='@media',I=['print','screen'],P=['host','lang','is','not','where','nthChild','nthLastChild','nthLastOfType','nthOfType'],q='all',D='any',B='not',H='only',F='data-styled-sheet',G=(e,t)=>{const r=n?window:global,o=`__STYLED_${e}_REGISTER`;return o in r||Object.defineProperty(r,o,{value:Object.freeze(t())}),r[o]},Y=e=>({add:(t,r)=>e.get(t)||e.set(t,{...r(),toString:()=>t}).get(t),get:t=>e.get(t),has:t=>e.has(t),__getDataStore:()=>new Map(e)}),z=G('CACHE',(()=>Y(new Map))),J=G('SHEET',(()=>{const e=new Map,t=([e,t])=>`<style ${F}="${e}">${t.css()}</style>`;return{...Y(e),getStyles:()=>[...e].map(t).join('')}})),U=G('PROPS',(()=>({...Y(new Map),names:new Set}))),{getStyles:V}=J,Z=c('content'),K=L('@container',N,'@supports'),Q=L(':','[',' ','>','~','+','.'),X=e=>()=>e,ee=(e,t)=>{const r=Z(e)||a(t)?g:W;return`${_(e)}:${r(t)};`},te=e=>(t,r)=>r.reduceRight(e,t),re=(e,t)=>`${t}{${e}}`,ne=te(re),oe=te(((e,t)=>({[t]:{...e}}))),se=(e,t,r)=>n=>{const o=1===r.length?n[r[0]]:n,s=t(o);return h(s)?oe(s,e):{}},ae=(...e)=>{const[t]=e,r=[e.map(k).join('')],n=(e,r,o,a)=>{const i=s(e),l=!U.has(o),c=U.get(o),[d,u]=(p=e,Object.entries(p).reduce((([e,t],[r,n])=>[f(n)?C(e,ee(r,n)):e,h(n)||s(n)?{...t,[r]:n}:t]),['',{}]));var p;const m=K(o)?[...a,o]:a,y=Q(o)?R(r,o):r;return Object.entries(u).reduce(((e,[r,o])=>{if(!l)return e;const{computables:s,rules:a}=n(o,y,r,m);return{baseClassName:t,computables:[...e.computables,...s],rules:[...e.rules,...a]}}),{baseClassName:t,computables:l?[]:[{...c,identity:i?$:X(S(e)),yield:i?se(a,e,c.keys):X(e)}],rules:l&&d?[ne(re(d,y.join()),m)]:[]})};return e=>n(e,r,'',[])},ie=(e,t=F)=>'undefined'==typeof document?void 0:document.querySelector(`style[${t}=${e}]`)||(e=>{const t=document.createElement(e),r={appendTo:e=>e.appendChild(t)&&r,withAttribute:(e,n)=>t.setAttribute(e,n)||r,unwrap:()=>t};return r})('style').withAttribute(t,e).appendTo(document.head).unwrap(),le=(e,t)=>(t.textContent||'').includes(e),ce=e=>t=>{if(!le(t,e)){const r=document.createTextNode(t);e.appendChild(r)}},de=(e,t=e.sheet)=>r=>{try{if(t&&!le(r,e)){const e=t.cssRules.length;t.insertRule(r,e)}}catch(e){console.error(`DOMException: Failed to parse "${r}"`)}},ue=(e,t)=>r=>{const o=z.has(e),{baseClassName:s,computables:a,globals:i=[],rules:l}=z.add(e,t);if(!o){const t=()=>((e,t=ie(e))=>{const r=new Map,o=n&&d(window.__STYLED_SLOW_MODE)?ce:de;return{inject:(e,n)=>{r.has(e)||(t&&n.forEach(o(t)),r.set(e,n))},css:()=>[...r.values()].flat().join('')}})(s);J.add(s,t).inject(e,[...l,...i])}return a.length?r(e):[]},pe=e=>{const t=r=>z.get(r).computables.reduce(((n,o)=>{if(!o.predicate(e))return n;const s=o.yield(e),a=o.identity(s),i=`${a} (${r})`;return[...n,a,...ue(i,(()=>ae(z.get(r).baseClassName,a)(s)))(t)]}),[]);return t},me=(e,t,r=[])=>(n={})=>{const o=v({name:e,...n}),s=s=>((e,t)=>{for(const r in t)Object.defineProperty(e,r,{value:t[r]});return e})(s,{styles:n,toString:()=>k(o),extend:(...o)=>{const s=(a=n,o.reduce(((e,t)=>{const r=t||{},n=r.styles||r;return M(e,n)}),a));var a;return me(e,t,r)(s)},withCSS:(...r)=>me(e,t,r)(n)});return s(t?t({classIdentity:o,displayName:`styled.${e}`,styleRules:n,plainStyles:r}):t=>me(e,he(t),r)(n))},he=n=>({classIdentity:o,styleRules:s,plainStyles:a})=>{const l=((e,t)=>{const r=w(e),n=()=>({...ae(r)(e),...t.length&&{globals:t.map(W)}});return e=>[r,...ue(r,n)(pe(e))]})(s,a);return s=>{const a=[...i(n)?[...U.names]:[],'class','component'],[,c]=e(s,a),d=t({component:n,get class(){return x(o,...l(s),s.class)}},c);return r(d)}},fe=['a','abbr','address','area','article','aside','audio','b','base','bdi','bdo','blockquote','body','br','button','canvas','caption','cite','code','col','colgroup','data','datalist','dd','del','details','dfn','dialog','div','dl','dt','em','embed','fieldset','figcaption','figure','footer','form','h1','h2','h3','h4','h5','h6','head','header','hgroup','hr','html','i','iframe','img','input','ins','kbd','label','legend','li','link','main','map','mark','math','menu','meta','meter','nav','noscript','object','ol','optgroup','option','output','p','picture','portal','pre','progress','q','rp','rt','ruby','s','samp','script','section','select','small','source','span','strong','style','sub','summary','sup','svg','table','tbody','td','textarea','tfoot','th','thead','time','title','tr','track','u','ul','var','video','wbr'].reduce(((e,t)=>({...e,[t]:me(t,he(t))})),{generic:me('generic')}),ye=j('px'),ge=[...I,'anyPointer','colorGamut','displayMode','orientation','overflowBlock','pointer','prefersColorScheme','prefersContrast','scripting','update','anyHover','hover','forcedColors','grid','invertedColors','overflowInline','prefersReducedMotion',...((...e)=>t=>t.reduce(((t,r)=>{return[...t,...e.map(j((n=r,n.charAt(0).toUpperCase()+n.slice(1)))),r];var n}),[]))('min','max')(['height','width','aspectRatio','color','colorIndex','monochrome','resolution'])],be=T(' and '),ve=T(', '),we=(...e)=>{const t=new Set(e),r=new Set,n=(e,t)=>r.add(A([_(e),t].filter(f).join(':'))),o={...ge.reduce(((e,r)=>({...e,[r]:I.includes(r)?()=>t.add(r)&&o:e=>n(r,e)&&o})),{}),feature:(e,t)=>n(e,t)&&o,from:e=>o.minWidth(ye(e)),to:e=>o.maxWidth(ye(e)),toString:()=>x(N,be(ve(...t),...r))};return o},Se=e=>t=>!y(e[t])&&!u(e[t]),$e=(e,t)=>{const r={[q]:e=>t.every(Se(e)),[D]:e=>t.some(Se(e)),[B]:e=>t.every((e=>t=>y(e[t]))(e)),[H]:e=>Se(e)(t[0])};return t.forEach((e=>U.names.add(e))),{keys:t,predicate:r[e]}},Ce=e=>(...t)=>U.add(`props.${e}(${t})`,(()=>$e(e,t))).toString(),je=e=>(...t)=>E(t.map(e)),Oe={and:(...e)=>E(e.reduce(R,[''])),or:(...e)=>E(e)},ke=e=>(t,r)=>[...t,...r].reduce(((t,n)=>{const o=C(e,_(n)),s=r.includes(n);return{...t,[n]:s?(...e)=>C(o,A(e)):o}}),{}),Re=ke('::')(['after','backdrop','before','cue','cueRegion','firstLetter','firstLine','fileSelectorButton','marker','placeholder','selection'],['part','slotted']),Ee=ke(':')(['active','anyLink','autofill','checked','default','defined','disabled','empty','enabled','first','firstChild','firstOfType','fullscreen','focus','focusVisible','focusWithin','hover','indeterminate','inRange','invalid','lastChild','lastOfType','left','link','modal','onlyChild','onlyOfType','optional','outOfRange','pictureInPicture','placeholderShown','paused','playing','readOnly','readWrite','required','right','root','scope','target','valid','visited'],P),Te=e=>`[${e}]`,xe=e=>{const t=_(e),r=e=>r=>Te(C(t,e,g(r)));return{equals:je(r('=')),contains:je(r('~=')),containsAny:je(r('*=')),startsWith:je(r('^=')),endsWith:je(r('$=')),toString:()=>Te(t)}},Ae={...Oe,...Re,...Ee,attribute:xe,data:e=>xe(`data-${e}`),selector:je(O(' ')),prop:Ce(H),props:{[q]:Ce(q),[D]:Ce(D),[B]:Ce(B)}};export{fe as default,V as getStyles,we as mq,Ae as style};
|
package/solid/esm/index.js.br
CHANGED
|
Binary file
|