@react-hive/honey-style 0.0.1
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/contexts/HoneyStyleContext.d.ts +8 -0
- package/dist/contexts/index.d.ts +1 -0
- package/dist/css.d.ts +2 -0
- package/dist/global-style.d.ts +2 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/use-honey-layout.d.ts +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/mount-style.d.ts +12 -0
- package/dist/providers/HoneyStyleProvider.d.ts +8 -0
- package/dist/providers/index.d.ts +1 -0
- package/dist/styled.d.ts +14 -0
- package/dist/types/css.types.d.ts +58 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/types.d.ts +258 -0
- package/dist/utils.d.ts +4 -0
- package/package.json +73 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 React Hive
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# honey-style
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HoneyStyleContext';
|
package/dist/css.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assert(condition: any, message: string): asserts condition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './use-honey-layout';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useHoneyStyle: () => import("../contexts").HoneyStyleContextValue;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(){"use strict";var e={n:function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,{a:t}),t},d:function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{HONEY_BREAKPOINTS:function(){return t},HoneyStyleContext:function(){return l},HoneyStyleProvider:function(){return f},VALID_DOM_ELEMENT_ATTRS:function(){return s},createGlobalStyle:function(){return te},css:function(){return m},styled:function(){return ie},useHoneyStyle:function(){return d}});const t=["xs","sm","md","lg","xl"],r=new Set(["accept","accessKey","alt","aria","as","autoCapitalize","autoComplete","autoFocus","capture","checked","className","contentEditable","contextMenu","controls","crossOrigin","dangerouslySetInnerHTML","data","dir","disabled","download","draggable","form","formAction","formEncType","formMethod","formNoValidate","formTarget","height","hidden","href","hrefLang","id","isMap","inert","key","lang","list","loop","max","maxLength","media","min","minLength","multiple","muted","name","pattern","placeholder","readOnly","required","role","size","slot","spellCheck","src","srcSet","step","style","tabIndex","target","title","translate","type","useMap","value","width","ref","children"]),o=new Set(["colSpan","rowSpan","headers","abbr","scope","align","valign","bgColor","char","charOff"]),a=new Set(["viewBox","fill","stroke","strokeWidth","x","y","cx","cy","d","r","rx","ry","points","transform","xmlns"]),c=new Set(["onCopy","onCut","onPaste","onCompositionEnd","onCompositionStart","onCompositionUpdate","onFocus","onBlur","onChange","onInput","onInvalid","onReset","onSubmit","onKeyDown","onKeyPress","onKeyUp","onClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError"]),s=new Set([...r,...o,...a,...c]);var i=require("react"),u=e.n(i);const l=(0,i.createContext)(void 0),f=({children:e,theme:n})=>{const t=(0,i.useMemo)((()=>({theme:n})),[n]);return u().createElement(l,{value:t},e)},d=()=>{const e=(0,i.useContext)(l);return function(e){if(!e)throw new Error("The `useHoneyStyle()` hook must be used inside <HoneyStyleProvider/> component!")}(e),e},p=(e,n)=>{var t,r;return"function"==typeof e?"$$ComponentId"in e?`.${e.$$ComponentId}`:p(e(n),n):Array.isArray(e)?e.map((e=>p(e,n))).join("\n"):e&&"object"==typeof e?Object.entries(e).filter((([,e])=>void 0!==e&&!1!==e)).map((([e,n])=>{return`${t=e,t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${n};`;var t})).join("\n"):null!==(r=null===(t=null==e?void 0:e.toString)||void 0===t?void 0:t.call(e))&&void 0!==r?r:""},m=(e,...n)=>t=>e.reduce(((e,r,o)=>{const a=n[o];return""===a||!1===a||null==a?e+r:e+r+p(a,t)}),"");var h="comm",y="rule",g="decl",b=Math.abs,v=String.fromCharCode;function O(e){return e.trim()}function S(e,n,t){return e.replace(n,t)}function C(e,n,t){return e.indexOf(n,t)}function E(e,n){return 0|e.charCodeAt(n)}function j(e,n,t){return e.slice(n,t)}function w(e){return e.length}function P(e,n){return n.push(e),e}function M(e,n){for(var t="",r=0;r<e.length;r++)t+=n(e[r],r,e,n)||"";return t}function k(e,n,t,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case"@namespace":case g:return e.return=e.return||e.value;case h:return"";case"@keyframes":return e.return=e.value+"{"+M(e.children,r)+"}";case y:if(!w(e.value=e.props.join(",")))return""}return w(t=M(e.children,r))?e.return=e.value+"{"+t+"}":""}Object.assign;var x=1,$=1,T=0,D=0,L=0,_="";function A(e,n,t,r,o,a,c,s){return{value:e,root:n,parent:t,type:r,props:o,children:a,line:x,column:$,length:c,return:"",siblings:s}}function I(){return L=D>0?E(_,--D):0,$--,10===L&&($=1,x--),L}function N(){return L=D<T?E(_,D++):0,$++,10===L&&($=1,x++),L}function H(){return E(_,D)}function B(){return D}function K(e,n){return j(_,e,n)}function U(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function W(e){return O(K(D-1,V(91===e?e+2:40===e?e+1:e)))}function R(e){for(;(L=H())&&L<33;)N();return U(e)>2||U(L)>3?"":" "}function z(e,n){for(;--n&&N()&&!(L<48||L>102||L>57&&L<65||L>70&&L<97););return K(e,B()+(n<6&&32==H()&&32==N()))}function V(e){for(;N();)switch(L){case e:return D;case 34:case 39:34!==e&&39!==e&&V(L);break;case 40:41===e&&V(e);break;case 92:N()}return D}function q(e,n){for(;N()&&e+L!==57&&(e+L!==84||47!==H()););return"/*"+K(n,D-1)+"*"+v(47===e?e:N())}function F(e){for(;!U(H());)N();return K(e,D)}function G(e){return function(e){return _="",e}(Y("",null,null,null,[""],e=function(e){return x=$=1,T=w(_=e),D=0,[]}(e),0,[0],e))}function Y(e,n,t,r,o,a,c,s,i){for(var u=0,l=0,f=c,d=0,p=0,m=0,h=1,y=1,g=1,O=0,M="",k=o,x=a,$=r,T=M;y;)switch(m=O,O=N()){case 40:if(108!=m&&58==E(T,f-1)){-1!=C(T+=S(W(O),"&","&\f"),"&\f",b(u?s[u-1]:0))&&(g=-1);break}case 34:case 39:case 91:T+=W(O);break;case 9:case 10:case 13:case 32:T+=R(m);break;case 92:T+=z(B()-1,7);continue;case 47:switch(H()){case 42:case 47:P(J(q(N(),B()),n,t,i),i),5!=U(m||1)&&5!=U(H()||1)||!w(T)||" "===j(T,-1,void 0)||(T+=" ");break;default:T+="/"}break;case 123*h:s[u++]=w(T)*g;case 125*h:case 59:case 0:switch(O){case 0:case 125:y=0;case 59+l:-1==g&&(T=S(T,/\f/g,"")),p>0&&(w(T)-f||0===h&&47===m)&&P(p>32?Q(T+";",r,t,f-1,i):Q(S(T," ","")+";",r,t,f-2,i),i);break;case 59:T+=";";default:if(P($=Z(T,n,t,u,l,o,s,M,k=[],x=[],f,a),a),123===O)if(0===l)Y(T,n,$,$,k,a,f,s,x);else{switch(d){case 99:if(110===E(T,3))break;case 108:if(97===E(T,2))break;default:l=0;case 100:case 109:case 115:}l?Y(e,$,$,r&&P(Z(e,$,$,0,0,o,s,M,o,k=[],f,x),x),o,x,f,s,r?k:x):Y(T,$,$,$,[""],x,0,s,x)}}u=l=p=0,h=g=1,M=T="",f=c;break;case 58:f=1+w(T),p=m;default:if(h<1)if(123==O)--h;else if(125==O&&0==h++&&125==I())continue;switch(T+=v(O),O*h){case 38:g=l>0?1:(T+="\f",-1);break;case 44:s[u++]=(w(T)-1)*g,g=1;break;case 64:45===H()&&(T+=W(N())),d=H(),l=f=w(M=T+=F(B())),O++;break;case 45:45===m&&2==w(T)&&(h=0)}}return a}function Z(e,n,t,r,o,a,c,s,i,u,l,f){for(var d=o-1,p=0===o?a:[""],m=function(e){return e.length}(p),h=0,g=0,v=0;h<r;++h)for(var C=0,E=j(e,d+1,d=b(g=c[h])),w=e;C<m;++C)(w=O(g>0?p[C]+" "+E:S(E,/&\f/g,p[C])))&&(i[v++]=w);return A(e,n,t,0===o?y:s,i,u,l,f)}function J(e,n,t,r){return A(e,n,t,h,v(L),j(e,2,-2),0,r)}function Q(e,n,t,r,o){return A(e,n,t,g,j(e,0,r),j(e,r+1,-1),r,o)}const X=e=>`${e}-${Math.random().toString(36).slice(2,8)}`,ee=e=>{let n=5381;for(let t=0;t<e.length;t++)n=33*n^e.charCodeAt(t);return(n>>>0).toString(36)},ne=(e,n)=>M(G(n?`${n}{${e}}`:e),k),te=(e,...n)=>{const t=X("hsg"),r=m(e,...n);return()=>{const{theme:e}=d();return(0,i.useEffect)((()=>{if(document.getElementById(t))return;const n=r({theme:e}),o=document.createElement("style");return o.id=t,o.innerHTML=ne(n),o.setAttribute("data-honey-style","true"),document.head.appendChild(o),()=>{o.remove()}}),[e]),null}},re=new Map;let oe=null;const ae=()=>{const e=(oe||(oe=document.createElement("style"),oe.setAttribute("data-honey-style","true"),document.head.appendChild(oe)),oe),n=Array.from(re.entries()).sort((([,e],[,n])=>e.priority-n.priority)).map((([,e])=>e.css)).join("\n");e.textContent=n},ce=e=>()=>{const n=re.get(e);n&&(n.usages--,n.usages<=0&&(re.delete(e),ae()))},se=(e,n,t=0)=>{const r=re.get(e);return r?(r.usages++,ce(e)):(re.set(e,{css:n,priority:t,usages:1}),ae(),ce(e))};const ie=(e,n)=>(t,...r)=>{const o=X("hsc"),a=m(t,...r),c=t=>{var{as:r,className:c,__chain:u,css:l}=t,f=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(t,["as","className","__chain","css"]);const{theme:p}=d(),h=Object.fromEntries(Object.entries(f).filter((([,e])=>void 0!==e))),y="function"==typeof n?n(Object.assign({theme:p,as:r,className:c},h)):null!=n?n:{},g=Object.assign(Object.assign(Object.assign({},y),h),{theme:p}),b=a(g),v=`hscn-${ee(b)}`,O=ne(b,`.${v}`);(0,i.useInsertionEffect)((()=>se(v,O,u?0:1)),[v]);const S="function"==typeof l?l(g):l,C=S?"string"==typeof S?S:m([""],[S])(g):"",E=C?`hscn-${ee(C)}`:"";(0,i.useInsertionEffect)((()=>{if(E)return se(E,ne(C,`.${E}`),2)}),[E]);const j=Object.assign(Object.assign(Object.assign({},y),h),{className:(w=[o,v,c,E],w.filter(Boolean).join(" ").trim())});var w;const P=r||e;if("string"==typeof e){const e="string"==typeof P?(e=>Object.entries(e).reduce(((e,[n,t])=>((s.has(n)||n.startsWith("data-")||n.startsWith("aria-"))&&(e[n]=t),e)),{}))(j):j;return(0,i.createElement)(P,e)}return(0,i.createElement)(e,Object.assign(Object.assign(Object.assign({},j),r&&{as:r}),{__chain:"true"}))};return c.$$ComponentId=o,c.displayName=`HoneyStyledComponent(${"string"==typeof e?e:e.displayName||e.name||"Component"})`,c};module.exports=n}();
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","mappings":"yBACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CACR,ECNAF,EAAwB,SAASM,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAR,EAAwB,SAASc,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGf,EAAwB,SAASM,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GACvD,G,yTCJO,MAAMC,EAA2C,CAAC,KAAM,KAAM,KAAM,KAAM,MAE3EC,EAAmB,IAAIC,IAAI,CAC/B,SACA,YACA,MACA,OACA,KACA,iBACA,eACA,YACA,UACA,UACA,YACA,kBACA,cACA,WACA,cACA,0BACA,OACA,MACA,WACA,WACA,YACA,OACA,aACA,cACA,aACA,iBACA,aACA,SACA,SACA,OACA,WACA,KACA,QACA,QACA,MACA,OACA,OACA,OACA,MACA,YACA,QACA,MACA,YACA,WACA,QACA,OACA,UACA,cACA,WACA,WACA,OACA,OACA,OACA,aACA,MACA,SACA,OACA,QACA,WACA,SACA,QACA,YACA,OACA,SACA,QACA,QACA,MACA,aAGIC,EAAoB,IAAID,IAAI,CAChC,UACA,UACA,UACA,OACA,QACA,QACA,SACA,UACA,OACA,YAGIE,EAAkB,IAAIF,IAAI,CAC9B,UACA,OACA,SACA,cACA,IACA,IACA,KACA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AGA,OAAO,IAAA/C,eAAc2B,EAAQ,OAAF,sCACtBgB,GACCZ,GAAM,CAAEA,OAAK,CACjBC,QAAS,SACT,EAMJ,OAHAF,EAAgBlJ,cAAgBiJ,EAChCC,EAAgBwB,YAAc,wBAA0C,iBAAX3B,EAAsBA,EAASA,EAAO2B,aAAe3B,EAAO4B,MAAQ,eAE1HzB,CAAe,E","sources":["webpack://@react-hive/honey-style/webpack/bootstrap","webpack://@react-hive/honey-style/webpack/runtime/compat get default export","webpack://@react-hive/honey-style/webpack/runtime/define property getters","webpack://@react-hive/honey-style/webpack/runtime/hasOwnProperty shorthand","webpack://@react-hive/honey-style/webpack/runtime/make namespace object","webpack://@react-hive/honey-style/./src/constants.ts","webpack://@react-hive/honey-style/external commonjs \"react\"","webpack://@react-hive/honey-style/./src/contexts/HoneyStyleContext.ts","webpack://@react-hive/honey-style/./src/providers/HoneyStyleProvider.tsx","webpack://@react-hive/honey-style/./src/hooks/use-honey-layout.ts","webpack://@react-hive/honey-style/./src/helpers.ts","webpack://@react-hive/honey-style/./src/css.ts","webpack://@react-hive/honey-style/./node_modules/stylis/src/Enum.js","webpack://@react-hive/honey-style/./node_modules/stylis/src/Utility.js","webpack://@react-hive/honey-style/./node_modules/stylis/src/Serializer.js","webpack://@react-hive/honey-style/./node_modules/stylis/src/Tokenizer.js","webpack://@react-hive/honey-style/./node_modules/stylis/src/Parser.js","webpack://@react-hive/honey-style/./src/utils.ts","webpack://@react-hive/honey-style/./src/global-style.ts","webpack://@react-hive/honey-style/./src/mount-style.ts","webpack://@react-hive/honey-style/./src/styled.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import type { HoneyBreakpointName } from './types';\n\nexport const HONEY_BREAKPOINTS: HoneyBreakpointName[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst VALID_HTML_ATTRS = new Set([\n 'accept',\n 'accessKey',\n 'alt',\n 'aria',\n 'as',\n 'autoCapitalize',\n 'autoComplete',\n 'autoFocus',\n 'capture',\n 'checked',\n 'className',\n 'contentEditable',\n 'contextMenu',\n 'controls',\n 'crossOrigin',\n 'dangerouslySetInnerHTML',\n 'data',\n 'dir',\n 'disabled',\n 'download',\n 'draggable',\n 'form',\n 'formAction',\n 'formEncType',\n 'formMethod',\n 'formNoValidate',\n 'formTarget',\n 'height',\n 'hidden',\n 'href',\n 'hrefLang',\n 'id',\n 'isMap',\n 'inert',\n 'key',\n 'lang',\n 'list',\n 'loop',\n 'max',\n 'maxLength',\n 'media',\n 'min',\n 'minLength',\n 'multiple',\n 'muted',\n 'name',\n 'pattern',\n 'placeholder',\n 'readOnly',\n 'required',\n 'role',\n 'size',\n 'slot',\n 'spellCheck',\n 'src',\n 'srcSet',\n 'step',\n 'style',\n 'tabIndex',\n 'target',\n 'title',\n 'translate',\n 'type',\n 'useMap',\n 'value',\n 'width',\n 'ref',\n 'children',\n]);\n\nconst VALID_TABLE_ATTRS = new Set([\n 'colSpan',\n 'rowSpan',\n 'headers',\n 'abbr',\n 'scope',\n 'align',\n 'valign',\n 'bgColor',\n 'char',\n 'charOff',\n]);\n\nconst VALID_SVG_ATTRS = new Set([\n 'viewBox',\n 'fill',\n 'stroke',\n 'strokeWidth',\n 'x',\n 'y',\n 'cx',\n 'cy',\n 'd',\n 'r',\n 'rx',\n 'ry',\n 'points',\n 'transform',\n 'xmlns',\n]);\n\nconst VALID_EVENT_ATTRS = new Set([\n // Clipboard\n 'onCopy',\n 'onCut',\n 'onPaste',\n // Composition\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n // Focus\n 'onFocus',\n 'onBlur',\n // Form\n 'onChange',\n 'onInput',\n 'onInvalid',\n 'onReset',\n 'onSubmit',\n // Keyboard\n 'onKeyDown',\n 'onKeyPress',\n 'onKeyUp',\n // Mouse\n 'onClick',\n 'onContextMenu',\n 'onDoubleClick',\n 'onMouseDown',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n // Drag & Drop\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n // Pointer\n 'onPointerDown',\n 'onPointerMove',\n 'onPointerUp',\n 'onPointerCancel',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerOver',\n 'onPointerOut',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n // Selection\n 'onSelect',\n // Touch\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n // UI\n 'onScroll',\n // Wheel\n 'onWheel',\n // Media\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n // Image\n 'onLoad',\n 'onError',\n]);\n\nexport const VALID_DOM_ELEMENT_ATTRS = new Set([\n ...VALID_HTML_ATTRS,\n ...VALID_TABLE_ATTRS,\n ...VALID_SVG_ATTRS,\n ...VALID_EVENT_ATTRS,\n]);\n","var __WEBPACK_NAMESPACE_OBJECT__ = require(\"react\");","import { createContext } from 'react';\n\nimport type { HoneyTheme } from '../types';\n\nexport interface HoneyStyleContextValue {\n /**\n * Represents the theme object.\n */\n theme: HoneyTheme;\n}\n\nexport const HoneyStyleContext = createContext<HoneyStyleContextValue | undefined>(undefined);\n","import React, { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport { HoneyStyleContext } from '../contexts';\nimport type { HoneyTheme } from '../types';\nimport type { HoneyStyleContextValue } from '../contexts';\n\ninterface HoneyStyleProviderProps {\n theme: HoneyTheme;\n}\n\nexport const HoneyStyleProvider = ({\n children,\n theme,\n}: PropsWithChildren<HoneyStyleProviderProps>) => {\n const contextValue = useMemo<HoneyStyleContextValue>(\n () => ({\n theme,\n }),\n [theme],\n );\n\n return <HoneyStyleContext value={contextValue}>{children}</HoneyStyleContext>;\n};\n","import { useContext } from 'react';\n\nimport { HoneyStyleContext } from '../contexts';\nimport { assert } from '../helpers';\n\nexport const useHoneyStyle = () => {\n const context = useContext(HoneyStyleContext);\n assert(\n context,\n 'The `useHoneyStyle()` hook must be used inside <HoneyStyleProvider/> component!',\n );\n\n return context;\n};\n","export function assert(condition: any, message: string): asserts condition {\n if (!condition) {\n throw new Error(message);\n }\n}\n","import type { HoneyStyledInterpolation, HoneyStyledContext } from './types';\n\nconst toKebabCase = (str: string): string =>\n str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n\nconst resolveCssInterpolation = <Props extends object>(\n interpolation: HoneyStyledInterpolation<Props>,\n context: HoneyStyledContext<Props>,\n): string => {\n if (typeof interpolation === 'function') {\n if ('$$ComponentId' in interpolation) {\n return `.${interpolation.$$ComponentId}`;\n }\n\n return resolveCssInterpolation(interpolation(context), context);\n }\n\n if (Array.isArray(interpolation)) {\n return interpolation.map(v => resolveCssInterpolation(v, context)).join('\\n');\n }\n\n if (interpolation && typeof interpolation === 'object') {\n return Object.entries(interpolation)\n .filter(([, v]) => v !== undefined && v !== false)\n .map(([k, v]) => `${toKebabCase(k)}: ${v};`)\n .join('\\n');\n }\n\n return interpolation?.toString?.() ?? '';\n};\n\nexport const css = <Props extends object>(\n strings: TemplateStringsArray,\n ...interpolations: HoneyStyledInterpolation<Props>[]\n) => {\n return (context: HoneyStyledContext<Props>) =>\n strings.reduce((cssResult, str, index) => {\n const interpolation = interpolations[index];\n\n if (\n interpolation === '' ||\n interpolation === false ||\n interpolation === undefined ||\n interpolation === null\n ) {\n return cssResult + str;\n }\n\n return cssResult + str + resolveCssInterpolation(interpolation, context);\n }, '');\n};\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\nexport var SCOPE = '@scope'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @param {number} position\n * @return {number}\n */\nexport function indexof (value, search, position) {\n\treturn value.indexOf(search, position)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n\n/**\n * @param {string[]} array\n * @param {RegExp} pattern\n * @return {string[]}\n */\nexport function filter (array, pattern) {\n\treturn array.filter(function (value) { return !match(value, pattern) })\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES, NAMESPACE} from './Enum.js'\nimport {strlen} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\n\tfor (var i = 0; i < children.length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case NAMESPACE: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: if (!strlen(element.value = element.props.join(','))) return ''\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {object[]} siblings\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length, siblings) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: '', siblings: siblings}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0, root.siblings), root, {length: -root.length}, props)\n}\n\n/**\n * @param {object} root\n */\nexport function lift (root) {\n\twhile (root.root)\n\t\troot = copy(root.root, {children: [root]})\n\n\tappend(root, root.siblings)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, token, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f', abs(index ? points[index - 1] : 0)) != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent, declarations), declarations)\n\t\t\t\t\t\tif ((token(previous || 1) == 5 || token(peek() || 1) == 5) && strlen(characters) && substr(characters, -1, void 0) !== ' ') characters += ' '\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length || (variable === 0 && previous === 47)))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1, declarations) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2, declarations), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length, rulesets), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tswitch (atrule) {\n\t\t\t\t\t\t\t\t\t// c(ontainer)\n\t\t\t\t\t\t\t\t\tcase 99:\n\t\t\t\t\t\t\t\t\t\tif (charat(characters, 3) === 110) break\n\t\t\t\t\t\t\t\t\t// l(ayer)\n\t\t\t\t\t\t\t\t\tcase 108:\n\t\t\t\t\t\t\t\t\t\tif (charat(characters, 2) === 97) break\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\toffset = 0\n\t\t\t\t\t\t\t\t\t// d(ocument) m(edia) s(upports)\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (offset) parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length, children), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\telse parse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length, siblings) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length, siblings)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @param {object[]} siblings\n * @return {object}\n */\nexport function comment (value, root, parent, siblings) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @param {object[]} siblings\n * @return {object}\n */\nexport function declaration (value, root, parent, length, siblings) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length, siblings)\n}\n","import { compile, serialize, stringify } from 'stylis';\n\nexport const generateId = (prefix: string) => `${prefix}-${Math.random().toString(36).slice(2, 8)}`;\n\nexport const hashString = (str: string): string => {\n let hash = 5381;\n\n for (let i = 0; i < str.length; i++) {\n hash = (hash * 33) ^ str.charCodeAt(i);\n }\n\n return (hash >>> 0).toString(36);\n};\n\nexport const makeClassName = (classNames: (string | undefined)[]) =>\n classNames.filter(Boolean).join(' ').trim();\n\nexport const processCss = (rawCss: string, selector?: string): string => {\n const scopedCss = selector ? `${selector}{${rawCss}}` : rawCss;\n\n return serialize(compile(scopedCss), stringify);\n};\n","import { useEffect } from 'react';\n\nimport { css } from './css';\nimport { processCss, generateId } from './utils';\nimport { useHoneyStyle } from './hooks';\nimport type { HoneyStyledInterpolation, HoneyStyledContext } from './types';\n\nexport const createGlobalStyle = (\n strings: TemplateStringsArray,\n ...interpolations: HoneyStyledInterpolation<HoneyStyledContext<object>>[]\n) => {\n const styleId = generateId('hsg');\n\n const computeCss = css(strings, ...interpolations);\n\n const GlobalStyle = () => {\n const { theme } = useHoneyStyle();\n\n useEffect(() => {\n if (document.getElementById(styleId)) {\n return;\n }\n\n const rawCss = computeCss({ theme });\n\n const styleElement = document.createElement('style');\n styleElement.id = styleId;\n styleElement.innerHTML = processCss(rawCss);\n styleElement.setAttribute('data-honey-style', 'true');\n\n document.head.appendChild(styleElement);\n\n return () => {\n styleElement.remove();\n };\n }, [theme]);\n\n return null;\n };\n\n return GlobalStyle;\n};\n","/**\n * Represents an entry in the style registry with the raw CSS string,\n * its usage count, and optional priority for ordering.\n */\ninterface StyleRegistryEntry {\n css: string;\n usages: number;\n priority: number;\n}\n\ntype StyleCleanupFn = () => void;\n\nconst styleRegistry = new Map<string, StyleRegistryEntry>();\n\nlet globalStyleTag: HTMLStyleElement | null = null;\n\n/**\n * Ensures a single <style> tag exists and is attached to <head>.\n *\n * @returns The <style> element.\n */\nconst ensureGlobalStyleTag = (): HTMLStyleElement => {\n if (!globalStyleTag) {\n globalStyleTag = document.createElement('style');\n globalStyleTag.setAttribute('data-honey-style', 'true');\n\n document.head.appendChild(globalStyleTag);\n }\n\n return globalStyleTag;\n};\n\n/**\n * Updates the global <style> tag with all currently active styles, sorted by priority.\n */\nconst updateGlobalStyleContent = () => {\n const styleTag = ensureGlobalStyleTag();\n\n const allCss = Array.from(styleRegistry.entries())\n .sort(([, a], [, b]) => a.priority - b.priority)\n .map(([, entry]) => entry.css)\n .join('\\n');\n\n styleTag.textContent = allCss;\n};\n\n/**\n * Creates a cleanup function for a style, which decrements usage count and removes it if unused.\n *\n * @param className - The key of the style.\n */\nconst createCleanupFunction =\n (className: string): StyleCleanupFn =>\n () => {\n const entry = styleRegistry.get(className);\n if (!entry) {\n return;\n }\n\n entry.usages--;\n\n if (entry.usages <= 0) {\n styleRegistry.delete(className);\n\n updateGlobalStyleContent();\n }\n };\n\n/**\n * Mounts a CSS string under a given class name. Injects into a global <style> tag and manages its lifecycle.\n *\n * @param className - Unique identifier for the style block.\n * @param css - Full CSS rule string (can include multiple rules, media queries, etc.)\n * @param priority - Optional number to determine style ordering (lower = earlier = lower specificity)\n *\n * @returns A cleanup function to unmount the style when it's no longer needed.\n */\nexport const mountStyle = (\n className: string,\n css: string,\n priority: number = 0,\n): StyleCleanupFn => {\n const existing = styleRegistry.get(className);\n\n if (existing) {\n existing.usages++;\n\n return createCleanupFunction(className);\n }\n\n styleRegistry.set(className, {\n css,\n priority,\n usages: 1,\n });\n\n updateGlobalStyleContent();\n\n return createCleanupFunction(className);\n};\n","import { createElement, useInsertionEffect } from 'react';\nimport type { ElementType, ComponentProps, ComponentPropsWithRef } from 'react';\n\nimport { VALID_DOM_ELEMENT_ATTRS } from './constants';\nimport { css } from './css';\nimport { mountStyle } from './mount-style';\nimport { useHoneyStyle } from './hooks';\nimport { processCss, generateId, hashString, makeClassName } from './utils';\nimport type {\n FastOmit,\n Override,\n HoneyHTMLDataAttributes,\n HoneyStyledInterpolation,\n HoneyStyledPropsWithAs,\n HoneyStyledContext,\n} from './types';\n\n/**\n * Filters out non-standard HTML attributes from the props object when rendering a native HTML element.\n *\n * Keeps only valid HTML attributes, including `data-*` and `aria-*` attributes.\n * Useful for preventing React warnings and ensuring proper HTML output.\n *\n * @template Props - The type of the props object\n *\n * @param props - The component props to filter\n *\n * @returns A new props object containing only valid HTML attributes\n */\nconst filterNonHtmlProps = <Props extends object>(props: Props): Props =>\n Object.entries(props).reduce((allowedProps, [propName, propValue]) => {\n if (\n VALID_DOM_ELEMENT_ATTRS.has(propName) ||\n propName.startsWith('data-') ||\n propName.startsWith('aria-')\n ) {\n allowedProps[propName as keyof Props] = propValue;\n }\n return allowedProps;\n }, {} as Props);\n\nexport type HoneyStyledProps<\n Element extends ElementType,\n Props extends object,\n> = HoneyStyledPropsWithAs<\n Element,\n HoneyHTMLDataAttributes & ComponentPropsWithRef<Element> & Props\n>;\n\ntype DefaultPropsResolver<\n Target extends ElementType,\n DefaultProps extends object,\n Props extends object,\n CombinedProps extends object = Override<DefaultProps, Props>,\n> =\n | HoneyStyledPropsWithAs<Target, FastOmit<Partial<CombinedProps>, 'as'>>\n | ((\n props: HoneyStyledContext<HoneyStyledPropsWithAs<Target, CombinedProps>>,\n ) => HoneyStyledPropsWithAs<Target, FastOmit<Partial<CombinedProps>, 'as'>>);\n\nexport const styled = <\n TargetProps extends object,\n Target extends ElementType = ElementType,\n OverrideTarget extends ElementType = Target,\n>(\n target: Target,\n defaultProps?: DefaultPropsResolver<OverrideTarget, ComponentProps<OverrideTarget>, TargetProps>,\n) => {\n return <Props extends object = TargetProps>(\n strings: TemplateStringsArray,\n ...interpolations: HoneyStyledInterpolation<Override<ComponentProps<OverrideTarget>, Props>>[]\n ) => {\n const componentId = generateId('hsc');\n const computeCss = css(strings, ...interpolations);\n\n const StyledComponent = <AsElement extends ElementType = OverrideTarget>({\n as,\n className,\n __chain,\n css: cssProp,\n ...props\n }: HoneyStyledPropsWithAs<\n AsElement,\n Override<ComponentProps<AsElement>, FastOmit<Props, 'as'>>\n > & {\n css?: HoneyStyledInterpolation<Props>;\n className?: string;\n __chain?: string;\n }) => {\n const { theme } = useHoneyStyle();\n\n const cleanedProps = Object.fromEntries(\n Object.entries(props).filter(([, value]) => value !== undefined),\n );\n\n const resolvedDefaultProps: typeof defaultProps =\n typeof defaultProps === 'function'\n ? defaultProps({ theme, as, className, ...cleanedProps } as never)\n : (defaultProps ?? ({} as never));\n\n const context: HoneyStyledContext<any> = {\n ...resolvedDefaultProps,\n ...cleanedProps,\n theme,\n };\n\n const rawCss = computeCss(context);\n const baseClassName = `hscn-${hashString(rawCss)}`;\n\n const baseCss = processCss(rawCss, `.${baseClassName}`);\n\n useInsertionEffect(\n () => mountStyle(baseClassName, baseCss, __chain ? 0 : 1),\n [baseClassName],\n );\n\n const cssPropRaw = typeof cssProp === 'function' ? cssProp(context) : cssProp;\n\n const cssPropString = cssPropRaw\n ? typeof cssPropRaw === 'string'\n ? cssPropRaw\n : // @ts-ignore\n css([''], [cssPropRaw])(context)\n : '';\n\n const cssPropClassName = cssPropString ? `hscn-${hashString(cssPropString)}` : '';\n\n useInsertionEffect(() => {\n if (cssPropClassName) {\n return mountStyle(cssPropClassName, processCss(cssPropString, `.${cssPropClassName}`), 2);\n }\n }, [cssPropClassName]);\n\n const mergedProps = {\n ...resolvedDefaultProps,\n ...cleanedProps,\n className: makeClassName([componentId, baseClassName, className, cssPropClassName]),\n };\n\n const finalComponent = as || target;\n\n if (typeof target === 'string') {\n const filteredProps =\n typeof finalComponent === 'string' ? filterNonHtmlProps(mergedProps) : mergedProps;\n\n return createElement(finalComponent, filteredProps);\n }\n\n // Recreate all elements in the chain\n return createElement(target, {\n ...mergedProps,\n ...(as && { as }),\n __chain: 'true',\n });\n };\n\n StyledComponent.$$ComponentId = componentId;\n StyledComponent.displayName = `HoneyStyledComponent(${typeof target === 'string' ? target : target.displayName || target.name || 'Component'})`;\n\n return StyledComponent;\n };\n};\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","HONEY_BREAKPOINTS","VALID_HTML_ATTRS","Set","VALID_TABLE_ATTRS","VALID_SVG_ATTRS","VALID_EVENT_ATTRS","VALID_DOM_ELEMENT_ATTRS","require","HoneyStyleContext","createContext","undefined","HoneyStyleProvider","children","theme","contextValue","useMemo","useHoneyStyle","context","useContext","condition","Error","assert","resolveCssInterpolation","interpolation","$$ComponentId","Array","isArray","map","v","join","entries","filter","k","str","replace","toLowerCase","toString","css","strings","interpolations","reduce","cssResult","index","COMMENT","RULESET","DECLARATION","abs","Math","String","fromCharCode","trim","pattern","replacement","indexof","search","position","indexOf","charat","charCodeAt","substr","begin","end","slice","strlen","length","array","push","serialize","callback","output","i","stringify","element","type","return","props","assign","line","column","character","characters","node","root","parent","siblings","prev","next","peek","caret","token","delimit","delimiter","whitespace","escaping","count","commenter","identifier","compile","dealloc","parse","alloc","rule","rules","rulesets","pseudo","points","declarations","offset","atrule","property","previous","variable","scanning","ampersand","reference","comment","declaration","ruleset","post","size","sizeof","j","x","y","z","generateId","prefix","random","hashString","hash","processCss","rawCss","selector","createGlobalStyle","styleId","computeCss","useEffect","document","getElementById","styleElement","createElement","id","innerHTML","setAttribute","head","appendChild","remove","styleRegistry","Map","globalStyleTag","updateGlobalStyleContent","styleTag","allCss","from","sort","b","priority","entry","textContent","createCleanupFunction","className","usages","delete","mountStyle","existing","set","styled","target","defaultProps","componentId","StyledComponent","as","__chain","cssProp","cleanedProps","fromEntries","resolvedDefaultProps","baseClassName","baseCss","useInsertionEffect","cssPropRaw","cssPropString","cssPropClassName","mergedProps","classNames","Boolean","finalComponent","filteredProps","allowedProps","propName","propValue","has","startsWith","filterNonHtmlProps","displayName","name"],"sourceRoot":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type StyleCleanupFn = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Mounts a CSS string under a given class name. Injects into a global <style> tag and manages its lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* @param className - Unique identifier for the style block.
|
|
6
|
+
* @param css - Full CSS rule string (can include multiple rules, media queries, etc.)
|
|
7
|
+
* @param priority - Optional number to determine style ordering (lower = earlier = lower specificity)
|
|
8
|
+
*
|
|
9
|
+
* @returns A cleanup function to unmount the style when it's no longer needed.
|
|
10
|
+
*/
|
|
11
|
+
export declare const mountStyle: (className: string, css: string, priority?: number) => StyleCleanupFn;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import type { HoneyTheme } from '../types';
|
|
4
|
+
interface HoneyStyleProviderProps {
|
|
5
|
+
theme: HoneyTheme;
|
|
6
|
+
}
|
|
7
|
+
export declare const HoneyStyleProvider: ({ children, theme, }: PropsWithChildren<HoneyStyleProviderProps>) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HoneyStyleProvider';
|
package/dist/styled.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ElementType, ComponentProps, ComponentPropsWithRef } from 'react';
|
|
2
|
+
import type { FastOmit, Override, HoneyHTMLDataAttributes, HoneyStyledInterpolation, HoneyStyledPropsWithAs, HoneyStyledContext } from './types';
|
|
3
|
+
export type HoneyStyledProps<Element extends ElementType, Props extends object> = HoneyStyledPropsWithAs<Element, HoneyHTMLDataAttributes & ComponentPropsWithRef<Element> & Props>;
|
|
4
|
+
type DefaultPropsResolver<Target extends ElementType, DefaultProps extends object, Props extends object, CombinedProps extends object = Override<DefaultProps, Props>> = HoneyStyledPropsWithAs<Target, FastOmit<Partial<CombinedProps>, 'as'>> | ((props: HoneyStyledContext<HoneyStyledPropsWithAs<Target, CombinedProps>>) => HoneyStyledPropsWithAs<Target, FastOmit<Partial<CombinedProps>, 'as'>>);
|
|
5
|
+
export declare const styled: <TargetProps extends object, Target extends ElementType = ElementType, OverrideTarget extends ElementType = Target>(target: Target, defaultProps?: DefaultPropsResolver<OverrideTarget, ComponentProps<OverrideTarget>, TargetProps>) => <Props extends object = TargetProps>(strings: TemplateStringsArray, ...interpolations: HoneyStyledInterpolation<Override<ComponentProps<OverrideTarget>, Props>>[]) => {
|
|
6
|
+
<AsElement extends ElementType = OverrideTarget>({ as, className, __chain, css: cssProp, ...props }: HoneyStyledPropsWithAs<AsElement, Override<ComponentProps<AsElement>, FastOmit<Props, "as">>> & {
|
|
7
|
+
css?: HoneyStyledInterpolation<Props>;
|
|
8
|
+
className?: string;
|
|
9
|
+
__chain?: string;
|
|
10
|
+
}): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
11
|
+
$$ComponentId: string;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a hexadecimal color value.
|
|
4
|
+
*
|
|
5
|
+
* Examples:
|
|
6
|
+
* - `'#ffffff'`
|
|
7
|
+
* - `'#123abc'`
|
|
8
|
+
* - `'#000'`
|
|
9
|
+
*/
|
|
10
|
+
export type HoneyHEXColor = `#${string}`;
|
|
11
|
+
/**
|
|
12
|
+
* Represents any valid CSS color, either a named color (like `'red'`, `'blue'`)
|
|
13
|
+
* or a hexadecimal color code (like `'#ff0000'`).
|
|
14
|
+
*/
|
|
15
|
+
export type HoneyCSSColor = CSS.DataType.NamedColor | HoneyHEXColor;
|
|
16
|
+
/**
|
|
17
|
+
* Represents absolute CSS dimension units.
|
|
18
|
+
*
|
|
19
|
+
* These units are fixed in physical measurements.
|
|
20
|
+
*
|
|
21
|
+
* - `'px'` — pixels
|
|
22
|
+
* - `'cm'` — centimeters
|
|
23
|
+
* - `'mm'` — millimeters
|
|
24
|
+
* - `'in'` — inches
|
|
25
|
+
* - `'pt'` — points
|
|
26
|
+
* - `'pc'` — picas
|
|
27
|
+
*/
|
|
28
|
+
type HoneyCSSAbsoluteDimensionUnit = 'px' | 'cm' | 'mm' | 'in' | 'pt' | 'pc';
|
|
29
|
+
/**
|
|
30
|
+
* Represents relative CSS dimension units.
|
|
31
|
+
*
|
|
32
|
+
* These units scale depending on the context.
|
|
33
|
+
*
|
|
34
|
+
* - `'em'` — relative to the font-size of the element
|
|
35
|
+
* - `'rem'` — relative to the font-size of the root element
|
|
36
|
+
* - `'%'` — percentage of the parent element
|
|
37
|
+
* - `'vh'` — 1% of the viewport height
|
|
38
|
+
* - `'vw'` — 1% of the viewport width
|
|
39
|
+
* - `'vmin'` — 1% of the smaller dimension of the viewport
|
|
40
|
+
* - `'vmax'` — 1% of the larger dimension of the viewport
|
|
41
|
+
*/
|
|
42
|
+
type HoneyCSSRelativeDimensionUnit = 'em' | 'rem' | '%' | 'vh' | 'vw' | 'vmin' | 'vmax';
|
|
43
|
+
/**
|
|
44
|
+
* Represents any valid CSS dimension unit, including both absolute and relative types.
|
|
45
|
+
*/
|
|
46
|
+
export type HoneyCSSDimensionUnit = HoneyCSSAbsoluteDimensionUnit | HoneyCSSRelativeDimensionUnit;
|
|
47
|
+
/**
|
|
48
|
+
* Represents a numeric CSS dimension value with an optional specific unit.
|
|
49
|
+
*
|
|
50
|
+
* This type can represent:
|
|
51
|
+
* - A value with a specific CSS unit, such as `'8px'`, `'1.5rem'`, or `'100%'`.
|
|
52
|
+
* - A number without a unit, such as `'16'` (representing a unitless value).
|
|
53
|
+
* - The special value `'auto'` commonly used for flexible layout values.
|
|
54
|
+
*
|
|
55
|
+
* @template Unit - The CSS unit to use (e.g., `'px'`, `'em'`, `'rem'`).
|
|
56
|
+
*/
|
|
57
|
+
export type HoneyCSSDimensionValue<Unit extends HoneyCSSDimensionUnit = HoneyCSSDimensionUnit> = `${number}${Unit}` | `${number}` | 'auto';
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import * as CSS from 'csstype';
|
|
2
|
+
import type { ElementType } from 'react';
|
|
3
|
+
import type { HoneyCSSColor, HoneyCSSDimensionValue } from './css.types';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a new type by omitting the specified keys `U` from the object type `T`.
|
|
6
|
+
*
|
|
7
|
+
* This is a faster and simpler alternative to TypeScript's built-in `Omit<T, U>`
|
|
8
|
+
* when you don't need support for more complex scenarios like union distributions.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* type User = {
|
|
13
|
+
* id: number;
|
|
14
|
+
* name: string;
|
|
15
|
+
* password: string;
|
|
16
|
+
* };
|
|
17
|
+
*
|
|
18
|
+
* type PublicUser = FastOmit<User, 'password'>;
|
|
19
|
+
* // Result: { id: number; name: string }
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @template T - The original object type.
|
|
23
|
+
* @template U - The keys to remove from `T`.
|
|
24
|
+
*/
|
|
25
|
+
export type FastOmit<T extends object, U extends string | number | symbol> = {
|
|
26
|
+
[K in keyof T as K extends U ? never : K]: T[K];
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new object type by replacing properties in `A` with properties from `B`
|
|
30
|
+
* where the keys overlap.
|
|
31
|
+
*
|
|
32
|
+
* This is useful for modifying existing types—for example, changing the type of a specific field
|
|
33
|
+
* without redefining the entire structure.
|
|
34
|
+
*
|
|
35
|
+
* Internally, it removes keys from `A` that exist in `B`, then merges in `B`.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* type Original = {
|
|
40
|
+
* id: number;
|
|
41
|
+
* name: string;
|
|
42
|
+
* };
|
|
43
|
+
*
|
|
44
|
+
* type Replacements = {
|
|
45
|
+
* name: boolean;
|
|
46
|
+
* };
|
|
47
|
+
*
|
|
48
|
+
* type Modified = Override<Original, Replacements>;
|
|
49
|
+
* // Result: { id: number; name: boolean }
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @template A - The base object type.
|
|
53
|
+
* @template B - The object type with properties to override in `A`.
|
|
54
|
+
*/
|
|
55
|
+
export type Override<A extends object, B extends object> = FastOmit<A, keyof B> & B;
|
|
56
|
+
export type HoneyHTMLDataAttributes = {
|
|
57
|
+
[key: `data-${string}`]: string | number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Defines different spacing sizes available in the theme.
|
|
61
|
+
*/
|
|
62
|
+
export interface HoneySpacings {
|
|
63
|
+
/**
|
|
64
|
+
* The base spacing value in pixels.
|
|
65
|
+
*/
|
|
66
|
+
base: number;
|
|
67
|
+
small?: number;
|
|
68
|
+
medium?: number;
|
|
69
|
+
large?: number;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Represents the breakpoints configuration in pixes for a responsive layout.
|
|
73
|
+
*
|
|
74
|
+
* Notes:
|
|
75
|
+
* - `xs`: Extra small devices
|
|
76
|
+
* - `sm`: Small devices
|
|
77
|
+
* - `md`: Medium devices
|
|
78
|
+
* - `lg`: Large devices
|
|
79
|
+
* - `xl`: Extra large devices
|
|
80
|
+
*/
|
|
81
|
+
export interface HoneyBreakpoints {
|
|
82
|
+
xs: number;
|
|
83
|
+
sm: number;
|
|
84
|
+
md: number;
|
|
85
|
+
lg: number;
|
|
86
|
+
xl: number;
|
|
87
|
+
}
|
|
88
|
+
export type HoneyBreakpointName = keyof HoneyBreakpoints;
|
|
89
|
+
export interface HoneyFont {
|
|
90
|
+
size: number;
|
|
91
|
+
family?: string;
|
|
92
|
+
weight?: number;
|
|
93
|
+
lineHeight?: number;
|
|
94
|
+
letterSpacing?: number;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Example of augmenting the fonts interface.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* declare module '@react-hive/honey-layout' {
|
|
102
|
+
* export interface HoneyFonts {
|
|
103
|
+
* body: HoneyFont;
|
|
104
|
+
* caption: HoneyFont;
|
|
105
|
+
* }
|
|
106
|
+
* }
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
export interface HoneyFonts {
|
|
110
|
+
[key: string]: HoneyFont;
|
|
111
|
+
}
|
|
112
|
+
export type HoneyFontName = keyof HoneyFonts;
|
|
113
|
+
/**
|
|
114
|
+
* Defines the color palette used in the theme.
|
|
115
|
+
*/
|
|
116
|
+
interface BaseHoneyColors {
|
|
117
|
+
/**
|
|
118
|
+
* Used for elements that require high visibility and emphasis, such as primary buttons, call-to-action elements,
|
|
119
|
+
* and important elements like headers or titles.
|
|
120
|
+
*/
|
|
121
|
+
primary: Record<string, HoneyCSSColor>;
|
|
122
|
+
/**
|
|
123
|
+
* Used to complement the primary color and add visual interest.
|
|
124
|
+
* Often used for secondary buttons, borders, and decorative elements to provide contrast and balance within the design.
|
|
125
|
+
* Helps create a cohesive visual hierarchy by providing variation in color tones.
|
|
126
|
+
*/
|
|
127
|
+
secondary: Record<string, HoneyCSSColor>;
|
|
128
|
+
/**
|
|
129
|
+
* Used to draw attention to specific elements or interactions.
|
|
130
|
+
* Often applied to interactive elements like links, icons, or tooltips to indicate their interactive nature.
|
|
131
|
+
* Can be used sparingly to highlight important information or to create visual focal points.
|
|
132
|
+
*/
|
|
133
|
+
accent: Record<string, HoneyCSSColor>;
|
|
134
|
+
/**
|
|
135
|
+
* Used for backgrounds, text, and other elements where a subtle, non-distracting color is desired.
|
|
136
|
+
* Provides a versatile palette for elements like backgrounds, borders, text, and icons, allowing other colors to stand
|
|
137
|
+
* out more prominently. Helps maintain balance and readability without overwhelming the user with too much color.
|
|
138
|
+
*/
|
|
139
|
+
neutral: Record<string, HoneyCSSColor>;
|
|
140
|
+
/**
|
|
141
|
+
* Used to indicate successful or positive actions or states.
|
|
142
|
+
* Often applied to elements like success messages, notifications, or icons to convey successful completion of tasks or operations.
|
|
143
|
+
* Provides visual feedback to users to indicate that their actions were successful.
|
|
144
|
+
*/
|
|
145
|
+
success: Record<string, HoneyCSSColor>;
|
|
146
|
+
/**
|
|
147
|
+
* Used to indicate cautionary or potentially risky situations.
|
|
148
|
+
* Applied to elements like warning messages, alerts, or icons to notify users about potential issues or actions that require attention.
|
|
149
|
+
* Helps users recognize and address potential problems or risks before they escalate.
|
|
150
|
+
*/
|
|
151
|
+
warning: Record<string, HoneyCSSColor>;
|
|
152
|
+
/**
|
|
153
|
+
* Used to indicate errors, critical issues, or potentially destructive actions.
|
|
154
|
+
* Applied to elements like error messages, validation indicators, form fields, or delete buttons to alert users about incorrect input,
|
|
155
|
+
* system errors, or actions that may have irreversible consequences. Provides visual feedback to prompt users to
|
|
156
|
+
* take corrective actions or seek assistance when encountering errors or potentially risky actions.
|
|
157
|
+
*/
|
|
158
|
+
error: Record<string, HoneyCSSColor>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Example of augmenting the colors interface.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* declare module '@react-hive/honey-layout' {
|
|
166
|
+
* export interface HoneyColors {
|
|
167
|
+
* neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
|
|
168
|
+
* }
|
|
169
|
+
* }
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export interface HoneyColors extends BaseHoneyColors {
|
|
173
|
+
}
|
|
174
|
+
export interface HoneyContainer {
|
|
175
|
+
/**
|
|
176
|
+
* Max container width in any CSS distance value.
|
|
177
|
+
*/
|
|
178
|
+
maxWidth: HoneyCSSDimensionValue;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Generates a union of all possible color keys by combining each property of `HoneyColors` with its corresponding keys.
|
|
182
|
+
*
|
|
183
|
+
* This type iterates over each key in the `HoneyColors` interface and creates a string template,
|
|
184
|
+
* which combines the color type with each of its keys. The result is a union of all possible color keys.
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
*
|
|
188
|
+
* Given the `HoneyColors` interface:
|
|
189
|
+
* ```ts
|
|
190
|
+
* interface HoneyColors {
|
|
191
|
+
* primary: Record<'blue' | 'green', HoneyCSSColor>;
|
|
192
|
+
* neutral: Record<'charcoalDark' | 'charcoalGray' | 'crimsonRed', HoneyCSSColor>;
|
|
193
|
+
* }
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* The resulting `HoneyColorKey` type will be:
|
|
197
|
+
* ```ts
|
|
198
|
+
* type HoneyColorKey = 'neutral.charcoalDark' | 'neutral.charcoalGray' | 'neutral.crimsonRed' | 'primary.blue' | 'primary.green';
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export type HoneyColorKey = {
|
|
202
|
+
[ColorType in keyof HoneyColors]: `${ColorType}.${keyof HoneyColors[ColorType] & string}`;
|
|
203
|
+
}[keyof HoneyColors];
|
|
204
|
+
export type HoneyColor = HoneyCSSColor | HoneyColorKey;
|
|
205
|
+
/**
|
|
206
|
+
* Represents a map of dimension names to CSS distance values.
|
|
207
|
+
*/
|
|
208
|
+
export interface HoneyDimensions {
|
|
209
|
+
[key: string]: HoneyCSSDimensionValue;
|
|
210
|
+
}
|
|
211
|
+
export type HoneyDimensionName = keyof HoneyDimensions;
|
|
212
|
+
/**
|
|
213
|
+
* Represents the theme configuration.
|
|
214
|
+
*/
|
|
215
|
+
export interface BaseHoneyTheme {
|
|
216
|
+
/**
|
|
217
|
+
* Breakpoints for responsive design, where keys are breakpoint names and values are breakpoint values.
|
|
218
|
+
*/
|
|
219
|
+
breakpoints: Partial<HoneyBreakpoints>;
|
|
220
|
+
/**
|
|
221
|
+
* Configuration for the container.
|
|
222
|
+
*/
|
|
223
|
+
container: Partial<HoneyContainer>;
|
|
224
|
+
/**
|
|
225
|
+
* Spacing values used throughout the theme.
|
|
226
|
+
*/
|
|
227
|
+
spacings: HoneySpacings;
|
|
228
|
+
/**
|
|
229
|
+
* Font settings used throughout the theme.
|
|
230
|
+
*/
|
|
231
|
+
fonts: HoneyFonts;
|
|
232
|
+
/**
|
|
233
|
+
* Color palette used throughout the theme.
|
|
234
|
+
*/
|
|
235
|
+
colors: HoneyColors;
|
|
236
|
+
/**
|
|
237
|
+
* Dimension values used throughout the theme.
|
|
238
|
+
*/
|
|
239
|
+
dimensions: HoneyDimensions;
|
|
240
|
+
}
|
|
241
|
+
export interface HoneyTheme extends BaseHoneyTheme {
|
|
242
|
+
}
|
|
243
|
+
export type HoneyStyledPropsWithAs<Element extends ElementType, Props extends object> = {
|
|
244
|
+
as?: Element;
|
|
245
|
+
} & Props;
|
|
246
|
+
export interface HoneyStyledComponent {
|
|
247
|
+
$$ComponentId: string;
|
|
248
|
+
displayName?: string;
|
|
249
|
+
}
|
|
250
|
+
export type HoneyStyledContext<Props extends object> = {
|
|
251
|
+
theme: HoneyTheme;
|
|
252
|
+
} & Props;
|
|
253
|
+
type HoneyStyledInterpolationCSSProps = {
|
|
254
|
+
[K in keyof CSS.Properties]?: CSS.Properties[K] | null | false | undefined;
|
|
255
|
+
};
|
|
256
|
+
export type HoneyStyledFunction<Props extends object> = (context: HoneyStyledContext<Props>) => HoneyStyledInterpolation<Props>;
|
|
257
|
+
export type HoneyStyledInterpolation<Props extends object> = string | number | boolean | null | undefined | HoneyStyledComponent | HoneyStyledInterpolationCSSProps | HoneyStyledFunction<Props> | HoneyStyledInterpolation<Props>[];
|
|
258
|
+
export {};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const generateId: (prefix: string) => string;
|
|
2
|
+
export declare const hashString: (str: string) => string;
|
|
3
|
+
export declare const makeClassName: (classNames: (string | undefined)[]) => string;
|
|
4
|
+
export declare const processCss: (rawCss: string, selector?: string) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@react-hive/honey-style",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"styled-components",
|
|
8
|
+
"typescript"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/React-Hive/honey-style",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/React-Hive/honey-style/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+ssh://git@github.com/React-Hive/honey-style.git"
|
|
17
|
+
},
|
|
18
|
+
"author": "Mykhailo Aliinyk <m.aliynik@gmail.com>",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "NODE_ENV=production webpack",
|
|
22
|
+
"build-docs": "NODE_ENV=production webpack -c webpack-docs.config.js",
|
|
23
|
+
"test": "jest --collect-coverage"
|
|
24
|
+
},
|
|
25
|
+
"main": "dist/index.js",
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"!dist/**/__mocks__",
|
|
30
|
+
"!dist/**/__tests__",
|
|
31
|
+
"!dist/**/jest*"
|
|
32
|
+
],
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"react": "^19.0.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"csstype": "3.1.3",
|
|
38
|
+
"stylis": "4.3.6",
|
|
39
|
+
"@mdx-js/react": "3.1.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@eslint/js": "9.24.0",
|
|
43
|
+
"@mdx-js/loader": "3.1.0",
|
|
44
|
+
"@testing-library/react": "16.3.0",
|
|
45
|
+
"@types/jest": "29.5.14",
|
|
46
|
+
"@types/mdx": "2.0.13",
|
|
47
|
+
"@types/react": "^19.1.0",
|
|
48
|
+
"@types/stylis": "4.2.7",
|
|
49
|
+
"eslint": "9.24.0",
|
|
50
|
+
"eslint-plugin-react": "7.37.5",
|
|
51
|
+
"html-webpack-plugin": "5.6.3",
|
|
52
|
+
"jest": "29.7.0",
|
|
53
|
+
"jest-environment-jsdom": "29.7.0",
|
|
54
|
+
"prettier": "3.5.3",
|
|
55
|
+
"ts-jest": "29.3.1",
|
|
56
|
+
"ts-loader": "9.5.2",
|
|
57
|
+
"typescript": "5.8.3",
|
|
58
|
+
"typescript-eslint": "8.29.1",
|
|
59
|
+
"webpack": "5.99.0",
|
|
60
|
+
"webpack-cli": "6.0.1"
|
|
61
|
+
},
|
|
62
|
+
"jest": {
|
|
63
|
+
"preset": "ts-jest",
|
|
64
|
+
"testEnvironment": "jsdom",
|
|
65
|
+
"testMatch": [
|
|
66
|
+
"**/src/**/__tests__/**/*.tsx"
|
|
67
|
+
]
|
|
68
|
+
},
|
|
69
|
+
"browserslist": [
|
|
70
|
+
"defaults",
|
|
71
|
+
"not IE 11"
|
|
72
|
+
]
|
|
73
|
+
}
|