@scalar/components 0.22.3 → 0.22.4

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 (29) hide show
  1. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +2 -0
  2. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
  3. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js.map +1 -1
  4. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.script.js +7 -2
  5. package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.script.js.map +1 -1
  6. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.d.ts +19 -0
  7. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.d.ts.map +1 -0
  8. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.js +8 -0
  9. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.js.map +1 -0
  10. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.script.js +23 -0
  11. package/dist/components/ScalarSidebar/ScalarSidebarLoading.vue.script.js.map +1 -0
  12. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts +2 -0
  13. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts.map +1 -1
  14. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js.map +1 -1
  15. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.script.js +5 -3
  16. package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.script.js.map +1 -1
  17. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js.map +1 -1
  18. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.script.js +1 -1
  19. package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.script.js.map +1 -1
  20. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts +2 -2
  21. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts.map +1 -1
  22. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.js.map +1 -1
  23. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.script.js +4 -2
  24. package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.script.js.map +1 -1
  25. package/dist/components/ScalarSidebar/types.d.ts +6 -0
  26. package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/style.css +37 -4
  29. package/package.json +5 -5
@@ -27,6 +27,7 @@ export default _default;
27
27
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
28
28
  controlled?: boolean;
29
29
  discrete?: boolean;
30
+ loading?: boolean;
30
31
  } & {
31
32
  open?: boolean;
32
33
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -37,6 +38,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
37
38
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
38
39
  controlled?: boolean;
39
40
  discrete?: boolean;
41
+ loading?: boolean;
40
42
  } & {
41
43
  open?: boolean;
42
44
  }> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAkLA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;WAwDT,OAAO;;;;;;;;;;WAAP,OAAO;;;;;4GAyNZ,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAsLA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;;WAwDT,OAAO;;;;;;;;;;;WAAP,OAAO;;;;;4GAmOZ,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"mr-0 -my-2\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <div\n v-if=\"discrete\"\n class=\"size-4\">\n <!-- Placeholder for discrete group toggle -->\n </div>\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <button\n v-if=\"discrete\"\n :aria-expanded=\"open\"\n class=\"absolute top-[1lh] -translate-y-1/2 p-0.75 rounded right-1.25 text-sidebar-c-2\"\n :class=\"\n selected\n ? 'hover:bg-sidebar-b-1 hover:text-sidebar-c-1'\n : 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover'\n \"\n type=\"button\"\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </button>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <slot\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ScalarSidebarGroup.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"mr-0 -my-2\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <div\n v-if=\"discrete\"\n class=\"size-4\">\n <!-- Placeholder for discrete group toggle -->\n </div>\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <button\n v-if=\"discrete\"\n :aria-expanded=\"open\"\n class=\"absolute top-[1lh] -translate-y-1/2 p-0.75 rounded right-1.25 text-sidebar-c-2\"\n :class=\"\n selected\n ? 'hover:bg-sidebar-b-1 hover:text-sidebar-c-1'\n : 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover'\n \"\n type=\"button\"\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </button>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":""}
@@ -2,6 +2,7 @@ import ScalarSidebarIndent_default from "./ScalarSidebarIndent.vue.js";
2
2
  import ScalarSidebarButton_default from "./ScalarSidebarButton.vue.js";
3
3
  import ScalarSidebarGroupToggle_default from "./ScalarSidebarGroupToggle.vue.js";
4
4
  import { useSidebarGroups } from "./useSidebarGroups.js";
5
+ import ScalarSidebarLoading_default from "./ScalarSidebarLoading.vue.js";
5
6
  import { useBindCx } from "@scalar/use-hooks/useBindCx";
6
7
  import { createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, normalizeClass, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, toDisplayString, unref, useModel, withCtx } from "vue";
7
8
  //#region src/components/ScalarSidebar/ScalarSidebarGroup.vue?vue&type=script&setup=true&lang.ts
@@ -26,7 +27,8 @@ var ScalarSidebarGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
26
27
  disabled: { type: Boolean },
27
28
  indent: {},
28
29
  controlled: { type: Boolean },
29
- discrete: { type: Boolean }
30
+ discrete: { type: Boolean },
31
+ loading: { type: Boolean }
30
32
  }, {
31
33
  "open": {
32
34
  type: Boolean,
@@ -103,7 +105,10 @@ var ScalarSidebarGroup_vue_vue_type_script_setup_true_lang_default = /* @__PURE_
103
105
  _: 3
104
106
  }, 8, ["open"])])], 10, _hoisted_3)) : createCommentVNode("", true)]),
105
107
  renderSlot(_ctx.$slots, "after", { open: open.value })
106
- ]), open.value ? (openBlock(), createElementBlock("ul", _hoisted_4, [renderSlot(_ctx.$slots, "items", { open: open.value })])) : createCommentVNode("", true)]),
108
+ ]), open.value ? (openBlock(), createElementBlock("ul", _hoisted_4, [__props.loading ? (openBlock(), createBlock(ScalarSidebarLoading_default, { key: 0 })) : renderSlot(_ctx.$slots, "items", {
109
+ key: 1,
110
+ open: open.value
111
+ })])) : createCommentVNode("", true)]),
107
112
  _: 3
108
113
  }, 16);
109
114
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarGroup.vue.script.js","names":["$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"mr-0 -my-2\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <div\n v-if=\"discrete\"\n class=\"size-4\">\n <!-- Placeholder for discrete group toggle -->\n </div>\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <button\n v-if=\"discrete\"\n :aria-expanded=\"open\"\n class=\"absolute top-[1lh] -translate-y-1/2 p-0.75 rounded right-1.25 text-sidebar-c-2\"\n :class=\"\n selected\n ? 'hover:bg-sidebar-b-1 hover:text-sidebar-c-1'\n : 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover'\n \"\n type=\"button\"\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </button>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <slot\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,OAAO;EAWb,MAAM,OAAO,SAAoB,SAAC,OAA0B;EAI5D,MAAM,EAAE,UAAU,iBAAiB,EAAE,WAAW,MAAM,CAAA;EAGtD,MAAM,EAAE,OAAO,WAAU;;EAGzB,MAAM,eAAe,UAAsB;AAEzC,QAAK,SAAS,MAAK;AACnB,OAAI,CAAC,QAAA,cAAc,CAAC,QAAA,SAElB,MAAK,QAAQ,CAAC,KAAK;;;EAKvB,MAAM,gBAAgB,UAAsB;AAE1C,QAAK,UAAU,MAAK;AACpB,OAAI,CAAC,QAAA,cAAc,QAAA,SAEjB,MAAK,QAAQ,CAAC,KAAK;;;uBAKrB,YAsFY,wBApFL,QAAA,GAAE,EAAA,eAAA,mBADC,MAAA,GAAE,CAAA,kCAAA,CAAA,CAAA,EAAA;2BA6EJ,CA3EN,mBA2EM,OA3EN,YA2EM;KA1EJ,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AA;;;KAMzD,WAEU,KAAA,QAAA,SAAA,EAAP,MAAA,KAAA,OAAI,CAAA;QAGD,KAAA,SAAA,WAAA,EADR,mBAMK,MANL,YAMK,CAHH,WAEU,KAAA,QAAA,SAAA,EAAP,MAAA,KAAA,OAAI,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"ScalarSidebarGroup.vue.script.js","names":["$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Group component\n *\n * A collapsible ScalarSidebarItem that can contain subitems.\n *\n * Classes applied to the component are passed to the inner list element.\n * Other attributes (like click event) are passed to the toggle button.\n *\n * @example\n * <ScalarSidebarGroup>\n * <!-- Group toggle text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarGroup>\n *\n *\n * By default the component has it's own internal open state, but this can be\n * controlled by passing the `controlled` prop and using binding the :open prop.\n *\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarGroupToggle from './ScalarSidebarGroupToggle.vue'\nimport ScalarSidebarIndent from './ScalarSidebarIndent.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarGroupSlots } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst {\n controlled,\n discrete,\n is = 'li',\n} = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the group label is clicked */\n (e: 'click', event: MouseEvent): void\n /**\n * Emitted when _only_ the group toggle button (caret) is clicked\n *\n * Note: This is only emitted if the group is discrete\n */\n (e: 'toggle', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\n\ndefineSlots<ScalarSidebarGroupSlots>()\n\nconst { level } = useSidebarGroups({ increment: true })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n\n/** Handle the click event for the group toggle */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled && !discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n\n/** Handle the click event for the group toggle */\nconst handleToggle = (event: MouseEvent) => {\n // Bubble up the toggle event\n emit('toggle', event)\n if (!controlled && discrete) {\n // Only toggle the open state if the group is uncontrolled and not discrete\n open.value = !open.value\n }\n}\n</script>\n<template>\n <component\n v-bind=\"cx('group/item flex flex-col gap-px')\"\n :is=\"is\">\n <div class=\"group/group-button relative flex flex-col text-base\">\n <slot\n name=\"before\"\n :open />\n <slot\n :level=\"level\"\n name=\"button\"\n :open>\n <ScalarSidebarButton\n is=\"button\"\n :active\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n @click=\"handleClick\">\n <template #indent>\n <ScalarSidebarIndent\n class=\"mr-0 -my-2\"\n :indent=\"level\"\n :selected />\n </template>\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot\n name=\"icon\"\n :open />\n </template>\n <template #aside>\n <slot\n name=\"aside\"\n :open />\n <div\n v-if=\"discrete\"\n class=\"size-4\">\n <!-- Placeholder for discrete group toggle -->\n </div>\n <slot\n v-else\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle\n class=\"text-sidebar-c-2\"\n :open />\n </slot>\n </template>\n <slot :open />\n </ScalarSidebarButton>\n <button\n v-if=\"discrete\"\n :aria-expanded=\"open\"\n class=\"absolute top-[1lh] -translate-y-1/2 p-0.75 rounded right-1.25 text-sidebar-c-2\"\n :class=\"\n selected\n ? 'hover:bg-sidebar-b-1 hover:text-sidebar-c-1'\n : 'hover:bg-sidebar-b-hover hover:text-sidebar-c-hover'\n \"\n type=\"button\"\n @click=\"handleToggle\">\n <slot\n name=\"toggle\"\n :open>\n <ScalarSidebarGroupToggle :open>\n <template #label>\n {{ open ? 'Close' : 'Open' }} <slot :open=\"open\" />\n </template>\n </ScalarSidebarGroupToggle>\n </slot>\n </button>\n </slot>\n <slot\n name=\"after\"\n :open />\n </div>\n <ul\n v-if=\"open\"\n class=\"group/items flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\"\n :open />\n </ul>\n </component>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CA,MAAM,OAAO;EAWb,MAAM,OAAO,SAAoB,SAAC,OAA0B;EAI5D,MAAM,EAAE,UAAU,iBAAiB,EAAE,WAAW,MAAM,CAAA;EAGtD,MAAM,EAAE,OAAO,WAAU;;EAGzB,MAAM,eAAe,UAAsB;AAEzC,QAAK,SAAS,MAAK;AACnB,OAAI,CAAC,QAAA,cAAc,CAAC,QAAA,SAElB,MAAK,QAAQ,CAAC,KAAK;;;EAKvB,MAAM,gBAAgB,UAAsB;AAE1C,QAAK,UAAU,MAAK;AACpB,OAAI,CAAC,QAAA,cAAc,QAAA,SAEjB,MAAK,QAAQ,CAAC,KAAK;;;uBAKrB,YAwFY,wBAtFL,QAAA,GAAE,EAAA,eAAA,mBADC,MAAA,GAAE,CAAA,kCAAA,CAAA,CAAA,EAAA;2BA6EJ,CA3EN,mBA2EM,OA3EN,YA2EM;KA1EJ,WAEU,KAAA,QAAA,UAAA,EAAP,MAAA,KAAA,OAAI,CAAA;KACP,WAmEO,KAAA,QAAA,UAAA;MAlEJ,OAAO,MAAA,MAAK;MAEZ,MAAA,KAAA;cAgEI,CA/DL,YAyCsB,6BAAA;MAxCpB,IAAG;MACF,QAAA,QAAA;MACA,iBAAe,KAAA;MACf,UAAA,QAAA;MACA,MAAA,QAAA;MACA,QAAQ,MAAA,MAAK;MACb,UAAA,QAAA;MACA,SAAO;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pulse bars inside
3
+ * `ScalarSidebarItem` rows so spacing and hierarchy match real navigation while content loads.
4
+ *
5
+ * @example
6
+ * ```vue
7
+ * <ScalarSidebarLoading :items="6" />
8
+ * ```
9
+ */
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
12
+ declare const __VLS_export: import("vue").DefineComponent<{
13
+ /** The number of items to display */
14
+ items?: number;
15
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
16
+ /** The number of items to display */
17
+ items?: number;
18
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ //# sourceMappingURL=ScalarSidebarLoading.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarSidebarLoading.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarLoading.vue"],"names":[],"mappings":"AA6CA;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEhB,qCAAqC;YAC7B,MAAM;;IADd,qCAAqC;YAC7B,MAAM;iGAgDZ,CAAC"}
@@ -0,0 +1,8 @@
1
+ import ScalarSidebarLoading_vue_vue_type_script_setup_true_lang_default from "./ScalarSidebarLoading.vue.script.js";
2
+ /* empty css */
3
+ //#region src/components/ScalarSidebar/ScalarSidebarLoading.vue
4
+ var ScalarSidebarLoading_default = ScalarSidebarLoading_vue_vue_type_script_setup_true_lang_default;
5
+ //#endregion
6
+ export { ScalarSidebarLoading_default as default };
7
+
8
+ //# sourceMappingURL=ScalarSidebarLoading.vue.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarSidebarLoading.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarLoading.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Skeleton loading UI for the sidebar. Renders animated pulse bars inside\n * `ScalarSidebarItem` rows so spacing and hierarchy match real navigation while content loads.\n *\n * @example\n * ```vue\n * <ScalarSidebarLoading :items=\"6\" />\n * ```\n */\nexport default {}\n</script>\n<script lang=\"ts\" setup>\nimport ScalarSidebarItem from '@/components/ScalarSidebar/ScalarSidebarItem.vue'\n\nconst { items = 4 } = defineProps<{\n /** The number of items to display */\n items?: number\n}>()\n</script>\n<template>\n <ScalarSidebarItem\n v-for=\"idx in items\"\n :key=\"idx\"\n class=\"pointer-events-none\">\n <div\n class=\"group/button-loading bg-sidebar-c-2/15 rounded-lg animate-pulse h-lh w-full box-content py-px -my-px\" />\n </ScalarSidebarItem>\n</template>\n<style>\n@reference \"../../style.css\";\n\n.group\\/item:last-of-type\n > .group\\/button\n > .group\\/button-label\n > .group\\/button-loading {\n @apply w-2/3;\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import ScalarSidebarItem_default from "./ScalarSidebarItem.vue.js";
2
+ import { Fragment, createBlock, createElementBlock, createElementVNode, defineComponent, openBlock, renderList, withCtx } from "vue";
3
+ var ScalarSidebarLoading_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
4
+ __name: "ScalarSidebarLoading",
5
+ props: { items: { default: 4 } },
6
+ setup(__props) {
7
+ return (_ctx, _cache) => {
8
+ return openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (idx) => {
9
+ return openBlock(), createBlock(ScalarSidebarItem_default, {
10
+ key: idx,
11
+ class: "pointer-events-none"
12
+ }, {
13
+ default: withCtx(() => [..._cache[0] || (_cache[0] = [createElementVNode("div", { class: "group/button-loading bg-sidebar-c-2/15 rounded-lg animate-pulse h-lh w-full box-content py-px -my-px" }, null, -1)])]),
14
+ _: 1
15
+ });
16
+ }), 128);
17
+ };
18
+ }
19
+ });
20
+ //#endregion
21
+ export { ScalarSidebarLoading_vue_vue_type_script_setup_true_lang_default as default };
22
+
23
+ //# sourceMappingURL=ScalarSidebarLoading.vue.script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScalarSidebarLoading.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarLoading.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Skeleton loading UI for the sidebar. Renders animated pulse bars inside\n * `ScalarSidebarItem` rows so spacing and hierarchy match real navigation while content loads.\n *\n * @example\n * ```vue\n * <ScalarSidebarLoading :items=\"6\" />\n * ```\n */\nexport default {}\n</script>\n<script lang=\"ts\" setup>\nimport ScalarSidebarItem from '@/components/ScalarSidebar/ScalarSidebarItem.vue'\n\nconst { items = 4 } = defineProps<{\n /** The number of items to display */\n items?: number\n}>()\n</script>\n<template>\n <ScalarSidebarItem\n v-for=\"idx in items\"\n :key=\"idx\"\n class=\"pointer-events-none\">\n <div\n class=\"group/button-loading bg-sidebar-c-2/15 rounded-lg animate-pulse h-lh w-full box-content py-px -my-px\" />\n </ScalarSidebarItem>\n</template>\n<style>\n@reference \"../../style.css\";\n\n.group\\/item:last-of-type\n > .group\\/button\n > .group\\/button-label\n > .group\\/button-loading {\n @apply w-2/3;\n}\n</style>\n"],"mappings":";;;;;;;2BAqBE,mBAMoB,UAAA,MAAA,WALJ,QAAA,QAAP,QAAG;wBADZ,YAMoB,2BAAA;KAJjB,KAAK;KACN,OAAM;;4BAE2G,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CADjH,mBACiH,OAAA,EAA/G,OAAM,wGAAsG,EAAA,MAAA,GAAA,CAAA,EAAA,CAAA"}
@@ -19,6 +19,7 @@ export default _default;
19
19
  declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
20
20
  controlled?: boolean;
21
21
  discrete?: boolean;
22
+ loading?: boolean;
22
23
  } & {
23
24
  open?: boolean;
24
25
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -29,6 +30,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<import
29
30
  }, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
30
31
  controlled?: boolean;
31
32
  discrete?: boolean;
33
+ loading?: boolean;
32
34
  } & {
33
35
  open?: boolean;
34
36
  }> & Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAoNA;;;;;;;;;;;;;;;GAeG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;WA+FT,OAAO;;;;;;;;;;WAAP,OAAO;;;;;;IA9Ed,qCAAqC;cACzB,MAAM,OAAO;IACzB,iCAAiC;aACtB,MAAM,OAAO;IACxB,wBAAwB;WACf,MAAM,OAAO;IACtB,8BAA8B;YACpB,MAAM,OAAO;IACvB,+BAA+B;WACtB,MAAM,OAAO;IACtB,qCAAqC;mBACtB,MAAM,OAAO;IAC5B,mCAAmC;YACzB,MAAM,OAAO;EAoTrB,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyNA;;;;;;;;;;;;;;;GAeG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;;;;;WA+FT,OAAO;;;;;;;;;;;WAAP,OAAO;;;;;;IA9Ed,qCAAqC;cACzB,MAAM,OAAO;IACzB,iCAAiC;aACtB,MAAM,OAAO;IACxB,wBAAwB;WACf,MAAM,OAAO;IACtB,8BAA8B;YACpB,MAAM,OAAO;IACvB,+BAA+B;WACtB,MAAM,OAAO;IACtB,qCAAqC;mBACtB,MAAM,OAAO;IAC5B,mCAAmC;YACzB,MAAM,OAAO;EA8TrB,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport { findScrollContainer } from './findScrollContainer'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(open)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"size-4 text-sidebar-c-2\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"flex flex-col gap-px sticky top-(--scalar-sidebar-sticky-offset,0) p-(--scalar-sidebar-padding) -m-(--scalar-sidebar-padding) mb-0 pb-0 bg-sidebar-b-1 z-1 animate-sidebar-border-bottom border-b-sidebar-border\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"size-4 -m-px text-sidebar-c-2\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <slot name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ScalarSidebarNestedItems.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport { findScrollContainer } from './findScrollContainer'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(open)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"size-4 text-sidebar-c-2\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"flex flex-col gap-px sticky top-(--scalar-sidebar-sticky-offset,0) p-(--scalar-sidebar-padding) -m-(--scalar-sidebar-padding) mb-0 pb-0 bg-sidebar-b-1 z-1 animate-sidebar-border-bottom border-b-sidebar-border\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"size-4 -m-px text-sidebar-c-2\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":""}
@@ -1,10 +1,11 @@
1
1
  import ScalarSidebarButton_default from "./ScalarSidebarButton.vue.js";
2
2
  import { useSidebarGroups } from "./useSidebarGroups.js";
3
+ import ScalarSidebarLoading_default from "./ScalarSidebarLoading.vue.js";
3
4
  import { useSidebarNestedItem } from "./useSidebarNestedItems.js";
4
5
  import ScalarSidebarItems_default from "./ScalarSidebarItems.vue.js";
5
6
  import ScalarSidebarSpacer_default from "./ScalarSidebarSpacer.vue.js";
6
7
  import { findScrollContainer } from "./findScrollContainer.js";
7
- import { Transition, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderSlot, unref, useModel, useTemplateRef, withCtx } from "vue";
8
+ import { Transition, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, openBlock, ref, renderSlot, unref, useModel, useTemplateRef, withCtx } from "vue";
8
9
  import { ScalarIconArrowRight, ScalarIconCaretLeft } from "@scalar/icons";
9
10
  //#region src/components/ScalarSidebar/ScalarSidebarNestedItems.vue?vue&type=script&setup=true&lang.ts
10
11
  var _hoisted_1 = {
@@ -23,7 +24,8 @@ var ScalarSidebarNestedItems_vue_vue_type_script_setup_true_lang_default = /* @_
23
24
  disabled: { type: Boolean },
24
25
  indent: {},
25
26
  controlled: { type: Boolean },
26
- discrete: { type: Boolean }
27
+ discrete: { type: Boolean },
28
+ loading: { type: Boolean }
27
29
  }, {
28
30
  "open": {
29
31
  type: Boolean,
@@ -109,7 +111,7 @@ var ScalarSidebarNestedItems_vue_vue_type_script_setup_true_lang_default = /* @_
109
111
  icon: withCtx(() => [createVNode(unref(ScalarIconCaretLeft), { class: "size-4 -m-px text-sidebar-c-2" })]),
110
112
  default: withCtx(() => [renderSlot(_ctx.$slots, "back-label", {}, () => [_cache[0] || (_cache[0] = createTextVNode("Back", -1))])]),
111
113
  _: 3
112
- })]), createVNode(ScalarSidebarSpacer_default, { class: "h-3" })]), renderSlot(_ctx.$slots, "items")]),
114
+ })]), createVNode(ScalarSidebarSpacer_default, { class: "h-3" })]), __props.loading ? (openBlock(), createBlock(ScalarSidebarLoading_default, { key: 0 })) : renderSlot(_ctx.$slots, "items", { key: 1 })]),
113
115
  _: 3
114
116
  }, 16)])) : createCommentVNode("", true)]),
115
117
  _: 3
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarNestedItems.vue.script.js","names":["$attrs","$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport { findScrollContainer } from './findScrollContainer'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(open)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"size-4 text-sidebar-c-2\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"flex flex-col gap-px sticky top-(--scalar-sidebar-sticky-offset,0) p-(--scalar-sidebar-padding) -m-(--scalar-sidebar-padding) mb-0 pb-0 bg-sidebar-b-1 z-1 animate-sidebar-border-bottom border-b-sidebar-border\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"size-4 -m-px text-sidebar-c-2\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <slot name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCA,MAAM,OAAO;EAOb,MAAM,OAAO,SAAoB,SAAC,OAA0B;AAC5D,uBAAqB,KAAI;EAmBzB,MAAM,EAAE,UAAU,iBAAiB,EAAE,OAAO,MAAM,CAAA;;EAGlD,MAAM,KAAK,eAAe,KAAI;;EAG9B,MAAM,SAAS,IAAI,EAAC;EAIpB,SAAS,SAAS;AAIhB,UAAO,QAAQ,oBAAoB,GAAG,MAAM,CAAC,aAAa;AAG1D,kBACE,GAAG,OACC,cAAiC,uCAAoC,EACrE,MAAM,EAAE,eAAe,MAAM,CAAC,CACpC;;EAEF,SAAS,WAAW;;AAElB,uBAAoB,GAAG,MAAM,CAAC,YAAY;;EAE5C,SAAS,UAAU;AACjB,kBAAe;AACb,OAAG,OAAO,cAAc,SAAS,EAAE,MAAM,EAAE,eAAe,MAAM,CAAA;AAChE,wBAAoB,GAAG,MAAM,CAAC,YAAY,OAAO;KAClD;;;EAMH,MAAM,eAAe,UAAsB;AAEzC,QAAK,SAAS,MAAK;AACnB,OAAI,CAAC,QAAA,WAEH,M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A+B,CAAA,CAAA,CAAA;6BAEzB,CAAnC,WAAmC,KAAA,QAAA,cAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAX,QAAI,GAAA,EAAA,CAAA,CAAA,CAAA;;WAGhC,YAAmC,6BAAA,EAAd,OAAM,OAAK,CAAA,CAAA,CAAA,EAElC,WAAqB,KAAA,QAAA,QAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"ScalarSidebarNestedItems.vue.script.js","names":["$attrs","$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Nested Items component\n *\n * A provides list of items thats presented over the parent list\n * Needs to be nested inside a ScalarSidebarItems component\n *\n * @example\n * <ScalarSidebarNestedItems v-model=\"open\">\n * <!-- Item text -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarNestedItems>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconArrowRight, ScalarIconCaretLeft } from '@scalar/icons'\nimport { nextTick, ref, useTemplateRef } from 'vue'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarItems from './ScalarSidebarItems.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport { findScrollContainer } from './findScrollContainer'\nimport type { ScalarSidebarGroupProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\nimport { useSidebarNestedItem } from './useSidebarNestedItems'\n\nconst { controlled } = defineProps<ScalarSidebarGroupProps>()\n\nconst emit = defineEmits<{\n /** Emitted when the nested item button is clicked */\n (e: 'click', event: MouseEvent): void\n /** Emitted when the back button is clicked */\n (e: 'back', event: MouseEvent): void\n}>()\n\nconst open = defineModel<boolean>('open', { default: false })\nuseSidebarNestedItem(open)\n\ndefineSlots<{\n /** The text content of the button */\n 'default'?: () => unknown\n /** Override the entire button */\n 'button'?: () => unknown\n /** Override the icon */\n 'icon'?: () => unknown\n /** Override the aside slot */\n 'aside'?: () => unknown\n /** Override the back button */\n 'back'?: () => unknown\n /** Override the back button label */\n 'back-label'?: () => unknown\n /** The list of sidebar subitems */\n 'items'?: () => unknown\n}>()\n\nconst { level } = useSidebarGroups({ reset: true })\n\n/** The root element ref */\nconst el = useTemplateRef('el')\n\n/** How far down to offset the nested items by when animating them in */\nconst offset = ref(0)\n\n// Transition hooks\n\nfunction onOpen() {\n // Calculate how far down the nearest scroll container is scrolled\n // We offset the nested items by this amount when animating them\n // in so they appear in line with the parent items list.\n offset.value = findScrollContainer(el.value).scrollTop ?? 0\n\n // Focus the first button in the nested items\n nextTick(() =>\n el.value\n ?.querySelector<HTMLButtonElement>('button:not([aria-expanded=\"true\"])')\n ?.focus({ preventScroll: true }),\n )\n}\nfunction onOpened() {\n /** Reset the scroll position of the scroll container after opening */\n findScrollContainer(el.value).scrollTop = 0\n}\nfunction onClose() {\n nextTick(() => {\n el.value?.querySelector('button')?.focus({ preventScroll: true })\n findScrollContainer(el.value).scrollTop = offset.value\n })\n}\n\ndefineOptions({ inheritAttrs: false })\n\n/** Handle the click event for the nested items button */\nconst handleClick = (event: MouseEvent) => {\n // Bubble up the click event\n emit('click', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = true\n }\n}\n\n/** Handle the back button click event */\nconst handleBack = (event: MouseEvent) => {\n // Bubble up the back event\n emit('back', event)\n if (!controlled) {\n // Only toggle the open state if the group is uncontrolled\n open.value = false\n }\n}\n</script>\n<template>\n <li\n ref=\"el\"\n class=\"group/item group/nested-items contents\"\n :class=\"{ 'group/nested-items-open': open }\"\n :style=\"{ '--nested-items-offset': `${offset}px` }\">\n <slot name=\"button\">\n <ScalarSidebarButton\n is=\"button\"\n :aria-expanded=\"open\"\n :disabled\n :icon\n :indent=\"level\"\n :selected\n v-bind=\"$attrs\"\n @click=\"handleClick\">\n <template\n v-if=\"$slots.icon\"\n #icon>\n <slot name=\"icon\" />\n </template>\n <slot />\n <template #aside>\n <slot name=\"aside\">\n <ScalarIconArrowRight class=\"size-4 text-sidebar-c-2\" />\n </slot>\n </template>\n </ScalarSidebarButton>\n </slot>\n <!-- Make sure the div is around for the entire transition -->\n <Transition\n :duration=\"300\"\n enterActiveClass=\"top-(--nested-items-offset)!\"\n leaveActiveClass=\"top-(--nested-items-offset)!\"\n @afterEnter=\"onOpened\"\n @enter=\"onOpen\"\n @leave=\"onClose\">\n <div\n v-if=\"open\"\n class=\"absolute inset-0 translate-x-full\">\n <ScalarSidebarItems v-bind=\"$attrs\">\n <div\n class=\"flex flex-col gap-px sticky top-(--scalar-sidebar-sticky-offset,0) p-(--scalar-sidebar-padding) -m-(--scalar-sidebar-padding) mb-0 pb-0 bg-sidebar-b-1 z-1 animate-sidebar-border-bottom border-b-sidebar-border\">\n <slot name=\"back\">\n <ScalarSidebarButton\n is=\"button\"\n class=\"text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1\"\n @click=\"handleBack\">\n <template #icon>\n <ScalarIconCaretLeft class=\"size-4 -m-px text-sidebar-c-2\" />\n </template>\n <slot name=\"back-label\">Back</slot>\n </ScalarSidebarButton>\n </slot>\n <ScalarSidebarSpacer class=\"h-3\" />\n </div>\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ScalarSidebarItems>\n </div>\n </Transition>\n </li>\n</template>\n\n<style>\n@reference \"../../style.css\";\n\n.animate-sidebar-border-bottom {\n animation: border-bottom forwards;\n animation-timeline: scroll();\n animation-range-end: 1px;\n}\n\n@keyframes border-bottom {\n from {\n border-bottom-width: 0;\n }\n to {\n border-bottom-width: var(--scalar-border-width);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkCA,MAAM,OAAO;EAOb,MAAM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,EAAlC,OAAM,2BAAyB,CAAA,CAAA,CAAA,CAAA,CAAA;2BAHjD,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;OAJAC,KAAAA,OAAO,OAAA;UACZ;sBACmB,CAApB,WAAoB,KAAA,QAAA,OAAA,CAAA,CAAA;;;;;;;;SAW1B,YAgCa,YAAA;IA/BV,UAAU;IACX,kBAAiB;IACjB,kBAAiB;IAChB,cAAY;IACZ,SAAO;IACP,SAAO;;2BAyBF,CAvBE,KAAA,SAAA,WAAA,EADR,mBAwBM,OAxBN,YAwBM,CArBJ,YAoBqB,4BAAA,eAAA,mBApBOD,KAAAA,OAAM,CAAA,EAAA;4BAe1B,CAdN,mBAcM,OAdN,YAcM,CAZJ,WAUO,KAAA,QAAA,QAAA,EAAA,QAAA,CATL,YAQsB,6BAAA;MAPpB,IAAG;MACH,OAAM;MACL,SAAO;;MACG,MAAI,cACgD,CAA7D,YAA6D,MAAA,oBAAA,EAAA,EAAxC,OAAM,iCAA+B,CAAA,CAAA,CAAA;6BAEzB,CAAnC,WAAmC,KAAA,QAAA,cAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAX,QAAI,GAAA,EAAA,CAAA,CAAA,CAAA;;WAGhC,YAAmC,6BAAA,EAAd,OAAM,OAAK,CAAA,CAAA,CAAA,EAEN,QAAA,WAAA,WAAA,EAA5B,YAAuC,8BAAA,EAAA,KAAA,GAAA,CAAA,IACvC,WAEiB,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSearchInput.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Input component\n *\n * An inline search input for the sidebar with a clear button\n * and optional loading indicator.\n *\n * @example\n * <ScalarSidebarSearchInput v-model=\"query\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass, ScalarIconX } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { onMounted, ref } from 'vue'\n\nimport { ScalarIconButton } from '../ScalarIconButton'\nimport { type LoadingState, ScalarLoading } from '../ScalarLoading'\n\nconst { autofocus } = defineProps<{\n autofocus?: boolean\n loader?: LoadingState\n label?: string\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst model = defineModel<string>()\n\nfunction handleClear() {\n model.value = ''\n // Push focus back to the input\n if (inputRef.value) {\n inputRef.value.focus()\n }\n}\n\ndefineOptions({ inheritAttrs: false })\nconst { stylingAttrsCx, otherAttrs } = useBindCx()\n\nonMounted(() => autofocus && inputRef.value?.focus())\n</script>\n<template>\n <label\n v-bind=\"\n stylingAttrsCx(\n 'flex items-center rounded border text-base has-[:focus-visible]:bg-sidebar-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5',\n 'bg-sidebar-b-search border-sidebar-border-search',\n model ? 'text-sidebar-c-1' : 'text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"text-sidebar-c-search size-4\" />\n <input\n ref=\"inputRef\"\n v-bind=\"otherAttrs\"\n v-model=\"model\"\n :aria-label=\"label ?? 'Enter search query'\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n class=\"flex-1 appearance-none rounded border-none bg-transparent outline-none\"\n placeholder=\"Search...\"\n spellcheck=\"false\"\n type=\"search\" />\n <ScalarLoading\n v-if=\"loader && loader.isActive\"\n class=\"mr-3 self-center\"\n :loader\n size=\"md\" />\n <ScalarIconButton\n v-else-if=\"model\"\n class=\"p-0.25 size-4\"\n :icon=\"ScalarIconX\"\n label=\"Clear Search\"\n weight=\"bold\"\n @click.stop.prevent=\"handleClear\" />\n </label>\n</template>\n"],"mappings":""}
1
+ {"version":3,"file":"ScalarSidebarSearchInput.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Input component\n *\n * An inline search input for the sidebar with a clear button\n * and optional loading indicator.\n *\n * @example\n * <ScalarSidebarSearchInput v-model=\"query\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass, ScalarIconX } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { onMounted, ref } from 'vue'\n\nimport { ScalarIconButton } from '../ScalarIconButton'\nimport { type LoadingState, ScalarLoading } from '../ScalarLoading'\n\nconst { autofocus } = defineProps<{\n autofocus?: boolean\n loader?: LoadingState\n label?: string\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst model = defineModel<string>()\n\nfunction handleClear() {\n model.value = ''\n // Push focus back to the input\n if (inputRef.value) {\n inputRef.value.focus()\n }\n}\n\ndefineOptions({ inheritAttrs: false })\nconst { stylingAttrsCx, otherAttrs } = useBindCx()\n\nonMounted(() => autofocus && inputRef.value?.focus())\n</script>\n<template>\n <label\n v-bind=\"\n stylingAttrsCx(\n 'flex items-center rounded border text-base has-[:focus-visible]:bg-sidebar-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5',\n 'bg-sidebar-b-search border-sidebar-border-search',\n model ? 'text-sidebar-c-1' : 'text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"text-sidebar-c-search size-4\" />\n <input\n ref=\"inputRef\"\n v-bind=\"otherAttrs\"\n v-model=\"model\"\n :aria-label=\"label ?? 'Enter search query'\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n class=\"flex-1 appearance-none rounded border-none bg-transparent outline-none\"\n placeholder=\"Search...\"\n spellcheck=\"false\"\n type=\"search\" />\n <ScalarLoading\n v-if=\"loader && loader.isActive\"\n class=\"mr-3 self-center\"\n :loader\n size=\"md\" />\n <ScalarIconButton\n v-else-if=\"model\"\n class=\"p-px size-4\"\n :icon=\"ScalarIconX\"\n label=\"Clear Search\"\n weight=\"bold\"\n @click.stop.prevent=\"handleClear\" />\n </label>\n</template>\n"],"mappings":""}
@@ -50,7 +50,7 @@ var ScalarSidebarSearchInput_vue_vue_type_script_setup_true_lang_default = /* @_
50
50
  size: "md"
51
51
  }, null, 8, ["loader"])) : model.value ? (openBlock(), createBlock(unref(ScalarIconButton_default), {
52
52
  key: 1,
53
- class: "p-0.25 size-4",
53
+ class: "p-px size-4",
54
54
  icon: unref(ScalarIconX),
55
55
  label: "Clear Search",
56
56
  weight: "bold",
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSearchInput.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Input component\n *\n * An inline search input for the sidebar with a clear button\n * and optional loading indicator.\n *\n * @example\n * <ScalarSidebarSearchInput v-model=\"query\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass, ScalarIconX } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { onMounted, ref } from 'vue'\n\nimport { ScalarIconButton } from '../ScalarIconButton'\nimport { type LoadingState, ScalarLoading } from '../ScalarLoading'\n\nconst { autofocus } = defineProps<{\n autofocus?: boolean\n loader?: LoadingState\n label?: string\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst model = defineModel<string>()\n\nfunction handleClear() {\n model.value = ''\n // Push focus back to the input\n if (inputRef.value) {\n inputRef.value.focus()\n }\n}\n\ndefineOptions({ inheritAttrs: false })\nconst { stylingAttrsCx, otherAttrs } = useBindCx()\n\nonMounted(() => autofocus && inputRef.value?.focus())\n</script>\n<template>\n <label\n v-bind=\"\n stylingAttrsCx(\n 'flex items-center rounded border text-base has-[:focus-visible]:bg-sidebar-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5',\n 'bg-sidebar-b-search border-sidebar-border-search',\n model ? 'text-sidebar-c-1' : 'text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"text-sidebar-c-search size-4\" />\n <input\n ref=\"inputRef\"\n v-bind=\"otherAttrs\"\n v-model=\"model\"\n :aria-label=\"label ?? 'Enter search query'\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n class=\"flex-1 appearance-none rounded border-none bg-transparent outline-none\"\n placeholder=\"Search...\"\n spellcheck=\"false\"\n type=\"search\" />\n <ScalarLoading\n v-if=\"loader && loader.isActive\"\n class=\"mr-3 self-center\"\n :loader\n size=\"md\" />\n <ScalarIconButton\n v-else-if=\"model\"\n class=\"p-0.25 size-4\"\n :icon=\"ScalarIconX\"\n label=\"Clear Search\"\n weight=\"bold\"\n @click.stop.prevent=\"handleClear\" />\n </label>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,WAAW,IAA6B,KAAI;EAElD,MAAM,QAAQ,SAAmB,SAAA,aAAC;EAElC,SAAS,cAAc;AACrB,SAAM,QAAQ;AAEd,OAAI,SAAS,MACX,UAAS,MAAM,OAAM;;EAKzB,MAAM,EAAE,gBAAgB,eAAe,WAAU;AAEjD,kBAAgB,QAAA,aAAa,SAAS,OAAO,OAAO,CAAA;;uBAGlD,mBAiCQ,SAAA,eAAA,mBAhCS,MAAA,eAAc,CAAA,qIAAA,oDAAmN,MAAA,QAAK,qBAAA,wBAAA,CAAA,CAAA,EAAA;IAOrP,YAAkE,MAAA,0BAAA,EAAA,EAAvC,OAAM,gCAA8B,CAAA;mBAC/D,mBAWkB,SAXlB,WAWkB;cAVZ;KAAJ,KAAI;OACI,MAAA,WAAU,EAAA;wEACJ,QAAA;KACb,cAAY,QAAA,SAAK;KAClB,gBAAe;KACf,cAAa;KACb,aAAY;KACZ,OAAM;KACN,aAAY;KACZ,YAAW;KACX,MAAK;6CARI,MAAA,MAAK,CAAA,CAAA;IAUR,QAAA,UAAU,QAAA,OAAO,YAAA,WAAA,EADzB,YAIc,MAAA,sBAAA,EAAA;;KAFZ,OAAM;KACL,QAAA,QAAA;KACD,MAAK;+BAEM,MAAA,SAAA,WAAA,EADb,YAMsC,MAAA,yBAAA,EAAA;;KAJpC,OAAM;KACL,MAAM,MAAA,YAAW;KAClB,OAAM;KACN,QAAO;KACN,SAAK,cAAe,aAAW,CAAA,QAAA,UAAA,CAAA"}
1
+ {"version":3,"file":"ScalarSidebarSearchInput.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Input component\n *\n * An inline search input for the sidebar with a clear button\n * and optional loading indicator.\n *\n * @example\n * <ScalarSidebarSearchInput v-model=\"query\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass, ScalarIconX } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\nimport { onMounted, ref } from 'vue'\n\nimport { ScalarIconButton } from '../ScalarIconButton'\nimport { type LoadingState, ScalarLoading } from '../ScalarLoading'\n\nconst { autofocus } = defineProps<{\n autofocus?: boolean\n loader?: LoadingState\n label?: string\n}>()\n\nconst inputRef = ref<HTMLInputElement | null>(null)\n\nconst model = defineModel<string>()\n\nfunction handleClear() {\n model.value = ''\n // Push focus back to the input\n if (inputRef.value) {\n inputRef.value.focus()\n }\n}\n\ndefineOptions({ inheritAttrs: false })\nconst { stylingAttrsCx, otherAttrs } = useBindCx()\n\nonMounted(() => autofocus && inputRef.value?.focus())\n</script>\n<template>\n <label\n v-bind=\"\n stylingAttrsCx(\n 'flex items-center rounded border text-base has-[:focus-visible]:bg-sidebar-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5',\n 'bg-sidebar-b-search border-sidebar-border-search',\n model ? 'text-sidebar-c-1' : 'text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"text-sidebar-c-search size-4\" />\n <input\n ref=\"inputRef\"\n v-bind=\"otherAttrs\"\n v-model=\"model\"\n :aria-label=\"label ?? 'Enter search query'\"\n autocapitalize=\"off\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n class=\"flex-1 appearance-none rounded border-none bg-transparent outline-none\"\n placeholder=\"Search...\"\n spellcheck=\"false\"\n type=\"search\" />\n <ScalarLoading\n v-if=\"loader && loader.isActive\"\n class=\"mr-3 self-center\"\n :loader\n size=\"md\" />\n <ScalarIconButton\n v-else-if=\"model\"\n class=\"p-px size-4\"\n :icon=\"ScalarIconX\"\n label=\"Clear Search\"\n weight=\"bold\"\n @click.stop.prevent=\"handleClear\" />\n </label>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EA0BA,MAAM,WAAW,IAA6B,KAAI;EAElD,MAAM,QAAQ,SAAmB,SAAA,aAAC;EAElC,SAAS,cAAc;AACrB,SAAM,QAAQ;AAEd,OAAI,SAAS,MACX,UAAS,MAAM,OAAM;;EAKzB,MAAM,EAAE,gBAAgB,eAAe,WAAU;AAEjD,kBAAgB,QAAA,aAAa,SAAS,OAAO,OAAO,CAAA;;uBAGlD,mBAiCQ,SAAA,eAAA,mBAhCS,MAAA,eAAc,CAAA,qIAAA,oDAAmN,MAAA,QAAK,qBAAA,wBAAA,CAAA,CAAA,EAAA;IAOrP,YAAkE,MAAA,0BAAA,EAAA,EAAvC,OAAM,gCAA8B,CAAA;mBAC/D,mBAWkB,SAXlB,WAWkB;cAVZ;KAAJ,KAAI;OACI,MAAA,WAAU,EAAA;wEACJ,QAAA;KACb,cAAY,QAAA,SAAK;KAClB,gBAAe;KACf,cAAa;KACb,aAAY;KACZ,OAAM;KACN,aAAY;KACZ,YAAW;KACX,MAAK;6CARI,MAAA,MAAK,CAAA,CAAA;IAUR,QAAA,UAAU,QAAA,OAAO,YAAA,WAAA,EADzB,YAIc,MAAA,sBAAA,EAAA;;KAFZ,OAAM;KACL,QAAA,QAAA;KACD,MAAK;+BAEM,MAAA,SAAA,WAAA,EADb,YAMsC,MAAA,yBAAA,EAAA;;KAJpC,OAAM;KACL,MAAM,MAAA,YAAW;KAClB,OAAM;KACN,QAAO;KACN,SAAK,cAAe,aAAW,CAAA,QAAA,UAAA,CAAA"}
@@ -1,4 +1,4 @@
1
- import type { ScalarSidebarItemProps } from './types';
1
+ import type { ScalarSidebarGroupProps, ScalarSidebarItemProps } from './types';
2
2
  /**
3
3
  * Scalar Sidebar Section component
4
4
  *
@@ -19,7 +19,7 @@ import type { ScalarSidebarItemProps } from './types';
19
19
  */
20
20
  declare const _default: typeof __VLS_export;
21
21
  export default _default;
22
- declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
22
+ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<ScalarSidebarItemProps & Pick<ScalarSidebarGroupProps, "loading">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps & Pick<ScalarSidebarGroupProps, "loading">> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
23
23
  /** The text content of the toggle */
24
24
  default?(): unknown;
25
25
  /** The list of sidebar subitems */
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA2FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIrD;;;;;;;;;;;;;;;;;GAiBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAMhB,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;EAyGf,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AAkGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI9E;;;;;;;;;;;;;;;;;GAiBG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAQhB,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;EAmHf,CAAC;AACL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSection.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Section component\n *\n * A section of the sidebar that can contain subitems\n *\n * @example\n * <ScalarSidebarSection>\n * <!-- Section title -->\n * <template #title>\n * My Section\n * </template>\n * <!-- Section items -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarSection>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarItemProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst { is = 'li' } = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<{\n /** The text content of the toggle */\n default?(): unknown\n /** The list of sidebar subitems */\n items?(): unknown\n}>()\n\nconst { level } = useSidebarGroups({ increment: false })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('group/item group/sidebar-section contents')\">\n <ScalarSidebarSpacer\n class=\"group/spacer-before h-3\"\n :indent=\"level\" />\n <ScalarSidebarButton\n is=\"div\"\n class=\"text-sm/4 py-1.75 font-bold\"\n disabled\n :icon=\"icon\"\n :indent=\"level\">\n <slot />\n </ScalarSidebarButton>\n <ul class=\"flex flex-col gap-px\">\n <slot name=\"items\" />\n </ul>\n <ScalarSidebarSpacer\n class=\"group/spacer-after h-3\"\n :indent=\"level\" />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Don't add a spacer before the first section */\n.group\\/sidebar-section:first-of-type > .group\\/spacer-before {\n @apply h-0;\n}\n\n/* Don't add a spacer after the last section */\n.group\\/sidebar-section:last-of-type > .group\\/spacer-after {\n @apply h-0;\n}\n\n/* Only one spacer between sections */\n.group\\/sidebar-section:has(+ .group\\/sidebar-section) > .group\\/spacer-after {\n @apply h-0 -mb-px;\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"ScalarSidebarSection.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Section component\n *\n * A section of the sidebar that can contain subitems\n *\n * @example\n * <ScalarSidebarSection>\n * <!-- Section title -->\n * <template #title>\n * My Section\n * </template>\n * <!-- Section items -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarSection>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarItemProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst { is = 'li' } = defineProps<\n ScalarSidebarItemProps & Pick<ScalarSidebarGroupProps, 'loading'>\n>()\n\ndefineSlots<{\n /** The text content of the toggle */\n default?(): unknown\n /** The list of sidebar subitems */\n items?(): unknown\n}>()\n\nconst { level } = useSidebarGroups({ increment: false })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('group/item group/sidebar-section contents')\">\n <ScalarSidebarSpacer\n class=\"group/spacer-before h-3\"\n :indent=\"level\" />\n <ScalarSidebarButton\n is=\"div\"\n class=\"text-sm/4 py-1.75 font-bold\"\n disabled\n :icon=\"icon\"\n :indent=\"level\">\n <slot />\n </ScalarSidebarButton>\n <ul class=\"flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ul>\n <ScalarSidebarSpacer\n class=\"group/spacer-after h-3\"\n :indent=\"level\" />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Don't add a spacer before the first section */\n.group\\/sidebar-section:first-of-type > .group\\/spacer-before {\n @apply h-0;\n}\n\n/* Don't add a spacer after the last section */\n.group\\/sidebar-section:last-of-type > .group\\/spacer-after {\n @apply h-0;\n}\n\n/* Only one spacer between sections */\n.group\\/sidebar-section:has(+ .group\\/sidebar-section) > .group\\/spacer-after {\n @apply h-0 -mb-px;\n}\n</style>\n"],"mappings":""}
@@ -1,5 +1,6 @@
1
1
  import ScalarSidebarButton_default from "./ScalarSidebarButton.vue.js";
2
2
  import { useSidebarGroups } from "./useSidebarGroups.js";
3
+ import ScalarSidebarLoading_default from "./ScalarSidebarLoading.vue.js";
3
4
  import ScalarSidebarSpacer_default from "./ScalarSidebarSpacer.vue.js";
4
5
  import { useBindCx } from "@scalar/use-hooks/useBindCx";
5
6
  import { createBlock, createElementVNode, createVNode, defineComponent, guardReactiveProps, normalizeProps, openBlock, renderSlot, resolveDynamicComponent, unref, withCtx } from "vue";
@@ -14,7 +15,8 @@ var ScalarSidebarSection_vue_vue_type_script_setup_true_lang_default = /* @__PUR
14
15
  active: { type: Boolean },
15
16
  selected: { type: Boolean },
16
17
  disabled: { type: Boolean },
17
- indent: {}
18
+ indent: {},
19
+ loading: { type: Boolean }
18
20
  },
19
21
  setup(__props) {
20
22
  const { level } = useSidebarGroups({ increment: false });
@@ -36,7 +38,7 @@ var ScalarSidebarSection_vue_vue_type_script_setup_true_lang_default = /* @__PUR
36
38
  default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
37
39
  _: 3
38
40
  }, 8, ["icon", "indent"]),
39
- createElementVNode("ul", _hoisted_1, [renderSlot(_ctx.$slots, "items")]),
41
+ createElementVNode("ul", _hoisted_1, [__props.loading ? (openBlock(), createBlock(ScalarSidebarLoading_default, { key: 0 })) : renderSlot(_ctx.$slots, "items", { key: 1 })]),
40
42
  createVNode(ScalarSidebarSpacer_default, {
41
43
  class: "group/spacer-after h-3",
42
44
  indent: unref(level)
@@ -1 +1 @@
1
- {"version":3,"file":"ScalarSidebarSection.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Section component\n *\n * A section of the sidebar that can contain subitems\n *\n * @example\n * <ScalarSidebarSection>\n * <!-- Section title -->\n * <template #title>\n * My Section\n * </template>\n * <!-- Section items -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarSection>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarItemProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst { is = 'li' } = defineProps<ScalarSidebarItemProps>()\n\ndefineSlots<{\n /** The text content of the toggle */\n default?(): unknown\n /** The list of sidebar subitems */\n items?(): unknown\n}>()\n\nconst { level } = useSidebarGroups({ increment: false })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('group/item group/sidebar-section contents')\">\n <ScalarSidebarSpacer\n class=\"group/spacer-before h-3\"\n :indent=\"level\" />\n <ScalarSidebarButton\n is=\"div\"\n class=\"text-sm/4 py-1.75 font-bold\"\n disabled\n :icon=\"icon\"\n :indent=\"level\">\n <slot />\n </ScalarSidebarButton>\n <ul class=\"flex flex-col gap-px\">\n <slot name=\"items\" />\n </ul>\n <ScalarSidebarSpacer\n class=\"group/spacer-after h-3\"\n :indent=\"level\" />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Don't add a spacer before the first section */\n.group\\/sidebar-section:first-of-type > .group\\/spacer-before {\n @apply h-0;\n}\n\n/* Don't add a spacer after the last section */\n.group\\/sidebar-section:last-of-type > .group\\/spacer-after {\n @apply h-0;\n}\n\n/* Only one spacer between sections */\n.group\\/sidebar-section:has(+ .group\\/sidebar-section) > .group\\/spacer-after {\n @apply h-0 -mb-px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAsCA,MAAM,EAAE,UAAU,iBAAiB,EAAE,WAAW,OAAO,CAAA;EAGvD,MAAM,EAAE,OAAO,WAAU;;uBAGvB,YAoBY,wBAnBL,QAAA,GAAE,EAAA,eAAA,mBACC,MAAA,GAAE,CAAA,4CAAA,CAAA,CAAA,EAAA;2BAGU;KAFpB,YAEoB,6BAAA;MADlB,OAAM;MACL,QAAQ,MAAA,MAAK;;KAChB,YAOsB,6BAAA;MANpB,IAAG;MACH,OAAM;MACN,UAAA;MACC,MAAM,QAAA;MACN,QAAQ,MAAA,MAAK;;6BACN,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;KAEV,mBAEK,MAFL,YAEK,CADH,WAAqB,KAAA,QAAA,QAAA,CAAA,CAAA;KAEvB,YAEoB,6BAAA;MADlB,OAAM;MACL,QAAQ,MAAA,MAAK"}
1
+ {"version":3,"file":"ScalarSidebarSection.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Section component\n *\n * A section of the sidebar that can contain subitems\n *\n * @example\n * <ScalarSidebarSection>\n * <!-- Section title -->\n * <template #title>\n * My Section\n * </template>\n * <!-- Section items -->\n * <template #items>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * <ScalarSidebarItem>...</ScalarSidebarItem>\n * </template>\n * </ScalarSidebarSection>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\nimport ScalarSidebarButton from './ScalarSidebarButton.vue'\nimport ScalarSidebarLoading from './ScalarSidebarLoading.vue'\nimport ScalarSidebarSpacer from './ScalarSidebarSpacer.vue'\nimport type { ScalarSidebarGroupProps, ScalarSidebarItemProps } from './types'\nimport { useSidebarGroups } from './useSidebarGroups'\n\nconst { is = 'li' } = defineProps<\n ScalarSidebarItemProps & Pick<ScalarSidebarGroupProps, 'loading'>\n>()\n\ndefineSlots<{\n /** The text content of the toggle */\n default?(): unknown\n /** The list of sidebar subitems */\n items?(): unknown\n}>()\n\nconst { level } = useSidebarGroups({ increment: false })\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <component\n :is=\"is\"\n v-bind=\"cx('group/item group/sidebar-section contents')\">\n <ScalarSidebarSpacer\n class=\"group/spacer-before h-3\"\n :indent=\"level\" />\n <ScalarSidebarButton\n is=\"div\"\n class=\"text-sm/4 py-1.75 font-bold\"\n disabled\n :icon=\"icon\"\n :indent=\"level\">\n <slot />\n </ScalarSidebarButton>\n <ul class=\"flex flex-col gap-px\">\n <ScalarSidebarLoading v-if=\"loading\" />\n <slot\n v-else\n name=\"items\" />\n </ul>\n <ScalarSidebarSpacer\n class=\"group/spacer-after h-3\"\n :indent=\"level\" />\n </component>\n</template>\n<style>\n@reference \"../../style.css\";\n\n/* Don't add a spacer before the first section */\n.group\\/sidebar-section:first-of-type > .group\\/spacer-before {\n @apply h-0;\n}\n\n/* Don't add a spacer after the last section */\n.group\\/sidebar-section:last-of-type > .group\\/spacer-after {\n @apply h-0;\n}\n\n/* Only one spacer between sections */\n.group\\/sidebar-section:has(+ .group\\/sidebar-section) > .group\\/spacer-after {\n @apply h-0 -mb-px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAyCA,MAAM,EAAE,UAAU,iBAAiB,EAAE,WAAW,OAAO,CAAA;EAGvD,MAAM,EAAE,OAAO,WAAU;;uBAGvB,YAuBY,wBAtBL,QAAA,GAAE,EAAA,eAAA,mBACC,MAAA,GAAE,CAAA,4CAAA,CAAA,CAAA,EAAA;2BAGU;KAFpB,YAEoB,6BAAA;MADlB,OAAM;MACL,QAAQ,MAAA,MAAK;;KAChB,YAOsB,6BAAA;MANpB,IAAG;MACH,OAAM;MACN,UAAA;MACC,MAAM,QAAA;MACN,QAAQ,MAAA,MAAK;;6BACN,CAAR,WAAQ,KAAA,QAAA,UAAA,CAAA,CAAA;;;KAEV,mBAKK,MALL,YAKK,CAJyB,QAAA,WAAA,WAAA,EAA5B,YAAuC,8BAAA,EAAA,KAAA,GAAA,CAAA,IACvC,WAEiB,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,CAAA,CAAA,CAAA;KAEnB,YAEoB,6BAAA;MADlB,OAAM;MACL,QAAQ,MAAA,MAAK"}
@@ -56,6 +56,12 @@ export type ScalarSidebarGroupProps = ScalarSidebarItemProps & {
56
56
  * </ScalarSidebarGroup>
57
57
  */
58
58
  discrete?: boolean;
59
+ /**
60
+ * Whether the group items are loading
61
+ *
62
+ * Will render a loading skeleton for the contents of the group
63
+ */
64
+ loading?: boolean;
59
65
  };
60
66
  /** Scalar Sidebar Item Slots */
61
67
  export type ScalarSidebarButtonSlots = {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAE3D,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qCAAqC;IACrC,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACvB,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,mBAAmB,CAAA;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,sBAAsB,GAAG;IAC7D;;;;;;;;;;;;;;;;;;;OAmBG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,gCAAgC;AAChC,MAAM,MAAM,wBAAwB,GAAG;IACrC,0CAA0C;IAC1C,OAAO,CAAC,IAAI,OAAO,CAAA;IACnB,2CAA2C;IAC3C,MAAM,CAAC,IAAI,OAAO,CAAA;IA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;IACzC,mCAAmC;IACnC,KAAK,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAA;CAC1C,CAAA"}
package/dist/index.js CHANGED
@@ -84,8 +84,8 @@ import ScalarSidebarIndent_default from "./components/ScalarSidebar/ScalarSideba
84
84
  import ScalarSidebarButton_default from "./components/ScalarSidebar/ScalarSidebarButton.vue.js";
85
85
  import ScalarSidebarFooter_default from "./components/ScalarSidebar/ScalarSidebarFooter.vue.js";
86
86
  import ScalarSidebarGroupToggle_default from "./components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js";
87
- import ScalarSidebarGroup_default from "./components/ScalarSidebar/ScalarSidebarGroup.vue.js";
88
87
  import ScalarSidebarItem_default from "./components/ScalarSidebar/ScalarSidebarItem.vue.js";
88
+ import ScalarSidebarGroup_default from "./components/ScalarSidebar/ScalarSidebarGroup.vue.js";
89
89
  import ScalarSidebarItems_default from "./components/ScalarSidebar/ScalarSidebarItems.vue.js";
90
90
  import ScalarSidebarSpacer_default from "./components/ScalarSidebar/ScalarSidebarSpacer.vue.js";
91
91
  import ScalarSidebarNestedItems_default from "./components/ScalarSidebar/ScalarSidebarNestedItems.vue.js";
package/dist/style.css CHANGED
@@ -1085,6 +1085,10 @@ img,
1085
1085
  bottom: 0;
1086
1086
  }
1087
1087
  /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
1088
+ .group\/item:last-of-type > .group\/button > .group\/button-label > .group\/button-loading {
1089
+ width: 66.6667%;
1090
+ }
1091
+ /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
1088
1092
  .group\/items.-translate-x-full .group\/button {
1089
1093
  transition-behavior: allow-discrete;
1090
1094
  max-height: 0;
@@ -1682,6 +1686,7 @@ to {
1682
1686
  --ease-in: cubic-bezier(.4, 0, 1, 1);
1683
1687
  --ease-out: cubic-bezier(0, 0, .2, 1);
1684
1688
  --ease-in-out: cubic-bezier(.4, 0, .2, 1);
1689
+ --animate-pulse: pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;
1685
1690
  --default-transition-duration: .15s;
1686
1691
  --default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
1687
1692
  }
@@ -2226,6 +2231,10 @@ to {
2226
2231
  margin-block: -8px;
2227
2232
  }
2228
2233
 
2234
+ .scalar-app .-my-px {
2235
+ margin-block: -1px;
2236
+ }
2237
+
2229
2238
  .scalar-app .my-0\.75 {
2230
2239
  margin-block: 3px;
2231
2240
  }
@@ -2314,6 +2323,10 @@ to {
2314
2323
  margin-left: auto;
2315
2324
  }
2316
2325
 
2326
+ .scalar-app .box-content {
2327
+ box-sizing: content-box;
2328
+ }
2329
+
2317
2330
  .scalar-app .line-clamp-\(--markdown-clamp\) {
2318
2331
  -webkit-line-clamp: var(--markdown-clamp);
2319
2332
  -webkit-box-orient: vertical;
@@ -2782,6 +2795,10 @@ to {
2782
2795
  transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
2783
2796
  }
2784
2797
 
2798
+ .scalar-app .animate-pulse {
2799
+ animation: var(--animate-pulse);
2800
+ }
2801
+
2785
2802
  .scalar-app .cursor-auto {
2786
2803
  cursor: auto;
2787
2804
  }
@@ -3175,6 +3192,16 @@ to {
3175
3192
  background-color: var(--scalar-sidebar-search-background, var(--scalar-background-2));
3176
3193
  }
3177
3194
 
3195
+ .scalar-app .bg-sidebar-c-2\/15 {
3196
+ background-color: var(--scalar-sidebar-color-2, var(--scalar-color-2));
3197
+ }
3198
+
3199
+ @supports (color: color-mix(in lab, red, red)) {
3200
+ .scalar-app .bg-sidebar-c-2\/15 {
3201
+ background-color: color-mix(in oklab, var(--scalar-sidebar-color-2, var(--scalar-color-2)) 15%, transparent);
3202
+ }
3203
+ }
3204
+
3178
3205
  .scalar-app .bg-sidebar-indent-border {
3179
3206
  background-color: var(--scalar-sidebar-indent-border, var(--scalar-border-color));
3180
3207
  }
@@ -3270,10 +3297,6 @@ to {
3270
3297
  padding: 2px;
3271
3298
  }
3272
3299
 
3273
- .scalar-app .p-0\.25 {
3274
- padding: 1px;
3275
- }
3276
-
3277
3300
  .scalar-app .p-0\.75 {
3278
3301
  padding: 3px;
3279
3302
  }
@@ -3386,6 +3409,10 @@ to {
3386
3409
  padding-block: 6.75px;
3387
3410
  }
3388
3411
 
3412
+ .scalar-app .py-px {
3413
+ padding-block: 1px;
3414
+ }
3415
+
3389
3416
  .scalar-app .pt-3 {
3390
3417
  padding-top: 12px;
3391
3418
  }
@@ -4646,4 +4673,10 @@ to {
4646
4673
  syntax: "*";
4647
4674
  inherits: false
4648
4675
  }
4676
+
4677
+ @keyframes pulse {
4678
+ 50% {
4679
+ opacity: .5;
4680
+ }
4681
+ }
4649
4682
  /*$vite$:1*/
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "git+https://github.com/scalar/scalar.git",
11
11
  "directory": "packages/components"
12
12
  },
13
- "version": "0.22.3",
13
+ "version": "0.22.4",
14
14
  "engines": {
15
15
  "node": ">=22"
16
16
  },
@@ -39,11 +39,11 @@
39
39
  "radix-vue": "^1.9.17",
40
40
  "vue": "^3.5.30",
41
41
  "vue-component-type-helpers": "^3.2.6",
42
- "@scalar/helpers": "0.5.2",
43
- "@scalar/code-highlight": "0.3.3",
42
+ "@scalar/code-highlight": "0.3.4",
44
43
  "@scalar/themes": "0.15.3",
45
- "@scalar/use-hooks": "0.4.3",
46
- "@scalar/icons": "0.7.2"
44
+ "@scalar/icons": "0.7.2",
45
+ "@scalar/helpers": "0.5.2",
46
+ "@scalar/use-hooks": "0.4.3"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@headlessui/tailwindcss": "^0.2.2",