@themodcraft/pro-kit 0.0.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/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/profile-images.d.ts +20 -0
- package/dist/auth/profile-images.js +1 -0
- package/dist/components/banner/Banner.d.ts +2 -0
- package/dist/components/banner/Banner.js +1 -0
- package/dist/components/banner/Banner.types.d.ts +8 -0
- package/dist/components/banner/Banner.types.js +0 -0
- package/dist/components/banner/index.d.ts +2 -0
- package/dist/components/banner/index.js +1 -0
- package/dist/components/container/Container.d.ts +2 -0
- package/dist/components/container/Container.js +1 -0
- package/dist/components/container/Container.types.d.ts +21 -0
- package/dist/components/container/Container.types.js +0 -0
- package/dist/components/container/container.module.css +1 -0
- package/dist/components/container/index.d.ts +2 -0
- package/dist/components/container/index.js +1 -0
- package/dist/components/navbar/Navbar.d.ts +2 -0
- package/dist/components/navbar/Navbar.js +1 -0
- package/dist/components/navbar/Navbar.types.d.ts +70 -0
- package/dist/components/navbar/Navbar.types.js +0 -0
- package/dist/components/navbar/NavbarFromConfig.d.ts +4 -0
- package/dist/components/navbar/NavbarFromConfig.js +1 -0
- package/dist/components/navbar/NavbarProvider.d.ts +13 -0
- package/dist/components/navbar/NavbarProvider.js +1 -0
- package/dist/components/navbar/configs/community.navbar.config.json +61 -0
- package/dist/components/navbar/configs/dashboard.navbar.config.json +92 -0
- package/dist/components/navbar/configs/docs.navbar.config.json +94 -0
- package/dist/components/navbar/configs/registry/index.d.ts +1 -0
- package/dist/components/navbar/configs/registry/index.js +1 -0
- package/dist/components/navbar/configs/registry/navbar-configs.d.ts +8 -0
- package/dist/components/navbar/configs/registry/navbar-configs.js +1 -0
- package/dist/components/navbar/configs/themodcraft-v3.navbar.config.json +86 -0
- package/dist/components/navbar/index.d.ts +11 -0
- package/dist/components/navbar/index.js +1 -0
- package/dist/components/navbar/navbar.config.schema.json +225 -0
- package/dist/components/navbar/navbar.default.config.json +83 -0
- package/dist/components/navbar/style_navbar.module.css +1 -0
- package/dist/components/overlay/Overlay.d.ts +2 -0
- package/dist/components/overlay/Overlay.js +13 -0
- package/dist/components/overlay/Overlay.module.css +1 -0
- package/dist/components/overlay/Overlay.types.d.ts +9 -0
- package/dist/components/overlay/Overlay.types.js +0 -0
- package/dist/components/overlay/index.d.ts +2 -0
- package/dist/components/overlay/index.js +1 -0
- package/dist/components/slider/Slider.d.ts +2 -0
- package/dist/components/slider/Slider.js +1 -0
- package/dist/components/slider/Slider.types.d.ts +17 -0
- package/dist/components/slider/Slider.types.js +0 -0
- package/dist/components/slider/SliderFromConfig.d.ts +4 -0
- package/dist/components/slider/SliderFromConfig.js +1 -0
- package/dist/components/slider/index.d.ts +3 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/soon/Soon.d.ts +2 -0
- package/dist/components/soon/Soon.js +1 -0
- package/dist/components/soon/Soon.types.d.ts +10 -0
- package/dist/components/soon/Soon.types.js +0 -0
- package/dist/components/soon/SoonFromConfig.d.ts +4 -0
- package/dist/components/soon/SoonFromConfig.js +1 -0
- package/dist/components/soon/index.d.ts +3 -0
- package/dist/components/soon/index.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1 -0
- package/package.json +40 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { buildGravatarImageUrl, decodeJwtUserProfile, getProfileInitials, resolveProfileImage, type GravatarImageOptions, type ProfileImageProvider, type ResolveProfileImageOptions, type UserProfile, } from "./profile-images";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{buildGravatarImageUrl as l,decodeJwtUserProfile as o,getProfileInitials as a,resolveProfileImage as i}from"./profile-images";export{l as buildGravatarImageUrl,o as decodeJwtUserProfile,a as getProfileInitials,i as resolveProfileImage};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface UserProfile {
|
|
2
|
+
email?: string | null;
|
|
3
|
+
image?: string | null;
|
|
4
|
+
name?: string | null;
|
|
5
|
+
username?: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface GravatarImageOptions {
|
|
8
|
+
defaultImage?: "404" | "mp" | "identicon" | "monsterid" | "wavatar" | "retro" | "robohash" | "blank";
|
|
9
|
+
rating?: "g" | "pg" | "r" | "x";
|
|
10
|
+
size?: number;
|
|
11
|
+
}
|
|
12
|
+
export type ProfileImageProvider = "explicit" | "gravatar" | "initials";
|
|
13
|
+
export interface ResolveProfileImageOptions {
|
|
14
|
+
gravatar?: GravatarImageOptions;
|
|
15
|
+
provider?: ProfileImageProvider;
|
|
16
|
+
}
|
|
17
|
+
export declare function decodeJwtUserProfile(token: string): UserProfile | null;
|
|
18
|
+
export declare function buildGravatarImageUrl(email: string, { defaultImage, rating, size }?: GravatarImageOptions): Promise<string | null>;
|
|
19
|
+
export declare function getProfileInitials(profile?: UserProfile | null): string;
|
|
20
|
+
export declare function resolveProfileImage(profile: UserProfile | null | undefined, { gravatar, provider }?: ResolveProfileImageOptions): Promise<string | null>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function o(e){const a=e.replace(/-/g,"+").replace(/_/g,"/"),t=a.padEnd(a.length+(4-a.length%4)%4,"=");return typeof globalThis.atob=="function"?globalThis.atob(t):""}function c(e){const[,a]=e.split(".");if(!a)return null;try{const t=JSON.parse(o(a));return{email:typeof t.email=="string"?t.email:null,image:typeof t.image=="string"?t.image:typeof t.picture=="string"?t.picture:typeof t.avatar_url=="string"?t.avatar_url:null,name:typeof t.name=="string"?t.name:null,username:typeof t.username=="string"?t.username:null}}catch{return null}}async function s(e){if(!globalThis.crypto?.subtle)return null;const a=new TextEncoder().encode(e),t=await globalThis.crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}async function u(e,{defaultImage:a="mp",rating:t="g",size:n=80}={}){const l=e.trim().toLowerCase(),r=await s(l);if(!r)return null;const i=new URLSearchParams({d:a,r:t,s:String(n)});return`https://www.gravatar.com/avatar/${r}?${i.toString()}`}function m(e){return(e?.name??e?.username??e?.email??"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(n=>n[0]?.toUpperCase()).join("")}async function g(e,{gravatar:a,provider:t="explicit"}={}){return e?(t==="explicit"||t==="gravatar")&&e.image?e.image:t==="gravatar"&&e.email?u(e.email,a):null:null}export{u as buildGravatarImageUrl,c as decodeJwtUserProfile,m as getProfileInitials,g as resolveProfileImage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as a}from"react/jsx-runtime";import{LicenseGate as n,TMC_ENTITLEMENTS as o}from"@themodcraft/license-client";import{resolveAssetPath as m}from"@themodcraft/core-ui";function h({children:l,className:i,imageUrl:r,subtitle:t,title:s}){return e(n,{required:o.proKit,children:a("div",{className:["relative flex min-h-[320px] items-end overflow-hidden bg-zinc-950 p-6 text-white sm:min-h-[420px] sm:p-10",i].filter(Boolean).join(" "),children:[e("img",{alt:"",className:"absolute inset-0 h-full w-full object-cover opacity-70",src:m(r)}),e("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-black/25 to-transparent"}),a("div",{className:"relative z-10 max-w-3xl",children:[s?e("h1",{className:"text-4xl font-semibold tracking-tight sm:text-6xl",children:s}):null,t?e("p",{className:"mt-4 max-w-xl text-base text-zinc-200",children:t}):null,l]})]})})}export{h as Banner};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Banner as n}from"./Banner";export{n as Banner};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { ContainerProps } from "./Container.types";
|
|
2
|
+
export declare function Container({ backgroundImage, border, children, className, height, imageAlt, imageUrl, margin, onPointerCancel, onPointerDown, onPointerLeave, onPointerMove, onPointerUp, padding, scrollDrag, scrolldrag, style, width, ...props }: ContainerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as N,jsxs as K}from"react/jsx-runtime";import W from"@emotion/styled";import{resolveAssetPath as j}from"@themodcraft/core-ui";import{LicenseGate as Z,TMC_ENTITLEMENTS as J}from"@themodcraft/license-client";import{useEffect as O,useMemo as Q,useRef as Y,useState as y}from"react";import m from"./container.module.css";const ee={"1/8":"12.5%","1/7":"14.2857%","1/6":"16.6667%","1/5":"20%","1/4":"25%","1/3":"33.3333%","1/2":"50%",full:"-webkit-fill-available"},ne=W("div",{shouldForwardProp:e=>e!=="containerStyles"})(({containerStyles:e})=>e);function b(e){if(e!==void 0)return typeof e=="number"?`${e}px`:e}function C(e){return e===void 0||e==="0"||e==="0px"||e==="0rem"||e==="0em"||e==="0%"}function re(e){return/^#[0-9a-f]{6}$/i.test(e)}function te(e,r){if(!re(e))return"#000000";let i=Number.parseInt(e.slice(1,3),16),a=Number.parseInt(e.slice(3,5),16),t=Number.parseInt(e.slice(5,7),16);return i=Math.max(0,i-r),a=Math.max(0,a-r),t=Math.max(0,t-r),`#${[i,a,t].map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function oe(e){const r=e.match(/\d+/g);if(!r||r.length<3)return null;const[i,a,t]=r.map(Number);return`#${[i,a,t].map(s=>s.toString(16).padStart(2,"0")).join("").toUpperCase()}`}function ue({backgroundImage:e,border:r=!1,children:i,className:a,height:t="auto",imageAlt:s="container background",imageUrl:h,margin:$=0,onPointerCancel:D,onPointerDown:V,onPointerLeave:E,onPointerMove:T,onPointerUp:X,padding:R,scrollDrag:U=!1,scrolldrag:v=!1,style:P,width:S="full",..._}){const o=Y(null),[B,H]=y(null),[d,x]=y({dragging:!1,scrollLeft:0,startX:0}),l=U||v,c=e?j(e):void 0,k=h?j(h):void 0,w=ee[S]??S,u=b($),f=b(R),L=C(u)?w:`calc(${w} - (${u} * 2))`,M=te(B??"#000000",60),g=Q(()=>({...P,"--border-color":M,backgroundImage:c?`url(${c})`:void 0,backgroundPosition:c?"center":void 0,backgroundSize:c?"cover":void 0,border:r?"1px solid var(--border-color)":void 0,borderRadius:r?"var(--border-radius)":void 0,cursor:l?d.dragging?"grabbing":"grab":void 0,height:b(t),margin:C(u)?void 0:u,padding:C(f)?void 0:f,userSelect:l?"none":void 0,width:L}),[r,M,L,l,d.dragging,t,u,f,c,P]);O(()=>{if(!o.current)return;const n=window.getComputedStyle(o.current).backgroundColor,I=oe(n);I&&H(I)},[g.background,g.backgroundColor]);function q(n){V?.(n),!(n.defaultPrevented||!l||!o.current)&&(o.current.setPointerCapture(n.pointerId),x({dragging:!0,scrollLeft:o.current.scrollLeft,startX:n.clientX}))}function z(n){T?.(n),!(n.defaultPrevented||!l||!d.dragging||!o.current)&&(n.preventDefault(),o.current.scrollLeft=d.scrollLeft-(n.clientX-d.startX)*2)}function A(n){D?.(n),p()}function F(n){E?.(n),p()}function G(n){X?.(n),p()}function p(){x(n=>({...n,dragging:!1}))}return N(Z,{required:J.proKit,children:K(ne,{className:[m.container,l?m.scrollDrag:"",a].filter(Boolean).join(" "),onPointerCancel:A,onPointerDown:q,onPointerLeave:F,onPointerMove:z,onPointerUp:G,ref:o,containerStyles:g,..._,children:[k?N("img",{alt:s,className:m.bgImage,draggable:!1,height:1080,src:k,width:2048}):null,i]})})}export{ue as Container};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { CSSObject, Interpolation } from "@emotion/react";
|
|
2
|
+
import type { HTMLAttributes, PointerEvent, ReactNode } from "react";
|
|
3
|
+
export type ContainerWidth = "1/8" | "1/7" | "1/6" | "1/5" | "1/4" | "1/3" | "1/2" | "full" | string;
|
|
4
|
+
export type ContainerCssValue = Interpolation<unknown>;
|
|
5
|
+
export type ContainerEmotionStyles = CSSObject;
|
|
6
|
+
export type ContainerPrimitiveStyleValue = boolean | null | number | string | undefined;
|
|
7
|
+
export interface ContainerProps extends Omit<HTMLAttributes<HTMLDivElement>, "style"> {
|
|
8
|
+
backgroundImage?: string;
|
|
9
|
+
border?: boolean;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
height?: number | string;
|
|
12
|
+
imageAlt?: string;
|
|
13
|
+
imageUrl?: string;
|
|
14
|
+
margin?: number | string;
|
|
15
|
+
padding?: number | string;
|
|
16
|
+
scrollDrag?: boolean;
|
|
17
|
+
scrolldrag?: boolean;
|
|
18
|
+
style?: ContainerEmotionStyles;
|
|
19
|
+
width?: ContainerWidth;
|
|
20
|
+
}
|
|
21
|
+
export type ContainerPointerEvent = PointerEvent<HTMLDivElement>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.i{position:relative;z-index:1;width:-webkit-fill-available;height:-webkit-fill-available;padding:1rem;margin:1rem;overflow:clip;color:#fff;background-color:inherit;border:2px solid #00000000;border-radius:0;scrollbar-color:var(--primary1) #00000000}.e{touch-action:pan-y}.o{position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:cover;user-select:none;pointer-events:none}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Container as e}from"./Container";export{e as Container};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as r,jsxs as p,Fragment as H}from"react/jsx-runtime";import{resolveAssetPath as Q}from"@themodcraft/core-ui";import{LicenseGate as X,TMC_ENTITLEMENTS as Y}from"@themodcraft/license-client";import{useCallback as ee,useEffect as L,useMemo as ne,useRef as I,useState as C}from"react";import{decodeJwtUserProfile as re,getProfileInitials as te,resolveProfileImage as ie}from"../../auth";import e from"./style_navbar.module.css";function w(...n){return n.filter(Boolean).join(" ")}function O(n){return n.id??`${n.label}-${n.href??"group"}`}function K(n){return n.href??"#"}function M(n){return n.external?"_blank":void 0}function R(n){return n.external?"noreferrer":void 0}function le(n){return n instanceof Element?n:n instanceof Node?n.parentElement:null}function oe({open:n=!1}){return r("svg",{className:w(e["ac-gn-ic"],n?e["ac-gn-ic-open"]:void 0),viewBox:"0 0 60 40",children:p("g",{stroke:"var(--primary-text)",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"4",children:[r("path",{className:e["ac-gn-ic-top-line"],d:"M10,10 L50,10 Z"}),r("path",{className:e["ac-gn-ic-middle-line"],d:"M10,20 L50,20 Z"}),r("path",{className:e["ac-gn-ic-bottom-line"],d:"M10,30 L50,30 Z"})]})})}function F({brand:n}){return n.logoSrc?r("img",{alt:n.label,src:Q(n.logoSrc),style:{height:"100%",objectFit:"contain",width:"100%"}}):r("span",{"aria-label":n.label,title:n.label,children:n.mark??n.label.slice(0,3)})}function ae({brand:n}){const i=r(F,{brand:n});return r("div",{className:e["ac-gn-logo-container"],children:r("div",{className:e["ac-gn-logo-cont"],children:n.href?r("a",{href:n.href,children:i}):i})})}function W({classPrefix:n,items:i,openDropdownKey:s,onDropdownKeyChange:c,variant:a}){const l=I(null),b=a==="sidebar"?"sc-gn-item":a==="dropdown"?"ac-dn-item":"ac-gn-item",g=a==="sidebar"?"sc-gn-link":a==="dropdown"?"ac-dn-link":"ac-gn-link";L(()=>()=>{l.current&&clearTimeout(l.current)},[]);function N(){l.current&&(clearTimeout(l.current),l.current=null)}function h(u){N(),c?.(u)}function v(){N(),c?.(null)}function y(){N(),l.current=setTimeout(()=>{c?.(null),l.current=null},180)}function o(u,D){return u.map((t,k)=>{const d=`${D}-${k}-${O(t)}`,f=!!t.children?.length;return p("li",{className:e["ac-gn-sub-item"],children:[r("a",{className:e["ac-gn-sub-link"],href:K(t),rel:R(t),target:M(t),children:t.label}),f?r("ul",{className:w(e["ac-gn-sub-list"],a==="sidebar"?e.navSidebarSubList:void 0),children:o(t.children??[],d)}):null]},d)})}function S(u,D){return u.map((t,k)=>{const d=`${D}-${k}-${O(t)}`,f=!!t.children?.length;return p("li",{className:e["ac-gn-sub-item"],role:"none",children:[p("a",{className:e["ac-gn-sub-link"],href:K(t),onClick:m=>{t.href||m.preventDefault()},rel:R(t),role:"menuitem",target:M(t),children:[r("span",{children:t.label}),f?r("span",{"aria-hidden":"true",className:e.navSubHint,children:"\u203A"}):null]}),f?r("ul",{className:e.navDropdownNestedList,children:S(t.children??[],d)}):null]},d)})}return r(H,{children:i.map((u,D)=>{const t=`${a}-${D}-${O(u)}`,k=!!u.children?.length,d=a==="desktop"&&k,f=d&&s===t;return p("li",{className:w(e[b],a!=="dropdown"?e[`${n}-gn-item-menu`]:void 0),onBlur:d?m=>{m.currentTarget.contains(m.relatedTarget)||v()}:void 0,onKeyDown:d?m=>{m.key==="Escape"&&v()}:void 0,onPointerEnter:d?()=>h(t):void 0,onPointerLeave:d?y:void 0,children:[p("a",{"aria-current":u.current?"page":void 0,"aria-expanded":d?f:void 0,"aria-haspopup":d?"menu":void 0,className:w(e[g],d?e.navDropdownTrigger:void 0),"data-state":f?"open":"closed",href:K(u),onClick:d?m=>{m.preventDefault(),m.stopPropagation(),f?v():h(t)}:void 0,onKeyDown:d?m=>{(m.key==="Enter"||m.key===" "||m.key==="ArrowDown")&&(m.preventDefault(),h(t))}:void 0,rel:R(u),target:M(u),children:[u.label,d?r("span",{"aria-hidden":"true",className:e.navChevron,children:"\u2304"}):null]}),k?d?r("ul",{className:w(e["ac-gn-sub-list"],e.navDropdownContent,f?e["ac-gn-sub-list-open"]:void 0),"data-state":f?"open":"closed",role:"menu",children:S(u.children??[],t)}):r("ul",{className:w(e["ac-gn-sub-list"],a==="sidebar"?e.navSidebarSubList:void 0),children:o(u.children??[],t)}):null]},t)})})}function Z({brand:n,enabled:i,isOpen:s,logoAsTrigger:c,onToggle:a,setToggleButton:l}){const b=I(null),g=I(!1);L(()=>{l(b.current)},[l]);function N(o){o.pointerType==="mouse"&&o.button!==0||(o.preventDefault(),o.stopPropagation(),g.current=!0,a())}function h(o){o.preventDefault(),o.stopPropagation()}function v(o){if(o.preventDefault(),o.stopPropagation(),g.current){g.current=!1;return}a()}function y(o){(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation(),g.current=!0,a())}return i?r("li",{className:w(e["ac-gn-item"],e["ac-gn-item-menu"],e["ac-gn-Sidebar"]),children:r("a",{"aria-expanded":s,"aria-label":s?"Close navigation menu":"Open navigation menu",className:w(e.openSidebarLink,e["ac-gn-link"],e["ac-gn-link-Sidebar"]),"data-navbar-toggle":"true",href:"#",onClick:v,onKeyDown:y,onMouseDown:h,onPointerDown:N,ref:b,role:"button",children:c&&n&&!s?r("span",{className:e.navMenuBrandIcon,children:r(F,{brand:n})}):r(oe,{open:s})})}):null}function se({brand:n,items:i,logoAsTrigger:s,maxDesktopItems:c,onOverflowItemsChange:a,sidebarEnabled:l,sidebarOpen:b,setToggleButton:g,toggleSidebar:N}){const h=I(null),v=I(null),[y,o]=C(c??i.length),[S,u]=C(!1),[D,t]=C(null),k=ee(()=>{const f=h.current,m=v.current;if(!f||!m)return;const x=Array.from(m.children),_=x[0]?.offsetWidth??0,$=f.clientWidth,T=Math.min(c??i.length,i.length),j=x.slice(1,T+1).map(P=>P.offsetWidth),V=j.reduce((P,E)=>P+E,0),q=T<i.length,G=V>$-(l?_:0),A=q||G,J=Math.max($-(A||l?_:0)-8,0);let z=0,B=0;if(!A){u(!1),o(T),a([]);return}for(let P=0;P<T;P+=1){const E=j[P];if(!E)break;const U=z+E;if(U>J)break;z=U,B+=1}u(!0),o(B),a(i.slice(B))},[i,c,a,l]);L(()=>{if(k(),!h.current||typeof ResizeObserver>"u")return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k);const f=new ResizeObserver(k);return f.observe(h.current),()=>f.disconnect()},[k]),L(()=>{if(!D)return;function f(m){const x=m.target;x instanceof Node&&h.current?.contains(x)||t(null)}return window.addEventListener("pointerdown",f),()=>window.removeEventListener("pointerdown",f)},[D]),L(()=>{t(null)},[y]);const d=i.slice(0,y);return r("nav",{className:e["ac-globalnav"],onKeyDown:f=>{f.key==="Escape"&&t(null)},ref:h,children:p("div",{className:e["ac-gn-content"],children:[p("ul",{className:e["ac-gn-list"],children:[r(Z,{brand:n,enabled:l||S,isOpen:b,logoAsTrigger:s,onToggle:()=>{t(null),N()},setToggleButton:g}),r(W,{classPrefix:"ac",items:d,onDropdownKeyChange:t,openDropdownKey:D,variant:"desktop"})]}),p("ul",{"aria-hidden":"true",className:w(e["ac-gn-list"],e["ac-gn-measure-list"]),ref:v,children:[r(Z,{brand:n,enabled:!0,isOpen:!1,logoAsTrigger:s,onToggle:()=>{},setToggleButton:()=>{}}),r(W,{classPrefix:"ac",items:c?i.slice(0,c):i,variant:"desktop"})]})]})})}function ce({display:n="field",enabled:i,placeholder:s}){return i?n==="icon"?r("button",{"aria-label":s??"Search",className:w(e.search_frame,e.searchIconOnly),type:"button",children:r("span",{"aria-hidden":"true",children:"\u2315"})}):p("div",{className:e.search_frame,children:[r("div",{className:w(e.search_icon,e.search_spacing),children:r("span",{"aria-hidden":"true",children:"\u2315"})}),r("div",{className:w(e.search,e.search_spacing),children:r("input",{"aria-label":"Search field",autoComplete:"on",className:e.search_input,placeholder:s??"Search..."})})]}):null}function de(n){const[i,s]=C(n?.profile??null),[c,a]=C(n?.profile?.image??null);return L(()=>{let l=!1;async function b(){let g=n?.profile??null;if(!g&&n?.tokenStorageKey&&typeof window<"u"){const h=window.localStorage.getItem(n.tokenStorageKey);g=h?re(h):null}const N=await ie(g,{gravatar:n?.gravatar,provider:n?.profileImageProvider??"explicit"});l||(s(g),a(N))}return b(),()=>{l=!0}},[n]),{profile:i,profileImage:c}}function ue({auth:n}){const i=n?.enabled??!1,{profile:s,profileImage:c}=de(n);if(L(()=>{typeof window<"u"&&window.localStorage.setItem("loginReferrer",window.location.href)},[]),!i)return null;function a(l){if(n?.onLogout){l.preventDefault(),n.onLogout();return}n?.tokenStorageKey&&typeof window<"u"&&window.localStorage.removeItem(n.tokenStorageKey)}return p("div",{className:e["nav-login"],children:[r("div",{className:e["account-img"],children:c?r("img",{alt:s?.name??s?.username??"User profile",src:c}):r("span",{"aria-hidden":"true",children:te(s)||"\u25EF"})}),r("div",{className:e["login-menu"],children:r("ul",{className:e["login-nav"],children:s?p(H,{children:[r("li",{className:e["login-item"],children:r("a",{className:e["login-item-link"],href:n?.settingsUrl??"/account/settings",children:"Settings"})}),r("li",{className:e["login-item"],children:r("a",{className:e["login-item-link"],href:n?.logoutUrl??"#",onClick:a,children:"Logout"})})]}):r("li",{className:e["login-item"],children:r("a",{className:e["login-item-link"],href:n?.loginUrl??"/login",children:"Login"})})})})]})}function fe({brand:n,enabled:i,items:s,mode:c,onClose:a,open:l,sidebar:b,toggleButton:g}){const N=I(null);if(L(()=>{function v(y){if(y.pointerType==="mouse"&&y.button!==0)return;const o=y.target,S=le(o);!(o instanceof Node)||S?.closest("[data-navbar-toggle='true']")||l&&!N.current?.contains(o)&&!g?.contains(o)&&y.button===0&&a()}return window.addEventListener("pointerdown",v),()=>window.removeEventListener("pointerdown",v)},[a,l,g]),!i)return null;const h=c==="overflow"?s:b?.items?.length?b.items:s;return r("aside",{className:e["sidebar-sec"],children:r("div",{className:w(e.sidebar,c==="overflow"?e.sidebarMobile:void 0,l?e.open:void 0),ref:N,children:p("ul",{className:e["sc-gn-list"],children:[r("li",{className:e["sc-gn-item"],children:r("span",{className:e["sc-gn-link"],children:b?.title??n.label})}),r(W,{classPrefix:"sc",items:h,variant:"sidebar"}),r("li",{className:w(e["ac-gn-item"],e["ac-gn-item-menu"],e["ac-gn-Sidebar"]),children:p("a",{className:w(e.closeButton,e["sc-gn-link"]),href:"#",onClick:v=>{v.preventDefault(),a()},children:[r("span",{className:e.closeButtonIcon,"aria-hidden":"true",children:"\xD7"}),r("span",{children:b?.closeLabel??"Close Sidebar"})]})})]})})})}function Ne({auth:n,brand:i,className:s,items:c,maxDesktopItems:a,search:l,sidebar:b}){const[g,N]=C(!1),[h,v]=C(null),[y,o]=C([]),S=!!b?.enabled,u=y.length>0,D=i.logoPosition==="menu",t=S||D,k=ne(()=>c,[c]);return p(X,{required:Y.proKit,children:[p("header",{className:w(e["header-sec"],s),children:[D?null:r(ae,{brand:i}),p("div",{className:e.header_bar,children:[r(se,{brand:i,items:k,logoAsTrigger:D,maxDesktopItems:a,onOverflowItemsChange:o,sidebarEnabled:t,setToggleButton:v,sidebarOpen:g,toggleSidebar:()=>N(d=>!d)}),p("div",{className:e["search-login-aligner"],children:[r(ce,{display:l?.display,enabled:l?.enabled,placeholder:l?.placeholder}),r(ue,{auth:n})]})]})]}),r(fe,{brand:i,enabled:t||u,items:k,mode:u?"overflow":"sidebar",onClose:()=>N(!1),open:g,sidebar:b,toggleButton:h})]})}export{Ne as Navbar};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ComponentConfig } from "@themodcraft/core-ui";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { GravatarImageOptions, ProfileImageProvider, UserProfile } from "../../auth";
|
|
4
|
+
export interface NavbarBrand {
|
|
5
|
+
href?: string;
|
|
6
|
+
label: string;
|
|
7
|
+
logoPosition?: "center" | "menu";
|
|
8
|
+
logoSrc?: string;
|
|
9
|
+
mark?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface NavbarItem {
|
|
12
|
+
children?: NavbarItem[];
|
|
13
|
+
current?: boolean;
|
|
14
|
+
external?: boolean;
|
|
15
|
+
href?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
export interface NavbarAction {
|
|
20
|
+
href: string;
|
|
21
|
+
label: string;
|
|
22
|
+
variant?: "primary" | "secondary";
|
|
23
|
+
}
|
|
24
|
+
export interface NavbarAuthConfig {
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
gravatar?: GravatarImageOptions;
|
|
27
|
+
loginUrl?: string;
|
|
28
|
+
logoutUrl?: string;
|
|
29
|
+
onLogout?: () => void;
|
|
30
|
+
profile?: UserProfile | null;
|
|
31
|
+
profileImageProvider?: ProfileImageProvider;
|
|
32
|
+
settingsUrl?: string;
|
|
33
|
+
tokenStorageKey?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface NavbarSearchConfig {
|
|
36
|
+
display?: "field" | "icon";
|
|
37
|
+
enabled?: boolean;
|
|
38
|
+
placeholder?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface NavbarProps {
|
|
41
|
+
actions?: NavbarAction[];
|
|
42
|
+
auth?: NavbarAuthConfig;
|
|
43
|
+
brand: NavbarBrand;
|
|
44
|
+
className?: string;
|
|
45
|
+
dropdown?: boolean;
|
|
46
|
+
items: NavbarItem[];
|
|
47
|
+
maxDesktopItems?: number;
|
|
48
|
+
search?: NavbarSearchConfig;
|
|
49
|
+
sidebar?: NavbarSidebarConfig;
|
|
50
|
+
sticky?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface NavbarSidebarConfig {
|
|
53
|
+
closeLabel?: string;
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
items?: NavbarItem[];
|
|
56
|
+
label?: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
}
|
|
59
|
+
export type NavbarConfig = ComponentConfig<"pro-kit.navbar", NavbarProps>;
|
|
60
|
+
export type NavbarConfigRegistry = Record<string, NavbarConfig>;
|
|
61
|
+
export interface NavbarProviderProps {
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
configs: NavbarConfigRegistry;
|
|
64
|
+
defaultConfigKey?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface NavbarConfigScopeProps {
|
|
67
|
+
children: ReactNode;
|
|
68
|
+
config?: NavbarConfig;
|
|
69
|
+
configKey: string;
|
|
70
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{readConfigProps as i}from"@themodcraft/core-ui";import{Navbar as m}from"./Navbar";function n({config:r}){return o(m,{...i(r)})}export{n as NavbarFromConfig};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NavbarConfig, NavbarConfigRegistry, NavbarConfigScopeProps, NavbarProviderProps } from "./Navbar.types";
|
|
2
|
+
interface NavbarContextValue {
|
|
3
|
+
activeConfig?: NavbarConfig;
|
|
4
|
+
activeConfigKey: string;
|
|
5
|
+
configs: NavbarConfigRegistry;
|
|
6
|
+
registerNavbarConfig: (key: string, config: NavbarConfig) => void;
|
|
7
|
+
setActiveConfigKey: (key: string) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function NavbarProvider({ children, configs, defaultConfigKey, }: NavbarProviderProps): import("react").JSX.Element;
|
|
10
|
+
export declare function useNavbarConfig(): NavbarContextValue;
|
|
11
|
+
export declare function NavbarSlot(): import("react").JSX.Element | null;
|
|
12
|
+
export declare function NavbarConfigScope({ children, config, configKey, }: NavbarConfigScopeProps): import("react").ReactNode;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as a}from"react/jsx-runtime";import{createContext as x,useCallback as N,useContext as d,useEffect as m,useMemo as j,useState as u}from"react";import{Navbar as y}from"./Navbar";const c=x(null);function k({children:e,configs:t,defaultConfigKey:o}){const n=o??Object.keys(t)[0]??"",[r,v]=u(t),[i,C]=u(n),s=N((g,l)=>{v(p=>({...p,[g]:l}))},[]),b=j(()=>({activeConfig:r[i],activeConfigKey:i,configs:r,registerNavbarConfig:s,setActiveConfigKey:C}),[i,s,r]);return a(c.Provider,{value:b,children:e})}function f(){const e=d(c);if(!e)throw new Error("useNavbarConfig must be used inside NavbarProvider.");return e}function w(){const{activeConfig:e}=f();return e?a(y,{...e.props}):null}function A({children:e,config:t,configKey:o}){const{registerNavbarConfig:n,setActiveConfigKey:r}=f();return m(()=>{t&&n(o,t),r(o)},[t,o,n,r]),e}export{A as NavbarConfigScope,k as NavbarProvider,w as NavbarSlot,f as useNavbarConfig};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pro-kit.navbar",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Community navbar",
|
|
6
|
+
"description": "Community and content navbar with external links.",
|
|
7
|
+
"tags": ["navigation", "community"]
|
|
8
|
+
},
|
|
9
|
+
"props": {
|
|
10
|
+
"brand": {
|
|
11
|
+
"label": "TheModCraft Community",
|
|
12
|
+
"href": "/community",
|
|
13
|
+
"mark": "TC"
|
|
14
|
+
},
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"label": "News",
|
|
18
|
+
"href": "/news"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"label": "Guides",
|
|
22
|
+
"href": "/guides",
|
|
23
|
+
"children": [
|
|
24
|
+
{
|
|
25
|
+
"label": "Getting Started",
|
|
26
|
+
"href": "/guides/start"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"label": "Modding",
|
|
30
|
+
"href": "/guides/modding"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "Discord",
|
|
36
|
+
"href": "https://discord.gg/themodcraft",
|
|
37
|
+
"external": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"label": "Support",
|
|
41
|
+
"href": "/support"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"auth": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"loginUrl": "/login",
|
|
47
|
+
"settingsUrl": "/account/settings",
|
|
48
|
+
"profileImageProvider": "gravatar",
|
|
49
|
+
"tokenStorageKey": "token"
|
|
50
|
+
},
|
|
51
|
+
"dropdown": true,
|
|
52
|
+
"search": {
|
|
53
|
+
"enabled": false
|
|
54
|
+
},
|
|
55
|
+
"sidebar": {
|
|
56
|
+
"enabled": true,
|
|
57
|
+
"title": "Community"
|
|
58
|
+
},
|
|
59
|
+
"sticky": true
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pro-kit.navbar",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Dashboard navbar",
|
|
6
|
+
"description": "Dense operations navbar for app shells and dashboards.",
|
|
7
|
+
"tags": ["navigation", "dashboard"]
|
|
8
|
+
},
|
|
9
|
+
"props": {
|
|
10
|
+
"brand": {
|
|
11
|
+
"label": "TMC Ops",
|
|
12
|
+
"href": "/dashboard",
|
|
13
|
+
"mark": "OP"
|
|
14
|
+
},
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"label": "Overview",
|
|
18
|
+
"href": "/dashboard",
|
|
19
|
+
"current": true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"label": "Servers",
|
|
23
|
+
"href": "/dashboard/servers",
|
|
24
|
+
"children": [
|
|
25
|
+
{
|
|
26
|
+
"label": "Nodes",
|
|
27
|
+
"href": "/dashboard/servers/nodes"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"label": "Status",
|
|
31
|
+
"href": "/dashboard/servers/status"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"label": "Users",
|
|
37
|
+
"href": "/dashboard/users"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"label": "Settings",
|
|
41
|
+
"href": "/dashboard/settings"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"actions": [
|
|
45
|
+
{
|
|
46
|
+
"label": "Account",
|
|
47
|
+
"href": "/account",
|
|
48
|
+
"variant": "secondary"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"auth": {
|
|
52
|
+
"enabled": true,
|
|
53
|
+
"loginUrl": "/login",
|
|
54
|
+
"settingsUrl": "/account/settings",
|
|
55
|
+
"profileImageProvider": "explicit",
|
|
56
|
+
"tokenStorageKey": "token"
|
|
57
|
+
},
|
|
58
|
+
"dropdown": true,
|
|
59
|
+
"search": {
|
|
60
|
+
"enabled": true,
|
|
61
|
+
"placeholder": "Search ops..."
|
|
62
|
+
},
|
|
63
|
+
"sidebar": {
|
|
64
|
+
"enabled": true,
|
|
65
|
+
"title": "Operations",
|
|
66
|
+
"items": [
|
|
67
|
+
{
|
|
68
|
+
"label": "Overview",
|
|
69
|
+
"href": "/dashboard"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"label": "Servers",
|
|
73
|
+
"children": [
|
|
74
|
+
{
|
|
75
|
+
"label": "Nodes",
|
|
76
|
+
"href": "/dashboard/servers/nodes"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"label": "Deployments",
|
|
80
|
+
"href": "/dashboard/servers/deployments"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"label": "Audit Log",
|
|
86
|
+
"href": "/dashboard/audit-log"
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"sticky": true
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pro-kit.navbar",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Docs navbar",
|
|
6
|
+
"description": "Documentation-focused navbar with nested package links.",
|
|
7
|
+
"tags": ["navigation", "docs"]
|
|
8
|
+
},
|
|
9
|
+
"props": {
|
|
10
|
+
"brand": {
|
|
11
|
+
"label": "TMC Nexus Docs",
|
|
12
|
+
"href": "/",
|
|
13
|
+
"mark": "ND"
|
|
14
|
+
},
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"label": "Packages",
|
|
18
|
+
"children": [
|
|
19
|
+
{
|
|
20
|
+
"label": "Core UI",
|
|
21
|
+
"href": "#core"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"label": "Pro Kit",
|
|
25
|
+
"href": "#pro",
|
|
26
|
+
"children": [
|
|
27
|
+
{
|
|
28
|
+
"label": "Navbar Provider",
|
|
29
|
+
"href": "#navbar-provider"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "Migrated Components",
|
|
33
|
+
"href": "#migrated-components"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"label": "Addon Packs",
|
|
39
|
+
"href": "#addons",
|
|
40
|
+
"children": [
|
|
41
|
+
{
|
|
42
|
+
"label": "Animations",
|
|
43
|
+
"href": "#addons"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"label": "Charts",
|
|
47
|
+
"href": "#addons"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"label": "Path Maps",
|
|
55
|
+
"href": "#path-maps"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"label": "Legacy Ranking",
|
|
59
|
+
"href": "#legacy-ranking"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"actions": [
|
|
63
|
+
{
|
|
64
|
+
"label": "Install",
|
|
65
|
+
"href": "#install",
|
|
66
|
+
"variant": "primary"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"auth": {
|
|
70
|
+
"enabled": true,
|
|
71
|
+
"profile": {
|
|
72
|
+
"email": "demo@themodcraft.net",
|
|
73
|
+
"name": "Demo User"
|
|
74
|
+
},
|
|
75
|
+
"profileImageProvider": "gravatar",
|
|
76
|
+
"loginUrl": "/login",
|
|
77
|
+
"settingsUrl": "/account/settings"
|
|
78
|
+
},
|
|
79
|
+
"dropdown": true,
|
|
80
|
+
"search": {
|
|
81
|
+
"enabled": true,
|
|
82
|
+
"display": "field",
|
|
83
|
+
"placeholder": "Search docs..."
|
|
84
|
+
},
|
|
85
|
+
"maxDesktopItems": 5,
|
|
86
|
+
"sidebar": {
|
|
87
|
+
"enabled": true,
|
|
88
|
+
"title": "Docs navigation",
|
|
89
|
+
"label": "Open docs navigation",
|
|
90
|
+
"closeLabel": "Close"
|
|
91
|
+
},
|
|
92
|
+
"sticky": true
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { navbarConfigs } from "./navbar-configs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{navbarConfigs as a}from"./navbar-configs";export{a as navbarConfigs};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"../community.navbar.config.json";import r from"../dashboard.navbar.config.json";import a from"../docs.navbar.config.json";import m from"../themodcraft-v3.navbar.config.json";import f from"../../navbar.default.config.json";const b={community:o,dashboard:r,default:f,docs:a,"themodcraft-v3":m};export{b as navbarConfigs};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pro-kit.navbar",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "TheModCraft V3 navbar",
|
|
6
|
+
"description": "Navbar config migrated from TheModCraft.Net-V3 public/resources/assets/configs/navigation.json.",
|
|
7
|
+
"tags": ["navigation", "themodcraft-v3"]
|
|
8
|
+
},
|
|
9
|
+
"props": {
|
|
10
|
+
"brand": {
|
|
11
|
+
"label": "TheModCraft",
|
|
12
|
+
"href": "/home",
|
|
13
|
+
"logoSrc": "@images/TMC_Logo.webp",
|
|
14
|
+
"mark": "TMC"
|
|
15
|
+
},
|
|
16
|
+
"items": [
|
|
17
|
+
{
|
|
18
|
+
"label": "Home",
|
|
19
|
+
"href": "/home",
|
|
20
|
+
"current": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"label": "Play",
|
|
24
|
+
"href": "/play"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"label": "Modpacks",
|
|
28
|
+
"href": "/modpacks",
|
|
29
|
+
"children": [
|
|
30
|
+
{
|
|
31
|
+
"label": "Latest Packs",
|
|
32
|
+
"href": "/modpacks/latest"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"label": "Install Guides",
|
|
36
|
+
"href": "/docs/modpacks"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"label": "Discord",
|
|
42
|
+
"href": "https://discord.gg/themodcraft",
|
|
43
|
+
"external": true
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"label": "News",
|
|
47
|
+
"href": "/news"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"label": "Docs",
|
|
51
|
+
"href": "/docs"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"label": "Support",
|
|
55
|
+
"href": "/support"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"actions": [
|
|
59
|
+
{
|
|
60
|
+
"label": "Login",
|
|
61
|
+
"href": "/login",
|
|
62
|
+
"variant": "primary"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"auth": {
|
|
66
|
+
"enabled": true,
|
|
67
|
+
"loginUrl": "/login",
|
|
68
|
+
"settingsUrl": "/account/settings",
|
|
69
|
+
"profileImageProvider": "gravatar",
|
|
70
|
+
"tokenStorageKey": "token"
|
|
71
|
+
},
|
|
72
|
+
"dropdown": true,
|
|
73
|
+
"search": {
|
|
74
|
+
"enabled": false,
|
|
75
|
+
"placeholder": "Search..."
|
|
76
|
+
},
|
|
77
|
+
"maxDesktopItems": 5,
|
|
78
|
+
"sidebar": {
|
|
79
|
+
"enabled": true,
|
|
80
|
+
"title": "TheModCraft",
|
|
81
|
+
"label": "Open sidebar",
|
|
82
|
+
"closeLabel": "Close"
|
|
83
|
+
},
|
|
84
|
+
"sticky": true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { Navbar } from "./Navbar";
|
|
2
|
+
export { NavbarFromConfig } from "./NavbarFromConfig";
|
|
3
|
+
export { NavbarConfigScope, NavbarProvider, NavbarSlot, useNavbarConfig, } from "./NavbarProvider";
|
|
4
|
+
export { navbarConfigs } from "./configs/registry";
|
|
5
|
+
import type { NavbarConfig } from "./Navbar.types";
|
|
6
|
+
export declare const defaultNavbarConfig: NavbarConfig;
|
|
7
|
+
export declare const communityNavbarConfig: NavbarConfig;
|
|
8
|
+
export declare const dashboardNavbarConfig: NavbarConfig;
|
|
9
|
+
export declare const docsNavbarConfig: NavbarConfig;
|
|
10
|
+
export declare const themodcraftV3NavbarConfig: NavbarConfig;
|
|
11
|
+
export type { NavbarAction, NavbarAuthConfig, NavbarBrand, NavbarConfig, NavbarConfigRegistry, NavbarConfigScopeProps, NavbarItem, NavbarProps, NavbarProviderProps, NavbarSearchConfig, NavbarSidebarConfig, } from "./Navbar.types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Navbar as d}from"./Navbar";import{NavbarFromConfig as u}from"./NavbarFromConfig";import{NavbarConfigScope as h,NavbarProvider as l,NavbarSlot as y,useNavbarConfig as S}from"./NavbarProvider";import{navbarConfigs as F}from"./configs/registry";import o from"./navbar.default.config.json";import r from"./configs/community.navbar.config.json";import a from"./configs/dashboard.navbar.config.json";import t from"./configs/docs.navbar.config.json";import f from"./configs/themodcraft-v3.navbar.config.json";const e=o,s=r,N=a,p=t,g=f;export{d as Navbar,h as NavbarConfigScope,u as NavbarFromConfig,l as NavbarProvider,y as NavbarSlot,s as communityNavbarConfig,N as dashboardNavbarConfig,e as defaultNavbarConfig,p as docsNavbarConfig,F as navbarConfigs,g as themodcraftV3NavbarConfig,S as useNavbarConfig};
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://tmc.local/schemas/pro-kit/navbar.schema.json",
|
|
4
|
+
"title": "TMC Pro Kit Navbar Config",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"required": ["type", "version", "props"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"type": {
|
|
10
|
+
"const": "pro-kit.navbar"
|
|
11
|
+
},
|
|
12
|
+
"version": {
|
|
13
|
+
"const": 1
|
|
14
|
+
},
|
|
15
|
+
"metadata": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": false,
|
|
18
|
+
"properties": {
|
|
19
|
+
"name": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"description": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"tags": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"props": {
|
|
34
|
+
"type": "object",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"required": ["brand", "items"],
|
|
37
|
+
"properties": {
|
|
38
|
+
"brand": {
|
|
39
|
+
"type": "object",
|
|
40
|
+
"additionalProperties": false,
|
|
41
|
+
"required": ["label"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"label": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"href": {
|
|
47
|
+
"type": "string"
|
|
48
|
+
},
|
|
49
|
+
"logoSrc": {
|
|
50
|
+
"type": "string"
|
|
51
|
+
},
|
|
52
|
+
"logoPosition": {
|
|
53
|
+
"enum": ["center", "menu"]
|
|
54
|
+
},
|
|
55
|
+
"mark": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"maxLength": 3
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "array",
|
|
63
|
+
"items": {
|
|
64
|
+
"$ref": "#/$defs/navItem"
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"actions": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"additionalProperties": false,
|
|
72
|
+
"required": ["label", "href"],
|
|
73
|
+
"properties": {
|
|
74
|
+
"label": {
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"href": {
|
|
78
|
+
"type": "string"
|
|
79
|
+
},
|
|
80
|
+
"variant": {
|
|
81
|
+
"enum": ["primary", "secondary"]
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"auth": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"properties": {
|
|
90
|
+
"enabled": {
|
|
91
|
+
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"loginUrl": {
|
|
94
|
+
"type": "string"
|
|
95
|
+
},
|
|
96
|
+
"logoutUrl": {
|
|
97
|
+
"type": "string"
|
|
98
|
+
},
|
|
99
|
+
"settingsUrl": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"tokenStorageKey": {
|
|
103
|
+
"type": "string"
|
|
104
|
+
},
|
|
105
|
+
"profileImageProvider": {
|
|
106
|
+
"enum": ["explicit", "gravatar", "initials"]
|
|
107
|
+
},
|
|
108
|
+
"profile": {
|
|
109
|
+
"type": ["object", "null"],
|
|
110
|
+
"additionalProperties": false,
|
|
111
|
+
"properties": {
|
|
112
|
+
"email": {
|
|
113
|
+
"type": ["string", "null"]
|
|
114
|
+
},
|
|
115
|
+
"image": {
|
|
116
|
+
"type": ["string", "null"]
|
|
117
|
+
},
|
|
118
|
+
"name": {
|
|
119
|
+
"type": ["string", "null"]
|
|
120
|
+
},
|
|
121
|
+
"username": {
|
|
122
|
+
"type": ["string", "null"]
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"gravatar": {
|
|
127
|
+
"type": "object",
|
|
128
|
+
"additionalProperties": false,
|
|
129
|
+
"properties": {
|
|
130
|
+
"defaultImage": {
|
|
131
|
+
"enum": ["404", "mp", "identicon", "monsterid", "wavatar", "retro", "robohash", "blank"]
|
|
132
|
+
},
|
|
133
|
+
"rating": {
|
|
134
|
+
"enum": ["g", "pg", "r", "x"]
|
|
135
|
+
},
|
|
136
|
+
"size": {
|
|
137
|
+
"type": "number"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"dropdown": {
|
|
144
|
+
"type": "boolean"
|
|
145
|
+
},
|
|
146
|
+
"maxDesktopItems": {
|
|
147
|
+
"type": "number",
|
|
148
|
+
"minimum": 1
|
|
149
|
+
},
|
|
150
|
+
"search": {
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"properties": {
|
|
154
|
+
"display": {
|
|
155
|
+
"enum": ["field", "icon"]
|
|
156
|
+
},
|
|
157
|
+
"enabled": {
|
|
158
|
+
"type": "boolean"
|
|
159
|
+
},
|
|
160
|
+
"placeholder": {
|
|
161
|
+
"type": "string"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"sidebar": {
|
|
166
|
+
"type": "object",
|
|
167
|
+
"additionalProperties": false,
|
|
168
|
+
"properties": {
|
|
169
|
+
"enabled": {
|
|
170
|
+
"type": "boolean"
|
|
171
|
+
},
|
|
172
|
+
"label": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
},
|
|
175
|
+
"title": {
|
|
176
|
+
"type": "string"
|
|
177
|
+
},
|
|
178
|
+
"closeLabel": {
|
|
179
|
+
"type": "string"
|
|
180
|
+
},
|
|
181
|
+
"items": {
|
|
182
|
+
"type": "array",
|
|
183
|
+
"items": {
|
|
184
|
+
"$ref": "#/$defs/navItem"
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"sticky": {
|
|
190
|
+
"type": "boolean"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"$defs": {
|
|
196
|
+
"navItem": {
|
|
197
|
+
"type": "object",
|
|
198
|
+
"additionalProperties": false,
|
|
199
|
+
"required": ["label"],
|
|
200
|
+
"properties": {
|
|
201
|
+
"id": {
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
"label": {
|
|
205
|
+
"type": "string"
|
|
206
|
+
},
|
|
207
|
+
"href": {
|
|
208
|
+
"type": "string"
|
|
209
|
+
},
|
|
210
|
+
"current": {
|
|
211
|
+
"type": "boolean"
|
|
212
|
+
},
|
|
213
|
+
"external": {
|
|
214
|
+
"type": "boolean"
|
|
215
|
+
},
|
|
216
|
+
"children": {
|
|
217
|
+
"type": "array",
|
|
218
|
+
"items": {
|
|
219
|
+
"$ref": "#/$defs/navItem"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "pro-kit.navbar",
|
|
3
|
+
"version": 1,
|
|
4
|
+
"metadata": {
|
|
5
|
+
"name": "Default navbar",
|
|
6
|
+
"description": "Starter JSON config for a pro-kit navigation bar.",
|
|
7
|
+
"tags": ["navigation", "layout"]
|
|
8
|
+
},
|
|
9
|
+
"props": {
|
|
10
|
+
"brand": {
|
|
11
|
+
"label": "TMC Nexus",
|
|
12
|
+
"href": "/",
|
|
13
|
+
"mark": "TN"
|
|
14
|
+
},
|
|
15
|
+
"items": [
|
|
16
|
+
{
|
|
17
|
+
"label": "Core UI",
|
|
18
|
+
"href": "#core",
|
|
19
|
+
"current": true,
|
|
20
|
+
"children": [
|
|
21
|
+
{
|
|
22
|
+
"label": "Button",
|
|
23
|
+
"href": "#button"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"label": "Tokens",
|
|
27
|
+
"href": "#tokens"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"label": "Pro Kit",
|
|
33
|
+
"href": "#pro",
|
|
34
|
+
"children": [
|
|
35
|
+
{
|
|
36
|
+
"label": "Navbar",
|
|
37
|
+
"href": "#navbar"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"label": "Container",
|
|
41
|
+
"href": "#container"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"label": "Addon Packs",
|
|
47
|
+
"href": "#addons"
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
"actions": [
|
|
51
|
+
{
|
|
52
|
+
"label": "Docs",
|
|
53
|
+
"href": "#docs",
|
|
54
|
+
"variant": "secondary"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"label": "Install",
|
|
58
|
+
"href": "#install",
|
|
59
|
+
"variant": "primary"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"auth": {
|
|
63
|
+
"enabled": true,
|
|
64
|
+
"loginUrl": "/login",
|
|
65
|
+
"settingsUrl": "/account/settings",
|
|
66
|
+
"profileImageProvider": "gravatar",
|
|
67
|
+
"tokenStorageKey": "token"
|
|
68
|
+
},
|
|
69
|
+
"dropdown": true,
|
|
70
|
+
"search": {
|
|
71
|
+
"enabled": false,
|
|
72
|
+
"placeholder": "Search..."
|
|
73
|
+
},
|
|
74
|
+
"maxDesktopItems": 5,
|
|
75
|
+
"sidebar": {
|
|
76
|
+
"enabled": true,
|
|
77
|
+
"title": "TMC Nexus",
|
|
78
|
+
"label": "Open navigation",
|
|
79
|
+
"closeLabel": "Close"
|
|
80
|
+
},
|
|
81
|
+
"sticky": true
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.O{position:relative;z-index:15;width:100%;display:flex;flex-direction:row;justify-content:center}.v{position:relative;color:var(--primary-text);background:var(--primary-background);height:58px;width:100%;min-width:0;display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;overflow:visible;box-shadow:-1px 3px 20px 4px var(--neutral-850)}.b{display:flex;flex-direction:row;background:var(--primary-background);align-items:center;height:34px;margin-right:10px;max-width:min(210px,28vw);border:1px solid var(--border-color);border-radius:var(--border-radius);box-sizing:border-box;overflow:hidden}@media screen and (max-width:911px){.b{display:none}}.P{margin:0 5px}.Q{display:flex;height:100%}.R{border:0;outline:0;width:clamp(96px,12vw,160px);min-width:0;height:100%;background:transparent;color:var(--primary-text);padding:0 10px 0 0}.S{display:flex;align-items:center;justify-content:center;color:var(--secondary-text)}.T{justify-content:center;width:42px;padding:0;cursor:pointer}.i{flex:1 1 auto;width:45%;max-width:calc(50% - 34px);height:58px;min-width:58px;display:flex;align-items:center}.i ul.U{list-style-type:none;margin:0;padding:0;min-width:0;overflow:visible;height:58px;display:flex;align-items:stretch}.V{position:relative;overflow:visible;height:58px;width:100%;min-width:0}.i li.y,li.u,li.w{margin-left:10px;float:none;display:flex;align-items:stretch;position:relative}.i li a.k,li.W{display:flex;align-items:center;height:58px;color:var(--primary-text);text-align:center;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif;white-space:nowrap}.i li a:hover.k{background-color:var(--hover-overlay);border-radius:var(--border-radius)}.i li a.a{display:flex;align-items:center;height:58px;color:#7fff00;text-align:center;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.i li a:hover.a{background-color:var(--hover-overlay)}.Z{list-style-type:none;margin:0;padding:6px;overflow:visible;background-color:var(--primary-background);border:1px solid var(--border-color);border-radius:8px;box-shadow:0 18px 42px #00000047,0 2px 10px #0000002e;display:none;position:absolute;top:calc(100% + 6px);left:0;z-index:20;min-width:210px;transform-origin:top left}._{display:block;animation:z 145ms cubic-bezier(.16,1,.3,1)}.p{display:flex;flex-direction:row;align-items:center;height:58px;min-width:0;flex:0 1 auto;justify-content:flex-end}.i li a:hover ul{display:block}.ii{overflow:hidden}.i li.s{margin-left:0;float:none;display:block;position:relative}.i li a.r{display:flex;align-items:center;min-height:44px;color:var(--primary-text);text-align:left;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif;white-space:nowrap}.i li a:hover.r{background-color:var(--hover-overlay);border-radius:var(--border-radius)}.j{gap:8px}.A{display:inline-flex;align-items:center;justify-content:center;width:.9em;color:var(--secondary-text);font-size:.8em;line-height:1;transition:transform .14s ease}.j[data-state=open] .A{transform:rotate(180deg)}.o{backdrop-filter:blur(16px)}.o:before{content:"";position:absolute;top:-18px;left:0;width:100%;height:18px}.o .s{margin-left:0}.o .r{justify-content:space-between;gap:18px;border-radius:6px}.ei{color:var(--secondary-text);font-size:1.1em;line-height:1}.H{list-style-type:none;margin:3px 0 6px;padding:0 0 0 12px;border-left:1px solid var(--border-color)}.H .r{min-height:36px;padding:0 12px;font-size:.94rem}.n{display:block;position:static;min-width:0;margin:2px 0 8px 18px;padding:0 0 0 12px;border:0;border-left:1px solid var(--border-color);border-radius:0;box-shadow:none;background:transparent}.e .n .s{width:100%;margin-left:0}.e .n .r{width:100%;min-height:40px;box-sizing:border-box;justify-content:flex-start;padding:10px 14px;border-radius:var(--border-radius)}.e .n .r:hover{background-color:var(--hover-overlay);border-radius:var(--border-radius)}.i li a.Y{display:flex;align-items:center;min-height:44px;color:#7fff00;text-align:left;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.i li a:hover.Y{background-color:var(--hover-overlay)}.t{float:none;z-index:10;height:58px;display:flex;align-items:center}.t .q{font-size:16px;border:none;outline:none;color:var(--primary-text);padding:0 16px;height:58px;display:flex;align-items:center;background-color:inherit;font-family:inherit;margin:0}.t .q .B{width:32px;min-height:18.5px}.l{display:none;position:absolute;min-width:160px;box-shadow:0 8px 16px #07070787;z-index:1}.l a{float:none;color:var(--primary-text);padding:12px 16px;text-decoration:none;display:block;text-align:left}.l a:hover{background-color:var(--hover-overlay)}.t:hover .l{display:block}@media(min-width:722px){.t{display:none}.t.ti{display:flex}.ri{display:none!important}.x{display:flex!important}}.x{display:none!important}@media(min-width:722px){.x{display:flex!important}}.t ul.ai{list-style-type:none;margin:0;padding:0;overflow:hidden;background-color:#07070787;display:flex;flex-direction:column}.t li.oi{margin-left:10px;float:none}.t li a.C{display:flex;align-items:center;min-height:44px;color:var(--primary-text);text-align:center;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.t li a:hover.C{background-color:var(--hover-overlay);border-radius:var(--border-radius)}.t li a.a{display:flex;align-items:center;min-height:44px;color:#000;text-align:center;padding:0 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.t li a:hover.a{background-color:var(--hover-overlay)}.X{text-align:center;box-sizing:border-box;margin-left:10px;margin-right:10px;padding:10px}.ni{width:auto;height:auto}.e{z-index:14;width:min(200px,100vw);width:min(200px,100dvw);max-width:100vw;max-width:100dvw;height:100vh;height:100dvh;background-color:rgb(from var(--neutral-999) r g b / .63);color:var(--primary-text);padding:20px;box-sizing:border-box;position:fixed;top:0;left:0;overflow-y:auto;overscroll-behavior:contain;transform:translate(calc(-100% - 1px));transition:transform .3s ease}.li{width:100vw;width:100dvw;max-width:100vw;max-width:100dvw}.e.di{transform:translate(0);padding:14px}.pi{display:inline-block;font-size:21.318px;transform:scaleX(1.501);transform-origin:left center}.si{margin-left:220px;padding:20px}.D{display:flex!important;align-items:center;justify-content:center;height:58px;background-color:var(--primary-background);color:var(--primary-text);padding:0 14px!important;cursor:pointer}.E{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;overflow:hidden}.E img{display:block;width:100%;height:100%;object-fit:contain}.e a{display:block;color:var(--primary-text);text-decoration:none;padding:5px}.e a:hover,.e .xi{background-color:var(--hover-overlay)}.ci{left:0}.e ul.gi{top:42px;position:relative;list-style-type:none;margin:0;padding:0;overflow:hidden;display:flex;flex-direction:column;align-items:stretch}.e li.hi,li.mi{margin-left:0;float:none;width:100%}.e li a.c,.e li span.c,a.fi{display:flex;align-items:center;justify-content:flex-start;gap:10px;width:100%;box-sizing:border-box;color:var(--primary-text);text-align:left;padding:12px 16px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.e li a:hover.c{background-color:var(--hover-overlay);border-radius:var(--border-radius)}.vi{display:inline-flex;align-items:center;justify-content:center;width:1.25em;font-size:1.25em;line-height:1}.e li a.F{display:block;color:#7fff00;text-align:center;padding:19.5px 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}.e li a:hover.F{background-color:var(--primary-text)}.bi{z-index:6;height:100%;background-color:#0000;position:fixed;width:50px}.g{height:58px;width:58px;flex:0 0 58px;transition:.3s linear all;display:flex;align-items:center;justify-content:center}.yi{position:absolute;inset:0;width:auto;max-width:100%;height:58px;overflow:hidden;display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:4}.g a{pointer-events:auto}@media screen and (max-width:722px){.g{transform:rotate(90deg);transition:.3s linear all;content:url(https://cdn.themodcraft.net/resources/assets/images/Chronos_Logo-noText2.png)}.v{overflow:visible;align-items:center}}.h{display:flex;flex-direction:row;align-items:center;margin:0 10px 0 0;height:58px;padding:0 8px;position:relative}.d{display:flex;flex-direction:row;font-size:1.8rem}.d>img{width:40px;height:40px;border-radius:100px}.m{visibility:hidden;opacity:0;position:fixed;top:58px;left:calc(100% - 200px);width:200px;height:auto;border-bottom-left-radius:var(--border-radius);background-color:var(--primary-background);z-index:1;padding-top:10px;transition:opacity .12s ease,visibility .12s ease}.m:before{content:"";position:absolute;top:-18px;left:0;width:100%;height:18px}.h:hover .m{visibility:visible;opacity:1}.ui{list-style-type:none;padding:0 40px}.G{border-radius:var(--border-radius)}.G:hover{background-color:var(--hover-overlay)}.wi{display:block;color:var(--primary-text);text-align:center;padding:8px 20px;text-decoration:none;font-family:Arial,Helvetica,sans-serif}@media screen and (max-width:480px){.i{max-width:calc(50% - 30px);min-width:52px}.i li.y,li.u,li.w{margin-left:4px}.D{padding:0 10px!important}.p{max-width:calc(50% - 30px)}.h{margin-right:4px;padding:0 4px}.d{font-size:1.45rem}.d>img{width:34px;height:34px}}@media screen and (max-width:260px){.p{display:none}.i{max-width:calc(50% - 30px)}}.B{width:32px;min-height:18.5px;position:relative}.ki{pointer-events:none;position:absolute;top:0;left:0;visibility:hidden;z-index:-1}.I,.J,.K{transform-box:fill-box;transform-origin:center}.f .I{animation:L .6s ease-out both}.f .J{animation:M .6s ease-out both}.f .K{animation:N .6s ease-out forwards}@keyframes M{0%{animation-timing-function:cubic-bezier(.16,-.88,.97,.53);transform:translateY(0)}30%{transform-origin:center;animation-timing-function:cubic-bezier(.34,1.56,.64,1);transform:translateY(-10px)}to{transform-origin:center;transform:translateY(-10px) rotate(45deg) scale(.9)}}@keyframes L{0%{animation-timing-function:cubic-bezier(.16,-.88,.97,.53);transform:translateY(0)}30%{transform-origin:center;animation-timing-function:cubic-bezier(.34,1.56,.64,1);transform:translateY(10px)}to{transform-origin:center;transform:translateY(10px) rotate(-45deg) scale(.9)}}@keyframes N{29%{opacity:1}30%{opacity:0}to{opacity:0}}@keyframes z{0%{opacity:0;transform:translateY(-4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{LicenseGate as v,TMC_ENTITLEMENTS as u}from"@themodcraft/license-client";import l from"./Overlay.module.css";function s({flipped:n=!1}){return r("svg",{className:n?l["wave-overlay-up"]:l["wave-overlay"],preserveAspectRatio:"none",style:n?{transform:"scaleY(-1) scaleX(-1)"}:void 0,viewBox:"0 0 1440 320",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:`
|
|
2
|
+
M 0, 305
|
|
3
|
+
L 1440, 175
|
|
4
|
+
L 1440, 180
|
|
5
|
+
L 0, 310
|
|
6
|
+
Z
|
|
7
|
+
`,fill:"var(--neutral-850)",fillOpacity:"0.6"}),e("path",{d:`
|
|
8
|
+
M 0, 310
|
|
9
|
+
L 1440, 180
|
|
10
|
+
L 1440, 340
|
|
11
|
+
L 0, 340
|
|
12
|
+
Z
|
|
13
|
+
`,fill:"var(--neutral-850)",fillOpacity:"1"})]})}function h({children:n,className:a,enableBottm:t,enableBottom:o,enableUp:i,enableTop:c}){const f=c??i??!1,p=o??t??!1;return e(v,{required:u.proKit,children:r("section",{className:[l["overlay-container"],a].filter(Boolean).join(" "),children:[f?e(s,{flipped:!0}):null,n,p?e(s,{}):null]})})}export{h as Overlay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.i{position:relative;width:100%;height:auto;background:var(--primary-background);overflow:hidden}.o{width:100%;height:40%;position:absolute;top:-1px;z-index:10}.t{width:100%;height:40%;position:absolute;bottom:0;z-index:0}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Overlay as o}from"./Overlay";export{o as Overlay};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as m}from"react/jsx-runtime";import{resolveAssetPath as f}from"@themodcraft/core-ui";import{LicenseGate as d,TMC_ENTITLEMENTS as h}from"@themodcraft/license-client";import{useEffect as g,useMemo as p,useState as b}from"react";function x({slide:e}){const l=m("div",{className:"relative h-full min-h-[260px] overflow-hidden rounded-lg bg-zinc-950",children:[t("img",{alt:e.text??"Slider image",className:"absolute inset-0 h-full w-full object-cover opacity-75",src:f(e.image)}),e.text?t("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/80 to-transparent p-5 text-white",children:t("p",{className:"text-lg font-semibold",children:e.text})}):null]});return e.link?t("a",{href:e.link,rel:"noreferrer",target:e.link.startsWith("http")?"_blank":void 0,children:l}):l}function k({autoPlay:e=!0,className:l,content:a,intervalMs:s=3500,slides:o}){const n=p(()=>o??a?.slides??[],[a?.slides,o]),[c,u]=b(0);return g(()=>{if(!e||n.length<2)return;const i=window.setInterval(()=>{u(r=>(r+1)%n.length)},s);return()=>window.clearInterval(i)},[e,s,n.length]),n.length===0?null:t(d,{required:h.proKit,children:m("section",{className:["grid gap-3",l].filter(Boolean).join(" "),children:[t(x,{slide:n[c]}),n.length>1?t("div",{className:"flex items-center justify-center gap-2",children:n.map((i,r)=>t("button",{"aria-label":`Show slide ${r+1}`,className:["h-2.5 rounded-full transition-all",r===c?"w-8 bg-blue-700":"w-2.5 bg-zinc-300"].join(" "),onClick:()=>u(r),type:"button"},`${i.image}-${r}`))}):null]})})}export{k as Slider};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentConfig } from "@themodcraft/core-ui";
|
|
2
|
+
export interface SliderItem {
|
|
3
|
+
image: string;
|
|
4
|
+
link?: string;
|
|
5
|
+
text?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SliderContent {
|
|
8
|
+
slides: SliderItem[];
|
|
9
|
+
}
|
|
10
|
+
export interface SliderProps {
|
|
11
|
+
autoPlay?: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
content?: SliderContent;
|
|
14
|
+
intervalMs?: number;
|
|
15
|
+
slides?: SliderItem[];
|
|
16
|
+
}
|
|
17
|
+
export type SliderConfig = ComponentConfig<"pro-kit.slider", SliderProps>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{readConfigProps as i}from"@themodcraft/core-ui";import{Slider as m}from"./Slider";function n({config:r}){return o(m,{...i(r)})}export{n as SliderFromConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Slider as e}from"./Slider";import{SliderFromConfig as i}from"./SliderFromConfig";export{e as Slider,i as SliderFromConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as l}from"react/jsx-runtime";import{LicenseGate as x,TMC_ENTITLEMENTS as f}from"@themodcraft/license-client";import{useEffect as u,useState as p}from"react";function c(n){const e=n?Date.parse(n)-Date.now():0;return{hours:Math.max(Math.floor(e/(1e3*60*60)),0),minutes:Math.max(Math.floor(e/1e3/60%60),0),seconds:Math.max(Math.floor(e/1e3%60),0),total:e}}const M={hours:0,minutes:0,seconds:0,total:0};function T({className:n,countDown:e=!1,description:r,pageName:m,targetDate:s,title:d}){const[o,a]=p(M);return u(()=>{if(!e||!s)return;a(c(s));const i=window.setInterval(()=>{a(c(s))},1e3);return()=>window.clearInterval(i)},[e,s]),t(x,{required:f.proKit,children:t("section",{className:["grid place-items-center rounded-lg border border-zinc-200 bg-white p-8 text-center shadow-sm",n].filter(Boolean).join(" "),children:l("div",{children:[t("h2",{className:"text-2xl font-semibold tracking-tight text-zinc-950",children:[m,d].filter(Boolean).join(" ")}),r?t("p",{className:"mt-3 text-sm text-zinc-600",children:r}):null,e?t("div",{className:"mt-6 flex items-center justify-center gap-3 font-mono",children:[["Hours",o.hours],["Minutes",o.minutes],["Seconds",o.seconds]].map(([i,h])=>l("div",{className:"rounded-md bg-zinc-950 px-4 py-3 text-white",children:[t("span",{className:"block text-2xl font-semibold",children:String(h).padStart(2,"0")}),t("span",{className:"text-xs text-zinc-400",children:i})]},i))}):null]})})})}export{T as Soon};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentConfig } from "@themodcraft/core-ui";
|
|
2
|
+
export interface SoonProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
countDown?: boolean;
|
|
5
|
+
description?: string;
|
|
6
|
+
pageName?: string;
|
|
7
|
+
targetDate?: string;
|
|
8
|
+
title: string;
|
|
9
|
+
}
|
|
10
|
+
export type SoonConfig = ComponentConfig<"pro-kit.soon", SoonProps>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{readConfigProps as m}from"@themodcraft/core-ui";import{Soon as n}from"./Soon";function p({config:o}){return r(n,{...m(o)})}export{p as SoonFromConfig};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Soon as f}from"./Soon";import{SoonFromConfig as n}from"./SoonFromConfig";export{f as Soon,n as SoonFromConfig};
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export*from"./auth";export*from"./components/banner";export*from"./components/container";export*from"./components/navbar";export*from"./components/overlay";export*from"./components/slider";export*from"./components/soon";
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@themodcraft/pro-kit",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"files": ["dist"],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./navbar/default-config": "./dist/components/navbar/navbar.default.config.json",
|
|
15
|
+
"./navbar/docs-config": "./dist/components/navbar/configs/docs.navbar.config.json",
|
|
16
|
+
"./navbar/dashboard-config": "./dist/components/navbar/configs/dashboard.navbar.config.json",
|
|
17
|
+
"./navbar/community-config": "./dist/components/navbar/configs/community.navbar.config.json",
|
|
18
|
+
"./navbar/configs": {
|
|
19
|
+
"types": "./dist/components/navbar/configs/registry/index.d.ts",
|
|
20
|
+
"default": "./dist/components/navbar/configs/registry/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./navbar/themodcraft-v3-config": "./dist/components/navbar/configs/themodcraft-v3.navbar.config.json",
|
|
23
|
+
"./navbar/schema": "./dist/components/navbar/navbar.config.schema.json"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "node ../../tools/build-package.mjs",
|
|
27
|
+
"prepack": "npm run build",
|
|
28
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@emotion/react": "^11.14.0",
|
|
32
|
+
"@emotion/styled": "^11.14.1",
|
|
33
|
+
"@themodcraft/core-ui": "0.0.0",
|
|
34
|
+
"@themodcraft/license-client": "0.0.0"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"react": "^19.0.0",
|
|
38
|
+
"react-dom": "^19.0.0"
|
|
39
|
+
}
|
|
40
|
+
}
|