@vitrumui/react 0.0.0-stage → 1.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/LICENSE.md +3 -0
- package/README.md +83 -2
- package/THIRD_PARTY_NOTICES.md +25 -0
- package/dist/chunk-3PB7SR7K.js +2 -0
- package/dist/chunk-5FQVPDYS.js +2 -0
- package/dist/chunk-7P4WUQQK.js +2 -0
- package/dist/chunk-NIACCP5E.js +2 -0
- package/dist/chunk-NIB24TKN.js +2 -0
- package/dist/chunk-NRK2HJTE.js +2 -0
- package/dist/chunk-QM4IN3YJ.js +2 -0
- package/dist/chunk-RNHRKD6Z.js +2 -0
- package/dist/chunk-SQYCOYYN.js +2 -0
- package/dist/chunk-U3CZMSFP.js +2 -0
- package/dist/controls/Checkbox.d.ts +28 -0
- package/dist/controls/Checkbox.js +3 -0
- package/dist/controls/Icon.d.ts +14 -0
- package/dist/controls/RangeSlider.d.ts +29 -0
- package/dist/controls/RangeSlider.js +3 -0
- package/dist/controls/Switch.d.ts +19 -0
- package/dist/controls/Switch.js +3 -0
- package/dist/controls/glass/draw.d.ts +29 -0
- package/dist/controls/glass/physics.d.ts +85 -0
- package/dist/controls/glass/runtime.d.ts +33 -0
- package/dist/controls/glass/tokens.d.ts +16 -0
- package/dist/controls/glass/useGlassCanvas.d.ts +10 -0
- package/dist/controls/shared.d.ts +8 -0
- package/dist/glass-action-button.d.ts +26 -0
- package/dist/glass-action-button.js +3 -0
- package/dist/glass-badge.d.ts +12 -0
- package/dist/glass-badge.js +3 -0
- package/dist/glass-button-group.d.ts +35 -0
- package/dist/glass-button-group.js +3 -0
- package/dist/glass-button.d.ts +19 -0
- package/dist/glass-button.js +3 -0
- package/dist/glass-card.d.ts +18 -0
- package/dist/glass-card.js +3 -0
- package/dist/glass-dropdown-menu.d.ts +29 -0
- package/dist/glass-dropdown-menu.js +3 -0
- package/dist/glass-layer.d.ts +97 -0
- package/dist/glass-lens.d.ts +7 -0
- package/dist/glass-popup.d.ts +27 -0
- package/dist/glass-select.d.ts +19 -0
- package/dist/glass-select.js +3 -0
- package/dist/glass-slide-to-confirm.d.ts +32 -0
- package/dist/glass-slide-to-confirm.js +3 -0
- package/dist/glass-tabs.d.ts +19 -0
- package/dist/glass-tabs.js +3 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +3 -0
- package/dist/runtime-2U4MAR2W.js +2 -0
- package/dist/styles.css +3 -0
- package/dist/styles.css.d.ts +1 -0
- package/package.json +104 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const iconNames: readonly ["sun", "moon", "plus", "minus", "check", "close", "search", "arrow-right", "chevron-down", "settings", "bell", "volume", "sparkle"];
|
|
2
|
+
export type IconName = (typeof iconNames)[number];
|
|
3
|
+
export declare const iconShapes: Record<IconName, {
|
|
4
|
+
paths: string[];
|
|
5
|
+
circles?: [number, number, number][];
|
|
6
|
+
}>;
|
|
7
|
+
export type IconProps = {
|
|
8
|
+
name?: IconName;
|
|
9
|
+
size?: number;
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare function Icon({ name, size, strokeWidth, className, }: IconProps): import("react").JSX.Element;
|
|
14
|
+
export default Icon;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type IconName } from "./Icon.js";
|
|
2
|
+
import { type Theme } from "./shared.js";
|
|
3
|
+
export type RangeSliderProps = {
|
|
4
|
+
value?: number;
|
|
5
|
+
onChange?: (value: number) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
theme?: Theme;
|
|
11
|
+
/** Colour of the filled part of the track: a hex, rgb() or named colour, not a CSS variable. Defaults to the kit's blue. */
|
|
12
|
+
color?: string;
|
|
13
|
+
size?: "sm" | "md" | "lg" | "xl";
|
|
14
|
+
startIcon?: IconName | "none";
|
|
15
|
+
endIcon?: IconName | "none";
|
|
16
|
+
showValue?: boolean;
|
|
17
|
+
/** At rest: 1 (default) = a flat white pill, 0 = clear glass. Held, it is always clear glass. */
|
|
18
|
+
restFrost?: number;
|
|
19
|
+
refraction?: number;
|
|
20
|
+
dispersion?: number;
|
|
21
|
+
rimIntensity?: number;
|
|
22
|
+
magnification?: number;
|
|
23
|
+
motionStretch?: number;
|
|
24
|
+
motionSmoothing?: number;
|
|
25
|
+
pressSpeed?: number;
|
|
26
|
+
pressBounce?: number;
|
|
27
|
+
};
|
|
28
|
+
export declare function RangeSlider({ value, onChange, min, max, step, label, theme, color, size, startIcon, endIcon, showValue, restFrost, refraction, dispersion, rimIntensity, magnification, motionStretch, motionSmoothing, pressSpeed, pressBounce, }: RangeSliderProps): import("react").JSX.Element;
|
|
29
|
+
export default RangeSlider;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
const _0x209492=_0x1247;function _0x1247(_0x2260c7,_0x1a10e1){_0x2260c7=_0x2260c7-0x16c;const _0x32082e=_0x3208();let _0x12473c=_0x32082e[_0x2260c7];return _0x12473c;}(function(_0x32459d,_0x1f5981){const _0x2d4f3e=_0x1247,_0x5bf445=_0x32459d();while(!![]){try{const _0x4ee225=-parseInt(_0x2d4f3e(0x179))/0x1+-parseInt(_0x2d4f3e(0x17e))/0x2+-parseInt(_0x2d4f3e(0x18a))/0x3+parseInt(_0x2d4f3e(0x18b))/0x4*(parseInt(_0x2d4f3e(0x183))/0x5)+-parseInt(_0x2d4f3e(0x17d))/0x6+parseInt(_0x2d4f3e(0x178))/0x7+parseInt(_0x2d4f3e(0x197))/0x8;if(_0x4ee225===_0x1f5981)break;else _0x5bf445['push'](_0x5bf445['shift']());}catch(_0x3d2257){_0x5bf445['push'](_0x5bf445['shift']());}}}(_0x3208,0xdff74));import{j,l,f,g,i,b,d,e,h}from'../chunk-U3CZMSFP.js';import{useId,useRef}from'react';import{jsxs,jsx}from'react/jsx-runtime';var ve={'sun':{'circles':[[0xc,0xc,0x4]],'paths':[_0x209492(0x19c)]},'moon':{'paths':[_0x209492(0x19d)]},'plus':{'paths':['M12\x205v14M5\x2012h14']},'minus':{'paths':[_0x209492(0x19a)]},'check':{'paths':['m5\x2012.5\x204.5\x204.5L19\x207.5']},'close':{'paths':['M6\x206l12\x2012M18\x206\x206\x2018']},'search':{'circles':[[0xb,0xb,6.5]],'paths':[_0x209492(0x18e)]},'arrow-right':{'paths':[_0x209492(0x16f)]},'chevron-down':{'paths':['m6\x209\x206\x206\x206-6']},'settings':{'circles':[[0xc,0xc,0x3]],'paths':['M19.4\x2015a1.65\x201.65\x200\x200\x200\x20.33\x201.82l.06.06a2\x202\x200\x201\x201-2.83\x202.83l-.06-.06a1.65\x201.65\x200\x200\x200-1.82-.33\x201.65\x201.65\x200\x200\x200-1\x201.51V21a2\x202\x200\x201\x201-4\x200v-.09A1.65\x201.65\x200\x200\x200\x209\x2019.4a1.65\x201.65\x200\x200\x200-1.82.33l-.06.06a2\x202\x200\x201\x201-2.83-2.83l.06-.06A1.65\x201.65\x200\x200\x200\x204.6\x2015a1.65\x201.65\x200\x200\x200-1.51-1H3a2\x202\x200\x201\x201\x200-4h.09A1.65\x201.65\x200\x200\x200\x204.6\x209a1.65\x201.65\x200\x200\x200-.33-1.82l-.06-.06a2\x202\x200\x201\x201\x202.83-2.83l.06.06A1.65\x201.65\x200\x200\x200\x209\x204.6a1.65\x201.65\x200\x200\x200\x201-1.51V3a2\x202\x200\x201\x201\x204\x200v.09a1.65\x201.65\x200\x200\x200\x201\x201.51\x201.65\x201.65\x200\x200\x200\x201.82-.33l.06-.06a2\x202\x200\x201\x201\x202.83\x202.83l-.06.06A1.65\x201.65\x200\x200\x200\x2019.4\x209a1.65\x201.65\x200\x200\x200\x201.51\x201H21a2\x202\x200\x201\x201\x200\x204h-.09a1.65\x201.65\x200\x200\x200-1.51\x201Z']},'bell':{'paths':[_0x209492(0x185),'M13.7\x2020.5a2\x202\x200\x200\x201-3.4\x200']},'volume':{'paths':['M11\x205\x206\x209H2.5v6H6l5\x204V5Z','M15.5\x208.5a5\x205\x200\x200\x201\x200\x207M18.5\x205.5a9\x209\x200\x200\x201\x200\x2013']},'sparkle':{'paths':['M12\x203c.6\x204.6\x202.4\x206.4\x207\x207-4.6.6-6.4\x202.4-7\x207-.6-4.6-2.4-6.4-7-7\x204.6-.6\x206.4-2.4\x207-7Z']}};function T({name:_0x22d08c='sparkle',size:_0x3ebbf8=0xf,strokeWidth:_0x48144c=0x2,className:_0x195c37}){const _0xaa3446=_0x209492;let _0x20ebd3=ve[_0x22d08c];return jsxs('svg',{'width':_0x3ebbf8,'height':_0x3ebbf8,'viewBox':'0\x200\x2024\x2024','fill':_0xaa3446(0x177),'stroke':'currentColor','strokeWidth':_0x48144c,'strokeLinecap':_0xaa3446(0x16d),'strokeLinejoin':_0xaa3446(0x16d),'aria-hidden':'true','className':_0x195c37,'children':[_0x20ebd3['circles']?.[_0xaa3446(0x191)](([_0x515a38,_0x34abd5,_0x15a3a5])=>jsx(_0xaa3446(0x17b),{'cx':_0x515a38,'cy':_0x34abd5,'r':_0x15a3a5},''['concat'](_0x515a38,'-')['concat'](_0x34abd5,'-')['concat'](_0x15a3a5))),_0x20ebd3[_0xaa3446(0x182)]['map'](_0x5501cb=>jsx('path',{'d':_0x5501cb},_0x5501cb))]});}function _0x3208(){const _0x3678bc=['map','current','startX','range','value','relative\x20flex-1\x20cursor-grab\x20touch-none\x20rounded-full\x20select-none\x20active:cursor-grabbing\x20has-focus-visible:outline-2\x20has-focus-visible:outline-offset-4\x20has-focus-visible:outline-[#3291FF]','21236200TDXlPh','clientX','bottom','M5\x2012h14','key','M12\x202.5v2M12\x2019.5v2M4.6\x204.6l1.4\x201.4M18\x2018l1.4\x201.4M2.5\x2012h2M19.5\x2012h2M4.6\x2019.4\x206\x2018M18\x206l1.4-1.4','M20.5\x2014.2A8.5\x208.5\x200\x200\x201\x209.8\x203.5a8.5\x208.5\x200\x201\x200\x2010.7\x2010.7Z','left','flex\x20w-full\x20max-w-md\x20flex-col\x20gap-2','relative\x20z-10','round','canvas','M4.5\x2012h15M13.5\x206l6\x206-6\x206','press','true','abs','getBoundingClientRect','label','currentTarget','top','none','9157435PvZLSl','1410833YlwTEi','stretch','circle','startFraction','10970208hVpRfl','1693050aAyalM','button','input','sr-only','paths','15215JyDdbm','min','M18\x208.5a6\x206\x200\x201\x200-12\x200c0\x207-3\x208.5-3\x208.5h18s-3-1.5-3-8.5Z','accent','max','omega','pointer-events-none\x20absolute','703971zjGVTP','1676UxxcfU','zeta','pressed','m16\x2016\x204.5\x204.5','div','pointerId'];_0x3208=function(){return _0x3678bc;};return _0x3208();}var O=0x20,ge={'w':0xf5,'h':0x78},Y={'w':0x84,'h':0x44},xe=0x16,r={'x':0x50,'top':0x50,'bottom':0xdc},R={'sm':0x8,'md':0xc,'lg':0x12,'xl':0x1a};function Me({value:_0x3c3cc5=0x32,onChange:_0x283f82,min:_0x4c1eb1=0x0,max:_0x2445f8=0x64,step:_0x5c334e=0x1,label:_0x570da0='Volume',theme:_0x71e1ba,color:_0x493a9d,size:_0x3ab0e7='md',startIcon:_0x8ce860='none',endIcon:_0x4c4566=_0x209492(0x177),showValue:_0x282cb8=!![],restFrost:_0x66e0ba=0x1,refraction:_0x4bcbdd=0x25,dispersion:_0x474243=0.12,rimIntensity:_0x16770b=0.55,magnification:_0x591776=0x0,motionStretch:_0x27abb1=0x3,motionSmoothing:_0x3ce1b3=0x1e,pressSpeed:_0x1ccd79=e[_0x209492(0x188)],pressBounce:_0x2db884=0x1-e[_0x209492(0x18c)]}){const _0x3c04e3=_0x209492;let _0x50bd0f=useId(),[_0x441b77,_0x5954af]=j(_0x3c3cc5,_0x283f82),[_0x3d002d,{width:_0x26424f}]=l(),_0x3ab79d=R[_0x3ab0e7]/O,_0x26e86f=Math['max'](_0x26424f/_0x3ab79d,0x1),_0x42b13b=Y['h']*_0x3ab79d+0x8,_0x122d2f=_0x2445f8>_0x4c1eb1?f((_0x441b77-_0x4c1eb1)/(_0x2445f8-_0x4c1eb1)):0x0,_0x2de89a=useRef({'value':{'x':_0x122d2f,'v':0x0},'press':{'x':0x0,'v':0x0},'stretch':0x0,'pressed':![]}),_0xef7806=useRef(null),_0x2315d6={...g,'refraction':_0x4bcbdd,'dispersion':_0x474243,'rimIntensity':_0x16770b,'magnification':_0x591776},_0x45ecfe=()=>{const _0x2a8691=_0x1247;let _0x8c5129=_0x2de89a['current'],_0x2c67a6=h(_0x8c5129['press']['x'],Y,ge,_0x66e0ba,_0x2315d6),_0x14f211=f(_0x8c5129[_0x2a8691(0x170)]['x']),_0x3bc74b=_0x2c67a6['hx']*(0x1-0.44*_0x14f211);return{'lens':_0x2c67a6,'x':Math['min'](_0x26e86f-_0x3bc74b,Math['max'](_0x3bc74b,_0x8c5129['value']['x']*_0x26e86f-xe*_0x14f211))};},{canvasRef:_0x465bab}=i({'width':_0x26424f+r['x']*0x2*_0x3ab79d,'height':(r[_0x3c04e3(0x176)]+r['bottom'])*_0x3ab79d,'unit':_0x3ab79d,'cursorLight':!![],'step'(_0x4b2236,_0x26814f){const _0x368481=_0x3c04e3;let _0x2020ac=_0x2de89a[_0x368481(0x192)],_0x31014e=_0x2020ac['pressed']?0x1:0x0;if(_0x26814f)return _0x2020ac['value']={'x':_0x122d2f,'v':0x0},_0x2020ac[_0x368481(0x170)]={'x':_0x31014e,'v':0x0},_0x2020ac['stretch']=0x0,![];let _0x2359d5=d(_0x2020ac['value'],_0x122d2f,Math[_0x368481(0x187)](_0x3ce1b3,0.01),0x1,_0x4b2236),_0x1fa39a=_0x2020ac[_0x368481(0x195)]['v']*_0x26e86f,_0x2e50d2=Math['max'](-0.04,Math[_0x368481(0x184)](0.04,_0x1fa39a*0.00003*_0x27abb1));_0x2020ac[_0x368481(0x17a)]+=(_0x2e50d2-_0x2020ac[_0x368481(0x17a)])*Math[_0x368481(0x184)](0x1,_0x4b2236*0x12);let _0x240555=Math[_0x368481(0x184)](0x1,Math[_0x368481(0x187)](0.05,0x1-_0x2db884)),_0x315ccd=d(_0x2020ac['press'],_0x31014e,Math[_0x368481(0x187)](_0x1ccd79,0.01),_0x240555,_0x4b2236);return _0x2359d5||_0x315ccd||Math[_0x368481(0x172)](_0x2020ac['stretch'])>0.0001;},'draw'(_0x251195,_0x1ad1d1,_0x281b7c){const _0x27e56a=_0x3c04e3;let _0x2fcadc=_0x2de89a[_0x27e56a(0x192)];b(_0x251195,{'x':r['x']*_0x3ab79d,'y':r['top']*_0x3ab79d,'length':_0x26424f,'height':O*_0x3ab79d,'fillEnd':(r['x']+_0x2fcadc[_0x27e56a(0x195)]['x']*_0x26e86f)*_0x3ab79d,'track':_0x281b7c['track'],'accent':_0x493a9d??_0x281b7c[_0x27e56a(0x186)]});let {lens:_0x56b8ed,x:_0x4d5e2f}=_0x45ecfe();return{..._0x56b8ed,'x':r['x']+_0x4d5e2f,'y':r['top'],'stretchX':0x1+Math['abs'](_0x2fcadc[_0x27e56a(0x17a)]),'stretchY':0x1-Math['abs'](_0x2fcadc['stretch'])*0.45,'shiftX':_0x2fcadc[_0x27e56a(0x17a)]*-0x3c,'frostCenter':'#ffffff','frostEdge':'#e9ebef'};}}),_0x4d9285=_0x53c07b=>{const _0x3aec89=_0x3c04e3;let _0x1de01d=_0x4c1eb1+f(_0x53c07b)*(_0x2445f8-_0x4c1eb1);_0x5954af(Math[_0x3aec89(0x184)](_0x2445f8,Math['max'](_0x4c1eb1,Math['round'](_0x1de01d/_0x5c334e)*_0x5c334e)));},_0x63d51e=_0x524ed8=>_0x524ed8[_0x3c04e3(0x198)]-_0x524ed8[_0x3c04e3(0x175)][_0x3c04e3(0x173)]()[_0x3c04e3(0x19e)],_0x4c689f=_0x5349c4=>{const _0x22d322=_0x3c04e3;if(_0x5349c4[_0x22d322(0x17f)]!==0x0)return;_0x5349c4['currentTarget']['setPointerCapture'](_0x5349c4[_0x22d322(0x190)]),_0x2de89a[_0x22d322(0x192)][_0x22d322(0x18d)]=!![];let _0x133fe4=_0x63d51e(_0x5349c4),{lens:_0x133b61,x:_0x5e0dfc}=_0x45ecfe(),_0x23d379=_0x122d2f;Math[_0x22d322(0x172)](_0x133fe4/_0x3ab79d-_0x5e0dfc)>_0x133b61['hx']+0x8&&(_0x23d379=_0x133fe4/_0x26424f,_0x4d9285(_0x23d379)),_0xef7806[_0x22d322(0x192)]={'startX':_0x133fe4,'startFraction':_0x23d379},_0x5349c4['preventDefault']();},_0x174144=_0x3ab79a=>{const _0x24c5ef=_0x3c04e3;let _0x275113=_0xef7806['current'];_0x275113&&_0x4d9285(_0x275113[_0x24c5ef(0x17c)]+(_0x63d51e(_0x3ab79a)-_0x275113[_0x24c5ef(0x193)])/_0x26424f);},_0x177249=()=>{const _0x5daef2=_0x3c04e3;_0xef7806['current']=null,_0x2de89a[_0x5daef2(0x192)]['pressed']=![];},_0x4b49e0=_0x59e74c=>{const _0x4a2981=_0x3c04e3;(_0x59e74c[_0x4a2981(0x19b)]==='PageUp'||_0x59e74c['key']==='PageDown')&&(_0x59e74c['preventDefault'](),_0x4d9285(_0x122d2f+(_0x59e74c['key']==='PageUp'?0.1:-0.1)));};return jsxs(_0x3c04e3(0x18f),{'data-theme':_0x71e1ba,'className':_0x3c04e3(0x19f),'children':[(_0x570da0||_0x282cb8)&&jsxs('div',{'className':'flex\x20items-center\x20justify-between\x20px-1\x20text-[13px]\x20font-medium','children':[jsx(_0x3c04e3(0x174),{'htmlFor':_0x50bd0f,'className':'text-neutral-900\x20dark:text-white','children':_0x570da0}),_0x282cb8&&jsx('span',{'className':'text-neutral-500\x20tabular-nums','children':Math['round'](_0x441b77)})]}),jsxs('div',{'className':'flex\x20items-center\x20gap-4\x20text-neutral-500','children':[_0x8ce860!==_0x3c04e3(0x177)&&jsx(T,{'name':_0x8ce860,'size':Math[_0x3c04e3(0x187)](0xe,R[_0x3ab0e7]+0x4),'className':_0x3c04e3(0x16c)}),jsxs(_0x3c04e3(0x18f),{'ref':_0x3d002d,'onPointerDown':_0x4c689f,'onPointerMove':_0x174144,'onPointerUp':_0x177249,'onPointerCancel':_0x177249,'className':_0x3c04e3(0x196),'style':{'height':_0x42b13b},'children':[jsx(_0x3c04e3(0x16e),{'ref':_0x465bab,'aria-hidden':_0x3c04e3(0x171),'className':_0x3c04e3(0x189),'style':{'left':-0x50*_0x3ab79d,'top':_0x42b13b/0x2-r[_0x3c04e3(0x176)]*_0x3ab79d,'width':_0x26424f+r['x']*0x2*_0x3ab79d,'height':(r['top']+r[_0x3c04e3(0x199)])*_0x3ab79d}}),jsx(_0x3c04e3(0x180),{'id':_0x50bd0f,'type':_0x3c04e3(0x194),'min':_0x4c1eb1,'max':_0x2445f8,'step':_0x5c334e,'value':_0x441b77,'onChange':_0x5a7ef5=>_0x5954af(Number(_0x5a7ef5['currentTarget'][_0x3c04e3(0x195)])),'onKeyDown':_0x4b49e0,'className':_0x3c04e3(0x181)})]}),_0x4c4566!==_0x3c04e3(0x177)&&jsx(T,{'name':_0x4c4566,'size':Math['max'](0xe,R[_0x3ab0e7]+0x4),'className':_0x3c04e3(0x16c)})]})]});}var Ie=Me;export{Me as RangeSlider,Ie as default};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Theme } from "./shared.js";
|
|
2
|
+
export type SwitchProps = {
|
|
3
|
+
checked?: boolean;
|
|
4
|
+
onChange?: (checked: boolean) => void;
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
theme?: Theme;
|
|
8
|
+
/** Colour of the track while on: a hex, rgb() or named colour, not a CSS variable. Defaults to the kit's blue. */
|
|
9
|
+
color?: string;
|
|
10
|
+
size?: "sm" | "md" | "lg";
|
|
11
|
+
labelSide?: "left" | "right";
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** Pressed lens size relative to the resting knob. */
|
|
14
|
+
lensScale?: number;
|
|
15
|
+
refraction?: number;
|
|
16
|
+
knobBounce?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare function Switch({ checked, onChange, label, description, theme, color, size, labelSide, disabled, lensScale, refraction, knobBounce, }: SwitchProps): import("react").JSX.Element;
|
|
19
|
+
export default Switch;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
const _0x3fc32a=_0x4d24;(function(_0x30e371,_0x93b42d){const _0xd4a27b=_0x4d24,_0x568e3e=_0x30e371();while(!![]){try{const _0x5ece0c=-parseInt(_0xd4a27b(0x177))/0x1*(parseInt(_0xd4a27b(0x16c))/0x2)+parseInt(_0xd4a27b(0x159))/0x3*(-parseInt(_0xd4a27b(0x172))/0x4)+parseInt(_0xd4a27b(0x175))/0x5*(-parseInt(_0xd4a27b(0x160))/0x6)+-parseInt(_0xd4a27b(0x169))/0x7+parseInt(_0xd4a27b(0x161))/0x8*(parseInt(_0xd4a27b(0x163))/0x9)+-parseInt(_0xd4a27b(0x167))/0xa+-parseInt(_0xd4a27b(0x165))/0xb*(-parseInt(_0xd4a27b(0x168))/0xc);if(_0x5ece0c===_0x93b42d)break;else _0x568e3e['push'](_0x568e3e['shift']());}catch(_0x3759a3){_0x568e3e['push'](_0x568e3e['shift']());}}}(_0x2ae2,0x64d0b));import{j as _0x5bb677,i,b,f,c as _0x553816,g,h,d,e,k}from'../chunk-U3CZMSFP.js';function _0x4d24(_0x3bbc44,_0x124f14){_0x3bbc44=_0x3bbc44-0x158;const _0x2ae293=_0x2ae2();let _0x4d244a=_0x2ae293[_0x3bbc44];return _0x4d244a;}function _0x2ae2(){const _0x1ebb8c=['pos','accent','bottom','switch','8udmfpC','right','zeta','3214110yzmwCh','pointer-events-none\x20absolute','3066lOJCHX','span','882726TvTJSk','currentTarget','moved','track','left','press','top','6ZATzlm','5417136VbwzsQ','startPos','9VVrOeL','inline-flex','11NkkLCd','dragPos','5223030pLNRdq','20048892zlJCqp','88935WcNyNN','current','button','110ZbLQqE','label'];_0x2ae2=function(){return _0x1ebb8c;};return _0x2ae2();}import{useId,useRef}from'react';import{jsx,jsxs}from'react/jsx-runtime';var s={'w':0x89,'h':0x3c},c={'w':0x51,'h':0x33},G=(s['h']-c['h'])/0x2,o={'x':0x3c,'top':0x32,'bottom':0x82},j={'sm':0x16,'md':0x1c,'lg':0x24};function tt({checked:_0x3ce99b=![],onChange:_0x510198,label:_0x595bd0='Notifications',description:_0x97192f,theme:_0x4b6d36,color:_0x497f0f,size:_0x3bdfc0='md',labelSide:_0x1862e6=_0x3fc32a(0x173),disabled:_0x2225ad=![],lensScale:_0x56ec6e=1.55,refraction:_0x3f6f1d=0x1a,knobBounce:_0x5a2d09=0.3}){const _0x30a3bb=_0x3fc32a;let _0x3b0290=useId(),[_0x54ff9e,_0x316c2e]=_0x5bb677(_0x3ce99b,_0x510198),_0x2d8b5c=j[_0x3bdfc0]/s['h'],_0x1f56a9=s['w']*_0x2d8b5c,_0x42caf2=s['h']*_0x2d8b5c,_0x773d24=s['w']-c['w']-G*0x2,_0x570bfe=useRef({'pos':{'x':_0x54ff9e?0x1:0x0,'v':0x0},'press':{'x':0x0,'v':0x0},'pressed':![],'dragPos':null}),_0x3380b0=useRef(null),_0x5d94e5=useRef(![]),{canvasRef:_0x59da0e}=i({'width':(s['w']+o['x']*0x2)*_0x2d8b5c,'height':(s['h']+o[_0x30a3bb(0x15f)]+o[_0x30a3bb(0x170)])*_0x2d8b5c,'unit':_0x2d8b5c,'cursorLight':!![],'step'(_0x15860d,_0x4a0492){const _0x136891=_0x30a3bb;let _0x12d11b=_0x570bfe['current'],_0xf756a4=_0x12d11b['dragPos']??(_0x54ff9e?0x1:0x0);if(_0x4a0492)return _0x12d11b['pos']={'x':_0xf756a4,'v':0x0},_0x12d11b[_0x136891(0x15e)]={'x':_0x12d11b['pressed']?0x1:0x0,'v':0x0},![];let _0x57c579=_0x12d11b['dragPos']===null&&Math['abs'](_0x12d11b[_0x136891(0x16e)]['x']-_0xf756a4)>0.08,_0x30ec38=_0x12d11b[_0x136891(0x166)]!==null?d(_0x12d11b[_0x136891(0x16e)],_0xf756a4,0x28,0x1,_0x15860d):d(_0x12d11b[_0x136891(0x16e)],_0xf756a4,0xf,0x1-_0x5a2d09,_0x15860d),_0x519095=d(_0x12d11b['press'],_0x12d11b['pressed']||_0x57c579?0x1:0x0,e['omega'],e[_0x136891(0x174)],_0x15860d);return _0x30ec38||_0x519095;},'draw'(_0x2f8802,_0x28d8d9,_0x117969){const _0x1016c7=_0x30a3bb;let _0x3bf315=_0x570bfe['current'];b(_0x2f8802,{'x':o['x']*_0x2d8b5c,'y':(o[_0x1016c7(0x15f)]+s['h']/0x2)*_0x2d8b5c,'length':_0x1f56a9,'height':_0x42caf2,'fillEnd':(o['x']+s['w'])*_0x2d8b5c,'track':_0x117969[_0x1016c7(0x15c)],'accent':_0x497f0f??_0x117969[_0x1016c7(0x16f)],'fillOpacity':f(_0x3bf315['pos']['x'])});let _0x2cd400=c['h']*_0x56ec6e/0x78,_0x4c68b1={..._0x553816(g,_0x2cd400),'refraction':_0x3f6f1d,'cornerRadius':0x3e7};return{...h(_0x3bf315[_0x1016c7(0x15e)]['x'],c,{'w':c['w']*_0x56ec6e,'h':c['h']*_0x56ec6e},0x1,_0x4c68b1),'x':o['x']+G+c['w']/0x2+_0x3bf315['pos']['x']*_0x773d24,'y':o['top']+s['h']/0x2,'stretchX':0x1,'stretchY':0x1,'shiftX':0x0,'frostCenter':'#ffffff','frostEdge':'#e9ebef'};}}),_0x34d8e0=_0x442a90=>_0x442a90['clientX']-_0x442a90[_0x30a3bb(0x15a)]['getBoundingClientRect']()['left'],_0x3f448e=_0x3c10d2=>{const _0x37f15f=_0x30a3bb;_0x2225ad||_0x3c10d2[_0x37f15f(0x16b)]!==0x0||(_0x3c10d2[_0x37f15f(0x15a)]['setPointerCapture'](_0x3c10d2['pointerId']),_0x570bfe[_0x37f15f(0x16a)]['pressed']=!![],_0x3380b0[_0x37f15f(0x16a)]={'startX':_0x34d8e0(_0x3c10d2),'startPos':_0x54ff9e?0x1:0x0,'moved':![]});},_0x853e09=_0x4be29f=>{const _0x7fcab0=_0x30a3bb;let _0x5c8f86=_0x3380b0[_0x7fcab0(0x16a)];if(!_0x5c8f86)return;let _0x380cbd=_0x34d8e0(_0x4be29f)-_0x5c8f86['startX'];!_0x5c8f86['moved']&&Math['abs'](_0x380cbd)<0x3||(_0x5c8f86['moved']=!![],_0x570bfe[_0x7fcab0(0x16a)][_0x7fcab0(0x166)]=f(_0x5c8f86[_0x7fcab0(0x162)]+_0x380cbd/(_0x773d24*_0x2d8b5c)));},_0x2b989b=()=>{const _0x594a89=_0x30a3bb;let _0x41420e=_0x3380b0[_0x594a89(0x16a)];_0x3380b0[_0x594a89(0x16a)]=null;let _0x556089=_0x570bfe[_0x594a89(0x16a)];if(_0x556089['pressed']=![],!_0x41420e)return;let _0x5b79de=_0x41420e[_0x594a89(0x15b)]?(_0x556089[_0x594a89(0x166)]??0x0)>0.5:!_0x54ff9e;_0x556089[_0x594a89(0x166)]=null,_0x5d94e5[_0x594a89(0x16a)]=!![],_0x316c2e(_0x5b79de);},_0x5eabaf=jsx('button',{'id':_0x3b0290,'type':'button','role':_0x30a3bb(0x171),'aria-checked':_0x54ff9e,'disabled':_0x2225ad,'onClick':()=>{const _0xe99c13=_0x30a3bb;_0x5d94e5[_0xe99c13(0x16a)]?_0x5d94e5[_0xe99c13(0x16a)]=![]:_0x316c2e(!_0x54ff9e);},'onPointerDown':_0x3f448e,'onPointerMove':_0x853e09,'onPointerUp':_0x2b989b,'onPointerCancel':_0x2b989b,'className':'relative\x20shrink-0\x20cursor-pointer\x20touch-none\x20rounded-full\x20disabled:cursor-not-allowed\x20disabled:opacity-40\x20'['concat'](k),'style':{'width':_0x1f56a9,'height':_0x42caf2},'children':jsx('canvas',{'ref':_0x59da0e,'aria-hidden':'true','className':_0x30a3bb(0x176),'style':{'left':-0x3c*_0x2d8b5c,'top':-0x32*_0x2d8b5c,'width':(s['w']+o['x']*0x2)*_0x2d8b5c,'height':(s['h']+o[_0x30a3bb(0x15f)]+o['bottom'])*_0x2d8b5c}})});return _0x595bd0?jsxs('div',{'data-theme':_0x4b6d36,'className':'inline-flex\x20items-center\x20gap-3\x20'['concat'](_0x1862e6===_0x30a3bb(0x15d)?'flex-row-reverse':''),'children':[_0x5eabaf,jsxs(_0x30a3bb(0x16d),{'htmlFor':_0x3b0290,'className':'relative\x20flex\x20cursor-pointer\x20flex-col\x20select-none','children':[jsx(_0x30a3bb(0x158),{'className':'text-[13px]\x20font-medium\x20text-neutral-900\x20dark:text-white','children':_0x595bd0}),_0x97192f&&jsx('span',{'className':'text-[12px]\x20text-neutral-500','children':_0x97192f})]})]}):jsx(_0x30a3bb(0x158),{'data-theme':_0x4b6d36,'className':_0x30a3bb(0x164),'children':_0x5eabaf});}var ct=tt;export{tt as Switch,ct as default};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Portions © 2026 Bilal Abdullah Gürşen, MIT License (see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
export declare function roundRect(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, r: number): void;
|
|
3
|
+
/** The page's font stack, so canvas labels match the DOM. */
|
|
4
|
+
export declare function fontFamily(): string;
|
|
5
|
+
/** Slider-style track: flat inactive pill plus a flat accent fill ending at `fillEnd`. */
|
|
6
|
+
export declare function drawTrack(ctx: CanvasRenderingContext2D, o: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
length: number;
|
|
10
|
+
height: number;
|
|
11
|
+
fillEnd: number;
|
|
12
|
+
track: string;
|
|
13
|
+
accent: string;
|
|
14
|
+
fillOpacity?: number;
|
|
15
|
+
}): void;
|
|
16
|
+
export declare function drawLabel(ctx: CanvasRenderingContext2D, text: string, cx: number, cy: number, size: number, color: string, weight?: number): void;
|
|
17
|
+
/** Strokes one of the Icon set's 24 × 24 glyphs centered at (cx, cy). */
|
|
18
|
+
export declare function drawIcon(ctx: CanvasRenderingContext2D, shape: {
|
|
19
|
+
paths: string[];
|
|
20
|
+
circles?: [number, number, number][];
|
|
21
|
+
}, cx: number, cy: number, size: number, color: string, strokeWidth?: number): void;
|
|
22
|
+
/** Scales the slider's spatial optics (designed for a 120-unit lens) to another lens height. */
|
|
23
|
+
export declare function scaleOptics<T extends {
|
|
24
|
+
refraction: number;
|
|
25
|
+
restRefraction: number;
|
|
26
|
+
bevelWidth: number;
|
|
27
|
+
shadowSoftness: number;
|
|
28
|
+
shadowOffset: number;
|
|
29
|
+
}>(o: T, k: number): T;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/** Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Portions © 2026 Bilal Abdullah Gürşen, MIT License (see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
export type Spring = {
|
|
3
|
+
x: number;
|
|
4
|
+
v: number;
|
|
5
|
+
};
|
|
6
|
+
/** Damped spring toward `target` (omega = speed, zeta = damping ratio; 1 = critical). */
|
|
7
|
+
export declare function stepSpring(s: Spring, target: number, omega: number, zeta: number, dt: number): boolean;
|
|
8
|
+
/** The slider's press spring: pressSpeed 16, pressBounce 0.4. */
|
|
9
|
+
export declare const PRESS: {
|
|
10
|
+
omega: number;
|
|
11
|
+
zeta: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Hover swell springs. Width and height use different speeds and low damping, so they
|
|
15
|
+
* overshoot out of phase and the glass wobbles like a drop of liquid as it grows.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HOVER_X: {
|
|
18
|
+
omega: number;
|
|
19
|
+
zeta: number;
|
|
20
|
+
};
|
|
21
|
+
export declare const HOVER_Y: {
|
|
22
|
+
omega: number;
|
|
23
|
+
zeta: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const lerp: (a: number, b: number, t: number) => number;
|
|
26
|
+
export declare const saturate: (v: number) => number;
|
|
27
|
+
/** All lens values are in design units (the slider's 750 × 532 frame). */
|
|
28
|
+
export type LensState = {
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
hx: number;
|
|
32
|
+
hy: number;
|
|
33
|
+
radius: number;
|
|
34
|
+
bevel: number;
|
|
35
|
+
refract: number;
|
|
36
|
+
mag: number;
|
|
37
|
+
disp: number;
|
|
38
|
+
blurCenter: number;
|
|
39
|
+
blurEdge: number;
|
|
40
|
+
frost: number;
|
|
41
|
+
rim: number;
|
|
42
|
+
caustic: number;
|
|
43
|
+
inner: number;
|
|
44
|
+
topRefl: number;
|
|
45
|
+
shadowOpacity: number;
|
|
46
|
+
shadowSoftness: number;
|
|
47
|
+
shadowOffset: number;
|
|
48
|
+
stretchX: number;
|
|
49
|
+
stretchY: number;
|
|
50
|
+
shiftX: number;
|
|
51
|
+
frostCenter?: string;
|
|
52
|
+
frostEdge?: string;
|
|
53
|
+
visible?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type GlassOptics = {
|
|
56
|
+
refraction: number;
|
|
57
|
+
restRefraction: number;
|
|
58
|
+
bevelWidth: number;
|
|
59
|
+
cornerRadius: number;
|
|
60
|
+
magnification: number;
|
|
61
|
+
dispersion: number;
|
|
62
|
+
blurCenter: number;
|
|
63
|
+
blurEdge: number;
|
|
64
|
+
frostBlur: number;
|
|
65
|
+
rimIntensity: number;
|
|
66
|
+
topReflection: number;
|
|
67
|
+
innerShading: number;
|
|
68
|
+
causticStrength: number;
|
|
69
|
+
shadowOpacity: number;
|
|
70
|
+
shadowSoftness: number;
|
|
71
|
+
shadowOffset: number;
|
|
72
|
+
};
|
|
73
|
+
/** Defaults of the hero slider (params.ts). */
|
|
74
|
+
export declare const sliderOptics: GlassOptics;
|
|
75
|
+
/**
|
|
76
|
+
* Morph between a small resting pill and the big pressed lens (engine applyPress).
|
|
77
|
+
* `press` may overshoot 0…1 with the spring; `frost` is the resting frost amount.
|
|
78
|
+
*/
|
|
79
|
+
export declare function pressedLens(press: number, rest: {
|
|
80
|
+
w: number;
|
|
81
|
+
h: number;
|
|
82
|
+
}, lens: {
|
|
83
|
+
w: number;
|
|
84
|
+
h: number;
|
|
85
|
+
}, frostAtRest: number, o?: GlassOptics): Omit<LensState, "x" | "y" | "stretchX" | "stretchY" | "shiftX">;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { LensState } from "./physics.js";
|
|
2
|
+
import { type GlassThemeName, type GlassTokens } from "./tokens.js";
|
|
3
|
+
export type GlassViewSpec = {
|
|
4
|
+
/** Canvas size in CSS px. */
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
/** CSS px per design unit. */
|
|
8
|
+
unit: number;
|
|
9
|
+
/** Advance animation; return true while anything still moves. */
|
|
10
|
+
step?: (dt: number, reducedMotion: boolean) => boolean;
|
|
11
|
+
/** Paint both layers (contexts are cleared and scaled to CSS px) and return the lens. */
|
|
12
|
+
draw: (bg: CanvasRenderingContext2D, fg: CanvasRenderingContext2D, tokens: GlassTokens, theme: GlassThemeName) => LensState;
|
|
13
|
+
/** 1 = foreground hides inside the clear lens so the refracted backdrop shows (segmented labels). */
|
|
14
|
+
fgUnderLens?: number;
|
|
15
|
+
/** Rim highlight leans toward the cursor. Off = fixed studio lighting. */
|
|
16
|
+
cursorLight?: boolean;
|
|
17
|
+
/** Redraw every frame even while nothing moves (the naive loop the site's demo compares against). */
|
|
18
|
+
alwaysRender?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/** Running totals for one view: GPU passes and main-thread time spent in them. */
|
|
21
|
+
export type GlassViewStats = {
|
|
22
|
+
renders: number;
|
|
23
|
+
ms: number;
|
|
24
|
+
};
|
|
25
|
+
export type GlassViewHandle = {
|
|
26
|
+
invalidate: () => void;
|
|
27
|
+
dispose: () => void;
|
|
28
|
+
stats: () => GlassViewStats;
|
|
29
|
+
};
|
|
30
|
+
/** Lazily creates the shared renderer (client only). */
|
|
31
|
+
export declare function getGlassRuntime(): Promise<{
|
|
32
|
+
createView(canvas: HTMLCanvasElement, spec: () => GlassViewSpec): Promise<GlassViewHandle>;
|
|
33
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Portions © 2026 Bilal Abdullah Gürşen, MIT License (see THIRD_PARTY_NOTICES.md). */
|
|
2
|
+
export type GlassThemeName = "light" | "dark";
|
|
3
|
+
export type GlassTokens = {
|
|
4
|
+
/** Page color the glass refracts where nothing is drawn beneath it. */
|
|
5
|
+
surface: string;
|
|
6
|
+
track: string;
|
|
7
|
+
accent: string;
|
|
8
|
+
accentDeep: string;
|
|
9
|
+
frostCenter: string;
|
|
10
|
+
frostEdge: string;
|
|
11
|
+
text: string;
|
|
12
|
+
textMuted: string;
|
|
13
|
+
well: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const glassTokens: Record<GlassThemeName, GlassTokens>;
|
|
16
|
+
export declare function hexToRgb(hex: string): [number, number, number];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GlassViewSpec, GlassViewStats } from "./runtime.js";
|
|
2
|
+
/**
|
|
3
|
+
* Registers a canvas with the shared glass renderer. The spec is read fresh every
|
|
4
|
+
* frame, so callers keep animation state in refs and simply return a new spec.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useGlassCanvas(spec: GlassViewSpec): {
|
|
7
|
+
canvasRef: import("react").RefObject<HTMLCanvasElement | null>;
|
|
8
|
+
invalidate: () => void | undefined;
|
|
9
|
+
stats: () => GlassViewStats;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Per-component theme override; omit it to follow the page (data-theme="dark" or class="dark"). */
|
|
2
|
+
export type Theme = "light" | "dark";
|
|
3
|
+
export declare function useSyncedState<T>(value: T, onChange?: (value: T) => void): readonly [T, (next: T) => void];
|
|
4
|
+
export declare const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#3291FF]";
|
|
5
|
+
export declare function useElementSize<T extends HTMLElement>(): readonly [import("react").RefObject<T | null>, {
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
}];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type GlassMaterial } from "./glass-layer.js";
|
|
3
|
+
export type GlassActionState = "idle" | "pending" | "success";
|
|
4
|
+
export type GlassActionButtonProps = {
|
|
5
|
+
/** The idle label; also the button's accessible name. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Runs on press. Return a promise to stay pending until it settles. */
|
|
8
|
+
onAction: () => unknown;
|
|
9
|
+
/** Called when `onAction` throws or rejects; the button returns to idle. */
|
|
10
|
+
onActionError?: (error: unknown) => void;
|
|
11
|
+
/** Label while `onAction` runs. Default: the idle label. */
|
|
12
|
+
pendingLabel?: ReactNode;
|
|
13
|
+
/** Label after `onAction` succeeds. Default: the idle label. */
|
|
14
|
+
successLabel?: ReactNode;
|
|
15
|
+
/** Milliseconds after a success before the droplet splits off again. 0 (default) stays merged. */
|
|
16
|
+
resetAfter?: number;
|
|
17
|
+
/** The droplet's idle icon. Default: an arrow. */
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
material?: GlassMaterial;
|
|
20
|
+
size?: "sm" | "md" | "lg";
|
|
21
|
+
/** Clear glass: how much tint covers the backdrop (0–1). */
|
|
22
|
+
tint?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className" | "onClick">;
|
|
25
|
+
export declare function GlassActionButton({ children, onAction, onActionError, pendingLabel, successLabel, resetAfter, icon, material, size, tint, disabled, className, type, ...rest }: GlassActionButtonProps): import("react").JSX.Element;
|
|
26
|
+
export default GlassActionButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
(function(_0x22504b,_0x1b6d70){var _0x5ae197=_0x1f43,_0x59e613=_0x22504b();while(!![]){try{var _0x16983a=-parseInt(_0x5ae197(0xdc))/0x1*(-parseInt(_0x5ae197(0xdf))/0x2)+-parseInt(_0x5ae197(0xe0))/0x3*(-parseInt(_0x5ae197(0xe6))/0x4)+-parseInt(_0x5ae197(0xe5))/0x5+parseInt(_0x5ae197(0xe3))/0x6*(-parseInt(_0x5ae197(0xdd))/0x7)+parseInt(_0x5ae197(0xe4))/0x8+-parseInt(_0x5ae197(0xde))/0x9+parseInt(_0x5ae197(0xe2))/0xa*(parseInt(_0x5ae197(0xe1))/0xb);if(_0x16983a===_0x1b6d70)break;else _0x59e613['push'](_0x59e613['shift']());}catch(_0x3decd9){_0x59e613['push'](_0x59e613['shift']());}}}(_0x421b,0xe61c2));function _0x421b(){var _0x437e40=['68THynqA','305475VbbPYX','23673826gXvnVF','10tMSQmB','1080XeyMdz','7114952eJNNlg','7895340BgZNhn','56wYJTQD','1915spTCYb','52941KnnUHK','5843313DSKBsh'];_0x421b=function(){return _0x437e40;};return _0x421b();}export{a as GlassActionButton,b as default}from'./chunk-5FQVPDYS.js';function _0x1f43(_0x2bfe63,_0x324724){_0x2bfe63=_0x2bfe63-0xdc;var _0x421b97=_0x421b();var _0x1f4307=_0x421b97[_0x2bfe63];return _0x1f4307;}import'./chunk-QM4IN3YJ.js';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type GlassBadgeProps = {
|
|
2
|
+
children: string;
|
|
3
|
+
/** Separator colour (CSS). Default: the text colour. */
|
|
4
|
+
dotColor?: string;
|
|
5
|
+
/** Loops per second at rest. */
|
|
6
|
+
speed?: number;
|
|
7
|
+
/** Opacity of the tint over the backdrop (0–1). */
|
|
8
|
+
tint?: number;
|
|
9
|
+
className?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function GlassBadge({ children, dotColor, speed, tint, className, }: GlassBadgeProps): import("react").JSX.Element;
|
|
12
|
+
export default GlassBadge;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
(function(_0x4d04f8,_0x36d126){var _0x40379e=_0x4bdf,_0x192189=_0x4d04f8();while(!![]){try{var _0x5f40c3=parseInt(_0x40379e(0x16d))/0x1+-parseInt(_0x40379e(0x16f))/0x2*(-parseInt(_0x40379e(0x172))/0x3)+parseInt(_0x40379e(0x16e))/0x4+parseInt(_0x40379e(0x16b))/0x5+-parseInt(_0x40379e(0x171))/0x6*(-parseInt(_0x40379e(0x16a))/0x7)+parseInt(_0x40379e(0x16c))/0x8+-parseInt(_0x40379e(0x170))/0x9;if(_0x5f40c3===_0x36d126)break;else _0x192189['push'](_0x192189['shift']());}catch(_0x58b255){_0x192189['push'](_0x192189['shift']());}}}(_0x4bb0,0x23e77));function _0x4bdf(_0x58eb6a,_0x12f45d){_0x58eb6a=_0x58eb6a-0x16a;var _0x4bb010=_0x4bb0();var _0x4bdfb8=_0x4bb010[_0x58eb6a];return _0x4bdfb8;}export{a as GlassBadge,b as default}from'./chunk-NIACCP5E.js';import'./chunk-QM4IN3YJ.js';function _0x4bb0(){var _0x7eaaba=['568560nhhfiR','97262gJTLDo','7248672IDBBUa','254256iZuBxE','15mdUZvo','21QKoVPp','72575wuUWfj','1307888jDNlNr','262047oAvoRZ'];_0x4bb0=function(){return _0x7eaaba;};return _0x4bb0();}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type GlassMaterial } from "./glass-layer.js";
|
|
3
|
+
export type GlassButtonGroupSize = "sm" | "md" | "lg";
|
|
4
|
+
export type GlassButtonGroupOrientation = "horizontal" | "vertical";
|
|
5
|
+
export type GlassButtonGroupProps = {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Side by side (default) or stacked. */
|
|
8
|
+
orientation?: GlassButtonGroupOrientation;
|
|
9
|
+
/** Height of a horizontal group: 32, 40 or 48 px. Its items follow. */
|
|
10
|
+
size?: GlassButtonGroupSize;
|
|
11
|
+
/** Glass look. Default `tinted`: white, or the colour of your own `bg-*` class. `clear` bends the page behind it. */
|
|
12
|
+
material?: GlassMaterial;
|
|
13
|
+
/** Clear glass: how much tint covers the backdrop (0–1). */
|
|
14
|
+
tint?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "children" | "className">;
|
|
17
|
+
export type GlassButtonGroupItemProps = {
|
|
18
|
+
children?: ReactNode;
|
|
19
|
+
/** Render the item on the single child element (a router `<Link>`, a menu trigger) instead of a `<button>`. */
|
|
20
|
+
asChild?: boolean;
|
|
21
|
+
className?: string;
|
|
22
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className">;
|
|
23
|
+
export declare function GlassButtonGroup({ children, orientation, size, material, tint, className, ...rest }: GlassButtonGroupProps): import("react").JSX.Element;
|
|
24
|
+
/** One action of the group: a plain button that lies in the group's glass. */
|
|
25
|
+
export declare function GlassButtonGroupItem({ children, asChild, className, type, ...rest }: GlassButtonGroupItemProps): import("react").JSX.Element;
|
|
26
|
+
/** A hairline between two items. It turns with the group. */
|
|
27
|
+
export declare function GlassButtonGroupSeparator({ className, }: {
|
|
28
|
+
className?: string;
|
|
29
|
+
}): import("react").JSX.Element;
|
|
30
|
+
/** Text that is not a button: a unit, a count, a label for the items next to it. */
|
|
31
|
+
export declare function GlassButtonGroupText({ children, className, ...rest }: {
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
className?: string;
|
|
34
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, "children" | "className">): import("react").JSX.Element;
|
|
35
|
+
export default GlassButtonGroup;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
(function(_0x76e6fc,_0x11ab35){var _0xa92e42=_0x29bf,_0x28fd8f=_0x76e6fc();while(!![]){try{var _0x3bc310=-parseInt(_0xa92e42(0xae))/0x1+-parseInt(_0xa92e42(0xad))/0x2*(parseInt(_0xa92e42(0xac))/0x3)+-parseInt(_0xa92e42(0xb1))/0x4*(parseInt(_0xa92e42(0xab))/0x5)+parseInt(_0xa92e42(0xa9))/0x6+-parseInt(_0xa92e42(0xb0))/0x7*(parseInt(_0xa92e42(0xaf))/0x8)+-parseInt(_0xa92e42(0xa7))/0x9*(-parseInt(_0xa92e42(0xaa))/0xa)+parseInt(_0xa92e42(0xa8))/0xb;if(_0x3bc310===_0x11ab35)break;else _0x28fd8f['push'](_0x28fd8f['shift']());}catch(_0x2fa313){_0x28fd8f['push'](_0x28fd8f['shift']());}}}(_0x430e,0xe2f74));function _0x430e(){var _0x34d89b=['20250846WmqHQm','9198036NdPXNu','780490qBwaLw','1315BQxLAt','1840518Ynwdmr','2SFZwxH','376769jwCAWc','72tyhKZP','1305003QAkhdm','12028vAuTIv','117DmPRMb'];_0x430e=function(){return _0x34d89b;};return _0x430e();}export{a as GlassButtonGroup,b as GlassButtonGroupItem,c as GlassButtonGroupSeparator,d as GlassButtonGroupText,e as default}from'./chunk-RNHRKD6Z.js';function _0x29bf(_0x217d60,_0x54331a){_0x217d60=_0x217d60-0xa7;var _0x430e84=_0x430e();var _0x29bf57=_0x430e84[_0x217d60];return _0x29bf57;}import'./chunk-3PB7SR7K.js';import'./chunk-QM4IN3YJ.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type GlassMaterial } from "./glass-layer.js";
|
|
3
|
+
export type GlassButtonSize = "sm" | "md" | "lg" | "xl";
|
|
4
|
+
export type GlassButtonProps = {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Glass look. Default `clear`. */
|
|
7
|
+
material?: GlassMaterial;
|
|
8
|
+
size?: GlassButtonSize;
|
|
9
|
+
/** An icon element (e.g. a lucide-react icon). */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
iconPosition?: "start" | "end";
|
|
12
|
+
/** Clear glass: how much tint covers the backdrop (0–1). */
|
|
13
|
+
tint?: number;
|
|
14
|
+
/** Render the glass on the single child element (e.g. a router `<Link>`) instead of a `<button>`. */
|
|
15
|
+
asChild?: boolean;
|
|
16
|
+
className?: string;
|
|
17
|
+
} & Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "className">;
|
|
18
|
+
export declare function GlassButton({ children, material, size, icon, iconPosition, tint, asChild, className, type, ...rest }: GlassButtonProps): import("react").JSX.Element;
|
|
19
|
+
export default GlassButton;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
(function(_0x9019bb,_0x206308){var _0x33c043=_0x4cbb,_0x4cc496=_0x9019bb();while(!![]){try{var _0x1b57fa=parseInt(_0x33c043(0x88))/0x1*(parseInt(_0x33c043(0x86))/0x2)+parseInt(_0x33c043(0x84))/0x3*(-parseInt(_0x33c043(0x81))/0x4)+parseInt(_0x33c043(0x7c))/0x5*(-parseInt(_0x33c043(0x7e))/0x6)+-parseInt(_0x33c043(0x80))/0x7*(-parseInt(_0x33c043(0x83))/0x8)+-parseInt(_0x33c043(0x87))/0x9+-parseInt(_0x33c043(0x7d))/0xa*(parseInt(_0x33c043(0x85))/0xb)+parseInt(_0x33c043(0x7f))/0xc*(parseInt(_0x33c043(0x82))/0xd);if(_0x1b57fa===_0x206308)break;else _0x4cc496['push'](_0x4cc496['shift']());}catch(_0x4d19ec){_0x4cc496['push'](_0x4cc496['shift']());}}}(_0x339e,0xb0aa0));export{a as GlassButton,b as default}from'./chunk-SQYCOYYN.js';function _0x339e(){var _0x30eae6=['4873wKPVHh','448558BEhTrz','10631439uirFMX','5BLNAZn','4034845uELQDt','14830roFKmf','6KSdgmE','17426508SgykFJ','8855lviKyB','3270572kzolrn','26dKYZEr','1016tahXOk','3QAFdwB'];_0x339e=function(){return _0x30eae6;};return _0x339e();}function _0x4cbb(_0x2d39e5,_0x33650d){_0x2d39e5=_0x2d39e5-0x7c;var _0x339e0f=_0x339e();var _0x4cbb2b=_0x339e0f[_0x2d39e5];return _0x4cbb2b;}import'./chunk-QM4IN3YJ.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
2
|
+
import { type GlassMaterial, type GlassOptics } from "./glass-layer.js";
|
|
3
|
+
export type GlassCardProps = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
/** Glass look. Default `clear`: frosts and bends what is behind. `tinted` takes the card's own background colour. */
|
|
6
|
+
material?: GlassMaterial;
|
|
7
|
+
/** Clear glass: how much tint covers the backdrop (0–1, default 0.7): white on a light page, black on a dark one. */
|
|
8
|
+
tint?: number;
|
|
9
|
+
/** Clear glass: how much the backdrop is frosted, in px like CSS `blur()` (default 5). `0` shows it sharp. */
|
|
10
|
+
blur?: number;
|
|
11
|
+
/** Repaint the backdrop every frame, for content that moves behind the card. It then draws while on screen. */
|
|
12
|
+
live?: boolean;
|
|
13
|
+
/** Fine-tuning of the glass: tint colour, a rim line, frost mix, bend, light and shadow. Merged over the card's own. */
|
|
14
|
+
optics?: GlassOptics;
|
|
15
|
+
className?: string;
|
|
16
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "children" | "className">;
|
|
17
|
+
export declare function GlassCard({ children, material, tint, blur, live, optics, className, style, ...rest }: GlassCardProps): import("react").JSX.Element;
|
|
18
|
+
export default GlassCard;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
function _0x3569(){var _0x244b73=['1476450oEhnoW','6AHLjoJ','24dsbAIO','168iijRgP','1718478BGEZOL','542905aREHJn','350497UTyDhT','36615Nbyfiv','2meENhl','121318IWlEkn','20pDjeWy','27819HxvqCj'];_0x3569=function(){return _0x244b73;};return _0x3569();}(function(_0x4e374d,_0x13f248){var _0xf8d1fd=_0x2292,_0x4c6203=_0x4e374d();while(!![]){try{var _0x1eeb1e=-parseInt(_0xf8d1fd(0x174))/0x1*(-parseInt(_0xf8d1fd(0x173))/0x2)+-parseInt(_0xf8d1fd(0x172))/0x3*(parseInt(_0xf8d1fd(0x169))/0x4)+parseInt(_0xf8d1fd(0x170))/0x5*(-parseInt(_0xf8d1fd(0x16c))/0x6)+-parseInt(_0xf8d1fd(0x171))/0x7*(parseInt(_0xf8d1fd(0x16d))/0x8)+parseInt(_0xf8d1fd(0x16f))/0x9+parseInt(_0xf8d1fd(0x16b))/0xa+parseInt(_0xf8d1fd(0x16a))/0xb*(-parseInt(_0xf8d1fd(0x16e))/0xc);if(_0x1eeb1e===_0x13f248)break;else _0x4c6203['push'](_0x4c6203['shift']());}catch(_0x336bb2){_0x4c6203['push'](_0x4c6203['shift']());}}}(_0x3569,0x198e8));function _0x2292(_0x34dc00,_0x29b849){_0x34dc00=_0x34dc00-0x169;var _0x356961=_0x3569();var _0x2292f3=_0x356961[_0x34dc00];return _0x2292f3;}export{a as GlassCard,b as default}from'./chunk-NIB24TKN.js';import'./chunk-QM4IN3YJ.js';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { MenuContent, MenuItem, MenuTrigger, type MenuProps } from "@ui-sdk/react/menu";
|
|
2
|
+
import { type CSSProperties, type ComponentProps, type ReactNode } from "react";
|
|
3
|
+
export type GlassDropdownMenuProps = MenuProps;
|
|
4
|
+
export type GlassDropdownMenuTriggerProps = {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
/** Put the trigger on the single child element (a GlassButtonGroupItem) instead of a glass button of its own. */
|
|
7
|
+
asChild?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & Omit<ComponentProps<typeof MenuTrigger>, "children" | "className" | "render">;
|
|
10
|
+
export type GlassDropdownMenuContentProps = {
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
} & Omit<ComponentProps<typeof MenuContent>, "children" | "className" | "render">;
|
|
14
|
+
export type GlassDropdownMenuItemProps = {
|
|
15
|
+
className?: string;
|
|
16
|
+
} & Omit<ComponentProps<typeof MenuItem>, "className" | "render">;
|
|
17
|
+
export declare function GlassDropdownMenu({ children, ...options }: GlassDropdownMenuProps): import("react").JSX.Element;
|
|
18
|
+
/** The control that opens the menu: a glass button of its own, or with `asChild` your own element inside a GlassButtonGroup. */
|
|
19
|
+
export declare function GlassDropdownMenuTrigger({ children, asChild, className, ...rest }: GlassDropdownMenuTriggerProps): import("react").JSX.Element;
|
|
20
|
+
/** The list, centred on its control unless `align` says otherwise. Its children are items and separators; they arrive one after another. */
|
|
21
|
+
export declare function GlassDropdownMenuContent({ children, className, sideOffset, align, ...rest }: GlassDropdownMenuContentProps): import("react").JSX.Element;
|
|
22
|
+
/** An action. Pressing it runs `onSelect` and closes the menu. `destructive` paints it red. */
|
|
23
|
+
export declare function GlassDropdownMenuItem({ className, ...rest }: GlassDropdownMenuItemProps): import("react").JSX.Element;
|
|
24
|
+
/** A hairline between items. */
|
|
25
|
+
export declare function GlassDropdownMenuSeparator({ className, style, }: {
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
}): import("react").JSX.Element;
|
|
29
|
+
export default GlassDropdownMenu;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/*! Vitrum © 2026 Onuzulike Anthony Ifechukwu. All rights reserved. Includes Liquid Glass UI © 2026 Bilal Abdullah Gürşen (MIT), see THIRD_PARTY_NOTICES.md */
|
|
3
|
+
const _0x34c6d4=_0x3d23;(function(_0x5e0e28,_0x589338){const _0x2cc88b=_0x3d23,_0xd34561=_0x5e0e28();while(!![]){try{const _0x545c71=-parseInt(_0x2cc88b(0x1cf))/0x1*(-parseInt(_0x2cc88b(0x1d1))/0x2)+parseInt(_0x2cc88b(0x1d2))/0x3*(-parseInt(_0x2cc88b(0x1d5))/0x4)+parseInt(_0x2cc88b(0x1c8))/0x5+parseInt(_0x2cc88b(0x1cd))/0x6+parseInt(_0x2cc88b(0x1d6))/0x7*(-parseInt(_0x2cc88b(0x1d0))/0x8)+-parseInt(_0x2cc88b(0x1d9))/0x9*(-parseInt(_0x2cc88b(0x1d8))/0xa)+-parseInt(_0x2cc88b(0x1c9))/0xb*(-parseInt(_0x2cc88b(0x1ce))/0xc);if(_0x545c71===_0x589338)break;else _0xd34561['push'](_0xd34561['shift']());}catch(_0x15b823){_0xd34561['push'](_0xd34561['shift']());}}}(_0x793d,0x95536));function _0x793d(){const _0x847f0=['187KJfRbo','div','group/vt\x20min-w-44\x20rounded-3xl\x20p-1.5\x20text-[15px]\x20text-neutral-900\x20outline-none\x20data-[vt-tone=dark]:text-white\x20data-[vt-tone=light]:text-neutral-900\x20','relative\x20flex\x20h-10\x20cursor-pointer\x20items-center\x20gap-2.5\x20rounded-2xl\x20px-3.5\x20font-medium\x20whitespace-nowrap\x20outline-none\x20select-none\x20transition-colors\x20duration-100\x20data-disabled:cursor-not-allowed\x20data-highlighted:bg-current/10\x20data-destructive:text-red-600\x20group-data-[vt-tone=dark]/vt:data-destructive:text-red-400\x20[&_svg]:size-4\x20[&_svg]:shrink-0\x20','1415202SnUWfA','118764nSSUrq','165810azvXhm','10072xvLxFl','2DViiMu','2778JJtkHM','concat','center','1160dVyauR','3311TYfOas','style','237410OGHJTe','243KVAwPn','mx-3.5\x20my-1\x20h-px\x20shrink-0\x20bg-current/15\x20','only','1323760pJQhOx'];_0x793d=function(){return _0x847f0;};return _0x793d();}import{d,a,c,b}from'./chunk-3PB7SR7K.js';import'./chunk-QM4IN3YJ.js';import{Menu,MenuTrigger,MenuContent,MenuItem,MenuSeparator}from'@ui-sdk/react/menu';import{useContext,Children,isValidElement,cloneElement}from'react';function _0x3d23(_0x5217e0,_0x2ecd43){_0x5217e0=_0x5217e0-0x1c6;const _0x793ded=_0x793d();let _0x3d2365=_0x793ded[_0x5217e0];return _0x3d2365;}import{jsx,jsxs}from'react/jsx-runtime';function C({children:_0x33fffe,..._0x57190d}){let _0x531a65=d();return jsx(Menu,{..._0x57190d,'children':jsx(a['Provider'],{'value':_0x531a65,'children':_0x33fffe})});}function D({children:_0x3bf3d8,asChild:_0x4404d9=![],className:_0x1d4a26='',..._0x100712}){const _0x22e09a=_0x3d23;let _0x48e114=useContext(a);return _0x4404d9||!_0x48e114?jsx(MenuTrigger,{'render':Children[_0x22e09a(0x1c7)](_0x3bf3d8),..._0x100712}):jsxs(MenuTrigger,{'data-vt-host':'','className':'inline-flex\x20h-10\x20shrink-0\x20cursor-pointer\x20items-center\x20justify-center\x20gap-2\x20rounded-full\x20border\x20border-black/10\x20bg-white/60\x20px-5\x20text-sm\x20font-semibold\x20whitespace-nowrap\x20text-neutral-900\x20outline-none\x20select-none\x20focus-visible:ring-2\x20focus-visible:ring-[#3291FF]\x20focus-visible:ring-offset-2\x20disabled:cursor-not-allowed\x20disabled:opacity-40\x20dark:border-white/15\x20dark:bg-white/10\x20dark:text-white\x20data-[vt-tone=dark]:text-white\x20data-[vt-tone=light]:text-neutral-900\x20[&_svg]:size-4\x20[&_svg]:shrink-0\x20'['concat'](_0x1d4a26),..._0x100712,'children':[jsx(c,{'popup':_0x48e114}),jsx('span',{'className':'inline-flex\x20items-center\x20gap-[inherit]','children':_0x3bf3d8})]});}function k({children:_0x44c30e,className:_0x298e0a='',sideOffset:_0x1747ad=0xc,align:_0xdb5318=_0x34c6d4(0x1d4),..._0x193246}){const _0x2e98ab=_0x34c6d4;let _0x42f6fd=useContext(a);return jsxs(MenuContent,{'data-vt-popup':'','data-vt-skip':'','sideOffset':_0x1747ad,'align':_0xdb5318,'className':_0x2e98ab(0x1cb)['concat'](_0x298e0a),..._0x193246,'children':[_0x42f6fd&&jsx(b,{'popup':_0x42f6fd}),jsx(_0x2e98ab(0x1ca),{'data-vt-list':'','className':'flex\x20flex-col','children':Children['toArray'](_0x44c30e)['map']((_0x17fe2f,_0x4c0d39)=>isValidElement(_0x17fe2f)?cloneElement(_0x17fe2f,{'style':{'--vt-i':_0x4c0d39,..._0x17fe2f['props'][_0x2e98ab(0x1d7)]}}):_0x17fe2f)})]});}function S({className:_0x40d089='',..._0x563f33}){const _0x423d47=_0x34c6d4;return jsx(MenuItem,{'className':_0x423d47(0x1cc)[_0x423d47(0x1d3)](_0x40d089),..._0x563f33});}function T({className:_0x4b8ad7='',style:_0x7afb9}){const _0x56dea5=_0x34c6d4;return jsx(MenuSeparator,{'data-vt-item':'','style':_0x7afb9,'className':_0x56dea5(0x1c6)[_0x56dea5(0x1d3)](_0x4b8ad7)});}var I=C;export{C as GlassDropdownMenu,k as GlassDropdownMenuContent,S as GlassDropdownMenuItem,T as GlassDropdownMenuSeparator,D as GlassDropdownMenuTrigger,I as default};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export type GlassMaterial = "clear" | "tinted";
|
|
2
|
+
export type GlassDroplet = "none" | "apart" | "merged";
|
|
3
|
+
/**
|
|
4
|
+
* Fine-tuning of the glass. Read on every frame: changing a value redraws the glass without
|
|
5
|
+
* rebuilding it, so it can follow a slider. Colours and frost apply to clear glass.
|
|
6
|
+
*/
|
|
7
|
+
export type GlassOptics = {
|
|
8
|
+
/** Tint colour, any CSS colour. Default: white on a light page, black on a dark one. */
|
|
9
|
+
tintColor?: string;
|
|
10
|
+
/** A line just inside the rim: its colour, opacity (0–1, default 0: none) and width in px (default 1). */
|
|
11
|
+
borderColor?: string;
|
|
12
|
+
borderAlpha?: number;
|
|
13
|
+
borderWidth?: number;
|
|
14
|
+
/** With `blur`: how much of the frost shows over the sharp bend (0–1, default 1). */
|
|
15
|
+
frostMix?: number;
|
|
16
|
+
/** With `blur`: × the frost at the rim, where the glass bends (default 1). */
|
|
17
|
+
frostEdge?: number;
|
|
18
|
+
/** Saturation of what shows through the glass (default 1; 1.5 = more vivid, 0 = grey). */
|
|
19
|
+
saturation?: number;
|
|
20
|
+
/** Without frost: blur of the clear glass in its middle and at its rim, in mip levels (default 0.35 and 2.2). */
|
|
21
|
+
clearBlur?: number;
|
|
22
|
+
clearBlurEdge?: number;
|
|
23
|
+
/** The bend at the rim, × the kit's own (default 1). */
|
|
24
|
+
refraction?: number;
|
|
25
|
+
/**
|
|
26
|
+
* How the rim bends. `edge` (default): along the rim, as deep as the bevel. `radial`: towards
|
|
27
|
+
* the centre, by 6.5% of the viewport × `refraction`, fading over half the glass (`bendCurve`
|
|
28
|
+
* sets how fast, `bendDepth` how far), and the frost blurs the bent picture: the SVG card's rim.
|
|
29
|
+
*/
|
|
30
|
+
bendMode?: "edge" | "radial";
|
|
31
|
+
/** × how far in from the rim the bend reaches (default 1). */
|
|
32
|
+
bendDepth?: number;
|
|
33
|
+
/** How sharply the bend falls off from the rim inwards, an exponent (default 1.6; higher = tighter to the rim). */
|
|
34
|
+
bendCurve?: number;
|
|
35
|
+
/** Colour split at the rim (default 0.12). */
|
|
36
|
+
dispersion?: number;
|
|
37
|
+
/** Magnification of the middle (default 0). */
|
|
38
|
+
magnify?: number;
|
|
39
|
+
/** Light on the glass, all of it (default 1). */
|
|
40
|
+
light?: number;
|
|
41
|
+
/** × the rim light (default 1) and × its line's thickness (default 1). */
|
|
42
|
+
rim?: number;
|
|
43
|
+
rimWidth?: number;
|
|
44
|
+
/** × the width of the bevel that shades the rim (default 1). */
|
|
45
|
+
bevel?: number;
|
|
46
|
+
/** × the fresnel glow, inner shading, top reflection and warm caustic (each default 1). */
|
|
47
|
+
fresnel?: number;
|
|
48
|
+
inner?: number;
|
|
49
|
+
reflection?: number;
|
|
50
|
+
caustic?: number;
|
|
51
|
+
/** The rim light leans towards the cursor (default true). */
|
|
52
|
+
cursorLight?: boolean;
|
|
53
|
+
/** The drop shadow: × its strength, softness and offset (each default 1). */
|
|
54
|
+
shadow?: number;
|
|
55
|
+
shadowSoftness?: number;
|
|
56
|
+
shadowOffset?: number;
|
|
57
|
+
/** Dark glass (a black tint, on a dark page): its own tint cover (in place of `tint`) and rim line. Unset values follow the rest. */
|
|
58
|
+
dark?: {
|
|
59
|
+
tint?: number;
|
|
60
|
+
borderColor?: string;
|
|
61
|
+
borderAlpha?: number;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type GlassLayerProps = {
|
|
65
|
+
/**
|
|
66
|
+
* `clear`: transparent glass that bends the page behind it (default).
|
|
67
|
+
* `tinted`: glass painted in the host's own CSS background colour, with light and shadow.
|
|
68
|
+
*/
|
|
69
|
+
material?: GlassMaterial;
|
|
70
|
+
/**
|
|
71
|
+
* The host's `[data-vt-drop]` child as a gooey droplet: `apart` (separated; it melts in
|
|
72
|
+
* while pressed) or `merged` (one body). Changing it animates the split or the merge. Default `none`.
|
|
73
|
+
*/
|
|
74
|
+
droplet?: GlassDroplet;
|
|
75
|
+
/** Clear glass: how much of the tint covers the backdrop (0 = invisible, 1 = solid). */
|
|
76
|
+
tint?: number;
|
|
77
|
+
/** Clear glass: frost the backdrop with a blur of this many px, like CSS `blur()` (default 0: sharp). */
|
|
78
|
+
blur?: number;
|
|
79
|
+
/** Clear glass: CSS selector of the ancestor whose content is refracted (default: the page). */
|
|
80
|
+
backdrop?: string;
|
|
81
|
+
/** Clear glass: repaint the backdrop every frame (for animated content behind the glass). */
|
|
82
|
+
live?: boolean;
|
|
83
|
+
/** Listen for hover/press on this ancestor instead of the host (e.g. a whole card link). */
|
|
84
|
+
trigger?: string;
|
|
85
|
+
/** Turn the glass off and keep the host's CSS look. */
|
|
86
|
+
disabled?: boolean;
|
|
87
|
+
/** Swell on hover and grow when pressed (default). `false` keeps the glass still under the pointer. */
|
|
88
|
+
swell?: boolean;
|
|
89
|
+
/** Fine-tuning: tint colour, a rim line, frost mix, bend, light and shadow (see GlassOptics). */
|
|
90
|
+
optics?: GlassOptics;
|
|
91
|
+
};
|
|
92
|
+
/** The CSS the glass relies on. Rendered once per page by <GlassStyles /> (React 19 dedupes it). */
|
|
93
|
+
export declare const GLASS_CSS = "\n/* Layered, so a utility class on the host (absolute, fixed) still wins over relative. */\n@layer components{:where([data-vt-host]){position:relative;isolation:isolate}}\n/* Unlayered on purpose: once the glass draws, it must beat the host's own fill utilities. */\n[data-vt-host][data-vt-ready]{background:transparent!important;border-color:transparent!important;box-shadow:none!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important}\n@keyframes vt-marquee{to{transform:translateX(-50%)}}\n[data-vt-marquee]{animation:vt-marquee var(--vt-marquee-duration,5s) linear infinite}\n/* Swapped labels and icons rise from a soft blur; a check draws itself in. */\n@keyframes vt-in{from{opacity:0;filter:blur(3px);transform:translateY(4px)}}\n[data-vt-in]{animation:vt-in .38s cubic-bezier(.2,.8,.2,1) both}\n@keyframes vt-draw{from{stroke-dashoffset:25}}\n[data-vt-draw]{stroke-dasharray:25;animation:vt-draw .42s cubic-bezier(.65,0,.35,1) .12s both}\n@keyframes vt-spin{to{transform:rotate(1turn)}}\n[data-vt-spin]{animation:vt-spin .8s linear infinite}\n[data-vt-ready] [data-vt-fallback]{visibility:hidden}\n@media (prefers-reduced-motion:reduce){[data-vt-marquee],[data-vt-in],[data-vt-draw],[data-vt-spin]{animation:none}}\n";
|
|
94
|
+
/** Injects GLASS_CSS once (React 19 hoists and dedupes `<style href precedence>`). */
|
|
95
|
+
export declare function GlassStyles(): import("react").JSX.Element;
|
|
96
|
+
export declare function GlassLayer({ material, droplet, tint, blur, backdrop, live, trigger, disabled, swell, optics, }: GlassLayerProps): import("react").JSX.Element;
|
|
97
|
+
export default GlassLayer;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type GlassLensProps = {
|
|
2
|
+
/** The selected value (any change slides the lens). `null` = nothing selected. */
|
|
3
|
+
value: string | number | null;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare function GlassLens({ value, disabled }: GlassLensProps): import("react").JSX.Element;
|
|
7
|
+
export default GlassLens;
|