@scalar/components 0.16.8 → 0.16.12

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.
Files changed (33) hide show
  1. package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts +13 -6
  2. package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
  3. package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +119 -40
  4. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts.map +1 -1
  5. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +2 -2
  6. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +15 -13
  7. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts +2 -0
  8. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts.map +1 -1
  9. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +1 -1
  10. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +19 -18
  11. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +4 -2
  12. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -1
  13. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +15 -16
  14. package/dist/components/ScalarDropdown/useDropdown.d.ts +10 -0
  15. package/dist/components/ScalarDropdown/useDropdown.d.ts.map +1 -0
  16. package/dist/components/ScalarDropdown/useDropdown.js +14 -0
  17. package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +4 -1
  18. package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
  19. package/dist/components/ScalarFloating/ScalarFloating.vue.js +38 -34
  20. package/dist/components/ScalarFloating/types.d.ts +4 -3
  21. package/dist/components/ScalarFloating/types.d.ts.map +1 -1
  22. package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
  23. package/dist/components/ScalarModal/ScalarModal.vue2.js +4 -4
  24. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +4 -0
  25. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
  26. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +95 -62
  27. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts +2 -0
  28. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts.map +1 -1
  29. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +17 -16
  30. package/dist/components/ScalarSidebar/types.d.ts +9 -0
  31. package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
  32. package/dist/style.css +1 -1
  33. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5E,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAAA;IAC7B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAAA;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAC/C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
@@ -2,7 +2,7 @@ import o from "./ScalarModal.vue2.js";
2
2
  import { useModal as f } from "./ScalarModal.vue2.js";
3
3
  /* empty css */
4
4
  import r from "../../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1319c63c"]]);
5
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c1e93776"]]);
6
6
  export {
7
7
  m as default,
8
8
  f as useModal
@@ -1,4 +1,4 @@
1
- import { defineComponent as x, createBlock as i, openBlock as l, unref as a, withCtx as t, createElementVNode as w, normalizeClass as o, createVNode as m, createElementBlock as r, createCommentVNode as d, normalizeStyle as b, createTextVNode as y, toDisplayString as g, renderSlot as n, reactive as z } from "vue";
1
+ import { defineComponent as x, createBlock as i, openBlock as l, unref as a, withCtx as t, createElementVNode as w, normalizeClass as o, createVNode as m, createElementBlock as r, createCommentVNode as d, normalizeStyle as y, createTextVNode as b, toDisplayString as g, renderSlot as n, reactive as z } from "vue";
2
2
  import { Dialog as k, DialogPanel as C, DialogTitle as S } from "@headlessui/vue";
3
3
  import { cva as f, cx as v } from "@scalar/use-hooks/useBindCx";
4
4
  import D from "../ScalarIconButton/ScalarIconButton.vue.js";
@@ -81,7 +81,7 @@ const T = /* @__PURE__ */ x({
81
81
  a(v)(
82
82
  e.size === "full" ? "scalar-modal-layout-full" : "scalar-modal-layout",
83
83
  "fixed left-0 top-0 flex items-start justify-center",
84
- "z-[1001] h-[100dvh] w-[100dvw]",
84
+ "z-overlay h-dvh w-dvw",
85
85
  "bg-backdrop opacity-0 dark:bg-backdrop-dark",
86
86
  e.size === "full" && "flex"
87
87
  )
@@ -89,7 +89,7 @@ const T = /* @__PURE__ */ x({
89
89
  }, [
90
90
  m(a(C), {
91
91
  class: o(a(h)({ size: e.size, variant: e.variant })),
92
- style: b({ maxWidth: e.maxWidth })
92
+ style: y({ maxWidth: e.maxWidth })
93
93
  }, {
94
94
  default: t(() => [
95
95
  e.title ? (l(), i(a(S), {
@@ -97,7 +97,7 @@ const T = /* @__PURE__ */ x({
97
97
  class: "scalar-modal-header m-0 -mb-1 rounded-lg pt-3 px-3 text-left text-sm font-medium text-c-1"
98
98
  }, {
99
99
  default: t(() => [
100
- y(g(e.title), 1)
100
+ b(g(e.title), 1)
101
101
  ]),
102
102
  _: 1
103
103
  })) : d("", !0),
@@ -24,19 +24,23 @@ import type { ScalarSidebarGroupSlots } from './types';
24
24
  */
25
25
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
26
26
  controlled?: boolean;
27
+ discrete?: boolean;
27
28
  } & {
28
29
  open?: boolean;
29
30
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
31
  "update:open": (value: boolean) => any;
31
32
  } & {
32
33
  click: (event: MouseEvent) => any;
34
+ toggle: (event: MouseEvent) => any;
33
35
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
34
36
  controlled?: boolean;
37
+ discrete?: boolean;
35
38
  } & {
36
39
  open?: boolean;
37
40
  }> & Readonly<{
38
41
  onClick?: ((event: MouseEvent) => any) | undefined;
39
42
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
43
+ onToggle?: ((event: MouseEvent) => any) | undefined;
40
44
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarGroupSlots>;
41
45
  export default _default;
42
46
  type __VLS_WithSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AA4HA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;WAqCM,OAAO;;;;;;;;WAAP,OAAO;;;;;AApChB,wBA6LC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAyKA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;WAwDM,OAAO;;;;;;;;;;WAAP,OAAO;;;;;;AAvDhB,wBAyQC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,87 +1,120 @@
1
- import { defineComponent as f, mergeModels as r, useModel as v, createBlock as b, openBlock as d, resolveDynamicComponent as y, normalizeProps as $, guardReactiveProps as k, unref as n, withCtx as l, renderSlot as t, createElementBlock as B, createCommentVNode as g, createVNode as s, createSlots as C } from "vue";
2
- import { useBindCx as S } from "@scalar/use-hooks/useBindCx";
3
- import h from "./ScalarSidebarButton.vue.js";
4
- import _ from "./ScalarSidebarGroupToggle.vue.js";
5
- import M from "./ScalarSidebarIndent.vue.js";
6
- import { useSidebarGroups as x } from "./useSidebarGroups.js";
7
- const G = {
1
+ import { defineComponent as g, mergeModels as u, useModel as h, createBlock as k, openBlock as i, resolveDynamicComponent as $, normalizeProps as B, guardReactiveProps as C, unref as n, withCtx as t, createElementVNode as S, createElementBlock as r, createCommentVNode as p, renderSlot as l, createVNode as d, createSlots as N, normalizeStyle as V, createTextVNode as x, toDisplayString as z } from "vue";
2
+ import { useBindCx as M } from "@scalar/use-hooks/useBindCx";
3
+ import D from "./ScalarSidebarButton.vue.js";
4
+ import v from "./ScalarSidebarGroupToggle.vue.js";
5
+ import E from "./ScalarSidebarIndent.vue.js";
6
+ import { useSidebarGroups as G } from "./useSidebarGroups.js";
7
+ const O = { class: "group/group-button relative flex flex-col" }, P = {
8
+ key: 0,
9
+ class: "size-4"
10
+ }, T = ["aria-expanded"], j = {
8
11
  key: 0,
9
12
  class: "group/items flex flex-col gap-px"
10
- }, N = {}, E = /* @__PURE__ */ f({
11
- ...N,
13
+ }, w = {}, K = /* @__PURE__ */ g({
14
+ ...w,
12
15
  inheritAttrs: !1,
13
16
  __name: "ScalarSidebarGroup",
14
- props: /* @__PURE__ */ r({
17
+ props: /* @__PURE__ */ u({
15
18
  is: { default: "li" },
16
19
  icon: { type: [Object, Function] },
17
20
  active: { type: Boolean },
18
21
  selected: { type: Boolean },
19
22
  disabled: { type: Boolean },
20
23
  indent: {},
21
- controlled: { type: Boolean }
24
+ controlled: { type: Boolean },
25
+ discrete: { type: Boolean }
22
26
  }, {
23
27
  open: { type: Boolean, default: !1 },
24
28
  openModifiers: {}
25
29
  }),
26
- emits: /* @__PURE__ */ r(["click"], ["update:open"]),
27
- setup(i, { emit: p }) {
28
- const c = p, o = v(i, "open"), { level: a } = x({ increment: !0 }), { cx: u } = S(), m = (e) => {
29
- c("click", e), i.controlled || (o.value = !o.value);
30
+ emits: /* @__PURE__ */ u(["click", "toggle"], ["update:open"]),
31
+ setup(a, { emit: m }) {
32
+ const c = m, o = h(a, "open"), { level: s } = G({ increment: !0 }), { cx: f } = M(), b = (e) => {
33
+ c("click", e), !a.controlled && !a.discrete && (o.value = !o.value);
34
+ }, y = (e) => {
35
+ c("toggle", e), !a.controlled && a.discrete && (o.value = !o.value);
30
36
  };
31
- return (e, P) => (d(), b(y(e.is), $(k(n(u)("group/item flex flex-col gap-px"))), {
32
- default: l(() => [
33
- t(e.$slots, "before", { open: o.value }),
34
- t(e.$slots, "button", {
35
- level: n(a),
36
- open: o.value
37
- }, () => [
38
- s(h, {
39
- is: "button",
40
- active: e.active,
41
- "aria-expanded": o.value,
42
- class: "group/group-button",
43
- disabled: e.disabled,
44
- indent: n(a),
45
- selected: e.selected,
46
- onClick: m
47
- }, C({
48
- indent: l(() => [
49
- s(M, {
50
- class: "mr-0 -my-2",
51
- indent: n(a)
52
- }, null, 8, ["indent"])
53
- ]),
54
- icon: l(() => [
55
- t(e.$slots, "icon", { open: o.value }, () => [
56
- s(_, {
57
- class: "text-c-3",
37
+ return (e, A) => (i(), k($(e.is), B(C(n(f)("group/item flex flex-col gap-px"))), {
38
+ default: t(() => [
39
+ S("div", O, [
40
+ l(e.$slots, "before", { open: o.value }),
41
+ l(e.$slots, "button", {
42
+ level: n(s),
43
+ open: o.value
44
+ }, () => [
45
+ d(D, {
46
+ is: "button",
47
+ active: e.active,
48
+ "aria-expanded": o.value,
49
+ disabled: e.disabled,
50
+ indent: n(s),
51
+ selected: e.selected,
52
+ onClick: b
53
+ }, N({
54
+ indent: t(() => [
55
+ d(E, {
56
+ class: "mr-0 -my-2",
57
+ indent: n(s),
58
+ selected: e.selected
59
+ }, null, 8, ["indent", "selected"])
60
+ ]),
61
+ icon: t(() => [
62
+ e.discrete ? (i(), r("div", P)) : l(e.$slots, "icon", {
63
+ key: 1,
58
64
  open: o.value
59
- }, null, 8, ["open"])
60
- ])
61
- ]),
62
- default: l(() => [
63
- t(e.$slots, "default", { open: o.value })
64
- ]),
65
- _: 2
66
- }, [
67
- e.$slots.aside ? {
68
- name: "aside",
69
- fn: l(() => [
70
- t(e.$slots, "aside", { open: o.value })
65
+ }, () => [
66
+ d(v, {
67
+ icon: e.icon,
68
+ class: "text-c-3",
69
+ open: o.value
70
+ }, null, 8, ["icon", "open"])
71
+ ])
71
72
  ]),
72
- key: "0"
73
- } : void 0
74
- ]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"])
73
+ default: t(() => [
74
+ l(e.$slots, "default", { open: o.value })
75
+ ]),
76
+ _: 2
77
+ }, [
78
+ e.$slots.aside ? {
79
+ name: "aside",
80
+ fn: t(() => [
81
+ l(e.$slots, "aside", { open: o.value })
82
+ ]),
83
+ key: "0"
84
+ } : void 0
85
+ ]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"]),
86
+ e.discrete ? (i(), r("button", {
87
+ key: 0,
88
+ type: "button",
89
+ "aria-expanded": o.value,
90
+ class: "absolute top-[1lh] -translate-y-1/2 p-0.75 rounded hover:bg-sidebar-b-hover left-[calc(4px+var(--scalar-sidebar-indent)*var(--scalar-sidebar-level))] text-c-3 hover:text-sidebar-c-1",
91
+ style: V({ "--scalar-sidebar-level": n(s) }),
92
+ onClick: y
93
+ }, [
94
+ l(e.$slots, "icon", { open: o.value }, () => [
95
+ d(v, {
96
+ icon: e.icon,
97
+ open: o.value
98
+ }, {
99
+ label: t(() => [
100
+ x(z(o.value ? "Close" : "Open") + " ", 1),
101
+ l(e.$slots, "default", { open: o.value })
102
+ ]),
103
+ _: 3
104
+ }, 8, ["icon", "open"])
105
+ ])
106
+ ], 12, T)) : p("", !0)
107
+ ]),
108
+ l(e.$slots, "after", { open: o.value })
75
109
  ]),
76
- t(e.$slots, "after", { open: o.value }),
77
- o.value ? (d(), B("ul", G, [
78
- t(e.$slots, "items", { open: o.value })
79
- ])) : g("", !0)
110
+ o.value ? (i(), r("ul", j, [
111
+ l(e.$slots, "items", { open: o.value })
112
+ ])) : p("", !0)
80
113
  ]),
81
114
  _: 3
82
115
  }, 16));
83
116
  }
84
117
  });
85
118
  export {
86
- E as default
119
+ K as default
87
120
  };
@@ -16,6 +16,7 @@
16
16
  */
17
17
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
18
18
  controlled?: boolean;
19
+ discrete?: boolean;
19
20
  } & {
20
21
  open?: boolean;
21
22
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -24,6 +25,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./
24
25
  click: (event: MouseEvent) => any;
25
26
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
26
27
  controlled?: boolean;
28
+ discrete?: boolean;
27
29
  } & {
28
30
  open?: boolean;
29
31
  }> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyLA;;;;;;;;;;;;;;;GAeG;;;;WAiFM,OAAO;;;;;;;;WAAP,OAAO;;;;;IAjEd,qCAAqC;cACzB,MAAM,OAAO;IACzB,iCAAiC;aACtB,MAAM,OAAO;IACxB,wBAAwB;WACf,MAAM,OAAO;IACtB,8BAA8B;YACpB,MAAM,OAAO;IACvB,+BAA+B;WACtB,MAAM,OAAO;IACtB,qCAAqC;mBACtB,MAAM,OAAO;IAC5B,mCAAmC;YACzB,MAAM,OAAO;;AA5BzB,wBAkTC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyLA;;;;;;;;;;;;;;;GAeG;;;;;WAiFM,OAAO;;;;;;;;;WAAP,OAAO;;;;;IAjEd,qCAAqC;cACzB,MAAM,OAAO;IACzB,iCAAiC;aACtB,MAAM,OAAO;IACxB,wBAAwB;WACf,MAAM,OAAO;IACtB,8BAA8B;YACpB,MAAM,OAAO;IACvB,+BAA+B;WACtB,MAAM,OAAO;IACtB,qCAAqC;mBACtB,MAAM,OAAO;IAC5B,mCAAmC;YACzB,MAAM,OAAO;;AA5BzB,wBAmTC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,9 +1,9 @@
1
- import { defineComponent as g, mergeModels as c, useModel as B, useTemplateRef as T, ref as _, createElementBlock as u, openBlock as f, normalizeStyle as h, normalizeClass as z, renderSlot as s, createVNode as t, mergeProps as I, unref as r, withCtx as l, Transition as N, createCommentVNode as A, normalizeProps as w, guardReactiveProps as L, createTextVNode as M, nextTick as m } from "vue";
2
- import { ScalarIconArrowRight as P, ScalarIconCaretLeft as R, ScalarIconListDashes as V } from "@scalar/icons";
1
+ import { defineComponent as B, mergeModels as c, useModel as g, useTemplateRef as h, ref as T, createElementBlock as u, openBlock as f, normalizeStyle as _, normalizeClass as z, renderSlot as s, createVNode as t, mergeProps as I, unref as r, withCtx as l, Transition as N, createCommentVNode as A, normalizeProps as w, guardReactiveProps as x, createTextVNode as L, nextTick as m } from "vue";
2
+ import { ScalarIconArrowRight as M, ScalarIconCaretLeft as P, ScalarIconListDashes as R } from "@scalar/icons";
3
3
  import p from "./ScalarSidebarButton.vue.js";
4
- import q from "./ScalarSidebarItems.vue.js";
4
+ import V from "./ScalarSidebarItems.vue.js";
5
5
  /* empty css */
6
- import x from "./ScalarSidebarSpacer.vue.js";
6
+ import q from "./ScalarSidebarSpacer.vue.js";
7
7
  import { findScrollContainer as v } from "./findScrollContainer.js";
8
8
  import { useSidebarGroups as E } from "./useSidebarGroups.js";
9
9
  import { useSidebarNestedItem as O } from "./useSidebarNestedItems.js";
@@ -11,27 +11,28 @@ import j from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
11
11
  const D = {
12
12
  key: 0,
13
13
  class: "absolute inset-0 translate-x-full"
14
- }, F = {}, te = /* @__PURE__ */ g({
14
+ }, F = {}, te = /* @__PURE__ */ B({
15
15
  ...F,
16
16
  inheritAttrs: !1,
17
17
  __name: "ScalarSidebarNestedItems",
18
18
  props: /* @__PURE__ */ c({
19
19
  is: {},
20
- icon: { type: [Object, Function], default: V },
20
+ icon: { type: [Object, Function], default: R },
21
21
  active: { type: Boolean },
22
22
  selected: { type: Boolean },
23
23
  disabled: { type: Boolean },
24
24
  indent: {},
25
- controlled: { type: Boolean }
25
+ controlled: { type: Boolean },
26
+ discrete: { type: Boolean }
26
27
  }, {
27
28
  open: { type: Boolean, default: !1 },
28
29
  openModifiers: {}
29
30
  }),
30
31
  emits: /* @__PURE__ */ c(["click"], ["update:open"]),
31
32
  setup(d, { emit: b }) {
32
- const $ = b, o = B(d, "open");
33
+ const $ = b, o = g(d, "open");
33
34
  O(o);
34
- const { level: S } = E({ reset: !0 }), a = T("el"), i = _(0);
35
+ const { level: S } = E({ reset: !0 }), a = h("el"), i = T(0);
35
36
  function k() {
36
37
  i.value = v(a.value).scrollTop ?? 0, m(
37
38
  () => a.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
@@ -49,13 +50,13 @@ const D = {
49
50
  ref_key: "el",
50
51
  ref: a,
51
52
  class: z(["group/item group/nested-items contents", { "group/nested-items-open": o.value }]),
52
- style: h({ "--nested-items-offset": `${i.value}px` })
53
+ style: _({ "--nested-items-offset": `${i.value}px` })
53
54
  }, [
54
55
  s(e.$slots, "button", {}, () => [
55
56
  t(p, I({
56
57
  is: "button",
57
58
  "aria-expanded": o.value,
58
- class: "text-sidebar-c-1 font-sidebar-active",
59
+ class: "text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1",
59
60
  disabled: e.disabled,
60
61
  indent: r(S),
61
62
  selected: e.selected
@@ -70,7 +71,7 @@ const D = {
70
71
  ]),
71
72
  aside: l(() => [
72
73
  s(e.$slots, "aside", {}, () => [
73
- t(r(P), { class: "size-4 text-sidebar-c-2" })
74
+ t(r(M), { class: "size-4 text-sidebar-c-2" })
74
75
  ])
75
76
  ]),
76
77
  default: l(() => [
@@ -88,7 +89,7 @@ const D = {
88
89
  }, {
89
90
  default: l(() => [
90
91
  o.value ? (f(), u("div", D, [
91
- t(q, w(L(e.$attrs)), {
92
+ t(V, w(x(e.$attrs)), {
92
93
  default: l(() => [
93
94
  s(e.$slots, "back", {}, () => [
94
95
  t(p, {
@@ -97,17 +98,17 @@ const D = {
97
98
  onClick: n[0] || (n[0] = (G) => !e.controlled && (o.value = !1))
98
99
  }, {
99
100
  icon: l(() => [
100
- t(r(R), { class: "size-4 -m-px text-sidebar-c-2" })
101
+ t(r(P), { class: "size-4 -m-px text-sidebar-c-2" })
101
102
  ]),
102
103
  default: l(() => [
103
104
  s(e.$slots, "back-label", {}, () => [
104
- n[1] || (n[1] = M("Back", -1))
105
+ n[1] || (n[1] = L("Back", -1))
105
106
  ])
106
107
  ]),
107
108
  _: 3
108
109
  })
109
110
  ]),
110
- t(x, { class: "h-3" }),
111
+ t(q, { class: "h-3" }),
111
112
  s(e.$slots, "items")
112
113
  ]),
113
114
  _: 3
@@ -47,6 +47,15 @@ export type ScalarSidebarGroupProps = ScalarSidebarItemProps & {
47
47
  * </template>
48
48
  */
49
49
  controlled?: boolean;
50
+ /**
51
+ * Enables separate buttons and events for the group toggle and item label
52
+ *
53
+ * @example
54
+ * <ScalarSidebarGroup discrete>
55
+ * ...
56
+ * </ScalarSidebarGroup>
57
+ */
58
+ discrete?: boolean;
50
59
  };
51
60
  /** Scalar Sidebar Item Slots */
52
61
  export type ScalarSidebarButtonSlots = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,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