@tinloof/ds 1.0.0 → 1.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/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var{defineProperty:
|
|
1
|
+
var{defineProperty:S,getOwnPropertyNames:O,getOwnPropertyDescriptor:W}=Object,q=Object.prototype.hasOwnProperty;var V=new WeakMap,_=(t)=>{var e=V.get(t),r;if(e)return e;if(e=S({},"__esModule",{value:!0}),t&&typeof t==="object"||typeof t==="function")O(t).map((o)=>!q.call(e,o)&&S(e,o,{get:()=>t[o],enumerable:!(r=W(t,o))||r.enumerable}));return V.set(t,e),e};var G=(t,e)=>{for(var r in e)S(t,r,{get:e[r],enumerable:!0,configurable:!0,set:(o)=>e[r]=()=>o})};var X={};G(X,{spacedWrapperVariants:()=>N,cva:()=>x,cn:()=>a,Textarea:()=>H,SpacedWrapper:()=>d,Skeleton:()=>L,Input:()=>z,IconButton:()=>k,Chip:()=>v,Button:()=>w});module.exports=_(X);function a(...t){return t.flat().filter((e)=>{if(typeof e==="string")return e.trim().length>0;if(typeof e==="number")return!0;if(typeof e==="object"&&e!==null)return!0;return!1}).map((e)=>{if(typeof e==="string")return e.trim();if(typeof e==="number")return String(e);if(typeof e==="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).filter(([r,o])=>Boolean(o)).map(([r,o])=>r).join(" ");return""}).join(" ").split(/\s+/).filter((e)=>e.length>0).join(" ")}var y=require("react"),I=require("react/jsx-dev-runtime"),E={base:"bg-base text-fg border border-transparent hover:bg-surface-soft group-hover/wrapper:bg-surface-soft border disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",surface:"bg-surface-strong text-fg border hover:bg-surface-soft group-hover/wrapper:bg-surface-soft disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 active:bg-surface focus-visible:ring focus-visible:ring-fg",transparent:"bg-transparent text-fg border border-transparent hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",active:"bg-surface-strong text-fg border disabled:opacity-40 disabled:cursor-not-allowed focus-visible:ring focus-visible:ring-fg"},J={24:"h-6 px-2.5",32:"h-8 px-3"};function w({className:t,variant:e="surface",size:r=24,asChild:o=!1,children:s,...n}){let i=a("rounded-4 group/button",E[e],J[r],t);if(o&&y.isValidElement(s))return y.cloneElement(s,{...n,className:a(s.props.className,i),tabIndex:0,"data-slot":"button"});return I.jsxDEV("button",{"data-slot":"button",className:i,tabIndex:0,...n,children:s},void 0,!1,void 0,this)}var R=require("react/jsx-dev-runtime");function v({className:t,variant:e="default",isActive:r=!1,text:o="New",...s}){return R.jsxDEV("span",{className:a("text-chip px-1 py-0.75 rounded-2 text-fg-soft flex items-center",e==="default"&&"bg-surface-strong",e==="interactive"&&["transition-colors",r?"bg-base":"bg-surface-strong group-hover/wrapper:bg-base group-hover/button:bg-base"],t),...s,children:o},void 0,!1,void 0,this)}function x(t,e){return(r)=>{if(!e||!r)return t;let o=[t];for(let s in e.variants){let n=r[s],i=e.defaultVariants?.[s],p=n??i;if(p&&typeof p==="string"){let l=e.variants[s];if(l){let f=l[p];if(f)o.push(String(f))}}}return o.filter(Boolean).join(" ")}}var b=require("react/jsx-dev-runtime"),N=x("w-full",{variants:{spaced:{none:"",top:"mt-0.5 relative group/wrapper after:absolute after:inset-x-0 after:bottom-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",right:"mr-0.5 relative group/wrapper after:absolute after:inset-y-0 after:left-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",bottom:"mb-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",left:"ml-0.5 relative group/wrapper after:absolute after:inset-y-0 after:right-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",x:"mx-0.5 relative group/wrapper after:absolute after:inset-y-0 after:left-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-y-0 before:right-full before:w-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer",y:"my-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-x-0 before:bottom-full before:h-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer",all:"m-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-y-0 before:right-full before:w-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer"}},defaultVariants:{spaced:"none"}});function d({spaced:t="none",className:e,children:r}){if(t==="none")return b.jsxDEV(b.Fragment,{children:r},void 0,!1,void 0,this);return b.jsxDEV("div",{className:a(N({spaced:t}),e),children:r},void 0,!1,void 0,this)}var h=require("react"),C=require("react/jsx-dev-runtime"),Q={24:"h-6 w-6",32:"h-8 w-8"},U={transparent:"bg-transparent border border-transparent text-fg-soft hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",solid:"bg-surface text-fg-soft border hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed focus-visible:bg-surface-strong transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",active:"bg-surface-strong text-fg border disabled:opacity-40 disabled:cursor-not-allowed focus-visible:ring focus-visible:ring-fg"};function k({className:t,variant:e="transparent",size:r=24,spaced:o="none",asChild:s=!1,children:n,...i}){let l=a("rounded-4 group/button flex justify-center items-center",Q[r],U[e],t);if(s&&h.isValidElement(n))return C.jsxDEV(d,{spaced:o,children:h.cloneElement(n,{"data-slot":"icon-button",className:a(l,n.props?.className),tabIndex:0,...i})},void 0,!1,void 0,this);return C.jsxDEV(d,{spaced:o,children:C.jsxDEV("button",{"data-slot":"icon-button",className:l,tabIndex:0,...i,children:n},void 0,!1,void 0,this)},void 0,!1,void 0,this)}var A=require("react");var P=require("react/jsx-dev-runtime");function z(t){let{className:e,errorMessage:r,defaultValue:o,onChange:s,variant:n="default",...i}=t,[p,l]=A.useState(o||""),f=(m)=>{l(m.target.value),s?.(m)},u=!!r,c=!!p,B=a("text-tight text-fg placeholder:text-tight focus:outline-none placeholder:text-fg-soft",n==="default"&&["py-3 border-b focus:border-fg",c&&!u&&"border-fg",!c&&!u&&"border-border",u&&"border-fg-error"],n==="surface"&&["h-8 px-3 border rounded text-regular-12 bg-bg-soft focus:border-fg",u?"border-fg-error":"border-border"],e);return P.jsxDEV("div",{className:"flex flex-col",children:[P.jsxDEV("input",{className:B,value:p,onChange:f,...i},void 0,!1,void 0,this),r&&P.jsxDEV("p",{className:"text-fg-error text-tight mt-3 mb-2",children:r},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var M=require("react");var g=require("react/jsx-dev-runtime");function H(t){let{className:e,errorMessage:r,defaultValue:o,onChange:s,required:n,...i}=t,[p,l]=M.useState(o||""),f=(T)=>{l(T.target.value),s?.(T)},u=!!r,c=!!p,B=!n,m=a("py-3 border-b text-tight text-fg placeholder:text-tight focus:outline-none placeholder:text-fg-soft focus:border-fg resize-none w-full h-20",c&&!u&&"border-fg",!c&&!u&&"border-border",u&&"border-fg-error",e);return g.jsxDEV("div",{className:"flex flex-col",children:[g.jsxDEV("div",{className:"relative w-full",children:[g.jsxDEV("textarea",{className:m,value:p,onChange:f,rows:4,required:n,...i},void 0,!1,void 0,this),!c&&B&&g.jsxDEV(v,{variant:"default",isActive:!0,className:"absolute top-2 right-0",text:"Optional"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),r&&g.jsxDEV("p",{className:"text-fg-error text-tight mt-3 mb-2",children:r},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var K=require("react/jsx-dev-runtime");function L({className:t,...e}){return K.jsxDEV("div",{className:a("rounded-4 animate-skeleton-pulse bg-surface",t),...e},void 0,!1,void 0,this)}
|
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function o(...r){return r.flat().filter((e)=>{if(typeof e==="string")return e.trim().length>0;if(typeof e==="number")return!0;if(typeof e==="object"&&e!==null)return!0;return!1}).map((e)=>{if(typeof e==="string")return e.trim();if(typeof e==="number")return String(e);if(typeof e==="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).filter(([t,a])=>Boolean(a)).map(([t,a])=>t).join(" ");return""}).join(" ").split(/\s+/).filter((e)=>e.length>0).join(" ")}import{cloneElement as S,isValidElement as N}from"react";import{
|
|
1
|
+
function o(...r){return r.flat().filter((e)=>{if(typeof e==="string")return e.trim().length>0;if(typeof e==="number")return!0;if(typeof e==="object"&&e!==null)return!0;return!1}).map((e)=>{if(typeof e==="string")return e.trim();if(typeof e==="number")return String(e);if(typeof e==="object"&&e!==null&&!Array.isArray(e))return Object.entries(e).filter(([t,a])=>Boolean(a)).map(([t,a])=>t).join(" ");return""}).join(" ").split(/\s+/).filter((e)=>e.length>0).join(" ")}import{cloneElement as S,isValidElement as N}from"react";import{jsxDEV as I}from"react/jsx-dev-runtime";var T={base:"bg-base text-fg border border-transparent hover:bg-surface-soft group-hover/wrapper:bg-surface-soft border disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",surface:"bg-surface-strong text-fg border hover:bg-surface-soft group-hover/wrapper:bg-surface-soft disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 active:bg-surface focus-visible:ring focus-visible:ring-fg",transparent:"bg-transparent text-fg border border-transparent hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",active:"bg-surface-strong text-fg border disabled:opacity-40 disabled:cursor-not-allowed focus-visible:ring focus-visible:ring-fg"},V={24:"h-6 px-2.5",32:"h-8 px-3"};function w({className:r,variant:e="surface",size:t=24,asChild:a=!1,children:s,...n}){let i=o("rounded-4 group/button",T[e],V[t],r);if(a&&N(s))return S(s,{...n,className:o(s.props.className,i),tabIndex:0,"data-slot":"button"});return I("button",{"data-slot":"button",className:i,tabIndex:0,...n,children:s},void 0,!1,void 0,this)}import{jsxDEV as R}from"react/jsx-dev-runtime";function y({className:r,variant:e="default",isActive:t=!1,text:a="New",...s}){return R("span",{className:o("text-chip px-1 py-0.75 rounded-2 text-fg-soft flex items-center",e==="default"&&"bg-surface-strong",e==="interactive"&&["transition-colors",t?"bg-base":"bg-surface-strong group-hover/wrapper:bg-base group-hover/button:bg-base"],r),...s,children:a},void 0,!1,void 0,this)}function v(r,e){return(t)=>{if(!e||!t)return r;let a=[r];for(let s in e.variants){let n=t[s],i=e.defaultVariants?.[s],p=n??i;if(p&&typeof p==="string"){let l=e.variants[s];if(l){let f=l[p];if(f)a.push(String(f))}}}return a.filter(Boolean).join(" ")}}import{jsxDEV as P,Fragment as k}from"react/jsx-dev-runtime";var B=v("w-full",{variants:{spaced:{none:"",top:"mt-0.5 relative group/wrapper after:absolute after:inset-x-0 after:bottom-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",right:"mr-0.5 relative group/wrapper after:absolute after:inset-y-0 after:left-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",bottom:"mb-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",left:"ml-0.5 relative group/wrapper after:absolute after:inset-y-0 after:right-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer",x:"mx-0.5 relative group/wrapper after:absolute after:inset-y-0 after:left-full after:w-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-y-0 before:right-full before:w-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer",y:"my-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-x-0 before:bottom-full before:h-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer",all:"m-0.5 relative group/wrapper after:absolute after:inset-x-0 after:top-full after:h-0.5 after:content-[''] after:pointer-events-auto after:cursor-pointer before:absolute before:inset-y-0 before:right-full before:w-0.5 before:content-[''] before:pointer-events-auto before:cursor-pointer"}},defaultVariants:{spaced:"none"}});function d({spaced:r="none",className:e,children:t}){if(r==="none")return P(k,{children:t},void 0,!1,void 0,this);return P("div",{className:o(B({spaced:r}),e),children:t},void 0,!1,void 0,this)}import{cloneElement as A,isValidElement as z}from"react";import{jsxDEV as x}from"react/jsx-dev-runtime";var M={24:"h-6 w-6",32:"h-8 w-8"},H={transparent:"bg-transparent border border-transparent text-fg-soft hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",solid:"bg-surface text-fg-soft border hover:bg-surface-strong group-hover/wrapper:bg-surface-strong disabled:opacity-40 disabled:cursor-not-allowed focus-visible:bg-surface-strong transition-colors duration-150 focus-visible:ring focus-visible:ring-fg",active:"bg-surface-strong text-fg border disabled:opacity-40 disabled:cursor-not-allowed focus-visible:ring focus-visible:ring-fg"};function L({className:r,variant:e="transparent",size:t=24,spaced:a="none",asChild:s=!1,children:n,...i}){let l=o("rounded-4 group/button flex justify-center items-center",M[t],H[e],r);if(s&&z(n))return x(d,{spaced:a,children:A(n,{"data-slot":"icon-button",className:o(l,n.props?.className),tabIndex:0,...i})},void 0,!1,void 0,this);return x(d,{spaced:a,children:x("button",{"data-slot":"icon-button",className:l,tabIndex:0,...i,children:n},void 0,!1,void 0,this)},void 0,!1,void 0,this)}import{useState as K}from"react";import{jsxDEV as C}from"react/jsx-dev-runtime";function O(r){let{className:e,errorMessage:t,defaultValue:a,onChange:s,variant:n="default",...i}=r,[p,l]=K(a||""),f=(b)=>{l(b.target.value),s?.(b)},u=!!t,c=!!p,m=o("text-tight text-fg placeholder:text-tight focus:outline-none placeholder:text-fg-soft",n==="default"&&["py-3 border-b focus:border-fg",c&&!u&&"border-fg",!c&&!u&&"border-border",u&&"border-fg-error"],n==="surface"&&["h-8 px-3 border rounded text-regular-12 bg-bg-soft focus:border-fg",u?"border-fg-error":"border-border"],e);return C("div",{className:"flex flex-col",children:[C("input",{className:m,value:p,onChange:f,...i},void 0,!1,void 0,this),t&&C("p",{className:"text-fg-error text-tight mt-3 mb-2",children:t},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{useState as W}from"react";import{jsxDEV as g}from"react/jsx-dev-runtime";function q(r){let{className:e,errorMessage:t,defaultValue:a,onChange:s,required:n,...i}=r,[p,l]=W(a||""),f=(h)=>{l(h.target.value),s?.(h)},u=!!t,c=!!p,m=!n,b=o("py-3 border-b text-tight text-fg placeholder:text-tight focus:outline-none placeholder:text-fg-soft focus:border-fg resize-none w-full h-20",c&&!u&&"border-fg",!c&&!u&&"border-border",u&&"border-fg-error",e);return g("div",{className:"flex flex-col",children:[g("div",{className:"relative w-full",children:[g("textarea",{className:b,value:p,onChange:f,rows:4,required:n,...i},void 0,!1,void 0,this),!c&&m&&g(y,{variant:"default",isActive:!0,className:"absolute top-2 right-0",text:"Optional"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),t&&g("p",{className:"text-fg-error text-tight mt-3 mb-2",children:t},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}import{jsxDEV as G}from"react/jsx-dev-runtime";function _({className:r,...e}){return G("div",{className:o("rounded-4 animate-skeleton-pulse bg-surface",r),...e},void 0,!1,void 0,this)}export{B as spacedWrapperVariants,v as cva,o as cn,q as Textarea,d as SpacedWrapper,_ as Skeleton,O as Input,L as IconButton,y as Chip,w as Button};
|