@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 b, mergeModels as m, useModel as y, ref as c, createBlock as i, openBlock as f, withCtx as t, createCommentVNode as k, createSlots as V, renderSlot as r, normalizeProps as d, guardReactiveProps as s } from "vue";
1
+ import { defineComponent as $, mergeModels as f, useModel as b, ref as y, createBlock as p, openBlock as u, withCtx as l, createCommentVNode as k, createSlots as V, renderSlot as d, normalizeProps as n, guardReactiveProps as m } from "vue";
2
2
  import w from "./ScalarComboboxOptions.vue.js";
3
3
  import z from "./ScalarComboboxPopover.vue.js";
4
- const P = /* @__PURE__ */ b({
4
+ const P = /* @__PURE__ */ $({
5
5
  __name: "ScalarComboboxMultiselect",
6
- props: /* @__PURE__ */ m({
6
+ props: /* @__PURE__ */ f({
7
7
  options: {},
8
8
  placeholder: {},
9
9
  placement: {},
@@ -16,12 +16,12 @@ const P = /* @__PURE__ */ b({
16
16
  modelValue: { default: [] },
17
17
  modelModifiers: {}
18
18
  }),
19
- emits: /* @__PURE__ */ m(["add"], ["update:modelValue"]),
20
- setup(u, { expose: g, emit: v }) {
21
- const $ = v, n = y(u, "modelValue"), p = c(null);
22
- return g({ comboboxPopoverRef: p }), (e, l) => (f(), i(z, {
19
+ emits: /* @__PURE__ */ f(["add"], ["update:modelValue"]),
20
+ setup(e, { expose: c, emit: g }) {
21
+ const v = g, s = b(e, "modelValue"), i = y(null);
22
+ return c({ comboboxPopoverRef: i }), (t, a) => (u(), p(z, {
23
23
  ref_key: "comboboxPopoverRef",
24
- ref: p,
24
+ ref: i,
25
25
  middleware: e.middleware,
26
26
  offset: e.offset,
27
27
  placement: e.placement ?? "bottom-start",
@@ -29,38 +29,38 @@ const P = /* @__PURE__ */ b({
29
29
  target: e.target,
30
30
  teleport: e.teleport
31
31
  }, {
32
- default: t(({ open: a }) => [
33
- r(e.$slots, "default", { open: a })
32
+ default: l(({ open: r }) => [
33
+ d(t.$slots, "default", { open: r })
34
34
  ]),
35
- popover: t(({ open: a }) => [
36
- e.options?.length ? (f(), i(w, {
35
+ popover: l(({ open: r }) => [
36
+ e.options?.length ? (u(), p(w, {
37
37
  key: 0,
38
- modelValue: n.value,
39
- "onUpdate:modelValue": l[0] || (l[0] = (o) => n.value = o),
38
+ modelValue: s.value,
39
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => s.value = o),
40
40
  multiselect: "",
41
- open: a,
41
+ open: r,
42
42
  options: e.options,
43
43
  placeholder: e.placeholder,
44
- onAdd: l[1] || (l[1] = (o) => $("add"))
44
+ onAdd: a[1] || (a[1] = (o) => v("add"))
45
45
  }, V({ _: 2 }, [
46
- e.$slots.option ? {
46
+ t.$slots.option ? {
47
47
  name: "option",
48
- fn: t((o) => [
49
- r(e.$slots, "option", d(s(o)))
48
+ fn: l((o) => [
49
+ d(t.$slots, "option", n(m(o)))
50
50
  ]),
51
51
  key: "0"
52
52
  } : void 0,
53
- e.$slots.group ? {
53
+ t.$slots.group ? {
54
54
  name: "group",
55
- fn: t((o) => [
56
- r(e.$slots, "group", d(s(o)))
55
+ fn: l((o) => [
56
+ d(t.$slots, "group", n(m(o)))
57
57
  ]),
58
58
  key: "1"
59
59
  } : void 0,
60
- e.$slots.add ? {
60
+ t.$slots.add ? {
61
61
  name: "add",
62
- fn: t((o) => [
63
- r(e.$slots, "add", d(s(o)))
62
+ fn: l((o) => [
63
+ d(t.$slots, "add", n(m(o)))
64
64
  ]),
65
65
  key: "2"
66
66
  } : void 0
@@ -1,13 +1,13 @@
1
- import { defineComponent as o, createElementBlock as r, openBlock as s, normalizeClass as n, unref as t, renderSlot as c } from "vue";
2
- import { cva as l, cx as i } from "@scalar/use-hooks/useBindCx";
3
- const p = ["aria-selected"], b = /* @__PURE__ */ o({
1
+ import { defineComponent as o, createElementBlock as n, openBlock as r, normalizeClass as l, unref as t, renderSlot as s } from "vue";
2
+ import { cva as i, cx as d } from "@scalar/use-hooks/useBindCx";
3
+ const m = ["aria-selected"], b = /* @__PURE__ */ o({
4
4
  __name: "ScalarComboboxOption",
5
5
  props: {
6
6
  active: { type: Boolean },
7
7
  selected: { type: Boolean }
8
8
  },
9
- setup(d) {
10
- const a = l({
9
+ setup(e) {
10
+ const a = i({
11
11
  base: [
12
12
  // Group
13
13
  "group/item",
@@ -23,17 +23,17 @@ const p = ["aria-selected"], b = /* @__PURE__ */ o({
23
23
  active: { true: "bg-b-2" }
24
24
  }
25
25
  });
26
- return (e, m) => (s(), r("li", {
26
+ return (c, u) => (r(), n("li", {
27
27
  "aria-selected": e.selected,
28
- class: n(t(i)(t(a)({ active: e.active, selected: e.selected }))),
28
+ class: l(t(d)(t(a)({ active: e.active, selected: e.selected }))),
29
29
  role: "option",
30
30
  tabindex: "-1"
31
31
  }, [
32
- c(e.$slots, "default", {
32
+ s(c.$slots, "default", {
33
33
  active: e.active,
34
34
  selected: e.selected
35
35
  })
36
- ], 10, p));
36
+ ], 10, m));
37
37
  }
38
38
  });
39
39
  export {
@@ -1,26 +1,26 @@
1
- import { defineComponent as a, useId as i, createElementBlock as o, openBlock as d, createCommentVNode as t, renderSlot as l } from "vue";
2
- const n = ["id", "aria-labelledby", "role"], r = ["id"], m = /* @__PURE__ */ a({
1
+ import { defineComponent as a, useId as i, createElementBlock as t, openBlock as l, createCommentVNode as n, renderSlot as o } from "vue";
2
+ const r = ["id", "aria-labelledby", "role"], c = ["id"], m = /* @__PURE__ */ a({
3
3
  __name: "ScalarComboboxOptionGroup",
4
4
  props: {
5
5
  id: { default: () => i() },
6
6
  hidden: { type: Boolean, default: !1 }
7
7
  },
8
- setup(s) {
9
- return (e, p) => (d(), o("div", {
8
+ setup(e) {
9
+ return (d, s) => (l(), t("div", {
10
10
  id: e.id,
11
11
  "aria-labelledby": e.id ? `${e.id}-label` : void 0,
12
12
  class: "contents",
13
13
  role: e.hidden ? void 0 : "group"
14
14
  }, [
15
- e.hidden ? t("", !0) : (d(), o("div", {
15
+ e.hidden ? n("", !0) : (l(), t("div", {
16
16
  key: 0,
17
17
  id: `${e.id}-label`,
18
18
  class: "min-w-0 truncate px-2.5 py-1.5 text-c-2"
19
19
  }, [
20
- l(e.$slots, "label")
21
- ], 8, r)),
22
- l(e.$slots, "default")
23
- ], 8, n));
20
+ o(d.$slots, "label")
21
+ ], 8, c)),
22
+ o(d.$slots, "default")
23
+ ], 8, r));
24
24
  }
25
25
  });
26
26
  export {
@@ -1,10 +1,10 @@
1
- import { defineComponent as W, mergeModels as O, useModel as X, useSlots as Y, useId as z, computed as w, ref as M, onMounted as D, watch as Z, createElementBlock as c, openBlock as a, Fragment as m, createElementVNode as k, withDirectives as G, createVNode as I, unref as h, withKeys as V, withModifiers as y, vModelText as _, createBlock as C, createCommentVNode as K, renderList as q, withCtx as x, renderSlot as S, toDisplayString as F, createTextVNode as ee, vShow as te } from "vue";
1
+ import { defineComponent as W, mergeModels as O, useModel as X, useSlots as Y, useId as z, computed as w, ref as I, onMounted as D, watch as Z, createElementBlock as v, openBlock as s, Fragment as m, createElementVNode as k, withDirectives as G, createVNode as h, unref as V, withKeys as C, withModifiers as y, vModelText as _, createBlock as S, createCommentVNode as K, renderList as q, withCtx as g, renderSlot as B, toDisplayString as F, createTextVNode as ee, vShow as te } from "vue";
2
2
  import { ScalarIconMagnifyingGlass as le, ScalarIconPlus as oe } from "@scalar/icons";
3
3
  import P from "./ScalarComboboxOption.vue.js";
4
4
  import ne from "./ScalarComboboxOptionGroup.vue.js";
5
5
  import { isGroups as R } from "./types.js";
6
6
  import ie from "../ScalarListbox/ScalarListboxCheckbox.vue.js";
7
- const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placeholder"], de = ["aria-multiselectable"], ue = { class: "inline-block min-w-0 flex-1 truncate text-c-1" }, be = /* @__PURE__ */ W({
7
+ const ae = { class: "relative flex" }, se = ["aria-activedescendant", "placeholder"], de = ["aria-multiselectable"], ue = { class: "inline-block min-w-0 flex-1 truncate text-c-1" }, be = /* @__PURE__ */ W({
8
8
  inheritAttrs: !1,
9
9
  __name: "ScalarComboboxOptions",
10
10
  props: /* @__PURE__ */ O({
@@ -16,9 +16,9 @@ const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placehold
16
16
  modelModifiers: {}
17
17
  }),
18
18
  emits: /* @__PURE__ */ O(["add"], ["update:modelValue"]),
19
- setup(B, { emit: U }) {
20
- const d = B, j = U, i = X(B, "modelValue"), g = Y(), $ = `scalar-combobox-items-${z()}`, f = { id: `${z()}-add`, label: "Add a new option" };
21
- function p(t) {
19
+ setup(f, { emit: U }) {
20
+ const d = f, j = U, i = X(f, "modelValue"), M = Y(), $ = `scalar-combobox-items-${z()}`, p = { id: `${z()}-add`, label: "Add a new option" };
21
+ function b(t) {
22
22
  return `${$}-${t.id}`;
23
23
  }
24
24
  const r = w(
@@ -32,24 +32,24 @@ const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placehold
32
32
  [{ label: "", options: d.options }]
33
33
  )
34
34
  // G is OptionGroup<O>
35
- ), u = M(""), l = M(i.value?.[0] ?? r.value[0]);
35
+ ), u = I(""), l = I(i.value?.[0] ?? r.value[0]);
36
36
  D(() => {
37
37
  u.value = "", l.value = i.value?.[0] ?? r.value[0], i.value[0] && setTimeout(() => {
38
38
  const e = i.value[0];
39
- e && document?.getElementById(p(e))?.scrollIntoView({ block: "nearest" });
39
+ e && document?.getElementById(b(e))?.scrollIntoView({ block: "nearest" });
40
40
  }, 10);
41
41
  }), Z(
42
42
  () => u.value,
43
43
  () => l.value = N.value[0]
44
44
  );
45
- const b = w(
45
+ const x = w(
46
46
  () => u.value === "" ? r.value : r.value.filter((t) => t.label.toLowerCase().includes(u.value.toLowerCase()))
47
47
  ), N = w(
48
- () => g.add ? [...b.value, f] : b.value
48
+ () => M.add ? [...x.value, p] : x.value
49
49
  );
50
50
  function A(t) {
51
51
  if (t) {
52
- if (t.id === f.id) {
52
+ if (t.id === p.id) {
53
53
  T();
54
54
  return;
55
55
  }
@@ -60,10 +60,10 @@ const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placehold
60
60
  }
61
61
  }
62
62
  function E(t) {
63
- const e = N.value, v = e.findIndex(
63
+ const e = N.value, c = e.findIndex(
64
64
  (n) => n.id === l.value?.id
65
65
  ) + t;
66
- v < 0 || v > e.length - 1 || (l.value = e[v], l.value && document?.getElementById(p(l.value))?.scrollIntoView({
66
+ c < 0 || c > e.length - 1 || (l.value = e[c], l.value && document?.getElementById(b(l.value))?.scrollIntoView({
67
67
  behavior: "smooth",
68
68
  block: "nearest"
69
69
  }));
@@ -71,79 +71,79 @@ const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placehold
71
71
  function T() {
72
72
  j("add"), u.value = "";
73
73
  }
74
- const L = M(null);
75
- return D(() => setTimeout(() => L.value?.focus(), 0)), (t, e) => (a(), c(m, null, [
76
- k("div", se, [
77
- I(h(le), { class: "pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-c-3 size-4" }),
74
+ const L = I(null);
75
+ return D(() => setTimeout(() => L.value?.focus(), 0)), (t, e) => (s(), v(m, null, [
76
+ k("div", ae, [
77
+ h(V(le), { class: "pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-c-3 size-4" }),
78
78
  G(k("input", {
79
79
  ref_key: "input",
80
80
  ref: L,
81
81
  "onUpdate:modelValue": e[0] || (e[0] = (o) => u.value = o),
82
- "aria-activedescendant": l.value ? p(l.value) : void 0,
82
+ "aria-activedescendant": l.value ? b(l.value) : void 0,
83
83
  "aria-autocomplete": "list",
84
84
  "aria-controls": $,
85
85
  class: "min-w-0 flex-1 rounded border-0 py-2.5 pl-8 pr-3 leading-none text-c-1 -outline-offset-1",
86
86
  "data-1p-ignore": "",
87
- placeholder: t.placeholder,
87
+ placeholder: f.placeholder,
88
88
  role: "combobox",
89
89
  tabindex: "0",
90
90
  type: "text",
91
91
  onKeydown: [
92
- e[1] || (e[1] = V(y((o) => E(1), ["prevent"]), ["down"])),
93
- e[2] || (e[2] = V(y((o) => l.value && A(l.value), ["prevent"]), ["enter"])),
94
- e[3] || (e[3] = V(y((o) => E(-1), ["prevent"]), ["up"]))
92
+ e[1] || (e[1] = C(y((o) => E(1), ["prevent"]), ["down"])),
93
+ e[2] || (e[2] = C(y((o) => l.value && A(l.value), ["prevent"]), ["enter"])),
94
+ e[3] || (e[3] = C(y((o) => E(-1), ["prevent"]), ["up"]))
95
95
  ]
96
- }, null, 40, ae), [
96
+ }, null, 40, se), [
97
97
  [_, u.value]
98
98
  ])
99
99
  ]),
100
100
  G(k("ul", {
101
101
  id: $,
102
- "aria-multiselectable": t.multiselect,
102
+ "aria-multiselectable": f.multiselect,
103
103
  class: "border-t p-0.75 custom-scroll overscroll-contain flex-1 min-h-0",
104
104
  role: "listbox",
105
105
  tabindex: "-1"
106
106
  }, [
107
- (a(!0), c(m, null, q(H.value, (o, v) => (a(), C(ne, {
108
- id: `${$}-group-${v}`,
109
- key: v,
107
+ (s(!0), v(m, null, q(H.value, (o, c) => (s(), S(ne, {
108
+ id: `${$}-group-${c}`,
109
+ key: c,
110
110
  hidden: (
111
111
  // Only show the group label if there are some results
112
- !o.options.some((n) => b.value.some((s) => s.id === n.id)) || // And it has a label
112
+ !o.options.some((n) => x.value.some((a) => a.id === n.id)) || // And it has a label
113
113
  !o.label
114
114
  )
115
115
  }, {
116
- label: x(() => [
117
- t.$slots.group ? S(t.$slots, "group", {
116
+ label: g(() => [
117
+ t.$slots.group ? B(t.$slots, "group", {
118
118
  key: 0,
119
119
  group: o
120
- }) : (a(), c(m, { key: 1 }, [
120
+ }) : (s(), v(m, { key: 1 }, [
121
121
  ee(F(o.label), 1)
122
122
  ], 64))
123
123
  ]),
124
- default: x(() => [
125
- (a(!0), c(m, null, q(b.value, (n) => (a(), c(m, {
124
+ default: g(() => [
125
+ (s(!0), v(m, null, q(x.value, (n) => (s(), v(m, {
126
126
  key: n.id
127
127
  }, [
128
- o.options.some((s) => s.id === n.id) ? (a(), C(P, {
128
+ o.options.some((a) => a.id === n.id) ? (s(), S(P, {
129
129
  key: 0,
130
- id: p(n),
130
+ id: b(n),
131
131
  active: l.value?.id === n.id,
132
- selected: i.value.some((s) => s.id === n.id),
133
- onClick: (s) => A(n),
132
+ selected: i.value.some((a) => a.id === n.id),
133
+ onClick: (a) => A(n),
134
134
  onMousedown: e[4] || (e[4] = y(() => {
135
135
  }, ["prevent"])),
136
- onMouseenter: (s) => l.value = n
136
+ onMouseenter: (a) => l.value = n
137
137
  }, {
138
- default: x(({ active: s, selected: J }) => [
139
- t.$slots.option ? S(t.$slots, "option", {
138
+ default: g(({ active: a, selected: J }) => [
139
+ t.$slots.option ? B(t.$slots, "option", {
140
140
  key: 0,
141
- active: s,
141
+ active: a,
142
142
  option: n,
143
143
  selected: J
144
- }) : (a(), c(m, { key: 1 }, [
145
- I(h(ie), {
146
- multiselect: t.multiselect,
144
+ }) : (s(), v(m, { key: 1 }, [
145
+ h(V(ie), {
146
+ multiselect: f.multiselect,
147
147
  selected: i.value.some((Q) => Q.id === n.id)
148
148
  }, null, 8, ["multiselect", "selected"]),
149
149
  k("span", ue, F(n.label), 1)
@@ -155,23 +155,23 @@ const se = { class: "relative flex" }, ae = ["aria-activedescendant", "placehold
155
155
  ]),
156
156
  _: 2
157
157
  }, 1032, ["id", "hidden"]))), 128)),
158
- g.add ? (a(), C(P, {
158
+ M.add ? (s(), S(P, {
159
159
  key: 0,
160
- id: p(f),
161
- active: l.value?.id === f.id,
160
+ id: b(p),
161
+ active: l.value?.id === p.id,
162
162
  onClick: T,
163
163
  onMousedown: e[5] || (e[5] = y(() => {
164
164
  }, ["prevent"])),
165
- onMouseenter: e[6] || (e[6] = (o) => l.value = f)
165
+ onMouseenter: e[6] || (e[6] = (o) => l.value = p)
166
166
  }, {
167
- default: x(({ active: o }) => [
168
- I(h(oe), { class: "size-4 p-px" }),
169
- S(t.$slots, "add", { active: o })
167
+ default: g(({ active: o }) => [
168
+ h(V(oe), { class: "size-4 p-px" }),
169
+ B(t.$slots, "add", { active: o })
170
170
  ]),
171
171
  _: 3
172
172
  }, 8, ["id", "active"])) : K("", !0)
173
173
  ], 8, de), [
174
- [te, b.value.length || g.add]
174
+ [te, x.value.length || M.add]
175
175
  ])
176
176
  ], 64));
177
177
  }
@@ -1,5 +1,5 @@
1
- import { defineComponent as d, createBlock as r, openBlock as i, unref as e, withCtx as t, createVNode as n, normalizeClass as f, renderSlot as a } from "vue";
2
- import { ContextMenuRoot as u, ContextMenuTrigger as c, ContextMenuPortal as g, ContextMenuContent as C, ContextMenuItem as p } from "radix-vue";
1
+ import { defineComponent as d, createBlock as r, openBlock as i, unref as e, withCtx as t, createVNode as n, normalizeClass as f, renderSlot as o } from "vue";
2
+ import { ContextMenuRoot as u, ContextMenuTrigger as c, ContextMenuPortal as g, ContextMenuContent as C, ContextMenuItem as m } from "radix-vue";
3
3
  const M = /* @__PURE__ */ d({
4
4
  __name: "ScalarContextMenu",
5
5
  props: {
@@ -9,16 +9,16 @@ const M = /* @__PURE__ */ d({
9
9
  disabled: { type: Boolean, default: !1 },
10
10
  triggerClass: {}
11
11
  },
12
- setup(o) {
13
- const l = o;
14
- return (s, m) => (i(), r(e(u), null, {
12
+ setup(s) {
13
+ const l = s;
14
+ return (a, p) => (i(), r(e(u), null, {
15
15
  default: t(() => [
16
16
  n(e(c), {
17
17
  class: f(s.triggerClass),
18
18
  disabled: l.disabled
19
19
  }, {
20
20
  default: t(() => [
21
- a(s.$slots, "trigger")
21
+ o(a.$slots, "trigger")
22
22
  ]),
23
23
  _: 3
24
24
  }, 8, ["class", "disabled"]),
@@ -30,9 +30,9 @@ const M = /* @__PURE__ */ d({
30
30
  sideOffset: l.sideOffset
31
31
  }, {
32
32
  default: t(() => [
33
- n(e(p), null, {
33
+ n(e(m), null, {
34
34
  default: t(() => [
35
- a(s.$slots, "content")
35
+ o(a.$slots, "content")
36
36
  ]),
37
37
  _: 3
38
38
  })
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, mergeModels as D, ref as b, useModel as g, useId as _, watch as $, computed as K, createBlock as L, openBlock as M, unref as m, mergeProps as I, createSlots as N, withCtx as A, renderSlot as R, createVNode as q, createElementVNode as O, withKeys as a, withModifiers as i, nextTick as C } from "vue";
1
+ import { defineComponent as B, mergeModels as D, ref as b, useModel as g, useId as $, watch as I, computed as K, createBlock as L, openBlock as M, unref as m, mergeProps as R, createSlots as N, withCtx as A, renderSlot as C, createVNode as q, createElementVNode as O, withKeys as a, withModifiers as r, nextTick as E } from "vue";
2
2
  import { useBindCx as U } from "@scalar/use-hooks/useBindCx";
3
3
  import { onClickOutside as V } from "@vueuse/core";
4
4
  import j from "./ScalarDropdownMenu.vue.js";
@@ -20,24 +20,24 @@ const P = ["id", "aria-activedescendant", "aria-labelledby", "onKeydown"], G = {
20
20
  openModifiers: {}
21
21
  }),
22
22
  emits: ["update:open"],
23
- setup(E) {
24
- const l = b(), r = b(), n = g(E, "open"), { active: o } = z(), v = _(), f = b(v), y = _();
25
- async function k() {
26
- n.value = !n.value, await C(), n.value && r.value?.focus();
23
+ setup(k) {
24
+ const l = b(), i = b(), n = g(k, "open"), { active: o } = z(), v = $(), f = b(v), y = $();
25
+ async function x() {
26
+ n.value = !n.value, await E(), n.value && i.value?.focus();
27
27
  }
28
28
  async function h(e) {
29
29
  if (["ArrowDown", "ArrowUp", " ", "Enter"].includes(e.key))
30
30
  e.preventDefault();
31
31
  else return;
32
- n.value || (n.value = !0), await C(), r.value?.focus(), ["ArrowDown", " ", "Enter"].includes(e.key) ? d(1) : e.key === "ArrowUp" && d(-1);
32
+ n.value || (n.value = !0), await E(), i.value?.focus(), ["ArrowDown", " ", "Enter"].includes(e.key) ? c(1) : e.key === "ArrowUp" && c(-1);
33
33
  }
34
- $(
34
+ I(
35
35
  () => l.value?.targetRef,
36
36
  (e, t) => {
37
- e && (e.id ? f.value = e.id : (f.value = v, e.setAttribute("id", f.value)), e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", `${n.value}`), n.value && e.setAttribute("aria-controls", y), e.addEventListener("click", k), e.addEventListener("keydown", h)), t && t !== e && (t.id === v && t.removeAttribute("id"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-expanded"), t.removeEventListener("click", k), t.removeEventListener("keydown", h));
37
+ e && (e.id ? f.value = e.id : (f.value = v, e.setAttribute("id", f.value)), e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", `${n.value}`), n.value && e.setAttribute("aria-controls", y), e.addEventListener("click", x), e.addEventListener("keydown", h)), t && t !== e && (t.id === v && t.removeAttribute("id"), t.removeAttribute("aria-controls"), t.removeAttribute("aria-haspopup"), t.removeAttribute("aria-expanded"), t.removeEventListener("click", x), t.removeEventListener("keydown", h));
38
38
  },
39
39
  { immediate: !0 }
40
- ), $(
40
+ ), I(
41
41
  n,
42
42
  (e) => {
43
43
  const t = l.value?.targetRef;
@@ -48,75 +48,75 @@ const P = ["id", "aria-activedescendant", "aria-labelledby", "onKeydown"], G = {
48
48
  async function u() {
49
49
  l.value?.targetRef?.focus(), n.value = !1;
50
50
  }
51
- function x() {
52
- if (!o.value || !r.value) return;
53
- const e = r.value.querySelector(
51
+ function w() {
52
+ if (!o.value || !i.value) return;
53
+ const e = i.value.querySelector(
54
54
  `#${o.value}[role="menuitem"]:not([aria-disabled="true"])`
55
55
  );
56
56
  e && (e.click(), u());
57
57
  }
58
- function d(e) {
59
- if (!n.value || !r.value) return;
58
+ function c(e) {
59
+ if (!n.value || !i.value) return;
60
60
  const t = Array.from(
61
- r.value.querySelectorAll(
61
+ i.value.querySelectorAll(
62
62
  '[role="menuitem"]:not([aria-disabled="true"])'
63
63
  )
64
64
  );
65
65
  if (t.length === 0) return;
66
- const c = t.findIndex((p) => p.id === o.value);
67
- if (c === -1) {
66
+ const d = t.findIndex((p) => p.id === o.value);
67
+ if (d === -1) {
68
68
  const p = t[e > 0 ? 0 : t.length - 1];
69
69
  p?.id && (o.value = p.id);
70
70
  return;
71
71
  }
72
- const s = c + e;
72
+ const s = d + e;
73
73
  if (s < 0 || s > t.length - 1)
74
74
  return;
75
- const w = t[s];
76
- w?.id && (o.value = w.id);
75
+ const _ = t[s];
76
+ _?.id && (o.value = _.id);
77
77
  }
78
- V(r, u, {
78
+ V(i, u, {
79
79
  ignore: [K(() => l.value?.targetRef)]
80
80
  });
81
81
  const { cx: S } = U();
82
- return (e, t) => (M(), L(m(F), I({
82
+ return (e, t) => (M(), L(m(F), R({
83
83
  ref_key: "floatingRef",
84
84
  ref: l
85
85
  }, e.$props, {
86
- placement: e.placement ?? "bottom-start"
86
+ placement: k.placement ?? "bottom-start"
87
87
  }), N({
88
88
  default: A(() => [
89
- R(e.$slots, "default", { open: n.value })
89
+ C(e.$slots, "default", { open: n.value })
90
90
  ]),
91
91
  _: 2
92
92
  }, [
93
93
  n.value ? {
94
94
  name: "floating",
95
- fn: A(({ width: c }) => [
96
- q(j, I({
97
- style: { width: c }
95
+ fn: A(({ width: d }) => [
96
+ q(j, R({
97
+ style: { width: d }
98
98
  }, m(S)("max-h-[inherit] max-w-[inherit]")), {
99
99
  menu: A(() => [
100
100
  O("div", {
101
101
  id: m(y),
102
102
  ref_key: "menuRef",
103
- ref: r,
103
+ ref: i,
104
104
  "aria-activedescendant": m(o),
105
105
  "aria-labelledby": f.value,
106
106
  class: "flex flex-col p-0.75 outline-none",
107
107
  role: "menu",
108
108
  tabindex: "-1",
109
- onClick: i(u, ["stop"]),
109
+ onClick: r(u, ["stop"]),
110
110
  onKeydown: [
111
- t[0] || (t[0] = a(i((s) => d(1), ["prevent", "stop"]), ["down"])),
112
- a(i(x, ["prevent", "stop"]), ["enter"]),
113
- a(i(u, ["prevent", "stop"]), ["escape"]),
114
- a(i(x, ["prevent", "stop"]), ["space"]),
115
- a(i(u, ["prevent", "stop"]), ["tab"]),
116
- t[1] || (t[1] = a(i((s) => d(-1), ["prevent", "stop"]), ["up"]))
111
+ t[0] || (t[0] = a(r((s) => c(1), ["prevent", "stop"]), ["down"])),
112
+ a(r(w, ["prevent", "stop"]), ["enter"]),
113
+ a(r(u, ["prevent", "stop"]), ["escape"]),
114
+ a(r(w, ["prevent", "stop"]), ["space"]),
115
+ a(r(u, ["prevent", "stop"]), ["tab"]),
116
+ t[1] || (t[1] = a(r((s) => c(-1), ["prevent", "stop"]), ["up"]))
117
117
  ]
118
118
  }, [
119
- R(e.$slots, "items", { open: n.value })
119
+ C(e.$slots, "items", { open: n.value })
120
120
  ], 40, P)
121
121
  ]),
122
122
  _: 3
@@ -1,15 +1,15 @@
1
- import { defineComponent as o, createBlock as n, openBlock as s, resolveDynamicComponent as r, normalizeClass as i, unref as t, withCtx as d, renderSlot as l } from "vue";
2
- import { cva as c, cx as p } from "@scalar/use-hooks/useBindCx";
3
- const u = {}, _ = /* @__PURE__ */ o({
4
- ...u,
1
+ import { defineComponent as o, createBlock as i, openBlock as s, resolveDynamicComponent as r, normalizeClass as d, unref as t, withCtx as l, renderSlot as c } from "vue";
2
+ import { cva as u, cx as b } from "@scalar/use-hooks/useBindCx";
3
+ const m = {}, x = /* @__PURE__ */ o({
4
+ ...m,
5
5
  __name: "ScalarDropdownButton",
6
6
  props: {
7
7
  is: { default: "button" },
8
8
  active: { type: Boolean },
9
9
  disabled: { type: Boolean }
10
10
  },
11
- setup(b) {
12
- const a = c({
11
+ setup(e) {
12
+ const a = u({
13
13
  base: [
14
14
  // Layout
15
15
  "block h-8 min-w-0 gap-1.5 rounded px-2.5 py-1.5 text-left",
@@ -24,18 +24,18 @@ const u = {}, _ = /* @__PURE__ */ o({
24
24
  },
25
25
  compoundVariants: [{ disabled: !1, active: !0, class: "bg-b-2" }]
26
26
  });
27
- return (e, m) => (s(), n(r(e.is), {
27
+ return (n, p) => (s(), i(r(e.is), {
28
28
  "aria-disabled": e.disabled,
29
- class: i(["item", t(p)("scalar-dropdown-item", t(a)({ active: e.active, disabled: e.disabled }))]),
29
+ class: d(["item", t(b)("scalar-dropdown-item", t(a)({ active: e.active, disabled: e.disabled }))]),
30
30
  type: e.is === "button" ? "button" : void 0
31
31
  }, {
32
- default: d(() => [
33
- l(e.$slots, "default", {}, void 0, !0)
32
+ default: l(() => [
33
+ c(n.$slots, "default", {}, void 0, !0)
34
34
  ]),
35
35
  _: 3
36
36
  }, 8, ["aria-disabled", "class", "type"]));
37
37
  }
38
38
  });
39
39
  export {
40
- _ as default
40
+ x as default
41
41
  };