@scalar/api-client 2.0.26 → 2.0.27

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 2.0.27
4
+
5
+ ### Patch Changes
6
+
7
+ - 19d8b6a: feat: animate sidebar icon
8
+ - c112f24: fix: remove ScalarCodeBlock that freezes browser in response preview
9
+ - 83fc241: fix: constantly adding empty header
10
+ - 2e1ef12: fix: set content type on body change and add proper header
11
+ - Updated dependencies [19d8b6a]
12
+ - Updated dependencies [c112f24]
13
+ - @scalar/components@0.12.18
14
+ - @scalar/use-codemirror@0.11.8
15
+
3
16
  ## 2.0.26
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OAuRO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,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;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"CodeInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/CodeInput.vue"],"names":[],"mappings":"AAAA,OA0RO,EAGL,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAA;;kBAeb,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;kBAlBP,OAAO;gBACT,MAAM,GAAG,MAAM;YACnB,OAAO;iBACF,OAAO;kBACN,OAAO;WACd,OAAO;uBACK,OAAO;eACf,kBAAkB;wBACT,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;wBACnB,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI;kBACzB,MAAM;eACT,OAAO;mBACH,OAAO;2BACC,OAAO;WACvB,MAAM,EAAE;WACR,MAAM;eACF,OAAO;oBACF,OAAO;kBACT,OAAO;;;;;;;;;;;;;;cAFV,OAAO;iBAEJ,OAAO;iBAlBP,OAAO;gBAGR,OAAO;sBAGD,OAAO;kBAMX,OAAO;0BACC,OAAO;mBAId,OAAO;;qBA2PG,GAAG;kBACN,GAAG;;AAhR9B,wBAmTC;AAMD,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./CodeInput.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import t from "../../_virtual/_plugin-vue_export-helper.js";
5
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-ee1f4723"]]);
5
+ const c = /* @__PURE__ */ t(o, [["__scopeId", "data-v-5c9fc64f"]]);
6
6
  export {
7
- f as default
7
+ c as default
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AA+F/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
1
+ {"version":3,"file":"codeVariableWidget.d.ts","sourceRoot":"","sources":["../../../src/components/CodeInput/codeVariableWidget.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,UAAU,EACV,KAAK,aAAa,EAClB,UAAU,EAEV,UAAU,EACV,KAAK,UAAU,EAEhB,MAAM,wBAAwB,CAAA;AAqH/B,eAAO,MAAM,UAAU;iBAEN,aAAa;mBAMX,UAAU;2BAMF,UAAU;EA6BpC,CAAA;AAED,eAAO,MAAM,gBAAgB,uCAmB3B,CAAA"}
@@ -1,30 +1,32 @@
1
1
  var u = Object.defineProperty;
2
- var f = (t, a, e) => a in t ? u(t, a, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[a] = e;
3
- var c = (t, a, e) => f(t, typeof a != "symbol" ? a + "" : a, e);
2
+ var f = (e, n, t) => n in e ? u(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
3
+ var c = (e, n, t) => f(e, typeof n != "symbol" ? n + "" : n, t);
4
4
  import { useWorkspace as v } from "../../store/workspace.js";
5
- import { ScalarButton as h, ScalarIcon as b, ScalarTooltip as g } from "@scalar/components";
5
+ import { ScalarButton as g, ScalarIcon as b, ScalarTooltip as h } from "@scalar/components";
6
6
  import { ViewPlugin as x, RangeSetBuilder as w, Decoration as N, EditorView as y, WidgetType as C } from "@scalar/use-codemirror";
7
- import { defineComponent as k, h as o, createApp as D } from "vue";
8
- const { activeParsedEnvironments: S, isReadOnly: E } = v();
7
+ import { defineComponent as E, h as s, createApp as k } from "vue";
8
+ const { activeParsedEnvironments: D, isReadOnly: S, environments: $ } = v(), A = (e) => "_scalarEnvId" in e ? `bg-${$[e._scalarEnvId].color}` : "bg-grey";
9
9
  class l extends C {
10
- constructor(e) {
10
+ constructor(t) {
11
11
  super();
12
12
  c(this, "app");
13
- this.variableName = e;
13
+ this.variableName = t;
14
14
  }
15
15
  toDOM() {
16
- const e = document.createElement("span");
17
- e.className = "cm-pill", e.textContent = `${this.variableName}`;
18
- const n = k({
16
+ const t = document.createElement("span");
17
+ t.className = "cm-pill", t.textContent = `${this.variableName}`;
18
+ const a = E({
19
19
  props: ["variableName"],
20
20
  render() {
21
- const s = S.value.find(
21
+ const o = D.value.find(
22
22
  (i) => i.key === this.variableName
23
- ), r = s ? o("div", { class: "p-2" }, s.value) : o("div", { class: "divide-y divide-1/2 grid" }, [
24
- o("span", { class: "p-2" }, "Variable not found"),
25
- !E.value && o("div", { class: "p-1" }, [
26
- o(
27
- h,
23
+ );
24
+ o && (t.className += ` ${A(o)}`);
25
+ const r = o ? s("div", { class: "p-2" }, o.value) : s("div", { class: "divide-y divide-1/2 grid" }, [
26
+ s("span", { class: "p-2" }, "Variable not found"),
27
+ !S.value && s("div", { class: "p-1" }, [
28
+ s(
29
+ g,
28
30
  {
29
31
  class: "gap-1.5 justify-start font-normal px-1 py-1.5 h-auto transition-colors rounded no-underline text-xxs w-full hover:bg-b-2",
30
32
  variant: "ghost",
@@ -33,14 +35,14 @@ class l extends C {
33
35
  }
34
36
  },
35
37
  [
36
- o(b, { class: "w-2", icon: "Add", size: "xs" }),
38
+ s(b, { class: "w-2", icon: "Add", size: "xs" }),
37
39
  "Add variable"
38
40
  ]
39
41
  )
40
42
  ])
41
43
  ]);
42
- return o(
43
- g,
44
+ return s(
45
+ h,
44
46
  {
45
47
  align: "start",
46
48
  class: "bg-b-1 w-full",
@@ -49,8 +51,8 @@ class l extends C {
49
51
  sideOffset: 6
50
52
  },
51
53
  {
52
- trigger: () => o("span", `${this.variableName}`),
53
- content: () => o(
54
+ trigger: () => s("span", `${this.variableName}`),
55
+ content: () => s(
54
56
  "div",
55
57
  {
56
58
  class: "w-content shadow-lg rounded bg-b-1 text-xxs leading-5 text-c-1"
@@ -61,35 +63,35 @@ class l extends C {
61
63
  );
62
64
  }
63
65
  });
64
- return this.app = D(n, { variableName: this.variableName }), this.app.mount(e), e;
66
+ return this.app = k(a, { variableName: this.variableName }), this.app.mount(t), t;
65
67
  }
66
68
  destroy() {
67
69
  this.app && this.app.unmount();
68
70
  }
69
- eq(e) {
70
- return e instanceof l && e.variableName === this.variableName;
71
+ eq(t) {
72
+ return t instanceof l && t.variableName === this.variableName;
71
73
  }
72
- ignoreEvent(e) {
74
+ ignoreEvent(t) {
73
75
  return !1;
74
76
  }
75
77
  }
76
78
  const V = x.fromClass(
77
79
  class {
78
- constructor(t) {
80
+ constructor(e) {
79
81
  c(this, "decorations");
80
- this.decorations = this.buildDecorations(t);
82
+ this.decorations = this.buildDecorations(e);
81
83
  }
82
- update(t) {
83
- (t.docChanged || t.viewportChanged) && (this.decorations = this.buildDecorations(t.view));
84
+ update(e) {
85
+ (e.docChanged || e.viewportChanged) && (this.decorations = this.buildDecorations(e.view));
84
86
  }
85
- buildDecorations(t) {
86
- const a = new w();
87
- for (const { from: e, to: n } of t.visibleRanges) {
88
- const s = t.state.doc.sliceString(e, n), r = /{{(.*?)}}/g;
87
+ buildDecorations(e) {
88
+ const n = new w();
89
+ for (const { from: t, to: a } of e.visibleRanges) {
90
+ const o = e.state.doc.sliceString(t, a), r = /{{(.*?)}}/g;
89
91
  let i;
90
- for (; (i = r.exec(s)) !== null; ) {
91
- const d = e + i.index, p = d + i[0].length, m = i[1];
92
- a.add(
92
+ for (; (i = r.exec(o)) !== null; ) {
93
+ const d = t + i.index, p = d + i[0].length, m = i[1];
94
+ n.add(
93
95
  d,
94
96
  p,
95
97
  N.widget({
@@ -99,21 +101,21 @@ const V = x.fromClass(
99
101
  );
100
102
  }
101
103
  }
102
- return a.finish();
104
+ return n.finish();
103
105
  }
104
106
  },
105
107
  {
106
- decorations: (t) => t.decorations
108
+ decorations: (e) => e.decorations
107
109
  }
108
110
  ), T = y.domEventHandlers({
109
- keydown(t, a) {
110
- if (t.key === "Backspace") {
111
- const { state: e } = a, { from: n, to: s } = e.selection.main;
112
- if (n === s && n > 0 && e.doc.sliceString(n - 2, n) === "}}")
113
- return a.dispatch({
114
- changes: { from: n - 2, to: s },
115
- selection: { anchor: n - 2 }
116
- }), t.preventDefault(), !0;
111
+ keydown(e, n) {
112
+ if (e.key === "Backspace") {
113
+ const { state: t } = n, { from: a, to: o } = t.selection.main;
114
+ if (a === o && a > 0 && t.doc.sliceString(a - 2, a) === "}}")
115
+ return n.dispatch({
116
+ changes: { from: a - 2, to: o },
117
+ selection: { anchor: a - 2 }
118
+ }), e.preventDefault(), !0;
117
119
  }
118
120
  return !1;
119
121
  }
@@ -1 +1 @@
1
- {"version":3,"file":"HttpMethod.vue.d.ts","sourceRoot":"","sources":["../../../src/components/HttpMethod/HttpMethod.vue"],"names":[],"mappings":";eA0Ge,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;eAFT,OAAO;YACV,MAAM;iBACD,OAAO;;;;;;;;cAFT,OAAO;gBAEL,OAAO;;AA8JxB,wBAOG;AAOH,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAC7C,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KAAC,CAAC,GACvC,CAAC,CAAC,CAAC,CAAC;CACP,CAAC;AAEN,KAAK,cAAc,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC;AAExD,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -1,8 +1,8 @@
1
- import { defineComponent as S, computed as s, openBlock as i, createBlock as c, unref as a, withCtx as k, createElementVNode as r, normalizeClass as l, toDisplayString as p, createCommentVNode as q, createElementBlock as y } from "vue";
2
- import { ScalarListbox as x, ScalarIcon as C } from "@scalar/components";
1
+ import { defineComponent as g, computed as s, openBlock as i, createBlock as m, unref as t, withCtx as y, createElementVNode as r, normalizeClass as l, toDisplayString as p, createCommentVNode as q, createElementBlock as k } from "vue";
2
+ import { ScalarListbox as C, ScalarIcon as x } from "@scalar/components";
3
3
  import { getRequest as B, REQUEST_METHODS as V } from "@scalar/oas-utils/helpers";
4
- import { cva as D, cx as b } from "cva";
5
- const z = /* @__PURE__ */ S({
4
+ import { cva as w, cx as f } from "cva";
5
+ const z = /* @__PURE__ */ g({
6
6
  __name: "HttpMethod",
7
7
  props: {
8
8
  isSquare: { type: Boolean, default: !1 },
@@ -10,17 +10,17 @@ const z = /* @__PURE__ */ S({
10
10
  isEditable: { type: Boolean, default: !1 }
11
11
  },
12
12
  emits: ["change"],
13
- setup(f, { emit: v }) {
14
- const n = f, h = v, t = s(() => B(n.method)), u = Object.entries(V).map(
15
- ([e, { short: o }]) => ({ id: e, label: o })
13
+ setup(b, { emit: v }) {
14
+ const n = b, h = v, o = s(() => B(n.method)), u = Object.entries(V).map(
15
+ ([e, { short: a }]) => ({ id: e, label: a })
16
16
  ), d = s({
17
17
  get: () => u.find(({ id: e }) => e === n.method),
18
18
  set: (e) => (e == null ? void 0 : e.id) && h("change", e.id)
19
- }), m = D({
19
+ }), c = w({
20
20
  base: "text-center font-code text-3xs justify-center items-center flex",
21
21
  variants: {
22
22
  isSquare: {
23
- true: "px-2.5 rounded-md bg-mix-transparent bg-mix-amount-90 dark:bg-mix-amount-80",
23
+ true: "px-2.5 rounded-md shadow-border",
24
24
  false: "rounded-full"
25
25
  },
26
26
  isEditable: {
@@ -28,32 +28,25 @@ const z = /* @__PURE__ */ S({
28
28
  false: "cusor-pointer"
29
29
  }
30
30
  }
31
- }), E = s(() => t.value.short);
32
- return (e, o) => e.isEditable ? (i(), c(a(x), {
31
+ }), E = s(() => o.value.short);
32
+ return (e, a) => e.isEditable ? (i(), m(t(C), {
33
33
  key: 0,
34
34
  modelValue: d.value,
35
- "onUpdate:modelValue": o[0] || (o[0] = (g) => d.value = g),
36
- options: a(u)
35
+ "onUpdate:modelValue": a[0] || (a[0] = (S) => d.value = S),
36
+ options: t(u)
37
37
  }, {
38
- default: k(() => [
38
+ default: y(() => [
39
39
  r("div", {
40
40
  class: l(["h-full", { "pointer-events-none": !e.isEditable }])
41
41
  }, [
42
42
  r("button", {
43
- class: l([
44
- "relative h-full gap-1",
45
- a(b)(
46
- a(m)({ isSquare: e.isSquare, isEditable: e.isEditable }),
47
- t.value.color,
48
- e.isSquare && t.value.backgroundColor
49
- )
50
- ]),
43
+ class: l(["relative h-full gap-1", t(f)(t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }), o.value.color)]),
51
44
  type: "button"
52
45
  }, [
53
46
  r("span", null, p(E.value), 1),
54
- e.isEditable ? (i(), c(a(C), {
47
+ e.isEditable ? (i(), m(t(x), {
55
48
  key: 0,
56
- class: l(t.value.color),
49
+ class: l(o.value.color),
57
50
  icon: "ChevronDown",
58
51
  size: "xs"
59
52
  }, null, 8, ["class"])) : q("", !0)
@@ -61,18 +54,18 @@ const z = /* @__PURE__ */ S({
61
54
  ], 2)
62
55
  ]),
63
56
  _: 1
64
- }, 8, ["modelValue", "options"])) : (i(), y("div", {
57
+ }, 8, ["modelValue", "options"])) : (i(), k("div", {
65
58
  key: 1,
66
59
  class: l([
67
60
  "relative gap-1",
68
- a(b)(
69
- a(m)({ isSquare: e.isSquare, isEditable: e.isEditable }),
70
- t.value.color,
71
- e.isSquare && t.value.backgroundColor
61
+ t(f)(
62
+ t(c)({ isSquare: e.isSquare, isEditable: e.isEditable }),
63
+ o.value.color,
64
+ e.isSquare && o.value.backgroundColor
72
65
  )
73
66
  ]),
74
67
  type: "button"
75
- }, p(t.value.short), 3));
68
+ }, p(o.value.short), 3));
76
69
  }
77
70
  });
78
71
  export {
@@ -0,0 +1,20 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToOption<{
2
+ modelValue: boolean;
3
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
4
+ "update:modelValue": (v: boolean) => void;
5
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToOption<{
6
+ modelValue: boolean;
7
+ }>>> & {
8
+ "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
9
+ }, {}, {}>;
10
+ export default _default;
11
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
12
+ type __VLS_TypePropsToOption<T> = {
13
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
14
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
15
+ } : {
16
+ type: import('vue').PropType<T[K]>;
17
+ required: true;
18
+ };
19
+ };
20
+ //# sourceMappingURL=SidebarToggle.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Sidebar/SidebarToggle.vue"],"names":[],"mappings":";gBA+Cc,OAAO;;;;gBAAP,OAAO;;;;AAiErB,wBAOG;AAOH,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { defineComponent as s, openBlock as l, createElementBlock as n, createElementVNode as e, normalizeClass as r } from "vue";
2
+ const a = {
3
+ class: "size-3.5",
4
+ fill: "none",
5
+ viewBox: "0 0 24 24",
6
+ xmlns: "http://www.w3.org/2000/svg"
7
+ }, d = /* @__PURE__ */ e("defs", null, [
8
+ /* @__PURE__ */ e("clipPath", { id: "mask" }, [
9
+ /* @__PURE__ */ e("path", {
10
+ "clip-rule": "evenodd",
11
+ d: "M9 3.2H4c-1.7 0-3 1.3-3 3v11.5c0 1.7 1.3 3 3 3h5V3.2z"
12
+ })
13
+ ])
14
+ ], -1), i = { "clip-path": "url(#mask)" }, c = /* @__PURE__ */ e("path", {
15
+ d: "M20 20.8H4c-1.7 0-3-1.3-3-3V6.2c0-1.7 1.3-3 3-3h16c1.7 0 3 1.3 3 3v11.5c0 1.7-1.3 3-3 3zM9 3.2v17.5",
16
+ stroke: "currentColor",
17
+ "stroke-linecap": "round",
18
+ "stroke-linejoin": "round",
19
+ "stroke-width": "2"
20
+ }, null, -1), h = /* @__PURE__ */ s({
21
+ __name: "SidebarToggle",
22
+ props: {
23
+ modelValue: { type: Boolean }
24
+ },
25
+ emits: ["update:modelValue"],
26
+ setup(u) {
27
+ return (t, o) => (l(), n("button", {
28
+ class: "text-c-3 hover:bg-b-3 active:text-c-1 p-2 rounded",
29
+ type: "button",
30
+ onClick: o[0] || (o[0] = (p) => t.$emit("update:modelValue", !t.modelValue))
31
+ }, [
32
+ (l(), n("svg", a, [
33
+ d,
34
+ e("g", i, [
35
+ e("path", {
36
+ class: r(["transition-transform duration-300", t.modelValue ? "translate-x-0" : "-translate-x-1/2"]),
37
+ d: "M1 3.2h8v17.5H1z",
38
+ fill: "currentColor"
39
+ }, null, 2)
40
+ ]),
41
+ c
42
+ ]))
43
+ ]));
44
+ }
45
+ });
46
+ export {
47
+ h as default
48
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./SidebarToggle.vue.js";
2
+ export {
3
+ f as default
4
+ };