@histoire/app 0.9.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.
Files changed (210) hide show
  1. package/LICENSE +21 -0
  2. package/dist/app/assets/histoire-text-dark.svg +89 -0
  3. package/dist/app/assets/histoire-text.svg +89 -0
  4. package/dist/app/assets/histoire.svg +51 -0
  5. package/dist/app/style/floating-vue.pcss +34 -0
  6. package/dist/app/style/main.pcss +86 -0
  7. package/dist/app/style/sandbox.css +19 -0
  8. package/dist/app/style/transitions.pcss +51 -0
  9. package/dist/bundle-index.js +1 -0
  10. package/dist/bundle-main.js +5 -0
  11. package/dist/bundle-sandbox.js +2 -0
  12. package/dist/bundled/App.js +148 -0
  13. package/dist/bundled/_virtual/plugin-vue_export-helper.js +8 -0
  14. package/dist/bundled/api.js +1 -0
  15. package/dist/bundled/assets/histoire-text-dark.js +2 -0
  16. package/dist/bundled/assets/histoire-text.js +2 -0
  17. package/dist/bundled/assets/histoire.js +2 -0
  18. package/dist/bundled/components/HomeView.js +24 -0
  19. package/dist/bundled/components/app/AppHeader.js +67 -0
  20. package/dist/bundled/components/app/AppLogo.js +26 -0
  21. package/dist/bundled/components/app/Breadcrumb.js +95 -0
  22. package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  23. package/dist/bundled/components/app/InitialLoading.js +48 -0
  24. package/dist/bundled/components/app/MobileOverlay.js +41 -0
  25. package/dist/bundled/components/base/BaseCheckbox.js +75 -0
  26. package/dist/bundled/components/base/BaseEmpty.js +13 -0
  27. package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  28. package/dist/bundled/components/base/BaseListItemLink.js +50 -0
  29. package/dist/bundled/components/base/BaseOverflowMenu.js +97 -0
  30. package/dist/bundled/components/base/BaseOverflowTab.js +45 -0
  31. package/dist/bundled/components/base/BaseSelect.js +69 -0
  32. package/dist/bundled/components/base/BaseSplitPane.js +184 -0
  33. package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  34. package/dist/bundled/components/base/BaseTab.js +45 -0
  35. package/dist/bundled/components/misc/CheckerboardPattern.js +41 -0
  36. package/dist/bundled/components/misc/HatchedPattern.js +11 -0
  37. package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  38. package/dist/bundled/components/panel/ControlsComponentPropItem.js +98 -0
  39. package/dist/bundled/components/panel/ControlsComponentProps.js +42 -0
  40. package/dist/bundled/components/panel/PaneTabs.js +112 -0
  41. package/dist/bundled/components/panel/StatePresets.js +190 -0
  42. package/dist/bundled/components/panel/StoryControls.js +66 -0
  43. package/dist/bundled/components/panel/StoryDocs.js +57 -0
  44. package/dist/bundled/components/panel/StoryEvent.js +56 -0
  45. package/dist/bundled/components/panel/StoryEvents.js +49 -0
  46. package/dist/bundled/components/panel/StorySidePanel.js +72 -0
  47. package/dist/bundled/components/panel/StorySourceCode.js +119 -0
  48. package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  49. package/dist/bundled/components/search/SearchItem.js +113 -0
  50. package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  51. package/dist/bundled/components/search/SearchLoading.js +19 -0
  52. package/dist/bundled/components/search/SearchModal.js +46 -0
  53. package/dist/bundled/components/search/SearchPane.js +263 -0
  54. package/dist/bundled/components/search/search-docs-data.js +7 -0
  55. package/dist/bundled/components/search/search-title-data.js +7 -0
  56. package/dist/bundled/components/story/GenericMountStory.js +27 -0
  57. package/dist/bundled/components/story/GenericRenderStory.js +27 -0
  58. package/dist/bundled/components/story/StoryResponsivePreview.js +180 -0
  59. package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  60. package/dist/bundled/components/story/StoryVariantGrid.js +94 -0
  61. package/dist/bundled/components/story/StoryVariantGridItem.js +106 -0
  62. package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  63. package/dist/bundled/components/story/StoryVariantListItem.js +58 -0
  64. package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  65. package/dist/bundled/components/story/StoryVariantSingle.js +115 -0
  66. package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  67. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +43 -0
  68. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +119 -0
  69. package/dist/bundled/components/story/StoryVariantSingleView.js +49 -0
  70. package/dist/bundled/components/story/StoryView.js +90 -0
  71. package/dist/bundled/components/story/StoryViewer.js +57 -0
  72. package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  73. package/dist/bundled/components/toolbar/StoryVariantBackground.js +85 -0
  74. package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  75. package/dist/bundled/components/toolbar/StoryVariantNewTab.js +33 -0
  76. package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +129 -0
  77. package/dist/bundled/components/toolbar/StoryVariantTitle.js +24 -0
  78. package/dist/bundled/components/tree/StoryGroup.js +74 -0
  79. package/dist/bundled/components/tree/StoryList.js +37 -0
  80. package/dist/bundled/components/tree/StoryListFolder.js +89 -0
  81. package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  82. package/dist/bundled/components/tree/StoryListItem.js +72 -0
  83. package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +2 -0
  84. package/dist/bundled/index.js +29 -0
  85. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +40 -0
  86. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +5 -0
  87. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +11 -0
  88. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +26 -0
  89. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +10 -0
  90. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +50 -0
  91. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +8 -0
  92. package/dist/bundled/router.js +28 -0
  93. package/dist/bundled/sandbox.js +88 -0
  94. package/dist/bundled/stores/events.js +29 -0
  95. package/dist/bundled/stores/folder.js +49 -0
  96. package/dist/bundled/stores/preview-settings.js +15 -0
  97. package/dist/bundled/stores/story.js +43 -0
  98. package/dist/bundled/style.css +102 -0
  99. package/dist/bundled/util/config.js +4 -0
  100. package/dist/bundled/util/const.js +5 -0
  101. package/dist/bundled/util/dark.js +4 -0
  102. package/dist/bundled/util/env.js +2 -0
  103. package/dist/bundled/util/events.js +32 -0
  104. package/dist/bundled/util/keyboard.js +84 -0
  105. package/dist/bundled/util/mapping.js +65 -0
  106. package/dist/bundled/util/preview-settings.js +6 -0
  107. package/dist/bundled/util/responsive.js +3 -0
  108. package/dist/bundled/util/sandbox.js +8 -0
  109. package/dist/bundled/util/scroll.js +28 -0
  110. package/dist/bundled/util/state.js +31 -0
  111. package/dist/bundled/util/tooltip.js +12 -0
  112. package/dist/bundled/util/variant.js +18 -0
  113. package/dist/style.css +2697 -0
  114. package/package.json +57 -0
  115. package/postcss.config.cjs +8 -0
  116. package/scripts/copy.mjs +12 -0
  117. package/scripts/watchAndCopy.mjs +15 -0
  118. package/src/app/App.vue +162 -0
  119. package/src/app/api.ts +1 -0
  120. package/src/app/assets/histoire-text-dark.svg +89 -0
  121. package/src/app/assets/histoire-text.svg +89 -0
  122. package/src/app/assets/histoire.svg +51 -0
  123. package/src/app/components/HomeView.vue +17 -0
  124. package/src/app/components/app/AppHeader.vue +64 -0
  125. package/src/app/components/app/AppLogo.vue +24 -0
  126. package/src/app/components/app/Breadcrumb.vue +98 -0
  127. package/src/app/components/app/InitialLoading.vue +44 -0
  128. package/src/app/components/app/MobileOverlay.vue +33 -0
  129. package/src/app/components/base/BaseCheckbox.vue +77 -0
  130. package/src/app/components/base/BaseCopyIcon.vue +34 -0
  131. package/src/app/components/base/BaseEmpty.vue +21 -0
  132. package/src/app/components/base/BaseListItemLink.vue +55 -0
  133. package/src/app/components/base/BaseOverflowMenu.vue +119 -0
  134. package/src/app/components/base/BaseOverflowTab.vue +46 -0
  135. package/src/app/components/base/BaseSelect.vue +72 -0
  136. package/src/app/components/base/BaseSplitPane.vue +240 -0
  137. package/src/app/components/base/BaseTab.vue +46 -0
  138. package/src/app/components/misc/CheckerboardPattern.vue +32 -0
  139. package/src/app/components/misc/HatchedPattern.vue +13 -0
  140. package/src/app/components/panel/ControlsComponentPropItem.vue +103 -0
  141. package/src/app/components/panel/ControlsComponentProps.vue +34 -0
  142. package/src/app/components/panel/PaneTabs.vue +89 -0
  143. package/src/app/components/panel/StatePresets.vue +196 -0
  144. package/src/app/components/panel/StoryControls.vue +68 -0
  145. package/src/app/components/panel/StoryDocs.vue +60 -0
  146. package/src/app/components/panel/StoryEvent.vue +54 -0
  147. package/src/app/components/panel/StoryEvents.vue +45 -0
  148. package/src/app/components/panel/StorySidePanel.vue +70 -0
  149. package/src/app/components/panel/StorySourceCode.vue +126 -0
  150. package/src/app/components/search/SearchItem.vue +110 -0
  151. package/src/app/components/search/SearchLoading.vue +16 -0
  152. package/src/app/components/search/SearchModal.vue +43 -0
  153. package/src/app/components/search/SearchPane.vue +293 -0
  154. package/src/app/components/search/search-docs-data.ts +10 -0
  155. package/src/app/components/search/search-title-data.ts +10 -0
  156. package/src/app/components/search/types.ts +4 -0
  157. package/src/app/components/story/GenericMountStory.vue +28 -0
  158. package/src/app/components/story/GenericRenderStory.vue +29 -0
  159. package/src/app/components/story/StoryResponsivePreview.vue +204 -0
  160. package/src/app/components/story/StoryVariantGrid.vue +112 -0
  161. package/src/app/components/story/StoryVariantGridItem.vue +110 -0
  162. package/src/app/components/story/StoryVariantListItem.vue +50 -0
  163. package/src/app/components/story/StoryVariantSingle.vue +105 -0
  164. package/src/app/components/story/StoryVariantSinglePreviewNative.vue +42 -0
  165. package/src/app/components/story/StoryVariantSinglePreviewRemote.vue +139 -0
  166. package/src/app/components/story/StoryVariantSingleView.vue +52 -0
  167. package/src/app/components/story/StoryView.vue +96 -0
  168. package/src/app/components/story/StoryViewer.vue +53 -0
  169. package/src/app/components/toolbar/StoryVariantBackground.vue +67 -0
  170. package/src/app/components/toolbar/StoryVariantNewTab.vue +29 -0
  171. package/src/app/components/toolbar/StoryVariantResponsiveSize.vue +82 -0
  172. package/src/app/components/toolbar/StoryVariantTitle.vue +21 -0
  173. package/src/app/components/tree/StoryGroup.vue +75 -0
  174. package/src/app/components/tree/StoryList.vue +35 -0
  175. package/src/app/components/tree/StoryListFolder.vue +89 -0
  176. package/src/app/components/tree/StoryListItem.vue +71 -0
  177. package/src/app/index.ts +30 -0
  178. package/src/app/router.ts +29 -0
  179. package/src/app/sandbox.ts +96 -0
  180. package/src/app/stores/events.ts +36 -0
  181. package/src/app/stores/folder.ts +59 -0
  182. package/src/app/stores/preview-settings.ts +17 -0
  183. package/src/app/stores/story.ts +47 -0
  184. package/src/app/style/floating-vue.pcss +34 -0
  185. package/src/app/style/main.pcss +86 -0
  186. package/src/app/style/sandbox.css +19 -0
  187. package/src/app/style/transitions.pcss +51 -0
  188. package/src/app/types.ts +46 -0
  189. package/src/app/util/config.ts +6 -0
  190. package/src/app/util/const.ts +4 -0
  191. package/src/app/util/dark.ts +4 -0
  192. package/src/app/util/env.ts +1 -0
  193. package/src/app/util/events.ts +30 -0
  194. package/src/app/util/keyboard.ts +99 -0
  195. package/src/app/util/mapping.ts +76 -0
  196. package/src/app/util/preview-settings.ts +8 -0
  197. package/src/app/util/responsive.ts +3 -0
  198. package/src/app/util/sandbox.ts +10 -0
  199. package/src/app/util/scroll.ts +31 -0
  200. package/src/app/util/state.ts +37 -0
  201. package/src/app/util/tooltip.ts +13 -0
  202. package/src/app/util/variant.ts +20 -0
  203. package/src/bundle-index.js +1 -0
  204. package/src/bundle-main.js +5 -0
  205. package/src/bundle-sandbox.js +2 -0
  206. package/src/index.ts +1 -0
  207. package/src/shim.d.ts +7 -0
  208. package/tailwind.config.cjs +126 -0
  209. package/tsconfig.json +54 -0
  210. package/vite.config.ts +87 -0
@@ -0,0 +1,69 @@
1
+ import { defineComponent, computed, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, mergeProps, renderSlot, createTextVNode, toDisplayString, createVNode } from "@histoire/vendors/vue";
2
+ import { Dropdown } from "@histoire/vendors/floating-vue";
3
+ import { Icon } from "@histoire/vendors/iconify";
4
+ const _hoisted_1 = { class: "htw-cursor-pointer htw-w-full htw-outline-none htw-px-2 htw-h-[27px] -htw-my-1 htw-border htw-border-solid htw-border-black/25 dark:htw-border-white/25 hover:htw-border-primary-500 dark:hover:htw-border-primary-500 htw-rounded-sm htw-flex htw-gap-2 htw-items-center htw-leading-normal" };
5
+ const _hoisted_2 = { class: "htw-flex-1 htw-truncate" };
6
+ const _hoisted_3 = { class: "htw-flex htw-flex-col htw-bg-gray-50 dark:htw-bg-gray-700" };
7
+ const _hoisted_4 = ["onClick"];
8
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
+ __name: "BaseSelect",
10
+ props: {
11
+ modelValue: null,
12
+ options: null
13
+ },
14
+ emits: ["update:modelValue", "select"],
15
+ setup(__props, { emit: emits }) {
16
+ const props = __props;
17
+ const formattedOptions = computed(() => {
18
+ if (Array.isArray(props.options)) {
19
+ return Object.fromEntries(props.options.map((value) => [value, value]));
20
+ }
21
+ return props.options;
22
+ });
23
+ const selectedLabel = computed(() => formattedOptions.value[props.modelValue]);
24
+ function selectValue(value, hide) {
25
+ emits("update:modelValue", value);
26
+ emits("select", value);
27
+ hide();
28
+ }
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createBlock(unref(Dropdown), { "auto-size": "" }, {
31
+ popper: withCtx(({ hide }) => [
32
+ createElementVNode("div", _hoisted_3, [
33
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(formattedOptions), (label, value) => {
34
+ return openBlock(), createElementBlock("div", mergeProps({ ..._ctx.$attrs, class: null, style: null }, {
35
+ key: label,
36
+ class: ["htw-px-2 htw-py-1 htw-cursor-pointer hover:htw-bg-primary-100 dark:hover:htw-bg-primary-700", {
37
+ "htw-bg-primary-200 dark:htw-bg-primary-800": props.modelValue === value
38
+ }],
39
+ onClick: ($event) => selectValue(value, hide)
40
+ }), [
41
+ renderSlot(_ctx.$slots, "option", {
42
+ label,
43
+ value
44
+ }, () => [
45
+ createTextVNode(toDisplayString(label), 1)
46
+ ])
47
+ ], 16, _hoisted_4);
48
+ }), 128))
49
+ ])
50
+ ]),
51
+ default: withCtx(() => [
52
+ createElementVNode("div", _hoisted_1, [
53
+ createElementVNode("div", _hoisted_2, [
54
+ renderSlot(_ctx.$slots, "default", { label: unref(selectedLabel) }, () => [
55
+ createTextVNode(toDisplayString(unref(selectedLabel)), 1)
56
+ ])
57
+ ]),
58
+ createVNode(unref(Icon), {
59
+ icon: "carbon:chevron-sort",
60
+ class: "htw-w-4 htw-h-4 htw-flex-none htw-ml-auto"
61
+ })
62
+ ])
63
+ ]),
64
+ _: 3
65
+ });
66
+ };
67
+ }
68
+ });
69
+ export { _sfc_main as default };
@@ -0,0 +1,184 @@
1
+ import { pushScopeId, popScopeId, defineComponent, ref, watch, computed, onUnmounted, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, unref, renderSlot, withModifiers } from "@histoire/vendors/vue";
2
+ import "./BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js";
3
+ import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
4
+ const _withScopeId = (n) => (pushScopeId("data-v-328ea07c"), n = n(), popScopeId(), n);
5
+ const _hoisted_1 = ["onMousedown"];
6
+ const _sfc_main = /* @__PURE__ */ defineComponent({
7
+ __name: "BaseSplitPane",
8
+ props: {
9
+ orientation: {
10
+ type: String,
11
+ default: "landscape",
12
+ validator: (value) => ["landscape", "portrait"].includes(value)
13
+ },
14
+ defaultSplit: {
15
+ type: Number,
16
+ default: 50
17
+ },
18
+ split: {
19
+ type: Number,
20
+ default: void 0
21
+ },
22
+ min: {
23
+ type: Number,
24
+ default: 20
25
+ },
26
+ max: {
27
+ type: Number,
28
+ default: 80
29
+ },
30
+ draggerOffset: {
31
+ type: String,
32
+ default: "center",
33
+ validator: (value) => ["before", "center", "after"].includes(value)
34
+ },
35
+ saveId: {
36
+ type: String,
37
+ default: null
38
+ },
39
+ fixed: {
40
+ type: Boolean,
41
+ default: false
42
+ }
43
+ },
44
+ emits: {
45
+ "update:split": (value) => true
46
+ },
47
+ setup(__props, { emit }) {
48
+ const props = __props;
49
+ const SAVE_PREFIX = "__histoire";
50
+ const currentSplit = ref(props.defaultSplit);
51
+ watch(() => props.split, (value) => {
52
+ if (value !== void 0) {
53
+ currentSplit.value = value;
54
+ }
55
+ }, {
56
+ immediate: true
57
+ });
58
+ if (props.saveId) {
59
+ const storageKey = `${SAVE_PREFIX}-split-pane-${props.saveId}`;
60
+ const savedValue = localStorage.getItem(storageKey);
61
+ if (savedValue != null) {
62
+ let parsedValue;
63
+ try {
64
+ parsedValue = JSON.parse(savedValue);
65
+ } catch (e) {
66
+ console.error(e);
67
+ }
68
+ if (typeof parsedValue === "number") {
69
+ currentSplit.value = parsedValue;
70
+ }
71
+ }
72
+ watch(currentSplit, (value) => {
73
+ localStorage.setItem(storageKey, JSON.stringify(value));
74
+ });
75
+ watch(currentSplit, (value) => {
76
+ if (value !== props.split) {
77
+ emit("update:split", value);
78
+ }
79
+ }, {
80
+ immediate: true
81
+ });
82
+ }
83
+ const boundSplit = computed(() => {
84
+ if (currentSplit.value < props.min) {
85
+ return props.min;
86
+ } else if (currentSplit.value > props.max) {
87
+ return props.max;
88
+ } else {
89
+ return currentSplit.value;
90
+ }
91
+ });
92
+ const leftStyle = computed(() => ({
93
+ [props.orientation === "landscape" ? "width" : "height"]: props.fixed ? `${boundSplit.value}px` : `${boundSplit.value}%`
94
+ }));
95
+ const rightStyle = computed(() => ({
96
+ [props.orientation === "landscape" ? "width" : "height"]: props.fixed ? null : `${100 - boundSplit.value}%`
97
+ }));
98
+ const dragging = ref(false);
99
+ let startPosition = 0;
100
+ let startSplit = 0;
101
+ const el = ref(null);
102
+ function dragStart(e) {
103
+ dragging.value = true;
104
+ startPosition = props.orientation === "landscape" ? e.pageX : e.pageY;
105
+ startSplit = boundSplit.value;
106
+ window.addEventListener("mousemove", dragMove);
107
+ window.addEventListener("mouseup", dragEnd);
108
+ }
109
+ function dragMove(e) {
110
+ if (dragging.value) {
111
+ let position;
112
+ let totalSize;
113
+ if (props.orientation === "landscape") {
114
+ position = e.pageX;
115
+ totalSize = el.value.offsetWidth;
116
+ } else {
117
+ position = e.pageY;
118
+ totalSize = el.value.offsetHeight;
119
+ }
120
+ const dPosition = position - startPosition;
121
+ if (props.fixed) {
122
+ currentSplit.value = startSplit + dPosition;
123
+ } else {
124
+ currentSplit.value = startSplit + ~~(dPosition / totalSize * 200) / 2;
125
+ }
126
+ }
127
+ }
128
+ function dragEnd() {
129
+ dragging.value = false;
130
+ removeDragListeners();
131
+ }
132
+ function removeDragListeners() {
133
+ window.removeEventListener("mousemove", dragMove);
134
+ window.removeEventListener("mouseup", dragEnd);
135
+ }
136
+ onUnmounted(() => {
137
+ removeDragListeners();
138
+ });
139
+ return (_ctx, _cache) => {
140
+ return openBlock(), createElementBlock("div", {
141
+ ref_key: "el",
142
+ ref: el,
143
+ class: normalizeClass(["htw-flex htw-h-full htw-isolate htw-overflow-auto", {
144
+ "htw-flex-col": __props.orientation === "portrait",
145
+ "htw-cursor-ew-resize": dragging.value && __props.orientation === "landscape",
146
+ "htw-cursor-ns-resize": dragging.value && __props.orientation === "portrait",
147
+ [__props.orientation]: true
148
+ }])
149
+ }, [
150
+ createElementVNode("div", {
151
+ class: normalizeClass(["htw-relative htw-top-0 htw-left-0 htw-z-20", {
152
+ "htw-pointer-events-none": dragging.value,
153
+ "htw-border-r htw-border-gray-200 dark:htw-border-gray-850": __props.orientation === "landscape",
154
+ "htw-flex-none": __props.fixed
155
+ }]),
156
+ style: normalizeStyle(unref(leftStyle))
157
+ }, [
158
+ renderSlot(_ctx.$slots, "first", {}, void 0, true),
159
+ createElementVNode("div", {
160
+ class: normalizeClass(["dragger htw-absolute htw-z-100 hover:htw-bg-primary-500/50 htw-transition-colors htw-duration-150 htw-delay-150", {
161
+ "htw-top-0 htw-bottom-0 htw-cursor-ew-resize": __props.orientation === "landscape",
162
+ "htw-left-0 htw-right-0 htw-cursor-ns-resize": __props.orientation === "portrait",
163
+ [`dragger-offset-${__props.draggerOffset}`]: true,
164
+ "htw-bg-primary-500/25": dragging.value
165
+ }]),
166
+ onMousedown: withModifiers(dragStart, ["prevent"])
167
+ }, null, 42, _hoisted_1)
168
+ ], 6),
169
+ createElementVNode("div", {
170
+ class: normalizeClass(["htw-relative htw-bottom-0 htw-right-0", {
171
+ "htw-pointer-events-none": dragging.value,
172
+ "htw-border-t htw-border-gray-200 dark:htw-border-gray-850": __props.orientation === "portrait",
173
+ "htw-flex-1": __props.fixed
174
+ }]),
175
+ style: normalizeStyle(unref(rightStyle))
176
+ }, [
177
+ renderSlot(_ctx.$slots, "last", {}, void 0, true)
178
+ ], 6)
179
+ ], 2);
180
+ };
181
+ }
182
+ });
183
+ var BaseSplitPane = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-328ea07c"]]);
184
+ export { BaseSplitPane as default };
@@ -0,0 +1,2 @@
1
+ var BaseSplitPane_vue_vue_type_style_index_0_scoped_true_lang = "";
2
+ export { BaseSplitPane_vue_vue_type_style_index_0_scoped_true_lang as default };
@@ -0,0 +1,45 @@
1
+ import { defineComponent, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementVNode, renderSlot, createVNode, Transition, createElementBlock, createCommentVNode } from "@histoire/vendors/vue";
2
+ import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
3
+ const _sfc_main = defineComponent({
4
+ inheritAttrs: false,
5
+ props: {
6
+ exact: {
7
+ type: Boolean,
8
+ default: false
9
+ },
10
+ matched: {
11
+ type: Boolean,
12
+ default: null
13
+ }
14
+ }
15
+ });
16
+ const _hoisted_1 = ["href", "onClick"];
17
+ const _hoisted_2 = {
18
+ key: 0,
19
+ class: "htw-absolute htw-bottom-0 htw-left-0 htw-w-full htw-h-[2px] htw-bg-primary-500 dark:htw-bg-primary-400"
20
+ };
21
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22
+ const _component_router_link = resolveComponent("router-link");
23
+ return openBlock(), createBlock(_component_router_link, mergeProps(_ctx.$attrs, { custom: "" }), {
24
+ default: withCtx(({ isActive, isExactActive, href, navigate }) => [
25
+ createElementVNode("a", mergeProps(_ctx.$attrs, {
26
+ href,
27
+ class: ["htw-px-4 htw-h-full htw-inline-flex htw-items-center hover:htw-bg-primary-50 dark:hover:htw-bg-primary-900 htw-relative htw-text-gray-900 dark:htw-text-gray-100", {
28
+ "htw-text-primary-500 dark:htw-text-primary-400": _ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive
29
+ }],
30
+ onClick: navigate
31
+ }), [
32
+ renderSlot(_ctx.$slots, "default"),
33
+ createVNode(Transition, { name: "__histoire-scale-x" }, {
34
+ default: withCtx(() => [
35
+ (_ctx.matched != null ? _ctx.matched : _ctx.exact && isExactActive || !_ctx.exact && isActive) ? (openBlock(), createElementBlock("div", _hoisted_2)) : createCommentVNode("", true)
36
+ ]),
37
+ _: 2
38
+ }, 1024)
39
+ ], 16, _hoisted_1)
40
+ ]),
41
+ _: 3
42
+ }, 16);
43
+ }
44
+ var BaseTab = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
45
+ export { BaseTab as default };
@@ -0,0 +1,41 @@
1
+ import { createElementVNode, openBlock, createElementBlock } from "@histoire/vendors/vue";
2
+ import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
3
+ const _sfc_main = {};
4
+ const _hoisted_1 = { fill: "none" };
5
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode("pattern", {
6
+ id: "checkerboard",
7
+ width: "64",
8
+ height: "64",
9
+ patternUnits: "userSpaceOnUse"
10
+ }, [
11
+ /* @__PURE__ */ createElementVNode("rect", {
12
+ x: "0",
13
+ y: "0",
14
+ width: "32",
15
+ height: "32",
16
+ fill: "currentColor"
17
+ }),
18
+ /* @__PURE__ */ createElementVNode("rect", {
19
+ x: "32",
20
+ y: "32",
21
+ width: "32",
22
+ height: "32",
23
+ fill: "currentColor"
24
+ })
25
+ ], -1);
26
+ const _hoisted_3 = /* @__PURE__ */ createElementVNode("rect", {
27
+ x: "0",
28
+ y: "0",
29
+ width: "100%",
30
+ height: "100%",
31
+ fill: "url(#checkerboard)"
32
+ }, null, -1);
33
+ const _hoisted_4 = [
34
+ _hoisted_2,
35
+ _hoisted_3
36
+ ];
37
+ function _sfc_render(_ctx, _cache) {
38
+ return openBlock(), createElementBlock("svg", _hoisted_1, _hoisted_4);
39
+ }
40
+ var CheckerboardPattern = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
41
+ export { CheckerboardPattern as default };
@@ -0,0 +1,11 @@
1
+ import { pushScopeId, popScopeId, openBlock, createElementBlock } from "@histoire/vendors/vue";
2
+ import "./HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js";
3
+ import _export_sfc from "../../_virtual/plugin-vue_export-helper.js";
4
+ const _sfc_main = {};
5
+ const _withScopeId = (n) => (pushScopeId("data-v-0bb8c4e8"), n = n(), popScopeId(), n);
6
+ const _hoisted_1 = { class: "__histoire-hatched-pattern" };
7
+ function _sfc_render(_ctx, _cache) {
8
+ return openBlock(), createElementBlock("div", _hoisted_1);
9
+ }
10
+ var HatchedPattern = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-0bb8c4e8"]]);
11
+ export { HatchedPattern as default };
@@ -0,0 +1,2 @@
1
+ var HatchedPattern_vue_vue_type_style_index_0_scoped_true_lang = "";
2
+ export { HatchedPattern_vue_vue_type_style_index_0_scoped_true_lang as default };
@@ -0,0 +1,98 @@
1
+ import { defineComponent, computed, ref, resolveDirective, unref, openBlock, createBlock, resolveDynamicComponent, isRef, withCtx, withDirectives, createCommentVNode, createVNode, normalizeClass, withModifiers } from "@histoire/vendors/vue";
2
+ import { Icon } from "@histoire/vendors/iconify";
3
+ import { HstTextarea, HstCheckbox, HstNumber, HstText } from "@histoire/controls";
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "ControlsComponentPropItem",
6
+ props: {
7
+ variant: null,
8
+ component: null,
9
+ definition: null
10
+ },
11
+ setup(__props) {
12
+ const props = __props;
13
+ const comp = computed(() => {
14
+ var _a;
15
+ switch ((_a = props.definition.types) == null ? void 0 : _a[0]) {
16
+ case "string":
17
+ return HstText;
18
+ case "number":
19
+ return HstNumber;
20
+ case "boolean":
21
+ return HstCheckbox;
22
+ case "object":
23
+ default:
24
+ return HstTextarea;
25
+ }
26
+ });
27
+ const isJSON = computed(() => comp.value === HstTextarea);
28
+ const invalidValue = ref("");
29
+ const model = computed({
30
+ get: () => {
31
+ var _a;
32
+ if (invalidValue.value) {
33
+ return invalidValue.value;
34
+ }
35
+ let val = (_a = props.variant.state._hPropState[props.component.index]) == null ? void 0 : _a[props.definition.name];
36
+ if (val && isJSON.value) {
37
+ val = JSON.stringify(val, null, 2);
38
+ }
39
+ return val;
40
+ },
41
+ set: (value) => {
42
+ invalidValue.value = "";
43
+ if (isJSON.value) {
44
+ try {
45
+ value = JSON.parse(value);
46
+ } catch (e) {
47
+ invalidValue.value = value;
48
+ return;
49
+ }
50
+ }
51
+ if (!props.variant.state._hPropState[props.component.index]) {
52
+ props.variant.state._hPropState[props.component.index] = {};
53
+ }
54
+ props.variant.state._hPropState[props.component.index][props.definition.name] = value;
55
+ }
56
+ });
57
+ function reset() {
58
+ if (props.variant.state._hPropState[props.component.index]) {
59
+ delete props.variant.state._hPropState[props.component.index][props.definition.name];
60
+ }
61
+ }
62
+ const canReset = computed(() => {
63
+ var _a, _b;
64
+ return ((_b = (_a = props.variant.state) == null ? void 0 : _a._hPropState) == null ? void 0 : _b[props.component.index]) && props.definition.name in props.variant.state._hPropState[props.component.index];
65
+ });
66
+ return (_ctx, _cache) => {
67
+ const _directive_tooltip = resolveDirective("tooltip");
68
+ return unref(comp) ? (openBlock(), createBlock(resolveDynamicComponent(unref(comp)), {
69
+ key: 0,
70
+ modelValue: unref(model),
71
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(model) ? model.value = $event : null),
72
+ title: `${__props.definition.name}${unref(canReset) ? " *" : ""}`,
73
+ placeholder: unref(isJSON) ? "Enter JSON" : null
74
+ }, {
75
+ actions: withCtx(() => [
76
+ invalidValue.value ? withDirectives((openBlock(), createBlock(unref(Icon), {
77
+ key: 0,
78
+ icon: "carbon:warning-alt",
79
+ class: "htw-text-orange-500"
80
+ }, null, 512)), [
81
+ [_directive_tooltip, "JSON error"]
82
+ ]) : createCommentVNode("", true),
83
+ withDirectives(createVNode(unref(Icon), {
84
+ icon: "carbon:erase",
85
+ class: normalizeClass(["htw-cursor-pointer htw-w-4 htw-h-4 hover:htw-text-primary-500 dark:hover:htw-text-primary-400 htw-text-gray-900 dark:htw-text-gray-100", [
86
+ unref(canReset) ? "htw-opacity-50 hover:htw-opacity-100" : "htw-opacity-25 htw-pointer-events-none"
87
+ ]]),
88
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => reset(), ["stop"]))
89
+ }, null, 8, ["class"]), [
90
+ [_directive_tooltip, "Remove override"]
91
+ ])
92
+ ]),
93
+ _: 1
94
+ }, 8, ["modelValue", "title", "placeholder"])) : createCommentVNode("", true);
95
+ };
96
+ }
97
+ });
98
+ export { _sfc_main as default };
@@ -0,0 +1,42 @@
1
+ import { createElementVNode, defineComponent, resolveDirective, openBlock, createElementBlock, withDirectives, createVNode, unref, createTextVNode, toDisplayString, Fragment, renderList, createBlock } from "@histoire/vendors/vue";
2
+ import { Icon } from "@histoire/vendors/iconify";
3
+ import _sfc_main$1 from "./ControlsComponentPropItem.js";
4
+ const _hoisted_1 = { class: "htw-font-mono htw-p-2 htw-flex htw-items-center htw-gap-1" };
5
+ const _hoisted_2 = /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-30" }, "<", -1);
6
+ const _hoisted_3 = /* @__PURE__ */ createElementVNode("span", { class: "htw-opacity-30" }, ">", -1);
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "ControlsComponentProps",
9
+ props: {
10
+ variant: null,
11
+ definition: null
12
+ },
13
+ setup(__props) {
14
+ return (_ctx, _cache) => {
15
+ const _directive_tooltip = resolveDirective("tooltip");
16
+ return openBlock(), createElementBlock("div", null, [
17
+ createElementVNode("div", _hoisted_1, [
18
+ withDirectives(createVNode(unref(Icon), {
19
+ icon: "carbon:flash",
20
+ class: "htw-w-4 htw-h-4 htw-text-primary-500 htw-flex-none"
21
+ }, null, 512), [
22
+ [_directive_tooltip, "Auto-detected props"]
23
+ ]),
24
+ createElementVNode("div", null, [
25
+ _hoisted_2,
26
+ createTextVNode(toDisplayString(__props.definition.name), 1),
27
+ _hoisted_3
28
+ ])
29
+ ]),
30
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.definition.props, (prop) => {
31
+ return openBlock(), createBlock(_sfc_main$1, {
32
+ key: prop.name,
33
+ variant: __props.variant,
34
+ component: __props.definition,
35
+ definition: prop
36
+ }, null, 8, ["variant", "component", "definition"]);
37
+ }), 128))
38
+ ]);
39
+ };
40
+ }
41
+ });
42
+ export { _sfc_main as default };
@@ -0,0 +1,112 @@
1
+ import { createTextVNode, defineComponent, toRefs, computed, openBlock, createBlock, withCtx, createVNode, normalizeClass, unref, createElementBlock, toDisplayString, createCommentVNode } from "@histoire/vendors/vue";
2
+ import BaseTab from "../base/BaseTab.js";
3
+ import { useEventsStore } from "../../stores/events.js";
4
+ import _sfc_main$1 from "../base/BaseOverflowMenu.js";
5
+ import BaseOverflowTab from "../base/BaseOverflowTab.js";
6
+ import { useStoryDoc } from "./StoryDocs.js";
7
+ const _hoisted_1 = /* @__PURE__ */ createTextVNode(" Controls ");
8
+ const _hoisted_2 = /* @__PURE__ */ createTextVNode(" Docs ");
9
+ const _hoisted_3 = /* @__PURE__ */ createTextVNode(" Events ");
10
+ const _hoisted_4 = {
11
+ key: 0,
12
+ class: "htw-text-center htw-text-xs htw-mx-1 htw-px-0.5 htw-h-4 htw-min-w-4 htw-rounded-full active htw-bg-primary-500 htw-text-white dark:htw-text-black"
13
+ };
14
+ const _hoisted_5 = /* @__PURE__ */ createTextVNode(" Controls ");
15
+ const _hoisted_6 = /* @__PURE__ */ createTextVNode(" Docs ");
16
+ const _hoisted_7 = /* @__PURE__ */ createTextVNode(" Events ");
17
+ const _hoisted_8 = {
18
+ key: 0,
19
+ class: "htw-text-center htw-text-xs htw-mx-1 htw-px-0.5 htw-h-4 htw-min-w-4 htw-rounded-full active htw-bg-primary-500 htw-text-white dark:htw-text-black"
20
+ };
21
+ const _sfc_main = /* @__PURE__ */ defineComponent({
22
+ __name: "PaneTabs",
23
+ props: {
24
+ story: null,
25
+ variant: null
26
+ },
27
+ setup(__props) {
28
+ const props = __props;
29
+ const { story } = toRefs(props);
30
+ const { renderedDoc } = useStoryDoc(story);
31
+ const eventsStore = useEventsStore();
32
+ const hasEvents = computed(() => eventsStore.events.length);
33
+ return (_ctx, _cache) => {
34
+ return openBlock(), createBlock(_sfc_main$1, { class: "htw-h-10 htw-flex-none htw-border-b htw-border-gray-100 dark:htw-border-gray-750" }, {
35
+ overflow: withCtx(() => [
36
+ createVNode(BaseOverflowTab, {
37
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "" } },
38
+ matched: !_ctx.$route.query.tab
39
+ }, {
40
+ default: withCtx(() => [
41
+ _hoisted_5
42
+ ]),
43
+ _: 1
44
+ }, 8, ["to", "matched"]),
45
+ createVNode(BaseOverflowTab, {
46
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "docs" } },
47
+ matched: _ctx.$route.query.tab === "docs",
48
+ class: normalizeClass({
49
+ "opacity-50": !unref(renderedDoc)
50
+ })
51
+ }, {
52
+ default: withCtx(() => [
53
+ _hoisted_6
54
+ ]),
55
+ _: 1
56
+ }, 8, ["to", "matched", "class"]),
57
+ createVNode(BaseOverflowTab, {
58
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "events" } },
59
+ matched: _ctx.$route.query.tab === "events",
60
+ class: normalizeClass({
61
+ "htw-opacity-50": !unref(hasEvents)
62
+ })
63
+ }, {
64
+ default: withCtx(() => [
65
+ _hoisted_7,
66
+ unref(eventsStore).unseen ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(unref(eventsStore).unseen <= 99 ? unref(eventsStore).unseen : "99+"), 1)) : createCommentVNode("", true)
67
+ ]),
68
+ _: 1
69
+ }, 8, ["to", "matched", "class"])
70
+ ]),
71
+ default: withCtx(() => [
72
+ createVNode(BaseTab, {
73
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "" } },
74
+ matched: !_ctx.$route.query.tab
75
+ }, {
76
+ default: withCtx(() => [
77
+ _hoisted_1
78
+ ]),
79
+ _: 1
80
+ }, 8, ["to", "matched"]),
81
+ createVNode(BaseTab, {
82
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "docs" } },
83
+ matched: _ctx.$route.query.tab === "docs",
84
+ class: normalizeClass({
85
+ "htw-opacity-50": !unref(renderedDoc)
86
+ })
87
+ }, {
88
+ default: withCtx(() => [
89
+ _hoisted_2
90
+ ]),
91
+ _: 1
92
+ }, 8, ["to", "matched", "class"]),
93
+ createVNode(BaseTab, {
94
+ to: { ..._ctx.$route, query: { ..._ctx.$route.query, tab: "events" } },
95
+ matched: _ctx.$route.query.tab === "events",
96
+ class: normalizeClass({
97
+ "htw-opacity-50": !unref(hasEvents)
98
+ })
99
+ }, {
100
+ default: withCtx(() => [
101
+ _hoisted_3,
102
+ unref(eventsStore).unseen ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(eventsStore).unseen <= 99 ? unref(eventsStore).unseen : "99+"), 1)) : createCommentVNode("", true)
103
+ ]),
104
+ _: 1
105
+ }, 8, ["to", "matched", "class"])
106
+ ]),
107
+ _: 1
108
+ });
109
+ };
110
+ }
111
+ });
112
+ export { _sfc_main as default };