@funhub/platform 0.2.28 → 0.2.29
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/components/biz/business/tab-bar/client.mjs +1 -1
- package/dist/components/common/tab-bar/index.mjs +1 -1
- package/dist/components/ui/badge.d.mts +1 -1
- package/dist/components/ui/button.d.mts +2 -2
- package/dist/components/ui/item.d.mts +1 -1
- package/dist/components/ui/toggle.d.mts +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{usePathname as i}from"next/navigation";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.
|
|
2
|
+
"use client";import{trackNavigation as e}from"../../../../utils/tracking.mjs";import{Image as t}from"../../../ui/image.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import{usePathname as i}from"next/navigation";import{useMemo as a}from"react";import{jsx as o,jsxs as s}from"react/jsx-runtime";import c from"next/link";const l=[],u={backgroundColor:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},d={background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},f={background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`};function p(e){return e.split(`?`)[0].replace(/\/+$/,``)||`/`}function m(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/${t}`:`/`}function h(e,t){let n=p(t);if(e.configType===1){let t=p(m(e).split(`?`)[0]);return n===t||n.startsWith(`${t}/`)}let r=e.domainId.trim();if(!r)return n===`/`||n.startsWith(`/category/`);let i=`/domain/${r}`;return n===i||n.startsWith(`${i}/`)}function g(e,t){return e.findIndex(e=>h(e,t))}function _(e){return typeof e.show_nav_name==`boolean`?e.show_nav_name:typeof e.showNavName==`boolean`?e.showNavName:!0}function v(p){let{items:h=l,mode:v=`renderer`}=p,y=i(),b=a(()=>{if(v===`editor`)return 0;let e=g(h??[],y);return e>=0?e:0},[h,y,v]),x=a(()=>(h??[]).some(e=>_(e)&&e.label.trim()!==``),[h]);if(!h?.length)return null;function S(t,n){v===`editor`?t.preventDefault():e({navigation_key:`navigation_${n.label}`,navigation_name:n.label})}let C=`size-full rounded-[6px] bg-white/20`;return o(n,{as:`nav`,"aria-label":`Bottom navigation`,className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center`,style:u,children:s(n,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:d,"aria-hidden":`true`}),o(n,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:f,"aria-hidden":`true`}),h.map((e,i)=>{let a=b===i,l=a?e.activeIcon:e.icon,u=e.label,d=_(e)&&u.trim()!==``,f=m(e),p=x?a?`gap-[5px]`:`gap-[4px]`:``,h=a?`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-[#C043E8]`:`whitespace-nowrap text-center text-[12px] leading-[16px] font-normal text-white/50`;return s(c,{href:f,className:`flex flex-col items-center justify-center ${p}`,"aria-current":a?`page`:void 0,"data-index":i,"data-webview-nav":`spa`,onClick:t=>S(t,e),children:[o(n,{className:`relative size-5 shrink-0`,children:l?o(t,{src:l,alt:u,fill:!0,className:`object-contain`}):o(n,{className:a?`${C} bg-[#C043E8]`:C})}),x&&d?o(r,{"data-active":a,className:h,children:u}):null]},i)})]})})}export{v as TabBarClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v=[`/nav-page`];function y(y){let{className:b}=y,x=u(),S=g(`tabBar`),[C,w]=f(null),[,T]=p(),[E]=f(0),[D,O]=f(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return d(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),d(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.
|
|
2
|
+
"use client";import{Box as e}from"../../ui/box.mjs";import{Text as t}from"../../ui/text.mjs";import n from"../../ui/link.mjs";import r from"../../../assets/icons/tabs/follow.mjs";import i from"../../../assets/icons/tabs/follow_active.mjs";import a from"../../../assets/icons/tabs/home.mjs";import o from"../../../assets/icons/tabs/home_active.mjs";import s from"../../../assets/icons/tabs/mine.mjs";import c from"../../../assets/icons/tabs/mine_active.mjs";import l from"../../ui/legacy/badge.mjs";import{usePathname as u}from"next/navigation";import{useEffect as d,useState as f,useTransition as p}from"react";import{jsx as m,jsxs as h}from"react/jsx-runtime";import{useTranslations as g}from"next-intl";function _(e,t){if(t!==`/`)return e.startsWith(t);let n=[`/user`].some(t=>e.startsWith(t)),r=e.startsWith(`/category/`);return!n&&(e===`/`||r)}const v=[`/nav-page`];function y(y){let{className:b}=y,x=u(),S=g(`tabBar`),[C,w]=f(null),[,T]=p(),[E]=f(0),[D,O]=f(!1),k=[{badge:!1,id:1,labelKey:`home`,path:`/`,icon:a,activeIcon:o,width:20,height:20},{badge:!1,id:2,labelKey:`follow`,path:`/user/follow`,icon:r,activeIcon:i,width:20,height:20},{badge:!1,id:5,labelKey:`mine`,path:`/user/mine`,icon:s,activeIcon:c,width:20,height:20}],A=(e,t,n)=>{t!==x&&w(t)};return d(()=>{C&&_(x,C)&&T(()=>{w(null)})},[x,C]),d(()=>{let e=setTimeout(()=>{O(!0)},0);return()=>clearTimeout(e)},[]),x&&v.some(e=>x.includes(e))?null:m(e,{className:`fixed bottom-0 left-0 right-0 z-50 flex flex-col items-center ${b||``}`,style:{background:`rgba(5, 1, 15, 0.1)`,backdropFilter:`blur(8px)`,WebkitBackdropFilter:`blur(8px)`},children:h(e,{className:`relative my-[4px] flex h-[56px] w-[358px] items-center justify-between rounded-[100px] px-[40px]`,children:[m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(0deg, rgba(6, 3, 21, 0.03) 0%, rgba(6, 3, 21, 0.03) 100%), rgba(255, 255, 255, 0.10)`},"aria-hidden":`true`}),m(e,{className:`pointer-events-none absolute inset-0 rounded-[100px]`,style:{background:`linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%)`,padding:`1px`,WebkitMask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,WebkitMaskComposite:`xor`,mask:`linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0)`,maskComposite:`exclude`},"aria-hidden":`true`}),k.map(r=>{let i=D&&x?_(C||x||``,r.path):!1,a=i?r.activeIcon:r.icon,o=h(e,{className:`flex flex-col items-center ${i?`gap-[5px]`:`gap-[4px]`}`,children:[r.badge&&E>0?m(l,{dot:!0,children:m(a,{width:20,height:20})}):m(a,{width:20,height:20}),m(t,{className:`whitespace-nowrap text-center text-[12px] leading-[16px] ${i?`text-[#C043E8]`:`text-white/50`}`,children:S(r.labelKey)})]});return i?m(e,{className:`flex items-center justify-center`,children:o},r.id):m(n,{href:r.path,prefetch:!0,className:`flex items-center justify-center`,onClick:e=>{A(e,r.path,r.labelKey)},children:o},r.id)})]})})}export{y as TabBar};
|
|
@@ -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?: "link" | "default" | "
|
|
9
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
11
11
|
/** Badge 组件。 */
|
|
12
12
|
declare function Badge({
|
|
@@ -7,8 +7,8 @@ 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?: "link" | "default" | "
|
|
11
|
-
size?: "icon" | "
|
|
10
|
+
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
11
|
+
size?: "icon" | "default" | "xs" | "sm" | "lg" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|
|
@@ -70,7 +70,7 @@ declare function ItemSeparator({
|
|
|
70
70
|
/** itemVariants 工具定义。 */
|
|
71
71
|
declare const itemVariants: (props?: ({
|
|
72
72
|
variant?: "default" | "outline" | "muted" | null | undefined;
|
|
73
|
-
size?: "
|
|
73
|
+
size?: "default" | "xs" | "sm" | null | undefined;
|
|
74
74
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
75
75
|
/** Item 组件。 */
|
|
76
76
|
declare function Item({
|
|
@@ -8,7 +8,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
8
8
|
/** toggleVariants 工具定义。 */
|
|
9
9
|
declare const toggleVariants: (props?: ({
|
|
10
10
|
variant?: "default" | "outline" | null | undefined;
|
|
11
|
-
size?: "
|
|
11
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Toggle 组件属性。 */
|
|
14
14
|
type ToggleProps = Toggle.Props & VariantProps<typeof toggleVariants> & {
|