@scalar/components 0.21.0 → 0.21.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.d.ts +38 -9
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.js.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.script.js +0 -5
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.script.js.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.d.ts +28 -16
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.d.ts.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.js.map +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +13 -2
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.script.js +0 -1
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts +12 -2
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.script.js +0 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts +23 -13
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.d.ts +21 -11
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts +11 -2
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.script.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts +16 -6
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.script.js +0 -1
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.script.js.map +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts +14 -6
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.d.ts.map +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js.map +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.script.js.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +19 -9
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.script.js +0 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.script.js.map +1 -1
- package/dist/components/ScalarForm/ScalarFormError.vue.d.ts +20 -11
- package/dist/components/ScalarForm/ScalarFormError.vue.d.ts.map +1 -1
- package/dist/components/ScalarForm/ScalarFormError.vue.js.map +1 -1
- package/dist/components/ScalarForm/ScalarFormError.vue.script.js +0 -1
- package/dist/components/ScalarForm/ScalarFormError.vue.script.js.map +1 -1
- package/dist/components/ScalarHotkey/ScalarHotkey.vue.d.ts +15 -5
- package/dist/components/ScalarHotkey/ScalarHotkey.vue.d.ts.map +1 -1
- package/dist/components/ScalarHotkey/ScalarHotkey.vue.js.map +1 -1
- package/dist/components/ScalarHotkey/ScalarHotkey.vue.script.js.map +1 -1
- package/dist/components/ScalarIcon/IconList.vue.d.ts +15 -4
- package/dist/components/ScalarIcon/IconList.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +37 -24
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.vue.script.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts +17 -5
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.script.js +0 -1
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.script.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts +16 -5
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.js.map +1 -1
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.script.js +0 -1
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.script.js.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts +11 -2
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.script.js.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.d.ts +26 -17
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.d.ts.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js.map +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts +15 -6
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenu.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts +10 -3
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts +21 -10
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts +21 -10
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts +22 -11
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.d.ts +9 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuResources.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts +14 -6
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuSection.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSupport.vue.d.ts +9 -1
- package/dist/components/ScalarMenu/ScalarMenuSupport.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSupport.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuSupport.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuSupport.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts +19 -6
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.script.js +0 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.d.ts +16 -5
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.script.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.d.ts +20 -9
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.js.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.script.js.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts +13 -2
- package/dist/components/ScalarModal/ScalarModal.vue.d.ts.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.js.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.script.js +13 -0
- package/dist/components/ScalarModal/ScalarModal.vue.script.js.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts +19 -7
- package/dist/components/ScalarPopover/ScalarPopover.vue.d.ts.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.js.map +1 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.script.js +0 -1
- package/dist/components/ScalarPopover/ScalarPopover.vue.script.js.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts +23 -13
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.script.js.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.d.ts +21 -11
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.d.ts.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js.map +1 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.script.js +0 -1
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.script.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.d.ts +16 -8
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchButton.vue.script.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts +21 -9
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.script.js.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts +20 -9
- package/dist/components/ScalarToggle/ScalarToggle.vue.d.ts.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.js.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.script.js.map +1 -1
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.d.ts +24 -5
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.d.ts.map +1 -1
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.js.map +1 -1
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.script.js +0 -1
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.script.js.map +1 -1
- package/dist/style.css +13 -13
- package/package.json +2 -2
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Search Result List component
|
|
3
|
+
*
|
|
4
|
+
* A container for search result items with a "no results" fallback.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* <ScalarSearchResultList :noResults="results.length === 0">
|
|
8
|
+
* <ScalarSearchResultItem v-for="r in results" :key="r.id">
|
|
9
|
+
* {{ r.label }}
|
|
10
|
+
* </ScalarSearchResultItem>
|
|
11
|
+
* </ScalarSearchResultList>
|
|
12
|
+
*/
|
|
12
13
|
declare const _default: typeof __VLS_export;
|
|
13
14
|
export default _default;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
16
|
+
noResults?: boolean;
|
|
17
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
18
|
+
noResults?: boolean;
|
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
noResults?: (props: {}) => any;
|
|
21
|
+
} & {
|
|
22
|
+
default?: (props: {}) => any;
|
|
23
|
+
}>;
|
|
14
24
|
type __VLS_WithSlots<T, S> = T & {
|
|
15
25
|
new (): {
|
|
16
26
|
$slots: S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSearchResultList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSearchResultList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"names":[],"mappings":"AAiDA;;;;;;;;;;;GAWG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;gBAEJ,OAAO;;gBAAP,OAAO;;gBAqDL,CAAC,KAAK,IAAgB,KAAK,GAAG;;cAChC,CAAC,KAAK,IAAgB,KAAK,GAAG;EASxC,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":"ScalarSearchResultList.vue.js","names":[],"sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n noResults?: boolean\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n role=\"listbox\"\n v-bind=\"cx('flex flex-col')\">\n <slot\n v-if=\"noResults\"\n name=\"noResults\">\n <div class=\"flex flex-col items-center gap-2 px-3 py-4\">\n <div\n class=\"text-base font-medium text-c-2\"\n role=\"alert\">\n No results found\n </div>\n </div>\n </slot>\n <slot />\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ScalarSearchResultList.vue.js","names":[],"sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Search Result List component\n *\n * A container for search result items with a \"no results\" fallback.\n *\n * @example\n * <ScalarSearchResultList :noResults=\"results.length === 0\">\n * <ScalarSearchResultItem v-for=\"r in results\" :key=\"r.id\">\n * {{ r.label }}\n * </ScalarSearchResultItem>\n * </ScalarSearchResultList>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n noResults?: boolean\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n role=\"listbox\"\n v-bind=\"cx('flex flex-col')\">\n <slot\n v-if=\"noResults\"\n name=\"noResults\">\n <div class=\"flex flex-col items-center gap-2 px-3 py-4\">\n <div\n class=\"text-base font-medium text-c-2\"\n role=\"alert\">\n No results found\n </div>\n </div>\n </slot>\n <slot />\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useBindCx } from "@scalar/use-hooks/useBindCx";
|
|
2
2
|
import { createCommentVNode, createElementBlock, createElementVNode, defineComponent, mergeProps, openBlock, renderSlot, unref } from "vue";
|
|
3
|
-
//#region src/components/ScalarSearchResults/ScalarSearchResultList.vue?vue&type=script&setup=true&lang.ts
|
|
4
3
|
var ScalarSearchResultList_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5
4
|
inheritAttrs: false,
|
|
6
5
|
__name: "ScalarSearchResultList",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSearchResultList.vue.script.js","names":[],"sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n noResults?: boolean\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n role=\"listbox\"\n v-bind=\"cx('flex flex-col')\">\n <slot\n v-if=\"noResults\"\n name=\"noResults\">\n <div class=\"flex flex-col items-center gap-2 px-3 py-4\">\n <div\n class=\"text-base font-medium text-c-2\"\n role=\"alert\">\n No results found\n </div>\n </div>\n </slot>\n <slot />\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSearchResultList.vue.script.js","names":[],"sources":["../../../src/components/ScalarSearchResults/ScalarSearchResultList.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Search Result List component\n *\n * A container for search result items with a \"no results\" fallback.\n *\n * @example\n * <ScalarSearchResultList :noResults=\"results.length === 0\">\n * <ScalarSearchResultItem v-for=\"r in results\" :key=\"r.id\">\n * {{ r.label }}\n * </ScalarSearchResultItem>\n * </ScalarSearchResultList>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineProps<{\n noResults?: boolean\n}>()\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <div\n role=\"listbox\"\n v-bind=\"cx('flex flex-col')\">\n <slot\n v-if=\"noResults\"\n name=\"noResults\">\n <div class=\"flex flex-col items-center gap-2 px-3 py-4\">\n <div\n class=\"text-base font-medium text-c-2\"\n role=\"alert\">\n No results found\n </div>\n </div>\n </slot>\n <slot />\n </div>\n</template>\n"],"mappings":";;;;;;;EAuBA,MAAM,EAAE,OAAO,WAAU;;uBAGvB,mBAeM,OAfN,WAeM,EAdJ,MAAK,WAAS,EACN,MAAA,GAAE,CAAA,gBAAA,CAAA,EAAA,CAEF,QAAA,YADR,WAUO,KAAA,QAAA,aAAA,EAAA,KAAA,GAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAPL,mBAMM,OAAA,EAND,OAAM,8CAA4C,EAAA,CACrD,mBAIM,OAAA;IAHJ,OAAM;IACN,MAAK;MAAQ,qBAEf,CAAA,EAAA,GAAA,EAAA,CAAA,GAAA,mBAAA,IAAA,KAAA,EAGJ,WAAQ,KAAA,QAAA,UAAA,CAAA,EAAA,GAAA"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Sidebar Search Button component
|
|
3
|
+
*
|
|
4
|
+
* A styled button that serves as a search trigger in the sidebar.
|
|
5
|
+
* Displays a magnifying glass icon and an optional keyboard shortcut.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScalarSidebarSearchButton>
|
|
9
|
+
* <template #shortcut>⌘K</template>
|
|
10
|
+
* </ScalarSidebarSearchButton>
|
|
11
|
+
*/
|
|
9
12
|
declare const _default: typeof __VLS_export;
|
|
10
13
|
export default _default;
|
|
14
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
15
|
+
default?: (props: {}) => any;
|
|
16
|
+
} & {
|
|
17
|
+
shortcut?: (props: {}) => any;
|
|
18
|
+
}>;
|
|
11
19
|
type __VLS_WithSlots<T, S> = T & {
|
|
12
20
|
new (): {
|
|
13
21
|
$slots: S;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"names":[],"mappings":"AAoDA;;;;;;;;;;GAUG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;cAyEJ,CAAC,KAAK,IAAgB,KAAK,GAAG;;eAC7B,CAAC,KAAK,IAAgB,KAAK,GAAG;EAQzC,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":"ScalarSidebarSearchButton.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <button\n role=\"search\"\n type=\"button\"\n v-bind=\"\n cx(\n 'flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1',\n 'bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"size-4\" />\n <span class=\"flex-1 text-left leading-none\">\n <slot>Search...</slot>\n </span>\n <span\n v-if=\"$slots.shortcut\"\n class=\"uppercase text-sidebar-c-2 leading-none py-1 px-1.25 rounded text-xs font-medium border\">\n <span class=\"sr-only\">Keyboard Shortcut:</span>\n <kbd>\n <slot name=\"shortcut\" />\n </kbd>\n </span>\n </button>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchButton.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Button component\n *\n * A styled button that serves as a search trigger in the sidebar.\n * Displays a magnifying glass icon and an optional keyboard shortcut.\n *\n * @example\n * <ScalarSidebarSearchButton>\n * <template #shortcut>⌘K</template>\n * </ScalarSidebarSearchButton>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <button\n role=\"search\"\n type=\"button\"\n v-bind=\"\n cx(\n 'flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1',\n 'bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"size-4\" />\n <span class=\"flex-1 text-left leading-none\">\n <slot>Search...</slot>\n </span>\n <span\n v-if=\"$slots.shortcut\"\n class=\"uppercase text-sidebar-c-2 leading-none py-1 px-1.25 rounded text-xs font-medium border\">\n <span class=\"sr-only\">Keyboard Shortcut:</span>\n <kbd>\n <slot name=\"shortcut\" />\n </kbd>\n </span>\n </button>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchButton.vue.script.js","names":["$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <button\n role=\"search\"\n type=\"button\"\n v-bind=\"\n cx(\n 'flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1',\n 'bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"size-4\" />\n <span class=\"flex-1 text-left leading-none\">\n <slot>Search...</slot>\n </span>\n <span\n v-if=\"$slots.shortcut\"\n class=\"uppercase text-sidebar-c-2 leading-none py-1 px-1.25 rounded text-xs font-medium border\">\n <span class=\"sr-only\">Keyboard Shortcut:</span>\n <kbd>\n <slot name=\"shortcut\" />\n </kbd>\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchButton.vue.script.js","names":["$slots"],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchButton.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Sidebar Search Button component\n *\n * A styled button that serves as a search trigger in the sidebar.\n * Displays a magnifying glass icon and an optional keyboard shortcut.\n *\n * @example\n * <ScalarSidebarSearchButton>\n * <template #shortcut>⌘K</template>\n * </ScalarSidebarSearchButton>\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { ScalarIconMagnifyingGlass } from '@scalar/icons'\nimport { useBindCx } from '@scalar/use-hooks/useBindCx'\n\ndefineOptions({ inheritAttrs: false })\nconst { cx } = useBindCx()\n</script>\n<template>\n <button\n role=\"search\"\n type=\"button\"\n v-bind=\"\n cx(\n 'flex items-center rounded border text-base h-8 gap-1 pl-2 pr-1',\n 'bg-sidebar-b-search border-sidebar-border-search text-sidebar-c-search',\n )\n \">\n <ScalarIconMagnifyingGlass class=\"size-4\" />\n <span class=\"flex-1 text-left leading-none\">\n <slot>Search...</slot>\n </span>\n <span\n v-if=\"$slots.shortcut\"\n class=\"uppercase text-sidebar-c-2 leading-none py-1 px-1.25 rounded text-xs font-medium border\">\n <span class=\"sr-only\">Keyboard Shortcut:</span>\n <kbd>\n <slot name=\"shortcut\" />\n </kbd>\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;EAmBA,MAAM,EAAE,OAAO,WAAU;;uBAGvB,mBAqBS,UArBT,WAqBS;IApBP,MAAK;IACL,MAAK;MACU,MAAA,GAAE,CAAA,kEAAA,yEAAA,CAAA,EAAA;IAMjB,YAA4C,MAAA,0BAAA,EAAA,EAAjB,OAAM,UAAQ,CAAA;IACzC,mBAEO,QAFP,YAEO,CADL,WAAsB,KAAA,QAAA,WAAA,EAAA,QAAA,CAAA,OAAA,OAAA,OAAA,KAAA,gBAAhB,aAAS,GAAA,EAAA,CAAA,CAAA,CAAA;IAGTA,KAAAA,OAAO,YAAA,WAAA,EADf,mBAOO,QAPP,YAOO,CAAA,OAAA,OAAA,OAAA,KAJL,mBAA+C,QAAA,EAAzC,OAAM,WAAS,EAAC,sBAAkB,GAAA,GACxC,mBAEM,OAAA,MAAA,CADJ,WAAwB,KAAA,QAAA,WAAA,CAAA,CAAA,CAAA,CAAA,IAAA,mBAAA,IAAA,KAAA"}
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
import { type LoadingState } from '../ScalarLoading';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Search Input component
|
|
4
|
+
*
|
|
5
|
+
* An inline search input for the sidebar with a clear button
|
|
6
|
+
* and optional loading indicator.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ScalarSidebarSearchInput v-model="query" />
|
|
10
|
+
*/
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
3
14
|
autofocus?: boolean;
|
|
4
15
|
loader?: LoadingState;
|
|
5
16
|
label?: string;
|
|
6
|
-
}
|
|
7
|
-
type __VLS_ModelProps = {
|
|
17
|
+
} & {
|
|
8
18
|
modelValue?: string;
|
|
9
|
-
}
|
|
10
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
20
|
"update:modelValue": (value: string | undefined) => any;
|
|
13
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
21
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
22
|
+
autofocus?: boolean;
|
|
23
|
+
loader?: LoadingState;
|
|
24
|
+
label?: string;
|
|
25
|
+
} & {
|
|
26
|
+
modelValue?: string;
|
|
27
|
+
}> & Readonly<{
|
|
14
28
|
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
15
29
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
-
declare const _default: typeof __VLS_export;
|
|
17
|
-
export default _default;
|
|
18
30
|
//# sourceMappingURL=ScalarSidebarSearchInput.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSearchInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"names":[],"mappings":"AAuFA,OAAO,EAAE,KAAK,YAAY,EAAiB,MAAM,kBAAkB,CAAA;AAGnE;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;gBAEJ,OAAO;aACV,YAAY;YACb,MAAM;;iBAwBH,MAAM;;;;gBA1BL,OAAO;aACV,YAAY;YACb,MAAM;;iBAwBH,MAAM;;;kFA+Hf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchInput.vue.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<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-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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSearchInput.vue.script.js","names":[],"sources":["../../../src/components/ScalarSidebar/ScalarSidebarSearchInput.vue"],"sourcesContent":["<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.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,16 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Toggle component
|
|
3
|
+
*
|
|
4
|
+
* A switch-style toggle control with support for
|
|
5
|
+
* disabled state and accessible labeling.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScalarToggle v-model="enabled" label="Enable feature" />
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
2
13
|
disabled?: boolean;
|
|
3
14
|
label?: string;
|
|
4
|
-
}
|
|
5
|
-
type __VLS_ModelProps = {
|
|
15
|
+
} & {
|
|
6
16
|
modelValue?: boolean;
|
|
7
|
-
}
|
|
8
|
-
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
18
|
"update:modelValue": (value: boolean) => any;
|
|
11
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
label?: string;
|
|
22
|
+
} & {
|
|
23
|
+
modelValue?: boolean;
|
|
24
|
+
}> & Readonly<{
|
|
12
25
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
13
26
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
16
27
|
//# sourceMappingURL=ScalarToggle.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"names":[],"mappings":"AA6DA;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;eAEL,OAAO;YACV,MAAM;;iBA0BH,OAAO;;;;eA3BP,OAAO;YACV,MAAM;;iBA0BH,OAAO;;;kFAoEhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarToggle.vue.js","names":[],"sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, cx } from '@scalar/use-hooks/useBindCx'\n\nconst props = defineProps<{\n disabled?: boolean\n label?: string\n}>()\n\nconst model = defineModel<boolean>({ default: false })\n\nfunction toggle() {\n if (props.disabled) {\n return\n }\n model.value = !model.value\n}\n\nconst variants = cva({\n base: 'relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300',\n variants: {\n checked: { true: 'bg-c-accent' },\n disabled: { true: 'cursor-not-allowed opacity-40' },\n },\n})\n</script>\n<template>\n <button\n :aria-checked=\"model\"\n :aria-disabled=\"disabled\"\n :class=\"cx(variants({ checked: model, disabled }))\"\n role=\"switch\"\n type=\"button\"\n @click=\"toggle\">\n <div\n class=\"absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300\"\n :class=\"{ 'translate-x-2.5': model }\" />\n <span\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </span>\n </button>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ScalarToggle.vue.js","names":[],"sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Toggle component\n *\n * A switch-style toggle control with support for\n * disabled state and accessible labeling.\n *\n * @example\n * <ScalarToggle v-model=\"enabled\" label=\"Enable feature\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, cx } from '@scalar/use-hooks/useBindCx'\n\nconst props = defineProps<{\n disabled?: boolean\n label?: string\n}>()\n\nconst model = defineModel<boolean>({ default: false })\n\nfunction toggle() {\n if (props.disabled) {\n return\n }\n model.value = !model.value\n}\n\nconst variants = cva({\n base: 'relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300',\n variants: {\n checked: { true: 'bg-c-accent' },\n disabled: { true: 'cursor-not-allowed opacity-40' },\n },\n})\n</script>\n<template>\n <button\n :aria-checked=\"model\"\n :aria-disabled=\"disabled\"\n :class=\"cx(variants({ checked: model, disabled }))\"\n role=\"switch\"\n type=\"button\"\n @click=\"toggle\">\n <div\n class=\"absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300\"\n :class=\"{ 'translate-x-2.5': model }\" />\n <span\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </span>\n </button>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarToggle.vue.script.js","names":[],"sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, cx } from '@scalar/use-hooks/useBindCx'\n\nconst props = defineProps<{\n disabled?: boolean\n label?: string\n}>()\n\nconst model = defineModel<boolean>({ default: false })\n\nfunction toggle() {\n if (props.disabled) {\n return\n }\n model.value = !model.value\n}\n\nconst variants = cva({\n base: 'relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300',\n variants: {\n checked: { true: 'bg-c-accent' },\n disabled: { true: 'cursor-not-allowed opacity-40' },\n },\n})\n</script>\n<template>\n <button\n :aria-checked=\"model\"\n :aria-disabled=\"disabled\"\n :class=\"cx(variants({ checked: model, disabled }))\"\n role=\"switch\"\n type=\"button\"\n @click=\"toggle\">\n <div\n class=\"absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300\"\n :class=\"{ 'translate-x-2.5': model }\" />\n <span\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ScalarToggle.vue.script.js","names":[],"sources":["../../../src/components/ScalarToggle/ScalarToggle.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Toggle component\n *\n * A switch-style toggle control with support for\n * disabled state and accessible labeling.\n *\n * @example\n * <ScalarToggle v-model=\"enabled\" label=\"Enable feature\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { cva, cx } from '@scalar/use-hooks/useBindCx'\n\nconst props = defineProps<{\n disabled?: boolean\n label?: string\n}>()\n\nconst model = defineModel<boolean>({ default: false })\n\nfunction toggle() {\n if (props.disabled) {\n return\n }\n model.value = !model.value\n}\n\nconst variants = cva({\n base: 'relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300',\n variants: {\n checked: { true: 'bg-c-accent' },\n disabled: { true: 'cursor-not-allowed opacity-40' },\n },\n})\n</script>\n<template>\n <button\n :aria-checked=\"model\"\n :aria-disabled=\"disabled\"\n :class=\"cx(variants({ checked: model, disabled }))\"\n role=\"switch\"\n type=\"button\"\n @click=\"toggle\">\n <div\n class=\"absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300\"\n :class=\"{ 'translate-x-2.5': model }\" />\n <span\n v-if=\"label\"\n class=\"sr-only\">\n {{ label }}\n </span>\n </button>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EAKd,MAAM,QAAQ,SAAoB,SAAA,aAAmB;EAErD,SAAS,SAAS;AAChB,OAAI,MAAM,SACR;AAEF,SAAM,QAAQ,CAAC,MAAM;;EAGvB,MAAM,WAAW,IAAI;GACnB,MAAM;GACN,UAAU;IACR,SAAS,EAAE,MAAM,eAAe;IAChC,UAAU,EAAE,MAAM,iCAAiC;IACpD;GACF,CAAA;;uBAGC,mBAeS,UAAA;IAdN,gBAAc,MAAA;IACd,iBAAe,QAAA;IACf,OAAK,eAAE,MAAA,GAAE,CAAC,MAAA,SAAQ,CAAA;KAAA,SAAY,MAAA;KAAK,UAAE,QAAA;KAAQ,CAAA,CAAA,CAAA;IAC9C,MAAK;IACL,MAAK;IACJ,SAAO;OACR,mBAE0C,OAAA,EADxC,OAAK,eAAA,CAAC,wIAAsI,EAAA,mBAC/G,MAAA,OAAK,CAAA,CAAA,EAAA,EAAA,MAAA,EAAA,EAE5B,QAAA,SAAA,WAAA,EADR,mBAIO,QAJP,YAIO,gBADF,QAAA,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,EAAA,IAAA,WAAA"}
|
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Virtual Text component
|
|
3
|
+
*
|
|
4
|
+
* Renders large blocks of text efficiently using virtualized scrolling.
|
|
5
|
+
* Only the visible lines are rendered to the DOM.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* <ScalarVirtualText text="line1\nline2\nline3" :lineHeight="20" />
|
|
9
|
+
*/
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
13
|
+
/** Text to display */
|
|
14
|
+
text: string;
|
|
15
|
+
/**
|
|
16
|
+
* Height of each line
|
|
17
|
+
* @default 20
|
|
18
|
+
*/
|
|
19
|
+
lineHeight?: number;
|
|
20
|
+
containerClass?: string;
|
|
21
|
+
contentClass?: string;
|
|
22
|
+
lineClass?: string;
|
|
23
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
2
24
|
/** Text to display */
|
|
3
25
|
text: string;
|
|
4
26
|
/**
|
|
@@ -9,13 +31,10 @@ type __VLS_Props = {
|
|
|
9
31
|
containerClass?: string;
|
|
10
32
|
contentClass?: string;
|
|
11
33
|
lineClass?: string;
|
|
12
|
-
}
|
|
13
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
34
|
+
}> & Readonly<{}>, {
|
|
14
35
|
lineHeight: number;
|
|
15
36
|
containerClass: string;
|
|
16
37
|
contentClass: string;
|
|
17
38
|
lineClass: string;
|
|
18
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
-
declare const _default: typeof __VLS_export;
|
|
20
|
-
export default _default;
|
|
21
40
|
//# sourceMappingURL=ScalarVirtualText.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarVirtualText.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarVirtualText.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"names":[],"mappings":"AA0IA;;;;;;;;GAQG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAGzC,QAAA,MAAM,YAAY;IAEd,sBAAsB;UAChB,MAAM;IACZ;;;OAGG;iBACU,MAAM;qBACF,MAAM;mBACR,MAAM;gBACT,MAAM;;IATlB,sBAAsB;UAChB,MAAM;IACZ;;;OAGG;iBACU,MAAM;qBACF,MAAM;mBACR,MAAM;gBACT,MAAM;;gBAHL,MAAM;oBACF,MAAM;kBACR,MAAM;eACT,MAAM;6EAqJlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarVirtualText.vue.js","names":[],"sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref, watchEffect } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Text to display */\n text: string\n /**\n * Height of each line\n * @default 20\n */\n lineHeight?: number\n containerClass?: string\n contentClass?: string\n lineClass?: string\n }>(),\n {\n lineHeight: 20,\n containerClass: '',\n contentClass: '',\n lineClass: '',\n },\n)\n\nconst containerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst scrollPosition = ref(0)\nconst containerHeight = ref(0)\n\n/** Array of text broken into lines */\nconst lines = computed(() => props.text.split('\\n'))\n/**\n * Total height of all lines combined\n *\n * TODO: there is a problem with this calculation which screws up the scrollbar a bit\n */\nconst totalHeight = computed(() => lines.value.length * props.lineHeight)\n\n/** Index of the first visible line */\nconst visibleStartIndex = computed(() =>\n Math.floor(scrollPosition.value / props.lineHeight),\n)\n\n/** Index of the last visible line */\nconst visibleEndIndex = computed(() =>\n Math.min(\n Math.ceil(\n (scrollPosition.value + containerHeight.value) / props.lineHeight,\n ),\n lines.value.length,\n ),\n)\n\n/** Array of visible lines, including buffer for smooth scrolling */\nconst visibleLines = computed(() => {\n const buffer = 10\n const start = Math.max(0, visibleStartIndex.value - buffer)\n const end = Math.min(lines.value.length, visibleEndIndex.value + buffer)\n\n return lines.value.slice(start, end)\n})\n\n/** Style object for the content container, controls \"scrolling\" */\nconst contentStyle = computed(() => ({\n height: `${totalHeight.value}px`,\n transform: `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`,\n}))\n\n/** Updates the scroll position when the container is scrolled */\nconst handleScroll = () =>\n containerRef.value && (scrollPosition.value = containerRef.value.scrollTop)\n\n/** Updates the container height when the window is resized */\nconst updateContainerHeight = () =>\n containerRef.value &&\n (containerHeight.value = containerRef.value.clientHeight)\n\nonMounted(() => {\n updateContainerHeight()\n window.addEventListener('resize', updateContainerHeight)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('resize', updateContainerHeight)\n})\n\nwatchEffect(() => {\n if (!contentRef.value) {\n return\n }\n\n contentRef.value.style.transform = `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"scalar-virtual-text overflow-auto\"\n :class=\"containerClass\"\n @scroll=\"handleScroll\">\n <code\n ref=\"contentRef\"\n class=\"scalar-virtual-text-content\"\n :class=\"contentClass\"\n :style=\"contentStyle\">\n <div\n v-for=\"(line, index) in visibleLines\"\n :key=\"visibleStartIndex + index\"\n class=\"scalar-virtual-text-line\"\n :class=\"lineClass\"\n :style=\"{\n height: `${props.lineHeight}px`,\n lineHeight: `${props.lineHeight}px`,\n }\">\n {{ line }}\n </div>\n </code>\n </div>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"ScalarVirtualText.vue.js","names":[],"sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Virtual Text component\n *\n * Renders large blocks of text efficiently using virtualized scrolling.\n * Only the visible lines are rendered to the DOM.\n *\n * @example\n * <ScalarVirtualText text=\"line1\\nline2\\nline3\" :lineHeight=\"20\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref, watchEffect } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Text to display */\n text: string\n /**\n * Height of each line\n * @default 20\n */\n lineHeight?: number\n containerClass?: string\n contentClass?: string\n lineClass?: string\n }>(),\n {\n lineHeight: 20,\n containerClass: '',\n contentClass: '',\n lineClass: '',\n },\n)\n\nconst containerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst scrollPosition = ref(0)\nconst containerHeight = ref(0)\n\n/** Array of text broken into lines */\nconst lines = computed(() => props.text.split('\\n'))\n/**\n * Total height of all lines combined\n *\n * TODO: there is a problem with this calculation which screws up the scrollbar a bit\n */\nconst totalHeight = computed(() => lines.value.length * props.lineHeight)\n\n/** Index of the first visible line */\nconst visibleStartIndex = computed(() =>\n Math.floor(scrollPosition.value / props.lineHeight),\n)\n\n/** Index of the last visible line */\nconst visibleEndIndex = computed(() =>\n Math.min(\n Math.ceil(\n (scrollPosition.value + containerHeight.value) / props.lineHeight,\n ),\n lines.value.length,\n ),\n)\n\n/** Array of visible lines, including buffer for smooth scrolling */\nconst visibleLines = computed(() => {\n const buffer = 10\n const start = Math.max(0, visibleStartIndex.value - buffer)\n const end = Math.min(lines.value.length, visibleEndIndex.value + buffer)\n\n return lines.value.slice(start, end)\n})\n\n/** Style object for the content container, controls \"scrolling\" */\nconst contentStyle = computed(() => ({\n height: `${totalHeight.value}px`,\n transform: `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`,\n}))\n\n/** Updates the scroll position when the container is scrolled */\nconst handleScroll = () =>\n containerRef.value && (scrollPosition.value = containerRef.value.scrollTop)\n\n/** Updates the container height when the window is resized */\nconst updateContainerHeight = () =>\n containerRef.value &&\n (containerHeight.value = containerRef.value.clientHeight)\n\nonMounted(() => {\n updateContainerHeight()\n window.addEventListener('resize', updateContainerHeight)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('resize', updateContainerHeight)\n})\n\nwatchEffect(() => {\n if (!contentRef.value) {\n return\n }\n\n contentRef.value.style.transform = `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"scalar-virtual-text overflow-auto\"\n :class=\"containerClass\"\n @scroll=\"handleScroll\">\n <code\n ref=\"contentRef\"\n class=\"scalar-virtual-text-content\"\n :class=\"contentClass\"\n :style=\"contentStyle\">\n <div\n v-for=\"(line, index) in visibleLines\"\n :key=\"visibleStartIndex + index\"\n class=\"scalar-virtual-text-line\"\n :class=\"lineClass\"\n :style=\"{\n height: `${props.lineHeight}px`,\n lineHeight: `${props.lineHeight}px`,\n }\">\n {{ line }}\n </div>\n </code>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Fragment, computed, createElementBlock, createElementVNode, defineComponent, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, toDisplayString, watchEffect } from "vue";
|
|
2
|
-
//#region src/components/ScalarVirtualText/ScalarVirtualText.vue?vue&type=script&setup=true&lang.ts
|
|
3
2
|
var ScalarVirtualText_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
4
3
|
__name: "ScalarVirtualText",
|
|
5
4
|
props: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarVirtualText.vue.script.js","names":[],"sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref, watchEffect } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Text to display */\n text: string\n /**\n * Height of each line\n * @default 20\n */\n lineHeight?: number\n containerClass?: string\n contentClass?: string\n lineClass?: string\n }>(),\n {\n lineHeight: 20,\n containerClass: '',\n contentClass: '',\n lineClass: '',\n },\n)\n\nconst containerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst scrollPosition = ref(0)\nconst containerHeight = ref(0)\n\n/** Array of text broken into lines */\nconst lines = computed(() => props.text.split('\\n'))\n/**\n * Total height of all lines combined\n *\n * TODO: there is a problem with this calculation which screws up the scrollbar a bit\n */\nconst totalHeight = computed(() => lines.value.length * props.lineHeight)\n\n/** Index of the first visible line */\nconst visibleStartIndex = computed(() =>\n Math.floor(scrollPosition.value / props.lineHeight),\n)\n\n/** Index of the last visible line */\nconst visibleEndIndex = computed(() =>\n Math.min(\n Math.ceil(\n (scrollPosition.value + containerHeight.value) / props.lineHeight,\n ),\n lines.value.length,\n ),\n)\n\n/** Array of visible lines, including buffer for smooth scrolling */\nconst visibleLines = computed(() => {\n const buffer = 10\n const start = Math.max(0, visibleStartIndex.value - buffer)\n const end = Math.min(lines.value.length, visibleEndIndex.value + buffer)\n\n return lines.value.slice(start, end)\n})\n\n/** Style object for the content container, controls \"scrolling\" */\nconst contentStyle = computed(() => ({\n height: `${totalHeight.value}px`,\n transform: `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`,\n}))\n\n/** Updates the scroll position when the container is scrolled */\nconst handleScroll = () =>\n containerRef.value && (scrollPosition.value = containerRef.value.scrollTop)\n\n/** Updates the container height when the window is resized */\nconst updateContainerHeight = () =>\n containerRef.value &&\n (containerHeight.value = containerRef.value.clientHeight)\n\nonMounted(() => {\n updateContainerHeight()\n window.addEventListener('resize', updateContainerHeight)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('resize', updateContainerHeight)\n})\n\nwatchEffect(() => {\n if (!contentRef.value) {\n return\n }\n\n contentRef.value.style.transform = `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"scalar-virtual-text overflow-auto\"\n :class=\"containerClass\"\n @scroll=\"handleScroll\">\n <code\n ref=\"contentRef\"\n class=\"scalar-virtual-text-content\"\n :class=\"contentClass\"\n :style=\"contentStyle\">\n <div\n v-for=\"(line, index) in visibleLines\"\n :key=\"visibleStartIndex + index\"\n class=\"scalar-virtual-text-line\"\n :class=\"lineClass\"\n :style=\"{\n height: `${props.lineHeight}px`,\n lineHeight: `${props.lineHeight}px`,\n }\">\n {{ line }}\n </div>\n </code>\n </div>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarVirtualText.vue.script.js","names":[],"sources":["../../../src/components/ScalarVirtualText/ScalarVirtualText.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Scalar Virtual Text component\n *\n * Renders large blocks of text efficiently using virtualized scrolling.\n * Only the visible lines are rendered to the DOM.\n *\n * @example\n * <ScalarVirtualText text=\"line1\\nline2\\nline3\" :lineHeight=\"20\" />\n */\nexport default {}\n</script>\n<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref, watchEffect } from 'vue'\n\nconst props = withDefaults(\n defineProps<{\n /** Text to display */\n text: string\n /**\n * Height of each line\n * @default 20\n */\n lineHeight?: number\n containerClass?: string\n contentClass?: string\n lineClass?: string\n }>(),\n {\n lineHeight: 20,\n containerClass: '',\n contentClass: '',\n lineClass: '',\n },\n)\n\nconst containerRef = ref<HTMLElement | null>(null)\nconst contentRef = ref<HTMLElement | null>(null)\nconst scrollPosition = ref(0)\nconst containerHeight = ref(0)\n\n/** Array of text broken into lines */\nconst lines = computed(() => props.text.split('\\n'))\n/**\n * Total height of all lines combined\n *\n * TODO: there is a problem with this calculation which screws up the scrollbar a bit\n */\nconst totalHeight = computed(() => lines.value.length * props.lineHeight)\n\n/** Index of the first visible line */\nconst visibleStartIndex = computed(() =>\n Math.floor(scrollPosition.value / props.lineHeight),\n)\n\n/** Index of the last visible line */\nconst visibleEndIndex = computed(() =>\n Math.min(\n Math.ceil(\n (scrollPosition.value + containerHeight.value) / props.lineHeight,\n ),\n lines.value.length,\n ),\n)\n\n/** Array of visible lines, including buffer for smooth scrolling */\nconst visibleLines = computed(() => {\n const buffer = 10\n const start = Math.max(0, visibleStartIndex.value - buffer)\n const end = Math.min(lines.value.length, visibleEndIndex.value + buffer)\n\n return lines.value.slice(start, end)\n})\n\n/** Style object for the content container, controls \"scrolling\" */\nconst contentStyle = computed(() => ({\n height: `${totalHeight.value}px`,\n transform: `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`,\n}))\n\n/** Updates the scroll position when the container is scrolled */\nconst handleScroll = () =>\n containerRef.value && (scrollPosition.value = containerRef.value.scrollTop)\n\n/** Updates the container height when the window is resized */\nconst updateContainerHeight = () =>\n containerRef.value &&\n (containerHeight.value = containerRef.value.clientHeight)\n\nonMounted(() => {\n updateContainerHeight()\n window.addEventListener('resize', updateContainerHeight)\n})\n\nonBeforeUnmount(() => {\n window.removeEventListener('resize', updateContainerHeight)\n})\n\nwatchEffect(() => {\n if (!contentRef.value) {\n return\n }\n\n contentRef.value.style.transform = `translateY(${Math.max(0, visibleStartIndex.value - 10) * props.lineHeight}px)`\n})\n</script>\n\n<template>\n <div\n ref=\"containerRef\"\n class=\"scalar-virtual-text overflow-auto\"\n :class=\"containerClass\"\n @scroll=\"handleScroll\">\n <code\n ref=\"contentRef\"\n class=\"scalar-virtual-text-content\"\n :class=\"contentClass\"\n :style=\"contentStyle\">\n <div\n v-for=\"(line, index) in visibleLines\"\n :key=\"visibleStartIndex + index\"\n class=\"scalar-virtual-text-line\"\n :class=\"lineClass\"\n :style=\"{\n height: `${props.lineHeight}px`,\n lineHeight: `${props.lineHeight}px`,\n }\">\n {{ line }}\n </div>\n </code>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;EAeA,MAAM,QAAQ;EAqBd,MAAM,eAAe,IAAwB,KAAI;EACjD,MAAM,aAAa,IAAwB,KAAI;EAC/C,MAAM,iBAAiB,IAAI,EAAC;EAC5B,MAAM,kBAAkB,IAAI,EAAC;;EAG7B,MAAM,QAAQ,eAAe,MAAM,KAAK,MAAM,KAAK,CAAA;;;;;;EAMnD,MAAM,cAAc,eAAe,MAAM,MAAM,SAAS,MAAM,WAAU;;EAGxE,MAAM,oBAAoB,eACxB,KAAK,MAAM,eAAe,QAAQ,MAAM,WAAW,CACrD;;EAGA,MAAM,kBAAkB,eACtB,KAAK,IACH,KAAK,MACF,eAAe,QAAQ,gBAAgB,SAAS,MAAM,WACxD,EACD,MAAM,MAAM,OACb,CACH;;EAGA,MAAM,eAAe,eAAe;GAClC,MAAM,SAAS;GACf,MAAM,QAAQ,KAAK,IAAI,GAAG,kBAAkB,QAAQ,OAAM;GAC1D,MAAM,MAAM,KAAK,IAAI,MAAM,MAAM,QAAQ,gBAAgB,QAAQ,OAAM;AAEvE,UAAO,MAAM,MAAM,MAAM,OAAO,IAAG;IACpC;;EAGD,MAAM,eAAe,gBAAgB;GACnC,QAAQ,GAAG,YAAY,MAAM;GAC7B,WAAW,cAAc,KAAK,IAAI,GAAG,kBAAkB,QAAQ,GAAG,GAAG,MAAM,WAAW;GACvF,EAAC;;EAGF,MAAM,qBACJ,aAAa,UAAU,eAAe,QAAQ,aAAa,MAAM;;EAGnE,MAAM,8BACJ,aAAa,UACZ,gBAAgB,QAAQ,aAAa,MAAM;AAE9C,kBAAgB;AACd,0BAAsB;AACtB,UAAO,iBAAiB,UAAU,sBAAqB;IACxD;AAED,wBAAsB;AACpB,UAAO,oBAAoB,UAAU,sBAAqB;IAC3D;AAED,oBAAkB;AAChB,OAAI,CAAC,WAAW,MACd;AAGF,cAAW,MAAM,MAAM,YAAY,cAAc,KAAK,IAAI,GAAG,kBAAkB,QAAQ,GAAG,GAAG,MAAM,WAAW;IAC/G;;uBAIC,mBAsBM,OAAA;aArBA;IAAJ,KAAI;IACJ,OAAK,eAAA,CAAC,qCACE,QAAA,eAAc,CAAA;IACrB,UAAQ;OACT,mBAgBO,QAAA;aAfD;IAAJ,KAAI;IACJ,OAAK,eAAA,CAAC,+BACE,QAAA,aAAY,CAAA;IACnB,OAAK,eAAE,aAAA,MAAY;yBACpB,mBAUM,UAAA,MAAA,WAToB,aAAA,QAAhB,MAAM,UAAK;wBADrB,mBAUM,OAAA;KARH,KAAK,kBAAA,QAAoB;KAC1B,OAAK,eAAA,CAAC,4BACE,QAAA,UAAS,CAAA;KAChB,OAAK,eAAA;iBAAyB,MAAM,WAAU;qBAA+B,MAAM,WAAU;;uBAI3F,KAAI,EAAA,EAAA"}
|
package/dist/style.css
CHANGED
|
@@ -1005,19 +1005,19 @@ img,
|
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
|
|
1008
|
-
.scalar-modal-layout[data-v-
|
|
1009
|
-
animation: .3s ease-in-out forwards fadein-layout-
|
|
1008
|
+
.scalar-modal-layout[data-v-5bb1dcc2] {
|
|
1009
|
+
animation: .3s ease-in-out forwards fadein-layout-5bb1dcc2;
|
|
1010
1010
|
}
|
|
1011
|
-
.scalar-modal[data-v-
|
|
1011
|
+
.scalar-modal[data-v-5bb1dcc2] {
|
|
1012
1012
|
box-shadow: var(--scalar-shadow-2);
|
|
1013
|
-
animation: .3s ease-in-out .1s forwards fadein-modal-
|
|
1013
|
+
animation: .3s ease-in-out .1s forwards fadein-modal-5bb1dcc2;
|
|
1014
1014
|
transform: translate3d(0, 10px, 0);
|
|
1015
1015
|
}
|
|
1016
|
-
.scalar-modal-layout-full[data-v-
|
|
1016
|
+
.scalar-modal-layout-full[data-v-5bb1dcc2] {
|
|
1017
1017
|
opacity: 1 !important;
|
|
1018
1018
|
background: none !important;
|
|
1019
1019
|
}
|
|
1020
|
-
.modal-content-search .modal-body[data-v-
|
|
1020
|
+
.modal-content-search .modal-body[data-v-5bb1dcc2] {
|
|
1021
1021
|
flex-direction: column;
|
|
1022
1022
|
max-height: 440px;
|
|
1023
1023
|
padding: 0;
|
|
@@ -1025,12 +1025,12 @@ img,
|
|
|
1025
1025
|
overflow: hidden;
|
|
1026
1026
|
}
|
|
1027
1027
|
@media (max-width: 720px) and (max-height: 480px) {
|
|
1028
|
-
.scalar-modal-layout .scalar-modal[data-v-
|
|
1028
|
+
.scalar-modal-layout .scalar-modal[data-v-5bb1dcc2] {
|
|
1029
1029
|
max-height: 90svh;
|
|
1030
1030
|
margin-top: 5svh;
|
|
1031
1031
|
}
|
|
1032
1032
|
}
|
|
1033
|
-
@keyframes fadein-layout-
|
|
1033
|
+
@keyframes fadein-layout-5bb1dcc2 {
|
|
1034
1034
|
0% {
|
|
1035
1035
|
opacity: 0;
|
|
1036
1036
|
}
|
|
@@ -1038,7 +1038,7 @@ img,
|
|
|
1038
1038
|
opacity: 1;
|
|
1039
1039
|
}
|
|
1040
1040
|
}
|
|
1041
|
-
@keyframes fadein-modal-
|
|
1041
|
+
@keyframes fadein-modal-5bb1dcc2 {
|
|
1042
1042
|
0% {
|
|
1043
1043
|
opacity: 0;
|
|
1044
1044
|
transform: translate3d(0, 10px, 0);
|
|
@@ -1048,10 +1048,10 @@ img,
|
|
|
1048
1048
|
transform: translate3d(0, 0, 0);
|
|
1049
1049
|
}
|
|
1050
1050
|
}
|
|
1051
|
-
.full-size-styles[data-v-
|
|
1051
|
+
.full-size-styles[data-v-5bb1dcc2] {
|
|
1052
1052
|
margin: initial;
|
|
1053
1053
|
border-right: var(--scalar-border-width) solid var(--scalar-border-color);
|
|
1054
|
-
animation: .3s ease-in-out forwards fadein-layout-
|
|
1054
|
+
animation: .3s ease-in-out forwards fadein-layout-5bb1dcc2;
|
|
1055
1055
|
left: 0;
|
|
1056
1056
|
transform: translate3d(0, 0, 0);
|
|
1057
1057
|
background-color: var(--scalar-background-1) !important;
|
|
@@ -1062,11 +1062,11 @@ img,
|
|
|
1062
1062
|
top: 0 !important;
|
|
1063
1063
|
}
|
|
1064
1064
|
@media (min-width: 800px) {
|
|
1065
|
-
.full-size-styles[data-v-
|
|
1065
|
+
.full-size-styles[data-v-5bb1dcc2] {
|
|
1066
1066
|
width: 50dvw !important;
|
|
1067
1067
|
}
|
|
1068
1068
|
}
|
|
1069
|
-
.full-size-styles[data-v-
|
|
1069
|
+
.full-size-styles[data-v-5bb1dcc2]:after {
|
|
1070
1070
|
content: "";
|
|
1071
1071
|
width: 50dvw;
|
|
1072
1072
|
height: 100dvh;
|
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.21.
|
|
13
|
+
"version": "0.21.2",
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=22"
|
|
16
16
|
},
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"vue-component-type-helpers": "^3.2.2",
|
|
42
42
|
"@scalar/code-highlight": "0.3.1",
|
|
43
43
|
"@scalar/helpers": "0.4.2",
|
|
44
|
+
"@scalar/icons": "0.7.1",
|
|
44
45
|
"@scalar/themes": "0.15.1",
|
|
45
|
-
"@scalar/icons": "0.6.4",
|
|
46
46
|
"@scalar/use-hooks": "0.4.1"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|