@scalar/components 0.16.19 → 0.16.22

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 (74) hide show
  1. package/dist/components/ScalarButton/ScalarButton.vue.js +28 -28
  2. package/dist/components/ScalarCard/useCardHeading.js +1 -1
  3. package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.js +7 -7
  4. package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.js +15 -15
  5. package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.js +10 -10
  6. package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.js +15 -15
  7. package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.js +6 -6
  8. package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue2.js +20 -20
  9. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggle.vue.js +7 -7
  10. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +13 -13
  11. package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +20 -20
  12. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +25 -25
  13. package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js +9 -9
  14. package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.js +9 -9
  15. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +51 -51
  16. package/dist/components/ScalarContextMenu/ScalarContextMenu.vue.js +8 -8
  17. package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +36 -36
  18. package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +11 -11
  19. package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +14 -14
  20. package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +12 -12
  21. package/dist/components/ScalarDropdown/useDropdown.js +1 -1
  22. package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +47 -47
  23. package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.js +23 -23
  24. package/dist/components/ScalarFileUpload/ScalarFileUploadInputCompact.vue.js +17 -17
  25. package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.js +9 -9
  26. package/dist/components/ScalarFloating/ScalarFloating.vue.js +30 -30
  27. package/dist/components/ScalarForm/ScalarFormError.vue.js +8 -8
  28. package/dist/components/ScalarForm/ScalarFormField.vue.js +14 -14
  29. package/dist/components/ScalarForm/ScalarFormInput.vue.js +9 -9
  30. package/dist/components/ScalarForm/ScalarFormInputGroup.vue.js +8 -8
  31. package/dist/components/ScalarForm/useFormGroups.js +1 -1
  32. package/dist/components/ScalarHeader/ScalarHeaderButton.vue.js +12 -12
  33. package/dist/components/ScalarIcon/ScalarIcon.vue2.js +8 -8
  34. package/dist/components/ScalarIcon/ScalarIconLegacyAdapter.vue.js +10 -10
  35. package/dist/components/ScalarIconButton/ScalarIconButton.vue.js +18 -18
  36. package/dist/components/ScalarListbox/ScalarListbox.vue.js +28 -28
  37. package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +9 -9
  38. package/dist/components/ScalarListbox/ScalarListboxInput.vue.js +11 -11
  39. package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +10 -10
  40. package/dist/components/ScalarLoading/ScalarLoading.vue2.js +13 -13
  41. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +13 -13
  42. package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +16 -16
  43. package/dist/components/ScalarMenu/ScalarMenuButton.vue.js +16 -16
  44. package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +17 -17
  45. package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js +11 -11
  46. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +24 -24
  47. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +17 -17
  48. package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.js +14 -14
  49. package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.js +8 -8
  50. package/dist/components/ScalarModal/ScalarModal.vue2.js +34 -34
  51. package/dist/components/ScalarPopover/ScalarPopover.vue.js +25 -25
  52. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +26 -26
  53. package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +30 -30
  54. package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js +8 -8
  55. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +24 -24
  56. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +51 -51
  57. package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +18 -18
  58. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +14 -14
  59. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +7 -7
  60. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +12 -12
  61. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +46 -46
  62. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +30 -30
  63. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.js +18 -18
  64. package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.js +8 -8
  65. package/dist/components/ScalarSidebar/useSidebarGroups.js +1 -1
  66. package/dist/components/ScalarSidebar/useSidebarNestedItems.js +1 -1
  67. package/dist/components/ScalarTeleport/ScalarTeleport.vue.js +12 -12
  68. package/dist/components/ScalarTeleport/useTeleport.js +1 -1
  69. package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +34 -34
  70. package/dist/components/ScalarToggle/ScalarToggle.vue.js +20 -20
  71. package/dist/components/ScalarToggle/ScalarToggleGroup.vue.js +14 -14
  72. package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.js +25 -25
  73. package/dist/style.css +1 -1
  74. package/package.json +11 -11
@@ -1,9 +1,9 @@
1
- import { defineComponent as m, createBlock as i, openBlock as c, unref as e, withCtx as t, createVNode as r, normalizeProps as u, guardReactiveProps as d, renderSlot as s, mergeProps as _ } from "vue";
2
- import { Popover as P, PopoverButton as v, PopoverPanel as B } from "@headlessui/vue";
3
- import { useBindCx as y } from "@scalar/use-hooks/useBindCx";
4
- import $ from "../ScalarFloating/ScalarFloating.vue.js";
5
- import g from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
6
- const z = /* @__PURE__ */ m({
1
+ import { defineComponent as c, createBlock as i, openBlock as u, unref as e, withCtx as o, createVNode as r, normalizeProps as d, guardReactiveProps as _, renderSlot as l, mergeProps as P } from "vue";
2
+ import { Popover as v, PopoverButton as B, PopoverPanel as y } from "@headlessui/vue";
3
+ import { useBindCx as $ } from "@scalar/use-hooks/useBindCx";
4
+ import g from "../ScalarFloating/ScalarFloating.vue.js";
5
+ import b from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
6
+ const z = /* @__PURE__ */ c({
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarPopover",
9
9
  props: {
@@ -15,32 +15,32 @@ const z = /* @__PURE__ */ m({
15
15
  middleware: {},
16
16
  teleport: { type: [Boolean, String] }
17
17
  },
18
- setup(b) {
19
- const { cx: l } = y();
20
- return (o, h) => (c(), i(e(P), { as: "template" }, {
21
- default: t(({ open: a }) => [
22
- r(e($), u(d(o.$props)), {
23
- floating: t(({ width: p, height: f }) => [
24
- r(e(B), _({
25
- focus: o.focus,
26
- style: { width: p, height: f }
27
- }, e(l)("relative flex flex-col p-0.75")), {
28
- default: t(({ close: n }) => [
29
- s(o.$slots, "popover", {
30
- close: () => n(),
18
+ setup(s) {
19
+ const { cx: p } = $();
20
+ return (t, h) => (u(), i(e(v), { as: "template" }, {
21
+ default: o(({ open: a }) => [
22
+ r(e(g), d(_(t.$props)), {
23
+ floating: o(({ width: f, height: n }) => [
24
+ r(e(y), P({
25
+ focus: s.focus,
26
+ style: { width: f, height: n }
27
+ }, e(p)("relative flex flex-col p-0.75")), {
28
+ default: o(({ close: m }) => [
29
+ l(t.$slots, "popover", {
30
+ close: () => m(),
31
31
  open: a
32
32
  }),
33
- s(o.$slots, "backdrop", { open: a }, () => [
34
- r(e(g))
33
+ l(t.$slots, "backdrop", { open: a }, () => [
34
+ r(e(b))
35
35
  ])
36
36
  ]),
37
37
  _: 2
38
38
  }, 1040, ["focus", "style"])
39
39
  ]),
40
- default: t(() => [
41
- r(e(v), { as: "template" }, {
42
- default: t(() => [
43
- s(o.$slots, "default", { open: a })
40
+ default: o(() => [
41
+ r(e(B), { as: "template" }, {
42
+ default: o(() => [
43
+ l(t.$slots, "default", { open: a })
44
44
  ]),
45
45
  _: 2
46
46
  }, 1024)
@@ -1,10 +1,10 @@
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
- import { ScalarIconMagnifyingGlass as x } from "@scalar/icons";
1
+ import { defineComponent as u, mergeModels as f, useModel as m, ref as p, createElementBlock as h, openBlock as o, normalizeProps as v, guardReactiveProps as g, unref as l, createVNode as b, withDirectives as k, createBlock as n, createCommentVNode as x, createElementVNode as y, mergeProps as C, vModelText as V, withModifiers as M } from "vue";
2
+ import { ScalarIconMagnifyingGlass as S } from "@scalar/icons";
3
3
  import { useBindCx as z } from "@scalar/use-hooks/useBindCx";
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
- ...N,
4
+ import _ from "../ScalarLoading/ScalarLoading.vue.js";
5
+ import A from "../ScalarIconButton/ScalarIconButton.vue.js";
6
+ const B = ["aria-label"], E = {}, D = /* @__PURE__ */ u({
7
+ ...E,
8
8
  inheritAttrs: !1,
9
9
  __name: "ScalarSearchInput",
10
10
  props: /* @__PURE__ */ f({
@@ -15,24 +15,24 @@ const E = ["aria-label"], N = {}, D = /* @__PURE__ */ p({
15
15
  modelModifiers: {}
16
16
  }),
17
17
  emits: ["update:modelValue"],
18
- setup(s) {
19
- const l = m(s, "modelValue"), o = h(null);
20
- function i() {
21
- l.value = "", o.value && o.value.focus();
18
+ setup(e) {
19
+ const a = m(e, "modelValue"), t = p(null);
20
+ function s() {
21
+ a.value = "", t.value && t.value.focus();
22
22
  }
23
- const { stylingAttrsCx: c, otherAttrs: d } = z();
24
- return (a, t) => (r(), v("label", g(b(
25
- e(c)(
23
+ const { stylingAttrsCx: c, otherAttrs: i } = z();
24
+ return (N, r) => (o(), h("label", v(g(
25
+ l(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
- k(e(x), { class: "text-sidebar-c-search size-4" }),
30
- _(C("input", V({
29
+ b(l(S), { class: "text-sidebar-c-search size-4" }),
30
+ k(y("input", C({
31
31
  ref_key: "inputRef",
32
- ref: o
33
- }, e(d), {
34
- "onUpdate:modelValue": t[0] || (t[0] = (u) => l.value = u),
35
- "aria-label": a.label ?? "Enter search query",
32
+ ref: t
33
+ }, l(i), {
34
+ "onUpdate:modelValue": r[0] || (r[0] = (d) => a.value = d),
35
+ "aria-label": e.label ?? "Enter search query",
36
36
  autocapitalize: "off",
37
37
  autocomplete: "off",
38
38
  autocorrect: "off",
@@ -40,22 +40,22 @@ const E = ["aria-label"], N = {}, D = /* @__PURE__ */ p({
40
40
  placeholder: "Search...",
41
41
  spellcheck: "false",
42
42
  type: "search"
43
- }), null, 16, E), [
44
- [M, l.value]
43
+ }), null, 16, B), [
44
+ [V, a.value]
45
45
  ]),
46
- a.loader && a.loader.isActive ? (r(), n(e(A), {
46
+ e.loader && e.loader.isActive ? (o(), n(l(_), {
47
47
  key: 0,
48
48
  class: "self-center",
49
- loader: a.loader,
49
+ loader: e.loader,
50
50
  size: "md"
51
- }, null, 8, ["loader"])) : l.value ? (r(), n(e(B), {
51
+ }, null, 8, ["loader"])) : a.value ? (o(), n(l(A), {
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: S(i, ["stop", "prevent"])
58
- })) : y("", !0)
57
+ onClick: M(s, ["stop", "prevent"])
58
+ })) : x("", !0)
59
59
  ], 16));
60
60
  }
61
61
  });
@@ -1,59 +1,59 @@
1
- import { defineComponent as c, createElementBlock as o, openBlock as t, mergeProps as d, unref as l, createCommentVNode as s, createElementVNode as n, renderSlot as r, createBlock as m } from "vue";
2
- import { useBindCx as p } from "@scalar/use-hooks/useBindCx";
3
- import u from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
4
- const f = ["aria-selected"], h = {
1
+ import { defineComponent as d, createElementBlock as s, openBlock as o, mergeProps as m, unref as l, createCommentVNode as n, createElementVNode as c, renderSlot as i, createBlock as u } from "vue";
2
+ import { useBindCx as f } from "@scalar/use-hooks/useBindCx";
3
+ import p from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
4
+ const x = ["aria-selected"], h = {
5
5
  key: 0,
6
6
  class: "flex h-fit items-center text-sm font-medium text-c-3 group-hover:text-c-1"
7
- }, b = { class: "flex min-w-0 flex-1 flex-col gap-0.75" }, _ = { class: "flex items-center gap-1" }, x = { class: "flex-1 truncate zoomed:!whitespace-normal break-words text-base font-medium" }, k = {
7
+ }, b = { class: "flex min-w-0 flex-1 flex-col gap-0.75" }, k = { class: "flex items-center gap-1" }, g = { class: "flex-1 truncate zoomed:!whitespace-normal break-words text-base font-medium" }, v = {
8
8
  key: 0,
9
9
  class: "text-base text-c-2"
10
- }, g = {
10
+ }, y = {
11
11
  key: 0,
12
12
  class: "truncate zoomed:!whitespace-normal break-words text-base text-c-2"
13
- }, B = /* @__PURE__ */ c({
13
+ }, B = /* @__PURE__ */ d({
14
14
  inheritAttrs: !1,
15
15
  __name: "ScalarSearchResultItem",
16
16
  props: {
17
17
  icon: { type: [Object, Function] },
18
18
  selected: { type: Boolean }
19
19
  },
20
- setup(v) {
21
- const { cx: a } = p();
22
- return (e, i) => (t(), o("a", d(
20
+ setup(t) {
21
+ const { cx: a } = f();
22
+ return (e, r) => (o(), s("a", m(
23
23
  {
24
- "aria-selected": e.selected,
24
+ "aria-selected": t.selected,
25
25
  role: "option",
26
26
  tabindex: "-1"
27
27
  },
28
28
  l(a)(
29
29
  "group flex cursor-pointer gap-2 rounded px-2 py-1.5 no-underline hover:bg-b-2",
30
- { "bg-b-2": e.selected }
30
+ { "bg-b-2": t.selected }
31
31
  )
32
32
  ), [
33
- e.icon ? (t(), o("div", h, [
34
- r(e.$slots, "icon", {}, () => [
35
- e.icon ? (t(), m(l(u), {
33
+ t.icon ? (o(), s("div", h, [
34
+ i(e.$slots, "icon", {}, () => [
35
+ t.icon ? (o(), u(l(p), {
36
36
  key: 0,
37
37
  class: "size-4",
38
- icon: e.icon
39
- }, null, 8, ["icon"])) : s("", !0)
38
+ icon: t.icon
39
+ }, null, 8, ["icon"])) : n("", !0)
40
40
  ]),
41
- i[0] || (i[0] = n("span", null, " ", -1))
42
- ])) : s("", !0),
43
- n("div", b, [
44
- n("div", _, [
45
- n("div", x, [
46
- r(e.$slots, "default")
41
+ r[0] || (r[0] = c("span", null, " ", -1))
42
+ ])) : n("", !0),
43
+ c("div", b, [
44
+ c("div", k, [
45
+ c("div", g, [
46
+ i(e.$slots, "default")
47
47
  ]),
48
- e.$slots.addon ? (t(), o("div", k, [
49
- r(e.$slots, "addon")
50
- ])) : s("", !0)
48
+ e.$slots.addon ? (o(), s("div", v, [
49
+ i(e.$slots, "addon")
50
+ ])) : n("", !0)
51
51
  ]),
52
- e.$slots.description ? (t(), o("div", g, [
53
- r(e.$slots, "description")
54
- ])) : s("", !0)
52
+ e.$slots.description ? (o(), s("div", y, [
53
+ i(e.$slots, "description")
54
+ ])) : n("", !0)
55
55
  ])
56
- ], 16, f));
56
+ ], 16, x));
57
57
  }
58
58
  });
59
59
  export {
@@ -1,22 +1,22 @@
1
- import { defineComponent as r, createElementBlock as n, openBlock as a, mergeProps as m, unref as p, renderSlot as o, createCommentVNode as u, createElementVNode as s } from "vue";
2
- import { useBindCx as f } from "@scalar/use-hooks/useBindCx";
3
- const x = /* @__PURE__ */ r({
1
+ import { defineComponent as n, createElementBlock as a, openBlock as m, mergeProps as u, unref as c, renderSlot as o, createCommentVNode as f, createElementVNode as s } from "vue";
2
+ import { useBindCx as i } from "@scalar/use-hooks/useBindCx";
3
+ const x = /* @__PURE__ */ n({
4
4
  inheritAttrs: !1,
5
5
  __name: "ScalarSearchResultList",
6
6
  props: {
7
7
  noResults: { type: Boolean }
8
8
  },
9
- setup(i) {
10
- const { cx: l } = f();
11
- return (e, t) => (a(), n("div", m({ role: "listbox" }, p(l)("flex flex-col")), [
12
- e.noResults ? o(e.$slots, "noResults", { key: 0 }, () => [
9
+ setup(l) {
10
+ const { cx: r } = i();
11
+ return (e, t) => (m(), a("div", u({ role: "listbox" }, c(r)("flex flex-col")), [
12
+ l.noResults ? o(e.$slots, "noResults", { key: 0 }, () => [
13
13
  t[0] || (t[0] = s("div", { class: "flex flex-col items-center gap-2 px-3 py-4" }, [
14
14
  s("div", {
15
15
  class: "text-base font-medium text-c-2",
16
16
  role: "alert"
17
17
  }, " No results found ")
18
18
  ], -1))
19
- ]) : u("", !0),
19
+ ]) : f("", !0),
20
20
  o(e.$slots, "default")
21
21
  ], 16));
22
22
  }
@@ -1,12 +1,12 @@
1
- import { defineComponent as l, createBlock as o, openBlock as a, resolveDynamicComponent as n, mergeProps as c, unref as s, withCtx as b, renderSlot as t, createElementBlock as u, createCommentVNode as i, createElementVNode as f, createVNode as p } from "vue";
2
- import { cva as v, useBindCx as m } from "@scalar/use-hooks/useBindCx";
3
- import h from "./ScalarSidebarIndent.vue.js";
4
- import y from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
5
- const B = {
1
+ import { defineComponent as c, createBlock as d, openBlock as s, resolveDynamicComponent as r, mergeProps as b, unref as i, withCtx as u, renderSlot as a, createElementBlock as f, createCommentVNode as l, createElementVNode as v, createVNode as m } from "vue";
2
+ import { cva as h, useBindCx as y } from "@scalar/use-hooks/useBindCx";
3
+ import B from "./ScalarSidebarIndent.vue.js";
4
+ import x from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
5
+ const g = {
6
6
  key: 0,
7
7
  class: "h-[1lh] *:size-4 mr-1"
8
- }, g = { class: "group/button-label flex-1 min-w-0" }, k = {}, E = /* @__PURE__ */ l({
9
- ...k,
8
+ }, k = { class: "group/button-label flex-1 min-w-0" }, $ = {}, p = /* @__PURE__ */ c({
9
+ ...$,
10
10
  inheritAttrs: !1,
11
11
  __name: "ScalarSidebarButton",
12
12
  props: {
@@ -17,8 +17,8 @@ const B = {
17
17
  disabled: { type: Boolean },
18
18
  indent: { default: 0 }
19
19
  },
20
- setup($) {
21
- const d = v({
20
+ setup(e) {
21
+ const n = h({
22
22
  base: [
23
23
  "group/button peer/button flex items-stretch rounded p-2",
24
24
  "font-sidebar text-base/5 text-sidebar-c-2 no-underline wrap-break-word"
@@ -45,37 +45,37 @@ const B = {
45
45
  }
46
46
  ],
47
47
  defaultVariants: { selected: !1, disabled: !1, active: !1 }
48
- }), { cx: r } = m();
49
- return (e, C) => (a(), o(n(e.is), c({
48
+ }), { cx: o } = y();
49
+ return (t, C) => (s(), d(r(e.is), b({
50
50
  "aria-selected": e.selected,
51
51
  type: e.is === "button" ? "button" : void 0
52
- }, s(r)(s(d)({ selected: e.selected, disabled: e.disabled, active: e.active }))), {
53
- default: b(() => [
54
- t(e.$slots, "indent", {}, () => [
55
- p(h, {
52
+ }, i(o)(i(n)({ selected: e.selected, disabled: e.disabled, active: e.active }))), {
53
+ default: u(() => [
54
+ a(t.$slots, "indent", {}, () => [
55
+ m(B, {
56
56
  class: "-my-2",
57
57
  disabled: e.disabled,
58
58
  indent: e.indent,
59
59
  selected: e.selected
60
60
  }, null, 8, ["disabled", "indent", "selected"])
61
61
  ]),
62
- e.icon || e.$slots.icon ? (a(), u("div", B, [
63
- t(e.$slots, "icon", {}, () => [
64
- e.icon ? (a(), o(s(y), {
62
+ e.icon || t.$slots.icon ? (s(), f("div", g, [
63
+ a(t.$slots, "icon", {}, () => [
64
+ e.icon ? (s(), d(i(x), {
65
65
  key: 0,
66
66
  icon: e.icon
67
- }, null, 8, ["icon"])) : i("", !0)
67
+ }, null, 8, ["icon"])) : l("", !0)
68
68
  ])
69
- ])) : i("", !0),
70
- f("div", g, [
71
- t(e.$slots, "default")
69
+ ])) : l("", !0),
70
+ v("div", k, [
71
+ a(t.$slots, "default")
72
72
  ]),
73
- t(e.$slots, "aside")
73
+ a(t.$slots, "aside")
74
74
  ]),
75
75
  _: 3
76
76
  }, 16, ["aria-selected", "type"]));
77
77
  }
78
78
  });
79
79
  export {
80
- E as default
80
+ p as default
81
81
  };
@@ -1,7 +1,7 @@
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 d, createCommentVNode as p, renderSlot as l, createVNode as r, normalizeStyle as x, normalizeClass as z, createTextVNode as N, toDisplayString as V, createSlots as M } from "vue";
1
+ import { defineComponent as g, mergeModels as u, useModel as h, createBlock as x, openBlock as s, resolveDynamicComponent as k, normalizeProps as $, guardReactiveProps as B, unref as n, withCtx as a, createElementVNode as C, createElementBlock as c, createCommentVNode as v, renderSlot as o, createVNode as d, normalizeStyle as S, normalizeClass as z, createTextVNode as N, toDisplayString as V, createSlots as M } from "vue";
2
2
  import { useBindCx as D } from "@scalar/use-hooks/useBindCx";
3
3
  import E from "./ScalarSidebarButton.vue.js";
4
- import v from "./ScalarSidebarGroupToggle.vue.js";
4
+ import m from "./ScalarSidebarGroupToggle.vue.js";
5
5
  import G from "./ScalarSidebarIndent.vue.js";
6
6
  import { useSidebarGroups as O } from "./useSidebarGroups.js";
7
7
  const P = { class: "group/group-button relative flex flex-col leading-5" }, T = ["aria-expanded"], j = {
@@ -28,91 +28,91 @@ const P = { class: "group/group-button relative flex flex-col leading-5" }, T =
28
28
  openModifiers: {}
29
29
  }),
30
30
  emits: /* @__PURE__ */ u(["click", "toggle"], ["update:open"]),
31
- setup(a, { emit: m }) {
32
- const c = m, o = h(a, "open"), { level: s } = O({ increment: !0 }), { cx: f } = D(), 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);
31
+ setup(t, { emit: f }) {
32
+ const r = f, e = h(t, "open"), { level: i } = O({ increment: !0 }), { cx: p } = D(), b = (l) => {
33
+ r("click", l), !t.controlled && !t.discrete && (e.value = !e.value);
34
+ }, y = (l) => {
35
+ r("toggle", l), !t.controlled && t.discrete && (e.value = !e.value);
36
36
  };
37
- return (e, F) => (i(), k($(e.is), B(C(n(f)("group/item flex flex-col gap-px"))), {
38
- default: t(() => [
39
- S("div", P, [
40
- l(e.$slots, "before", { open: o.value }),
41
- l(e.$slots, "button", {
42
- level: n(s),
43
- open: o.value
37
+ return (l, F) => (s(), x(k(t.is), $(B(n(p)("group/item flex flex-col gap-px"))), {
38
+ default: a(() => [
39
+ C("div", P, [
40
+ o(l.$slots, "before", { open: e.value }),
41
+ o(l.$slots, "button", {
42
+ level: n(i),
43
+ open: e.value
44
44
  }, () => [
45
- e.discrete ? (i(), d("button", {
45
+ t.discrete ? (s(), c("button", {
46
46
  key: 0,
47
47
  type: "button",
48
- "aria-expanded": o.value,
48
+ "aria-expanded": e.value,
49
49
  class: z([
50
50
  "absolute top-[1lh] -translate-y-1/2 p-0.75 rounded left-[calc(4px+var(--scalar-sidebar-indent)*var(--scalar-sidebar-level))]",
51
- e.selected ? "text-sidebar-c-1 hover:bg-sidebar-b-1 hover:text-sidebar-c-1" : "text-c-3 hover:bg-sidebar-b-hover hover:text-sidebar-c-hover"
51
+ t.selected ? "text-sidebar-c-1 hover:bg-sidebar-b-1 hover:text-sidebar-c-1" : "text-c-3 hover:bg-sidebar-b-hover hover:text-sidebar-c-hover"
52
52
  ]),
53
- style: x({ "--scalar-sidebar-level": n(s) }),
53
+ style: S({ "--scalar-sidebar-level": n(i) }),
54
54
  onClick: y
55
55
  }, [
56
- l(e.$slots, "icon", { open: o.value }, () => [
57
- r(v, {
58
- icon: e.icon,
59
- open: o.value
56
+ o(l.$slots, "icon", { open: e.value }, () => [
57
+ d(m, {
58
+ icon: t.icon,
59
+ open: e.value
60
60
  }, {
61
- label: t(() => [
62
- N(V(o.value ? "Close" : "Open") + " ", 1),
63
- l(e.$slots, "default", { open: o.value })
61
+ label: a(() => [
62
+ N(V(e.value ? "Close" : "Open") + " ", 1),
63
+ o(l.$slots, "default", { open: e.value })
64
64
  ]),
65
65
  _: 3
66
66
  }, 8, ["icon", "open"])
67
67
  ])
68
- ], 14, T)) : p("", !0),
69
- r(E, {
68
+ ], 14, T)) : v("", !0),
69
+ d(E, {
70
70
  is: "button",
71
- active: e.active,
72
- "aria-expanded": o.value,
73
- disabled: e.disabled,
74
- indent: n(s),
75
- selected: e.selected,
71
+ active: t.active,
72
+ "aria-expanded": e.value,
73
+ disabled: t.disabled,
74
+ indent: n(i),
75
+ selected: t.selected,
76
76
  onClick: b
77
77
  }, M({
78
- indent: t(() => [
79
- r(G, {
78
+ indent: a(() => [
79
+ d(G, {
80
80
  class: "mr-0 -my-2",
81
- indent: n(s),
82
- selected: e.selected
81
+ indent: n(i),
82
+ selected: t.selected
83
83
  }, null, 8, ["indent", "selected"])
84
84
  ]),
85
- icon: t(() => [
86
- e.discrete ? (i(), d("div", j)) : l(e.$slots, "icon", {
85
+ icon: a(() => [
86
+ t.discrete ? (s(), c("div", j)) : o(l.$slots, "icon", {
87
87
  key: 1,
88
- open: o.value
88
+ open: e.value
89
89
  }, () => [
90
- r(v, {
90
+ d(m, {
91
91
  class: "text-c-3",
92
- icon: e.icon,
93
- open: o.value
92
+ icon: t.icon,
93
+ open: e.value
94
94
  }, null, 8, ["icon", "open"])
95
95
  ])
96
96
  ]),
97
- default: t(() => [
98
- l(e.$slots, "default", { open: o.value })
97
+ default: a(() => [
98
+ o(l.$slots, "default", { open: e.value })
99
99
  ]),
100
100
  _: 2
101
101
  }, [
102
- e.$slots.aside ? {
102
+ l.$slots.aside ? {
103
103
  name: "aside",
104
- fn: t(() => [
105
- l(e.$slots, "aside", { open: o.value })
104
+ fn: a(() => [
105
+ o(l.$slots, "aside", { open: e.value })
106
106
  ]),
107
107
  key: "0"
108
108
  } : void 0
109
109
  ]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"])
110
110
  ]),
111
- l(e.$slots, "after", { open: o.value })
111
+ o(l.$slots, "after", { open: e.value })
112
112
  ]),
113
- o.value ? (i(), d("ul", w, [
114
- l(e.$slots, "items", { open: o.value })
115
- ])) : p("", !0)
113
+ e.value ? (s(), c("ul", w, [
114
+ o(l.$slots, "items", { open: e.value })
115
+ ])) : v("", !0)
116
116
  ]),
117
117
  _: 3
118
118
  }, 16));
@@ -1,9 +1,9 @@
1
- import { defineComponent as i, createBlock as n, openBlock as t, resolveDynamicComponent as p, mergeProps as l, unref as o, withCtx as c, renderSlot as r, createElementVNode as f, createTextVNode as u, toDisplayString as d } from "vue";
2
- import { ScalarIconCaretRight as m } from "@scalar/icons";
3
- import { cva as y, useBindCx as b } from "@scalar/use-hooks/useBindCx";
4
- import _ from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
5
- const g = { class: "sr-only" }, h = {}, $ = /* @__PURE__ */ i({
6
- ...h,
1
+ import { defineComponent as l, createBlock as n, openBlock as o, resolveDynamicComponent as c, mergeProps as f, unref as t, withCtx as u, renderSlot as i, createElementVNode as d, createTextVNode as m, toDisplayString as p } from "vue";
2
+ import { ScalarIconCaretRight as y } from "@scalar/icons";
3
+ import { cva as b, useBindCx as g } from "@scalar/use-hooks/useBindCx";
4
+ import h from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
5
+ const v = { class: "sr-only" }, C = {}, $ = /* @__PURE__ */ l({
6
+ ...C,
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarSidebarGroupToggle",
9
9
  props: {
@@ -11,29 +11,29 @@ const g = { class: "sr-only" }, h = {}, $ = /* @__PURE__ */ i({
11
11
  open: { type: Boolean, default: !1 },
12
12
  icon: { type: [Object, Function] }
13
13
  },
14
- setup(v) {
15
- const s = y({
14
+ setup(e) {
15
+ const r = b({
16
16
  base: "size-4 flex items-center justify-center transition-transform duration-100",
17
17
  variants: { open: { true: "rotate-90" } },
18
18
  defaultVariants: { open: !1 }
19
- }), { cx: a } = b();
20
- return (e, C) => (t(), n(p(e.is), l({
19
+ }), { cx: s } = g();
20
+ return (a, x) => (o(), n(c(e.is), f({
21
21
  type: e.is === "button" ? "button" : void 0
22
- }, o(a)(o(s)({ open: e.open }))), {
23
- default: c(() => [
24
- r(e.$slots, "default", { open: e.open }, () => [
25
- e.icon ? (t(), n(o(_), {
22
+ }, t(s)(t(r)({ open: e.open }))), {
23
+ default: u(() => [
24
+ i(a.$slots, "default", { open: e.open }, () => [
25
+ e.icon ? (o(), n(t(h), {
26
26
  key: 0,
27
27
  icon: e.icon
28
- }, null, 8, ["icon"])) : (t(), n(o(m), {
28
+ }, null, 8, ["icon"])) : (o(), n(t(y), {
29
29
  key: 1,
30
30
  class: "size-3",
31
31
  weight: "bold"
32
32
  }))
33
33
  ]),
34
- f("span", g, [
35
- r(e.$slots, "label", { open: e.open }, () => [
36
- u(d(e.open ? "Close" : "Open") + " Group ", 1)
34
+ d("span", v, [
35
+ i(a.$slots, "label", { open: e.open }, () => [
36
+ m(p(e.open ? "Close" : "Open") + " Group ", 1)
37
37
  ])
38
38
  ])
39
39
  ]),
@@ -1,7 +1,7 @@
1
- import { defineComponent as o, computed as c, createElementBlock as t, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as p, createElementVNode as v, createCommentVNode as g, normalizeClass as y } from "vue";
2
- import { useBindCx as B } from "@scalar/use-hooks/useBindCx";
3
- const _ = {}, C = /* @__PURE__ */ o({
4
- ..._,
1
+ import { defineComponent as o, computed as c, createElementBlock as r, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as v, createElementVNode as g, createCommentVNode as y, normalizeClass as p } from "vue";
2
+ import { useBindCx as x } from "@scalar/use-hooks/useBindCx";
3
+ const B = {}, C = /* @__PURE__ */ o({
4
+ ...B,
5
5
  inheritAttrs: !1,
6
6
  __name: "ScalarSidebarIndent",
7
7
  props: {
@@ -9,26 +9,26 @@ const _ = {}, C = /* @__PURE__ */ o({
9
9
  selected: { type: Boolean, default: !1 },
10
10
  disabled: { type: Boolean }
11
11
  },
12
- setup(d) {
13
- const a = c(() => Array.from({ length: d.indent }, (e, r) => r)), { cx: s } = B();
14
- return (e, r) => (n(), t("div", u(b(
15
- m(s)("scalar-sidebar-indent flex justify-center", {
12
+ setup(e) {
13
+ const a = c(() => Array.from({ length: e.indent }, (l, t) => t)), { cx: d } = x();
14
+ return (l, t) => (n(), r("div", u(b(
15
+ m(d)("scalar-sidebar-indent flex justify-center", {
16
16
  "mr-[calc(20px-var(--scalar-sidebar-indent))]": e.indent > 0,
17
17
  "scalar-sidebar-indent-selected": e.selected
18
18
  })
19
19
  )), [
20
- (n(!0), t(f, null, p(a.value, (l, i) => (n(), t("div", {
21
- key: l,
20
+ (n(!0), r(f, null, v(a.value, (s, i) => (n(), r("div", {
21
+ key: s,
22
22
  class: "relative w-[var(--scalar-sidebar-indent)]"
23
23
  }, [
24
- r[0] || (r[0] = v("div", { class: "scalar-sidebar-indent-border absolute left-2 inset-y-0 w-border bg-sidebar-indent-border" }, null, -1)),
25
- i === a.value.length - 1 ? (n(), t("div", {
24
+ t[0] || (t[0] = g("div", { class: "scalar-sidebar-indent-border absolute left-2 inset-y-0 w-border bg-sidebar-indent-border" }, null, -1)),
25
+ i === a.value.length - 1 ? (n(), r("div", {
26
26
  key: 0,
27
- class: y([
27
+ class: p([
28
28
  "absolute left-2 inset-y-0 w-border",
29
29
  e.disabled ? "" : e.selected ? "bg-sidebar-indent-border-active" : "group-hover/button:bg-sidebar-indent-border-hover"
30
30
  ])
31
- }, null, 2)) : g("", !0)
31
+ }, null, 2)) : y("", !0)
32
32
  ]))), 128))
33
33
  ], 16));
34
34
  }