@soybeanjs/ui 0.6.4 → 0.6.5

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.
@@ -13,8 +13,8 @@ type __VLS_Slots = {} & {
13
13
  };
14
14
  declare const __VLS_base: vue.DefineComponent<ButtonLinkProps, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<ButtonLinkProps> & Readonly<{}>, {
15
15
  disabled: boolean;
16
- variant: ButtonVariant;
17
16
  replace: boolean;
17
+ variant: ButtonVariant;
18
18
  external: boolean;
19
19
  viewTransition: boolean;
20
20
  noRel: boolean;
@@ -33,8 +33,8 @@ declare const __VLS_base: vue.DefineComponent<DialogPureProps, {}, {}, {}, {}, v
33
33
  }>, {
34
34
  open: boolean;
35
35
  defaultOpen: boolean;
36
- closable: boolean;
37
36
  modal: boolean;
37
+ closable: boolean;
38
38
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
39
39
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
40
40
  declare const _default: typeof __VLS_export;
@@ -48,8 +48,8 @@ declare const __VLS_base: vue.DefineComponent<DialogProps, {}, {}, {}, {}, vue.C
48
48
  }>, {
49
49
  open: boolean;
50
50
  defaultOpen: boolean;
51
- closable: boolean;
52
51
  modal: boolean;
52
+ closable: boolean;
53
53
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
54
54
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
55
  declare const _default: typeof __VLS_export;
@@ -48,8 +48,8 @@ declare const __VLS_base: vue.DefineComponent<DrawerProps, {}, {}, {}, {}, vue.C
48
48
  }>, {
49
49
  open: boolean;
50
50
  defaultOpen: boolean;
51
- closable: boolean;
52
51
  modal: boolean;
52
+ closable: boolean;
53
53
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
54
54
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
55
55
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import n from"../context-menu/context-menu.js";import{pageTabsVariants as r}from"../../variants/page-tabs.js";import{usePageTabsState as i}from"./hooks.js";import{Fragment as a,computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,defineComponent as f,isRef as p,mergeProps as m,normalizeClass as h,openBlock as g,renderList as _,shallowRef as v,toDisplayString as y,unref as b,watchEffect as x,withCtx as S}from"vue";import{useControllableState as C,useOmitProps as w}from"@soybeanjs/headless/composables";import{PageTabsClose as T,PageTabsItem as E,PageTabsPin as D,PageTabsRoot as O,providePageTabsUi as k}from"@soybeanjs/headless";const A=f({name:`SPageTabs`,__name:`page-tabs`,props:{class:{},size:{},variant:{default:`chrome`},ui:{},items:{},menuFactory:{},beforeClose:{type:Function,default:()=>!0},modelValue:{},middleClickClose:{type:Boolean}},emits:[`update:modelValue`,`update:items`,`click`,`close`,`pin`,`contextmenu`,`select-context-menu`],setup(f,{emit:A}){let j=f,M=A,N=w(j,[`class`,`size`,`variant`,`ui`,`modelValue`,`items`,`menuFactory`]),P=C(()=>j.modelValue,e=>{M(`update:modelValue`,e??``)},``),F=C(()=>j.items,e=>{M(`update:items`,e)},[]),{closeTab:I,pinTab:L,sortTabs:R,getState:z}=i({items:F,modelValue:P,beforeClose:j.beforeClose}),B=v(null),V=v(null),H=o(()=>{if(!B.value||!j.menuFactory)return[];let e=z(B.value);return j.menuFactory(B.value,e)}),U=e=>{I(e.value,()=>{M(`close`,e)})},W=(e,t)=>{L(e,t),M(`pin`,e)},G=(e,t)=>{V.value=e.currentTarget,B.value=t,M(`contextmenu`,t)},K=async e=>{B.value&&(await e.action?.(),M(`select-context-menu`,e,B.value))},q=o(()=>e(r({size:j.size,variant:j.variant}),j.ui,{root:j.class}));return x(()=>{R()}),k(q),(e,r)=>(g(),s(b(O),m({ref:`root`},b(N),{modelValue:b(P),"onUpdate:modelValue":r[0]||=e=>p(P)?P.value=e:null}),{default:S(()=>[(g(!0),l(a,null,_(b(F),e=>(g(),s(b(E),{key:e.value,value:e.value,pinned:e.pinned,onClick:t=>M(`click`,e),onClose:t=>U(e),onPin:t=>W(e,t),onPointerenter:t=>G(t,e)},{default:S(()=>[d(t,{icon:e.icon},null,8,[`icon`]),u(`span`,{class:h(q.value.itemText)},y(e.label),3),e.hidePinnedIcon?c(`v-if`,!0):(g(),s(b(D),{key:0,"as-child":``},{default:S(()=>[d(t,{icon:`lucide:pin`})]),_:1})),d(b(T),{"as-child":``},{default:S(()=>[d(t,{icon:`lucide:x`})]),_:1}),f.variant===`chrome`?(g(),l(a,{key:1},[(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgLeft)},[...r[1]||=[u(`path`,{d:`M 0 8 A 8 8 0 0 0 8 0 L 8 8 Z`},null,-1)]],2)),(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgRight)},[...r[2]||=[u(`path`,{d:`M 0 0 A 8 8 0 0 0 8 8 L 0 8 Z`},null,-1)]],2))],64)):c(`v-if`,!0),f.variant===`slider`?(g(),l(`div`,{key:2,class:h(q.value.sliderIndicator)},null,2)):c(`v-if`,!0)]),_:2},1032,[`value`,`pinned`,`onClick`,`onClose`,`onPin`,`onPointerenter`]))),128)),H.value.length?(g(),s(n,{key:0,modal:!1,items:H.value,"trigger-props":{reference:V.value},onSelect:K},null,8,[`items`,`trigger-props`])):c(`v-if`,!0)]),_:1},16,[`modelValue`]))}});export{A as default};
1
+ import{mergeSlotVariants as e}from"../../theme/shared.js";import"../../theme/index.js";import t from"../icon/icon.js";import n from"../context-menu/context-menu.js";import{pageTabsVariants as r}from"../../variants/page-tabs.js";import{usePageTabsState as i}from"./hooks.js";import{Fragment as a,computed as o,createBlock as s,createCommentVNode as c,createElementBlock as l,createElementVNode as u,createVNode as d,defineComponent as f,isRef as p,mergeProps as m,normalizeClass as h,openBlock as g,renderList as _,shallowRef as v,toDisplayString as y,unref as b,watchEffect as x,withCtx as S}from"vue";import{useControllableState as C,useOmitProps as w}from"@soybeanjs/headless/composables";import{PageTabsClose as T,PageTabsItem as E,PageTabsPin as D,PageTabsRoot as O,providePageTabsUi as k}from"@soybeanjs/headless";const A=f({name:`SPageTabs`,__name:`page-tabs`,props:{class:{},size:{},variant:{default:`chrome`},ui:{},items:{},menuFactory:{},beforeClose:{type:Function,default:()=>!0},modelValue:{},middleClickClose:{type:Boolean}},emits:[`update:modelValue`,`update:items`,`click`,`close`,`pin`,`contextmenu`,`select-context-menu`],setup(f,{emit:A}){let j=f,M=A,N=w(j,[`class`,`size`,`variant`,`ui`,`modelValue`,`items`,`menuFactory`,`beforeClose`]),P=C(()=>j.modelValue,e=>{M(`update:modelValue`,e??``)},``),F=C(()=>j.items,e=>{M(`update:items`,e)},[]),{closeTab:I,pinTab:L,sortTabs:R,getState:z}=i({items:F,modelValue:P,beforeClose:j.beforeClose}),B=v(null),V=v(null),H=o(()=>{if(!B.value||!j.menuFactory)return[];let e=z(B.value);return j.menuFactory(B.value,e)}),U=e=>{I(e.value,()=>{M(`close`,e)})},W=(e,t)=>{L(e,t),M(`pin`,e)},G=(e,t)=>{V.value=e.currentTarget,B.value=t,M(`contextmenu`,t)},K=async e=>{B.value&&(await e.action?.(),M(`select-context-menu`,e,B.value))},q=o(()=>e(r({size:j.size,variant:j.variant}),j.ui,{root:j.class}));return x(()=>{R()}),k(q),(e,r)=>(g(),s(b(O),m({ref:`root`},b(N),{modelValue:b(P),"onUpdate:modelValue":r[0]||=e=>p(P)?P.value=e:null}),{default:S(()=>[(g(!0),l(a,null,_(b(F),e=>(g(),s(b(E),{key:e.value,value:e.value,pinned:e.pinned,onClick:t=>M(`click`,e),onClose:t=>U(e),onPin:t=>W(e,t),onPointerenter:t=>G(t,e)},{default:S(()=>[d(t,{icon:e.icon},null,8,[`icon`]),u(`span`,{class:h(q.value.itemText)},y(e.label),3),e.hidePinnedIcon?c(`v-if`,!0):(g(),s(b(D),{key:0,"as-child":``},{default:S(()=>[d(t,{icon:`lucide:pin`})]),_:1})),d(b(T),{"as-child":``},{default:S(()=>[d(t,{icon:`lucide:x`})]),_:1}),f.variant===`chrome`?(g(),l(a,{key:1},[(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgLeft)},[...r[1]||=[u(`path`,{d:`M 0 8 A 8 8 0 0 0 8 0 L 8 8 Z`},null,-1)]],2)),(g(),l(`svg`,{height:`100%`,width:`100%`,viewBox:`0 0 8 8`,class:h(q.value.chromeBgRight)},[...r[2]||=[u(`path`,{d:`M 0 0 A 8 8 0 0 0 8 8 L 0 8 Z`},null,-1)]],2))],64)):c(`v-if`,!0),f.variant===`slider`?(g(),l(`div`,{key:2,class:h(q.value.sliderIndicator)},null,2)):c(`v-if`,!0)]),_:2},1032,[`value`,`pinned`,`onClick`,`onClose`,`onPin`,`onPointerenter`]))),128)),H.value.length?(g(),s(n,{key:0,modal:!1,items:H.value,"trigger-props":{reference:V.value},onSelect:K},null,8,[`items`,`trigger-props`])):c(`v-if`,!0)]),_:1},16,[`modelValue`]))}});export{A as default};
@@ -7,9 +7,9 @@ declare const __VLS_export: <T extends PageTabsOptionData>(__VLS_props: NonNulla
7
7
  onContextmenu?: ((tab: T) => any) | undefined;
8
8
  "onUpdate:modelValue"?: ((value: string) => any) | undefined;
9
9
  onClose?: ((tab: T) => any) | undefined;
10
+ onClick?: ((tab: T) => any) | undefined;
10
11
  onPin?: ((tab: T) => any) | undefined;
11
12
  "onUpdate:items"?: ((items: T[]) => any) | undefined;
12
- onClick?: ((tab: T) => any) | undefined;
13
13
  "onSelect-context-menu"?: ((menu: PageTabsContextMenuOptionData, tab: T) => any) | undefined;
14
14
  }> & (typeof globalThis extends {
15
15
  __VLS_PROPS_FALLBACK: infer P;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soybeanjs/ui",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "SoybeanUI is built on top of SoybeanHeadless, providing a collection of styled components for Vue 3.",
5
5
  "homepage": "https://github.com/soybeanjs/soybean-ui",
6
6
  "bugs": {
@@ -54,7 +54,7 @@
54
54
  "tailwind-variants": "^3.2.2",
55
55
  "valibot": "^1.2.0",
56
56
  "zod": "^4.3.6",
57
- "@soybeanjs/headless": "^0.6.4"
57
+ "@soybeanjs/headless": "^0.6.5"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@soybeanjs/cli": "^1.5.0",