histoire 0.8.4 → 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/client.d.ts +1 -3
  2. package/client.js +1 -0
  3. package/dist/node/alias.d.ts +0 -1
  4. package/dist/node/alias.js +5 -6
  5. package/dist/node/bin.js +1 -0
  6. package/dist/node/build.js +13 -1
  7. package/dist/node/builtin-plugins/tailwind-tokens.js +391 -377
  8. package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts +14 -0
  9. package/dist/node/builtin-plugins/vanilla-support/MountStory.js +39 -0
  10. package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts +38 -0
  11. package/dist/node/builtin-plugins/vanilla-support/RenderStory.js +131 -0
  12. package/dist/node/builtin-plugins/vanilla-support/client.d.ts +3 -0
  13. package/dist/node/builtin-plugins/vanilla-support/client.js +5 -0
  14. package/dist/node/builtin-plugins/vanilla-support/collect.d.ts +2 -0
  15. package/dist/node/builtin-plugins/vanilla-support/collect.js +33 -0
  16. package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts +2 -0
  17. package/dist/node/builtin-plugins/vanilla-support/plugin.js +29 -0
  18. package/dist/node/builtin-plugins/vanilla-support/types.d.ts +35 -0
  19. package/dist/node/builtin-plugins/vanilla-support/types.js +3 -0
  20. package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts +3 -0
  21. package/dist/node/builtin-plugins/vanilla-support/vanilla.story.js +55 -0
  22. package/dist/node/collect/run.js +4 -6
  23. package/dist/node/config.d.ts +9 -0
  24. package/dist/node/config.js +16 -0
  25. package/dist/node/context.d.ts +3 -7
  26. package/dist/node/context.js +2 -0
  27. package/dist/node/plugin.d.ts +5 -1
  28. package/dist/node/server.js +1 -1
  29. package/dist/node/stories.js +15 -1
  30. package/dist/node/vite.d.ts +4 -0
  31. package/dist/node/vite.js +47 -16
  32. package/package.json +11 -21
  33. package/src/node/alias.ts +5 -6
  34. package/src/node/bin.ts +1 -0
  35. package/src/node/build.ts +13 -1
  36. package/src/node/builtin-plugins/tailwind-tokens.ts +394 -377
  37. package/src/node/builtin-plugins/vanilla-support/MountStory.ts +50 -0
  38. package/src/node/builtin-plugins/vanilla-support/RenderStory.ts +166 -0
  39. package/src/node/builtin-plugins/vanilla-support/client.ts +6 -0
  40. package/src/node/builtin-plugins/vanilla-support/collect.ts +42 -0
  41. package/src/node/builtin-plugins/vanilla-support/plugin.ts +35 -0
  42. package/src/node/builtin-plugins/vanilla-support/types.ts +40 -0
  43. package/src/node/builtin-plugins/vanilla-support/vanilla.story.ts +63 -0
  44. package/src/node/collect/run.ts +4 -8
  45. package/src/node/config.ts +26 -0
  46. package/src/node/context.ts +7 -2
  47. package/src/node/plugin.ts +5 -1
  48. package/src/node/server.ts +2 -2
  49. package/src/node/stories.ts +18 -1
  50. package/src/node/vite.ts +56 -16
  51. package/tsconfig.json +2 -11
  52. package/dist/bundled/App.js +0 -166
  53. package/dist/bundled/_virtual/plugin-vue_export-helper.js +0 -8
  54. package/dist/bundled/api.js +0 -1
  55. package/dist/bundled/assets/histoire-text-dark.js +0 -2
  56. package/dist/bundled/assets/histoire-text.js +0 -2
  57. package/dist/bundled/assets/histoire.js +0 -2
  58. package/dist/bundled/components/HomeView.js +0 -24
  59. package/dist/bundled/components/app/AppHeader.js +0 -67
  60. package/dist/bundled/components/app/AppLogo.js +0 -26
  61. package/dist/bundled/components/app/Breadcrumb.js +0 -95
  62. package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  63. package/dist/bundled/components/app/InitialLoading.js +0 -48
  64. package/dist/bundled/components/app/MobileOverlay.js +0 -41
  65. package/dist/bundled/components/base/BaseCheckbox.js +0 -75
  66. package/dist/bundled/components/base/BaseEmpty.js +0 -13
  67. package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  68. package/dist/bundled/components/base/BaseListItemLink.js +0 -50
  69. package/dist/bundled/components/base/BaseOverflowMenu.js +0 -97
  70. package/dist/bundled/components/base/BaseOverflowTab.js +0 -45
  71. package/dist/bundled/components/base/BaseSelect.js +0 -88
  72. package/dist/bundled/components/base/BaseSplitPane.js +0 -184
  73. package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  74. package/dist/bundled/components/base/BaseTab.js +0 -45
  75. package/dist/bundled/components/misc/CheckerboardPattern.js +0 -41
  76. package/dist/bundled/components/misc/HatchedPattern.js +0 -11
  77. package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  78. package/dist/bundled/components/panel/ControlsComponentPropItem.js +0 -98
  79. package/dist/bundled/components/panel/ControlsComponentProps.js +0 -42
  80. package/dist/bundled/components/panel/PaneTabs.js +0 -131
  81. package/dist/bundled/components/panel/StatePresets.js +0 -184
  82. package/dist/bundled/components/panel/StoryControls.js +0 -66
  83. package/dist/bundled/components/panel/StoryDocs.js +0 -58
  84. package/dist/bundled/components/panel/StoryEvent.js +0 -56
  85. package/dist/bundled/components/panel/StoryEvents.js +0 -49
  86. package/dist/bundled/components/panel/StorySidePanel.js +0 -71
  87. package/dist/bundled/components/panel/StorySourceCode.js +0 -110
  88. package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  89. package/dist/bundled/components/search/SearchItem.js +0 -113
  90. package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  91. package/dist/bundled/components/search/SearchLoading.js +0 -19
  92. package/dist/bundled/components/search/SearchModal.js +0 -46
  93. package/dist/bundled/components/search/SearchPane.js +0 -263
  94. package/dist/bundled/components/search/search-docs-data.js +0 -7
  95. package/dist/bundled/components/search/search-title-data.js +0 -7
  96. package/dist/bundled/components/story/StoryResponsivePreview.js +0 -180
  97. package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  98. package/dist/bundled/components/story/StoryVariantGrid.js +0 -94
  99. package/dist/bundled/components/story/StoryVariantGridItem.js +0 -106
  100. package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  101. package/dist/bundled/components/story/StoryVariantListItem.js +0 -58
  102. package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  103. package/dist/bundled/components/story/StoryVariantSingle.js +0 -115
  104. package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  105. package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +0 -43
  106. package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +0 -119
  107. package/dist/bundled/components/story/StoryVariantSingleView.js +0 -49
  108. package/dist/bundled/components/story/StoryView.js +0 -107
  109. package/dist/bundled/components/story/StoryViewer.js +0 -57
  110. package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  111. package/dist/bundled/components/toolbar/StoryVariantBackground.js +0 -85
  112. package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  113. package/dist/bundled/components/toolbar/StoryVariantNewTab.js +0 -33
  114. package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +0 -129
  115. package/dist/bundled/components/toolbar/StoryVariantTitle.js +0 -24
  116. package/dist/bundled/components/tree/StoryGroup.js +0 -74
  117. package/dist/bundled/components/tree/StoryList.js +0 -37
  118. package/dist/bundled/components/tree/StoryListFolder.js +0 -89
  119. package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  120. package/dist/bundled/components/tree/StoryListItem.js +0 -72
  121. package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
  122. package/dist/bundled/index.js +0 -29
  123. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +0 -40
  124. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +0 -5
  125. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +0 -11
  126. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +0 -26
  127. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +0 -10
  128. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +0 -50
  129. package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +0 -8
  130. package/dist/bundled/router.js +0 -28
  131. package/dist/bundled/sandbox.js +0 -87
  132. package/dist/bundled/stores/events.js +0 -29
  133. package/dist/bundled/stores/folder.js +0 -46
  134. package/dist/bundled/stores/preview-settings.js +0 -15
  135. package/dist/bundled/stores/story.js +0 -43
  136. package/dist/bundled/style.css +0 -102
  137. package/dist/bundled/util/config.js +0 -4
  138. package/dist/bundled/util/const.js +0 -5
  139. package/dist/bundled/util/dark.js +0 -4
  140. package/dist/bundled/util/env.js +0 -2
  141. package/dist/bundled/util/events.js +0 -32
  142. package/dist/bundled/util/keyboard.js +0 -84
  143. package/dist/bundled/util/mapping.js +0 -94
  144. package/dist/bundled/util/preview-settings.js +0 -6
  145. package/dist/bundled/util/responsive.js +0 -3
  146. package/dist/bundled/util/sandbox.js +0 -8
  147. package/dist/bundled/util/scroll.js +0 -28
  148. package/dist/bundled/util/state.js +0 -31
  149. package/dist/bundled/util/tooltip.js +0 -12
  150. package/dist/bundled/util/variant.js +0 -35
  151. package/dist/client/app/App.vue +0 -162
  152. package/dist/client/app/api.d.ts +0 -1
  153. package/dist/client/app/api.js +0 -1
  154. package/dist/client/app/assets/histoire-text-dark.svg +0 -89
  155. package/dist/client/app/assets/histoire-text.svg +0 -89
  156. package/dist/client/app/assets/histoire.svg +0 -51
  157. package/dist/client/app/components/HomeView.vue +0 -17
  158. package/dist/client/app/components/app/AppHeader.vue +0 -64
  159. package/dist/client/app/components/app/AppLogo.vue +0 -24
  160. package/dist/client/app/components/app/Breadcrumb.vue +0 -98
  161. package/dist/client/app/components/app/InitialLoading.vue +0 -44
  162. package/dist/client/app/components/app/MobileOverlay.vue +0 -33
  163. package/dist/client/app/components/base/BaseCheckbox.vue +0 -77
  164. package/dist/client/app/components/base/BaseCopyIcon.vue +0 -34
  165. package/dist/client/app/components/base/BaseEmpty.vue +0 -21
  166. package/dist/client/app/components/base/BaseListItemLink.vue +0 -55
  167. package/dist/client/app/components/base/BaseOverflowMenu.vue +0 -119
  168. package/dist/client/app/components/base/BaseOverflowTab.vue +0 -46
  169. package/dist/client/app/components/base/BaseSelect.vue +0 -72
  170. package/dist/client/app/components/base/BaseSplitPane.vue +0 -240
  171. package/dist/client/app/components/base/BaseTab.vue +0 -46
  172. package/dist/client/app/components/misc/CheckerboardPattern.vue +0 -32
  173. package/dist/client/app/components/misc/HatchedPattern.vue +0 -13
  174. package/dist/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
  175. package/dist/client/app/components/panel/ControlsComponentProps.vue +0 -34
  176. package/dist/client/app/components/panel/PaneTabs.vue +0 -89
  177. package/dist/client/app/components/panel/StatePresets.vue +0 -196
  178. package/dist/client/app/components/panel/StoryControls.vue +0 -68
  179. package/dist/client/app/components/panel/StoryDocs.vue +0 -61
  180. package/dist/client/app/components/panel/StoryEvent.vue +0 -54
  181. package/dist/client/app/components/panel/StoryEvents.vue +0 -45
  182. package/dist/client/app/components/panel/StorySidePanel.vue +0 -69
  183. package/dist/client/app/components/panel/StorySourceCode.vue +0 -116
  184. package/dist/client/app/components/search/SearchItem.vue +0 -110
  185. package/dist/client/app/components/search/SearchLoading.vue +0 -16
  186. package/dist/client/app/components/search/SearchModal.vue +0 -43
  187. package/dist/client/app/components/search/SearchPane.vue +0 -293
  188. package/dist/client/app/components/search/search-docs-data.d.ts +0 -3
  189. package/dist/client/app/components/search/search-docs-data.js +0 -7
  190. package/dist/client/app/components/search/search-title-data.d.ts +0 -3
  191. package/dist/client/app/components/search/search-title-data.js +0 -7
  192. package/dist/client/app/components/search/types.d.ts +0 -7
  193. package/dist/client/app/components/search/types.js +0 -1
  194. package/dist/client/app/components/story/StoryResponsivePreview.vue +0 -204
  195. package/dist/client/app/components/story/StoryVariantGrid.vue +0 -112
  196. package/dist/client/app/components/story/StoryVariantGridItem.vue +0 -110
  197. package/dist/client/app/components/story/StoryVariantListItem.vue +0 -50
  198. package/dist/client/app/components/story/StoryVariantSingle.vue +0 -105
  199. package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
  200. package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
  201. package/dist/client/app/components/story/StoryVariantSingleView.vue +0 -52
  202. package/dist/client/app/components/story/StoryView.vue +0 -96
  203. package/dist/client/app/components/story/StoryViewer.vue +0 -53
  204. package/dist/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
  205. package/dist/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
  206. package/dist/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
  207. package/dist/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
  208. package/dist/client/app/components/tree/StoryGroup.vue +0 -75
  209. package/dist/client/app/components/tree/StoryList.vue +0 -35
  210. package/dist/client/app/components/tree/StoryListFolder.vue +0 -89
  211. package/dist/client/app/components/tree/StoryListItem.vue +0 -71
  212. package/dist/client/app/index.d.ts +0 -2
  213. package/dist/client/app/index.js +0 -28
  214. package/dist/client/app/router.d.ts +0 -2
  215. package/dist/client/app/router.js +0 -26
  216. package/dist/client/app/sandbox.d.ts +0 -1
  217. package/dist/client/app/sandbox.js +0 -87
  218. package/dist/client/app/stores/events.d.ts +0 -29
  219. package/dist/client/app/stores/events.js +0 -25
  220. package/dist/client/app/stores/folder.d.ts +0 -10
  221. package/dist/client/app/stores/folder.js +0 -47
  222. package/dist/client/app/stores/preview-settings.d.ts +0 -8
  223. package/dist/client/app/stores/preview-settings.js +0 -14
  224. package/dist/client/app/stores/story.d.ts +0 -362
  225. package/dist/client/app/stores/story.js +0 -39
  226. package/dist/client/app/style/floating-vue.pcss +0 -34
  227. package/dist/client/app/style/main.pcss +0 -86
  228. package/dist/client/app/style/sandbox.css +0 -19
  229. package/dist/client/app/style/transitions.pcss +0 -51
  230. package/dist/client/app/types.d.ts +0 -34
  231. package/dist/client/app/types.js +0 -1
  232. package/dist/client/app/util/config.d.ts +0 -3
  233. package/dist/client/app/util/config.js +0 -4
  234. package/dist/client/app/util/const.d.ts +0 -4
  235. package/dist/client/app/util/const.js +0 -4
  236. package/dist/client/app/util/dark.d.ts +0 -2
  237. package/dist/client/app/util/dark.js +0 -3
  238. package/dist/client/app/util/env.d.ts +0 -1
  239. package/dist/client/app/util/env.js +0 -1
  240. package/dist/client/app/util/events.d.ts +0 -1
  241. package/dist/client/app/util/events.js +0 -31
  242. package/dist/client/app/util/keyboard.d.ts +0 -8
  243. package/dist/client/app/util/keyboard.js +0 -82
  244. package/dist/client/app/util/mapping.d.ts +0 -3
  245. package/dist/client/app/util/mapping.js +0 -85
  246. package/dist/client/app/util/preview-settings.d.ts +0 -9
  247. package/dist/client/app/util/preview-settings.js +0 -5
  248. package/dist/client/app/util/responsive.d.ts +0 -1
  249. package/dist/client/app/util/responsive.js +0 -2
  250. package/dist/client/app/util/sandbox.d.ts +0 -2
  251. package/dist/client/app/util/sandbox.js +0 -7
  252. package/dist/client/app/util/scroll.d.ts +0 -4
  253. package/dist/client/app/util/scroll.js +0 -27
  254. package/dist/client/app/util/state.d.ts +0 -1
  255. package/dist/client/app/util/state.js +0 -31
  256. package/dist/client/app/util/tooltip.d.ts +0 -6
  257. package/dist/client/app/util/tooltip.js +0 -11
  258. package/dist/client/app/util/variant.d.ts +0 -18
  259. package/dist/client/app/util/variant.js +0 -17
  260. package/dist/client/bundle-index.js +0 -5
  261. package/dist/client/bundle-main.js +0 -5
  262. package/dist/client/bundle-sandbox.js +0 -2
  263. package/dist/client/index.d.ts +0 -9
  264. package/dist/client/index.js +0 -4
  265. package/dist/style.css +0 -2382
  266. package/postcss.config.cjs +0 -8
  267. package/scripts/copy.mjs +0 -12
  268. package/scripts/watchAndCopy.mjs +0 -15
  269. package/src/client/app/App.vue +0 -162
  270. package/src/client/app/api.ts +0 -1
  271. package/src/client/app/assets/histoire-text-dark.svg +0 -89
  272. package/src/client/app/assets/histoire-text.svg +0 -89
  273. package/src/client/app/assets/histoire.svg +0 -51
  274. package/src/client/app/components/HomeView.vue +0 -17
  275. package/src/client/app/components/app/AppHeader.vue +0 -64
  276. package/src/client/app/components/app/AppLogo.vue +0 -24
  277. package/src/client/app/components/app/Breadcrumb.vue +0 -98
  278. package/src/client/app/components/app/InitialLoading.vue +0 -44
  279. package/src/client/app/components/app/MobileOverlay.vue +0 -33
  280. package/src/client/app/components/base/BaseCheckbox.vue +0 -77
  281. package/src/client/app/components/base/BaseCopyIcon.vue +0 -34
  282. package/src/client/app/components/base/BaseEmpty.vue +0 -21
  283. package/src/client/app/components/base/BaseListItemLink.vue +0 -55
  284. package/src/client/app/components/base/BaseOverflowMenu.vue +0 -119
  285. package/src/client/app/components/base/BaseOverflowTab.vue +0 -46
  286. package/src/client/app/components/base/BaseSelect.vue +0 -72
  287. package/src/client/app/components/base/BaseSplitPane.vue +0 -240
  288. package/src/client/app/components/base/BaseTab.vue +0 -46
  289. package/src/client/app/components/misc/CheckerboardPattern.vue +0 -32
  290. package/src/client/app/components/misc/HatchedPattern.vue +0 -13
  291. package/src/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
  292. package/src/client/app/components/panel/ControlsComponentProps.vue +0 -34
  293. package/src/client/app/components/panel/PaneTabs.vue +0 -89
  294. package/src/client/app/components/panel/StatePresets.vue +0 -196
  295. package/src/client/app/components/panel/StoryControls.vue +0 -68
  296. package/src/client/app/components/panel/StoryDocs.vue +0 -61
  297. package/src/client/app/components/panel/StoryEvent.vue +0 -54
  298. package/src/client/app/components/panel/StoryEvents.vue +0 -45
  299. package/src/client/app/components/panel/StorySidePanel.vue +0 -69
  300. package/src/client/app/components/panel/StorySourceCode.vue +0 -116
  301. package/src/client/app/components/search/SearchItem.vue +0 -110
  302. package/src/client/app/components/search/SearchLoading.vue +0 -16
  303. package/src/client/app/components/search/SearchModal.vue +0 -43
  304. package/src/client/app/components/search/SearchPane.vue +0 -293
  305. package/src/client/app/components/search/search-docs-data.ts +0 -10
  306. package/src/client/app/components/search/search-title-data.ts +0 -10
  307. package/src/client/app/components/search/types.ts +0 -4
  308. package/src/client/app/components/story/StoryResponsivePreview.vue +0 -204
  309. package/src/client/app/components/story/StoryVariantGrid.vue +0 -112
  310. package/src/client/app/components/story/StoryVariantGridItem.vue +0 -110
  311. package/src/client/app/components/story/StoryVariantListItem.vue +0 -50
  312. package/src/client/app/components/story/StoryVariantSingle.vue +0 -105
  313. package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
  314. package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
  315. package/src/client/app/components/story/StoryVariantSingleView.vue +0 -52
  316. package/src/client/app/components/story/StoryView.vue +0 -96
  317. package/src/client/app/components/story/StoryViewer.vue +0 -53
  318. package/src/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
  319. package/src/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
  320. package/src/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
  321. package/src/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
  322. package/src/client/app/components/tree/StoryGroup.vue +0 -75
  323. package/src/client/app/components/tree/StoryList.vue +0 -35
  324. package/src/client/app/components/tree/StoryListFolder.vue +0 -89
  325. package/src/client/app/components/tree/StoryListItem.vue +0 -71
  326. package/src/client/app/index.ts +0 -30
  327. package/src/client/app/router.ts +0 -29
  328. package/src/client/app/sandbox.ts +0 -95
  329. package/src/client/app/stores/events.ts +0 -36
  330. package/src/client/app/stores/folder.ts +0 -59
  331. package/src/client/app/stores/preview-settings.ts +0 -17
  332. package/src/client/app/stores/story.ts +0 -47
  333. package/src/client/app/style/floating-vue.pcss +0 -34
  334. package/src/client/app/style/main.pcss +0 -86
  335. package/src/client/app/style/sandbox.css +0 -19
  336. package/src/client/app/style/transitions.pcss +0 -51
  337. package/src/client/app/types.ts +0 -46
  338. package/src/client/app/util/config.ts +0 -6
  339. package/src/client/app/util/const.ts +0 -4
  340. package/src/client/app/util/dark.ts +0 -4
  341. package/src/client/app/util/env.ts +0 -1
  342. package/src/client/app/util/events.ts +0 -30
  343. package/src/client/app/util/keyboard.ts +0 -99
  344. package/src/client/app/util/mapping.ts +0 -91
  345. package/src/client/app/util/preview-settings.ts +0 -8
  346. package/src/client/app/util/responsive.ts +0 -3
  347. package/src/client/app/util/sandbox.ts +0 -10
  348. package/src/client/app/util/scroll.ts +0 -31
  349. package/src/client/app/util/state.ts +0 -37
  350. package/src/client/app/util/tooltip.ts +0 -13
  351. package/src/client/app/util/variant.ts +0 -20
  352. package/src/client/bundle-index.js +0 -5
  353. package/src/client/bundle-main.js +0 -5
  354. package/src/client/bundle-sandbox.js +0 -2
  355. package/src/client/index.ts +0 -13
  356. package/src/client/shim.d.ts +0 -7
  357. package/tailwind.config.cjs +0 -126
  358. package/vite.config.ts +0 -87
  359. package/vue.d.ts +0 -1
@@ -1,4 +1,9 @@
1
+ import { createRequire } from 'module';
1
2
  import { findUp } from '../util/find-up.js';
3
+ const require = createRequire(import.meta.url);
4
+ function resolveImport(request) {
5
+ return JSON.stringify(require.resolve(request));
6
+ }
2
7
  export function tailwindTokens(options = {}) {
3
8
  const tailwindConfigFile = options.configFile ?? findUp(process.cwd(), [
4
9
  'tailwind.config.js',
@@ -15,10 +20,11 @@ export function tailwindTokens(options = {}) {
15
20
  await api.fs.ensureDir(api.pluginTempDir);
16
21
  await api.fs.emptyDir(api.pluginTempDir);
17
22
  api.moduleLoader.clearCache();
23
+ await api.fs.writeFile(api.path.resolve(api.pluginTempDir, 'style.css'), css);
18
24
  const tailwindConfig = await api.moduleLoader.loadModule(tailwindConfigFile);
19
25
  const { default: resolveConfig } = await import('tailwindcss/resolveConfig.js');
20
26
  const resolvedTailwindConfig = resolveConfig(tailwindConfig);
21
- const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.vue');
27
+ const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.js');
22
28
  await api.fs.writeFile(storyFile, storyTemplate(resolvedTailwindConfig));
23
29
  api.addStoryFile(storyFile);
24
30
  }
@@ -27,7 +33,7 @@ export function tailwindTokens(options = {}) {
27
33
  }
28
34
  }
29
35
  return {
30
- name: 'tailwind-tokens',
36
+ name: 'builtin:tailwind-tokens',
31
37
  config(config) {
32
38
  if (tailwindConfigFile) {
33
39
  // Add 'design-system' group
@@ -69,442 +75,450 @@ export function tailwindTokens(options = {}) {
69
75
  },
70
76
  };
71
77
  }
72
- const storyTemplate = (tailwindConfig) => `<script setup>
73
- import 'histoire/dist/style.css'
74
- import { ref } from 'vue'
75
- const config = ${JSON.stringify(tailwindConfig, null, 2)}
78
+ const storyTemplate = (tailwindConfig) => `import 'histoire-style'
79
+ import './style.css'
80
+ import { createApp, h, markRaw, ref } from ${resolveImport('@histoire/vendors/vue')}
81
+ import {
82
+ HstColorShades,
83
+ HstTokenList,
84
+ HstTokenGrid,
85
+ HstText,
86
+ HstTextarea,
87
+ HstNumber,
88
+ } from ${resolveImport('@histoire/controls')}
89
+
90
+ const config = markRaw(${JSON.stringify(tailwindConfig, null, 2)})
76
91
  const search = ref('')
77
92
  const sampleText = ref('Cat sit like bread eat prawns daintily with a claw then lick paws clean wash down prawns with a lap of carnation milk then retire to the warmest spot on the couch to claw at the fabric before taking a catnap mrow cat cat moo moo lick ears lick paws')
78
93
  const fontSize = ref(16)
79
- defineExpose({
80
- search,
81
- sampleText,
82
- fontSize,
83
- })
84
- </script>
85
- <template>
86
- <Story id="tailwind" title="Tailwind" group="design-system" icon="mdi:tailwind" responsiveDisabled :layout="{ type: 'single', iframe: false }">
87
- <Variant id="background-color" title="Background Color" icon="carbon:color-palette">
88
- <HstColorShades
89
- v-for="(shades, key) of config.theme.backgroundColor"
90
- :key="key"
91
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
92
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`bg-\${key}\` : \`bg-\${key}-\${shade}\`)"
93
- :search="search"
94
- >
95
- <template #default="{ color }">
96
- <div
97
- class="shade"
98
- :style="{
99
- backgroundColor: color,
100
- }"
101
- />
102
- </template>
103
- </HstColorShades>
104
- <template #controls>
105
- <HstText
106
- v-model="search"
107
- title="Filter..."
108
- />
109
- </template>
110
- </Variant>
111
- <Variant id="text-color" title="Text Color" icon="carbon:text-color">
112
- <HstColorShades
113
- v-for="(shades, key) of config.theme.textColor"
114
- :key="key"
115
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
116
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`text-\${key}\` : \`text-\${key}-\${shade}\`)"
117
- :search="search"
118
- >
119
- <template #default="{ color }">
120
- <div
121
- class="shade text"
122
- :style="{
123
- color: color,
124
- }"
125
- >
126
- Aa
127
- </div>
128
- </template>
129
- </HstColorShades>
130
- <template #controls>
131
- <HstText
132
- v-model="search"
133
- title="Filter..."
134
- />
135
- </template>
136
- </Variant>
137
- <Variant id="border-color" title="Border Color" icon="carbon:color-palette">
138
- <HstColorShades
139
- v-for="(shades, key) of config.theme.borderColor"
140
- :key="key"
141
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
142
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`border-\${key}\` : \`border-\${key}-\${shade}\`)"
143
- :search="search"
144
- >
145
- <template #default="{ color }">
146
- <div
147
- class="shade border"
148
- :style="{
149
- borderColor: color,
150
- }"
151
- />
152
- </template>
153
- </HstColorShades>
154
- <template #controls>
155
- <HstText
156
- v-model="search"
157
- title="Filter..."
158
- />
159
- </template>
160
- </Variant>
161
- <Variant id="padding" title="Padding" icon="carbon:area">
162
- <HstTokenList
163
- :tokens="config.theme.padding"
164
- :get-name="key => \`\${config.prefix ?? ''}p-\${key}\`"
165
- >
166
- <template #default="{ token }">
167
- <div class="padding"
168
- :style="{
169
- padding: token.value,
170
- }"
171
- >
172
- <div
173
- class="padding-box"
174
- />
175
- </div>
176
- </template>
177
- </HstTokenList>
178
- </Variant>
179
- <Variant id="margin" title="Margin" icon="carbon:area">
180
- <HstTokenList
181
- :tokens="config.theme.margin"
182
- :get-name="key => \`\${config.prefix ?? ''}m-\${key}\`"
183
- >
184
- <template #default="{ token }">
185
- <div class="margin"
186
- :style="{
187
- padding: token.value,
188
- }"
189
- >
190
- <div
191
- class="margin-box"
192
- />
193
- </div>
194
- </template>
195
- </HstTokenList>
196
- </Variant>
197
- <Variant id="font-size" title="Font Size" icon="carbon:text-font">
198
- <HstTokenList
199
- :tokens="config.theme.fontSize"
200
- :get-name="key => \`\${config.prefix ?? ''}text-\${key}\`"
201
- >
202
- <template #default="{ token }">
203
- <div
204
- class="truncate"
205
- :style="{
206
- fontSize: token.value[0],
207
- ...token.value[1],
208
- }"
209
- >
210
- {{ sampleText }}
211
- </div>
212
- </template>
213
- </HstTokenList>
214
- <template #controls>
215
- <HstTextarea
216
- v-model="sampleText"
217
- title="Sample text"
218
- rows="5"
219
- />
220
- </template>
221
- </Variant>
222
- <Variant id="font-weight" title="Font Weight" icon="carbon:text-font">
223
- <HstTokenList
224
- :tokens="config.theme.fontWeight"
225
- :get-name="key => \`\${config.prefix ?? ''}font-\${key}\`"
226
- >
227
- <template #default="{ token }">
228
- <div
229
- class="truncate"
230
- :style="{
231
- fontWeight: token.value,
232
- fontSize: \`\${fontSize}px\`,
233
- }"
234
- >
235
- {{ sampleText }}
236
- </div>
237
- </template>
238
- </HstTokenList>
239
- <template #controls>
240
- <HstTextarea
241
- v-model="sampleText"
242
- title="Sample text"
243
- rows="5"
244
- />
245
- <HstNumber
246
- v-model="fontSize"
247
- title="Font size"
248
- min="1"
249
- />
250
- </template>
251
- </Variant>
252
- <Variant id="font-family" title="Font Family" icon="carbon:text-font">
253
- <HstTokenList
254
- :tokens="config.theme.fontFamily"
255
- :get-name="key => \`\${config.prefix ?? ''}font-\${key}\`"
256
- >
257
- <template #default="{ token }">
258
- <div
259
- class="truncate"
260
- :style="{
261
- fontFamily: token.value,
262
- fontSize: \`\${fontSize}px\`,
263
- }"
264
- >
265
- {{ sampleText }}
266
- </div>
267
- </template>
268
- </HstTokenList>
269
- <template #controls>
270
- <HstTextarea
271
- v-model="sampleText"
272
- title="Sample text"
273
- rows="5"
274
- />
275
- <HstNumber
276
- v-model="fontSize"
277
- title="Font size"
278
- min="1"
279
- />
280
- </template>
281
- </Variant>
282
- <Variant id="letter-spacing" title="Letter Spacing" icon="carbon:text-font">
283
- <HstTokenList
284
- :tokens="config.theme.letterSpacing"
285
- :get-name="key => \`\${config.prefix ?? ''}tracking-\${key}\`"
286
- >
287
- <template #default="{ token }">
288
- <div
289
- class="truncate"
290
- :style="{
291
- letterSpacing: token.value,
292
- fontSize: \`\${fontSize}px\`,
293
- }"
294
- >
295
- {{ sampleText }}
296
- </div>
297
- </template>
298
- </HstTokenList>
299
- <template #controls>
300
- <HstTextarea
301
- v-model="sampleText"
302
- title="Sample text"
303
- rows="5"
304
- />
305
- <HstNumber
306
- v-model="fontSize"
307
- title="Font size"
308
- min="1"
309
- />
310
- </template>
311
- </Variant>
312
- <Variant id="line-height" title="Line Height" icon="carbon:text-font">
313
- <HstTokenList
314
- :tokens="config.theme.lineHeight"
315
- :get-name="key => \`\${config.prefix ?? ''}leading-\${key}\`"
316
- >
317
- <template #default="{ token }">
318
- <div
319
- :style="{
320
- lineHeight: token.value,
321
- fontSize: \`\${fontSize}px\`,
322
- }"
323
- >
324
- {{ sampleText }}
325
- </div>
326
- </template>
327
- </HstTokenList>
328
- <template #controls>
329
- <HstTextarea
330
- v-model="sampleText"
331
- title="Sample text"
332
- rows="5"
333
- />
334
- <HstNumber
335
- v-model="fontSize"
336
- title="Font size"
337
- min="1"
338
- />
339
- </template>
340
- </Variant>
341
- <Variant id="drop-shadow" title="Drop Shadow" icon="carbon:shape-except">
342
- <HstTokenGrid
343
- :tokens="config.theme.dropShadow"
344
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'drop-shadow' : \`drop-shadow-\${key}\`)"
345
- :col-size="180"
346
- >
347
- <template #default="{ token }">
348
- <div
349
- class="drop-shadow"
350
- :style="{
351
- filter: \`\${(Array.isArray(token.value) ? token.value : [token.value]).map(v => \`drop-shadow(\${v})\`).join(' ')}\`,
352
- }"
353
- />
354
- </template>
355
- </HstTokenGrid>
356
- </Variant>
357
- <Variant id="border-radius" title="Border Radius" icon="carbon:condition-wait-point">
358
- <HstTokenGrid
359
- :tokens="config.theme.borderRadius"
360
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'rounded' : \`rounded-\${key}\`)"
361
- :col-size="180"
362
- >
363
- <template #default="{ token }">
364
- <div
365
- class="border-radius"
366
- :style="{
367
- borderRadius: token.value,
368
- }"
369
- />
370
- </template>
371
- </HstTokenGrid>
372
- </Variant>
373
- <Variant id="border-width" title="Border Width" icon="carbon:checkbox">
374
- <HstTokenGrid
375
- :tokens="config.theme.borderWidth"
376
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'border' : \`border-\${key}\`)"
377
- :col-size="180"
378
- >
379
- <template #default="{ token }">
380
- <div
381
- class="border-width"
382
- :style="{
383
- borderWidth: token.value,
384
- }"
385
- />
386
- </template>
387
- </HstTokenGrid>
388
- </Variant>
389
- <Variant id="width" title="Width" icon="carbon:pan-horizontal">
390
- <HstTokenList
391
- :tokens="config.theme.width"
392
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'w' : \`w-\${key}\`)"
393
- >
394
- <template #default="{ token }">
395
- <div class="width">
396
- <div
397
- class="width-box"
398
- :style="{
399
- width: token.value,
400
- }"
401
- />
402
- </div>
403
- </template>
404
- </HstTokenList>
405
- </Variant>
406
- <Variant id="height" title="Height" icon="carbon:pan-vertical">
407
- <HstTokenList
408
- :tokens="config.theme.height"
409
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'h' : \`h-\${key}\`)"
410
- >
411
- <template #default="{ token }">
412
- <div
413
- class="height"
414
- :style="{
415
- height: token.value,
416
- }"
417
- />
418
- </template>
419
- </HstTokenList>
420
- </Variant>
421
- <Variant id="full-config" title="Full Config" icon="carbon:code">
422
- <pre>{{ config }}</pre>
423
- </Variant>
424
- </Story>
425
- </template>
426
- <style scoped>
427
- .shade {
94
+
95
+ function mountApp ({ el, state, onUnmount }, render) {
96
+ Object.assign(state, {
97
+ search,
98
+ sampleText,
99
+ fontSize,
100
+ })
101
+
102
+ const app = createApp({
103
+ render,
104
+ })
105
+ app.mount(el)
106
+
107
+ onUnmount(() => {
108
+ app.unmount()
109
+ })
110
+ }
111
+
112
+ export default {
113
+ id: 'tailwind',
114
+ title: 'Tailwind',
115
+ group: 'design-system',
116
+ icon: 'mdi:tailwind',
117
+ responsiveDisabled: true,
118
+ layout: { type: 'single', iframe: false },
119
+ variants: [
120
+ {
121
+ id: 'background-color',
122
+ title: 'Background Color',
123
+ icon: 'carbon:color-palette',
124
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.backgroundColor).map(([key, shades]) => h(HstColorShades, {
125
+ key,
126
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
127
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`bg-\${key}\` : \`bg-\${key}-\${shade}\`),
128
+ search: search.value,
129
+ }, ({ color}) => h('div', {
130
+ class: '__hst-shade',
131
+ style: {
132
+ backgroundColor: color,
133
+ },
134
+ })))),
135
+ onMountControls: (api) => mountApp(api, () => [
136
+ h(HstText, {
137
+ title: 'Filter...',
138
+ modelValue: search.value,
139
+ 'onUpdate:modelValue': value => { search.value = value },
140
+ }),
141
+ ]),
142
+ },
143
+ {
144
+ id: 'text-color',
145
+ title: 'Text Color',
146
+ icon: 'carbon:text-color',
147
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.textColor).map(([key, shades]) => h(HstColorShades, {
148
+ key,
149
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
150
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`text-\${key}\` : \`text-\${key}-\${shade}\`),
151
+ search: search.value,
152
+ }, ({ color}) => h('div', {
153
+ class: '__hst-shade __hst-text',
154
+ style: {
155
+ color,
156
+ },
157
+ }, 'Aa')))),
158
+ onMountControls: (api) => mountApp(api, () => [
159
+ h(HstText, {
160
+ title: 'Filter...',
161
+ modelValue: search.value,
162
+ 'onUpdate:modelValue': value => { search.value = value },
163
+ }),
164
+ ]),
165
+ },
166
+ {
167
+ id: 'border-color',
168
+ title: 'Border Color',
169
+ icon: 'carbon:color-palette',
170
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.borderColor).map(([key, shades]) => h(HstColorShades, {
171
+ key,
172
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
173
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`border-\${key}\` : \`border-\${key}-\${shade}\`),
174
+ search: search.value,
175
+ }, ({ color}) => h('div', {
176
+ class: '__hst-shade __hst-border',
177
+ style: {
178
+ borderColor: color,
179
+ },
180
+ })))),
181
+ onMountControls: (api) => mountApp(api, () => [
182
+ h(HstText, {
183
+ title: 'Filter...',
184
+ modelValue: search.value,
185
+ 'onUpdate:modelValue': value => { search.value = value },
186
+ }),
187
+ ]),
188
+ },
189
+ {
190
+ id: 'padding',
191
+ title: 'Padding',
192
+ icon: 'carbon:area',
193
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
194
+ tokens: config.theme.padding,
195
+ getName: key => \`\${config.prefix ?? ''}p-\${key}\`,
196
+ }, ({ token }) => h('div', {
197
+ class: '__hst-padding',
198
+ style: {
199
+ padding: token.value,
200
+ },
201
+ }, [
202
+ h('div', {
203
+ class: '__hst-padding-box',
204
+ }),
205
+ ]))),
206
+ },
207
+ {
208
+ id: 'margin',
209
+ title: 'Margin',
210
+ icon: 'carbon:area',
211
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
212
+ tokens: config.theme.margin,
213
+ getName: key => \`\${config.prefix ?? ''}m-\${key}\`,
214
+ }, ({ token }) => h('div', {
215
+ class: '__hst-margin',
216
+ }, [
217
+ h('div', {
218
+ class: '__hst-margin-box',
219
+ style: {
220
+ margin: token.value,
221
+ },
222
+ }),
223
+ ]))),
224
+ },
225
+ {
226
+ id: 'font-size',
227
+ title: 'Font Size',
228
+ icon: 'carbon:text-font',
229
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
230
+ tokens: config.theme.fontSize,
231
+ getName: key => \`\${config.prefix ?? ''}text-\${key}\`,
232
+ }, ({ token }) => h('div', {
233
+ class: '__hst-truncate',
234
+ style: {
235
+ fontSize: token.value[0],
236
+ ...token.value[1],
237
+ },
238
+ }, sampleText.value))),
239
+ onMountControls: (api) => mountApp(api, () => [
240
+ h(HstTextarea, {
241
+ title: 'Sample text',
242
+ modelValue: sampleText.value,
243
+ 'onUpdate:modelValue': value => { sampleText.value = value },
244
+ rows: 5,
245
+ }),
246
+ ]),
247
+ },
248
+ {
249
+ id: 'font-weight',
250
+ title: 'Font Weight',
251
+ icon: 'carbon:text-font',
252
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
253
+ tokens: config.theme.fontWeight,
254
+ getName: key => \`\${config.prefix ?? ''}font-\${key}\`,
255
+ }, ({ token }) => h('div', {
256
+ class: '__hst-truncate',
257
+ style: {
258
+ fontWeight: token.value,
259
+ fontSize: \`\${fontSize.value}px\`,
260
+ },
261
+ }, sampleText.value))),
262
+ onMountControls: (api) => mountApp(api, () => [
263
+ h(HstTextarea, {
264
+ title: 'Sample text',
265
+ modelValue: sampleText.value,
266
+ 'onUpdate:modelValue': value => { sampleText.value = value },
267
+ rows: 5,
268
+ }),
269
+ h(HstNumber, {
270
+ title: 'Font size',
271
+ modelValue: fontSize.value,
272
+ 'onUpdate:modelValue': value => { fontSize.value = value },
273
+ min: 1,
274
+ }),
275
+ ]),
276
+ },
277
+ {
278
+ id: 'font-family',
279
+ title: 'Font Family',
280
+ icon: 'carbon:text-font',
281
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
282
+ tokens: config.theme.fontFamily,
283
+ getName: key => \`\${config.prefix ?? ''}font-\${key}\`,
284
+ }, ({ token }) => h('div', {
285
+ class: '__hst-truncate',
286
+ style: {
287
+ fontFamily: token.value,
288
+ fontSize: \`\${fontSize.value}px\`,
289
+ },
290
+ }, sampleText.value))),
291
+ onMountControls: (api) => mountApp(api, () => [
292
+ h(HstTextarea, {
293
+ title: 'Sample text',
294
+ modelValue: sampleText.value,
295
+ 'onUpdate:modelValue': value => { sampleText.value = value },
296
+ rows: 5,
297
+ }),
298
+ h(HstNumber, {
299
+ title: 'Font size',
300
+ modelValue: fontSize.value,
301
+ 'onUpdate:modelValue': value => { fontSize.value = value },
302
+ min: 1,
303
+ }),
304
+ ]),
305
+ },
306
+ {
307
+ id: 'letter-spacing',
308
+ title: 'Letter Spacing',
309
+ icon: 'carbon:text-font',
310
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
311
+ tokens: config.theme.letterSpacing,
312
+ getName: key => \`\${config.prefix ?? ''}tracking-\${key}\`,
313
+ }, ({ token }) => h('div', {
314
+ class: '__hst-truncate',
315
+ style: {
316
+ letterSpacing: token.value,
317
+ fontSize: \`\${fontSize.value}px\`,
318
+ },
319
+ }, sampleText.value))),
320
+ onMountControls: (api) => mountApp(api, () => [
321
+ h(HstTextarea, {
322
+ title: 'Sample text',
323
+ modelValue: sampleText.value,
324
+ 'onUpdate:modelValue': value => { sampleText.value = value },
325
+ rows: 5,
326
+ }),
327
+ h(HstNumber, {
328
+ title: 'Font size',
329
+ modelValue: fontSize.value,
330
+ 'onUpdate:modelValue': value => { fontSize.value = value },
331
+ min: 1,
332
+ }),
333
+ ]),
334
+ },
335
+ {
336
+ id: 'line-height',
337
+ title: 'Line Height',
338
+ icon: 'carbon:text-font',
339
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
340
+ tokens: config.theme.lineHeight,
341
+ getName: key => \`\${config.prefix ?? ''}leading-\${key}\`,
342
+ }, ({ token }) => h('div', {
343
+ style: {
344
+ lineHeight: token.value,
345
+ },
346
+ }, sampleText.value))),
347
+ onMountControls: (api) => mountApp(api, () => [
348
+ h(HstTextarea, {
349
+ title: 'Sample text',
350
+ modelValue: sampleText.value,
351
+ 'onUpdate:modelValue': value => { sampleText.value = value },
352
+ rows: 5,
353
+ }),
354
+ // @TODO select font size
355
+ ]),
356
+ },
357
+ {
358
+ id: 'drop-shadow',
359
+ title: 'Drop Shadow',
360
+ icon: 'carbon:shape-except',
361
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
362
+ tokens: config.theme.dropShadow,
363
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'drop-shadow' : \`drop-shadow-\${key}\`),
364
+ colSize: 180,
365
+ }, ({ token }) => h('div', {
366
+ class: '__hst-drop-shadow',
367
+ style: {
368
+ filter: \`\${(Array.isArray(token.value) ? token.value : [token.value]).map(v => \`drop-shadow(\${v})\`).join(' ')}\`,
369
+ },
370
+ }))),
371
+ },
372
+ {
373
+ id: 'border-radius',
374
+ title: 'Border Radius',
375
+ icon: 'carbon:condition-wait-point',
376
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
377
+ tokens: config.theme.borderRadius,
378
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'rounded' : \`rounded-\${key}\`),
379
+ colSize: 180,
380
+ }, ({ token }) => h('div', {
381
+ class: '__hst-border-radius',
382
+ style: {
383
+ borderRadius: token.value,
384
+ },
385
+ }))),
386
+ },
387
+ {
388
+ id: 'border-width',
389
+ title: 'Border Width',
390
+ icon: 'carbon:checkbox',
391
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
392
+ tokens: config.theme.borderWidth,
393
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'border' : \`border-\${key}\`),
394
+ colSize: 180,
395
+ }, ({ token }) => h('div', {
396
+ class: '__hst-border-width',
397
+ style: {
398
+ borderWidth: token.value,
399
+ },
400
+ }))),
401
+ },
402
+ {
403
+ id: 'width',
404
+ title: 'Width',
405
+ icon: 'carbon:pan-horizontal',
406
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
407
+ tokens: config.theme.width,
408
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'w' : \`w-\${key}\`),
409
+ }, ({ token }) => h('div', {
410
+ class: '__hst-width',
411
+ }, [
412
+ h('div', {
413
+ class: '__hst-width-box',
414
+ style: {
415
+ width: token.value,
416
+ },
417
+ }),
418
+ ]))),
419
+ },
420
+ {
421
+ id: 'height',
422
+ title: 'Height',
423
+ icon: 'carbon:pan-vertical',
424
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
425
+ tokens: config.theme.height,
426
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'h' : \`h-\${key}\`),
427
+ }, ({ token }) => h('div', {
428
+ class: '__hst-height',
429
+ style: {
430
+ height: token.value,
431
+ },
432
+ }))),
433
+ },
434
+ {
435
+ id: 'full-config',
436
+ title: 'Full Config',
437
+ icon: 'carbon:code',
438
+ onMount: (api) => mountApp(api, () => h('pre', JSON.stringify(config, null, 2))),
439
+ },
440
+ ],
441
+ }`;
442
+ const css = `.__hst-shade {
428
443
  height: 80px;
429
444
  border-radius: 4px;
430
445
  }
431
446
 
432
- .text {
447
+ .__hst-text {
433
448
  font-size: 4rem;
434
449
  display: flex;
435
450
  align-items: flex-end;
436
451
  }
437
452
 
438
- .border {
453
+ .__hst-border {
439
454
  border-style: solid;
440
455
  border-width: 2px;
441
456
  }
442
457
 
443
- .padding {
458
+ .__hst-padding {
444
459
  background-color: rgb(113 113 122 / 0.1);
445
460
  width: min-content;
446
461
  }
447
462
 
448
- .margin {
463
+ .__hst-margin {
449
464
  border: dashed 1px rgb(113 113 122 / 0.5);
450
465
  width: min-content;
451
466
  }
452
467
 
453
- .padding-box,
454
- .margin-box {
468
+ .__hst-padding-box,
469
+ .__hst-margin-box {
455
470
  width: 5rem;
456
471
  height: 5rem;
457
472
  background-color: rgb(113 113 122 / 0.5);
458
473
  }
459
474
 
460
- .padding,
461
- .padding-box,
462
- .margin,
463
- .margin-box,
464
- .drop-shadow {
475
+ .__hst-padding,
476
+ .__hst-padding-box,
477
+ .__hst-margin,
478
+ .__hst-margin-box,
479
+ .__hst-drop-shadow {
465
480
  border-radius: 4px;
466
481
  }
467
482
 
468
- .truncate {
483
+ .__hst-truncate {
469
484
  overflow: hidden;
470
485
  text-overflow: ellipsis;
471
486
  white-space: nowrap;
472
487
  }
473
488
 
474
- .drop-shadow {
489
+ .__hst-drop-shadow {
475
490
  width: 8rem;
476
491
  height: 8rem;
477
492
  background: white;
478
493
  margin-bottom: 0.5rem;
479
494
  }
480
495
 
481
- .dark .drop-shadow {
496
+ .__hst-drop-shadow {
482
497
  background: #4e4e57;
483
498
  }
484
499
 
485
- .border-radius {
500
+ .__hst-border-radius {
486
501
  width: 8rem;
487
502
  height: 8rem;
488
503
  background-color: rgb(113 113 122 / 0.5);
489
504
  }
490
505
 
491
- .border-width {
506
+ .__hst-border-width {
492
507
  width: 8rem;
493
508
  height: 8rem;
494
509
  border-color: rgb(113 113 122 / 0.5);
495
510
  background-color: rgb(113 113 122 / 0.1);
496
511
  }
497
512
 
498
- .width {
513
+ .__hst-width {
499
514
  background-color: rgb(113 113 122 / 0.1);
500
515
  }
501
516
 
502
- .width-box,
503
- .height {
517
+ .__hst-width-box,
518
+ .__hst-height {
504
519
  background-color: rgb(113 113 122 / 0.5);
505
520
  }
506
521
 
507
- .width-box {
522
+ .__hst-width-box {
508
523
  height: 5rem;
509
- }
510
- </style>`;
524
+ }`;