@scalar/components 0.14.18 → 0.14.20

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 (56) hide show
  1. package/dist/components/ScalarCard/ScalarCard.stories.d.ts +10 -0
  2. package/dist/components/ScalarCard/ScalarCard.stories.d.ts.map +1 -0
  3. package/dist/components/ScalarCard/ScalarCard.test.d.ts +2 -0
  4. package/dist/components/ScalarCard/ScalarCard.test.d.ts.map +1 -0
  5. package/dist/components/ScalarCard/ScalarCard.vue.d.ts +30 -0
  6. package/dist/components/ScalarCard/ScalarCard.vue.d.ts.map +1 -0
  7. package/dist/components/ScalarCard/ScalarCard.vue.js +25 -0
  8. package/dist/components/ScalarCard/ScalarCard.vue2.js +4 -0
  9. package/dist/components/ScalarCard/ScalarCardFooter.vue.d.ts +19 -0
  10. package/dist/components/ScalarCard/ScalarCardFooter.vue.d.ts.map +1 -0
  11. package/dist/components/ScalarCard/ScalarCardFooter.vue.js +20 -0
  12. package/dist/components/ScalarCard/ScalarCardFooter.vue2.js +4 -0
  13. package/dist/components/ScalarCard/ScalarCardHeader.vue.d.ts +22 -0
  14. package/dist/components/ScalarCard/ScalarCardHeader.vue.d.ts.map +1 -0
  15. package/dist/components/ScalarCard/ScalarCardHeader.vue.js +36 -0
  16. package/dist/components/ScalarCard/ScalarCardHeader.vue2.js +4 -0
  17. package/dist/components/ScalarCard/ScalarCardSection.vue.d.ts +22 -0
  18. package/dist/components/ScalarCard/ScalarCardSection.vue.d.ts.map +1 -0
  19. package/dist/components/ScalarCard/ScalarCardSection.vue.js +16 -0
  20. package/dist/components/ScalarCard/ScalarCardSection.vue2.js +4 -0
  21. package/dist/components/ScalarCard/index.d.ts +5 -0
  22. package/dist/components/ScalarCard/index.d.ts.map +1 -0
  23. package/dist/components/ScalarCard/useCardHeading.d.ts +21 -0
  24. package/dist/components/ScalarCard/useCardHeading.d.ts.map +1 -0
  25. package/dist/components/ScalarCard/useCardHeading.js +16 -0
  26. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +4 -3
  27. package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +15 -15
  28. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +1 -1
  29. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
  30. package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +14 -14
  31. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
  32. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +5 -145
  33. package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue2.js +145 -2
  34. package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +6 -6
  35. package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +15 -15
  36. package/dist/components/ScalarFileUpload/ScalarFileUploadFileList.vue.js +7 -5
  37. package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.js +2 -1
  38. package/dist/components/ScalarFloating/ScalarFloating.vue.js +20 -20
  39. package/dist/components/ScalarListbox/ScalarListbox.vue.js +15 -15
  40. package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts.map +1 -1
  41. package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +6 -3
  42. package/dist/components/ScalarMenu/ScalarMenuResources.vue.js +8 -5
  43. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +7 -5
  44. package/dist/components/ScalarPopover/ScalarPopover.vue.js +11 -11
  45. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
  46. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +8 -6
  47. package/dist/helpers/add-scalar-classes.d.ts +4 -2
  48. package/dist/helpers/add-scalar-classes.d.ts.map +1 -1
  49. package/dist/helpers/add-scalar-classes.js +13 -17
  50. package/dist/helpers/add-scalar-classes.test.d.ts +2 -0
  51. package/dist/helpers/add-scalar-classes.test.d.ts.map +1 -0
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +158 -150
  55. package/dist/style.css +1 -1
  56. package/package.json +9 -9
@@ -1,147 +1,7 @@
1
- import { defineComponent as q, useId as F, computed as b, ref as h, onMounted as M, watch as U, createElementBlock as y, openBlock as v, Fragment as $, createElementVNode as w, withDirectives as B, createVNode as j, unref as H, withKeys as x, withModifiers as g, vModelText as J, renderSlot as S, renderList as E, createBlock as N, withCtx as V, createCommentVNode as P, normalizeStyle as Q, createTextVNode as T, toDisplayString as L, vShow as R } from "vue";
2
- import { ScalarIconMagnifyingGlass as W } from "@scalar/icons";
3
- import X from "./ScalarComboboxOption.vue.js";
4
- import Y from "./ScalarComboboxOptionGroup.vue.js";
5
- import { isGroups as z } from "./types.js";
6
- const Z = { class: "relative flex" }, _ = ["aria-activedescendant", "placeholder"], ee = ["aria-multiselectable"], se = /* @__PURE__ */ q({
7
- inheritAttrs: !1,
8
- __name: "ScalarComboboxOptions",
9
- props: {
10
- options: {},
11
- modelValue: {},
12
- placeholder: {},
13
- multiselect: { type: Boolean },
14
- isDeletable: { type: Boolean }
15
- },
16
- emits: ["update:modelValue", "delete"],
17
- setup(A, { emit: G }) {
18
- var C;
19
- const a = A, K = G, m = `scalar-combobox-items-${F()}`;
20
- function p(e) {
21
- return `${m}-${e.id}`;
22
- }
23
- const f = b(
24
- () => z(a.options) ? a.options.flatMap((e) => e.options) : a.options
25
- ), O = b(
26
- () => z(a.options) ? a.options : [{ label: "", options: a.options }]
27
- ), r = h(""), o = h(
28
- ((C = a.modelValue) == null ? void 0 : C[0]) ?? f.value[0]
29
- );
30
- M(async () => {
31
- var e;
32
- r.value = "", o.value = ((e = a.modelValue) == null ? void 0 : e[0]) ?? f.value[0], s.value.length !== 0 && setTimeout(() => {
33
- var t;
34
- (t = document == null ? void 0 : document.getElementById(p(s.value[0]))) == null || t.scrollIntoView({ block: "nearest" });
35
- }, 10);
36
- }), U(
37
- () => r.value,
38
- () => o.value = c.value[0]
39
- );
40
- const c = b(
41
- () => r.value === "" ? f.value : f.value.filter((e) => e.label.toLowerCase().includes(r.value.toLowerCase()))
42
- ), s = b({
43
- get: () => a.modelValue ?? [],
44
- set: (e) => e && K("update:modelValue", e)
45
- });
46
- function k(e) {
47
- a.multiselect ? s.value.some((t) => t.id === e.id) ? s.value = s.value.filter((t) => t.id !== e.id) : s.value = [...s.value, e] : s.value = [e];
48
- }
49
- function I(e) {
50
- var l;
51
- const t = c.value, u = t.findIndex((d) => {
52
- var i;
53
- return d.id === ((i = o.value) == null ? void 0 : i.id);
54
- }) + e;
55
- u < 0 || u > t.length - 1 || (o.value = t[u], (l = document == null ? void 0 : document.getElementById(p(o.value))) == null || l.scrollIntoView({
56
- behavior: "smooth",
57
- block: "nearest"
58
- }));
59
- }
60
- const D = h(null);
61
- return M(() => setTimeout(() => {
62
- var e;
63
- return (e = D.value) == null ? void 0 : e.focus();
64
- }, 0)), (e, t) => (v(), y($, null, [
65
- w("div", Z, [
66
- j(H(W), { class: "pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-c-3 size-4" }),
67
- B(w("input", {
68
- "onUpdate:modelValue": t[0] || (t[0] = (n) => r.value = n),
69
- ref_key: "input",
70
- ref: D,
71
- "aria-activedescendant": o.value ? p(o.value) : void 0,
72
- "aria-autocomplete": "list",
73
- "aria-controls": m,
74
- class: "min-w-0 flex-1 rounded border-0 py-2.5 pl-8 pr-3 leading-none text-c-1 -outline-offset-1",
75
- "data-1p-ignore": "",
76
- placeholder: e.placeholder,
77
- role: "combobox",
78
- tabindex: "0",
79
- type: "text",
80
- onKeydown: [
81
- t[1] || (t[1] = x(g((n) => I(1), ["prevent"]), ["down"])),
82
- t[2] || (t[2] = x(g((n) => o.value && k(o.value), ["prevent"]), ["enter"])),
83
- t[3] || (t[3] = x(g((n) => I(-1), ["prevent"]), ["up"]))
84
- ]
85
- }, null, 40, _), [
86
- [J, r.value]
87
- ])
88
- ]),
89
- B(w("ul", {
90
- id: m,
91
- "aria-multiselectable": e.multiselect,
92
- class: "border-t p-0.75 custom-scroll overscroll-contain flex-1 min-h-0",
93
- role: "listbox",
94
- tabindex: "-1"
95
- }, [
96
- S(e.$slots, "before"),
97
- (v(!0), y($, null, E(O.value, (n, u) => (v(), N(Y, {
98
- id: `${m}-group-${u}`,
99
- key: u,
100
- hidden: (
101
- // Only show the group label if there are some results
102
- !n.options.some((l) => c.value.some((d) => d.id === l.id)) || // And it has a label
103
- !n.label
104
- )
105
- }, {
106
- label: V(() => [
107
- T(L(n.label), 1)
108
- ]),
109
- default: V(() => [
110
- (v(!0), y($, null, E(c.value, (l) => {
111
- var d;
112
- return v(), y($, {
113
- key: l.id
114
- }, [
115
- n.options.some((i) => i.id === l.id) ? (v(), N(X, {
116
- key: 0,
117
- id: p(l),
118
- active: ((d = o.value) == null ? void 0 : d.id) === l.id,
119
- isDeletable: l.isDeletable ?? e.isDeletable,
120
- selected: s.value.some((i) => i.id === l.id),
121
- style: Q(e.multiselect ? "checkbox" : "radio"),
122
- onClick: (i) => k(l),
123
- onDelete: (i) => e.$emit("delete", l),
124
- onMousedown: t[4] || (t[4] = g(() => {
125
- }, ["prevent"])),
126
- onMouseenter: (i) => o.value = l
127
- }, {
128
- default: V(() => [
129
- T(L(l.label), 1)
130
- ]),
131
- _: 2
132
- }, 1032, ["id", "active", "isDeletable", "selected", "style", "onClick", "onDelete", "onMouseenter"])) : P("", !0)
133
- ], 64);
134
- }), 128))
135
- ]),
136
- _: 2
137
- }, 1032, ["id", "hidden"]))), 128)),
138
- S(e.$slots, "after")
139
- ], 8, ee), [
140
- [R, c.value.length || e.$slots.before || e.$slots.after]
141
- ])
142
- ], 64));
143
- }
144
- });
1
+ import o from "./ScalarComboboxOptions.vue2.js";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b76d72f2"]]);
145
5
  export {
146
- se as default
6
+ f as default
147
7
  };
@@ -1,4 +1,147 @@
1
- import f from "./ScalarComboboxOptions.vue.js";
1
+ import { defineComponent as q, useId as F, computed as b, ref as g, onMounted as M, watch as U, createElementBlock as y, openBlock as v, Fragment as $, createElementVNode as w, withDirectives as B, createVNode as j, unref as H, withKeys as x, withModifiers as h, vModelText as J, renderSlot as S, renderList as E, createBlock as N, withCtx as V, createCommentVNode as P, normalizeStyle as Q, createTextVNode as T, toDisplayString as L, vShow as R } from "vue";
2
+ import { ScalarIconMagnifyingGlass as W } from "@scalar/icons";
3
+ import X from "./ScalarComboboxOption.vue.js";
4
+ import Y from "./ScalarComboboxOptionGroup.vue.js";
5
+ import { isGroups as z } from "./types.js";
6
+ const Z = { class: "relative flex" }, _ = ["aria-activedescendant", "placeholder"], ee = ["aria-multiselectable"], ie = /* @__PURE__ */ q({
7
+ inheritAttrs: !1,
8
+ __name: "ScalarComboboxOptions",
9
+ props: {
10
+ options: {},
11
+ modelValue: {},
12
+ placeholder: {},
13
+ multiselect: { type: Boolean },
14
+ isDeletable: { type: Boolean }
15
+ },
16
+ emits: ["update:modelValue", "delete"],
17
+ setup(A, { emit: G }) {
18
+ var C;
19
+ const a = A, K = G, m = `scalar-combobox-items-${F()}`;
20
+ function p(e) {
21
+ return `${m}-${e.id}`;
22
+ }
23
+ const f = b(
24
+ () => z(a.options) ? a.options.flatMap((e) => e.options) : a.options
25
+ ), O = b(
26
+ () => z(a.options) ? a.options : [{ label: "", options: a.options }]
27
+ ), r = g(""), o = g(
28
+ ((C = a.modelValue) == null ? void 0 : C[0]) ?? f.value[0]
29
+ );
30
+ M(async () => {
31
+ var e;
32
+ r.value = "", o.value = ((e = a.modelValue) == null ? void 0 : e[0]) ?? f.value[0], i.value.length !== 0 && setTimeout(() => {
33
+ var t;
34
+ (t = document == null ? void 0 : document.getElementById(p(i.value[0]))) == null || t.scrollIntoView({ block: "nearest" });
35
+ }, 10);
36
+ }), U(
37
+ () => r.value,
38
+ () => o.value = c.value[0]
39
+ );
40
+ const c = b(
41
+ () => r.value === "" ? f.value : f.value.filter((e) => e.label.toLowerCase().includes(r.value.toLowerCase()))
42
+ ), i = b({
43
+ get: () => a.modelValue ?? [],
44
+ set: (e) => e && K("update:modelValue", e)
45
+ });
46
+ function k(e) {
47
+ a.multiselect ? i.value.some((t) => t.id === e.id) ? i.value = i.value.filter((t) => t.id !== e.id) : i.value = [...i.value, e] : i.value = [e];
48
+ }
49
+ function I(e) {
50
+ var l;
51
+ const t = c.value, u = t.findIndex((d) => {
52
+ var s;
53
+ return d.id === ((s = o.value) == null ? void 0 : s.id);
54
+ }) + e;
55
+ u < 0 || u > t.length - 1 || (o.value = t[u], (l = document == null ? void 0 : document.getElementById(p(o.value))) == null || l.scrollIntoView({
56
+ behavior: "smooth",
57
+ block: "nearest"
58
+ }));
59
+ }
60
+ const D = g(null);
61
+ return M(() => setTimeout(() => {
62
+ var e;
63
+ return (e = D.value) == null ? void 0 : e.focus();
64
+ }, 0)), (e, t) => (v(), y($, null, [
65
+ w("div", Z, [
66
+ j(H(W), { class: "pointer-events-none absolute left-2.5 search-icon text-c-3 size-4" }),
67
+ B(w("input", {
68
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => r.value = n),
69
+ ref_key: "input",
70
+ ref: D,
71
+ "aria-activedescendant": o.value ? p(o.value) : void 0,
72
+ "aria-autocomplete": "list",
73
+ "aria-controls": m,
74
+ class: "min-w-0 flex-1 rounded border-0 py-2.5 pl-8 pr-3 leading-none text-c-1 -outline-offset-1",
75
+ "data-1p-ignore": "",
76
+ placeholder: e.placeholder,
77
+ role: "combobox",
78
+ tabindex: "0",
79
+ type: "text",
80
+ onKeydown: [
81
+ t[1] || (t[1] = x(h((n) => I(1), ["prevent"]), ["down"])),
82
+ t[2] || (t[2] = x(h((n) => o.value && k(o.value), ["prevent"]), ["enter"])),
83
+ t[3] || (t[3] = x(h((n) => I(-1), ["prevent"]), ["up"]))
84
+ ]
85
+ }, null, 40, _), [
86
+ [J, r.value]
87
+ ])
88
+ ]),
89
+ B(w("ul", {
90
+ id: m,
91
+ "aria-multiselectable": e.multiselect,
92
+ class: "border-t p-0.75 custom-scroll overscroll-contain flex-1 min-h-0",
93
+ role: "listbox",
94
+ tabindex: "-1"
95
+ }, [
96
+ S(e.$slots, "before", {}, void 0, !0),
97
+ (v(!0), y($, null, E(O.value, (n, u) => (v(), N(Y, {
98
+ id: `${m}-group-${u}`,
99
+ key: u,
100
+ hidden: (
101
+ // Only show the group label if there are some results
102
+ !n.options.some((l) => c.value.some((d) => d.id === l.id)) || // And it has a label
103
+ !n.label
104
+ )
105
+ }, {
106
+ label: V(() => [
107
+ T(L(n.label), 1)
108
+ ]),
109
+ default: V(() => [
110
+ (v(!0), y($, null, E(c.value, (l) => {
111
+ var d;
112
+ return v(), y($, {
113
+ key: l.id
114
+ }, [
115
+ n.options.some((s) => s.id === l.id) ? (v(), N(X, {
116
+ key: 0,
117
+ id: p(l),
118
+ active: ((d = o.value) == null ? void 0 : d.id) === l.id,
119
+ isDeletable: l.isDeletable ?? e.isDeletable,
120
+ selected: i.value.some((s) => s.id === l.id),
121
+ style: Q(e.multiselect ? "checkbox" : "radio"),
122
+ onClick: (s) => k(l),
123
+ onDelete: (s) => e.$emit("delete", l),
124
+ onMousedown: t[4] || (t[4] = h(() => {
125
+ }, ["prevent"])),
126
+ onMouseenter: (s) => o.value = l
127
+ }, {
128
+ default: V(() => [
129
+ T(L(l.label), 1)
130
+ ]),
131
+ _: 2
132
+ }, 1032, ["id", "active", "isDeletable", "selected", "style", "onClick", "onDelete", "onMouseenter"])) : P("", !0)
133
+ ], 64);
134
+ }), 128))
135
+ ]),
136
+ _: 2
137
+ }, 1032, ["id", "hidden"]))), 128)),
138
+ S(e.$slots, "after", {}, void 0, !0)
139
+ ], 8, ee), [
140
+ [R, c.value.length || e.$slots.before || e.$slots.after]
141
+ ])
142
+ ], 64));
143
+ }
144
+ });
2
145
  export {
3
- f as default
146
+ ie as default
4
147
  };
@@ -1,27 +1,27 @@
1
1
  import { defineComponent as u, ref as c, createBlock as _, openBlock as v, unref as o, withCtx as t, createVNode as r, normalizeProps as y, guardReactiveProps as w, createSlots as x, renderSlot as l, mergeProps as B } from "vue";
2
2
  import { Popover as P, PopoverButton as h, PopoverPanel as k } from "@headlessui/vue";
3
3
  import { useBindCx as g } from "@scalar/use-hooks/useBindCx";
4
- import $ from "../ScalarFloating/ScalarFloating.vue.js";
5
- import C from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
4
+ import b from "../ScalarFloating/ScalarFloating.vue.js";
5
+ import $ from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
6
6
  const z = /* @__PURE__ */ u({
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarComboboxPopover",
9
9
  props: {
10
10
  placement: {},
11
- offset: {},
11
+ offset: { type: [Number, Object, Function] },
12
12
  resize: { type: Boolean },
13
13
  target: {},
14
14
  middleware: {},
15
15
  teleport: { type: [Boolean, String] }
16
16
  },
17
- setup(S, { expose: s }) {
17
+ setup(C, { expose: s }) {
18
18
  const { cx: f } = g(), p = c(null), i = (e) => {
19
19
  var n;
20
20
  ["ArrowUp", "ArrowDown"].includes(e.key) && (e.preventDefault(), (n = e.target) == null || n.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter" })));
21
21
  };
22
22
  return s({ popoverButtonRef: p }), (e, n) => (v(), _(o(P), { as: "template" }, {
23
23
  default: t(({ open: a }) => [
24
- r(o($), y(w(e.$props)), x({
24
+ r(o(b), y(w(e.$props)), x({
25
25
  default: t(() => [
26
26
  r(o(h), {
27
27
  ref_key: "popoverButtonRef",
@@ -51,7 +51,7 @@ const z = /* @__PURE__ */ u({
51
51
  close: d,
52
52
  open: a
53
53
  }),
54
- r(o(C))
54
+ r(o($))
55
55
  ]),
56
56
  _: 2
57
57
  }, 1040, ["style"])
@@ -1,42 +1,42 @@
1
- import { defineComponent as p, createBlock as i, openBlock as f, unref as e, withCtx as t, createVNode as r, mergeProps as n, renderSlot as s } from "vue";
2
- import { Menu as u, MenuButton as _, MenuItems as c } from "@headlessui/vue";
1
+ import { defineComponent as p, createBlock as i, openBlock as f, unref as e, withCtx as t, createVNode as r, mergeProps as a, renderSlot as s } from "vue";
2
+ import { Menu as u, MenuButton as c, MenuItems as _ } from "@headlessui/vue";
3
3
  import { useBindCx as d } from "@scalar/use-hooks/useBindCx";
4
4
  import B from "./ScalarDropdownMenu.vue.js";
5
5
  import h from "../ScalarFloating/ScalarFloating.vue.js";
6
- const $ = {}, x = /* @__PURE__ */ p({
7
- ...$,
6
+ const y = {}, k = /* @__PURE__ */ p({
7
+ ...y,
8
8
  inheritAttrs: !1,
9
9
  __name: "ScalarDropdown",
10
10
  props: {
11
11
  placement: {},
12
- offset: {},
12
+ offset: { type: [Number, Object, Function] },
13
13
  resize: { type: Boolean },
14
14
  target: {},
15
15
  middleware: {},
16
16
  teleport: { type: [Boolean, String] }
17
17
  },
18
- setup(g) {
18
+ setup($) {
19
19
  const { cx: l } = d();
20
- return (o, y) => (f(), i(e(u), null, {
21
- default: t(({ open: a }) => [
22
- r(e(h), n(o.$props, {
20
+ return (o, g) => (f(), i(e(u), null, {
21
+ default: t(({ open: n }) => [
22
+ r(e(h), a(o.$props, {
23
23
  placement: o.placement ?? "bottom-start"
24
24
  }), {
25
25
  floating: t(({ width: m }) => [
26
- r(B, n({
27
- is: e(c),
26
+ r(B, a({
27
+ is: e(_),
28
28
  style: { width: m }
29
29
  }, e(l)("max-h-[inherit]")), {
30
30
  default: t(() => [
31
- s(o.$slots, "items", { open: a })
31
+ s(o.$slots, "items", { open: n })
32
32
  ]),
33
33
  _: 2
34
34
  }, 1040, ["is", "style"])
35
35
  ]),
36
36
  default: t(() => [
37
- r(e(_), { as: "template" }, {
37
+ r(e(c), { as: "template" }, {
38
38
  default: t(() => [
39
- s(o.$slots, "default", { open: a })
39
+ s(o.$slots, "default", { open: n })
40
40
  ]),
41
41
  _: 2
42
42
  }, 1024)
@@ -49,5 +49,5 @@ const $ = {}, x = /* @__PURE__ */ p({
49
49
  }
50
50
  });
51
51
  export {
52
- x as default
52
+ k as default
53
53
  };
@@ -1,8 +1,8 @@
1
- import { defineComponent as x, mergeModels as _, useModel as v, createElementBlock as o, openBlock as i, normalizeProps as g, guardReactiveProps as C, unref as l, createElementVNode as t, Fragment as V, renderList as k, toDisplayString as n, createVNode as d, withCtx as a, createTextVNode as m } from "vue";
1
+ import { defineComponent as _, mergeModels as x, useModel as v, createElementBlock as o, openBlock as i, normalizeProps as g, guardReactiveProps as C, unref as l, createElementVNode as t, Fragment as V, renderList as k, toDisplayString as n, createVNode as d, withCtx as a, createTextVNode as m } from "vue";
2
2
  import { useBindCx as y } from "@scalar/use-hooks/useBindCx";
3
3
  import z from "pretty-bytes";
4
4
  import u from "../ScalarButton/ScalarButton.vue.js";
5
- const B = { class: "border rounded p-1 text-xs" }, $ = { class: "flex items-center justify-between" }, w = { class: "flex-1 min-w-0 truncate" }, F = { class: "text-c-3" }, M = { class: "flex items-center gap-1.5" }, N = {}, P = /* @__PURE__ */ x({
5
+ const B = { class: "border rounded p-1 text-xs" }, $ = { class: "flex items-center justify-between" }, w = { class: "flex-1 min-w-0 truncate" }, F = { class: "text-c-3" }, M = { class: "flex items-center gap-1.5" }, N = {}, P = /* @__PURE__ */ _({
6
6
  ...N,
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarFileUploadFileList",
@@ -10,7 +10,7 @@ const B = { class: "border rounded p-1 text-xs" }, $ = { class: "flex items-cent
10
10
  modelValue: {},
11
11
  modelModifiers: {}
12
12
  },
13
- emits: /* @__PURE__ */ _(["upload"], ["update:modelValue"]),
13
+ emits: /* @__PURE__ */ x(["upload"], ["update:modelValue"]),
14
14
  setup(p) {
15
15
  const r = v(p, "modelValue"), { cx: f } = y();
16
16
  return (c, e) => (i(), o("div", g(C(l(f)("flex flex-col gap-2 p-4"))), [
@@ -34,7 +34,8 @@ const B = { class: "border rounded p-1 text-xs" }, $ = { class: "flex items-cent
34
34
  default: a(() => e[2] || (e[2] = [
35
35
  m(" Upload ")
36
36
  ])),
37
- _: 1
37
+ _: 1,
38
+ __: [2]
38
39
  }),
39
40
  d(l(u), {
40
41
  size: "sm",
@@ -44,7 +45,8 @@ const B = { class: "border rounded p-1 text-xs" }, $ = { class: "flex items-cent
44
45
  default: a(() => e[3] || (e[3] = [
45
46
  m(" Clear ")
46
47
  ])),
47
- _: 1
48
+ _: 1,
49
+ __: [3]
48
50
  })
49
51
  ])
50
52
  ], 16));
@@ -32,7 +32,8 @@ const v = { class: "flex items-center gap-1.5 whitespace-nowrap" }, B = { class:
32
32
  default: x(() => e[2] || (e[2] = [
33
33
  o(" Browse files ")
34
34
  ])),
35
- _: 1
35
+ _: 1,
36
+ __: [2]
36
37
  })
37
38
  ]),
38
39
  r(t.$slots, "sublabel", {}, () => [
@@ -1,14 +1,14 @@
1
- import { defineComponent as w, ref as d, computed as a, createElementBlock as z, openBlock as s, Fragment as S, createElementVNode as m, createBlock as $, createCommentVNode as k, normalizeClass as B, renderSlot as u, unref as o, withCtx as R, normalizeStyle as b } from "vue";
2
- import { getSideAxis as g } from "@floating-ui/utils";
3
- import { useFloating as x, autoUpdate as E, offset as C, flip as F, shift as M, size as H } from "@floating-ui/vue";
4
- import { useResizeWithTarget as T } from "./useResizeWithTarget.js";
5
- import W from "../ScalarTeleport/ScalarTeleport.vue.js";
6
- const I = /* @__PURE__ */ w({
1
+ import { defineComponent as w, ref as d, computed as a, createElementBlock as z, openBlock as s, Fragment as S, createElementVNode as m, createBlock as $, createCommentVNode as b, normalizeClass as k, renderSlot as u, unref as o, withCtx as B, normalizeStyle as R } from "vue";
2
+ import { getSideAxis as c } from "@floating-ui/utils";
3
+ import { useFloating as x, autoUpdate as E, offset as F, flip as C, shift as M, size as H } from "@floating-ui/vue";
4
+ import { useResizeWithTarget as N } from "./useResizeWithTarget.js";
5
+ import T from "../ScalarTeleport/ScalarTeleport.vue.js";
6
+ const D = /* @__PURE__ */ w({
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarFloating",
9
9
  props: {
10
10
  placement: { default: "bottom" },
11
- offset: { default: 5 },
11
+ offset: { type: [Number, Object, Function], default: 5 },
12
12
  resize: { type: Boolean, default: !1 },
13
13
  target: {},
14
14
  middleware: { default: () => [] },
@@ -27,18 +27,18 @@ const I = /* @__PURE__ */ w({
27
27
  return t.target;
28
28
  return ((e = n.value.children) == null ? void 0 : e[0]) || n.value;
29
29
  }
30
- }), f = T(r, {
30
+ }), f = N(r, {
31
31
  enabled: a(() => t.resize)
32
- }), c = a(
33
- () => g(t.placement) === "y" ? f.width.value : void 0
32
+ }), g = a(
33
+ () => c(t.placement) === "y" ? f.width.value : void 0
34
34
  ), h = a(
35
- () => g(t.placement) === "x" ? f.height.value : void 0
35
+ () => c(t.placement) === "x" ? f.height.value : void 0
36
36
  ), { floatingStyles: p, middlewareData: y } = x(r, i, {
37
37
  placement: a(() => t.placement),
38
38
  whileElementsMounted: E,
39
39
  middleware: a(() => [
40
- C(t.offset),
41
- F(),
40
+ F(t.offset),
41
+ C(),
42
42
  M(),
43
43
  H({
44
44
  apply({ availableWidth: e, availableHeight: l, elements: v }) {
@@ -55,34 +55,34 @@ const I = /* @__PURE__ */ w({
55
55
  m("div", {
56
56
  ref_key: "wrapperRef",
57
57
  ref: n,
58
- class: B({ contents: !!e.$slots.default })
58
+ class: k({ contents: !!e.$slots.default })
59
59
  }, [
60
60
  u(e.$slots, "default")
61
61
  ], 2),
62
- e.$slots.floating ? (s(), $(o(W), {
62
+ e.$slots.floating ? (s(), $(o(T), {
63
63
  key: 0,
64
64
  disabled: !e.teleport,
65
65
  to: typeof e.teleport == "string" ? e.teleport : void 0
66
66
  }, {
67
- default: R(() => [
67
+ default: B(() => [
68
68
  m("div", {
69
69
  ref_key: "floatingRef",
70
70
  ref: i,
71
71
  class: "relative z-context",
72
- style: b(o(p))
72
+ style: R(o(p))
73
73
  }, [
74
74
  u(e.$slots, "floating", {
75
75
  data: o(y),
76
76
  height: h.value,
77
- width: c.value
77
+ width: g.value
78
78
  })
79
79
  ], 4)
80
80
  ]),
81
81
  _: 3
82
- }, 8, ["disabled", "to"])) : k("", !0)
82
+ }, 8, ["disabled", "to"])) : b("", !0)
83
83
  ], 64));
84
84
  }
85
85
  });
86
86
  export {
87
- I as default
87
+ D as default
88
88
  };
@@ -1,10 +1,10 @@
1
- import { defineComponent as c, createBlock as i, openBlock as o, unref as t, withCtx as l, createCommentVNode as n, createVNode as r, createTextVNode as y, toDisplayString as b, mergeProps as p, renderSlot as V, createElementBlock as d, createElementVNode as B, Fragment as _, renderList as g, normalizeStyle as k } from "vue";
1
+ import { defineComponent as c, createBlock as i, openBlock as o, unref as t, withCtx as l, createCommentVNode as s, createVNode as r, createTextVNode as b, toDisplayString as y, mergeProps as p, renderSlot as V, createElementBlock as d, createElementVNode as B, Fragment as _, renderList as g, normalizeStyle as k } from "vue";
2
2
  import { Listbox as x, ListboxLabel as L, ListboxButton as h, ListboxOptions as $ } from "@headlessui/vue";
3
- import { useBindCx as S } from "@scalar/use-hooks/useBindCx";
4
- import C from "./ScalarListboxItem.vue.js";
5
- import N from "../ScalarFloating/ScalarFloating.vue.js";
3
+ import { useBindCx as N } from "@scalar/use-hooks/useBindCx";
4
+ import S from "./ScalarListboxItem.vue.js";
5
+ import C from "../ScalarFloating/ScalarFloating.vue.js";
6
6
  import v from "../ScalarFloating/ScalarFloatingBackdrop.vue.js";
7
- const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
7
+ const w = { class: "custom-scroll min-h-0 flex-1" }, P = /* @__PURE__ */ c({
8
8
  inheritAttrs: !1,
9
9
  __name: "ScalarListbox",
10
10
  props: {
@@ -14,7 +14,7 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
14
14
  multiple: { type: Boolean },
15
15
  modelValue: {},
16
16
  placement: {},
17
- offset: {},
17
+ offset: { type: [Number, Object, Function] },
18
18
  resize: { type: Boolean },
19
19
  target: {},
20
20
  middleware: {},
@@ -22,7 +22,7 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
22
22
  },
23
23
  emits: ["update:modelValue"],
24
24
  setup(z) {
25
- const { cx: u } = S();
25
+ const { cx: u } = N();
26
26
  return (e, m) => (o(), i(t(x), {
27
27
  modelValue: e.modelValue,
28
28
  multiple: e.multiple,
@@ -34,11 +34,11 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
34
34
  class: "sr-only"
35
35
  }, {
36
36
  default: l(() => [
37
- y(b(e.label), 1)
37
+ b(y(e.label), 1)
38
38
  ]),
39
39
  _: 1
40
- })) : n("", !0),
41
- r(t(N), p(e.$props, {
40
+ })) : s("", !0),
41
+ r(t(C), p(e.$props, {
42
42
  placement: e.placement ?? "bottom-start"
43
43
  }), {
44
44
  floating: l(({ width: f }) => [
@@ -49,9 +49,9 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
49
49
  B("div", w, [
50
50
  r(t($), { class: "flex flex-col gap-0.75 p-0.75 -outline-offset-1" }, {
51
51
  default: l(() => [
52
- (o(!0), d(_, null, g(e.options, (s) => (o(), i(C, {
53
- key: s.id,
54
- option: s,
52
+ (o(!0), d(_, null, g(e.options, (n) => (o(), i(S, {
53
+ key: n.id,
54
+ option: n,
55
55
  style: k(e.multiple ? "checkbox" : "radio")
56
56
  }, null, 8, ["option", "style"]))), 128))
57
57
  ]),
@@ -59,7 +59,7 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
59
59
  })
60
60
  ]),
61
61
  r(t(v))
62
- ], 16)) : n("", !0)
62
+ ], 16)) : s("", !0)
63
63
  ]),
64
64
  default: l(() => [
65
65
  r(t(h), {
@@ -80,5 +80,5 @@ const w = { class: "custom-scroll min-h-0 flex-1" }, T = /* @__PURE__ */ c({
80
80
  }
81
81
  });
82
82
  export {
83
- T as default
83
+ P as default
84
84
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/ScalarMarkdown.vue"],"names":[],"mappings":"AAsFA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;gBAPa,OAAO;iBAKN,OAAO;;AAsHzB,wBAQG"}
1
+ {"version":3,"file":"ScalarMarkdown.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMarkdown/ScalarMarkdown.vue"],"names":[],"mappings":"AAirBA,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IACxB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;;gBAPa,OAAO;iBAKN,OAAO;;AAsHzB,wBAQG"}
@@ -24,7 +24,8 @@ const w = /* @__PURE__ */ p({
24
24
  default: n(() => e[3] || (e[3] = [
25
25
  l(" Dashboard ")
26
26
  ])),
27
- _: 1
27
+ _: 1,
28
+ __: [3]
28
29
  }, 8, ["href", "icon", "selected"]),
29
30
  t(d, {
30
31
  href: ((a = o.hrefs) == null ? void 0 : a.docs) ?? "https://docs.scalar.com",
@@ -35,7 +36,8 @@ const w = /* @__PURE__ */ p({
35
36
  default: n(() => e[4] || (e[4] = [
36
37
  l(" Docs ")
37
38
  ])),
38
- _: 1
39
+ _: 1,
40
+ __: [4]
39
41
  }, 8, ["href", "icon", "selected"]),
40
42
  t(d, {
41
43
  href: ((f = o.hrefs) == null ? void 0 : f.client) ?? "https://client.scalar.com",
@@ -46,7 +48,8 @@ const w = /* @__PURE__ */ p({
46
48
  default: n(() => e[5] || (e[5] = [
47
49
  l(" Client ")
48
50
  ])),
49
- _: 1
51
+ _: 1,
52
+ __: [5]
50
53
  }, 8, ["href", "icon", "selected"])
51
54
  ], 16);
52
55
  };