@scalar/components 0.13.25 → 0.13.26

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 (54) hide show
  1. package/dist/components/ScalarButton/variants.d.ts.map +1 -1
  2. package/dist/components/ScalarButton/variants.js +2 -8
  3. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.d.ts +1 -1
  4. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.d.ts.map +1 -1
  5. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.js +2 -2
  6. package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +14 -11
  7. package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
  8. package/dist/components/ScalarFileUpload/ScalarFileUpload.stories.d.ts.map +1 -1
  9. package/dist/components/ScalarFileUpload/types.d.ts.map +1 -1
  10. package/dist/components/ScalarFloating/useResizeWithTarget.d.ts.map +1 -1
  11. package/dist/components/ScalarFloating/useResizeWithTarget.js +2 -6
  12. package/dist/components/ScalarIcon/ScalarIcon.stories.d.ts +1 -1
  13. package/dist/components/ScalarIcon/icons/Markdown.svg.js +19 -0
  14. package/dist/components/ScalarIcon/icons/NotAllowed.svg.js +21 -0
  15. package/dist/components/ScalarIcon/icons/index.d.ts +1 -1
  16. package/dist/components/ScalarIcon/icons/index.d.ts.map +1 -1
  17. package/dist/components/ScalarIcon/utils/index.js +188 -184
  18. package/dist/components/ScalarIconButton/ScalarIconButton.stories.d.ts +1 -1
  19. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts.map +1 -1
  20. package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +6 -6
  21. package/dist/components/ScalarModal/ScalarModal.stories.d.ts +10 -12
  22. package/dist/components/ScalarModal/ScalarModal.stories.d.ts.map +1 -1
  23. package/dist/components/ScalarModal/ScalarModal.vue.d.ts +3 -5
  24. package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +1 -1
  25. package/dist/components/ScalarModal/ScalarModal.vue.js +4 -4
  26. package/dist/components/ScalarModal/ScalarModal.vue2.js +42 -47
  27. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.d.ts.map +1 -1
  28. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +2 -2
  29. package/dist/components/ScalarSearchInput/ScalarSearchInput.vue2.js +34 -31
  30. package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts.map +1 -1
  31. package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +5 -8
  32. package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts.map +1 -1
  33. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -1
  34. package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +29 -30
  35. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +23 -6
  36. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
  37. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +37 -19
  38. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts +20 -0
  39. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts.map +1 -0
  40. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +7 -0
  41. package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +37 -0
  42. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts.map +1 -1
  43. package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +8 -8
  44. package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +3 -3
  45. package/dist/components/ScalarSidebar/types.d.ts +2 -0
  46. package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
  47. package/dist/components/ScalarSidebar/useSidebarGroups.d.ts.map +1 -1
  48. package/dist/components/ScalarVirtualText/ScalarVirtualText.stories.d.ts.map +1 -1
  49. package/dist/helpers/add-scalar-classes.d.ts.map +1 -1
  50. package/dist/helpers/add-scalar-classes.js +1 -3
  51. package/dist/helpers/oas-utils.d.ts.map +1 -1
  52. package/dist/hooks/useBindCx.stories.d.ts.map +1 -1
  53. package/dist/style.css +1 -1
  54. package/package.json +6 -6
@@ -1,9 +1,9 @@
1
1
  import o from "./ScalarModal.vue2.js";
2
- import { useModal as s } from "./ScalarModal.vue2.js";
2
+ import { useModal as e } from "./ScalarModal.vue2.js";
3
3
  /* empty css */
4
4
  import r from "../../_virtual/_plugin-vue_export-helper.js";
5
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-0f8e0211"]]);
5
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-12dc7570"]]);
6
6
  export {
7
- f as default,
8
- s as useModal
7
+ p as default,
8
+ e as useModal
9
9
  };
@@ -1,13 +1,13 @@
1
- import { defineComponent as v, openBlock as l, createBlock as r, unref as a, withCtx as t, createElementVNode as x, normalizeClass as o, createVNode as i, normalizeStyle as b, createTextVNode as y, toDisplayString as g, createCommentVNode as d, createElementBlock as m, renderSlot as n, reactive as w } from "vue";
1
+ import { defineComponent as p, openBlock as l, createBlock as r, unref as a, withCtx as o, createElementVNode as x, normalizeClass as t, createVNode as i, normalizeStyle as w, createTextVNode as b, toDisplayString as y, createCommentVNode as m, createElementBlock as n, renderSlot as d, reactive as g } from "vue";
2
2
  import { Dialog as z, DialogPanel as k, DialogTitle as C, DialogDescription as D } from "@headlessui/vue";
3
- import { cva as c, cx as u } from "../../cva.js";
3
+ import { cva as f, cx as c } from "../../cva.js";
4
4
  import S from "../ScalarIconButton/ScalarIconButton.vue.js";
5
5
  const $ = {
6
6
  key: 0,
7
7
  class: "close-button z-10 fixed right-2 top-2"
8
8
  };
9
9
  function E() {
10
- return w({
10
+ return g({
11
11
  open: !1,
12
12
  show() {
13
13
  this.open = !0;
@@ -17,7 +17,7 @@ function E() {
17
17
  }
18
18
  });
19
19
  }
20
- const M = /* @__PURE__ */ v({
20
+ const M = /* @__PURE__ */ p({
21
21
  __name: "ScalarModal",
22
22
  props: {
23
23
  state: {},
@@ -28,48 +28,43 @@ const M = /* @__PURE__ */ v({
28
28
  variant: {}
29
29
  },
30
30
  setup(N) {
31
- const f = c({
31
+ const u = f({
32
32
  base: [
33
33
  "scalar-modal",
34
- "col relative mx-auto mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]"
34
+ "flex flex-col relative mx-auto mb-0 rounded-lg bg-b-1 p-0 text-left leading-snug text-c-1 opacity-0 w-[calc(100vw-12px)] md:w-[calc(100vw-16px)] lg:w-[calc(100vw-32px)]"
35
35
  ].join(" "),
36
36
  variants: {
37
37
  size: {
38
- xxs: "mt-20 max-w-screen-xxs",
39
- xs: "mt-20 max-w-screen-xs",
40
- sm: "mt-20 max-w-screen-sm",
41
- md: "mt-20 max-w-screen-md",
42
- lg: "m-auto max-w-screen-lg",
43
- xl: "m-auto max-w-screen-xl",
44
- full: "full-size-styles mt-0 lg:w-full"
38
+ xxs: "mt-[20svh] max-h-[60svh] max-w-screen-xxs",
39
+ xs: "mt-[20svh] max-h-[60svh] max-w-screen-xs",
40
+ sm: "mt-[20svh] max-h-[60svh] max-w-screen-sm",
41
+ md: "mt-[20svh] max-h-[60svh] max-w-screen-md",
42
+ lg: "m-auto max-h-[80svh] max-w-screen-lg",
43
+ xl: "m-auto max-h-[90svh] max-w-screen-xl",
44
+ full: "full-size-styles max-h-dvh mt-0 lg:w-full"
45
45
  },
46
46
  variant: {
47
47
  form: "scalar-modal-form",
48
- history: "scalar-modal-history bg-b-1",
49
- search: "scalar-modal-search",
48
+ search: "scalar-modal-search mt-[15svh] max-h-[60svh] max-w-[540px]",
50
49
  error: "scalar-modal-error"
51
50
  }
52
51
  }
53
- }), p = c({
54
- base: [
55
- "scalar-modal-body",
56
- "relative max-h-[calc(100dvh-240px)] rounded-lg rounded-t-none border-t-1/2 bg-b-1 p-3"
57
- ].join(" "),
52
+ }), v = f({
53
+ base: ["scalar-modal-body", "relative flex-1 min-h-0 p-3"].join(" "),
58
54
  variants: {
59
55
  variant: {
60
56
  form: "overflow-visible",
61
- history: "pt-3",
62
- search: "col !m-0 max-h-[440px] overflow-hidden p-0",
57
+ search: "col !m-0 overflow-hidden p-0",
63
58
  error: "overflow-y-scroll"
64
59
  },
65
60
  size: {
66
- xxs: "max-h-[calc(100dvh-240px)]",
67
- xs: "max-h-[calc(100dvh-240px)]",
68
- sm: "max-h-[calc(100dvh-240px)]",
69
- md: "max-h-[calc(100dvh-240px)]",
70
- lg: "max-h-[calc(100dvh-180px)]",
71
- xl: "m-0 max-h-[calc(100dvh-120px)] p-0",
72
- full: "max-h-dvh rounded-none"
61
+ xxs: "",
62
+ xs: "",
63
+ sm: "",
64
+ md: "",
65
+ lg: "",
66
+ xl: "m-0 p-0",
67
+ full: " rounded-none"
73
68
  }
74
69
  }
75
70
  });
@@ -77,10 +72,10 @@ const M = /* @__PURE__ */ v({
77
72
  open: e.state.open,
78
73
  onClose: s[1] || (s[1] = (h) => e.state.hide())
79
74
  }, {
80
- default: t(() => [
75
+ default: o(() => [
81
76
  x("div", {
82
- class: o(
83
- a(u)(
77
+ class: t(
78
+ a(c)(
84
79
  e.size === "full" ? "scalar-modal-layout-full" : "scalar-modal-layout",
85
80
  "fixed left-0 top-0 flex items-start justify-center",
86
81
  "z-[1001] h-[100dvh] w-[100dvw]",
@@ -90,44 +85,44 @@ const M = /* @__PURE__ */ v({
90
85
  )
91
86
  }, [
92
87
  i(a(k), {
93
- class: o(a(f)({ size: e.size, variant: e.variant })),
94
- style: b({ maxWidth: e.maxWidth })
88
+ class: t(a(u)({ size: e.size, variant: e.variant })),
89
+ style: w({ maxWidth: e.maxWidth })
95
90
  }, {
96
- default: t(() => [
91
+ default: o(() => [
97
92
  e.title ? (l(), r(a(C), {
98
93
  key: 0,
99
- class: o(["scalar-modal-header m-0 -mb-1 rounded-lg p-3 text-left text-sm font-medium text-c-1", { "pb-0 pt-6": e.variant === "history" }])
94
+ class: "scalar-modal-header m-0 -mb-1 rounded-lg pt-3 px-3 text-left text-sm font-medium text-c-1"
100
95
  }, {
101
- default: t(() => [
102
- y(g(e.title), 1)
96
+ default: o(() => [
97
+ b(y(e.title), 1)
103
98
  ]),
104
99
  _: 1
105
- }, 8, ["class"])) : d("", !0),
106
- e.size === "full" ? (l(), m("div", {
100
+ })) : m("", !0),
101
+ e.size === "full" ? (l(), n("div", {
107
102
  key: 1,
108
- class: o(e.bodyClass)
103
+ class: t(e.bodyClass)
109
104
  }, [
110
- n(e.$slots, "default", {}, void 0, !0)
105
+ d(e.$slots, "default", {}, void 0, !0)
111
106
  ], 2)) : (l(), r(a(D), {
112
107
  key: 2,
113
- class: o(a(u)(a(p)({ size: e.size, variant: e.variant }), e.bodyClass))
108
+ class: t(a(c)(a(v)({ size: e.size, variant: e.variant }), e.bodyClass))
114
109
  }, {
115
- default: t(() => [
116
- n(e.$slots, "default", {}, void 0, !0)
110
+ default: o(() => [
111
+ d(e.$slots, "default", {}, void 0, !0)
117
112
  ]),
118
113
  _: 3
119
114
  }, 8, ["class"]))
120
115
  ]),
121
116
  _: 3
122
117
  }, 8, ["class", "style"]),
123
- e.size === "full" ? (l(), m("div", $, [
118
+ e.size === "full" ? (l(), n("div", $, [
124
119
  i(a(S), {
125
120
  class: "hover:bg-b-3 focus:outline-none",
126
121
  icon: "Close",
127
122
  label: "Clear Search",
128
123
  onClose: s[0] || (s[0] = (h) => e.state.hide())
129
124
  })
130
- ])) : d("", !0)
125
+ ])) : m("", !0)
131
126
  ], 2)
132
127
  ]),
133
128
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchInput/ScalarSearchInput.vue"],"names":[],"mappings":"AA0GA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAInE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;AA0KF,wBAQG"}
1
+ {"version":3,"file":"ScalarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchInput/ScalarSearchInput.vue"],"names":[],"mappings":"AAgHA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAInE,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAC;;;;;;;;;AA4KF,wBAQG"}
@@ -1,7 +1,7 @@
1
1
  import o from "./ScalarSearchInput.vue2.js";
2
2
  /* empty css */
3
3
  import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-2f2316c6"]]);
4
+ const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-080483f0"]]);
5
5
  export {
6
- p as default
6
+ c as default
7
7
  };
@@ -1,9 +1,9 @@
1
- import { defineComponent as b, ref as h, computed as g, useAttrs as k, openBlock as s, createElementBlock as v, normalizeClass as i, unref as a, createBlock as o, createCommentVNode as u, createElementVNode as S, mergeProps as V } from "vue";
2
- import { cva as y, cx as c } from "../../cva.js";
3
- import C from "../ScalarIcon/ScalarIcon.vue.js";
4
- import z from "../ScalarLoading/ScalarLoading.vue.js";
5
- import B from "../ScalarIconButton/ScalarIconButton.vue.js";
6
- const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
1
+ import { defineComponent as h, ref as v, computed as g, useAttrs as k, openBlock as s, createElementBlock as S, normalizeClass as i, unref as a, createBlock as o, createCommentVNode as c, createElementVNode as V, mergeProps as y, withModifiers as C } from "vue";
2
+ import { cva as z, cx as u } from "../../cva.js";
3
+ import B from "../ScalarIcon/ScalarIcon.vue.js";
4
+ import I from "../ScalarLoading/ScalarLoading.vue.js";
5
+ import w from "../ScalarIconButton/ScalarIconButton.vue.js";
6
+ const E = ["aria-label", "value"], M = /* @__PURE__ */ h({
7
7
  inheritAttrs: !1,
8
8
  __name: "ScalarSearchInput",
9
9
  props: {
@@ -13,15 +13,18 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
13
13
  label: {}
14
14
  },
15
15
  emits: ["update:modelValue"],
16
- setup(E, { expose: d, emit: m }) {
17
- const t = m, r = h(null);
18
- function p(e) {
19
- t("update:modelValue", e.target.value);
16
+ setup(N, { expose: d, emit: p }) {
17
+ const r = p, l = v(null);
18
+ function m(e) {
19
+ r("update:modelValue", e.target.value);
20
20
  }
21
- const n = g(() => {
22
- const { class: e, ...l } = k();
23
- return { class: e || "", rest: l };
24
- }), f = y({
21
+ function f() {
22
+ r("update:modelValue", ""), l.value && l.value.focus();
23
+ }
24
+ const t = g(() => {
25
+ const { class: e, ...n } = k();
26
+ return { class: e || "", rest: n };
27
+ }), b = z({
25
28
  base: "search-background flex items-center rounded border text-sm font-medium has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline",
26
29
  variants: {
27
30
  sidebar: {
@@ -33,26 +36,26 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
33
36
  return d({
34
37
  focus: () => {
35
38
  var e;
36
- (e = r.value) == null || e.focus();
39
+ (e = l.value) == null || e.focus();
37
40
  },
38
41
  blur: () => {
39
42
  var e;
40
- (e = r.value) == null || e.blur();
43
+ (e = l.value) == null || e.blur();
41
44
  }
42
- }), (e, l) => (s(), v("label", {
43
- class: i(a(c)(a(f)({ sidebar: e.sidebar }), n.value.class))
45
+ }), (e, n) => (s(), S("label", {
46
+ class: i(a(u)(a(b)({ sidebar: e.sidebar }), t.value.class))
44
47
  }, [
45
- e.sidebar ? (s(), o(a(C), {
48
+ e.sidebar ? (s(), o(a(B), {
46
49
  key: 0,
47
50
  class: "text-c-2",
48
51
  icon: "Search",
49
52
  size: "xs",
50
53
  thickness: "2.5"
51
- })) : u("", !0),
52
- S("input", V({
54
+ })) : c("", !0),
55
+ V("input", y({
53
56
  ref_key: "inputRef",
54
- ref: r
55
- }, n.value.rest, {
57
+ ref: l
58
+ }, t.value.rest, {
56
59
  "aria-label": e.label ?? "Enter search query",
57
60
  autocapitalize: "off",
58
61
  autocomplete: "off",
@@ -62,24 +65,24 @@ const I = ["aria-label", "value"], q = /* @__PURE__ */ b({
62
65
  spellcheck: "false",
63
66
  type: "search",
64
67
  value: e.modelValue,
65
- onInput: p
66
- }), null, 16, I),
67
- e.loading && e.loading.isLoading ? (s(), o(a(z), {
68
+ onInput: m
69
+ }), null, 16, E),
70
+ e.loading && e.loading.isLoading ? (s(), o(a(I), {
68
71
  key: 1,
69
72
  class: "mr-3 self-center",
70
73
  loadingState: e.loading,
71
74
  size: "md"
72
- }, null, 8, ["loadingState"])) : e.modelValue ? (s(), o(a(B), {
75
+ }, null, 8, ["loadingState"])) : e.modelValue ? (s(), o(a(w), {
73
76
  key: 2,
74
- class: i(a(c)("p-0", e.sidebar ? "h-4 w-4" : "h-5 w-5")),
77
+ class: i(a(u)("p-0", e.sidebar ? "h-4 w-4" : "h-5 w-5")),
75
78
  icon: "Close",
76
79
  label: "Clear Search",
77
80
  thickness: e.sidebar ? "1.75" : "1.5",
78
- onClick: l[0] || (l[0] = (N) => t("update:modelValue", ""))
79
- }, null, 8, ["class", "thickness"])) : u("", !0)
81
+ onClick: C(f, ["stop", "prevent"])
82
+ }, null, 8, ["class", "thickness"])) : c("", !0)
80
83
  ], 2));
81
84
  }
82
85
  });
83
86
  export {
84
- q as default
87
+ M as default
85
88
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSearchResultItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultItem.vue"],"names":[],"mappings":"AA6DA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,eAAe,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAWF,iBAAS,cAAc;WAiGT,OAAO,IAA6B;;sBAXxB,GAAG;yBACA,GAAG;uBACL,GAAG;6BACG,GAAG;;;;EAanC;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSearchResultItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultItem.vue"],"names":[],"mappings":"AA2DA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,eAAe,CAAA;AAIrD,KAAK,WAAW,GAAG;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAWF,iBAAS,cAAc;WAiGT,OAAO,IAA6B;;sBAXxB,GAAG;yBACA,GAAG;uBACL,GAAG;6BACG,GAAG;;;;EAanC;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,10 +1,7 @@
1
- import { defineComponent as a, openBlock as t, createElementBlock as s, createElementVNode as o, normalizeProps as d, guardReactiveProps as m, unref as l, renderSlot as n, createBlock as p, createCommentVNode as r } from "vue";
1
+ import { defineComponent as a, openBlock as t, createElementBlock as s, createElementVNode as o, normalizeProps as d, guardReactiveProps as m, unref as c, renderSlot as n, createBlock as p, createCommentVNode as r } from "vue";
2
2
  import { useBindCx as u } from "../../hooks/useBindCx.js";
3
3
  import f from "../ScalarIcon/ScalarIcon.vue.js";
4
- const h = {
5
- class: "contents",
6
- role: "option"
7
- }, v = {
4
+ const h = { class: "contents" }, v = {
8
5
  key: 0,
9
6
  class: "flex h-fit items-center text-sm font-medium text-c-3 group-hover:text-c-1"
10
7
  }, x = { class: "flex min-w-0 flex-1 flex-col gap-0.75" }, _ = { class: "flex items-center gap-1" }, g = { class: "flex-1 truncate text-sm font-medium" }, k = {
@@ -21,10 +18,10 @@ const h = {
21
18
  active: { type: Boolean }
22
19
  },
23
20
  setup($) {
24
- const { cx: c } = u();
21
+ const { cx: l } = u();
25
22
  return (e, i) => (t(), s("li", h, [
26
23
  o("a", d(m(
27
- l(c)(
24
+ c(l)(
28
25
  "group flex cursor-pointer gap-2.5 rounded px-3 py-1.5 no-underline hover:bg-b-2",
29
26
  {
30
27
  "bg-b-2": e.active
@@ -33,7 +30,7 @@ const h = {
33
30
  )), [
34
31
  e.icon ? (t(), s("div", v, [
35
32
  n(e.$slots, "icon", {}, () => [
36
- e.icon ? (t(), p(l(f), {
33
+ e.icon ? (t(), p(c(f), {
37
34
  key: 0,
38
35
  icon: e.icon,
39
36
  size: "sm"
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAUrD,QAAA,MAAM,IAAI,EAAE,IAwBX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA;AAE7B,eAAO,MAAM,YAAY,EAAE,KAqC1B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA6D9B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAkBxB,CAAA"}
1
+ {"version":3,"file":"ScalarSidebar.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebar.stories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAUrD,QAAA,MAAM,IAAI,EAAE,IAsBX,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,IAAI,EAAE,KAAU,CAAA;AAE7B,eAAO,MAAM,YAAY,EAAE,KAqC1B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAqF9B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KAkBxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AAoFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,wBAyHC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AAmFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,wBA4HC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,12 +1,13 @@
1
- import { defineComponent as d, openBlock as t, createBlock as r, resolveDynamicComponent as p, mergeProps as c, unref as o, withCtx as u, createElementVNode as f, createElementBlock as n, renderSlot as s, createVNode as m, createCommentVNode as l } from "vue";
1
+ import { defineComponent as r, openBlock as s, createBlock as c, resolveDynamicComponent as u, mergeProps as f, unref as o, withCtx as m, renderSlot as t, createVNode as n, createElementVNode as p, createElementBlock as a, createCommentVNode as l } from "vue";
2
2
  import { cva as b } from "../../cva.js";
3
3
  import { useBindCx as v } from "../../hooks/useBindCx.js";
4
+ import y from "./ScalarSidebarIndent.vue.js";
4
5
  import h from "../ScalarIcon/ScalarIcon.vue.js";
5
- const y = { class: "flex items-center gap-1 flex-1" }, B = {
6
+ const B = { class: "flex items-center gap-1 flex-1 py-2 leading-5" }, g = {
6
7
  key: 0,
7
8
  class: "size-3.5"
8
- }, _ = { key: 0 }, k = {}, N = /* @__PURE__ */ d({
9
- ...k,
9
+ }, S = { key: 0 }, $ = {}, w = /* @__PURE__ */ r({
10
+ ...$,
10
11
  inheritAttrs: !1,
11
12
  __name: "ScalarSidebarButton",
12
13
  props: {
@@ -16,48 +17,46 @@ const y = { class: "flex items-center gap-1 flex-1" }, B = {
16
17
  disabled: { type: Boolean },
17
18
  indent: { default: 0 }
18
19
  },
19
- setup(C) {
20
- const a = b({
21
- base: ["rounded p-1.5 font-medium text-c-2 no-underline"],
20
+ setup(k) {
21
+ const d = b({
22
+ base: ["group/button flex rounded px-1.5 font-medium text-c-2 no-underline"],
22
23
  variants: {
23
24
  selected: { true: "cursor-auto bg-b-2 text-c-1" },
24
- disabled: { true: "cursor-auto" },
25
- indent: {
26
- 0: "pl-[6px]",
27
- 1: "pl-[24px]",
28
- 2: "pl-[42px]",
29
- 3: "pl-[60px]",
30
- 4: "pl-[78px]",
31
- 5: "pl-[96px]",
32
- 6: "pl-[114px]"
33
- }
25
+ disabled: { true: "cursor-auto" }
34
26
  },
35
27
  compoundVariants: [
36
28
  { selected: !1, disabled: !1, class: "hover:bg-b-2" }
37
29
  ],
38
- defaultVariants: { selected: !1, disabled: !1, indent: 0 }
30
+ defaultVariants: { selected: !1, disabled: !1 }
39
31
  }), { cx: i } = v();
40
- return (e, V) => (t(), r(p(e.is), c({
32
+ return (e, C) => (s(), c(u(e.is), f({
41
33
  "aria-level": e.indent,
34
+ "aria-selected": e.selected,
42
35
  type: e.is === "button" ? "button" : void 0
43
- }, o(i)(o(a)({ selected: e.selected, disabled: e.disabled, indent: e.indent }))), {
44
- default: u(() => [
45
- f("div", y, [
46
- e.icon || e.$slots.icon ? (t(), n("div", B, [
47
- s(e.$slots, "icon", {}, () => [
48
- m(o(h), { icon: e.icon }, null, 8, ["icon"])
36
+ }, o(i)(o(d)({ selected: e.selected, disabled: e.disabled }))), {
37
+ default: m(() => [
38
+ t(e.$slots, "indent", {}, () => [
39
+ n(y, {
40
+ indent: e.indent,
41
+ selected: e.selected
42
+ }, null, 8, ["indent", "selected"])
43
+ ]),
44
+ p("div", B, [
45
+ e.icon || e.$slots.icon ? (s(), a("div", g, [
46
+ t(e.$slots, "icon", {}, () => [
47
+ n(o(h), { icon: e.icon }, null, 8, ["icon"])
49
48
  ])
50
49
  ])) : l("", !0),
51
- s(e.$slots, "default")
50
+ t(e.$slots, "default")
52
51
  ]),
53
- e.$slots.aside ? (t(), n("div", _, [
54
- s(e.$slots, "aside")
52
+ e.$slots.aside ? (s(), a("div", S, [
53
+ t(e.$slots, "aside")
55
54
  ])) : l("", !0)
56
55
  ]),
57
56
  _: 3
58
- }, 16, ["aria-level", "type"]));
57
+ }, 16, ["aria-level", "aria-selected", "type"]));
59
58
  }
60
59
  });
61
60
  export {
62
- N as default
61
+ w as default
63
62
  };
@@ -1,4 +1,5 @@
1
1
  import type { Component } from 'vue';
2
+ import { type SidebarGroupLevel } from './useSidebarGroups.js';
2
3
  /**
3
4
  * Scalar Sidebar Group component
4
5
  *
@@ -17,29 +18,45 @@ import type { Component } from 'vue';
17
18
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
18
19
  modelValue?: boolean;
19
20
  } & {
21
+ /** Override the element tag */
20
22
  is?: Component | string;
21
23
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
22
24
  "update:modelValue": (value: boolean) => any;
23
25
  }, string, import("vue").PublicProps, Readonly<{
24
26
  modelValue?: boolean;
25
27
  } & {
28
+ /** Override the element tag */
26
29
  is?: Component | string;
27
30
  }> & Readonly<{
28
31
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
29
32
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
30
33
  /** The text content of the toggle */
31
- default?: () => any;
34
+ default?: (props: {
35
+ open: boolean;
36
+ }) => any;
32
37
  /** Override the entire toggle button */
33
- button?: () => any;
38
+ button?: (props: {
39
+ open: boolean;
40
+ level: SidebarGroupLevel;
41
+ }) => any;
34
42
  /** The list of sidebar subitems */
35
- items?: () => any;
43
+ items?: (props: {
44
+ open: boolean;
45
+ }) => any;
36
46
  }> & {
37
47
  /** The text content of the toggle */
38
- default?: () => any;
48
+ default?: (props: {
49
+ open: boolean;
50
+ }) => any;
39
51
  /** Override the entire toggle button */
40
- button?: () => any;
52
+ button?: (props: {
53
+ open: boolean;
54
+ level: SidebarGroupLevel;
55
+ }) => any;
41
56
  /** The list of sidebar subitems */
42
- items?: () => any;
57
+ items?: (props: {
58
+ open: boolean;
59
+ }) => any;
43
60
  }>;
44
61
  export default _default;
45
62
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AA0EA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AASpC;;;;;;;;;;;;;;GAcG;;iBAiCU,OAAO;;SA7Bb,SAAS,GAAG,MAAM;;;;iBA6BZ,OAAO;;SA7Bb,SAAS,GAAG,MAAM;;;;IAQvB,qCAAqC;cAC3B,MAAM,GAAG;IACnB,wCAAwC;aAC/B,MAAM,GAAG;IAClB,mCAAmC;YAC3B,MAAM,GAAG;;IALjB,qCAAqC;cAC3B,MAAM,GAAG;IACnB,wCAAwC;aAC/B,MAAM,GAAG;IAClB,mCAAmC;YAC3B,MAAM,GAAG;;AAhBnB,wBAiJC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAqFA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAMpC,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,oBAAoB,CAAA;AAI7E;;;;;;;;;;;;;;GAcG;;iBAkCU,OAAO;;IA9BlB,+BAA+B;SAC1B,SAAS,GAAG,MAAM;;;;iBA6BZ,OAAO;;IA9BlB,+BAA+B;SAC1B,SAAS,GAAG,MAAM;;;;IAQvB,qCAAqC;cAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,wCAAwC;aAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,KAAK,GAAG;IACpE,mCAAmC;YAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;IALzC,qCAAqC;cAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;IAC3C,wCAAwC;aAC/B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,KAAK,GAAG;IACpE,mCAAmC;YAC3B,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,GAAG;;AAjB3C,wBAkKC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,9 +1,10 @@
1
- import { defineComponent as d, mergeModels as p, useModel as c, openBlock as r, createElementBlock as f, renderSlot as t, createVNode as a, unref as s, withCtx as n, createBlock as _, resolveDynamicComponent as v, normalizeProps as C, mergeProps as $, createCommentVNode as k } from "vue";
2
- import { useBindCx as x } from "../../hooks/useBindCx.js";
3
- import B from "./ScalarSidebarButton.vue.js";
4
- import V from "./ScalarSidebarGroupToggle.vue.js";
5
- import { useSidebarGroups as b } from "./useSidebarGroups.js";
6
- const S = { class: "contents" }, y = {}, w = /* @__PURE__ */ d({
1
+ import { defineComponent as d, mergeModels as p, useModel as c, openBlock as i, createElementBlock as f, renderSlot as a, unref as t, createVNode as r, withCtx as n, createBlock as v, resolveDynamicComponent as _, normalizeProps as x, mergeProps as b, createCommentVNode as C } from "vue";
2
+ import { useBindCx as S } from "../../hooks/useBindCx.js";
3
+ import $ from "./ScalarSidebarButton.vue.js";
4
+ import g from "./ScalarSidebarGroupToggle.vue.js";
5
+ import k from "./ScalarSidebarIndent.vue.js";
6
+ import { useSidebarGroups as B } from "./useSidebarGroups.js";
7
+ const V = { class: "group/item contents" }, y = {}, A = /* @__PURE__ */ d({
7
8
  ...y,
8
9
  inheritAttrs: !1,
9
10
  __name: "ScalarSidebarGroup",
@@ -14,34 +15,51 @@ const S = { class: "contents" }, y = {}, w = /* @__PURE__ */ d({
14
15
  modelModifiers: {}
15
16
  }),
16
17
  emits: ["update:modelValue"],
17
- setup(i) {
18
- const e = c(i, "modelValue"), { level: u } = b({ increment: !0 }), { cx: m } = x();
19
- return (o, l) => (r(), f("li", S, [
20
- t(o.$slots, "button", { open: e.value }, () => [
21
- a(B, {
18
+ setup(u) {
19
+ const e = c(u, "modelValue"), { level: l } = B({ increment: !0 }), { cx: m } = S();
20
+ return (o, s) => (i(), f("li", V, [
21
+ a(o.$slots, "button", {
22
+ level: t(l),
23
+ open: !!e.value
24
+ }, () => [
25
+ r($, {
22
26
  is: "button",
23
27
  "aria-expanded": e.value,
24
- indent: s(u),
25
- onClick: l[0] || (l[0] = (M) => e.value = !e.value)
28
+ class: "text-c-1 bg-b-1",
29
+ indent: t(l),
30
+ onClick: s[0] || (s[0] = (M) => e.value = !e.value)
26
31
  }, {
32
+ indent: n(() => [
33
+ r(k, {
34
+ class: "mr-0",
35
+ indent: t(l)
36
+ }, null, 8, ["indent"])
37
+ ]),
27
38
  icon: n(() => [
28
- a(V, { open: e.value }, null, 8, ["open"])
39
+ r(g, {
40
+ class: "text-c-3",
41
+ open: e.value
42
+ }, null, 8, ["open"])
29
43
  ]),
30
44
  default: n(() => [
31
- t(o.$slots, "default", { open: e.value })
45
+ a(o.$slots, "default", {
46
+ open: !!e.value
47
+ })
32
48
  ]),
33
49
  _: 3
34
50
  }, 8, ["aria-expanded", "indent"])
35
51
  ]),
36
- e.value ? (r(), _(v(o.is), C($({ key: 0 }, s(m)("flex flex-col"))), {
52
+ e.value ? (i(), v(_(o.is), x(b({ key: 0 }, t(m)("flex flex-col gap-px"))), {
37
53
  default: n(() => [
38
- t(o.$slots, "items", { open: e.value })
54
+ a(o.$slots, "items", {
55
+ open: !!e.value
56
+ })
39
57
  ]),
40
58
  _: 3
41
- }, 16)) : k("", !0)
59
+ }, 16)) : C("", !0)
42
60
  ]));
43
61
  }
44
62
  });
45
63
  export {
46
- w as default
64
+ A as default
47
65
  };
@@ -0,0 +1,20 @@
1
+ import type { SidebarGroupLevel } from './useSidebarGroups.js';
2
+ /**
3
+ * Scalar Sidebar Indent component
4
+ *
5
+ * @example
6
+ * <ScalarSidebarIndent :indent="1" />
7
+ */
8
+ declare const _default: import("vue").DefineComponent<{
9
+ /** The number of indents to render @default 0 */
10
+ indent?: SidebarGroupLevel;
11
+ /** Whether the indent is selected @default false */
12
+ selected?: boolean;
13
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
14
+ /** The number of indents to render @default 0 */
15
+ indent?: SidebarGroupLevel;
16
+ /** Whether the indent is selected @default false */
17
+ selected?: boolean;
18
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ export default _default;
20
+ //# sourceMappingURL=ScalarSidebarIndent.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"AAiFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;GAKG;;IAID,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;;IAHlB,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;;AANpB,wBAkHC"}
@@ -0,0 +1,7 @@
1
+ import o from "./ScalarSidebarIndent.vue2.js";
2
+ /* empty css */
3
+ import r from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3e0fb9f3"]]);
5
+ export {
6
+ f as default
7
+ };