@keslers/kui 0.2.0 → 0.3.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/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { IconType } from 'react-icons';
4
4
 
5
5
  interface NavItem {
6
- label: string;
6
+ label: ReactNode;
7
7
  href?: string;
8
8
  onClick?: () => void;
9
9
  }
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import { ReactNode } from 'react';
3
3
  import { IconType } from 'react-icons';
4
4
 
5
5
  interface NavItem {
6
- label: string;
6
+ label: ReactNode;
7
7
  href?: string;
8
8
  onClick?: () => void;
9
9
  }
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import{useState as Ln}from"react";import"react";import{cva as Hr}from"class-vari
42
42
 
43
43
  If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
45
- For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},dn="DialogDescriptionWarning",un=({contentRef:t,descriptionId:e})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fr(dn).contentName}}.`;return y.useEffect(()=>{let n=t.current?.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(o))},[o,t,e]),null},Sr=fr,Br=vr,Wr=kr,oe=mr,ne=Lr,ie=Cr,ae=Rr;import{cva as pn}from"class-variance-authority";import{jsx as q,jsxs as mn}from"react/jsx-runtime";var Er=Sr,Pr=Br;var gn=Wr,Nr=dt.forwardRef(({className:t,...e},r)=>q(oe,{className:B("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));Nr.displayName=oe.displayName;var fn=pn("fixed z-50 gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),ce=dt.forwardRef(({side:t="right",className:e,children:r,...o},n)=>mn(gn,{children:[q(Nr,{}),q(ne,{ref:n,className:B(fn({side:t}),e),...o,children:r})]}));ce.displayName=ne.displayName;var xn=({className:t,...e})=>q("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",t),...e});xn.displayName="SheetHeader";var vn=({className:t,...e})=>q("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});vn.displayName="SheetFooter";var yn=dt.forwardRef(({className:t,...e},r)=>q(ie,{ref:r,className:B("text-lg font-semibold text-foreground",t),...e}));yn.displayName=ie.displayName;var kn=dt.forwardRef(({className:t,...e},r)=>q(ae,{ref:r,className:B("text-sm text-muted-foreground",t),...e}));kn.displayName=ae.displayName;import{Menu as wn,X as Cn}from"lucide-react";import{jsx as F,jsxs as le}from"react/jsx-runtime";function bn({navItems:t=[],logoHref:e="/",onLogoClick:r=()=>{},logo:o,secondaryLogo:n}){let[i,c]=Ln(!1);return F("header",{className:"sticky top-0 z-60 w-full border-b border-border/20 bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60 pointer-events-auto uppercase",style:{pointerEvents:"auto"},children:le("div",{className:"container flex h-16 items-center justify-between px-4 md:px-6",children:[le("a",{href:e,className:"flex items-center gap-1 cursor-pointer group",onClick:()=>{r(),c(!1)},children:[F("h1",{className:"font-ddin text-1xl md:text-2xl tracking-tight",children:o}),n&&F("span",{className:"font-ddin text-1xl md:text-2xl tracking-tight text-muted-foreground",children:n})]}),F("div",{className:"hidden md:flex items-center gap-6",children:F(()=>F(pe,{children:F(ge,{className:"gap-2 md:gap-6",children:t.map(l=>F(fe,{children:F(ve,{className:xe(),href:l.href,onClick:l.onClick,children:F("span",{className:"font-ddin text-1xl",children:l.label})})},l.label))})}),{})}),le(Er,{open:i,onOpenChange:c,children:[F(Pr,{asChild:!0,className:"md:hidden",children:F(ye,{variant:"ghost",size:"icon","aria-label":"Toggle menu",children:i?F(Cn,{className:"h-6 w-6"}):F(wn,{className:"h-6 w-6"})})}),F(ce,{side:"right",className:"w-100 border-l border-border/30 mt-16",children:F("div",{className:"flex min-h-[calc(100vh-5rem)] flex-col justify-center px-8 py-12 bg-background",children:F("nav",{className:"flex flex-col gap-12 md:gap-16",children:t.map(l=>F("a",{href:l.href,onClick:()=>{l.onClick&&l.onClick(),c(!1)},className:`
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return y.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},dn="DialogDescriptionWarning",un=({contentRef:t,descriptionId:e})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fr(dn).contentName}}.`;return y.useEffect(()=>{let n=t.current?.getAttribute("aria-describedby");e&&n&&(document.getElementById(e)||console.warn(o))},[o,t,e]),null},Sr=fr,Br=vr,Wr=kr,oe=mr,ne=Lr,ie=Cr,ae=Rr;import{cva as pn}from"class-variance-authority";import{jsx as q,jsxs as mn}from"react/jsx-runtime";var Er=Sr,Pr=Br;var gn=Wr,Nr=dt.forwardRef(({className:t,...e},r)=>q(oe,{className:B("fixed inset-0 z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));Nr.displayName=oe.displayName;var fn=pn("fixed z-50 gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),ce=dt.forwardRef(({side:t="right",className:e,children:r,...o},n)=>mn(gn,{children:[q(Nr,{}),q(ne,{ref:n,className:B(fn({side:t}),e),...o,children:r})]}));ce.displayName=ne.displayName;var xn=({className:t,...e})=>q("div",{className:B("flex flex-col space-y-2 text-center sm:text-left",t),...e});xn.displayName="SheetHeader";var vn=({className:t,...e})=>q("div",{className:B("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});vn.displayName="SheetFooter";var yn=dt.forwardRef(({className:t,...e},r)=>q(ie,{ref:r,className:B("text-lg font-semibold text-foreground",t),...e}));yn.displayName=ie.displayName;var kn=dt.forwardRef(({className:t,...e},r)=>q(ae,{ref:r,className:B("text-sm text-muted-foreground",t),...e}));kn.displayName=ae.displayName;import{Menu as wn,X as Cn}from"lucide-react";import{jsx as F,jsxs as le}from"react/jsx-runtime";function bn({navItems:t=[],logoHref:e="/",onLogoClick:r=()=>{},logo:o,secondaryLogo:n}){let[i,c]=Ln(!1);return F("header",{className:"sticky top-0 z-60 w-full border-b border-border/20 bg-background/95 backdrop-blur supports-backdrop-filter:bg-background/60 pointer-events-auto uppercase",style:{pointerEvents:"auto"},children:le("div",{className:"container flex h-16 items-center justify-between px-4 md:px-6",children:[le("a",{href:e,className:"flex items-center gap-1 cursor-pointer group",onClick:()=>{r(),c(!1)},children:[F("h1",{className:"font-ddin text-1xl md:text-2xl tracking-tight",children:o}),n&&F("span",{className:"font-ddin text-1xl md:text-2xl tracking-tight text-muted-foreground",children:n})]}),F("div",{className:"hidden md:flex items-center gap-6",children:F(()=>F(pe,{children:F(ge,{className:"gap-2 md:gap-6",children:t.map((l,s)=>F(fe,{children:F(ve,{className:xe(),href:l.href,onClick:l.onClick,children:typeof l.label=="string"?F("span",{className:"font-ddin text-1xl",children:l.label}):l.label})},l.href||(typeof l.label=="string"?l.label:s)))})}),{})}),le(Er,{open:i,onOpenChange:c,children:[F(Pr,{asChild:!0,className:"md:hidden",children:F(ye,{variant:"ghost",size:"icon","aria-label":"Toggle menu",children:i?F(Cn,{className:"h-6 w-6"}):F(wn,{className:"h-6 w-6"})})}),F(ce,{side:"right",className:"w-100 border-l border-border/30 mt-16",children:F("div",{className:"flex min-h-[calc(100vh-5rem)] flex-col justify-center px-8 py-12 bg-background",children:F("nav",{className:"flex flex-col gap-12 md:gap-16",children:t.map((l,s)=>F("a",{href:l.href,onClick:()=>{l.onClick&&l.onClick(),c(!1)},className:`
46
46
  w-full text-left
47
47
  text-3xl md:text-4xl
48
48
  font-ddin font-medium tracking-wider
@@ -51,5 +51,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
51
51
  py-4 px-4 rounded-lg
52
52
  hover:bg-muted/30 focus:outline-none focus:ring-2 focus:ring-ring
53
53
  block
54
- `,children:l.label},l.label))})})})]})]})})}import ut from"react";import Ar from"react";var se={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},de=Ar.createContext&&Ar.createContext(se);var Rn=["attr","size","title"];function Mn(t,e){if(t==null)return{};var r,o,n=jn(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jn(t,e){if(t==null)return{};var r={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;r[o]=t[o]}return r}function Ft(){return Ft=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Ft.apply(null,arguments)}function Or(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,o)}return r}function St(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(r),!0).forEach(function(o){Fn(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}function Fn(t,e,r){return(e=Sn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sn(t){var e=Bn(t,"string");return typeof e=="symbol"?e:e+""}function Bn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var o=r.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tr(t){return t&&t.map((e,r)=>ut.createElement(e.tag,St({key:r},e.attr),Tr(e.child)))}function Ir(t){return e=>ut.createElement(Wn,Ft({attr:St({},t.attr)},e),Tr(t.child))}function Wn(t){var e=r=>{var{attr:o,size:n,title:i}=t,c=Mn(t,Rn),a=n||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),ut.createElement("svg",Ft({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,c,{className:l,style:St(St({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&ut.createElement("title",null,i),t.children)};return de!==void 0?ut.createElement(de.Consumer,null,r=>e(r)):e(se)}function Dr(t){return Ir({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]},{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"},child:[]}]})(t)}import{jsx as z,jsxs as ue}from"react/jsx-runtime";function En({links:t=[],socials:e=[],copyright:r,...o}){return z("footer",{className:"bg-background pt-12 pb-8 w-full font-ddin uppercase text-[10px] sm:text-xs",...o,children:z("div",{className:"container mx-auto px-6 max-w-[1400px]",children:ue("div",{className:"flex flex-col md:flex-row items-center justify-between gap-6 md:gap-4 text-muted-foreground",children:[z("div",{className:"flex items-center gap-6 order-3 md:order-1",children:e.map(n=>{let i=n.icon;return z("a",{href:n.href,className:"hover:text-foreground transition-colors",target:"_blank",rel:"noopener noreferrer","aria-label":n.label??"Social link",children:z(i,{className:"w-4 h-4"})},n.href)})}),z("ul",{className:"flex flex-wrap justify-center items-center gap-6 md:gap-10 order-1 md:order-2 font-medium tracking-widest text-foreground",children:t.map(n=>z("li",{children:ue("a",{href:n.href,onClick:n.onClick,target:n.isExternal?"_blank":void 0,rel:n.isExternal?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 hover:text-muted-foreground transition-colors",children:[z("span",{children:n.label}),n.isExternal&&z(Dr,{className:"inline-block h-3.5 w-3.5 text-muted-foreground/60","aria-hidden":"true"})]})},n.href))}),r&&z("div",{className:"order-2 md:order-3 font-medium tracking-widest whitespace-nowrap",children:ue("a",{href:r?.companyUrl,target:"_blank",rel:"noopener noreferrer",className:"focus-visible:underline outline-none",children:["\xA9 ",new Date().getFullYear()," ",r?.companyName]})})]})})})}import{jsx as Nn,jsxs as An}from"react/jsx-runtime";function Pn({header:t,footer:e,children:r}){return An("div",{className:"min-h-screen bg-background text-foreground font-ddin flex flex-col",children:[t,Nn("div",{className:"flex-1",children:r}),e]})}export{En as Footer,bn as Header,Pn as Layout};
54
+ `,children:typeof l.label=="string"?F("span",{className:"font-ddin",children:l.label}):l.label},l.href||(typeof l.label=="string"?l.label:s)))})})})]})]})})}import ut from"react";import Ar from"react";var se={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},de=Ar.createContext&&Ar.createContext(se);var Rn=["attr","size","title"];function Mn(t,e){if(t==null)return{};var r,o,n=jn(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(o=0;o<i.length;o++)r=i[o],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function jn(t,e){if(t==null)return{};var r={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(e.indexOf(o)!==-1)continue;r[o]=t[o]}return r}function Ft(){return Ft=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},Ft.apply(null,arguments)}function Or(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,o)}return r}function St(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Or(Object(r),!0).forEach(function(o){Fn(t,o,r[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Or(Object(r)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(r,o))})}return t}function Fn(t,e,r){return(e=Sn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sn(t){var e=Bn(t,"string");return typeof e=="symbol"?e:e+""}function Bn(t,e){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var o=r.call(t,e||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Tr(t){return t&&t.map((e,r)=>ut.createElement(e.tag,St({key:r},e.attr),Tr(e.child)))}function Ir(t){return e=>ut.createElement(Wn,Ft({attr:St({},t.attr)},e),Tr(t.child))}function Wn(t){var e=r=>{var{attr:o,size:n,title:i}=t,c=Mn(t,Rn),a=n||r.size||"1em",l;return r.className&&(l=r.className),t.className&&(l=(l?l+" ":"")+t.className),ut.createElement("svg",Ft({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,o,c,{className:l,style:St(St({color:t.color||r.color},r.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&ut.createElement("title",null,i),t.children)};return de!==void 0?ut.createElement(de.Consumer,null,r=>e(r)):e(se)}function Dr(t){return Ir({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"},child:[]},{tag:"polyline",attr:{points:"15 3 21 3 21 9"},child:[]},{tag:"line",attr:{x1:"10",y1:"14",x2:"21",y2:"3"},child:[]}]})(t)}import{jsx as z,jsxs as ue}from"react/jsx-runtime";function En({links:t=[],socials:e=[],copyright:r,...o}){return z("footer",{className:"bg-background pt-12 pb-8 w-full font-ddin uppercase text-[10px] sm:text-xs",...o,children:z("div",{className:"container mx-auto px-6 max-w-[1400px]",children:ue("div",{className:"flex flex-col md:flex-row items-center justify-between gap-6 md:gap-4 text-muted-foreground",children:[z("div",{className:"flex items-center gap-6 order-3 md:order-1",children:e.map(n=>{let i=n.icon;return z("a",{href:n.href,className:"hover:text-foreground transition-colors",target:"_blank",rel:"noopener noreferrer","aria-label":n.label??"Social link",children:z(i,{className:"w-4 h-4"})},n.href)})}),z("ul",{className:"flex flex-wrap justify-center items-center gap-6 md:gap-10 order-1 md:order-2 font-medium tracking-widest text-foreground",children:t.map(n=>z("li",{children:ue("a",{href:n.href,onClick:n.onClick,target:n.isExternal?"_blank":void 0,rel:n.isExternal?"noopener noreferrer":void 0,className:"inline-flex items-center gap-1.5 hover:text-muted-foreground transition-colors",children:[z("span",{children:n.label}),n.isExternal&&z(Dr,{className:"inline-block h-3.5 w-3.5 text-muted-foreground/60","aria-hidden":"true"})]})},n.href))}),r&&z("div",{className:"order-2 md:order-3 font-medium tracking-widest whitespace-nowrap",children:ue("a",{href:r?.companyUrl,target:"_blank",rel:"noopener noreferrer",className:"focus-visible:underline outline-none",children:["\xA9 ",new Date().getFullYear()," ",r?.companyName]})})]})})})}import{jsx as Nn,jsxs as An}from"react/jsx-runtime";function Pn({header:t,footer:e,children:r}){return An("div",{className:"min-h-screen bg-background text-foreground font-ddin flex flex-col",children:[t,Nn("div",{className:"flex-1",children:r}),e]})}export{En as Footer,bn as Header,Pn as Layout};
55
55
  //# sourceMappingURL=index.js.map