geekin-devtoys 0.4.3 → 0.5.1
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/lib/GBranched-DgHZO9BQ.js +1 -0
- package/lib/{GBranched-vnLlYOl9.mjs → GBranched-gk9VjilV.mjs} +22 -22
- package/lib/GButton/style.css +1 -1
- package/lib/{GButton/index.mjs → GButton-DYVUVEmW.mjs} +20 -21
- package/lib/GButton-DiVnpCJ_.js +1 -0
- package/lib/GCard/style.css +1 -1
- package/lib/{GCard/index.mjs → GCard-fy7pLgOm.mjs} +10 -11
- package/lib/GCard-mUE6ozOd.js +1 -0
- package/lib/{GCount/index.mjs → GCount-B8qGAPPw.mjs} +8 -9
- package/lib/GCount-PeMCQxKJ.js +1 -0
- package/lib/GDialog-BXKKf7pp.mjs +379 -0
- package/lib/GDialog-DYUmUJIs.js +1 -0
- package/lib/GDropdown/style.css +1 -1
- package/lib/GDropdown-DAV-MJNy.mjs +301 -0
- package/lib/GDropdown-XCTNfuvx.js +1 -0
- package/lib/{GFuzzyText/index.mjs → GFuzzyText-C8YqMyVc.mjs} +2 -2
- package/lib/GFuzzyText-DlvSSgZN.js +1 -0
- package/lib/GInput/style.css +1 -1
- package/lib/GInput-BQ3kUKBK.js +1 -0
- package/lib/{GInput/index.mjs → GInput-Dmr0imGb.mjs} +7 -8
- package/lib/GPagination-C3Bv-WAh.mjs +207 -0
- package/lib/GPagination-TlNbcdVK.js +1 -0
- package/lib/GPicker/style.css +1 -1
- package/lib/GPicker-CGIJstWX.js +1 -0
- package/lib/{GPicker/index.mjs → GPicker-Dod_ZC1a.mjs} +17 -18
- package/lib/GPie3D/style.css +1 -1
- package/lib/{GPie3D/index.mjs → GPie3D-f9qP9766.mjs} +29 -29
- package/lib/GPie3D-n-Rr8wxJ.js +1 -0
- package/lib/GPluginVideo-CCMOsKR1.js +1 -0
- package/lib/{GPluginVideo/index.mjs → GPluginVideo-DRoHqxth.mjs} +5 -6
- package/lib/GProgress/style.css +1 -1
- package/lib/GProgress-BLhyozxX.js +1 -0
- package/lib/{GProgress/index.mjs → GProgress-DE4nojJS.mjs} +3 -4
- package/lib/GRadio-Cfrcw4ij.js +1 -0
- package/lib/{GRadio/index.mjs → GRadio-DJT1sLHB.mjs} +8 -9
- package/lib/GRing/style.css +1 -1
- package/lib/GRing-C7jmMP3i.js +1 -0
- package/lib/{GRing/index.mjs → GRing-wjC39-EB.mjs} +9 -10
- package/lib/{GScreen/index.mjs → GScreen-2eUu-UYd.mjs} +17 -18
- package/lib/GScreen-XeAOifAH.js +1 -0
- package/lib/GScroller/style.css +1 -1
- package/lib/{GScroller/index.mjs → GScroller-B3nJgbB6.mjs} +8 -9
- package/lib/GScroller-SxgsNnGm.js +1 -0
- package/lib/{GSegment/index.mjs → GSegment-BOCz6tKA.mjs} +17 -18
- package/lib/GSegment-DBya2zxC.js +1 -0
- package/lib/GShinyText-1l_2iEh2.js +1 -0
- package/lib/{GShinyText/index.mjs → GShinyText-DlOUA5Ks.mjs} +25 -26
- package/lib/{GSlider/index.mjs → GSlider-Cr82jLMa.mjs} +11 -12
- package/lib/GSlider-Did6qEGG.js +1 -0
- package/lib/GSteps/style.css +1 -1
- package/lib/GSteps-CLkuWWKC.js +1 -0
- package/lib/{GSteps/index.mjs → GSteps-Dn5IYJpx.mjs} +34 -35
- package/lib/GTable/style.css +1 -1
- package/lib/GTable-DbKMCmgA.js +1 -0
- package/lib/GTable-JWC4MouE.mjs +306 -0
- package/lib/GTag/style.css +1 -1
- package/lib/{GTag/index.mjs → GTag-BBCyhlbu.mjs} +8 -9
- package/lib/GTag-Cz1B_ljk.js +1 -0
- package/lib/GToast/style.css +1 -1
- package/lib/{GToast/index.mjs → GToast-BRd2P7dm.mjs} +16 -17
- package/lib/GToast-Dz_Ukb9h.js +1 -0
- package/lib/GTree/style.css +1 -1
- package/lib/GTree-6YPV4gsf.js +1 -0
- package/lib/{GTree/index.mjs → GTree-BeEm75-u.mjs} +37 -38
- package/lib/GVideo/style.css +1 -1
- package/lib/{GVideo/index.mjs → GVideo-CNWjIzXx.mjs} +13 -14
- package/lib/GVideo-DHoeaGKS.js +2 -0
- package/lib/assets/GPagination.css +1 -0
- package/lib/components/GBranched/__tests__/index.test.d.ts +1 -0
- package/lib/components/GButton/__tests__/index.test.d.ts +1 -0
- package/lib/components/GButton/index.d.ts +8 -19
- package/lib/components/GButton/types.d.ts +37 -0
- package/lib/components/GCard/__tests__/index.test.d.ts +1 -0
- package/lib/components/GCard/index.d.ts +2 -18
- package/lib/components/GCard/types.d.ts +66 -0
- package/lib/components/GCount/__tests__/index.test.d.ts +1 -0
- package/lib/components/GCount/index.d.ts +3 -18
- package/lib/components/GCount/types.d.ts +38 -0
- package/lib/components/GDialog/__tests__/index.test.d.ts +1 -0
- package/lib/components/GDropdown/__tests__/index.test.d.ts +1 -0
- package/lib/components/GDropdown/__tests__/slots.tmp.test.d.ts +1 -0
- package/lib/components/GDropdown/index.d.ts +32 -34
- package/lib/components/GDropdown/types.d.ts +116 -0
- package/lib/components/GFuzzyText/__tests__/index.test.d.ts +1 -0
- package/lib/components/GFuzzyText/index.d.ts +2 -39
- package/lib/components/GFuzzyText/types.d.ts +93 -0
- package/lib/components/GInput/__tests__/index.test.d.ts +1 -0
- package/lib/components/GInput/index.d.ts +3 -23
- package/lib/components/GInput/types.d.ts +50 -0
- package/lib/components/GPagination/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPagination/icons.d.ts +7 -0
- package/lib/components/GPagination/index.d.ts +30 -0
- package/lib/components/GPagination/types.d.ts +66 -0
- package/lib/components/GPicker/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPicker/index.d.ts +4 -67
- package/lib/components/GPicker/types.d.ts +159 -0
- package/lib/components/GPie3D/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPie3D/index.d.ts +3 -81
- package/lib/components/GPie3D/types.d.ts +106 -0
- package/lib/components/GPluginVideo/__tests__/index.test.d.ts +1 -0
- package/lib/components/GPluginVideo/index.d.ts +1 -0
- package/lib/components/GPluginVideo/types.d.ts +86 -0
- package/lib/components/GProgress/__tests__/index.test.d.ts +1 -0
- package/lib/components/GProgress/index.d.ts +3 -47
- package/lib/components/GProgress/types.d.ts +46 -0
- package/lib/components/GRadio/__tests__/index.test.d.ts +1 -0
- package/lib/components/GRadio/index.d.ts +6 -6
- package/lib/components/GRing/__tests__/index.test.d.ts +1 -0
- package/lib/components/GRing/index.d.ts +3 -53
- package/lib/components/GRing/types.d.ts +52 -0
- package/lib/components/GScreen/__tests__/index.test.d.ts +1 -0
- package/lib/components/GScreen/index.d.ts +3 -22
- package/lib/components/GScreen/types.d.ts +21 -0
- package/lib/components/GScroller/__tests__/index.test.d.ts +1 -0
- package/lib/components/GScroller/index.d.ts +3 -22
- package/lib/components/GScroller/types.d.ts +73 -0
- package/lib/components/GSegment/__tests__/index.test.d.ts +1 -0
- package/lib/components/GSegment/index.d.ts +3 -3
- package/lib/components/GShinyText/__tests__/index.test.d.ts +1 -0
- package/lib/components/GShinyText/index.d.ts +2 -25
- package/lib/components/GShinyText/types.d.ts +65 -0
- package/lib/components/GSlider/__tests__/index.test.d.ts +1 -0
- package/lib/components/GSlider/index.d.ts +2 -2
- package/lib/components/GSteps/__tests__/index.test.d.ts +1 -0
- package/lib/components/GSteps/index.d.ts +3 -21
- package/lib/components/GSteps/types.d.ts +42 -0
- package/lib/components/GTable/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTable/icons.d.ts +5 -0
- package/lib/components/GTable/index.d.ts +23 -91
- package/lib/components/GTable/types.d.ts +110 -0
- package/lib/components/GTag/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTag/index.d.ts +7 -18
- package/lib/components/GTag/types.d.ts +34 -0
- package/lib/components/GToast/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTree/__tests__/index.test.d.ts +1 -0
- package/lib/components/GTree/index.d.ts +2 -4
- package/lib/components/GVideo/__tests__/index.test.d.ts +1 -0
- package/lib/components/GVideo/index.d.ts +1 -0
- package/lib/components/GVideo/types.d.ts +38 -0
- package/lib/index/index.d.mts +6 -0
- package/lib/index/index.js +1 -1
- package/lib/index/index.mjs +66 -63
- package/lib/index/style.css +15 -15
- package/lib/index.d.ts +3 -1
- package/package.json +14 -8
- package/lib/GBranched/index.js +0 -1
- package/lib/GBranched/index.mjs +0 -5
- package/lib/GBranched-BtF7heMk.js +0 -1
- package/lib/GBranched.d.ts +0 -1
- package/lib/GButton/index.js +0 -1
- package/lib/GButton.d.ts +0 -1
- package/lib/GCard/index.js +0 -1
- package/lib/GCard.d.ts +0 -1
- package/lib/GCount/index.js +0 -1
- package/lib/GCount.d.ts +0 -1
- package/lib/GDialog/index.js +0 -1
- package/lib/GDialog/index.mjs +0 -458
- package/lib/GDialog.d.ts +0 -1
- package/lib/GDropdown/index.js +0 -1
- package/lib/GDropdown/index.mjs +0 -278
- package/lib/GDropdown.d.ts +0 -1
- package/lib/GFuzzyText/index.js +0 -1
- package/lib/GFuzzyText.d.ts +0 -1
- package/lib/GInput/index.js +0 -1
- package/lib/GInput.d.ts +0 -1
- package/lib/GPicker/index.js +0 -1
- package/lib/GPicker.d.ts +0 -1
- package/lib/GPie3D/index.js +0 -1
- package/lib/GPie3D.d.ts +0 -1
- package/lib/GPluginVideo/index.js +0 -1
- package/lib/GPluginVideo.d.ts +0 -1
- package/lib/GProgress/index.js +0 -1
- package/lib/GProgress.d.ts +0 -1
- package/lib/GRadio/index.js +0 -1
- package/lib/GRadio.d.ts +0 -1
- package/lib/GRing/index.js +0 -1
- package/lib/GRing.d.ts +0 -1
- package/lib/GScreen/index.js +0 -1
- package/lib/GScreen.d.ts +0 -1
- package/lib/GScroller/index.js +0 -1
- package/lib/GScroller.d.ts +0 -1
- package/lib/GSegment/index.js +0 -1
- package/lib/GSegment.d.ts +0 -1
- package/lib/GShinyText/index.js +0 -1
- package/lib/GShinyText.d.ts +0 -1
- package/lib/GSlider/index.js +0 -1
- package/lib/GSlider.d.ts +0 -1
- package/lib/GSteps/index.js +0 -1
- package/lib/GSteps.d.ts +0 -1
- package/lib/GTable/index.js +0 -1
- package/lib/GTable/index.mjs +0 -448
- package/lib/GTable.d.ts +0 -1
- package/lib/GTag/index.js +0 -1
- package/lib/GTag.d.ts +0 -1
- package/lib/GToast/index.js +0 -1
- package/lib/GToast.d.ts +0 -1
- package/lib/GTree/index.js +0 -1
- package/lib/GTree.d.ts +0 -1
- package/lib/GVideo/index.js +0 -2
- package/lib/GVideo.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),A=(d,k)=>{const v=d.__vccOpts||d;for(const[f,a]of k)v[f]=a;return v},I=["data-open"],R=["aria-expanded","aria-current","data-active","onClick"],T={key:0,class:"g-branched__fold"},F={class:"g-branched__clip"},L=["width","height"],G=["d"],P=["d"],q=["d"],U=["aria-current","data-active","tabindex","onClick"],W={key:0,class:"g-branched__icon","aria-hidden":"true"},K={class:"g-branched__label"},m=6,Q=16,X=e.defineComponent({name:"GBranched",__name:"index",props:{items:{default:void 0},defaultOpen:{default:0},defaultActive:{default:""},color:{default:void 0},accentColor:{default:void 0},lineColor:{default:void 0},width:{default:240},rowHeight:{default:36},indent:{default:40},trunk:{default:14},radius:{default:10},lineWidth:{default:1.5},fontSize:{default:14},drawDuration:{default:400},foldDuration:{default:300},className:{default:""}},emits:["select","toggle"],setup(d,{emit:k}){const v=[{label:"Getting started",children:[{value:"install",label:"Installation"},{value:"quick",label:"Quick start"},{value:"config",label:"Configuration"},{value:"theming",label:"Theming"}]},{label:"Components",children:[{value:"buttons",label:"Buttons"},{value:"typography",label:"Typography"},{value:"overlays",label:"Overlays"},{value:"toasts",label:"Toasts"}]}],f=t=>new Set(Array.isArray(t)?t:t>=0?[t]:[]),a=d,$=k,p=e.computed(()=>a.items??v),u=e.ref(f(a.defaultOpen)),s=e.ref(a.defaultActive||(p.value.find((t,n)=>t.children&&f(a.defaultOpen).has(n))?.children?.[0]?.value??"")),y=e.ref(null),w=e.ref(null),E=[];let _=null;const b=e.computed(()=>p.value.findIndex(t=>t.children?.some(n=>n.value===s.value))),C=e.computed(()=>b.value>=0&&u.value.has(b.value)),S=t=>{const n=w.value,l=E[b.value];if(!n)return;const c=C.value&&l;t||(n.style.transition="none"),c&&(n.style.top=`${l.offsetTop+(l.offsetHeight-Q)/2}px`),n.toggleAttribute("data-on",!!c),t||(n.offsetHeight,n.style.transition="")},x=()=>{_?.disconnect(),S(!0);let t=!0;_=new ResizeObserver(()=>{if(t){t=!1;return}S(!1)}),y.value&&_.observe(y.value)};e.onMounted(x),e.onUnmounted(()=>_?.disconnect()),e.watch(()=>[b.value,C.value,p.value,a.fontSize,a.rowHeight],x,{flush:"post"});const H=(t,n)=>{s.value=t,$("select",t,n)},N=t=>{const n=new Set(u.value),l=!n.has(t);l?n.add(t):n.delete(t),u.value=n,$("toggle",t,l)},r=e.computed(()=>Math.min(a.radius,a.rowHeight/2-2)),B=e.computed(()=>a.indent-8),i=t=>m+t*a.rowHeight+a.rowHeight/2,V=t=>`M ${a.trunk} ${i(t)-r.value} A ${r.value} ${r.value} 0 0 0 ${a.trunk+r.value} ${i(t)} H ${B.value}`,z=t=>`M ${a.trunk} 0 V ${i(t)-r.value} A ${r.value} ${r.value} 0 0 0 ${a.trunk+r.value} ${i(t)} H ${B.value}`,D=t=>i(t)-r.value+Math.PI*r.value/2+(B.value-a.trunk-r.value),M=t=>`M ${a.trunk} 0 V ${i(t-1)-r.value}`,O=e.computed(()=>({"--bm-w":`${a.width}px`,...a.color!==void 0&&{"--bm-ink":a.color},...a.accentColor!==void 0&&{"--bm-accent":a.accentColor},...a.lineColor!==void 0&&{"--bm-line":a.lineColor},"--bm-font":`${a.fontSize}px`,"--bm-row":`${a.rowHeight}px`,"--bm-indent":`${a.indent}px`,"--bm-line-w":a.lineWidth,"--bm-pad":`${m}px`,"--bm-draw":`${a.drawDuration}ms`,"--bm-fold":`${a.foldDuration}ms`}));return(t,n)=>(e.openBlock(),e.createElementBlock("nav",{ref_key:"navRef",ref:y,class:e.normalizeClass(["g-branched",t.className]),style:e.normalizeStyle(O.value)},[e.createElementVNode("span",{ref_key:"markerRef",ref:w,class:"g-branched__marker","aria-hidden":"true"},null,512),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,(l,c)=>(e.openBlock(),e.createElementBlock("div",{key:l.value??l.label,class:"g-branched__section","data-open":l.children&&u.value.has(c)?"":void 0},[e.createElementVNode("button",{ref_for:!0,ref:o=>E[c]=o,type:"button",class:"g-branched__head","aria-expanded":l.children?u.value.has(c):void 0,"aria-current":!l.children&&(l.value??l.label)===s.value?"true":void 0,"data-active":!l.children&&(l.value??l.label)===s.value?"":void 0,onClick:o=>l.children?N(c):H(l.value??l.label,l)},e.toDisplayString(l.label),9,R),l.children?(e.openBlock(),e.createElementBlock("div",T,[e.createElementVNode("div",F,[e.createElementVNode("div",{class:"g-branched__body",style:e.normalizeStyle({height:`${m*2+l.children.length*t.rowHeight}px`})},[(e.openBlock(),e.createElementBlock("svg",{class:"g-branched__lines",width:t.indent,height:m*2+l.children.length*t.rowHeight,"aria-hidden":"true"},[e.createElementVNode("path",{class:"g-branched__path",d:M(l.children.length)},null,8,G),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,(o,h)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${o.value}`,class:"g-branched__path",d:V(h)},null,8,P))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,(o,h)=>(e.openBlock(),e.createElementBlock("path",{key:`reach-${o.value}`,class:"g-branched__path g-branched__path--accent",d:z(h),style:e.normalizeStyle({strokeDasharray:D(h),strokeDashoffset:o.value===s.value?0:D(h)})},null,12,q))),128))],8,L)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.children,o=>(e.openBlock(),e.createElementBlock("button",{key:o.value,type:"button",class:"g-branched__item","aria-current":o.value===s.value?"true":void 0,"data-active":o.value===s.value?"":void 0,tabindex:u.value.has(c)?0:-1,onClick:h=>H(o.value,o)},[o.icon?(e.openBlock(),e.createElementBlock("span",W,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon)))])):e.createCommentVNode("",!0),e.createElementVNode("span",K,e.toDisplayString(o.label),1)],8,U))),128))],4)])])):e.createCommentVNode("",!0)],8,I))),128))],6))}}),g=A(X,[["__scopeId","data-v-cd651c8b"]]);g.install=d=>{d.component(g.name,g)};exports.GBranched=g;exports._export_sfc=A;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { defineComponent as W, computed as f, ref as $, onMounted as q, onUnmounted as K, watch as Q, createElementBlock as s, openBlock as o, normalizeStyle as A, normalizeClass as X, createElementVNode as _, Fragment as w, renderList as k, createCommentVNode as G, toDisplayString as N, createBlock as Y, resolveDynamicComponent as j } from "vue";
|
|
2
|
-
const J =
|
|
2
|
+
const J = (d, x) => {
|
|
3
|
+
const b = d.__vccOpts || d;
|
|
4
|
+
for (const [p, a] of x)
|
|
5
|
+
b[p] = a;
|
|
6
|
+
return b;
|
|
7
|
+
}, Z = ["data-open"], ee = ["aria-expanded", "aria-current", "data-active", "onClick"], ae = {
|
|
3
8
|
key: 0,
|
|
4
9
|
class: "g-branched__fold"
|
|
5
|
-
},
|
|
10
|
+
}, te = { class: "g-branched__clip" }, ne = ["width", "height"], le = ["d"], oe = ["d"], re = ["d"], se = ["aria-current", "data-active", "tabindex", "onClick"], ce = {
|
|
6
11
|
key: 0,
|
|
7
12
|
class: "g-branched__icon",
|
|
8
13
|
"aria-hidden": "true"
|
|
9
|
-
},
|
|
14
|
+
}, ue = { class: "g-branched__label" }, C = 6, de = 16, ie = /* @__PURE__ */ W({
|
|
10
15
|
name: "GBranched",
|
|
11
16
|
__name: "index",
|
|
12
17
|
props: {
|
|
@@ -58,7 +63,7 @@ const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "o
|
|
|
58
63
|
const n = O.value, t = z[y.value];
|
|
59
64
|
if (!n) return;
|
|
60
65
|
const c = B.value && t;
|
|
61
|
-
e || (n.style.transition = "none"), c && (n.style.top = `${t.offsetTop + (t.offsetHeight -
|
|
66
|
+
e || (n.style.transition = "none"), c && (n.style.top = `${t.offsetTop + (t.offsetHeight - de) / 2}px`), n.toggleAttribute("data-on", !!c), e || (n.offsetHeight, n.style.transition = "");
|
|
62
67
|
}, R = () => {
|
|
63
68
|
m?.disconnect(), I(!0);
|
|
64
69
|
let e = !0;
|
|
@@ -130,9 +135,9 @@ const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "o
|
|
|
130
135
|
"aria-current": !t.children && (t.value ?? t.label) === u.value ? "true" : void 0,
|
|
131
136
|
"data-active": !t.children && (t.value ?? t.label) === u.value ? "" : void 0,
|
|
132
137
|
onClick: (l) => t.children ? V(c) : T(t.value ?? t.label, t)
|
|
133
|
-
}, N(t.label), 9,
|
|
134
|
-
t.children ? (o(), s("div",
|
|
135
|
-
_("div",
|
|
138
|
+
}, N(t.label), 9, ee),
|
|
139
|
+
t.children ? (o(), s("div", ae, [
|
|
140
|
+
_("div", te, [
|
|
136
141
|
_("div", {
|
|
137
142
|
class: "g-branched__body",
|
|
138
143
|
style: A({ height: `${C * 2 + t.children.length * e.rowHeight}px` })
|
|
@@ -146,12 +151,12 @@ const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "o
|
|
|
146
151
|
_("path", {
|
|
147
152
|
class: "g-branched__path",
|
|
148
153
|
d: L(t.children.length)
|
|
149
|
-
}, null, 8,
|
|
154
|
+
}, null, 8, le),
|
|
150
155
|
(o(!0), s(w, null, k(t.children, (l, v) => (o(), s("path", {
|
|
151
156
|
key: `line-${l.value}`,
|
|
152
157
|
class: "g-branched__path",
|
|
153
158
|
d: P(v)
|
|
154
|
-
}, null, 8,
|
|
159
|
+
}, null, 8, oe))), 128)),
|
|
155
160
|
(o(!0), s(w, null, k(t.children, (l, v) => (o(), s("path", {
|
|
156
161
|
key: `reach-${l.value}`,
|
|
157
162
|
class: "g-branched__path g-branched__path--accent",
|
|
@@ -160,8 +165,8 @@ const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "o
|
|
|
160
165
|
strokeDasharray: E(v),
|
|
161
166
|
strokeDashoffset: l.value === u.value ? 0 : E(v)
|
|
162
167
|
})
|
|
163
|
-
}, null, 12,
|
|
164
|
-
], 8,
|
|
168
|
+
}, null, 12, re))), 128))
|
|
169
|
+
], 8, ne)),
|
|
165
170
|
(o(!0), s(w, null, k(t.children, (l) => (o(), s("button", {
|
|
166
171
|
key: l.value,
|
|
167
172
|
type: "button",
|
|
@@ -171,27 +176,22 @@ const J = ["data-open"], Z = ["aria-expanded", "aria-current", "data-active", "o
|
|
|
171
176
|
tabindex: i.value.has(c) ? 0 : -1,
|
|
172
177
|
onClick: (v) => T(l.value, l)
|
|
173
178
|
}, [
|
|
174
|
-
l.icon ? (o(), s("span",
|
|
179
|
+
l.icon ? (o(), s("span", ce, [
|
|
175
180
|
(o(), Y(j(l.icon)))
|
|
176
181
|
])) : G("", !0),
|
|
177
|
-
_("span",
|
|
178
|
-
], 8,
|
|
182
|
+
_("span", ue, N(l.label), 1)
|
|
183
|
+
], 8, se))), 128))
|
|
179
184
|
], 4)
|
|
180
185
|
])
|
|
181
186
|
])) : G("", !0)
|
|
182
|
-
], 8,
|
|
187
|
+
], 8, Z))), 128))
|
|
183
188
|
], 6));
|
|
184
189
|
}
|
|
185
|
-
}),
|
|
186
|
-
const b = d.__vccOpts || d;
|
|
187
|
-
for (const [p, a] of x)
|
|
188
|
-
b[p] = a;
|
|
189
|
-
return b;
|
|
190
|
-
}, D = /* @__PURE__ */ ie(de, [["__scopeId", "data-v-cd651c8b"]]);
|
|
190
|
+
}), D = /* @__PURE__ */ J(ie, [["__scopeId", "data-v-cd651c8b"]]);
|
|
191
191
|
D.install = (d) => {
|
|
192
192
|
d.component(D.name, D);
|
|
193
193
|
};
|
|
194
194
|
export {
|
|
195
195
|
D as G,
|
|
196
|
-
|
|
196
|
+
J as _
|
|
197
197
|
};
|
package/lib/GButton/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.g-button[data-v-
|
|
1
|
+
@charset "UTF-8";.g-button[data-v-39479b50]{--g-button-wave-color: currentcolor;position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;height:var(--g-size-middle-height, 32px);padding:0 15px;font-size:var(--g-button-font-size, 14px);line-height:1;white-space:nowrap;cursor:pointer;-webkit-user-select:none;user-select:none;overflow:hidden;color:var(--g-text-color, rgba(0, 0, 0, .88));background:var(--g-button-bg-color, var(--g-button-default-color, #e8e8eb));border:none;border-radius:var(--g-button-radius, 6px);outline:none;transition:all .2s cubic-bezier(.645,.045,.355,1)}.g-button[data-v-39479b50]:not(.is-disabled):hover,.g-button[data-v-39479b50]:not(.is-disabled):focus-visible{border-color:var(--g-primary-color, #039be5);color:var(--g-primary-color, #039be5)}.g-button[data-v-39479b50]:not(.is-disabled):active{border-color:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000);color:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000)}.g-button.is-block[data-v-39479b50]{display:flex;width:100%}.g-button.is-disabled[data-v-39479b50]{cursor:not-allowed;opacity:.5}.g-button--large[data-v-39479b50]{height:var(--g-size-large-height, 40px);padding:0 20px;font-size:var(--g-size-large-font-size, 16px);border-radius:calc(var(--g-button-radius, 6px) + 2px)}.g-button--small[data-v-39479b50]{height:var(--g-size-small-height, 24px);padding:0 7px;font-size:var(--g-size-small-font-size, 12px);border-radius:calc(var(--g-button-radius, 6px) - 2px)}.g-button--primary[data-v-39479b50]{--g-button-wave-color: #fff;color:#fff;background:var(--g-primary-color, #039be5);border-color:var(--g-primary-color, #039be5)}.g-button--primary[data-v-39479b50]:not(.is-disabled):hover,.g-button--primary[data-v-39479b50]:not(.is-disabled):focus-visible{color:#fff;background:color-mix(in srgb,var(--g-primary-color, #039be5) 85%,#fff)}.g-button--primary[data-v-39479b50]:not(.is-disabled):active{color:#fff;background:color-mix(in srgb,var(--g-primary-color, #039be5) 70%,#000)}.g-button--success[data-v-39479b50],.g-button--warning[data-v-39479b50],.g-button--danger[data-v-39479b50]{--g-button-wave-color: #fff;color:#fff}.g-button--success[data-v-39479b50]:not(.is-disabled):hover,.g-button--success[data-v-39479b50]:not(.is-disabled):focus-visible,.g-button--warning[data-v-39479b50]:not(.is-disabled):hover,.g-button--warning[data-v-39479b50]:not(.is-disabled):focus-visible,.g-button--danger[data-v-39479b50]:not(.is-disabled):hover,.g-button--danger[data-v-39479b50]:not(.is-disabled):focus-visible{color:#fff;background:color-mix(in srgb,var(--g-button-type-color) 85%,#fff)}.g-button--success[data-v-39479b50]:not(.is-disabled):active,.g-button--warning[data-v-39479b50]:not(.is-disabled):active,.g-button--danger[data-v-39479b50]:not(.is-disabled):active{color:#fff;background:color-mix(in srgb,var(--g-button-type-color) 70%,#000)}.g-button--success[data-v-39479b50]{--g-button-type-color: var(--g-success-color, #50c189);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--warning[data-v-39479b50]{--g-button-type-color: var(--g-warning-color, #f78716);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--danger[data-v-39479b50]{--g-button-type-color: var(--g-danger-color, #e1594d);background:var(--g-button-type-color);border-color:var(--g-button-type-color)}.g-button--emphasis[data-v-39479b50]{--g-button-wave-color: var(--g-emphasis-text-color, #fff);color:var(--g-emphasis-text-color, #fff);background:var(--g-emphasis-color, #000)}.g-button--emphasis[data-v-39479b50]:not(.is-disabled):hover,.g-button--emphasis[data-v-39479b50]:not(.is-disabled):focus-visible{color:var(--g-emphasis-text-color, #fff);background:color-mix(in srgb,var(--g-emphasis-color, #000) 85%,var(--g-emphasis-text-color, #fff))}.g-button--emphasis[data-v-39479b50]:not(.is-disabled):active{color:var(--g-emphasis-text-color, #fff);background:color-mix(in srgb,var(--g-emphasis-color, #000) 70%,var(--g-emphasis-text-color, #fff))}.g-button--link[data-v-39479b50]{height:auto;padding:2px 5px;background:transparent;border-color:transparent}.g-button--link[data-v-39479b50]:not(.is-disabled):hover,.g-button--link[data-v-39479b50]:not(.is-disabled):focus-visible{color:color-mix(in srgb,var(--g-primary-color, #039be5) 85%,#fff);background:transparent}.g-button__loading[data-v-39479b50]{width:1em;height:1em;border:2px solid currentcolor;border-top-color:transparent;border-radius:50%;animation:g-button-spin-39479b50 .6s linear infinite}.g-button__icon[data-v-39479b50]{display:inline-flex;align-items:center}.g-button__icon[data-v-39479b50] svg{width:1em;height:1em;display:block}.g-button__wave[data-v-39479b50]{position:absolute;border-radius:50%;background:var(--g-button-wave-color);opacity:.2;pointer-events:none}@keyframes g-button-spin-39479b50{to{transform:rotate(360deg)}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as k, ref as _, createElementBlock as n, openBlock as o, normalizeClass as B, createCommentVNode as r, renderSlot as
|
|
2
|
-
import { useReducedMotion as
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as k, ref as _, createElementBlock as n, openBlock as o, normalizeClass as B, createCommentVNode as r, renderSlot as u, Fragment as v, renderList as z, createBlock as C, unref as $, normalizeStyle as G } from "vue";
|
|
2
|
+
import { useReducedMotion as M, motion as T } from "motion-v";
|
|
3
|
+
import { _ as w } from "./GBranched-gk9VjilV.mjs";
|
|
4
|
+
const A = ["type", "disabled"], I = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "g-button__loading"
|
|
7
7
|
}, R = {
|
|
@@ -14,26 +14,26 @@ const G = ["type", "disabled"], I = {
|
|
|
14
14
|
name: "GButton",
|
|
15
15
|
__name: "index",
|
|
16
16
|
props: {
|
|
17
|
-
type: {},
|
|
18
|
-
size: {},
|
|
17
|
+
type: { default: "default" },
|
|
18
|
+
size: { default: "middle" },
|
|
19
19
|
loading: { type: Boolean },
|
|
20
20
|
disabled: { type: Boolean },
|
|
21
21
|
block: { type: Boolean },
|
|
22
|
-
nativeType: {}
|
|
22
|
+
nativeType: { default: "button" }
|
|
23
23
|
},
|
|
24
24
|
emits: ["click"],
|
|
25
|
-
setup(s, { emit:
|
|
26
|
-
const l = s, m =
|
|
25
|
+
setup(s, { emit: p }) {
|
|
26
|
+
const l = s, m = p, y = (e) => {
|
|
27
27
|
if (!(l.disabled || l.loading)) {
|
|
28
|
-
if (l.type !== "link" && !
|
|
29
|
-
const t = e.currentTarget.getBoundingClientRect(), d = e.clientX !== 0 || e.clientY !== 0,
|
|
28
|
+
if (l.type !== "link" && !f.value) {
|
|
29
|
+
const t = e.currentTarget.getBoundingClientRect(), d = e.clientX !== 0 || e.clientY !== 0, h = {
|
|
30
30
|
id: ++g,
|
|
31
31
|
x: d ? e.clientX - t.left : t.width / 2,
|
|
32
32
|
y: d ? e.clientY - t.top : t.height / 2,
|
|
33
33
|
// 直径覆盖整个按钮对角线,保证涟漪能填满按钮
|
|
34
34
|
size: Math.hypot(t.width, t.height) * 2
|
|
35
35
|
};
|
|
36
|
-
i.value.push(
|
|
36
|
+
i.value.push(h);
|
|
37
37
|
}
|
|
38
38
|
m("click", e);
|
|
39
39
|
}
|
|
@@ -41,7 +41,7 @@ const G = ["type", "disabled"], I = {
|
|
|
41
41
|
let g = 0;
|
|
42
42
|
const b = (e) => {
|
|
43
43
|
i.value = i.value.filter((a) => a.id !== e);
|
|
44
|
-
},
|
|
44
|
+
}, f = M();
|
|
45
45
|
return (e, a) => (o(), n("button", {
|
|
46
46
|
class: B(["g-button", [
|
|
47
47
|
"g-button--" + e.type,
|
|
@@ -58,27 +58,26 @@ const G = ["type", "disabled"], I = {
|
|
|
58
58
|
}, [
|
|
59
59
|
e.loading ? (o(), n("span", I)) : r("", !0),
|
|
60
60
|
e.$slots.icon ? (o(), n("span", R, [
|
|
61
|
-
|
|
61
|
+
u(e.$slots, "icon", {}, void 0, !0)
|
|
62
62
|
])) : r("", !0),
|
|
63
63
|
e.$slots.default ? (o(), n("span", S, [
|
|
64
|
-
|
|
64
|
+
u(e.$slots, "default", {}, void 0, !0)
|
|
65
65
|
])) : r("", !0),
|
|
66
|
-
(o(!0), n(v, null, z(i.value, (t) => (o(), C($(
|
|
66
|
+
(o(!0), n(v, null, z(i.value, (t) => (o(), C($(T).span, {
|
|
67
67
|
key: t.id,
|
|
68
68
|
class: "g-button__wave",
|
|
69
69
|
initial: { x: "-50%", y: "-50%", scale: 0, opacity: 0.2 },
|
|
70
70
|
animate: { x: "-50%", y: "-50%", scale: 1, opacity: 0 },
|
|
71
71
|
transition: { duration: 0.6, ease: "easeOut" },
|
|
72
|
-
style:
|
|
72
|
+
style: G({ left: t.x + "px", top: t.y + "px", width: t.size + "px", height: t.size + "px" }),
|
|
73
73
|
onAnimationComplete: (d) => b(t.id)
|
|
74
74
|
}, null, 8, ["style", "onAnimationComplete"]))), 128))
|
|
75
|
-
], 10,
|
|
75
|
+
], 10, A));
|
|
76
76
|
}
|
|
77
|
-
}), c = /* @__PURE__ */
|
|
77
|
+
}), c = /* @__PURE__ */ w(X, [["__scopeId", "data-v-39479b50"]]);
|
|
78
78
|
c.install = (s) => {
|
|
79
79
|
s.component(c.name, c);
|
|
80
80
|
};
|
|
81
81
|
export {
|
|
82
|
-
c as
|
|
83
|
-
c as default
|
|
82
|
+
c as G
|
|
84
83
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),d=require("motion-v"),b=require("./GBranched-DgHZO9BQ.js"),B=["type","disabled"],h={key:0,class:"g-button__loading"},f={key:1,class:"g-button__icon"},_={key:2,class:"g-button__text"},C=e.defineComponent({name:"GButton",__name:"index",props:{type:{default:"default"},size:{default:"middle"},loading:{type:Boolean},disabled:{type:Boolean},block:{type:Boolean},nativeType:{default:"button"}},emits:["click"],setup(i,{emit:r}){const s=i,u=r,p=t=>{if(!(s.disabled||s.loading)){if(s.type!=="link"&&!k.value){const o=t.currentTarget.getBoundingClientRect(),c=t.clientX!==0||t.clientY!==0,g={id:++m,x:c?t.clientX-o.left:o.width/2,y:c?t.clientY-o.top:o.height/2,size:Math.hypot(o.width,o.height)*2};n.value.push(g)}u("click",t)}},n=e.ref([]);let m=0;const y=t=>{n.value=n.value.filter(a=>a.id!==t)},k=d.useReducedMotion();return(t,a)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["g-button",["g-button--"+t.type,"g-button--"+t.size,{"is-block":t.block,"is-loading":t.loading,"is-disabled":t.disabled}]]),type:t.nativeType,disabled:t.disabled||t.loading,onClick:p},[t.loading?(e.openBlock(),e.createElementBlock("span",h)):e.createCommentVNode("",!0),t.$slots.icon?(e.openBlock(),e.createElementBlock("span",f,[e.renderSlot(t.$slots,"icon",{},void 0,!0)])):e.createCommentVNode("",!0),t.$slots.default?(e.openBlock(),e.createElementBlock("span",_,[e.renderSlot(t.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,o=>(e.openBlock(),e.createBlock(e.unref(d.motion).span,{key:o.id,class:"g-button__wave",initial:{x:"-50%",y:"-50%",scale:0,opacity:.2},animate:{x:"-50%",y:"-50%",scale:1,opacity:0},transition:{duration:.6,ease:"easeOut"},style:e.normalizeStyle({left:o.x+"px",top:o.y+"px",width:o.size+"px",height:o.size+"px"}),onAnimationComplete:c=>y(o.id)},null,8,["style","onAnimationComplete"]))),128))],10,B))}}),l=b._export_sfc(C,[["__scopeId","data-v-39479b50"]]);l.install=i=>{i.component(l.name,l)};exports.GButton=l;
|
package/lib/GCard/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.g-card[data-v-
|
|
1
|
+
.g-card[data-v-7ef47624]{position:relative;display:grid;isolation:isolate;border:1px solid rgba(255,255,255,.15);transform:translateZ(.01px)}.g-card--shadow[data-v-7ef47624]{box-shadow:#0000000d 0 2px 8px,#0000000d 0 16px 40px}.g-card__border[data-v-7ef47624],.g-card__fill[data-v-7ef47624]{position:absolute;inset:0;z-index:-1;border:1px solid transparent;border-radius:inherit}.g-card__fill[data-v-7ef47624]{mask-composite:subtract,add,add,add,add,add;-webkit-mask-composite:source-out,source-over,source-over,source-over,source-over,source-over;mix-blend-mode:soft-light}.g-card__glow[data-v-7ef47624]{position:absolute;z-index:1;border-radius:inherit;pointer-events:none;mix-blend-mode:plus-lighter}.g-card__glow-inner[data-v-7ef47624]{position:absolute;border-radius:inherit}.g-card__content[data-v-7ef47624]{position:relative;z-index:1;display:flex;flex-direction:column;overflow:auto}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as X, computed as i, useTemplateRef as Y, ref as y, watch as J, createElementBlock as A, openBlock as F, normalizeStyle as b, normalizeClass as K, createCommentVNode as Z, createElementVNode as m, Fragment as ee, renderSlot as ae } from "vue";
|
|
2
|
-
import { _ as te } from "
|
|
2
|
+
import { _ as te } from "./GBranched-gk9VjilV.mjs";
|
|
3
3
|
const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
4
4
|
__name: "index",
|
|
5
5
|
props: {
|
|
@@ -73,11 +73,11 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
73
73
|
"86% 85%",
|
|
74
74
|
"82% 18%",
|
|
75
75
|
"51% 4%"
|
|
76
|
-
],
|
|
77
|
-
function
|
|
76
|
+
], G = [0, 1, 2, 0, 1, 2, 1];
|
|
77
|
+
function z(e) {
|
|
78
78
|
const a = [];
|
|
79
79
|
for (let t = 0; t < 7; t++) {
|
|
80
|
-
const r = e[Math.min(
|
|
80
|
+
const r = e[Math.min(G[t], e.length - 1)];
|
|
81
81
|
a.push(`radial-gradient(at ${j[t]}, ${r} 0px, transparent 50%)`);
|
|
82
82
|
}
|
|
83
83
|
return a.push(`linear-gradient(${e[0]} 0 100%)`), a;
|
|
@@ -85,7 +85,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
85
85
|
const n = h, _ = i(() => n.backgroundColor ?? "transparent"), I = Y("cardRef"), $ = y(!1), f = y(45), p = y(0), C = y(!1), R = (e) => {
|
|
86
86
|
const { width: a, height: t } = e.getBoundingClientRect();
|
|
87
87
|
return [a / 2, t / 2];
|
|
88
|
-
},
|
|
88
|
+
}, D = (e, a, t) => {
|
|
89
89
|
const [r, o] = R(e), s = a - r, c = t - o;
|
|
90
90
|
let d = 1 / 0, l = 1 / 0;
|
|
91
91
|
return s !== 0 && (d = r / Math.abs(s)), c !== 0 && (l = o / Math.abs(c)), Math.min(Math.max(1 / Math.min(d, l), 0), 1);
|
|
@@ -98,7 +98,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
98
98
|
const a = I.value;
|
|
99
99
|
if (!a) return;
|
|
100
100
|
const t = a.getBoundingClientRect(), r = e.clientX - t.left, o = e.clientY - t.top;
|
|
101
|
-
p.value =
|
|
101
|
+
p.value = D(a, r, o), f.value = T(a, r, o);
|
|
102
102
|
};
|
|
103
103
|
J(
|
|
104
104
|
() => n.animated,
|
|
@@ -143,7 +143,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
143
143
|
0,
|
|
144
144
|
(p.value * 100 - n.edgeSensitivity) / (100 - n.edgeSensitivity)
|
|
145
145
|
) : 0
|
|
146
|
-
), P = i(() =>
|
|
146
|
+
), P = i(() => z(n.colors)), W = i(() => P.value.map((e) => `${e} border-box`)), q = i(() => P.value.map((e) => `${e} padding-box`)), u = i(() => `${f.value.toFixed(3)}deg`);
|
|
147
147
|
return (e, a) => (F(), A("div", {
|
|
148
148
|
ref_key: "cardRef",
|
|
149
149
|
ref: I,
|
|
@@ -221,7 +221,7 @@ const ne = { class: "g-card__content" }, re = /* @__PURE__ */ X({
|
|
|
221
221
|
])
|
|
222
222
|
], 38));
|
|
223
223
|
}
|
|
224
|
-
}), x = /* @__PURE__ */ te(re, [["__scopeId", "data-v-
|
|
224
|
+
}), x = /* @__PURE__ */ te(re, [["__scopeId", "data-v-7ef47624"]]), se = [
|
|
225
225
|
// ===== 浅色方案 =====
|
|
226
226
|
{
|
|
227
227
|
name: "Daylight",
|
|
@@ -285,7 +285,6 @@ x.install = (h) => {
|
|
|
285
285
|
h.component(x.name, x);
|
|
286
286
|
};
|
|
287
287
|
export {
|
|
288
|
-
x as
|
|
289
|
-
se as
|
|
290
|
-
x as default
|
|
288
|
+
x as G,
|
|
289
|
+
se as c
|
|
291
290
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("vue"),U=require("./GBranched-DgHZO9BQ.js"),W={class:"g-card__content"},H=a.defineComponent({__name:"index",props:{className:{default:""},edgeSensitivity:{default:30},glowColor:{default:"40 80 80"},backgroundColor:{},borderRadius:{default:28},glowRadius:{default:40},glowIntensity:{default:1},coneSpread:{default:25},animated:{type:Boolean,default:!1},colors:{default:()=>["#c084fc","#f472b6","#38bdf8"]},fillOpacity:{default:.5},shadow:{type:Boolean,default:!0},glow:{type:Boolean,default:!0}},setup(v){function B(e){const t=e.match(/([\d.]+)\s*([\d.]+)%?\s*([\d.]+)%?/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3])}:{h:40,s:80,l:80}}function O(e,t){const{h:n,s:o,l}=B(e),c=`${n}deg ${o}% ${l}%`;return[[0,0,0,1,100,!0],[0,0,1,0,60,!0],[0,0,3,0,50,!0],[0,0,6,0,40,!0],[0,0,15,0,30,!0],[0,0,25,2,20,!0],[0,0,50,2,10,!0],[0,0,1,0,60,!1],[0,0,3,0,50,!1],[0,0,6,0,40,!1],[0,0,15,0,30,!1],[0,0,25,2,20,!1],[0,0,50,2,10,!1]].map(([d,s,$,b,q,D])=>{const T=Math.min(q*t,100);return`${D?"inset ":""}${d}px ${s}px ${$}px ${b}px hsl(${c} / ${T}%)`}).join(", ")}function C(e){return 1-Math.pow(1-e,3)}function w(e){return e*e*e}function m({start:e=0,end:t=100,duration:n=1e3,delay:o=0,ease:l=C,onUpdate:c,onEnd:i}){const d=performance.now()+o;function s(){const $=performance.now()-d,b=Math.min($/n,1);c(e+(t-e)*l(b)),b<1?requestAnimationFrame(s):i&&i()}setTimeout(()=>requestAnimationFrame(s),o)}const E=["80% 55%","69% 34%","8% 6%","41% 38%","86% 85%","82% 18%","51% 4%"],P=[0,1,2,0,1,2,1];function N(e){const t=[];for(let n=0;n<7;n++){const o=e[Math.min(P[n],e.length-1)];t.push(`radial-gradient(at ${E[n]}, ${o} 0px, transparent 50%)`)}return t.push(`linear-gradient(${e[0]} 0 100%)`),t}const r=v,x=a.computed(()=>r.backgroundColor??"transparent"),S=a.useTemplateRef("cardRef"),y=a.ref(!1),f=a.ref(45),p=a.ref(0),h=a.ref(!1),M=e=>{const{width:t,height:n}=e.getBoundingClientRect();return[t/2,n/2]},z=(e,t,n)=>{const[o,l]=M(e),c=t-o,i=n-l;let d=1/0,s=1/0;return c!==0&&(d=o/Math.abs(c)),i!==0&&(s=l/Math.abs(i)),Math.min(Math.max(1/Math.min(d,s),0),1)},V=(e,t,n)=>{const[o,l]=M(e),c=t-o,i=n-l;if(c===0&&i===0)return 0;let s=Math.atan2(i,c)*(180/Math.PI)+90;return s<0&&(s+=360),s},A=e=>{const t=S.value;if(!t)return;const n=t.getBoundingClientRect(),o=e.clientX-n.left,l=e.clientY-n.top;p.value=z(t,o,l),f.value=V(t,o,l)};a.watch(()=>r.animated,()=>{if(!r.animated)return;const e=110,t=465;h.value=!0,f.value=e,m({duration:500,onUpdate:n=>p.value=n/100}),m({ease:w,duration:1500,end:50,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),m({ease:C,delay:1500,duration:2250,start:50,end:100,onUpdate:n=>{f.value=(t-e)*(n/100)+e}}),m({ease:w,delay:2500,duration:1500,start:100,end:0,onUpdate:n=>p.value=n/100,onEnd:()=>h.value=!1})},{immediate:!0});const _=a.computed(()=>r.edgeSensitivity+20),g=a.computed(()=>y.value||h.value),I=a.computed(()=>g.value?Math.max(0,(p.value*100-_.value)/(100-_.value)):0),F=a.computed(()=>g.value?Math.max(0,(p.value*100-r.edgeSensitivity)/(100-r.edgeSensitivity)):0),R=a.computed(()=>N(r.colors)),G=a.computed(()=>R.value.map(e=>`${e} border-box`)),j=a.computed(()=>R.value.map(e=>`${e} padding-box`)),u=a.computed(()=>`${f.value.toFixed(3)}deg`);return(e,t)=>(a.openBlock(),a.createElementBlock("div",{ref_key:"cardRef",ref:S,onPointermove:A,onPointerenter:t[0]||(t[0]=n=>y.value=!0),onPointerleave:t[1]||(t[1]=n=>y.value=!1),class:a.normalizeClass(["g-card",{"g-card--shadow":r.shadow},r.className]),style:a.normalizeStyle({background:x.value,borderRadius:r.borderRadius+"px"})},[r.glow?(a.openBlock(),a.createElementBlock(a.Fragment,{key:0},[a.createElementVNode("div",{class:"g-card__border",style:a.normalizeStyle({background:[`linear-gradient(${x.value} 0 100%) padding-box`,"linear-gradient(rgb(255 255 255 / 0%) 0% 100%) border-box",...G.value].join(", "),opacity:I.value,maskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black ${r.coneSpread}%, transparent ${r.coneSpread+15}%, transparent ${100-r.coneSpread-15}%, black ${100-r.coneSpread}%)`,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),a.createElementVNode("div",{class:"g-card__fill",style:a.normalizeStyle({background:j.value.join(", "),maskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),WebkitMaskImage:["linear-gradient(to bottom, black, black)","radial-gradient(ellipse at 50% 50%, black 40%, transparent 65%)","radial-gradient(ellipse at 66% 66%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 66% 33%, black 5%, transparent 40%)","radial-gradient(ellipse at 33% 66%, black 5%, transparent 40%)",`conic-gradient(from ${u.value} at center, transparent 5%, black 15%, black 85%, transparent 95%)`].join(", "),opacity:I.value*r.fillOpacity,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},null,4),a.createElementVNode("span",{class:"g-card__glow",style:a.normalizeStyle({inset:`-${r.glowRadius}px`,maskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,WebkitMaskImage:`conic-gradient(from ${u.value} at center, black 2.5%, transparent 10%, transparent 90%, black 97.5%)`,opacity:F.value,transition:g.value?"opacity 0.25s ease-out":"opacity 0.75s ease-in-out"})},[a.createElementVNode("span",{class:"g-card__glow-inner",style:a.normalizeStyle({inset:`${r.glowRadius}px`,boxShadow:O(r.glowColor,r.glowIntensity)})},null,4)],4)],64)):a.createCommentVNode("",!0),a.createElementVNode("div",W,[a.renderSlot(e.$slots,"default",{},void 0,!0)])],38))}}),k=U._export_sfc(H,[["__scopeId","data-v-7ef47624"]]),L=[{name:"Daylight",colors:["#5464f6ff","#c084fc","#38bdf8"],glowColor:"220 80 60",backgroundColor:"#f8fafc",dark:!1},{name:"Quartz",colors:["#f472b6","#fb7185","#f9a8d4"],glowColor:"340 80 65",backgroundColor:"#f8fafc",dark:!1},{name:"Matcha",colors:["#34d399","#86efac","#fbbf24"],glowColor:"150 60 50",backgroundColor:"#f8fafc",dark:!1},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#f8fafc",dark:!1},{name:"Daylight",colors:["#c084fc","#f472b6","#38bdf8"],glowColor:"280 80 75",backgroundColor:"#1d1e1f",dark:!0},{name:"Quartz",colors:["#f97316","#f43f5e","#facc15"],glowColor:"20 90 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Matcha",colors:["#34d399","#10b981","#a7f3d0"],glowColor:"150 70 65",backgroundColor:"#1d1e1f",dark:!0},{name:"Ocean",colors:["#0ea5e9","#22d3ee","#6366f1"],glowColor:"200 90 65",backgroundColor:"#1d1e1f",dark:!0}];k.install=v=>{v.component(k.name,k)};exports.GCard=k;exports.cardPresets=L;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as q, useTemplateRef as B, ref as y, watch as N, onMounted as V, onUnmounted as E, createElementBlock as
|
|
1
|
+
import { defineComponent as q, useTemplateRef as B, ref as y, watch as N, onMounted as V, onUnmounted as E, createElementBlock as P, openBlock as U, normalizeClass as z } from "vue";
|
|
2
2
|
const A = /* @__PURE__ */ q({
|
|
3
3
|
__name: "index",
|
|
4
4
|
props: {
|
|
@@ -11,13 +11,13 @@ const A = /* @__PURE__ */ q({
|
|
|
11
11
|
decimalPlaces: { default: 0 }
|
|
12
12
|
},
|
|
13
13
|
emits: ["start", "end"],
|
|
14
|
-
setup(w, { expose: W, emit:
|
|
15
|
-
const e = w, I =
|
|
14
|
+
setup(w, { expose: W, emit: C }) {
|
|
15
|
+
const e = w, I = C;
|
|
16
16
|
W({
|
|
17
17
|
reset: D,
|
|
18
18
|
start: h
|
|
19
19
|
});
|
|
20
|
-
const n = B("elementRef"),
|
|
20
|
+
const n = B("elementRef"), _ = () => 0, r = y(_()), s = y(!1), i = y(!1);
|
|
21
21
|
let a = null, c = null, l = null, m = !1, f = 0, d = 0, u = 0;
|
|
22
22
|
const R = (t) => 1 - Math.pow(1 - t, 3), S = (t) => {
|
|
23
23
|
const o = Math.max(0, Math.floor(e.decimalPlaces)), g = {
|
|
@@ -47,7 +47,7 @@ const A = /* @__PURE__ */ q({
|
|
|
47
47
|
!m || !s.value || !e.startWhen || (F(), p(), f = r.value, d = e.num, u = 0, a = requestAnimationFrame(M));
|
|
48
48
|
}
|
|
49
49
|
function D() {
|
|
50
|
-
F(), p(), u = 0, i.value = !1, r.value =
|
|
50
|
+
F(), p(), u = 0, i.value = !1, r.value = _(), v();
|
|
51
51
|
}
|
|
52
52
|
const O = () => {
|
|
53
53
|
n.value && (l = new IntersectionObserver(
|
|
@@ -76,10 +76,10 @@ const A = /* @__PURE__ */ q({
|
|
|
76
76
|
m = !0, v(), O();
|
|
77
77
|
}), E(() => {
|
|
78
78
|
k();
|
|
79
|
-
}), (t, o) => (
|
|
79
|
+
}), (t, o) => (U(), P("span", {
|
|
80
80
|
ref_key: "elementRef",
|
|
81
81
|
ref: n,
|
|
82
|
-
class:
|
|
82
|
+
class: z(t.className)
|
|
83
83
|
}, null, 2));
|
|
84
84
|
}
|
|
85
85
|
});
|
|
@@ -87,6 +87,5 @@ A.install = (w) => {
|
|
|
87
87
|
w.component(A.name, A);
|
|
88
88
|
};
|
|
89
89
|
export {
|
|
90
|
-
A as
|
|
91
|
-
A as default
|
|
90
|
+
A as _
|
|
92
91
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),F=t.defineComponent({__name:"index",props:{num:{default:0},delay:{default:0},duration:{default:2},className:{default:""},startWhen:{type:Boolean,default:!0},separator:{default:""},decimalPlaces:{default:0}},emits:["start","end"],setup(M,{expose:N,emit:W}){const e=M,A=W;N({reset:T,start:b});const a=t.useTemplateRef("elementRef"),I=()=>0,s=t.ref(I()),u=t.ref(!1),c=t.ref(!1);let l=null,m=null,r=null,f=!1,d=0,v=0,o=0;const C=n=>1-Math.pow(1-n,3),R=n=>{const i=Math.max(0,Math.floor(e.decimalPlaces)),y={useGrouping:!!e.separator,minimumFractionDigits:i,maximumFractionDigits:i},w=Number(n.toFixed(i)),x=Intl.NumberFormat("en-US",y).format(w);return e.separator?x.replace(/,/g,e.separator):x},p=()=>{a.value&&(a.value.textContent=R(s.value))},_=()=>{l!==null&&(cancelAnimationFrame(l),l=null)},h=()=>{m!==null&&(clearTimeout(m),m=null)},g=n=>{if(!f)return;o||(o=n);const i=(n-o)/1e3,y=Math.max(.001,e.duration),w=Math.min(1,i/y),x=C(w);s.value=d+(v-d)*x,p(),w<1?l=requestAnimationFrame(g):(s.value=v,p(),l=null,A("end"))};function b(){c.value||!u.value||!e.startWhen||(c.value=!0,A("start"),h(),m=setTimeout(()=>{m=null,f&&(d=s.value,v=e.num,o=0,l=requestAnimationFrame(g))},e.delay*1e3))}function S(){!f||!u.value||!e.startWhen||(_(),h(),d=s.value,v=e.num,o=0,l=requestAnimationFrame(g))}function T(){_(),h(),o=0,c.value=!1,s.value=I(),p()}const q=()=>{a.value&&(r=new IntersectionObserver(([n])=>{n.isIntersecting&&!u.value&&(u.value=!0,b(),r&&a.value&&r.unobserve(a.value))},{threshold:0,rootMargin:"0px"}),r.observe(a.value))},D=()=>{f=!1,_(),h(),r&&(r.disconnect(),r=null)};return t.watch(()=>e.num,()=>{c.value?S():u.value&&e.startWhen&&b()}),t.watch(()=>e.startWhen,()=>{e.startWhen&&u.value&&!c.value&&b()}),t.onMounted(()=>{f=!0,p(),q()}),t.onUnmounted(()=>{D()}),(n,i)=>(t.openBlock(),t.createElementBlock("span",{ref_key:"elementRef",ref:a,class:t.normalizeClass(n.className)},null,2))}});F.install=M=>{M.component(F.name,F)};exports._sfc_main=F;
|