@scalar/components 0.16.16 → 0.16.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAqMA;;;;;;;;;;;;;;;GAeG;;;;;WA6FM,OAAO;;;;;;;;;;WAAP,OAAO;;;;;;IA3Ed,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;;AA9BzB,wBA6TC;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":"AA6LA;;;;;;;;;;;;;;;GAeG;;;;;WA4FM,OAAO;;;;;;;;;;WAAP,OAAO;;;;;;IA3Ed,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;;AA7BzB,wBA0TC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,23 +1,23 @@
1
- import { defineComponent as h, mergeModels as u, useModel as g, useTemplateRef as _, ref as T, createElementBlock as f, openBlock as m, normalizeStyle as z, normalizeClass as I, renderSlot as o, createVNode as t, mergeProps as N, unref as n, withCtx as s, Transition as x, createCommentVNode as A, normalizeProps as w, guardReactiveProps as L, createTextVNode as M, nextTick as p } from "vue";
2
- import { ScalarIconArrowRight as P, ScalarIconCaretLeft as R, ScalarIconListDashes as V } from "@scalar/icons";
1
+ import { defineComponent as g, mergeModels as u, useModel as h, useTemplateRef as T, ref as _, createElementBlock as f, openBlock as m, normalizeStyle as z, normalizeClass as N, renderSlot as o, createVNode as t, mergeProps as A, unref as a, createSlots as I, withCtx as s, Transition as w, createCommentVNode as M, normalizeProps as P, guardReactiveProps as R, createTextVNode as V, nextTick as p } from "vue";
2
+ import { ScalarIconArrowRight as q, ScalarIconCaretLeft as x } from "@scalar/icons";
3
3
  import b from "./ScalarSidebarButton.vue.js";
4
- import q from "./ScalarSidebarItems.vue.js";
4
+ import E from "./ScalarSidebarItems.vue.js";
5
5
  /* empty css */
6
- import E from "./ScalarSidebarSpacer.vue.js";
6
+ import L from "./ScalarSidebarSpacer.vue.js";
7
7
  import { findScrollContainer as v } from "./findScrollContainer.js";
8
8
  import { useSidebarGroups as O } from "./useSidebarGroups.js";
9
9
  import { useSidebarNestedItem as j } from "./useSidebarNestedItems.js";
10
- import D from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
11
- const F = {
10
+ import F from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
11
+ const G = {
12
12
  key: 0,
13
13
  class: "absolute inset-0 translate-x-full"
14
- }, G = {}, te = /* @__PURE__ */ h({
15
- ...G,
14
+ }, D = {}, te = /* @__PURE__ */ g({
15
+ ...D,
16
16
  inheritAttrs: !1,
17
17
  __name: "ScalarSidebarNestedItems",
18
18
  props: /* @__PURE__ */ u({
19
19
  is: {},
20
- icon: { type: [Object, Function], default: V },
20
+ icon: { type: [Object, Function] },
21
21
  active: { type: Boolean },
22
22
  selected: { type: Boolean },
23
23
  disabled: { type: Boolean },
@@ -30,92 +30,96 @@ const F = {
30
30
  }),
31
31
  emits: /* @__PURE__ */ u(["click", "back"], ["update:open"]),
32
32
  setup(r, { emit: k }) {
33
- const c = k, a = g(r, "open");
34
- j(a);
35
- const { level: S } = O({ reset: !0 }), l = _("el"), i = T(0);
36
- function $() {
37
- i.value = v(l.value).scrollTop ?? 0, p(
38
- () => l.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
33
+ const c = k, l = h(r, "open");
34
+ j(l);
35
+ const { level: y } = O({ reset: !0 }), n = T("el"), i = _(0);
36
+ function S() {
37
+ i.value = v(n.value).scrollTop ?? 0, p(
38
+ () => n.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
39
39
  );
40
40
  }
41
- function y() {
41
+ function $() {
42
42
  p(() => {
43
- l.value?.querySelector("button")?.focus({ preventScroll: !0 }), v(l.value).scrollTop = i.value;
43
+ n.value?.querySelector("button")?.focus({ preventScroll: !0 }), v(n.value).scrollTop = i.value;
44
44
  });
45
45
  }
46
46
  const C = (e) => {
47
- c("click", e), r.controlled || (a.value = !0);
47
+ c("click", e), r.controlled || (l.value = !0);
48
48
  }, B = (e) => {
49
- c("back", e), r.controlled || (a.value = !1);
49
+ c("back", e), r.controlled || (l.value = !1);
50
50
  };
51
51
  return (e, d) => (m(), f("li", {
52
52
  ref_key: "el",
53
- ref: l,
54
- class: I(["group/item group/nested-items contents", { "group/nested-items-open": a.value }]),
53
+ ref: n,
54
+ class: N(["group/item group/nested-items contents", { "group/nested-items-open": l.value }]),
55
55
  style: z({ "--nested-items-offset": `${i.value}px` })
56
56
  }, [
57
57
  o(e.$slots, "button", {}, () => [
58
- t(b, N({
58
+ t(b, A({
59
59
  is: "button",
60
- "aria-expanded": a.value,
61
- class: "text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1",
60
+ "aria-expanded": l.value,
62
61
  disabled: e.disabled,
63
- indent: n(S),
62
+ indent: a(y),
64
63
  selected: e.selected
65
- }, e.$attrs, { onClick: C }), {
66
- icon: s(() => [
67
- o(e.$slots, "icon", {}, () => [
68
- t(n(D), {
69
- icon: e.icon,
70
- weight: "bold"
71
- }, null, 8, ["icon"])
72
- ])
73
- ]),
64
+ }, e.$attrs, { onClick: C }), I({
74
65
  aside: s(() => [
75
66
  o(e.$slots, "aside", {}, () => [
76
- t(n(P), { class: "size-4 text-sidebar-c-2" })
67
+ t(a(q), { class: "size-4 text-sidebar-c-2" })
77
68
  ])
78
69
  ]),
79
70
  default: s(() => [
80
71
  o(e.$slots, "default")
81
72
  ]),
82
- _: 3
83
- }, 16, ["aria-expanded", "disabled", "indent", "selected"])
73
+ _: 2
74
+ }, [
75
+ e.icon ? {
76
+ name: "icon",
77
+ fn: s(() => [
78
+ o(e.$slots, "icon", {}, () => [
79
+ t(a(F), {
80
+ icon: e.icon,
81
+ weight: "bold"
82
+ }, null, 8, ["icon"])
83
+ ])
84
+ ]),
85
+ key: "0"
86
+ } : void 0
87
+ ]), 1040, ["aria-expanded", "disabled", "indent", "selected"])
84
88
  ]),
85
- t(x, {
89
+ t(w, {
86
90
  duration: 300,
87
91
  enterActiveClass: "top-(--nested-items-offset)",
88
92
  leaveActiveClass: "top-(--nested-items-offset)",
89
- onEnter: $,
90
- onLeave: y
93
+ onEnter: S,
94
+ onLeave: $
91
95
  }, {
92
96
  default: s(() => [
93
- a.value ? (m(), f("div", F, [
94
- t(q, w(L(e.$attrs)), {
97
+ l.value ? (m(), f("div", G, [
98
+ t(E, P(R(e.$attrs)), {
95
99
  default: s(() => [
96
100
  o(e.$slots, "back", {}, () => [
97
101
  t(b, {
98
102
  is: "button",
99
- class: "text-sidebar-c-1 font-sidebar-active",
103
+ class: "text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1",
100
104
  onClick: B
101
105
  }, {
102
106
  icon: s(() => [
103
- t(n(R), { class: "size-4 -m-px text-sidebar-c-2" })
107
+ t(a(x), { class: "size-4 -m-px text-sidebar-c-2" })
104
108
  ]),
105
109
  default: s(() => [
106
110
  o(e.$slots, "back-label", {}, () => [
107
- d[0] || (d[0] = M("Back", -1))
111
+ d[0] || (d[0] = V("Back", -1))
108
112
  ])
109
113
  ]),
110
114
  _: 3
111
115
  })
112
116
  ]),
113
- t(E, { class: "h-3" }),
117
+ t(L, { class: "h-3" }),
114
118
  o(e.$slots, "items")
115
119
  ]),
116
120
  _: 3
117
121
  }, 16)
118
- ])) : A("", !0)
122
+ ])) : M("", !0)
119
123
  ]),
120
124
  _: 3
121
125
  })
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/components"
12
12
  },
13
- "version": "0.16.16",
13
+ "version": "0.16.18",
14
14
  "engines": {
15
15
  "node": ">=20"
16
16
  },
@@ -42,8 +42,8 @@
42
42
  "vue-component-type-helpers": "^3.0.4",
43
43
  "@scalar/code-highlight": "0.2.2",
44
44
  "@scalar/helpers": "0.2.6",
45
- "@scalar/oas-utils": "0.6.14",
46
45
  "@scalar/icons": "0.5.2",
46
+ "@scalar/oas-utils": "0.6.15",
47
47
  "@scalar/themes": "0.13.26",
48
48
  "@scalar/use-hooks": "0.3.5"
49
49
  },