@histoire/app 0.10.7 → 0.11.0
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/app/style/main.pcss +11 -0
- package/dist/bundled/App.js +4 -148
- package/dist/bundled/App.vue_vue_type_script_setup_true_lang.js +156 -0
- package/dist/bundled/_virtual/{plugin-vue_export-helper.js → _plugin-vue_export-helper.js} +4 -2
- package/dist/bundled/api.js +4 -1
- package/dist/bundled/assets/histoire-text-dark.js +4 -2
- package/dist/bundled/assets/histoire-text.js +4 -2
- package/dist/bundled/assets/histoire.js +4 -2
- package/dist/bundled/components/HomeView.js +5 -24
- package/dist/bundled/components/HomeView.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/app/AppHeader.js +5 -67
- package/dist/bundled/components/app/AppHeader.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/bundled/components/app/AppLogo.js +5 -26
- package/dist/bundled/components/app/AppLogo.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/bundled/components/app/Breadcrumb.js +7 -95
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_afeba72b_lang.js +4 -0
- package/dist/bundled/components/app/InitialLoading.js +5 -48
- package/dist/bundled/components/app/InitialLoading.vue_vue_type_script_setup_true_lang.js +50 -0
- package/dist/bundled/components/app/MobileOverlay.js +4 -40
- package/dist/bundled/components/app/MobileOverlay.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/bundled/components/base/BaseCheckbox.js +4 -74
- package/dist/bundled/components/base/BaseCheckbox.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/bundled/components/base/BaseEmpty.js +7 -5
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_af3328a6_lang.js +4 -0
- package/dist/bundled/components/base/BaseListItemLink.js +7 -25
- package/dist/bundled/components/base/BaseListItemLink.vue_vue_type_script_lang.js +25 -0
- package/dist/bundled/components/base/BaseOverflowMenu.js +4 -96
- package/dist/bundled/components/base/BaseOverflowMenu.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/bundled/components/base/BaseOverflowTab.js +7 -17
- package/dist/bundled/components/base/BaseOverflowTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/base/BaseSelect.js +5 -69
- package/dist/bundled/components/base/BaseSelect.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/bundled/components/base/BaseSplitPane.js +7 -184
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_bb6c600c_lang.js +4 -0
- package/dist/bundled/components/base/BaseTab.js +7 -17
- package/dist/bundled/components/base/BaseTab.vue_vue_type_script_lang.js +17 -0
- package/dist/bundled/components/misc/CheckerboardPattern.js +5 -3
- package/dist/bundled/components/misc/HatchedPattern.js +7 -5
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_91561117_lang.js +4 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +5 -98
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/bundled/components/panel/ControlsComponentProps.js +5 -42
- package/dist/bundled/components/panel/ControlsComponentProps.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/bundled/components/panel/PaneTabs.js +4 -111
- package/dist/bundled/components/panel/PaneTabs.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/bundled/components/panel/StatePresets.js +4 -189
- package/dist/bundled/components/panel/StatePresets.vue_vue_type_script_setup_true_lang.js +193 -0
- package/dist/bundled/components/panel/StoryControls.js +4 -72
- package/dist/bundled/components/panel/StoryControls.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/bundled/components/panel/StoryDocs.js +6 -72
- package/dist/bundled/components/panel/StoryDocs.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/bundled/components/panel/StoryEvent.js +4 -55
- package/dist/bundled/components/panel/StoryEvent.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/bundled/components/panel/StoryEvents.js +5 -49
- package/dist/bundled/components/panel/StoryEvents.vue_vue_type_script_setup_true_lang.js +51 -0
- package/dist/bundled/components/panel/StorySidePanel.js +5 -72
- package/dist/bundled/components/panel/StorySidePanel.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/bundled/components/panel/StorySourceCode.js +6 -130
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_0d096b10_lang.js +4 -0
- package/dist/bundled/components/search/SearchItem.js +6 -112
- package/dist/bundled/components/search/SearchItem.vue_vue_type_script_setup_true_lang.js +112 -0
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_b819ed97_lang.js +4 -0
- package/dist/bundled/components/search/SearchLoading.js +5 -19
- package/dist/bundled/components/search/SearchLoading.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/bundled/components/search/SearchModal.js +4 -45
- package/dist/bundled/components/search/SearchModal.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/bundled/components/search/SearchPane.js +4 -268
- package/dist/bundled/components/search/SearchPane.vue_vue_type_script_setup_true_lang.js +270 -0
- package/dist/bundled/components/search/search-docs-data.js +5 -2
- package/dist/bundled/components/search/search-title-data.js +5 -2
- package/dist/bundled/components/story/GenericMountStory.js +4 -30
- package/dist/bundled/components/story/GenericMountStory.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/bundled/components/story/GenericRenderStory.js +4 -30
- package/dist/bundled/components/story/GenericRenderStory.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/bundled/components/story/StoryResponsivePreview.js +6 -180
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_script_setup_true_lang.js +183 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_1375d05a_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantGrid.js +5 -94
- package/dist/bundled/components/story/StoryVariantGrid.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/bundled/components/story/StoryVariantGridItem.js +7 -108
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_script_setup_true_lang.js +108 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_be3a417b_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantListItem.js +7 -58
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_cc25ec8b_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSingle.js +6 -114
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_afe0bbc2_lang.js +4 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +5 -45
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +5 -122
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue_vue_type_script_setup_true_lang.js +124 -0
- package/dist/bundled/components/story/StoryVariantSingleView.js +4 -48
- package/dist/bundled/components/story/StoryVariantSingleView.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/bundled/components/story/StoryView.js +4 -89
- package/dist/bundled/components/story/StoryView.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/bundled/components/story/StoryViewer.js +7 -57
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_54d5a557_lang.js +4 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.js +7 -85
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_8dc02d19_lang.js +4 -0
- package/dist/bundled/components/toolbar/StoryVariantNewTab.js +5 -33
- package/dist/bundled/components/toolbar/StoryVariantNewTab.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +5 -129
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.vue_vue_type_script_setup_true_lang.js +131 -0
- package/dist/bundled/components/toolbar/StoryVariantTitle.js +5 -24
- package/dist/bundled/components/toolbar/StoryVariantTitle.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/bundled/components/tree/StoryGroup.js +4 -73
- package/dist/bundled/components/tree/StoryGroup.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/bundled/components/tree/StoryList.js +5 -37
- package/dist/bundled/components/tree/StoryList.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/bundled/components/tree/StoryListFolder.js +7 -89
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_41fb5f7e_lang.js +4 -0
- package/dist/bundled/components/tree/StoryListItem.js +6 -71
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_script_setup_true_lang.js +71 -0
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_313a2f42_lang.js +4 -0
- package/dist/bundled/index.js +6 -3
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +13 -1
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +7 -2
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +11 -1
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +4 -1
- package/dist/bundled/router.js +4 -1
- package/dist/bundled/sandbox.js +5 -3
- package/dist/bundled/stores/events.js +3 -1
- package/dist/bundled/stores/folder.js +6 -2
- package/dist/bundled/stores/preview-settings.js +3 -1
- package/dist/bundled/stores/story.js +3 -1
- package/dist/bundled/style.css +37 -46
- package/dist/bundled/util/config.js +5 -2
- package/dist/bundled/util/const.js +6 -1
- package/dist/bundled/util/dark.js +4 -1
- package/dist/bundled/util/env.js +3 -1
- package/dist/bundled/util/events.js +4 -2
- package/dist/bundled/util/keyboard.js +4 -1
- package/dist/bundled/util/mapping.js +4 -1
- package/dist/bundled/util/preview-settings.js +4 -1
- package/dist/bundled/util/responsive.js +3 -1
- package/dist/bundled/util/sandbox.js +3 -1
- package/dist/bundled/util/scroll.js +3 -1
- package/dist/bundled/util/state.js +3 -1
- package/dist/bundled/util/tooltip.js +3 -1
- package/dist/bundled/util/variant.js +3 -1
- package/dist/style.css +145 -119
- package/package.json +6 -6
- package/src/app/App.vue +2 -2
- package/src/app/api.ts +1 -1
- package/src/app/components/base/BaseSplitPane.vue +2 -2
- package/src/app/components/panel/StorySourceCode.vue +134 -26
- package/src/app/components/search/search-docs-data.ts +1 -1
- package/src/app/components/search/search-title-data.ts +1 -1
- package/src/app/components/story/StoryResponsivePreview.vue +55 -54
- package/src/app/components/story/StoryVariantSingle.vue +2 -2
- package/src/app/index.ts +1 -1
- package/src/app/sandbox.ts +1 -1
- package/src/app/stores/folder.ts +3 -1
- package/src/app/style/main.pcss +11 -0
- package/src/app/util/config.ts +1 -1
- package/src/app/util/events.ts +1 -1
- package/tailwind.config.cjs +12 -0
- package/tsconfig.json +0 -1
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveDirective, openBlock, createElementBlock, createElementVNode, unref, createVNode, withDirectives } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import "./AppLogo.js";
|
|
4
|
+
import { isDark, toggleDark } from "../../util/dark.js";
|
|
5
|
+
import { onKeyboardShortcut } from "../../util/keyboard.js";
|
|
6
|
+
import { makeTooltip } from "../../util/tooltip.js";
|
|
7
|
+
import { histoireConfig } from "../../util/config.js";
|
|
8
|
+
import _sfc_main$1 from "./AppLogo.vue_vue_type_script_setup_true_lang.js";
|
|
9
|
+
const _hoisted_1 = { class: "htw-px-4 htw-h-16 htw-flex htw-items-center htw-gap-2" };
|
|
10
|
+
const _hoisted_2 = { class: "htw-py-3 sm:htw-py-4 htw-flex-1 htw-h-full htw-flex htw-items-center htw-pr-2" };
|
|
11
|
+
const _hoisted_3 = ["href"];
|
|
12
|
+
const _hoisted_4 = { class: "htw-ml-auto htw-flex-none htw-flex" };
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "AppHeader",
|
|
15
|
+
emits: {
|
|
16
|
+
search: () => true
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const themeIcon = computed(() => {
|
|
20
|
+
return isDark.value ? "carbon:moon" : "carbon:sun";
|
|
21
|
+
});
|
|
22
|
+
onKeyboardShortcut(["ctrl+shift+d", "meta+shift+d"], (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
toggleDark();
|
|
25
|
+
});
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
var _a;
|
|
28
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
29
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
|
+
createElementVNode("div", _hoisted_2, [
|
|
31
|
+
createElementVNode("a", {
|
|
32
|
+
href: (_a = unref(histoireConfig).theme) == null ? void 0 : _a.logoHref,
|
|
33
|
+
target: "_blank",
|
|
34
|
+
class: "htw-w-full htw-h-full htw-flex htw-items-center"
|
|
35
|
+
}, [
|
|
36
|
+
createVNode(_sfc_main$1, { class: "htw-max-w-full htw-max-h-full" })
|
|
37
|
+
], 8, _hoisted_3)
|
|
38
|
+
]),
|
|
39
|
+
createElementVNode("div", _hoisted_4, [
|
|
40
|
+
withDirectives((openBlock(), createElementBlock("a", {
|
|
41
|
+
class: "htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-text-gray-900 dark:htw-text-gray-100",
|
|
42
|
+
"data-test-id": "search-btn",
|
|
43
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("search"))
|
|
44
|
+
}, [
|
|
45
|
+
createVNode(unref(Icon), {
|
|
46
|
+
icon: "carbon:search",
|
|
47
|
+
class: "htw-w-6 htw-h-6 sm:htw-w-4 sm:htw-h-4"
|
|
48
|
+
})
|
|
49
|
+
])), [
|
|
50
|
+
[_directive_tooltip, unref(makeTooltip)("Search", ({ isMac }) => isMac ? "meta+k" : "ctrl+k")]
|
|
51
|
+
]),
|
|
52
|
+
withDirectives((openBlock(), createElementBlock("a", {
|
|
53
|
+
class: "htw-p-2 sm:htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-text-gray-900 dark:htw-text-gray-100",
|
|
54
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(toggleDark)())
|
|
55
|
+
}, [
|
|
56
|
+
createVNode(unref(Icon), {
|
|
57
|
+
icon: unref(themeIcon),
|
|
58
|
+
class: "htw-w-6 htw-h-6 sm:htw-w-4 sm:htw-h-4"
|
|
59
|
+
}, null, 8, ["icon"])
|
|
60
|
+
])), [
|
|
61
|
+
[_directive_tooltip, unref(makeTooltip)("Toggle dark mode", ({ isMac }) => isMac ? "meta+shift+d" : "ctrl+shift+d")]
|
|
62
|
+
])
|
|
63
|
+
])
|
|
64
|
+
]);
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
_sfc_main as default
|
|
70
|
+
};
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const _hoisted_1 = ["src", "alt"];
|
|
7
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
-
__name: "AppLogo",
|
|
9
|
-
setup(__props) {
|
|
10
|
-
const logoUrl = computed(() => {
|
|
11
|
-
var _a, _b;
|
|
12
|
-
if (isDark.value) {
|
|
13
|
-
return ((_a = histoireConfig.theme.logo) == null ? void 0 : _a.dark) ? customLogos.dark : HistoireLogoDark;
|
|
14
|
-
}
|
|
15
|
-
return ((_b = histoireConfig.theme.logo) == null ? void 0 : _b.light) ? customLogos.light : HistoireLogoLight;
|
|
16
|
-
});
|
|
17
|
-
const altText = computed(() => histoireConfig.theme.title + " logo");
|
|
18
|
-
return (_ctx, _cache) => {
|
|
19
|
-
return openBlock(), createElementBlock("img", {
|
|
20
|
-
src: unref(logoUrl),
|
|
21
|
-
alt: unref(altText)
|
|
22
|
-
}, null, 8, _hoisted_1);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./AppLogo.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./AppLogo.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, unref } from "@histoire/vendors/vue";
|
|
2
|
+
import { isDark } from "../../util/dark.js";
|
|
3
|
+
import { histoireConfig, customLogos } from "../../util/config.js";
|
|
4
|
+
import HistoireLogoDark from "../../assets/histoire-text-dark.js";
|
|
5
|
+
import HistoireLogoLight from "../../assets/histoire-text.js";
|
|
6
|
+
const _hoisted_1 = ["src", "alt"];
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
__name: "AppLogo",
|
|
9
|
+
setup(__props) {
|
|
10
|
+
const logoUrl = computed(() => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
if (isDark.value) {
|
|
13
|
+
return ((_a = histoireConfig.theme.logo) == null ? void 0 : _a.dark) ? customLogos.dark : HistoireLogoDark;
|
|
14
|
+
}
|
|
15
|
+
return ((_b = histoireConfig.theme.logo) == null ? void 0 : _b.light) ? customLogos.light : HistoireLogoLight;
|
|
16
|
+
});
|
|
17
|
+
const altText = computed(() => histoireConfig.theme.title + " logo");
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return openBlock(), createElementBlock("img", {
|
|
20
|
+
src: unref(logoUrl),
|
|
21
|
+
alt: unref(altText)
|
|
22
|
+
}, null, 8, _hoisted_1);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
_sfc_main as default
|
|
28
|
+
};
|
|
@@ -1,95 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const _withScopeId = (n) => (pushScopeId("data-v-25f7510c"), n = n(), popScopeId(), n);
|
|
9
|
-
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-40" }, " / ", -1));
|
|
10
|
-
const _hoisted_2 = { class: "htw-flex htw-items-center htw-gap-2" };
|
|
11
|
-
const _hoisted_3 = { class: "htw-opacity-40 htw-text-sm" };
|
|
12
|
-
const _hoisted_4 = /* @__PURE__ */ createTextVNode(" Select a story... ");
|
|
13
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
-
__name: "Breadcrumb",
|
|
15
|
-
props: {
|
|
16
|
-
tree: null,
|
|
17
|
-
stories: null
|
|
18
|
-
},
|
|
19
|
-
setup(__props) {
|
|
20
|
-
useCssVars((_ctx) => {
|
|
21
|
-
var _a;
|
|
22
|
-
return {
|
|
23
|
-
"353b213f": (_a = unref(story)) == null ? void 0 : _a.iconColor
|
|
24
|
-
};
|
|
25
|
-
});
|
|
26
|
-
const storyStore = useStoryStore();
|
|
27
|
-
const story = computed(() => storyStore.currentStory);
|
|
28
|
-
const folders = computed(() => {
|
|
29
|
-
return story.value.file.path.slice(0, -1);
|
|
30
|
-
});
|
|
31
|
-
const isMenuOpened = ref(false);
|
|
32
|
-
function openMenu() {
|
|
33
|
-
isMenuOpened.value = true;
|
|
34
|
-
}
|
|
35
|
-
function closeMenu() {
|
|
36
|
-
isMenuOpened.value = false;
|
|
37
|
-
}
|
|
38
|
-
watch(story, () => {
|
|
39
|
-
isMenuOpened.value = false;
|
|
40
|
-
});
|
|
41
|
-
return (_ctx, _cache) => {
|
|
42
|
-
var _a;
|
|
43
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
44
|
-
createElementVNode("div", null, [
|
|
45
|
-
createElementVNode("a", {
|
|
46
|
-
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center",
|
|
47
|
-
onClick: openMenu
|
|
48
|
-
}, [
|
|
49
|
-
unref(story) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
50
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(folders), (file, key) => {
|
|
51
|
-
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
52
|
-
createElementVNode("span", null, toDisplayString(file), 1),
|
|
53
|
-
_hoisted_1
|
|
54
|
-
], 64);
|
|
55
|
-
}), 128)),
|
|
56
|
-
createElementVNode("span", _hoisted_2, [
|
|
57
|
-
createVNode(unref(Icon), {
|
|
58
|
-
icon: (_a = unref(story).icon) != null ? _a : "carbon:cube",
|
|
59
|
-
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none", {
|
|
60
|
-
"htw-text-primary-500": !unref(story).iconColor,
|
|
61
|
-
"bind-icon-color": unref(story).iconColor
|
|
62
|
-
}])
|
|
63
|
-
}, null, 8, ["icon", "class"]),
|
|
64
|
-
createTextVNode(" " + toDisplayString(unref(story).title) + " ", 1),
|
|
65
|
-
createElementVNode("span", _hoisted_3, toDisplayString(unref(story).variants.length), 1)
|
|
66
|
-
])
|
|
67
|
-
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
68
|
-
_hoisted_4
|
|
69
|
-
], 64)),
|
|
70
|
-
createVNode(unref(Icon), {
|
|
71
|
-
icon: "carbon:chevron-sort",
|
|
72
|
-
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
73
|
-
})
|
|
74
|
-
])
|
|
75
|
-
]),
|
|
76
|
-
createVNode(_sfc_main$1, {
|
|
77
|
-
title: "Select a story",
|
|
78
|
-
opened: isMenuOpened.value,
|
|
79
|
-
onClose: closeMenu
|
|
80
|
-
}, {
|
|
81
|
-
default: withCtx(() => [
|
|
82
|
-
createVNode(_sfc_main$2, {
|
|
83
|
-
tree: __props.tree,
|
|
84
|
-
stories: __props.stories,
|
|
85
|
-
class: "htw-flex-1 htw-overflow-y-scroll"
|
|
86
|
-
}, null, 8, ["tree", "stories"])
|
|
87
|
-
]),
|
|
88
|
-
_: 1
|
|
89
|
-
}, 8, ["opened"])
|
|
90
|
-
], 64);
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
var Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-25f7510c"]]);
|
|
95
|
-
export { Breadcrumb as default };
|
|
1
|
+
import _sfc_main from "./Breadcrumb.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import "./Breadcrumb.vue_vue_type_style_index_0_scoped_afeba72b_lang.js";
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-afeba72b"]]);
|
|
5
|
+
export {
|
|
6
|
+
Breadcrumb as default
|
|
7
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { pushScopeId, popScopeId, createElementVNode, defineComponent, useCssVars, unref, computed, ref, watch, openBlock, createElementBlock, Fragment, renderList, toDisplayString, createVNode, normalizeClass, createTextVNode, withCtx } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
+
import "./MobileOverlay.js";
|
|
5
|
+
import "../tree/StoryList.js";
|
|
6
|
+
import _sfc_main$1 from "./MobileOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
7
|
+
import _sfc_main$2 from "../tree/StoryList.vue_vue_type_script_setup_true_lang.js";
|
|
8
|
+
const _withScopeId = (n) => (pushScopeId("data-v-afeba72b"), n = n(), popScopeId(), n);
|
|
9
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-40" }, " / ", -1));
|
|
10
|
+
const _hoisted_2 = { class: "htw-flex htw-items-center htw-gap-2" };
|
|
11
|
+
const _hoisted_3 = { class: "htw-opacity-40 htw-text-sm" };
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
__name: "Breadcrumb",
|
|
14
|
+
props: {
|
|
15
|
+
tree: null,
|
|
16
|
+
stories: null
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
useCssVars((_ctx) => {
|
|
20
|
+
var _a;
|
|
21
|
+
return {
|
|
22
|
+
"1e773cc4": (_a = unref(story)) == null ? void 0 : _a.iconColor
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
const storyStore = useStoryStore();
|
|
26
|
+
const story = computed(() => storyStore.currentStory);
|
|
27
|
+
const folders = computed(() => {
|
|
28
|
+
return story.value.file.path.slice(0, -1);
|
|
29
|
+
});
|
|
30
|
+
const isMenuOpened = ref(false);
|
|
31
|
+
function openMenu() {
|
|
32
|
+
isMenuOpened.value = true;
|
|
33
|
+
}
|
|
34
|
+
function closeMenu() {
|
|
35
|
+
isMenuOpened.value = false;
|
|
36
|
+
}
|
|
37
|
+
watch(story, () => {
|
|
38
|
+
isMenuOpened.value = false;
|
|
39
|
+
});
|
|
40
|
+
return (_ctx, _cache) => {
|
|
41
|
+
var _a;
|
|
42
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
43
|
+
createElementVNode("div", null, [
|
|
44
|
+
createElementVNode("a", {
|
|
45
|
+
class: "htw-px-6 htw-h-12 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer htw-flex htw-gap-2 htw-flex-wrap htw-w-full htw-items-center",
|
|
46
|
+
onClick: openMenu
|
|
47
|
+
}, [
|
|
48
|
+
unref(story) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
49
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(folders), (file, key) => {
|
|
50
|
+
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
51
|
+
createElementVNode("span", null, toDisplayString(file), 1),
|
|
52
|
+
_hoisted_1
|
|
53
|
+
], 64);
|
|
54
|
+
}), 128)),
|
|
55
|
+
createElementVNode("span", _hoisted_2, [
|
|
56
|
+
createVNode(unref(Icon), {
|
|
57
|
+
icon: (_a = unref(story).icon) != null ? _a : "carbon:cube",
|
|
58
|
+
class: normalizeClass(["base-list-item-link-icon htw-w-5 htw-h-5 htw-flex-none", {
|
|
59
|
+
"htw-text-primary-500": !unref(story).iconColor,
|
|
60
|
+
"bind-icon-color": unref(story).iconColor
|
|
61
|
+
}])
|
|
62
|
+
}, null, 8, ["icon", "class"]),
|
|
63
|
+
createTextVNode(" " + toDisplayString(unref(story).title) + " ", 1),
|
|
64
|
+
createElementVNode("span", _hoisted_3, toDisplayString(unref(story).variants.length), 1)
|
|
65
|
+
])
|
|
66
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
67
|
+
createTextVNode(" Select a story... ")
|
|
68
|
+
], 64)),
|
|
69
|
+
createVNode(unref(Icon), {
|
|
70
|
+
icon: "carbon:chevron-sort",
|
|
71
|
+
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
72
|
+
})
|
|
73
|
+
])
|
|
74
|
+
]),
|
|
75
|
+
createVNode(_sfc_main$1, {
|
|
76
|
+
title: "Select a story",
|
|
77
|
+
opened: isMenuOpened.value,
|
|
78
|
+
onClose: closeMenu
|
|
79
|
+
}, {
|
|
80
|
+
default: withCtx(() => [
|
|
81
|
+
createVNode(_sfc_main$2, {
|
|
82
|
+
tree: __props.tree,
|
|
83
|
+
stories: __props.stories,
|
|
84
|
+
class: "htw-flex-1 htw-overflow-y-scroll"
|
|
85
|
+
}, null, 8, ["tree", "stories"])
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 8, ["opened"])
|
|
89
|
+
], 64);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
export {
|
|
94
|
+
_sfc_main as default
|
|
95
|
+
};
|
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const progress = reactive({
|
|
7
|
-
loaded: 0,
|
|
8
|
-
total: 0
|
|
9
|
-
});
|
|
10
|
-
const maxCols = window.innerWidth / 20;
|
|
11
|
-
if (import.meta.hot) {
|
|
12
|
-
import.meta.hot.on("histoire:stories-loading-progress", (data) => {
|
|
13
|
-
progress.loaded = data.loadedFileCount;
|
|
14
|
-
progress.total = data.totalFileCount;
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return (_ctx, _cache) => {
|
|
18
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
-
createVNode(Transition, { name: "__histoire-fade" }, {
|
|
20
|
-
default: withCtx(() => [
|
|
21
|
-
progress.total > 0 ? (openBlock(), createElementBlock("div", {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "htw-grid htw-gap-2",
|
|
24
|
-
style: normalizeStyle({
|
|
25
|
-
gridTemplateColumns: `repeat(${Math.min(Math.ceil(Math.sqrt(progress.total)), maxCols)}, minmax(0, 1fr))`
|
|
26
|
-
})
|
|
27
|
-
}, [
|
|
28
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(progress.total, (n) => {
|
|
29
|
-
return openBlock(), createElementBlock("div", {
|
|
30
|
-
key: n,
|
|
31
|
-
class: "htw-bg-primary-500/10 htw-rounded-full"
|
|
32
|
-
}, [
|
|
33
|
-
createElementVNode("div", {
|
|
34
|
-
class: normalizeClass(["htw-w-3 htw-h-3 htw-bg-primary-500 htw-rounded-full htw-duration-150 htw-ease-out", {
|
|
35
|
-
"htw-transition-transform htw-scale-0": n >= progress.loaded
|
|
36
|
-
}])
|
|
37
|
-
}, null, 2)
|
|
38
|
-
]);
|
|
39
|
-
}), 128))
|
|
40
|
-
], 4)) : createCommentVNode("", true)
|
|
41
|
-
]),
|
|
42
|
-
_: 1
|
|
43
|
-
})
|
|
44
|
-
]);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export { _sfc_main as default };
|
|
1
|
+
import _sfc_main from "./InitialLoading.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./InitialLoading.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
5
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineComponent, reactive, openBlock, createElementBlock, createVNode, Transition, withCtx, normalizeStyle, Fragment, renderList, createElementVNode, normalizeClass, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
const _hoisted_1 = { class: "htw-fixed htw-inset-0 htw-bg-white dark:htw-bg-gray-700 htw-flex htw-flex-col htw-gap-6 htw-items-center htw-justify-center" };
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "InitialLoading",
|
|
5
|
+
setup(__props) {
|
|
6
|
+
const progress = reactive({
|
|
7
|
+
loaded: 0,
|
|
8
|
+
total: 0
|
|
9
|
+
});
|
|
10
|
+
const maxCols = window.innerWidth / 20;
|
|
11
|
+
if (import.meta.hot) {
|
|
12
|
+
import.meta.hot.on("histoire:stories-loading-progress", (data) => {
|
|
13
|
+
progress.loaded = data.loadedFileCount;
|
|
14
|
+
progress.total = data.totalFileCount;
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
19
|
+
createVNode(Transition, { name: "__histoire-fade" }, {
|
|
20
|
+
default: withCtx(() => [
|
|
21
|
+
progress.total > 0 ? (openBlock(), createElementBlock("div", {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "htw-grid htw-gap-2",
|
|
24
|
+
style: normalizeStyle({
|
|
25
|
+
gridTemplateColumns: `repeat(${Math.min(Math.ceil(Math.sqrt(progress.total)), maxCols)}, minmax(0, 1fr))`
|
|
26
|
+
})
|
|
27
|
+
}, [
|
|
28
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(progress.total, (n) => {
|
|
29
|
+
return openBlock(), createElementBlock("div", {
|
|
30
|
+
key: n,
|
|
31
|
+
class: "htw-bg-primary-500/10 htw-rounded-full"
|
|
32
|
+
}, [
|
|
33
|
+
createElementVNode("div", {
|
|
34
|
+
class: normalizeClass(["htw-w-3 htw-h-3 htw-bg-primary-500 htw-rounded-full htw-duration-150 htw-ease-out", {
|
|
35
|
+
"htw-transition-transform htw-scale-0": n >= progress.loaded
|
|
36
|
+
}])
|
|
37
|
+
}, null, 2)
|
|
38
|
+
]);
|
|
39
|
+
}), 128))
|
|
40
|
+
], 4)) : createCommentVNode("", true)
|
|
41
|
+
]),
|
|
42
|
+
_: 1
|
|
43
|
+
})
|
|
44
|
+
]);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
_sfc_main as default
|
|
50
|
+
};
|
|
@@ -1,41 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class: "htw-absolute htw-z-10 htw-bg-white dark:htw-bg-gray-700 htw-w-screen htw-h-screen htw-inset-0 htw-overflow-hidden htw-flex htw-flex-col"
|
|
1
|
+
import _sfc_main from "./MobileOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./MobileOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
6
5
|
};
|
|
7
|
-
const _hoisted_2 = { class: "htw-p-4 htw-h-16 htw-flex htw-border-b htw-border-gray-100 dark:htw-border-gray-800 htw-items-center htw-place-content-between" };
|
|
8
|
-
const _hoisted_3 = { class: "htw-text-gray-500" };
|
|
9
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
-
__name: "MobileOverlay",
|
|
11
|
-
props: {
|
|
12
|
-
title: null,
|
|
13
|
-
opened: { type: Boolean }
|
|
14
|
-
},
|
|
15
|
-
emits: ["close"],
|
|
16
|
-
setup(__props, { emit: emits }) {
|
|
17
|
-
return (_ctx, _cache) => {
|
|
18
|
-
return openBlock(), createBlock(Transition, { name: "__histoire-fade-bottom" }, {
|
|
19
|
-
default: withCtx(() => [
|
|
20
|
-
__props.opened ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
21
|
-
createElementVNode("div", _hoisted_2, [
|
|
22
|
-
createElementVNode("span", _hoisted_3, toDisplayString(__props.title), 1),
|
|
23
|
-
createElementVNode("a", {
|
|
24
|
-
class: "htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer",
|
|
25
|
-
onClick: _cache[0] || (_cache[0] = ($event) => emits("close"))
|
|
26
|
-
}, [
|
|
27
|
-
createVNode(unref(Icon), {
|
|
28
|
-
icon: "carbon:close",
|
|
29
|
-
class: "htw-w-8 htw-h-8 htw-shrink-0"
|
|
30
|
-
})
|
|
31
|
-
])
|
|
32
|
-
]),
|
|
33
|
-
renderSlot(_ctx.$slots, "default")
|
|
34
|
-
])) : createCommentVNode("", true)
|
|
35
|
-
]),
|
|
36
|
-
_: 3
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export { _sfc_main as default };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { defineComponent, openBlock, createBlock, Transition, withCtx, createElementBlock, createElementVNode, toDisplayString, createVNode, unref, renderSlot, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "htw-absolute htw-z-10 htw-bg-white dark:htw-bg-gray-700 htw-w-screen htw-h-screen htw-inset-0 htw-overflow-hidden htw-flex htw-flex-col"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_2 = { class: "htw-p-4 htw-h-16 htw-flex htw-border-b htw-border-gray-100 dark:htw-border-gray-800 htw-items-center htw-place-content-between" };
|
|
8
|
+
const _hoisted_3 = { class: "htw-text-gray-500" };
|
|
9
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
10
|
+
__name: "MobileOverlay",
|
|
11
|
+
props: {
|
|
12
|
+
title: null,
|
|
13
|
+
opened: { type: Boolean }
|
|
14
|
+
},
|
|
15
|
+
emits: ["close"],
|
|
16
|
+
setup(__props, { emit: emits }) {
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
return openBlock(), createBlock(Transition, { name: "__histoire-fade-bottom" }, {
|
|
19
|
+
default: withCtx(() => [
|
|
20
|
+
__props.opened ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
21
|
+
createElementVNode("div", _hoisted_2, [
|
|
22
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.title), 1),
|
|
23
|
+
createElementVNode("a", {
|
|
24
|
+
class: "htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer",
|
|
25
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emits("close"))
|
|
26
|
+
}, [
|
|
27
|
+
createVNode(unref(Icon), {
|
|
28
|
+
icon: "carbon:close",
|
|
29
|
+
class: "htw-w-8 htw-h-8 htw-shrink-0"
|
|
30
|
+
})
|
|
31
|
+
])
|
|
32
|
+
]),
|
|
33
|
+
renderSlot(_ctx.$slots, "default")
|
|
34
|
+
])) : createCommentVNode("", true)
|
|
35
|
+
]),
|
|
36
|
+
_: 3
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
export {
|
|
42
|
+
_sfc_main as default
|
|
43
|
+
};
|
|
@@ -1,75 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
height: "16",
|
|
6
|
-
viewBox: "0 0 24 24",
|
|
7
|
-
class: "htw-relative htw-z-10"
|
|
1
|
+
import _sfc_main from "./BaseCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
import { default as default2 } from "./BaseCheckbox.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
export {
|
|
4
|
+
default2 as default
|
|
8
5
|
};
|
|
9
|
-
const _hoisted_3 = ["stroke-dasharray", "stroke-dashoffset"];
|
|
10
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
-
__name: "BaseCheckbox",
|
|
12
|
-
props: {
|
|
13
|
-
modelValue: {
|
|
14
|
-
type: Boolean,
|
|
15
|
-
default: false
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
emits: {
|
|
19
|
-
"update:modelValue": (newValue) => true
|
|
20
|
-
},
|
|
21
|
-
setup(__props, { emit }) {
|
|
22
|
-
const props = __props;
|
|
23
|
-
function toggle() {
|
|
24
|
-
emit("update:modelValue", !props.modelValue);
|
|
25
|
-
animationEnabled.value = true;
|
|
26
|
-
}
|
|
27
|
-
const path = ref();
|
|
28
|
-
const dasharray = ref(0);
|
|
29
|
-
const progress = computed(() => props.modelValue ? 1 : 0);
|
|
30
|
-
const dashoffset = computed(() => (1 - progress.value) * dasharray.value);
|
|
31
|
-
const animationEnabled = ref(false);
|
|
32
|
-
watch(path, () => {
|
|
33
|
-
var _a, _b, _c;
|
|
34
|
-
dasharray.value = (_c = (_b = (_a = path.value).getTotalLength) == null ? void 0 : _b.call(_a)) != null ? _c : 21.21;
|
|
35
|
-
});
|
|
36
|
-
return (_ctx, _cache) => {
|
|
37
|
-
return openBlock(), createElementBlock("div", {
|
|
38
|
-
role: "checkbox",
|
|
39
|
-
tabindex: "0",
|
|
40
|
-
class: "htw-flex htw-items-center htw-gap-2 htw-select-none htw-px-4 htw-py-3 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700",
|
|
41
|
-
onClick: _cache[0] || (_cache[0] = ($event) => toggle()),
|
|
42
|
-
onKeydown: [
|
|
43
|
-
_cache[1] || (_cache[1] = withKeys(withModifiers(($event) => toggle(), ["prevent"]), ["enter"])),
|
|
44
|
-
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => toggle(), ["prevent"]), ["space"]))
|
|
45
|
-
]
|
|
46
|
-
}, [
|
|
47
|
-
createElementVNode("div", _hoisted_1, [
|
|
48
|
-
createElementVNode("div", {
|
|
49
|
-
class: normalizeClass(["htw-border group-active:htw-bg-gray-500/20 htw-rounded-sm htw-box-border htw-absolute htw-inset-0 htw-transition-border htw-duration-150 htw-ease-out", [
|
|
50
|
-
__props.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
|
|
51
|
-
]])
|
|
52
|
-
}, null, 2),
|
|
53
|
-
(openBlock(), createElementBlock("svg", _hoisted_2, [
|
|
54
|
-
createElementVNode("path", {
|
|
55
|
-
ref_key: "path",
|
|
56
|
-
ref: path,
|
|
57
|
-
d: "m 4 12 l 5 5 l 10 -10",
|
|
58
|
-
fill: "none",
|
|
59
|
-
class: normalizeClass(["htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out", [
|
|
60
|
-
animationEnabled.value ? "htw-transition-all" : "htw-transition-none",
|
|
61
|
-
{
|
|
62
|
-
"htw-delay-150": __props.modelValue
|
|
63
|
-
}
|
|
64
|
-
]]),
|
|
65
|
-
"stroke-dasharray": dasharray.value,
|
|
66
|
-
"stroke-dashoffset": unref(dashoffset)
|
|
67
|
-
}, null, 10, _hoisted_3)
|
|
68
|
-
]))
|
|
69
|
-
]),
|
|
70
|
-
renderSlot(_ctx.$slots, "default")
|
|
71
|
-
], 32);
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
export { _sfc_main as default };
|