@jamsr-ui/utils
Advanced tools
Comparing version 0.0.44 to 0.0.45
export * from 'tailwind-variants'; | ||
export { getRandomFromArray, includes } from './array.js'; | ||
export { dataAttr, getBoolean, isBoolean, isDecNum, isEmpty, isString, isTrue } from './assertion.js'; | ||
export { cn } from './class-name.js'; | ||
export { cn, mergeClassNames } from './class-name.js'; | ||
export { absoluteFullClasses, dataFocusVisibleClasses, focusVisibleClasses, groupDataFocusVisibleClasses, ringClasses, translateCenterClasses } from './classes.js'; | ||
@@ -8,9 +9,8 @@ export { colorVariants } from './color-variants.js'; | ||
export { CreateContextOptions, CreateContextReturn, createContext } from './context.js'; | ||
export { useDOMRef } from './dom.js'; | ||
export { filterDOMProps } from './filter-dom-props.js'; | ||
export { mergeProps } from './merge-props.js'; | ||
export { TRANSITION_VARIANTS } from './transition.js'; | ||
export { SlotsToClasses, mapPropsVariants } from './tv.js'; | ||
export { getRandomFromArray, includes } from './array.js'; | ||
export { useDOMRef } from './dom.js'; | ||
export { mergeProps } from './merge-props.js'; | ||
export { filterDOMProps } from './filter-dom-props.js'; | ||
import 'clsx'; | ||
import 'react'; |
"use client" | ||
"use strict";var D=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!k.call(e,r)&&r!==n&&p(e,r,{get:()=>t[r],enumerable:!(s=E(t,r))||s.enumerable});return e},i=(e,t,n)=>(l(e,t,"default"),n&&l(n,t,"default")),b=(e,t,n)=>(n=e!=null?D(S(e)):{},l(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),R=e=>l(p({},"__esModule",{value:!0}),e);var o={};N(o,{TRANSITION_VARIANTS:()=>ne,absoluteFullClasses:()=>q,cn:()=>w,colorVariants:()=>ee,createContext:()=>te,dataAttr:()=>K,dataFocusVisibleClasses:()=>B,filterDOMProps:()=>M,focusVisibleClasses:()=>j,getBoolean:()=>V,getRandomFromArray:()=>se,groupDataFocusVisibleClasses:()=>$,includes:()=>oe,isBoolean:()=>I,isDecNum:()=>F,isEmpty:()=>L,isString:()=>A,isTrue:()=>U,mapPropsVariants:()=>re,mergeProps:()=>ce,ringClasses:()=>H,translateCenterClasses:()=>G,useDOMRef:()=>ae});module.exports=R(o);i(o,require("tailwind-variants"),module.exports);var K=e=>e?"true":"false",A=e=>typeof e=="string",I=e=>typeof e=="boolean",U=e=>e===!0,L=e=>typeof e=="object"&&e!==null?Object.keys(e).length===0:Array.isArray(e)?e.length===0:!e,V=e=>e,F=e=>/^\d+(\.\d+)?$/.test(e.toString());var y=b(require("clsx")),h=require("tailwind-merge"),z=(0,h.extendTailwindMerge)({extend:{classGroups:{gap:["gap-responsive"],"font-size":["text-size-inherit"],shadow:["shadow-card"]}}}),w=(...e)=>z((0,y.default)(e));var j=["focus-visible:z-10","focus-visible:outline-primary","focus-visible:outline-2","focus-visible:outline-focus","focus-visible:outline-offset-2"],B=["outline-none","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],$=["outline-none","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],H=["outline-none","ring-2","ring-focus","ring-offset-2","ring-offset-background"],G=["absolute","top-1/2","left-1/2","-translate-x-1/2","-translate-y-1/2"],q=["absolute","inset-0"];var Q={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground"},W={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},Z={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},_={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-700",secondary:"bg-secondary/20 text-secondary-700",success:"bg-success/20 text-success-800 dark:text-success",warning:"bg-warning/20 text-warning-800 dark:text-warning",danger:"bg-danger/20 text-danger-800 dark:text-danger-500"},J={default:"text-foreground",primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger"},X={default:"bg-transparent text-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},Y={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},ee={solid:Q,shadow:W,outlined:Z,flat:_,link:J,light:X,ghost:Y};var f=b(require("react"));function te(e={}){let{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:s}=e,r=f.createContext(void 0);r.displayName=s;function c(){let d=f.useContext(r);if(!d&&t){let u=new Error(n);throw u.name="ContextError",Error.captureStackTrace?.(u,c),u}return d}return[r.Provider,c,r]}var ne={collapse:{enter:{opacity:1,height:"auto",filter:"blur(0px)",transition:{type:"spring",duration:.6}},exit:{opacity:0,height:0,filter:"blur(2px)",transition:{type:"spring",duration:.6}}}};var re=(e,t,n=!0)=>{if(!t)return[e,{}];let s=t.reduce((r,c)=>c in e?{...r,[c]:e[c]}:r,{});return n?[Object.keys(e).filter(c=>!t.includes(c)).reduce((c,d)=>({...c,[d]:e[d]}),{}),s]:[e,s]};function oe(e,t){return e.includes(t)}var se=e=>Math.floor(Math.random()*e);var g=require("react"),ae=e=>{let t=(0,g.useRef)(null);return(0,g.useImperativeHandle)(e,()=>t.current),t};function ie(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style={...e.style,...n};else if(typeof n=="function"){let s=e[t];e[t]=s?(...r)=>{s(...r),n(...r)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error(`Didn\u2019t know how to merge prop '${t}'. Only 'className', 'style', and event handlers are supported`)}}function ce(...e){return e.length===1?e[0]:e.reduce((t,n)=>{for(let s in n)ie(t,s,n[s]);return t},{})}var T=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),C=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]);var P=/^(data-.*)$/,de=/^(aria-.*)$/,m=/^(on[A-Z].*)$/;function M(e,t={}){let{labelable:n=!0,enabled:s=!0,propNames:r,omitPropNames:c,omitEventNames:d,omitDataProps:u,omitEventProps:O}=t,x={};if(!s)return e;for(let a in e)c?.has(a)||d?.has(a)&&m.test(a)||m.test(a)&&!C.has(a)||u&&P.test(a)||O&&m.test(a)||(Object.prototype.hasOwnProperty.call(e,a)&&(T.has(a)||n&&de.test(a)||r?.has(a)||P.test(a))||m.test(a))&&(x[a]=e[a]);return x}0&&(module.exports={TRANSITION_VARIANTS,absoluteFullClasses,cn,colorVariants,createContext,dataAttr,dataFocusVisibleClasses,filterDOMProps,focusVisibleClasses,getBoolean,getRandomFromArray,groupDataFocusVisibleClasses,includes,isBoolean,isDecNum,isEmpty,isString,isTrue,mapPropsVariants,mergeProps,ringClasses,translateCenterClasses,useDOMRef,...require("tailwind-variants")}); | ||
"use strict";var E=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},l=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of S(t))!N.call(e,o)&&o!==n&&p(e,o,{get:()=>t[o],enumerable:!(r=v(t,o))||r.enumerable});return e},i=(e,t,n)=>(l(e,t,"default"),n&&l(n,t,"default")),y=(e,t,n)=>(n=e!=null?E(k(e)):{},l(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),K=e=>l(p({},"__esModule",{value:!0}),e);var s={};R(s,{TRANSITION_VARIANTS:()=>de,absoluteFullClasses:()=>Z,cn:()=>x,colorVariants:()=>re,createContext:()=>oe,dataAttr:()=>U,dataFocusVisibleClasses:()=>G,filterDOMProps:()=>O,focusVisibleClasses:()=>H,getBoolean:()=>j,getRandomFromArray:()=>I,groupDataFocusVisibleClasses:()=>q,includes:()=>A,isBoolean:()=>V,isDecNum:()=>B,isEmpty:()=>z,isString:()=>L,isTrue:()=>F,mapPropsVariants:()=>ue,mergeClassNames:()=>T,mergeProps:()=>ce,ringClasses:()=>Q,translateCenterClasses:()=>W,useDOMRef:()=>se});module.exports=K(s);i(s,require("tailwind-variants"),module.exports);function A(e,t){return e.includes(t)}var I=e=>Math.floor(Math.random()*e);var U=e=>e?"true":"false",L=e=>typeof e=="string",V=e=>typeof e=="boolean",F=e=>e===!0,z=e=>typeof e=="object"&&e!==null?Object.keys(e).length===0:Array.isArray(e)?e.length===0:!e,j=e=>e,B=e=>/^\d+(\.\d+)?$/.test(e.toString());var h=y(require("clsx")),w=require("tailwind-merge"),$=(0,w.extendTailwindMerge)({extend:{classGroups:{gap:["gap-responsive"],"font-size":["text-size-inherit"],shadow:["shadow-card"]}}}),x=(...e)=>$((0,h.default)(e)),T=(e,t)=>{if(!e&&!t)return{};if(!e)return t;if(!t)return e;let n={};for(let r in e)t.hasOwnProperty(r)?n[r]=x(e[r],t[r]):n[r]=e[r];for(let r in t)e.hasOwnProperty(r)||(n[r]=t[r]);return n};var H=["focus-visible:z-10","focus-visible:outline-primary","focus-visible:outline-2","focus-visible:outline-focus","focus-visible:outline-offset-2"],G=["outline-none","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],q=["outline-none","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],Q=["outline-none","ring-2","ring-focus","ring-offset-2","ring-offset-background"],W=["absolute","top-1/2","left-1/2","-translate-x-1/2","-translate-y-1/2"],Z=["absolute","inset-0"];var _={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground"},J={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},X={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},Y={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-700",secondary:"bg-secondary/20 text-secondary-700",success:"bg-success/20 text-success-800 dark:text-success",warning:"bg-warning/20 text-warning-800 dark:text-warning",danger:"bg-danger/20 text-danger-800 dark:text-danger-500"},ee={default:"text-foreground",primary:"text-primary",secondary:"text-secondary",success:"text-success",warning:"text-warning",danger:"text-danger"},te={default:"bg-transparent text-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},ne={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},re={solid:_,shadow:J,outlined:X,flat:Y,link:ee,light:te,ghost:ne};var f=y(require("react"));function oe(e={}){let{strict:t=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:r}=e,o=f.createContext(void 0);o.displayName=r;function c(){let d=f.useContext(o);if(!d&&t){let u=new Error(n);throw u.name="ContextError",Error.captureStackTrace?.(u,c),u}return d}return[o.Provider,c,o]}var g=require("react"),se=e=>{let t=(0,g.useRef)(null);return(0,g.useImperativeHandle)(e,()=>t.current),t};var C=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),P=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]);var M=/^(data-.*)$/,ae=/^(aria-.*)$/,m=/^(on[A-Z].*)$/;function O(e,t={}){let{labelable:n=!0,enabled:r=!0,propNames:o,omitPropNames:c,omitEventNames:d,omitDataProps:u,omitEventProps:D}=t,b={};if(!r)return e;for(let a in e)c?.has(a)||d?.has(a)&&m.test(a)||m.test(a)&&!P.has(a)||u&&M.test(a)||D&&m.test(a)||(Object.prototype.hasOwnProperty.call(e,a)&&(C.has(a)||n&&ae.test(a)||o?.has(a)||M.test(a))||m.test(a))&&(b[a]=e[a]);return b}function ie(e,t,n){if(t==="className")e.className=[e.className,n].join(" ").trim();else if(t==="style")e.style={...e.style,...n};else if(typeof n=="function"){let r=e[t];e[t]=r?(...o)=>{r(...o),n(...o)}:n}else{if(n===void 0||typeof n!="object"&&n===e[t])return;if(!(t in e))e[t]=n;else throw new Error(`Didn\u2019t know how to merge prop '${t}'. Only 'className', 'style', and event handlers are supported`)}}function ce(...e){return e.length===1?e[0]:e.reduce((t,n)=>{for(let r in n)ie(t,r,n[r]);return t},{})}var de={collapse:{enter:{opacity:1,height:"auto",filter:"blur(0px)",transition:{type:"spring",duration:.6}},exit:{opacity:0,height:0,filter:"blur(2px)",transition:{type:"spring",duration:.6}}}};var ue=(e,t,n=!0)=>{if(!t)return[e,{}];let r=t.reduce((o,c)=>c in e?{...o,[c]:e[c]}:o,{});return n?[Object.keys(e).filter(c=>!t.includes(c)).reduce((c,d)=>({...c,[d]:e[d]}),{}),r]:[e,r]};0&&(module.exports={TRANSITION_VARIANTS,absoluteFullClasses,cn,colorVariants,createContext,dataAttr,dataFocusVisibleClasses,filterDOMProps,focusVisibleClasses,getBoolean,getRandomFromArray,groupDataFocusVisibleClasses,includes,isBoolean,isDecNum,isEmpty,isString,isTrue,mapPropsVariants,mergeClassNames,mergeProps,ringClasses,translateCenterClasses,useDOMRef,...require("tailwind-variants")}); |
{ | ||
"name": "@jamsr-ui/utils", | ||
"version": "0.0.44", | ||
"version": "0.0.45", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
54193
442