@ohos-ports/histoire-app 1.0.0-beta.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/LICENSE +21 -0
- package/dist/app/assets/histoire-text-dark.svg +89 -0
- package/dist/app/assets/histoire-text.svg +89 -0
- package/dist/app/assets/histoire.svg +51 -0
- package/dist/app/style/floating.pcss +34 -0
- package/dist/app/style/main.pcss +100 -0
- package/dist/app/style/sandbox.css +24 -0
- package/dist/app/style/transitions.pcss +51 -0
- package/dist/bundle-index.js +3 -0
- package/dist/bundle-main-dev.js +4 -0
- package/dist/bundle-main.js +5 -0
- package/dist/bundle-sandbox-dev.js +2 -0
- package/dist/bundle-sandbox.js +2 -0
- package/dist/bundled/App.vue.js +5 -0
- package/dist/bundled/App.vue2.js +167 -0
- package/dist/bundled/_virtual/_node-dom-env.js +188 -0
- package/dist/bundled/_virtual/_node-dom-polyfill.js +152 -0
- package/dist/bundled/_virtual/_plugin-vue_export-helper.js +10 -0
- package/dist/bundled/_virtual/histoire-commands.js +8 -0
- package/dist/bundled/_virtual/histoire-config.js +42 -0
- package/dist/bundled/_virtual/histoire-markdown-files.js +8 -0
- package/dist/bundled/_virtual/histoire-search-docs-data.js +11 -0
- package/dist/bundled/_virtual/histoire-search-title-data.js +11 -0
- package/dist/bundled/_virtual/histoire-stories.js +17 -0
- package/dist/bundled/_virtual/histoire-support-plugins-client.js +8 -0
- package/dist/bundled/_virtual/histoire-theme.js +8 -0
- package/dist/bundled/api.js +12 -0
- package/dist/bundled/app.css +116 -0
- package/dist/bundled/assets/histoire-text-dark.svg.js +4 -0
- package/dist/bundled/assets/histoire-text.svg.js +4 -0
- package/dist/bundled/assets/histoire.svg.js +4 -0
- package/dist/bundled/components/HomeView.vue.js +5 -0
- package/dist/bundled/components/HomeView.vue2.js +66 -0
- package/dist/bundled/components/app/AppHeader.vue.js +5 -0
- package/dist/bundled/components/app/AppHeader.vue2.js +71 -0
- package/dist/bundled/components/app/AppLogo.vue.js +5 -0
- package/dist/bundled/components/app/AppLogo.vue2.js +29 -0
- package/dist/bundled/components/app/Breadcrumb.vue.js +8 -0
- package/dist/bundled/components/app/Breadcrumb.vue2.js +91 -0
- package/dist/bundled/components/app/HomeCounter.vue.js +5 -0
- package/dist/bundled/components/app/HomeCounter.vue2.js +42 -0
- package/dist/bundled/components/app/InitialLoading.vue.js +5 -0
- package/dist/bundled/components/app/InitialLoading.vue2.js +51 -0
- package/dist/bundled/components/app/MobileOverlay.vue.js +5 -0
- package/dist/bundled/components/app/MobileOverlay.vue2.js +45 -0
- package/dist/bundled/components/base/BaseButton.vue.js +5 -0
- package/dist/bundled/components/base/BaseButton.vue2.js +39 -0
- package/dist/bundled/components/base/BaseCheckbox.vue.js +5 -0
- package/dist/bundled/components/base/BaseCheckbox.vue2.js +78 -0
- package/dist/bundled/components/base/BaseEmpty.vue.js +14 -0
- package/dist/bundled/components/base/BaseIcon.vue.js +8 -0
- package/dist/bundled/components/base/BaseIcon.vue2.js +29 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue.js +5 -0
- package/dist/bundled/components/base/BaseKeyboardShortcut.vue2.js +20 -0
- package/dist/bundled/components/base/BaseListItem.vue.js +5 -0
- package/dist/bundled/components/base/BaseListItem.vue2.js +33 -0
- package/dist/bundled/components/base/BaseListItemLink.vue.js +33 -0
- package/dist/bundled/components/base/BaseListItemLink.vue2.js +26 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue.js +5 -0
- package/dist/bundled/components/base/BaseOverflowMenu.vue2.js +100 -0
- package/dist/bundled/components/base/BaseOverflowTab.vue.js +36 -0
- package/dist/bundled/components/base/BaseOverflowTab.vue2.js +18 -0
- package/dist/bundled/components/base/BaseSelect.vue.js +5 -0
- package/dist/bundled/components/base/BaseSelect.vue2.js +77 -0
- package/dist/bundled/components/base/BaseSplitPane.vue.js +8 -0
- package/dist/bundled/components/base/BaseSplitPane.vue2.js +183 -0
- package/dist/bundled/components/base/BaseTab.vue.js +36 -0
- package/dist/bundled/components/base/BaseTab.vue2.js +18 -0
- package/dist/bundled/components/base/BaseTag.vue.js +13 -0
- package/dist/bundled/components/command/CommandPrompts.vue.js +5 -0
- package/dist/bundled/components/command/CommandPrompts.vue2.js +91 -0
- package/dist/bundled/components/command/CommandPromptsModal.vue.js +5 -0
- package/dist/bundled/components/command/CommandPromptsModal.vue2.js +45 -0
- package/dist/bundled/components/command/PromptSelect.vue.js +5 -0
- package/dist/bundled/components/command/PromptSelect.vue2.js +142 -0
- package/dist/bundled/components/command/PromptText.vue.js +5 -0
- package/dist/bundled/components/command/PromptText.vue2.js +67 -0
- package/dist/bundled/components/misc/CheckerboardPattern.vue.js +40 -0
- package/dist/bundled/components/misc/HatchedPattern.vue.js +12 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentPropItem.vue2.js +72 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentProps.vue2.js +45 -0
- package/dist/bundled/components/panel/ControlsComponentState.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentState.vue2.js +41 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue.js +5 -0
- package/dist/bundled/components/panel/ControlsComponentStateItem.vue2.js +46 -0
- package/dist/bundled/components/panel/PaneTabs.vue.js +5 -0
- package/dist/bundled/components/panel/PaneTabs.vue2.js +114 -0
- package/dist/bundled/components/panel/StatePresets.vue.js +5 -0
- package/dist/bundled/components/panel/StatePresets.vue2.js +193 -0
- package/dist/bundled/components/panel/StoryControls.vue.js +5 -0
- package/dist/bundled/components/panel/StoryControls.vue2.js +87 -0
- package/dist/bundled/components/panel/StoryDocs.vue.js +7 -0
- package/dist/bundled/components/panel/StoryDocs.vue2.js +161 -0
- package/dist/bundled/components/panel/StoryEvent.vue.js +5 -0
- package/dist/bundled/components/panel/StoryEvent.vue2.js +59 -0
- package/dist/bundled/components/panel/StoryEvents.vue.js +5 -0
- package/dist/bundled/components/panel/StoryEvents.vue2.js +53 -0
- package/dist/bundled/components/panel/StorySidePanel.vue.js +5 -0
- package/dist/bundled/components/panel/StorySidePanel.vue2.js +83 -0
- package/dist/bundled/components/panel/StorySourceCode.vue.js +8 -0
- package/dist/bundled/components/panel/StorySourceCode.vue2.js +204 -0
- package/dist/bundled/components/search/SearchItem.vue.js +8 -0
- package/dist/bundled/components/search/SearchItem.vue2.js +93 -0
- package/dist/bundled/components/search/SearchItemContent.vue.js +5 -0
- package/dist/bundled/components/search/SearchItemContent.vue2.js +71 -0
- package/dist/bundled/components/search/SearchLoading.vue.js +5 -0
- package/dist/bundled/components/search/SearchLoading.vue2.js +21 -0
- package/dist/bundled/components/search/SearchModal.vue.js +5 -0
- package/dist/bundled/components/search/SearchModal.vue2.js +51 -0
- package/dist/bundled/components/search/SearchPane.vue.js +5 -0
- package/dist/bundled/components/search/SearchPane.vue2.js +272 -0
- package/dist/bundled/components/search/search-docs-data.js +11 -0
- package/dist/bundled/components/search/search-title-data.js +11 -0
- package/dist/bundled/components/story/GenericMountStory.vue.js +5 -0
- package/dist/bundled/components/story/GenericMountStory.vue2.js +34 -0
- package/dist/bundled/components/story/GenericRenderStory.vue.js +5 -0
- package/dist/bundled/components/story/GenericRenderStory.vue2.js +39 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue.js +8 -0
- package/dist/bundled/components/story/StoryResponsivePreview.vue2.js +207 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantGrid.vue2.js +146 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantGridItem.vue2.js +153 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantListItem.vue2.js +55 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue.js +8 -0
- package/dist/bundled/components/story/StoryVariantSingle.vue2.js +107 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.vue2.js +70 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.vue2.js +128 -0
- package/dist/bundled/components/story/StoryVariantSingleView.vue.js +5 -0
- package/dist/bundled/components/story/StoryVariantSingleView.vue2.js +66 -0
- package/dist/bundled/components/story/StoryView.vue.js +5 -0
- package/dist/bundled/components/story/StoryView.vue2.js +104 -0
- package/dist/bundled/components/story/StoryViewer.vue.js +8 -0
- package/dist/bundled/components/story/StoryViewer.vue2.js +55 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue.js +5 -0
- package/dist/bundled/components/toolbar/DevOnlyToolbarOpenInEditor.vue2.js +31 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.vue.js +8 -0
- package/dist/bundled/components/toolbar/ToolbarBackground.vue2.js +98 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarNewTab.vue2.js +36 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarResponsiveSize.vue2.js +127 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarTextDirection.vue2.js +27 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue.js +5 -0
- package/dist/bundled/components/toolbar/ToolbarTitle.vue2.js +26 -0
- package/dist/bundled/components/tree/StoryGroup.vue.js +5 -0
- package/dist/bundled/components/tree/StoryGroup.vue2.js +74 -0
- package/dist/bundled/components/tree/StoryList.vue.js +5 -0
- package/dist/bundled/components/tree/StoryList.vue2.js +41 -0
- package/dist/bundled/components/tree/StoryListFolder.vue.js +8 -0
- package/dist/bundled/components/tree/StoryListFolder.vue2.js +86 -0
- package/dist/bundled/components/tree/StoryListItem.vue.js +8 -0
- package/dist/bundled/components/tree/StoryListItem.vue2.js +69 -0
- package/dist/bundled/index.js +36 -0
- package/dist/bundled/plugin.js +49 -0
- package/dist/bundled/router.js +32 -0
- package/dist/bundled/sandbox.js +87 -0
- package/dist/bundled/stores/command.js +25 -0
- package/dist/bundled/stores/events.js +29 -0
- package/dist/bundled/stores/folder.js +54 -0
- package/dist/bundled/stores/preview-settings.js +19 -0
- package/dist/bundled/stores/story.js +43 -0
- package/dist/bundled/util/commands.js +57 -0
- package/dist/bundled/util/config.js +8 -0
- package/dist/bundled/util/const.js +10 -0
- package/dist/bundled/util/dark.js +28 -0
- package/dist/bundled/util/docs.js +26 -0
- package/dist/bundled/util/env.js +4 -0
- package/dist/bundled/util/events.js +33 -0
- package/dist/bundled/util/keyboard.js +90 -0
- package/dist/bundled/util/mapping.js +70 -0
- package/dist/bundled/util/open-in-editor.js +7 -0
- package/dist/bundled/util/preview-settings.js +21 -0
- package/dist/bundled/util/responsive.js +6 -0
- package/dist/bundled/util/sandbox.js +11 -0
- package/dist/bundled/util/scroll.js +31 -0
- package/dist/bundled/util/select.js +28 -0
- package/dist/bundled/util/state.js +41 -0
- package/dist/bundled/util/tooltip.js +15 -0
- package/dist/bundled/util/variant.js +21 -0
- package/dist/style.css +2853 -0
- package/package.json +62 -0
- package/postcss-scope-wrapper.cjs +35 -0
- package/postcss.config.cjs +9 -0
- package/scripts/copy.mjs +12 -0
- package/scripts/watchAndCopy.mjs +15 -0
- package/src/app/App.vue +172 -0
- package/src/app/api.ts +9 -0
- package/src/app/assets/histoire-text-dark.svg +89 -0
- package/src/app/assets/histoire-text.svg +89 -0
- package/src/app/assets/histoire.svg +51 -0
- package/src/app/components/HomeView.vue +61 -0
- package/src/app/components/app/AppHeader.vue +65 -0
- package/src/app/components/app/AppLogo.vue +25 -0
- package/src/app/components/app/Breadcrumb.vue +98 -0
- package/src/app/components/app/HomeCounter.vue +39 -0
- package/src/app/components/app/InitialLoading.vue +44 -0
- package/src/app/components/app/MobileOverlay.vue +33 -0
- package/src/app/components/base/BaseButton.vue +33 -0
- package/src/app/components/base/BaseCheckbox.vue +76 -0
- package/src/app/components/base/BaseCopyIcon.vue +34 -0
- package/src/app/components/base/BaseEmpty.vue +21 -0
- package/src/app/components/base/BaseIcon.vue +31 -0
- package/src/app/components/base/BaseKeyboardShortcut.vue +16 -0
- package/src/app/components/base/BaseListItem.vue +30 -0
- package/src/app/components/base/BaseListItemLink.vue +56 -0
- package/src/app/components/base/BaseOverflowMenu.vue +119 -0
- package/src/app/components/base/BaseOverflowTab.vue +47 -0
- package/src/app/components/base/BaseSelect.vue +75 -0
- package/src/app/components/base/BaseSplitPane.vue +244 -0
- package/src/app/components/base/BaseTab.vue +47 -0
- package/src/app/components/base/BaseTag.vue +5 -0
- package/src/app/components/command/CommandPrompts.vue +95 -0
- package/src/app/components/command/CommandPromptsModal.vue +41 -0
- package/src/app/components/command/PromptSelect.vue +142 -0
- package/src/app/components/command/PromptText.vue +65 -0
- package/src/app/components/misc/CheckerboardPattern.vue +32 -0
- package/src/app/components/misc/HatchedPattern.vue +13 -0
- package/src/app/components/panel/ControlsComponentPropItem.vue +73 -0
- package/src/app/components/panel/ControlsComponentProps.vue +34 -0
- package/src/app/components/panel/ControlsComponentState.vue +38 -0
- package/src/app/components/panel/ControlsComponentStateItem.vue +44 -0
- package/src/app/components/panel/PaneTabs.vue +84 -0
- package/src/app/components/panel/StatePresets.vue +199 -0
- package/src/app/components/panel/StoryControls.vue +97 -0
- package/src/app/components/panel/StoryDocs.vue +202 -0
- package/src/app/components/panel/StoryEvent.vue +54 -0
- package/src/app/components/panel/StoryEvents.vue +48 -0
- package/src/app/components/panel/StorySidePanel.vue +76 -0
- package/src/app/components/panel/StorySourceCode.vue +248 -0
- package/src/app/components/search/SearchItem.vue +89 -0
- package/src/app/components/search/SearchItemContent.vue +67 -0
- package/src/app/components/search/SearchLoading.vue +16 -0
- package/src/app/components/search/SearchModal.vue +44 -0
- package/src/app/components/search/SearchPane.vue +319 -0
- package/src/app/components/search/search-docs-data.ts +9 -0
- package/src/app/components/search/search-title-data.ts +9 -0
- package/src/app/components/search/types.ts +4 -0
- package/src/app/components/story/GenericMountStory.vue +35 -0
- package/src/app/components/story/GenericRenderStory.vue +41 -0
- package/src/app/components/story/StoryResponsivePreview.vue +216 -0
- package/src/app/components/story/StoryVariantGrid.vue +169 -0
- package/src/app/components/story/StoryVariantGridItem.vue +163 -0
- package/src/app/components/story/StoryVariantListItem.vue +52 -0
- package/src/app/components/story/StoryVariantSingle.vue +105 -0
- package/src/app/components/story/StoryVariantSinglePreviewNative.vue +66 -0
- package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +143 -0
- package/src/app/components/story/StoryVariantSingleView.vue +61 -0
- package/src/app/components/story/StoryView.vue +110 -0
- package/src/app/components/story/StoryViewer.vue +52 -0
- package/src/app/components/toolbar/DevOnlyToolbarOpenInEditor.vue +23 -0
- package/src/app/components/toolbar/ToolbarBackground.vue +81 -0
- package/src/app/components/toolbar/ToolbarNewTab.vue +29 -0
- package/src/app/components/toolbar/ToolbarResponsiveSize.vue +82 -0
- package/src/app/components/toolbar/ToolbarTextDirection.vue +19 -0
- package/src/app/components/toolbar/ToolbarTitle.vue +21 -0
- package/src/app/components/tree/StoryGroup.vue +73 -0
- package/src/app/components/tree/StoryList.vue +35 -0
- package/src/app/components/tree/StoryListFolder.vue +88 -0
- package/src/app/components/tree/StoryListItem.vue +72 -0
- package/src/app/index.ts +33 -0
- package/src/app/plugin.ts +59 -0
- package/src/app/router.ts +29 -0
- package/src/app/sandbox.ts +101 -0
- package/src/app/stores/command.ts +26 -0
- package/src/app/stores/events.ts +36 -0
- package/src/app/stores/folder.ts +63 -0
- package/src/app/stores/preview-settings.ts +18 -0
- package/src/app/stores/story.ts +47 -0
- package/src/app/style/floating.pcss +34 -0
- package/src/app/style/main.pcss +100 -0
- package/src/app/style/sandbox.css +24 -0
- package/src/app/style/transitions.pcss +51 -0
- package/src/app/types.ts +72 -0
- package/src/app/util/commands.ts +57 -0
- package/src/app/util/config.ts +5 -0
- package/src/app/util/const.ts +4 -0
- package/src/app/util/dark.ts +27 -0
- package/src/app/util/docs.ts +27 -0
- package/src/app/util/env.ts +1 -0
- package/src/app/util/events.ts +31 -0
- package/src/app/util/keyboard.ts +103 -0
- package/src/app/util/mapping.ts +80 -0
- package/src/app/util/open-in-editor.ts +3 -0
- package/src/app/util/preview-settings.ts +23 -0
- package/src/app/util/responsive.ts +3 -0
- package/src/app/util/sandbox.ts +9 -0
- package/src/app/util/scroll.ts +32 -0
- package/src/app/util/select.ts +30 -0
- package/src/app/util/state.ts +45 -0
- package/src/app/util/tooltip.ts +13 -0
- package/src/app/util/variant.ts +21 -0
- package/src/bundle-index.js +1 -0
- package/src/bundle-main-dev.js +4 -0
- package/src/bundle-main.js +5 -0
- package/src/bundle-sandbox-dev.js +2 -0
- package/src/bundle-sandbox.js +2 -0
- package/src/index.ts +1 -0
- package/src/shim.d.ts +10 -0
- package/src/virtual.d.ts +7 -0
- package/tailwind.config.cjs +137 -0
- package/tsconfig.json +53 -0
- package/vite.config.ts +88 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, createElementVNode, createVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import HistoireLogo from "../assets/histoire.svg.js";
|
|
3
|
+
import { useStoryStore } from "../stores/story.js";
|
|
4
|
+
import { customLogos, histoireConfig } from "../util/config.js";
|
|
5
|
+
import "./app/HomeCounter.vue.js";
|
|
6
|
+
import _sfc_main$1 from "./app/HomeCounter.vue2.js";
|
|
7
|
+
"use strict";
|
|
8
|
+
const _hoisted_1 = { class: "histoire-home-view htw-flex md:htw-flex-col htw-gap-12 htw-items-center htw-justify-center htw-h-full" };
|
|
9
|
+
const _hoisted_2 = ["src"];
|
|
10
|
+
const _hoisted_3 = { class: "htw-flex !md:htw-flex-col htw-flex-wrap htw-justify-evenly htw-gap-2 htw-px-4 htw-py-2 htw-bg-gray-100 dark:htw-bg-gray-750 htw-rounded htw-border htw-border-gray-500/30" };
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "HomeView",
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const logoUrl = computed(() => histoireConfig.theme?.logo?.square ? customLogos.square : HistoireLogo);
|
|
15
|
+
const storyStore = useStoryStore();
|
|
16
|
+
const stats = computed(() => {
|
|
17
|
+
let storyCount = 0;
|
|
18
|
+
let variantCount = 0;
|
|
19
|
+
let docsCount = 0;
|
|
20
|
+
(storyStore.stories || []).forEach((story) => {
|
|
21
|
+
if (story.docsOnly) {
|
|
22
|
+
docsCount++;
|
|
23
|
+
} else {
|
|
24
|
+
storyCount++;
|
|
25
|
+
if (story.variants) {
|
|
26
|
+
variantCount += story.variants.length;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
storyCount,
|
|
32
|
+
variantCount,
|
|
33
|
+
docsCount
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
38
|
+
createElementVNode("img", {
|
|
39
|
+
src: logoUrl.value,
|
|
40
|
+
alt: "Logo",
|
|
41
|
+
class: "htw-w-64 htw-h-64 htw-opacity-25 htw-mb-8 htw-hidden md:htw-block"
|
|
42
|
+
}, null, 8, _hoisted_2),
|
|
43
|
+
createElementVNode("div", _hoisted_3, [
|
|
44
|
+
createVNode(_sfc_main$1, {
|
|
45
|
+
title: "Stories",
|
|
46
|
+
icon: "carbon:cube",
|
|
47
|
+
count: stats.value.storyCount
|
|
48
|
+
}, null, 8, ["count"]),
|
|
49
|
+
createVNode(_sfc_main$1, {
|
|
50
|
+
title: "Variants",
|
|
51
|
+
icon: "carbon:cube-view",
|
|
52
|
+
count: stats.value.variantCount
|
|
53
|
+
}, null, 8, ["count"]),
|
|
54
|
+
createVNode(_sfc_main$1, {
|
|
55
|
+
title: "Documents",
|
|
56
|
+
icon: "carbon:document-blank",
|
|
57
|
+
count: stats.value.docsCount
|
|
58
|
+
}, null, 8, ["count"])
|
|
59
|
+
])
|
|
60
|
+
]);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
export {
|
|
65
|
+
_sfc_main as default
|
|
66
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineComponent, computed, resolveDirective, createElementBlock, openBlock, createElementVNode, unref, createVNode, withDirectives, createCommentVNode } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { histoireConfig } from "../../util/config.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 "./AppLogo.vue.js";
|
|
8
|
+
import _sfc_main$1 from "./AppLogo.vue2.js";
|
|
9
|
+
"use strict";
|
|
10
|
+
const _hoisted_1 = { class: "histoire-app-header htw-px-4 htw-h-16 htw-flex htw-items-center htw-gap-2" };
|
|
11
|
+
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" };
|
|
12
|
+
const _hoisted_3 = ["href"];
|
|
13
|
+
const _hoisted_4 = { class: "htw-ml-auto htw-flex-none htw-flex" };
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
__name: "AppHeader",
|
|
16
|
+
emits: {
|
|
17
|
+
search: () => true
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const themeIcon = computed(() => {
|
|
21
|
+
return isDark.value ? "carbon:moon" : "carbon:sun";
|
|
22
|
+
});
|
|
23
|
+
onKeyboardShortcut(["ctrl+shift+d", "meta+shift+d"], (event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
toggleDark();
|
|
26
|
+
});
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
29
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
30
|
+
createElementVNode("div", _hoisted_2, [
|
|
31
|
+
createElementVNode("a", {
|
|
32
|
+
href: unref(histoireConfig).theme?.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
|
+
!unref(histoireConfig).theme.hideColorSchemeSwitch ? withDirectives((openBlock(), createElementBlock("a", {
|
|
53
|
+
key: 0,
|
|
54
|
+
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",
|
|
55
|
+
onClick: _cache[1] || (_cache[1] = ($event) => unref(toggleDark)())
|
|
56
|
+
}, [
|
|
57
|
+
createVNode(unref(Icon), {
|
|
58
|
+
icon: themeIcon.value,
|
|
59
|
+
class: "htw-w-6 htw-h-6 sm:htw-w-4 sm:htw-h-4"
|
|
60
|
+
}, null, 8, ["icon"])
|
|
61
|
+
])), [
|
|
62
|
+
[_directive_tooltip, unref(makeTooltip)("Toggle dark mode", ({ isMac }) => isMac ? "meta+shift+d" : "ctrl+shift+d")]
|
|
63
|
+
]) : createCommentVNode("", true)
|
|
64
|
+
])
|
|
65
|
+
]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
_sfc_main as default
|
|
71
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock } from "@histoire/vendors/vue";
|
|
2
|
+
import HistoireLogoDark from "../../assets/histoire-text-dark.svg.js";
|
|
3
|
+
import HistoireLogoLight from "../../assets/histoire-text.svg.js";
|
|
4
|
+
import { customLogos, histoireConfig } from "../../util/config.js";
|
|
5
|
+
import { isDark } from "../../util/dark.js";
|
|
6
|
+
"use strict";
|
|
7
|
+
const _hoisted_1 = ["src", "alt"];
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "AppLogo",
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const logoUrl = computed(() => {
|
|
12
|
+
if (isDark.value) {
|
|
13
|
+
return histoireConfig.theme.logo?.dark ? customLogos.dark : HistoireLogoDark;
|
|
14
|
+
}
|
|
15
|
+
return histoireConfig.theme.logo?.light ? customLogos.light : HistoireLogoLight;
|
|
16
|
+
});
|
|
17
|
+
const altText = computed(() => `${histoireConfig.theme.title} logo`);
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return openBlock(), createElementBlock("img", {
|
|
20
|
+
class: "histoire-app-logo",
|
|
21
|
+
src: logoUrl.value,
|
|
22
|
+
alt: altText.value
|
|
23
|
+
}, null, 8, _hoisted_1);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
_sfc_main as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./Breadcrumb.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d15ecb89"]]);
|
|
6
|
+
export {
|
|
7
|
+
Breadcrumb as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { defineComponent, useCssVars, computed, ref, watch, createElementBlock, openBlock, Fragment, createElementVNode, createVNode, renderList, toDisplayString, createTextVNode, unref, normalizeClass, withCtx } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
import { useStoryStore } from "../../stores/story.js";
|
|
4
|
+
import "../tree/StoryList.vue.js";
|
|
5
|
+
import "./MobileOverlay.vue.js";
|
|
6
|
+
import _sfc_main$1 from "./MobileOverlay.vue2.js";
|
|
7
|
+
import _sfc_main$2 from "../tree/StoryList.vue2.js";
|
|
8
|
+
"use strict";
|
|
9
|
+
const _hoisted_1 = { class: "histoire-breadcrumb" };
|
|
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: {},
|
|
16
|
+
stories: {}
|
|
17
|
+
},
|
|
18
|
+
setup(__props) {
|
|
19
|
+
useCssVars((_ctx) => ({
|
|
20
|
+
"a3f02f4e": story.value?.iconColor
|
|
21
|
+
}));
|
|
22
|
+
const storyStore = useStoryStore();
|
|
23
|
+
const story = computed(() => storyStore.currentStory);
|
|
24
|
+
const folders = computed(() => {
|
|
25
|
+
return story.value.file.path.slice(0, -1);
|
|
26
|
+
});
|
|
27
|
+
const isMenuOpened = ref(false);
|
|
28
|
+
function openMenu() {
|
|
29
|
+
isMenuOpened.value = true;
|
|
30
|
+
}
|
|
31
|
+
function closeMenu() {
|
|
32
|
+
isMenuOpened.value = false;
|
|
33
|
+
}
|
|
34
|
+
watch(story, () => {
|
|
35
|
+
isMenuOpened.value = false;
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
39
|
+
createElementVNode("div", _hoisted_1, [
|
|
40
|
+
createElementVNode("a", {
|
|
41
|
+
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",
|
|
42
|
+
onClick: openMenu
|
|
43
|
+
}, [
|
|
44
|
+
story.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
45
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(folders.value, (file, key) => {
|
|
46
|
+
return openBlock(), createElementBlock(Fragment, { key }, [
|
|
47
|
+
createElementVNode("span", null, toDisplayString(file), 1),
|
|
48
|
+
_cache[0] || (_cache[0] = createElementVNode("span", { class: "htw-opacity-40" }, " / ", -1))
|
|
49
|
+
], 64);
|
|
50
|
+
}), 128)),
|
|
51
|
+
createElementVNode("span", _hoisted_2, [
|
|
52
|
+
createVNode(unref(Icon), {
|
|
53
|
+
icon: story.value.icon ?? "carbon:cube",
|
|
54
|
+
class: normalizeClass(["htw-w-5 htw-h-5 htw-flex-none", {
|
|
55
|
+
"htw-text-primary-500": !story.value.iconColor,
|
|
56
|
+
"bind-icon-color": story.value.iconColor
|
|
57
|
+
}])
|
|
58
|
+
}, null, 8, ["icon", "class"]),
|
|
59
|
+
createTextVNode(" " + toDisplayString(story.value.title) + " ", 1),
|
|
60
|
+
createElementVNode("span", _hoisted_3, toDisplayString(story.value.variants.length), 1)
|
|
61
|
+
])
|
|
62
|
+
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
63
|
+
createTextVNode(" Select a story... ")
|
|
64
|
+
], 64)),
|
|
65
|
+
createVNode(unref(Icon), {
|
|
66
|
+
icon: "carbon:chevron-sort",
|
|
67
|
+
class: "htw-w-5 htw-h-5 htw-shrink-0 htw-ml-auto"
|
|
68
|
+
})
|
|
69
|
+
])
|
|
70
|
+
]),
|
|
71
|
+
createVNode(_sfc_main$1, {
|
|
72
|
+
title: "Select a story",
|
|
73
|
+
opened: isMenuOpened.value,
|
|
74
|
+
onClose: closeMenu
|
|
75
|
+
}, {
|
|
76
|
+
default: withCtx(() => [
|
|
77
|
+
createVNode(_sfc_main$2, {
|
|
78
|
+
tree: __props.tree,
|
|
79
|
+
stories: __props.stories,
|
|
80
|
+
class: "htw-flex-1 htw-overflow-y-scroll"
|
|
81
|
+
}, null, 8, ["tree", "stories"])
|
|
82
|
+
]),
|
|
83
|
+
_: 1
|
|
84
|
+
}, 8, ["opened"])
|
|
85
|
+
], 64);
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
export {
|
|
90
|
+
_sfc_main as default
|
|
91
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createVNode, createElementVNode, unref, toDisplayString } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = { class: "htw-p-2 htw-flex htw-items-center htw-gap-x-2" };
|
|
5
|
+
const _hoisted_2 = { class: "htw-flex htw-flex-col htw-leading-none" };
|
|
6
|
+
const _hoisted_3 = { class: "htw-text-primary-500 htw-min-w-[80px] htw-font-bold" };
|
|
7
|
+
const _hoisted_4 = { class: "htw-text-sm htw-text-gray-900 dark:htw-text-gray-100" };
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
__name: "HomeCounter",
|
|
10
|
+
props: {
|
|
11
|
+
icon: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: "carbon:cube"
|
|
14
|
+
},
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
count: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 0
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
28
|
+
createVNode(unref(Icon), {
|
|
29
|
+
icon: props.icon,
|
|
30
|
+
class: "htw-text-2xl htw-text-gray-700 dark:htw-text-gray-300 htw-flex-none"
|
|
31
|
+
}, null, 8, ["icon"]),
|
|
32
|
+
createElementVNode("div", _hoisted_2, [
|
|
33
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.count), 1),
|
|
34
|
+
createElementVNode("span", _hoisted_4, toDisplayString(__props.title), 1)
|
|
35
|
+
])
|
|
36
|
+
]);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
_sfc_main as default
|
|
42
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent, reactive, createElementBlock, openBlock, createVNode, Transition, withCtx, createCommentVNode, normalizeStyle, Fragment, renderList, createElementVNode, normalizeClass } from "@histoire/vendors/vue";
|
|
2
|
+
"use strict";
|
|
3
|
+
const _hoisted_1 = { class: "histoire-initial-loading 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" };
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "InitialLoading",
|
|
6
|
+
setup(__props) {
|
|
7
|
+
const progress = reactive({
|
|
8
|
+
loaded: 0,
|
|
9
|
+
total: 0
|
|
10
|
+
});
|
|
11
|
+
const maxCols = window.innerWidth / 20;
|
|
12
|
+
if (import.meta.hot) {
|
|
13
|
+
import.meta.hot.on("histoire:stories-loading-progress", (data) => {
|
|
14
|
+
progress.loaded = data.loadedFileCount;
|
|
15
|
+
progress.total = data.totalFileCount;
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
20
|
+
createVNode(Transition, { name: "__histoire-fade" }, {
|
|
21
|
+
default: withCtx(() => [
|
|
22
|
+
progress.total > 0 ? (openBlock(), createElementBlock("div", {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "htw-grid htw-gap-2",
|
|
25
|
+
style: normalizeStyle({
|
|
26
|
+
gridTemplateColumns: `repeat(${Math.min(Math.ceil(Math.sqrt(progress.total)), maxCols)}, minmax(0, 1fr))`
|
|
27
|
+
})
|
|
28
|
+
}, [
|
|
29
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(progress.total, (n) => {
|
|
30
|
+
return openBlock(), createElementBlock("div", {
|
|
31
|
+
key: n,
|
|
32
|
+
class: "htw-bg-primary-500/10 htw-rounded-full"
|
|
33
|
+
}, [
|
|
34
|
+
createElementVNode("div", {
|
|
35
|
+
class: normalizeClass(["htw-w-3 htw-h-3 htw-bg-primary-500 htw-rounded-full htw-duration-150 htw-ease-out", {
|
|
36
|
+
"htw-transition-transform htw-scale-0": n >= progress.loaded
|
|
37
|
+
}])
|
|
38
|
+
}, null, 2)
|
|
39
|
+
]);
|
|
40
|
+
}), 128))
|
|
41
|
+
], 4)) : createCommentVNode("", true)
|
|
42
|
+
]),
|
|
43
|
+
_: 1
|
|
44
|
+
})
|
|
45
|
+
]);
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
_sfc_main as default
|
|
51
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineComponent, createBlock, openBlock, Transition, withCtx, createElementBlock, createCommentVNode, createElementVNode, renderSlot, toDisplayString, createVNode, unref } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "histoire-mobile-overlay 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"
|
|
7
|
+
};
|
|
8
|
+
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" };
|
|
9
|
+
const _hoisted_3 = { class: "htw-text-gray-500" };
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
__name: "MobileOverlay",
|
|
12
|
+
props: {
|
|
13
|
+
title: {},
|
|
14
|
+
opened: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
emits: ["close"],
|
|
17
|
+
setup(__props, { emit: __emit }) {
|
|
18
|
+
const emit = __emit;
|
|
19
|
+
return (_ctx, _cache) => {
|
|
20
|
+
return openBlock(), createBlock(Transition, { name: "__histoire-fade-bottom" }, {
|
|
21
|
+
default: withCtx(() => [
|
|
22
|
+
__props.opened ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
23
|
+
createElementVNode("div", _hoisted_2, [
|
|
24
|
+
createElementVNode("span", _hoisted_3, toDisplayString(__props.title), 1),
|
|
25
|
+
createElementVNode("a", {
|
|
26
|
+
class: "htw-p-1 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-cursor-pointer",
|
|
27
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
|
|
28
|
+
}, [
|
|
29
|
+
createVNode(unref(Icon), {
|
|
30
|
+
icon: "carbon:close",
|
|
31
|
+
class: "htw-w-8 htw-h-8 htw-shrink-0"
|
|
32
|
+
})
|
|
33
|
+
])
|
|
34
|
+
]),
|
|
35
|
+
renderSlot(_ctx.$slots, "default")
|
|
36
|
+
])) : createCommentVNode("", true)
|
|
37
|
+
]),
|
|
38
|
+
_: 3
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export {
|
|
44
|
+
_sfc_main as default
|
|
45
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineComponent, computed, createBlock, openBlock, resolveDynamicComponent, normalizeClass, withCtx, renderSlot } from "@histoire/vendors/vue";
|
|
2
|
+
import { RouterLink } from "@histoire/vendors/vue-router";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
__name: "BaseButton",
|
|
6
|
+
props: {
|
|
7
|
+
to: {},
|
|
8
|
+
href: {},
|
|
9
|
+
color: {}
|
|
10
|
+
},
|
|
11
|
+
setup(__props) {
|
|
12
|
+
const props = __props;
|
|
13
|
+
const comp = computed(() => {
|
|
14
|
+
if (props.to) {
|
|
15
|
+
return RouterLink;
|
|
16
|
+
}
|
|
17
|
+
if (props.href) {
|
|
18
|
+
return "a";
|
|
19
|
+
}
|
|
20
|
+
return "button";
|
|
21
|
+
});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createBlock(resolveDynamicComponent(comp.value), {
|
|
24
|
+
class: normalizeClass(["histoire-base-button htw-rounded htw-cursor-pointer", {
|
|
25
|
+
"htw-bg-primary-200 dark:htw-bg-primary-800 hover:htw-bg-primary-300 dark:hover:htw-bg-primary-700": __props.color === "primary" || !__props.color,
|
|
26
|
+
"htw-bg-grey-100 dark:htw-bg-grey-900 hover:htw-bg-grey-200 dark:hover:htw-bg-grey-800": __props.color === "grey"
|
|
27
|
+
}])
|
|
28
|
+
}, {
|
|
29
|
+
default: withCtx(() => [
|
|
30
|
+
renderSlot(_ctx.$slots, "default")
|
|
31
|
+
]),
|
|
32
|
+
_: 3
|
|
33
|
+
}, 8, ["class"]);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export {
|
|
38
|
+
_sfc_main as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, watch, createElementBlock, openBlock, withKeys, withModifiers, createElementVNode, renderSlot, normalizeClass } from "@histoire/vendors/vue";
|
|
2
|
+
"use strict";
|
|
3
|
+
const _hoisted_1 = { class: "htw-text-white htw-w-[16px] htw-h-[16px] htw-relative" };
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
width: "16",
|
|
6
|
+
height: "16",
|
|
7
|
+
viewBox: "0 0 24 24",
|
|
8
|
+
class: "htw-relative htw-z-10"
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_3 = ["stroke-dasharray", "stroke-dashoffset"];
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
__name: "BaseCheckbox",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
emits: {
|
|
20
|
+
"update:modelValue": (_newValue) => true
|
|
21
|
+
},
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
function toggle() {
|
|
26
|
+
emit("update:modelValue", !props.modelValue);
|
|
27
|
+
animationEnabled.value = true;
|
|
28
|
+
}
|
|
29
|
+
const path = ref();
|
|
30
|
+
const dasharray = ref(0);
|
|
31
|
+
const progress = computed(() => props.modelValue ? 1 : 0);
|
|
32
|
+
const dashoffset = computed(() => (1 - progress.value) * dasharray.value);
|
|
33
|
+
const animationEnabled = ref(false);
|
|
34
|
+
watch(path, () => {
|
|
35
|
+
dasharray.value = path.value.getTotalLength?.() ?? 21.21;
|
|
36
|
+
});
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock("div", {
|
|
39
|
+
role: "checkbox",
|
|
40
|
+
tabindex: "0",
|
|
41
|
+
class: "histoire-base-checkbox 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",
|
|
42
|
+
onClick: _cache[0] || (_cache[0] = ($event) => toggle()),
|
|
43
|
+
onKeydown: [
|
|
44
|
+
_cache[1] || (_cache[1] = withKeys(withModifiers(($event) => toggle(), ["prevent"]), ["enter"])),
|
|
45
|
+
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => toggle(), ["prevent"]), ["space"]))
|
|
46
|
+
]
|
|
47
|
+
}, [
|
|
48
|
+
createElementVNode("div", _hoisted_1, [
|
|
49
|
+
createElementVNode("div", {
|
|
50
|
+
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", [
|
|
51
|
+
__props.modelValue ? "htw-border-primary-500 htw-border-8" : "htw-border-black/25 dark:htw-border-white/25 htw-delay-150"
|
|
52
|
+
]])
|
|
53
|
+
}, null, 2),
|
|
54
|
+
(openBlock(), createElementBlock("svg", _hoisted_2, [
|
|
55
|
+
createElementVNode("path", {
|
|
56
|
+
ref_key: "path",
|
|
57
|
+
ref: path,
|
|
58
|
+
d: "m 4 12 l 5 5 l 10 -10",
|
|
59
|
+
fill: "none",
|
|
60
|
+
class: normalizeClass(["htw-stroke-white htw-stroke-2 htw-duration-200 htw-ease-in-out", [
|
|
61
|
+
animationEnabled.value ? "htw-transition-all" : "htw-transition-none",
|
|
62
|
+
{
|
|
63
|
+
"htw-delay-150": __props.modelValue
|
|
64
|
+
}
|
|
65
|
+
]]),
|
|
66
|
+
"stroke-dasharray": dasharray.value,
|
|
67
|
+
"stroke-dashoffset": dashoffset.value
|
|
68
|
+
}, null, 10, _hoisted_3)
|
|
69
|
+
]))
|
|
70
|
+
]),
|
|
71
|
+
renderSlot(_ctx.$slots, "default")
|
|
72
|
+
], 32);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
_sfc_main as default
|
|
78
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createElementBlock, openBlock, renderSlot } from "@histoire/vendors/vue";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = {};
|
|
5
|
+
const _hoisted_1 = { class: "histoire-base-empty htw-base-empty htw-flex htw-flex-col htw-items-center htw-justify-center htw-space-y-4 htw-py-12 htw-h-full htw-text-center htw-text-gray-400 htw-text-lg" };
|
|
6
|
+
function _sfc_render(_ctx, _cache) {
|
|
7
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
8
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
9
|
+
]);
|
|
10
|
+
}
|
|
11
|
+
const BaseEmpty = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c5ecfead"]]);
|
|
12
|
+
export {
|
|
13
|
+
BaseEmpty as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import _sfc_main from "./BaseIcon.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
"use strict";
|
|
5
|
+
const BaseIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2114f510"]]);
|
|
6
|
+
export {
|
|
7
|
+
BaseIcon as default
|
|
8
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, createBlock, openBlock, unref } from "@histoire/vendors/vue";
|
|
2
|
+
import { Icon } from "@histoire/vendors/iconify";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = ["src", "alt"];
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "BaseIcon",
|
|
7
|
+
props: {
|
|
8
|
+
icon: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const isUrl = computed(() => props.icon.startsWith("http") || props.icon.startsWith("data:image") || props.icon.startsWith(".") || props.icon.startsWith("/"));
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return isUrl.value ? (openBlock(), createElementBlock("img", {
|
|
15
|
+
key: 0,
|
|
16
|
+
src: __props.icon,
|
|
17
|
+
alt: __props.icon,
|
|
18
|
+
class: "histoire-base-icon"
|
|
19
|
+
}, null, 8, _hoisted_1)) : (openBlock(), createBlock(unref(Icon), {
|
|
20
|
+
key: 1,
|
|
21
|
+
icon: __props.icon,
|
|
22
|
+
class: "histoire-base-icon"
|
|
23
|
+
}, null, 8, ["icon"]));
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
_sfc_main as default
|
|
29
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, toDisplayString } from "@histoire/vendors/vue";
|
|
2
|
+
import { formatKey } from "../../util/keyboard.js";
|
|
3
|
+
"use strict";
|
|
4
|
+
const _hoisted_1 = { class: "histoire-base-keyboard-shortcut htw-border htw-border-current htw-opacity-50 htw-px-1 htw-rounded-sm" };
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
__name: "BaseKeyboardShortcut",
|
|
7
|
+
props: {
|
|
8
|
+
shortcut: {}
|
|
9
|
+
},
|
|
10
|
+
setup(__props) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const formatted = computed(() => props.shortcut.split("+").map((k) => formatKey(k.trim())).join(" "));
|
|
13
|
+
return (_ctx, _cache) => {
|
|
14
|
+
return openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(formatted.value), 1);
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
_sfc_main as default
|
|
20
|
+
};
|