@react-hive/honey-style 2.10.0 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/types.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.dev.cjs +83 -58
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/styled.d.ts +4 -1
- package/package.json +8 -8
package/dist/index.dev.cjs
CHANGED
|
@@ -10,64 +10,75 @@
|
|
|
10
10
|
|
|
11
11
|
__webpack_require__.r(__webpack_exports__);
|
|
12
12
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13
|
+
/* harmony export */ FOCUSABLE_HTML_TAGS: () => (/* binding */ Q),
|
|
13
14
|
/* harmony export */ assert: () => (/* binding */ e),
|
|
14
|
-
/* harmony export */
|
|
15
|
-
/* harmony export */
|
|
16
|
-
/* harmony export */
|
|
17
|
-
/* harmony export */
|
|
18
|
-
/* harmony export */
|
|
19
|
-
/* harmony export */
|
|
20
|
-
/* harmony export */
|
|
21
|
-
/* harmony export */
|
|
22
|
-
/* harmony export */
|
|
23
|
-
/* harmony export */
|
|
24
|
-
/* harmony export */
|
|
25
|
-
/* harmony export */
|
|
26
|
-
/* harmony export */
|
|
27
|
-
/* harmony export */
|
|
28
|
-
/* harmony export */
|
|
29
|
-
/* harmony export */
|
|
15
|
+
/* harmony export */ blobToFile: () => (/* binding */ ut),
|
|
16
|
+
/* harmony export */ calculateEuclideanDistance: () => (/* binding */ W),
|
|
17
|
+
/* harmony export */ calculateMovingSpeed: () => (/* binding */ J),
|
|
18
|
+
/* harmony export */ calculatePercentage: () => (/* binding */ K),
|
|
19
|
+
/* harmony export */ camelToDashCase: () => (/* binding */ U),
|
|
20
|
+
/* harmony export */ camelToWords: () => (/* binding */ V),
|
|
21
|
+
/* harmony export */ chunk: () => (/* binding */ P),
|
|
22
|
+
/* harmony export */ cloneBlob: () => (/* binding */ et),
|
|
23
|
+
/* harmony export */ compact: () => (/* binding */ A),
|
|
24
|
+
/* harmony export */ compose: () => (/* binding */ x),
|
|
25
|
+
/* harmony export */ delay: () => (/* binding */ X),
|
|
26
|
+
/* harmony export */ difference: () => (/* binding */ S),
|
|
27
|
+
/* harmony export */ everyAsync: () => (/* binding */ B),
|
|
28
|
+
/* harmony export */ fileListToFiles: () => (/* binding */ ft),
|
|
29
|
+
/* harmony export */ filterParallel: () => (/* binding */ j),
|
|
30
|
+
/* harmony export */ filterSequential: () => (/* binding */ $),
|
|
31
|
+
/* harmony export */ findAsync: () => (/* binding */ I),
|
|
32
|
+
/* harmony export */ getDOMRectIntersectionRatio: () => (/* binding */ nt),
|
|
30
33
|
/* harmony export */ getElementOffsetRect: () => (/* binding */ rt),
|
|
31
|
-
/* harmony export */
|
|
32
|
-
/* harmony export */
|
|
33
|
-
/* harmony export */
|
|
34
|
-
/* harmony export */
|
|
34
|
+
/* harmony export */ getFocusableHtmlElements: () => (/* binding */ ot),
|
|
35
|
+
/* harmony export */ hashString: () => (/* binding */ H),
|
|
36
|
+
/* harmony export */ intersection: () => (/* binding */ k),
|
|
37
|
+
/* harmony export */ invokeIfFunction: () => (/* binding */ F),
|
|
38
|
+
/* harmony export */ isAnchorHtmlElement: () => (/* binding */ at),
|
|
39
|
+
/* harmony export */ isArray: () => (/* binding */ d),
|
|
35
40
|
/* harmony export */ isBool: () => (/* binding */ s),
|
|
36
|
-
/* harmony export */
|
|
37
|
-
/* harmony export */
|
|
38
|
-
/* harmony export */
|
|
39
|
-
/* harmony export */
|
|
40
|
-
/* harmony export */
|
|
41
|
-
/* harmony export */
|
|
42
|
-
/* harmony export */
|
|
43
|
-
/* harmony export */
|
|
44
|
-
/* harmony export */
|
|
45
|
-
/* harmony export */
|
|
46
|
-
/* harmony export */
|
|
41
|
+
/* harmony export */ isContentEditableHtmlElement: () => (/* binding */ it),
|
|
42
|
+
/* harmony export */ isDate: () => (/* binding */ c),
|
|
43
|
+
/* harmony export */ isDefined: () => (/* binding */ a),
|
|
44
|
+
/* harmony export */ isEmptyArray: () => (/* binding */ b),
|
|
45
|
+
/* harmony export */ isEmptyObject: () => (/* binding */ l),
|
|
46
|
+
/* harmony export */ isFile: () => (/* binding */ lt),
|
|
47
|
+
/* harmony export */ isFiniteNumber: () => (/* binding */ m),
|
|
48
|
+
/* harmony export */ isFunction: () => (/* binding */ E),
|
|
49
|
+
/* harmony export */ isHtmlElementFocusable: () => (/* binding */ st),
|
|
50
|
+
/* harmony export */ isInteger: () => (/* binding */ g),
|
|
51
|
+
/* harmony export */ isMap: () => (/* binding */ h),
|
|
52
|
+
/* harmony export */ isNil: () => (/* binding */ r),
|
|
53
|
+
/* harmony export */ isNilOrEmptyString: () => (/* binding */ _),
|
|
54
|
+
/* harmony export */ isNull: () => (/* binding */ n),
|
|
47
55
|
/* harmony export */ isNumber: () => (/* binding */ i),
|
|
48
|
-
/* harmony export */ isObject: () => (/* binding */
|
|
49
|
-
/* harmony export */ isPromise: () => (/* binding */
|
|
50
|
-
/* harmony export */ isRegExp: () => (/* binding */
|
|
51
|
-
/* harmony export */ isSet: () => (/* binding */
|
|
52
|
-
/* harmony export */ isString: () => (/* binding */
|
|
53
|
-
/* harmony export */ isSymbol: () => (/* binding */
|
|
54
|
-
/* harmony export */ isUndefined: () => (/* binding */
|
|
55
|
-
/* harmony export */ isValidDate: () => (/* binding */
|
|
56
|
-
/* harmony export */ noop: () => (/* binding */
|
|
57
|
-
/* harmony export */ not: () => (/* binding */
|
|
58
|
-
/* harmony export */ parse2DMatrix: () => (/* binding */
|
|
59
|
-
/* harmony export */
|
|
60
|
-
/* harmony export */
|
|
61
|
-
/* harmony export */
|
|
62
|
-
/* harmony export */
|
|
63
|
-
/* harmony export */
|
|
64
|
-
/* harmony export */
|
|
65
|
-
/* harmony export */
|
|
66
|
-
/* harmony export */
|
|
67
|
-
/* harmony export */
|
|
68
|
-
/* harmony export */
|
|
56
|
+
/* harmony export */ isObject: () => (/* binding */ o),
|
|
57
|
+
/* harmony export */ isPromise: () => (/* binding */ L),
|
|
58
|
+
/* harmony export */ isRegExp: () => (/* binding */ u),
|
|
59
|
+
/* harmony export */ isSet: () => (/* binding */ y),
|
|
60
|
+
/* harmony export */ isString: () => (/* binding */ Z),
|
|
61
|
+
/* harmony export */ isSymbol: () => (/* binding */ p),
|
|
62
|
+
/* harmony export */ isUndefined: () => (/* binding */ w),
|
|
63
|
+
/* harmony export */ isValidDate: () => (/* binding */ f),
|
|
64
|
+
/* harmony export */ noop: () => (/* binding */ C),
|
|
65
|
+
/* harmony export */ not: () => (/* binding */ O),
|
|
66
|
+
/* harmony export */ parse2DMatrix: () => (/* binding */ tt),
|
|
67
|
+
/* harmony export */ parseFileName: () => (/* binding */ ct),
|
|
68
|
+
/* harmony export */ pipe: () => (/* binding */ T),
|
|
69
|
+
/* harmony export */ readFilesFromDataTransfer: () => (/* binding */ yt),
|
|
70
|
+
/* harmony export */ reduceAsync: () => (/* binding */ z),
|
|
71
|
+
/* harmony export */ retry: () => (/* binding */ N),
|
|
72
|
+
/* harmony export */ runParallel: () => (/* binding */ Y),
|
|
73
|
+
/* harmony export */ runSequential: () => (/* binding */ R),
|
|
74
|
+
/* harmony export */ someAsync: () => (/* binding */ D),
|
|
75
|
+
/* harmony export */ splitStringIntoWords: () => (/* binding */ q),
|
|
76
|
+
/* harmony export */ timeout: () => (/* binding */ v),
|
|
77
|
+
/* harmony export */ toKebabCase: () => (/* binding */ G),
|
|
78
|
+
/* harmony export */ traverseFileSystemDirectory: () => (/* binding */ ht),
|
|
79
|
+
/* harmony export */ unique: () => (/* binding */ M)
|
|
69
80
|
/* harmony export */ });
|
|
70
|
-
var t={};function e(t,e){if(!t)throw new Error(e)}t.d=(e,
|
|
81
|
+
var t={};function e(t,e){if(!t)throw new Error(e)}t.d=(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const n=t=>null===t,r=t=>null==t,a=t=>null!=t,i=t=>"number"==typeof t,s=t=>"boolean"==typeof t,o=t=>"object"==typeof t,l=t=>o(t)&&!n(t)&&0===Object.keys(t).length,c=t=>t instanceof Date,f=t=>c(t)&&!isNaN(t.getTime()),u=t=>t instanceof RegExp,h=t=>t instanceof Map,y=t=>t instanceof Set,p=t=>"symbol"==typeof t,w=t=>void 0===t,m=t=>i(t)&&isFinite(t),g=t=>i(t)&&Number.isInteger(t),d=t=>Array.isArray(t),b=t=>d(t)&&0===t.length,A=t=>t.filter(Boolean),M=t=>[...new Set(t)],P=(t,n)=>(e(n>0,"Chunk size must be greater than 0"),Array.from({length:Math.ceil(t.length/n)},(e,r)=>t.slice(r*n,(r+1)*n))),k=(...t)=>{if(0===t.length)return[];if(1===t.length)return[...t[0]];const[e,...n]=t;return M(e).filter(t=>n.every(e=>e.includes(t)))},S=(t,e)=>t.filter(t=>!e.includes(t)),T=(...t)=>e=>t.reduce((t,e)=>e(t),e),x=(...t)=>e=>t.reduceRight((t,e)=>e(t),e),C=()=>{},E=t=>"function"==typeof t,O=t=>(...e)=>!t(...e),F=(t,...e)=>"function"==typeof t?t(...e):t,X=t=>new Promise(e=>setTimeout(e,t)),v=async(t,e,n="Operation timed out")=>{try{return await Promise.race([t,X(e).then(()=>Promise.reject(new Error(n)))])}finally{}},N=(t,{maxAttempts:e=3,delayMs:n=300,backoff:r=!0,onRetry:a}={})=>async(...i)=>{let s;for(let o=1;o<=e;o++)try{return await t(...i)}catch(t){if(s=t,o<e){a?.(o,t);const e=r?n*2**(o-1):n;await X(e)}}throw s},L=t=>E(t?.then),R=async(t,e)=>{const n=[];for(let r=0;r<t.length;r++)n.push(await e(t[r],r,t));return n},Y=async(t,e)=>Promise.all(t.map(e)),$=async(t,e)=>{const n=[];for(let r=0;r<t.length;r++){const a=t[r];await e(a,r,t)&&n.push(a)}return n},j=async(t,e)=>{const n=await Y(t,async(t,n,r)=>!!await e(t,n,r)&&t);return A(n)},D=async(t,e)=>{for(let n=0;n<t.length;n++)if(await e(t[n],n,t))return!0;return!1},B=async(t,e)=>{for(let n=0;n<t.length;n++)if(!await e(t[n],n,t))return!1;return!0},z=async(t,e,n)=>{let r=n;for(let n=0;n<t.length;n++)r=await e(r,t[n],n,t);return r},I=async(t,e)=>{for(let n=0;n<t.length;n++)if(await e(t[n],n,t))return t[n];return null},Z=t=>"string"==typeof t,_=t=>""===t||r(t),G=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),U=t=>{const e=t.charAt(0),n=t.slice(1);return e.toLowerCase()+n.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)},V=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1 $2"),q=t=>t.split(" ").filter(Boolean),H=t=>{let e=5381;for(let n=0;n<t.length;n++)e=33*e^t.charCodeAt(n);return(e>>>0).toString(36)},W=(t,e,n,r)=>{const a=n-t,i=r-e;return Math.hypot(a,i)},J=(t,e)=>Math.abs(t/e),K=(t,e)=>t*e/100,Q=["INPUT","SELECT","TEXTAREA","BUTTON","A"],tt=t=>{const e=window.getComputedStyle(t).getPropertyValue("transform").match(/^matrix\((.+)\)$/);if(!e)return{translateX:0,translateY:0,scaleX:1,scaleY:1,skewX:0,skewY:0};const[n,r,a,i,s,o]=e[1].split(", ").map(parseFloat);return{translateX:s,translateY:o,scaleX:n,scaleY:i,skewX:a,skewY:r}},et=t=>new Blob([t],{type:t.type}),nt=(t,e)=>Math.max(0,Math.min(t.right,e.right)-Math.max(t.left,e.left))*Math.max(0,Math.min(t.bottom,e.bottom)-Math.max(t.top,e.top))/(e.width*e.height),rt=t=>new DOMRect(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight),at=t=>"A"===t.tagName,it=t=>"true"===t.getAttribute("contenteditable"),st=t=>{if(!t)return!1;const e=window.getComputedStyle(t);if("hidden"===e.visibility||"none"===e.display)return!1;if("disabled"in t&&t.disabled)return!1;const n=t.getAttribute("tabindex");return"-1"!==n&&(Q.includes(t.tagName)?!at(t)||""!==t.href:!!it(t)||null!==n)},ot=t=>Array.from(t.querySelectorAll("*")).filter(st),lt=t=>t instanceof File,ct=t=>{const e=t.lastIndexOf(".");return e<=0||e===t.length-1?[t,""]:[t.slice(0,e),t.slice(e+1).toLowerCase()]},ft=t=>{if(!t)return[];const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);return e},ut=(t,e)=>new File([t],e,{type:t.type}),ht=async(t,{skipFiles:e=[".DS_Store","Thumbs.db","desktop.ini","ehthumbs.db",".Spotlight-V100",".Trashes",".fseventsd","__MACOSX"]}={})=>{const n=new Set(e),r=await(async t=>{const e=t.createReader(),n=async()=>new Promise((t,r)=>{e.readEntries(async e=>{if(e.length)try{const r=await n();t([...e,...r])}catch(t){r(t)}else t([])},r)});return n()})(t);return(await Y(r,async t=>t.isDirectory?ht(t,{skipFiles:e}):n.has(t.name)?[]:[await new Promise((e,n)=>{t.file(e,n)})])).flat()},yt=async(t,e={})=>{const n=t?.items;if(!n)return[];const r=[];for(let t=0;t<n.length;t++){const a=n[t];if("webkitGetAsEntry"in a){const t=a.webkitGetAsEntry?.();if(t?.isDirectory){r.push(ht(t,e));continue}if(t?.isFile){r.push(new Promise((e,n)=>t.file(t=>e([t]),n)));continue}}const i=a.getAsFile();i&&r.push(Promise.resolve([i]))}return(await Promise.all(r)).flat()};
|
|
71
82
|
//# sourceMappingURL=index.mjs.map
|
|
72
83
|
|
|
73
84
|
/***/ }),
|
|
@@ -2716,7 +2727,7 @@ const evaluateDynamicCss = (interpolation, context) => {
|
|
|
2716
2727
|
// @ts-expect-error
|
|
2717
2728
|
return (0,_css__WEBPACK_IMPORTED_MODULE_4__.css)([''], [interpolation])(context);
|
|
2718
2729
|
};
|
|
2719
|
-
const styled = (target, defaultProps) => {
|
|
2730
|
+
const styled = (target, defaultProps, { omitProps } = {}) => {
|
|
2720
2731
|
return (strings, ...interpolations) => {
|
|
2721
2732
|
const componentId = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.generateId)('hsc');
|
|
2722
2733
|
const computeCss = (0,_css__WEBPACK_IMPORTED_MODULE_4__.css)(strings, ...interpolations);
|
|
@@ -2753,20 +2764,34 @@ const styled = (target, defaultProps) => {
|
|
|
2753
2764
|
return (0,_mount_style__WEBPACK_IMPORTED_MODULE_5__.mountStyle)(cssPropClassName, overrideCss, 1);
|
|
2754
2765
|
}
|
|
2755
2766
|
}, [cssPropClassName]);
|
|
2767
|
+
const finalClassName = (0,_utils__WEBPACK_IMPORTED_MODULE_3__.combineClassNames)([
|
|
2768
|
+
componentId,
|
|
2769
|
+
baseClassName,
|
|
2770
|
+
className,
|
|
2771
|
+
cssPropClassName,
|
|
2772
|
+
]);
|
|
2756
2773
|
const mergedProps = {
|
|
2757
2774
|
...resolvedDefaultProps,
|
|
2758
2775
|
...cleanedProps,
|
|
2759
|
-
className:
|
|
2776
|
+
className: finalClassName,
|
|
2760
2777
|
};
|
|
2778
|
+
const finalProps = omitProps
|
|
2779
|
+
? Object.entries(mergedProps).reduce((result, [propName, propValue]) => omitProps(propName)
|
|
2780
|
+
? result
|
|
2781
|
+
: {
|
|
2782
|
+
...result,
|
|
2783
|
+
[propName]: propValue,
|
|
2784
|
+
}, {})
|
|
2785
|
+
: mergedProps;
|
|
2761
2786
|
const finalComponent = as || target;
|
|
2762
2787
|
if ((0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.isString)(target)) {
|
|
2763
2788
|
const filteredProps = (0,_react_hive_honey_utils__WEBPACK_IMPORTED_MODULE_1__.isString)(finalComponent)
|
|
2764
|
-
? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.filterNonHtmlAttrs)(
|
|
2765
|
-
:
|
|
2789
|
+
? (0,_utils__WEBPACK_IMPORTED_MODULE_3__.filterNonHtmlAttrs)(finalProps)
|
|
2790
|
+
: finalProps;
|
|
2766
2791
|
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(finalComponent, filteredProps);
|
|
2767
2792
|
}
|
|
2768
2793
|
return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(target, {
|
|
2769
|
-
...
|
|
2794
|
+
...finalProps,
|
|
2770
2795
|
...(as && { as }),
|
|
2771
2796
|
...((0,_utils__WEBPACK_IMPORTED_MODULE_3__.isStyledComponent)(target) && {
|
|
2772
2797
|
__compositionDepth: __compositionDepth - 1,
|