@scalar/components 0.16.3 → 0.16.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.
Files changed (55) hide show
  1. package/dist/components/ScalarButton/ScalarButton.vue.js +27 -27
  2. package/dist/components/ScalarButton/types.d.ts +6 -6
  3. package/dist/components/ScalarButton/types.d.ts.map +1 -1
  4. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +25 -25
  5. package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.js +7 -7
  6. package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts +14 -16
  7. package/dist/components/ScalarLoading/ScalarLoading.vue.d.ts.map +1 -1
  8. package/dist/components/ScalarLoading/ScalarLoading.vue.js +3 -5
  9. package/dist/components/ScalarLoading/ScalarLoading.vue2.js +20 -58
  10. package/dist/components/ScalarLoading/index.d.ts +3 -1
  11. package/dist/components/ScalarLoading/index.d.ts.map +1 -1
  12. package/dist/components/ScalarLoading/types.d.ts +61 -0
  13. package/dist/components/ScalarLoading/types.d.ts.map +1 -0
  14. package/dist/components/ScalarLoading/useLoadingState.d.ts +16 -0
  15. package/dist/components/ScalarLoading/useLoadingState.d.ts.map +1 -0
  16. package/dist/components/ScalarLoading/useLoadingState.js +39 -0
  17. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts +2 -2
  18. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
  19. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +17 -17
  20. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +3 -0
  21. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
  22. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +66 -62
  23. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts +3 -0
  24. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts.map +1 -1
  25. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +63 -62
  26. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts +1 -1
  27. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts.map +1 -1
  28. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +16 -16
  29. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts.map +1 -1
  30. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.js +35 -35
  31. package/dist/components/ScalarThemeSwatches/ScalarThemeSwatches.vue.d.ts +15 -0
  32. package/dist/components/ScalarThemeSwatches/ScalarThemeSwatches.vue.d.ts.map +1 -0
  33. package/dist/components/ScalarThemeSwatches/ScalarThemeSwatches.vue.js +35 -0
  34. package/dist/components/ScalarThemeSwatches/ScalarThemeSwatches.vue2.js +4 -0
  35. package/dist/components/ScalarThemeSwatches/index.d.ts +3 -0
  36. package/dist/components/ScalarThemeSwatches/index.d.ts.map +1 -0
  37. package/dist/components/ScalarThemeSwatches/useThemeSwatches.d.ts +28 -0
  38. package/dist/components/ScalarThemeSwatches/useThemeSwatches.d.ts.map +1 -0
  39. package/dist/components/ScalarThemeSwatches/useThemeSwatches.js +33 -0
  40. package/dist/components/ScalarWrappingText/ScalarWrappingText.vue.d.ts +14 -0
  41. package/dist/components/ScalarWrappingText/ScalarWrappingText.vue.d.ts.map +1 -0
  42. package/dist/components/ScalarWrappingText/ScalarWrappingText.vue.js +25 -0
  43. package/dist/components/ScalarWrappingText/ScalarWrappingText.vue2.js +4 -0
  44. package/dist/components/ScalarWrappingText/constants.d.ts +13 -0
  45. package/dist/components/ScalarWrappingText/constants.d.ts.map +1 -0
  46. package/dist/components/ScalarWrappingText/constants.js +12 -0
  47. package/dist/components/ScalarWrappingText/index.d.ts +2 -0
  48. package/dist/components/ScalarWrappingText/index.d.ts.map +1 -0
  49. package/dist/components/ScalarWrappingText/types.d.ts +18 -0
  50. package/dist/components/ScalarWrappingText/types.d.ts.map +1 -0
  51. package/dist/index.d.ts +2 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +76 -70
  54. package/dist/style.css +1 -1
  55. package/package.json +10 -10
@@ -1,14 +1,14 @@
1
- import { defineComponent as p, mergeModels as f, useModel as m, ref as g, createElementBlock as h, openBlock as t, normalizeProps as v, guardReactiveProps as b, unref as e, createVNode as k, withDirectives as _, createBlock as n, createCommentVNode as y, createElementVNode as C, mergeProps as S, vModelText as V, withModifiers as M } from "vue";
1
+ import { defineComponent as p, mergeModels as f, useModel as m, ref as h, createElementBlock as v, openBlock as r, normalizeProps as g, guardReactiveProps as b, unref as e, createVNode as k, withDirectives as _, createBlock as n, createCommentVNode as y, createElementVNode as C, mergeProps as V, vModelText as M, withModifiers as S } from "vue";
2
2
  import { ScalarIconMagnifyingGlass as x } from "@scalar/icons";
3
3
  import { useBindCx as z } from "@scalar/use-hooks/useBindCx";
4
- import B from "../ScalarLoading/ScalarLoading.vue.js";
5
- import A from "../ScalarIconButton/ScalarIconButton.vue.js";
6
- const E = ["aria-label"], N = {}, q = /* @__PURE__ */ p({
4
+ import A from "../ScalarLoading/ScalarLoading.vue.js";
5
+ import B from "../ScalarIconButton/ScalarIconButton.vue.js";
6
+ const E = ["aria-label"], N = {}, D = /* @__PURE__ */ p({
7
7
  ...N,
8
8
  inheritAttrs: !1,
9
9
  __name: "ScalarSearchInput",
10
10
  props: /* @__PURE__ */ f({
11
- loading: {},
11
+ loader: {},
12
12
  label: {}
13
13
  }, {
14
14
  modelValue: {},
@@ -16,21 +16,21 @@ const E = ["aria-label"], N = {}, q = /* @__PURE__ */ p({
16
16
  }),
17
17
  emits: ["update:modelValue"],
18
18
  setup(s) {
19
- const a = m(s, "modelValue"), o = g(null);
19
+ const l = m(s, "modelValue"), o = h(null);
20
20
  function i() {
21
- a.value = "", o.value && o.value.focus();
21
+ l.value = "", o.value && o.value.focus();
22
22
  }
23
23
  const { stylingAttrsCx: c, otherAttrs: d } = z();
24
- return (l, r) => (t(), h("label", v(b(
24
+ return (a, t) => (r(), v("label", g(b(
25
25
  e(c)(
26
26
  "flex items-center text-lg font-medium h-10 pl-3 pr-1 py-2 gap-2.25"
27
27
  )
28
28
  )), [
29
29
  k(e(x), { class: "text-sidebar-c-search size-4" }),
30
- _(C("input", S({
30
+ _(C("input", V({
31
31
  ref_key: "inputRef",
32
32
  ref: o,
33
- "aria-label": l.label ?? "Enter search query",
33
+ "aria-label": a.label ?? "Enter search query",
34
34
  autocapitalize: "off",
35
35
  autocomplete: "off",
36
36
  autocorrect: "off",
@@ -39,26 +39,26 @@ const E = ["aria-label"], N = {}, q = /* @__PURE__ */ p({
39
39
  spellcheck: "false",
40
40
  type: "search"
41
41
  }, e(d), {
42
- "onUpdate:modelValue": r[0] || (r[0] = (u) => a.value = u)
42
+ "onUpdate:modelValue": t[0] || (t[0] = (u) => l.value = u)
43
43
  }), null, 16, E), [
44
- [V, a.value]
44
+ [M, l.value]
45
45
  ]),
46
- l.loading && l.loading.isLoading ? (t(), n(e(B), {
46
+ a.loader && a.loader.isActive ? (r(), n(e(A), {
47
47
  key: 0,
48
48
  class: "self-center",
49
- loadingState: l.loading,
49
+ loader: a.loader,
50
50
  size: "md"
51
- }, null, 8, ["loadingState"])) : a.value ? (t(), n(e(A), {
51
+ }, null, 8, ["loader"])) : l.value ? (r(), n(e(B), {
52
52
  key: 1,
53
53
  class: "p-0 size-5",
54
54
  icon: "Close",
55
55
  label: "Clear Search",
56
56
  thickness: "1.5",
57
- onClick: M(i, ["stop", "prevent"])
57
+ onClick: S(i, ["stop", "prevent"])
58
58
  })) : y("", !0)
59
59
  ], 16));
60
60
  }
61
61
  });
62
62
  export {
63
- q as default
63
+ D as default
64
64
  };
@@ -28,11 +28,14 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./
28
28
  open?: boolean;
29
29
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
30
30
  "update:open": (value: boolean) => any;
31
+ } & {
32
+ click: (event: MouseEvent) => any;
31
33
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
32
34
  controlled?: boolean;
33
35
  } & {
34
36
  open?: boolean;
35
37
  }> & Readonly<{
38
+ onClick?: ((event: MouseEvent) => any) | undefined;
36
39
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
37
40
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarGroupSlots>;
38
41
  export default _default;
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAuGA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;WAqBM,OAAO;;;;;;WAAP,OAAO;;;;AApBhB,wBAyKC;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":"AAsHA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;WAqCM,OAAO;;;;;;;;WAAP,OAAO;;;;;AApChB,wBAsLC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,15 +1,18 @@
1
- import { defineComponent as c, mergeModels as f, useModel as v, createElementBlock as b, openBlock as r, renderSlot as t, createBlock as y, createCommentVNode as g, unref as l, createVNode as s, mergeProps as d, createSlots as B, withCtx as n, resolveDynamicComponent as $, normalizeProps as C } from "vue";
1
+ import { defineComponent as f, mergeModels as r, useModel as v, createBlock as b, openBlock as d, resolveDynamicComponent as k, normalizeProps as y, guardReactiveProps as B, unref as n, withCtx as t, renderSlot as l, createElementBlock as g, createCommentVNode as $, createVNode as s, createSlots as C } from "vue";
2
2
  import { useBindCx as S } from "@scalar/use-hooks/useBindCx";
3
- import k from "./ScalarSidebarButton.vue.js";
4
- import _ from "./ScalarSidebarGroupToggle.vue.js";
5
- import h from "./ScalarSidebarIndent.vue.js";
6
- import { useSidebarGroups as x } from "./useSidebarGroups.js";
7
- const A = { class: "group/item flex flex-col gap-px" }, M = {}, D = /* @__PURE__ */ c({
8
- ...M,
3
+ import _ from "./ScalarSidebarButton.vue.js";
4
+ import h from "./ScalarSidebarGroupToggle.vue.js";
5
+ import x from "./ScalarSidebarIndent.vue.js";
6
+ import { useSidebarGroups as M } from "./useSidebarGroups.js";
7
+ const G = {
8
+ key: 0,
9
+ class: "group/items flex flex-col gap-px"
10
+ }, N = {}, E = /* @__PURE__ */ f({
11
+ ...N,
9
12
  inheritAttrs: !1,
10
13
  __name: "ScalarSidebarGroup",
11
- props: /* @__PURE__ */ f({
12
- is: { default: "ul" },
14
+ props: /* @__PURE__ */ r({
15
+ is: { default: "li" },
13
16
  icon: { type: [Object, Function] },
14
17
  active: { type: Boolean },
15
18
  selected: { type: Boolean },
@@ -20,62 +23,63 @@ const A = { class: "group/item flex flex-col gap-px" }, M = {}, D = /* @__PURE__
20
23
  open: { type: Boolean, default: !1 },
21
24
  openModifiers: {}
22
25
  }),
23
- emits: ["update:open"],
24
- setup(p) {
25
- const o = v(p, "open"), { level: a } = x({ increment: !0 }), { stylingAttrsCx: u, otherAttrs: m } = S();
26
- return (e, i) => (r(), b("li", A, [
27
- t(e.$slots, "button", {
28
- level: l(a),
29
- open: o.value
30
- }, () => [
31
- s(k, d({
32
- is: "button",
33
- active: e.active,
34
- "aria-expanded": o.value,
35
- class: "group/group-button",
36
- disabled: e.disabled,
37
- indent: l(a),
38
- selected: e.selected
39
- }, l(m), {
40
- onClick: i[0] || (i[0] = (G) => !e.controlled && (o.value = !o.value))
41
- }), B({
42
- indent: n(() => [
43
- s(h, {
44
- class: "mr-0",
45
- indent: l(a)
46
- }, null, 8, ["indent"])
47
- ]),
48
- icon: n(() => [
49
- t(e.$slots, "icon", { open: o.value }, () => [
50
- s(_, {
51
- class: "text-c-3",
52
- open: o.value
53
- }, null, 8, ["open"])
54
- ])
55
- ]),
56
- default: n(() => [
57
- t(e.$slots, "default", { open: o.value })
58
- ]),
59
- _: 2
60
- }, [
61
- e.$slots.aside ? {
62
- name: "aside",
63
- fn: n(() => [
64
- t(e.$slots, "aside", { open: o.value })
26
+ emits: /* @__PURE__ */ r(["click"], ["update:open"]),
27
+ setup(i, { emit: c }) {
28
+ const p = c, o = v(i, "open"), { level: a } = M({ increment: !0 }), { cx: u } = S(), m = (e) => {
29
+ p("click", e), i.controlled || (o.value = !o.value);
30
+ };
31
+ return (e, P) => (d(), b(k(e.is), y(B(n(u)("group/item flex flex-col gap-px"))), {
32
+ default: t(() => [
33
+ l(e.$slots, "button", {
34
+ level: n(a),
35
+ open: o.value
36
+ }, () => [
37
+ s(_, {
38
+ is: "button",
39
+ active: e.active,
40
+ "aria-expanded": o.value,
41
+ class: "group/group-button",
42
+ disabled: e.disabled,
43
+ indent: n(a),
44
+ selected: e.selected,
45
+ onClick: m
46
+ }, C({
47
+ indent: t(() => [
48
+ s(x, {
49
+ class: "mr-0",
50
+ indent: n(a)
51
+ }, null, 8, ["indent"])
65
52
  ]),
66
- key: "0"
67
- } : void 0
68
- ]), 1040, ["active", "aria-expanded", "disabled", "indent", "selected"])
69
- ]),
70
- o.value ? (r(), y($(e.is), C(d({ key: 0 }, l(u)("group/items flex flex-col gap-px"))), {
71
- default: n(() => [
72
- t(e.$slots, "items", { open: o.value })
53
+ icon: t(() => [
54
+ l(e.$slots, "icon", { open: o.value }, () => [
55
+ s(h, {
56
+ class: "text-c-3",
57
+ open: o.value
58
+ }, null, 8, ["open"])
59
+ ])
60
+ ]),
61
+ default: t(() => [
62
+ l(e.$slots, "default", { open: o.value })
63
+ ]),
64
+ _: 2
65
+ }, [
66
+ e.$slots.aside ? {
67
+ name: "aside",
68
+ fn: t(() => [
69
+ l(e.$slots, "aside", { open: o.value })
70
+ ]),
71
+ key: "0"
72
+ } : void 0
73
+ ]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"])
73
74
  ]),
74
- _: 3
75
- }, 16)) : g("", !0)
76
- ]));
75
+ o.value ? (d(), g("ul", G, [
76
+ l(e.$slots, "items", { open: o.value })
77
+ ])) : $("", !0)
78
+ ]),
79
+ _: 3
80
+ }, 16));
77
81
  }
78
82
  });
79
83
  export {
80
- D as default
84
+ E as default
81
85
  };
@@ -20,11 +20,14 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./
20
20
  open?: boolean;
21
21
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
22
  "update:open": (value: boolean) => any;
23
+ } & {
24
+ click: (event: MouseEvent) => any;
23
25
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
24
26
  controlled?: boolean;
25
27
  } & {
26
28
  open?: boolean;
27
29
  }> & Readonly<{
30
+ onClick?: ((event: MouseEvent) => any) | undefined;
28
31
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
29
32
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
30
33
  /** The text content of the button */
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyKA;;;;;;;;;;;;;;;GAeG;;;;WAgEM,OAAO;;;;;;WAAP,OAAO;;;;IAvDd,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;;AArBzB,wBAkSC;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,wBAkTC;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 y, mergeModels as C, useModel as k, useTemplateRef as g, ref as B, createElementBlock as d, openBlock as u, normalizeStyle as T, normalizeClass as z, renderSlot as o, createVNode as t, mergeProps as I, unref as r, withCtx as s, Transition as N, createCommentVNode as _, normalizeProps as A, guardReactiveProps as w, createTextVNode as L, nextTick as c } from "vue";
2
- import { ScalarIconArrowRight as M, ScalarIconCaretLeft as P, ScalarIconListDashes as R } from "@scalar/icons";
3
- import f from "./ScalarSidebarButton.vue.js";
4
- import V from "./ScalarSidebarItems.vue.js";
1
+ import { defineComponent as g, mergeModels as d, 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";
3
+ import p from "./ScalarSidebarButton.vue.js";
4
+ import q from "./ScalarSidebarItems.vue.js";
5
5
  /* empty css */
6
- import h from "./ScalarSidebarSpacer.vue.js";
7
- import { findScrollContainer as p } from "./findScrollContainer.js";
8
- import { useSidebarGroups as q } from "./useSidebarGroups.js";
9
- import { useSidebarNestedItem as E } from "./useSidebarNestedItems.js";
10
- import O from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
11
- const j = {
6
+ import x from "./ScalarSidebarSpacer.vue.js";
7
+ import { findScrollContainer as v } from "./findScrollContainer.js";
8
+ import { useSidebarGroups as E } from "./useSidebarGroups.js";
9
+ import { useSidebarNestedItem as O } from "./useSidebarNestedItems.js";
10
+ import j from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
11
+ const D = {
12
12
  key: 0,
13
13
  class: "absolute inset-0 translate-x-full"
14
- }, x = {}, Y = /* @__PURE__ */ y({
15
- ...x,
14
+ }, F = {}, te = /* @__PURE__ */ g({
15
+ ...F,
16
16
  inheritAttrs: !1,
17
17
  __name: "ScalarSidebarNestedItems",
18
- props: /* @__PURE__ */ C({
18
+ props: /* @__PURE__ */ d({
19
19
  is: {},
20
- icon: { type: [Object, Function], default: R },
20
+ icon: { type: [Object, Function], default: V },
21
21
  active: { type: Boolean },
22
22
  selected: { type: Boolean },
23
23
  disabled: { type: Boolean },
@@ -27,53 +27,54 @@ const j = {
27
27
  open: { type: Boolean, default: !1 },
28
28
  openModifiers: {}
29
29
  }),
30
- emits: ["update:open"],
31
- setup(m) {
32
- const l = k(m, "open");
33
- E(l);
34
- const { level: v } = q({ reset: !0 }), a = g("el"), i = B(0);
35
- function b() {
36
- i.value = p(a.value).scrollTop ?? 0, c(
37
- () => a.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
30
+ emits: /* @__PURE__ */ d(["click"], ["update:open"]),
31
+ setup(c, { emit: b }) {
32
+ const $ = b, o = B(c, "open");
33
+ O(o);
34
+ const { level: S } = E({ reset: !0 }), n = T("el"), i = _(0);
35
+ function k() {
36
+ i.value = v(n.value).scrollTop ?? 0, m(
37
+ () => n.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
38
38
  );
39
39
  }
40
- function $() {
41
- c(() => {
42
- a.value?.querySelector("button")?.focus({ preventScroll: !0 }), p(a.value).scrollTop = i.value;
40
+ function y() {
41
+ m(() => {
42
+ n.value?.querySelector("button")?.focus({ preventScroll: !0 }), v(n.value).scrollTop = i.value;
43
43
  });
44
44
  }
45
- return (e, n) => (u(), d("li", {
45
+ const C = (e) => {
46
+ $("click", e), c.controlled || (o.value = !o.value);
47
+ };
48
+ return (e, a) => (f(), u("li", {
46
49
  ref_key: "el",
47
- ref: a,
48
- class: z(["group/item group/nested-items contents", { "group/nested-items-open": l.value }]),
49
- style: T({ "--nested-items-offset": `${i.value}px` })
50
+ ref: n,
51
+ class: z(["group/item group/nested-items contents", { "group/nested-items-open": o.value }]),
52
+ style: h({ "--nested-items-offset": `${i.value}px` })
50
53
  }, [
51
- o(e.$slots, "button", {}, () => [
52
- t(f, I({
54
+ s(e.$slots, "button", {}, () => [
55
+ t(p, I({
53
56
  is: "button",
54
- "aria-expanded": l.value,
57
+ "aria-expanded": o.value,
55
58
  class: "text-c-1 font-sidebar-active",
56
59
  disabled: e.disabled,
57
- indent: r(v),
60
+ indent: r(S),
58
61
  selected: e.selected
59
- }, e.$attrs, {
60
- onClick: n[0] || (n[0] = (S) => !e.controlled && (l.value = !0))
61
- }), {
62
- icon: s(() => [
63
- o(e.$slots, "icon", {}, () => [
64
- t(r(O), {
62
+ }, e.$attrs, { onClick: C }), {
63
+ icon: l(() => [
64
+ s(e.$slots, "icon", {}, () => [
65
+ t(r(j), {
65
66
  icon: e.icon,
66
67
  weight: "bold"
67
68
  }, null, 8, ["icon"])
68
69
  ])
69
70
  ]),
70
- aside: s(() => [
71
- o(e.$slots, "aside", {}, () => [
72
- t(r(M), { class: "size-4 text-c-2" })
71
+ aside: l(() => [
72
+ s(e.$slots, "aside", {}, () => [
73
+ t(r(P), { class: "size-4 text-c-2" })
73
74
  ])
74
75
  ]),
75
- default: s(() => [
76
- o(e.$slots, "default")
76
+ default: l(() => [
77
+ s(e.$slots, "default")
77
78
  ]),
78
79
  _: 3
79
80
  }, 16, ["aria-expanded", "disabled", "indent", "selected"])
@@ -82,36 +83,36 @@ const j = {
82
83
  duration: 300,
83
84
  enterActiveClass: "top-(--nested-items-offset)",
84
85
  leaveActiveClass: "top-(--nested-items-offset)",
85
- onEnter: b,
86
- onLeave: $
86
+ onEnter: k,
87
+ onLeave: y
87
88
  }, {
88
- default: s(() => [
89
- l.value ? (u(), d("div", j, [
90
- t(V, A(w(e.$attrs)), {
91
- default: s(() => [
92
- o(e.$slots, "back", {}, () => [
93
- t(f, {
89
+ default: l(() => [
90
+ o.value ? (f(), u("div", D, [
91
+ t(q, w(L(e.$attrs)), {
92
+ default: l(() => [
93
+ s(e.$slots, "back", {}, () => [
94
+ t(p, {
94
95
  is: "button",
95
96
  class: "text-c-1 font-sidebar-active",
96
- onClick: n[1] || (n[1] = (S) => !e.controlled && (l.value = !1))
97
+ onClick: a[0] || (a[0] = (G) => !e.controlled && (o.value = !1))
97
98
  }, {
98
- icon: s(() => [
99
- t(r(P), { class: "size-4 -m-px text-c-2" })
99
+ icon: l(() => [
100
+ t(r(R), { class: "size-4 -m-px text-c-2" })
100
101
  ]),
101
- default: s(() => [
102
- o(e.$slots, "back-label", {}, () => [
103
- n[2] || (n[2] = L("Back", -1))
102
+ default: l(() => [
103
+ s(e.$slots, "back-label", {}, () => [
104
+ a[1] || (a[1] = M("Back", -1))
104
105
  ])
105
106
  ]),
106
107
  _: 3
107
108
  })
108
109
  ]),
109
- t(h, { class: "h-3" }),
110
- o(e.$slots, "items")
110
+ t(x, { class: "h-3" }),
111
+ s(e.$slots, "items")
111
112
  ]),
112
113
  _: 3
113
114
  }, 16)
114
- ])) : _("", !0)
115
+ ])) : A("", !0)
115
116
  ]),
116
117
  _: 3
117
118
  })
@@ -119,5 +120,5 @@ const j = {
119
120
  }
120
121
  });
121
122
  export {
122
- Y as default
123
+ te as default
123
124
  };
@@ -1,7 +1,7 @@
1
1
  import { type LoadingState } from '../ScalarLoading';
2
2
  type __VLS_Props = {
3
3
  autofocus?: boolean;
4
- loading?: LoadingState;
4
+ loader?: LoadingState;
5
5
  label?: string;
6
6
  };
7
7
  type __VLS_PublicProps = __VLS_Props & {
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"names":[],"mappings":"AA0EA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAEnE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAwBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;;;;;;AA4HF,wBAOG"}
1
+ {"version":3,"file":"ScalarSidebarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"names":[],"mappings":"AA0EA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAEnE,KAAK,WAAW,GAAG;IACjB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;AAwBF,KAAK,iBAAiB,GAAG,WAAW,GAAG;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;;;;;;AA4HF,wBAOG"}
@@ -1,14 +1,14 @@
1
- import { defineComponent as f, mergeModels as p, ref as m, useModel as b, onMounted as h, createElementBlock as g, openBlock as r, normalizeProps as v, guardReactiveProps as S, unref as e, createVNode as k, withDirectives as y, createBlock as s, createCommentVNode as x, createElementVNode as C, mergeProps as M, vModelText as V, withModifiers as z } from "vue";
2
- import { ScalarIconMagnifyingGlass as B, ScalarIconX as w } from "@scalar/icons";
3
- import { useBindCx as A } from "@scalar/use-hooks/useBindCx";
1
+ import { defineComponent as f, mergeModels as p, ref as m, useModel as b, onMounted as h, createElementBlock as v, openBlock as l, normalizeProps as g, guardReactiveProps as k, unref as e, createVNode as y, withDirectives as S, createBlock as n, createCommentVNode as x, createElementVNode as C, mergeProps as M, vModelText as V, withModifiers as z } from "vue";
2
+ import { ScalarIconMagnifyingGlass as B, ScalarIconX as A } from "@scalar/icons";
3
+ import { useBindCx as w } from "@scalar/use-hooks/useBindCx";
4
4
  import E from "../ScalarLoading/ScalarLoading.vue.js";
5
5
  import I from "../ScalarIconButton/ScalarIconButton.vue.js";
6
- const N = ["aria-label"], D = /* @__PURE__ */ f({
6
+ const N = ["aria-label"], G = /* @__PURE__ */ f({
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarSidebarSearchInput",
9
9
  props: /* @__PURE__ */ p({
10
10
  autofocus: { type: Boolean },
11
- loading: {},
11
+ loader: {},
12
12
  label: {}
13
13
  }, {
14
14
  modelValue: {},
@@ -20,19 +20,19 @@ const N = ["aria-label"], D = /* @__PURE__ */ f({
20
20
  function i() {
21
21
  a.value = "", o.value && o.value.focus();
22
22
  }
23
- const { stylingAttrsCx: c, otherAttrs: u } = A();
24
- return h(() => t.autofocus && o.value?.focus()), (l, n) => (r(), g("label", v(S(
23
+ const { stylingAttrsCx: c, otherAttrs: u } = w();
24
+ return h(() => t.autofocus && o.value?.focus()), (r, s) => (l(), v("label", g(k(
25
25
  e(c)(
26
26
  "flex items-center rounded border text-base has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5",
27
27
  "bg-sidebar-b-search border-sidebar-border-search",
28
28
  a.value ? "text-c-1" : "text-sidebar-c-search"
29
29
  )
30
30
  )), [
31
- k(e(B), { class: "text-sidebar-c-search size-4" }),
32
- y(C("input", M({
31
+ y(e(B), { class: "text-sidebar-c-search size-4" }),
32
+ S(C("input", M({
33
33
  ref_key: "inputRef",
34
34
  ref: o,
35
- "aria-label": l.label ?? "Enter search query",
35
+ "aria-label": r.label ?? "Enter search query",
36
36
  autocapitalize: "off",
37
37
  autocomplete: "off",
38
38
  autocorrect: "off",
@@ -41,19 +41,19 @@ const N = ["aria-label"], D = /* @__PURE__ */ f({
41
41
  spellcheck: "false",
42
42
  type: "search"
43
43
  }, e(u), {
44
- "onUpdate:modelValue": n[0] || (n[0] = (d) => a.value = d)
44
+ "onUpdate:modelValue": s[0] || (s[0] = (d) => a.value = d)
45
45
  }), null, 16, N), [
46
46
  [V, a.value]
47
47
  ]),
48
- l.loading && l.loading.isLoading ? (r(), s(e(E), {
48
+ r.loader && r.loader.isActive ? (l(), n(e(E), {
49
49
  key: 0,
50
50
  class: "mr-3 self-center",
51
- loadingState: l.loading,
51
+ loader: r.loader,
52
52
  size: "md"
53
- }, null, 8, ["loadingState"])) : a.value ? (r(), s(e(I), {
53
+ }, null, 8, ["loader"])) : a.value ? (l(), n(e(I), {
54
54
  key: 1,
55
55
  class: "p-0.25 size-4",
56
- icon: e(w),
56
+ icon: e(A),
57
57
  weight: "bold",
58
58
  label: "Clear Search",
59
59
  onClick: z(i, ["stop", "prevent"])
@@ -62,5 +62,5 @@ const N = ["aria-label"], D = /* @__PURE__ */ f({
62
62
  }
63
63
  });
64
64
  export {
65
- D as default
65
+ G as default
66
66
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIrD;;;;;;;;;;;;;;;;;GAiBG;;IAMD,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;;AARnB,wBA0HC;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":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIrD;;;;;;;;;;;;;;;;;GAiBG;;IAMD,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;;AARnB,wBA2HC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}