@funhub/platform 0.1.78 → 0.1.79
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useMemo as r}from"react";import{jsx as
|
|
2
|
+
"use client";import{Image as e}from"../../../ui/image.mjs";import{Box as t}from"../../../ui/box.mjs";import{Text as n}from"../../../ui/text.mjs";import{useMemo as r,useState as i}from"react";import{jsx as a,jsxs as o}from"react/jsx-runtime";import{usePathname as s,useRouter as c}from"next/navigation";const l=[];function u(e,t){return e.domainId===`home`&&t===`/`||e.domainId===`mine`&&t.includes(`/mine`)}function d(e){if(e.configType===1)switch(e.functionPageType){case`搜索`:return`/search`;case`个人中心`:return`/user/mine`;case`内容列表`:return`/video-list?tags=${e.tags}&title=${e.title}`;default:return`/`}let t=(e.domainId??``).toString().trim();return t?`/domain/category/${t}`:`/`}function f(f){let{items:p=l,mode:m=`renderer`}=f,h=c(),g=s(),[_,v]=i(0),y=r(()=>{if(m===`editor`)return 0;let e=(p??[]).findIndex(e=>u(e,g));return e>=0?e:_},[p,g,m,_]),b=r(()=>(p??[]).some(e=>e.label!=null&&String(e.label).trim()!==``),[p]);if(!p?.length)return null;let x=(e,t)=>{m!==`editor`&&(v(t),h.push(d(e)))},S=`flex min-w-0 flex-1 cursor-pointer flex-col items-center justify-center ${b?`gap-1`:``}`;return a(t,{className:`fixed bottom-0 left-0 right-0 z-50 safe-area-bottom bg-bg1 border-t border-line1 backdrop-blur-[2px] py-3 shadow-[0px_-4px_10px_0px_rgba(0,0,0,0.02)]`,children:a(t,{className:`flex w-full items-center`,children:p.map((r,i)=>{let s=y===i,c=s&&r.activeIcon?r.activeIcon:r.icon,l=typeof r.label==`string`?r.label:String(r.label??``);return o(t,{className:S,onClick:()=>x(r,i),children:[a(t,{className:`relative size-[22px] shrink-0`,children:c?a(e,{src:c,alt:l,fill:!0,className:`object-contain`}):a(t,{className:`size-full rounded-sm ${s?`bg-theme5`:`bg-text3`}`})}),b&&a(n,{className:`truncate text-center text-[10px] leading-[10px] font-medium min-w-0 max-w-full px-0.5 ${s?`text-theme5`:`text-text2`}`,children:l})]},i)})})})}export{f as TabBarClient};
|
|
@@ -6,7 +6,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
6
6
|
//#region components/ui/badge.d.ts
|
|
7
7
|
/** badgeVariants 工具定义。 */
|
|
8
8
|
declare const badgeVariants: (props?: ({
|
|
9
|
-
variant?: "
|
|
9
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,7 +7,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
7
7
|
//#region components/ui/button.d.ts
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
|
-
variant?: "
|
|
10
|
+
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | null | undefined;
|
|
11
11
|
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|