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,6 +1,13 @@
1
+ import { createRequire } from 'module'
1
2
  import { BasePluginApi, Plugin } from '../plugin.js'
2
3
  import { findUp } from '../util/find-up.js'
3
4
 
5
+ const require = createRequire(import.meta.url)
6
+
7
+ function resolveImport (request) {
8
+ return JSON.stringify(require.resolve(request))
9
+ }
10
+
4
11
  export interface TailwindTokensOptions {
5
12
  configFile?: string
6
13
  }
@@ -22,10 +29,11 @@ export function tailwindTokens (options: TailwindTokensOptions = {}): Plugin {
22
29
  await api.fs.ensureDir(api.pluginTempDir)
23
30
  await api.fs.emptyDir(api.pluginTempDir)
24
31
  api.moduleLoader.clearCache()
32
+ await api.fs.writeFile(api.path.resolve(api.pluginTempDir, 'style.css'), css)
25
33
  const tailwindConfig = await api.moduleLoader.loadModule(tailwindConfigFile)
26
34
  const { default: resolveConfig } = await import('tailwindcss/resolveConfig.js')
27
35
  const resolvedTailwindConfig = resolveConfig(tailwindConfig)
28
- const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.vue')
36
+ const storyFile = api.path.resolve(api.pluginTempDir, 'Tailwind.story.js')
29
37
  await api.fs.writeFile(storyFile, storyTemplate(resolvedTailwindConfig))
30
38
  api.addStoryFile(storyFile)
31
39
  } catch (e) {
@@ -34,7 +42,7 @@ export function tailwindTokens (options: TailwindTokensOptions = {}): Plugin {
34
42
  }
35
43
 
36
44
  return {
37
- name: 'tailwind-tokens',
45
+ name: 'builtin:tailwind-tokens',
38
46
 
39
47
  config (config) {
40
48
  if (tailwindConfigFile) {
@@ -80,442 +88,451 @@ export function tailwindTokens (options: TailwindTokensOptions = {}): Plugin {
80
88
  }
81
89
  }
82
90
 
83
- const storyTemplate = (tailwindConfig: any) => `<script setup>
84
- import 'histoire/dist/style.css'
85
- import { ref } from 'vue'
86
- const config = ${JSON.stringify(tailwindConfig, null, 2)}
91
+ const storyTemplate = (tailwindConfig: any) => `import 'histoire-style'
92
+ import './style.css'
93
+ import { createApp, h, markRaw, ref } from ${resolveImport('@histoire/vendors/vue')}
94
+ import {
95
+ HstColorShades,
96
+ HstTokenList,
97
+ HstTokenGrid,
98
+ HstText,
99
+ HstTextarea,
100
+ HstNumber,
101
+ } from ${resolveImport('@histoire/controls')}
102
+
103
+ const config = markRaw(${JSON.stringify(tailwindConfig, null, 2)})
87
104
  const search = ref('')
88
105
  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')
89
106
  const fontSize = ref(16)
90
- defineExpose({
91
- search,
92
- sampleText,
93
- fontSize,
94
- })
95
- </script>
96
- <template>
97
- <Story id="tailwind" title="Tailwind" group="design-system" icon="mdi:tailwind" responsiveDisabled :layout="{ type: 'single', iframe: false }">
98
- <Variant id="background-color" title="Background Color" icon="carbon:color-palette">
99
- <HstColorShades
100
- v-for="(shades, key) of config.theme.backgroundColor"
101
- :key="key"
102
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
103
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`bg-\${key}\` : \`bg-\${key}-\${shade}\`)"
104
- :search="search"
105
- >
106
- <template #default="{ color }">
107
- <div
108
- class="shade"
109
- :style="{
110
- backgroundColor: color,
111
- }"
112
- />
113
- </template>
114
- </HstColorShades>
115
- <template #controls>
116
- <HstText
117
- v-model="search"
118
- title="Filter..."
119
- />
120
- </template>
121
- </Variant>
122
- <Variant id="text-color" title="Text Color" icon="carbon:text-color">
123
- <HstColorShades
124
- v-for="(shades, key) of config.theme.textColor"
125
- :key="key"
126
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
127
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`text-\${key}\` : \`text-\${key}-\${shade}\`)"
128
- :search="search"
129
- >
130
- <template #default="{ color }">
131
- <div
132
- class="shade text"
133
- :style="{
134
- color: color,
135
- }"
136
- >
137
- Aa
138
- </div>
139
- </template>
140
- </HstColorShades>
141
- <template #controls>
142
- <HstText
143
- v-model="search"
144
- title="Filter..."
145
- />
146
- </template>
147
- </Variant>
148
- <Variant id="border-color" title="Border Color" icon="carbon:color-palette">
149
- <HstColorShades
150
- v-for="(shades, key) of config.theme.borderColor"
151
- :key="key"
152
- :shades="typeof shades === 'object' ? shades : { DEFAULT: shades }"
153
- :get-name="shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`border-\${key}\` : \`border-\${key}-\${shade}\`)"
154
- :search="search"
155
- >
156
- <template #default="{ color }">
157
- <div
158
- class="shade border"
159
- :style="{
160
- borderColor: color,
161
- }"
162
- />
163
- </template>
164
- </HstColorShades>
165
- <template #controls>
166
- <HstText
167
- v-model="search"
168
- title="Filter..."
169
- />
170
- </template>
171
- </Variant>
172
- <Variant id="padding" title="Padding" icon="carbon:area">
173
- <HstTokenList
174
- :tokens="config.theme.padding"
175
- :get-name="key => \`\${config.prefix ?? ''}p-\${key}\`"
176
- >
177
- <template #default="{ token }">
178
- <div class="padding"
179
- :style="{
180
- padding: token.value,
181
- }"
182
- >
183
- <div
184
- class="padding-box"
185
- />
186
- </div>
187
- </template>
188
- </HstTokenList>
189
- </Variant>
190
- <Variant id="margin" title="Margin" icon="carbon:area">
191
- <HstTokenList
192
- :tokens="config.theme.margin"
193
- :get-name="key => \`\${config.prefix ?? ''}m-\${key}\`"
194
- >
195
- <template #default="{ token }">
196
- <div class="margin"
197
- :style="{
198
- padding: token.value,
199
- }"
200
- >
201
- <div
202
- class="margin-box"
203
- />
204
- </div>
205
- </template>
206
- </HstTokenList>
207
- </Variant>
208
- <Variant id="font-size" title="Font Size" icon="carbon:text-font">
209
- <HstTokenList
210
- :tokens="config.theme.fontSize"
211
- :get-name="key => \`\${config.prefix ?? ''}text-\${key}\`"
212
- >
213
- <template #default="{ token }">
214
- <div
215
- class="truncate"
216
- :style="{
217
- fontSize: token.value[0],
218
- ...token.value[1],
219
- }"
220
- >
221
- {{ sampleText }}
222
- </div>
223
- </template>
224
- </HstTokenList>
225
- <template #controls>
226
- <HstTextarea
227
- v-model="sampleText"
228
- title="Sample text"
229
- rows="5"
230
- />
231
- </template>
232
- </Variant>
233
- <Variant id="font-weight" title="Font Weight" icon="carbon:text-font">
234
- <HstTokenList
235
- :tokens="config.theme.fontWeight"
236
- :get-name="key => \`\${config.prefix ?? ''}font-\${key}\`"
237
- >
238
- <template #default="{ token }">
239
- <div
240
- class="truncate"
241
- :style="{
242
- fontWeight: token.value,
243
- fontSize: \`\${fontSize}px\`,
244
- }"
245
- >
246
- {{ sampleText }}
247
- </div>
248
- </template>
249
- </HstTokenList>
250
- <template #controls>
251
- <HstTextarea
252
- v-model="sampleText"
253
- title="Sample text"
254
- rows="5"
255
- />
256
- <HstNumber
257
- v-model="fontSize"
258
- title="Font size"
259
- min="1"
260
- />
261
- </template>
262
- </Variant>
263
- <Variant id="font-family" title="Font Family" icon="carbon:text-font">
264
- <HstTokenList
265
- :tokens="config.theme.fontFamily"
266
- :get-name="key => \`\${config.prefix ?? ''}font-\${key}\`"
267
- >
268
- <template #default="{ token }">
269
- <div
270
- class="truncate"
271
- :style="{
272
- fontFamily: token.value,
273
- fontSize: \`\${fontSize}px\`,
274
- }"
275
- >
276
- {{ sampleText }}
277
- </div>
278
- </template>
279
- </HstTokenList>
280
- <template #controls>
281
- <HstTextarea
282
- v-model="sampleText"
283
- title="Sample text"
284
- rows="5"
285
- />
286
- <HstNumber
287
- v-model="fontSize"
288
- title="Font size"
289
- min="1"
290
- />
291
- </template>
292
- </Variant>
293
- <Variant id="letter-spacing" title="Letter Spacing" icon="carbon:text-font">
294
- <HstTokenList
295
- :tokens="config.theme.letterSpacing"
296
- :get-name="key => \`\${config.prefix ?? ''}tracking-\${key}\`"
297
- >
298
- <template #default="{ token }">
299
- <div
300
- class="truncate"
301
- :style="{
302
- letterSpacing: token.value,
303
- fontSize: \`\${fontSize}px\`,
304
- }"
305
- >
306
- {{ sampleText }}
307
- </div>
308
- </template>
309
- </HstTokenList>
310
- <template #controls>
311
- <HstTextarea
312
- v-model="sampleText"
313
- title="Sample text"
314
- rows="5"
315
- />
316
- <HstNumber
317
- v-model="fontSize"
318
- title="Font size"
319
- min="1"
320
- />
321
- </template>
322
- </Variant>
323
- <Variant id="line-height" title="Line Height" icon="carbon:text-font">
324
- <HstTokenList
325
- :tokens="config.theme.lineHeight"
326
- :get-name="key => \`\${config.prefix ?? ''}leading-\${key}\`"
327
- >
328
- <template #default="{ token }">
329
- <div
330
- :style="{
331
- lineHeight: token.value,
332
- fontSize: \`\${fontSize}px\`,
333
- }"
334
- >
335
- {{ sampleText }}
336
- </div>
337
- </template>
338
- </HstTokenList>
339
- <template #controls>
340
- <HstTextarea
341
- v-model="sampleText"
342
- title="Sample text"
343
- rows="5"
344
- />
345
- <HstNumber
346
- v-model="fontSize"
347
- title="Font size"
348
- min="1"
349
- />
350
- </template>
351
- </Variant>
352
- <Variant id="drop-shadow" title="Drop Shadow" icon="carbon:shape-except">
353
- <HstTokenGrid
354
- :tokens="config.theme.dropShadow"
355
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'drop-shadow' : \`drop-shadow-\${key}\`)"
356
- :col-size="180"
357
- >
358
- <template #default="{ token }">
359
- <div
360
- class="drop-shadow"
361
- :style="{
362
- filter: \`\${(Array.isArray(token.value) ? token.value : [token.value]).map(v => \`drop-shadow(\${v})\`).join(' ')}\`,
363
- }"
364
- />
365
- </template>
366
- </HstTokenGrid>
367
- </Variant>
368
- <Variant id="border-radius" title="Border Radius" icon="carbon:condition-wait-point">
369
- <HstTokenGrid
370
- :tokens="config.theme.borderRadius"
371
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'rounded' : \`rounded-\${key}\`)"
372
- :col-size="180"
373
- >
374
- <template #default="{ token }">
375
- <div
376
- class="border-radius"
377
- :style="{
378
- borderRadius: token.value,
379
- }"
380
- />
381
- </template>
382
- </HstTokenGrid>
383
- </Variant>
384
- <Variant id="border-width" title="Border Width" icon="carbon:checkbox">
385
- <HstTokenGrid
386
- :tokens="config.theme.borderWidth"
387
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'border' : \`border-\${key}\`)"
388
- :col-size="180"
389
- >
390
- <template #default="{ token }">
391
- <div
392
- class="border-width"
393
- :style="{
394
- borderWidth: token.value,
395
- }"
396
- />
397
- </template>
398
- </HstTokenGrid>
399
- </Variant>
400
- <Variant id="width" title="Width" icon="carbon:pan-horizontal">
401
- <HstTokenList
402
- :tokens="config.theme.width"
403
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'w' : \`w-\${key}\`)"
404
- >
405
- <template #default="{ token }">
406
- <div class="width">
407
- <div
408
- class="width-box"
409
- :style="{
410
- width: token.value,
411
- }"
412
- />
413
- </div>
414
- </template>
415
- </HstTokenList>
416
- </Variant>
417
- <Variant id="height" title="Height" icon="carbon:pan-vertical">
418
- <HstTokenList
419
- :tokens="config.theme.height"
420
- :get-name="key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'h' : \`h-\${key}\`)"
421
- >
422
- <template #default="{ token }">
423
- <div
424
- class="height"
425
- :style="{
426
- height: token.value,
427
- }"
428
- />
429
- </template>
430
- </HstTokenList>
431
- </Variant>
432
- <Variant id="full-config" title="Full Config" icon="carbon:code">
433
- <pre>{{ config }}</pre>
434
- </Variant>
435
- </Story>
436
- </template>
437
- <style scoped>
438
- .shade {
107
+
108
+ function mountApp ({ el, state, onUnmount }, render) {
109
+ Object.assign(state, {
110
+ search,
111
+ sampleText,
112
+ fontSize,
113
+ })
114
+
115
+ const app = createApp({
116
+ render,
117
+ })
118
+ app.mount(el)
119
+
120
+ onUnmount(() => {
121
+ app.unmount()
122
+ })
123
+ }
124
+
125
+ export default {
126
+ id: 'tailwind',
127
+ title: 'Tailwind',
128
+ group: 'design-system',
129
+ icon: 'mdi:tailwind',
130
+ responsiveDisabled: true,
131
+ layout: { type: 'single', iframe: false },
132
+ variants: [
133
+ {
134
+ id: 'background-color',
135
+ title: 'Background Color',
136
+ icon: 'carbon:color-palette',
137
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.backgroundColor).map(([key, shades]) => h(HstColorShades, {
138
+ key,
139
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
140
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`bg-\${key}\` : \`bg-\${key}-\${shade}\`),
141
+ search: search.value,
142
+ }, ({ color}) => h('div', {
143
+ class: '__hst-shade',
144
+ style: {
145
+ backgroundColor: color,
146
+ },
147
+ })))),
148
+ onMountControls: (api) => mountApp(api, () => [
149
+ h(HstText, {
150
+ title: 'Filter...',
151
+ modelValue: search.value,
152
+ 'onUpdate:modelValue': value => { search.value = value },
153
+ }),
154
+ ]),
155
+ },
156
+ {
157
+ id: 'text-color',
158
+ title: 'Text Color',
159
+ icon: 'carbon:text-color',
160
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.textColor).map(([key, shades]) => h(HstColorShades, {
161
+ key,
162
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
163
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`text-\${key}\` : \`text-\${key}-\${shade}\`),
164
+ search: search.value,
165
+ }, ({ color}) => h('div', {
166
+ class: '__hst-shade __hst-text',
167
+ style: {
168
+ color,
169
+ },
170
+ }, 'Aa')))),
171
+ onMountControls: (api) => mountApp(api, () => [
172
+ h(HstText, {
173
+ title: 'Filter...',
174
+ modelValue: search.value,
175
+ 'onUpdate:modelValue': value => { search.value = value },
176
+ }),
177
+ ]),
178
+ },
179
+ {
180
+ id: 'border-color',
181
+ title: 'Border Color',
182
+ icon: 'carbon:color-palette',
183
+ onMount: (api) => mountApp(api, () => Object.entries(config.theme.borderColor).map(([key, shades]) => h(HstColorShades, {
184
+ key,
185
+ shades: typeof shades === 'object' ? shades : { DEFAULT: shades },
186
+ getName: shade => (config.prefix ?? '') + (shade === 'DEFAULT' ? \`border-\${key}\` : \`border-\${key}-\${shade}\`),
187
+ search: search.value,
188
+ }, ({ color}) => h('div', {
189
+ class: '__hst-shade __hst-border',
190
+ style: {
191
+ borderColor: color,
192
+ },
193
+ })))),
194
+ onMountControls: (api) => mountApp(api, () => [
195
+ h(HstText, {
196
+ title: 'Filter...',
197
+ modelValue: search.value,
198
+ 'onUpdate:modelValue': value => { search.value = value },
199
+ }),
200
+ ]),
201
+ },
202
+ {
203
+ id: 'padding',
204
+ title: 'Padding',
205
+ icon: 'carbon:area',
206
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
207
+ tokens: config.theme.padding,
208
+ getName: key => \`\${config.prefix ?? ''}p-\${key}\`,
209
+ }, ({ token }) => h('div', {
210
+ class: '__hst-padding',
211
+ style: {
212
+ padding: token.value,
213
+ },
214
+ }, [
215
+ h('div', {
216
+ class: '__hst-padding-box',
217
+ }),
218
+ ]))),
219
+ },
220
+ {
221
+ id: 'margin',
222
+ title: 'Margin',
223
+ icon: 'carbon:area',
224
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
225
+ tokens: config.theme.margin,
226
+ getName: key => \`\${config.prefix ?? ''}m-\${key}\`,
227
+ }, ({ token }) => h('div', {
228
+ class: '__hst-margin',
229
+ }, [
230
+ h('div', {
231
+ class: '__hst-margin-box',
232
+ style: {
233
+ margin: token.value,
234
+ },
235
+ }),
236
+ ]))),
237
+ },
238
+ {
239
+ id: 'font-size',
240
+ title: 'Font Size',
241
+ icon: 'carbon:text-font',
242
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
243
+ tokens: config.theme.fontSize,
244
+ getName: key => \`\${config.prefix ?? ''}text-\${key}\`,
245
+ }, ({ token }) => h('div', {
246
+ class: '__hst-truncate',
247
+ style: {
248
+ fontSize: token.value[0],
249
+ ...token.value[1],
250
+ },
251
+ }, sampleText.value))),
252
+ onMountControls: (api) => mountApp(api, () => [
253
+ h(HstTextarea, {
254
+ title: 'Sample text',
255
+ modelValue: sampleText.value,
256
+ 'onUpdate:modelValue': value => { sampleText.value = value },
257
+ rows: 5,
258
+ }),
259
+ ]),
260
+ },
261
+ {
262
+ id: 'font-weight',
263
+ title: 'Font Weight',
264
+ icon: 'carbon:text-font',
265
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
266
+ tokens: config.theme.fontWeight,
267
+ getName: key => \`\${config.prefix ?? ''}font-\${key}\`,
268
+ }, ({ token }) => h('div', {
269
+ class: '__hst-truncate',
270
+ style: {
271
+ fontWeight: token.value,
272
+ fontSize: \`\${fontSize.value}px\`,
273
+ },
274
+ }, sampleText.value))),
275
+ onMountControls: (api) => mountApp(api, () => [
276
+ h(HstTextarea, {
277
+ title: 'Sample text',
278
+ modelValue: sampleText.value,
279
+ 'onUpdate:modelValue': value => { sampleText.value = value },
280
+ rows: 5,
281
+ }),
282
+ h(HstNumber, {
283
+ title: 'Font size',
284
+ modelValue: fontSize.value,
285
+ 'onUpdate:modelValue': value => { fontSize.value = value },
286
+ min: 1,
287
+ }),
288
+ ]),
289
+ },
290
+ {
291
+ id: 'font-family',
292
+ title: 'Font Family',
293
+ icon: 'carbon:text-font',
294
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
295
+ tokens: config.theme.fontFamily,
296
+ getName: key => \`\${config.prefix ?? ''}font-\${key}\`,
297
+ }, ({ token }) => h('div', {
298
+ class: '__hst-truncate',
299
+ style: {
300
+ fontFamily: token.value,
301
+ fontSize: \`\${fontSize.value}px\`,
302
+ },
303
+ }, sampleText.value))),
304
+ onMountControls: (api) => mountApp(api, () => [
305
+ h(HstTextarea, {
306
+ title: 'Sample text',
307
+ modelValue: sampleText.value,
308
+ 'onUpdate:modelValue': value => { sampleText.value = value },
309
+ rows: 5,
310
+ }),
311
+ h(HstNumber, {
312
+ title: 'Font size',
313
+ modelValue: fontSize.value,
314
+ 'onUpdate:modelValue': value => { fontSize.value = value },
315
+ min: 1,
316
+ }),
317
+ ]),
318
+ },
319
+ {
320
+ id: 'letter-spacing',
321
+ title: 'Letter Spacing',
322
+ icon: 'carbon:text-font',
323
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
324
+ tokens: config.theme.letterSpacing,
325
+ getName: key => \`\${config.prefix ?? ''}tracking-\${key}\`,
326
+ }, ({ token }) => h('div', {
327
+ class: '__hst-truncate',
328
+ style: {
329
+ letterSpacing: token.value,
330
+ fontSize: \`\${fontSize.value}px\`,
331
+ },
332
+ }, sampleText.value))),
333
+ onMountControls: (api) => mountApp(api, () => [
334
+ h(HstTextarea, {
335
+ title: 'Sample text',
336
+ modelValue: sampleText.value,
337
+ 'onUpdate:modelValue': value => { sampleText.value = value },
338
+ rows: 5,
339
+ }),
340
+ h(HstNumber, {
341
+ title: 'Font size',
342
+ modelValue: fontSize.value,
343
+ 'onUpdate:modelValue': value => { fontSize.value = value },
344
+ min: 1,
345
+ }),
346
+ ]),
347
+ },
348
+ {
349
+ id: 'line-height',
350
+ title: 'Line Height',
351
+ icon: 'carbon:text-font',
352
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
353
+ tokens: config.theme.lineHeight,
354
+ getName: key => \`\${config.prefix ?? ''}leading-\${key}\`,
355
+ }, ({ token }) => h('div', {
356
+ style: {
357
+ lineHeight: token.value,
358
+ },
359
+ }, sampleText.value))),
360
+ onMountControls: (api) => mountApp(api, () => [
361
+ h(HstTextarea, {
362
+ title: 'Sample text',
363
+ modelValue: sampleText.value,
364
+ 'onUpdate:modelValue': value => { sampleText.value = value },
365
+ rows: 5,
366
+ }),
367
+ // @TODO select font size
368
+ ]),
369
+ },
370
+ {
371
+ id: 'drop-shadow',
372
+ title: 'Drop Shadow',
373
+ icon: 'carbon:shape-except',
374
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
375
+ tokens: config.theme.dropShadow,
376
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'drop-shadow' : \`drop-shadow-\${key}\`),
377
+ colSize: 180,
378
+ }, ({ token }) => h('div', {
379
+ class: '__hst-drop-shadow',
380
+ style: {
381
+ filter: \`\${(Array.isArray(token.value) ? token.value : [token.value]).map(v => \`drop-shadow(\${v})\`).join(' ')}\`,
382
+ },
383
+ }))),
384
+ },
385
+ {
386
+ id: 'border-radius',
387
+ title: 'Border Radius',
388
+ icon: 'carbon:condition-wait-point',
389
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
390
+ tokens: config.theme.borderRadius,
391
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'rounded' : \`rounded-\${key}\`),
392
+ colSize: 180,
393
+ }, ({ token }) => h('div', {
394
+ class: '__hst-border-radius',
395
+ style: {
396
+ borderRadius: token.value,
397
+ },
398
+ }))),
399
+ },
400
+ {
401
+ id: 'border-width',
402
+ title: 'Border Width',
403
+ icon: 'carbon:checkbox',
404
+ onMount: (api) => mountApp(api, () => h(HstTokenGrid, {
405
+ tokens: config.theme.borderWidth,
406
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'border' : \`border-\${key}\`),
407
+ colSize: 180,
408
+ }, ({ token }) => h('div', {
409
+ class: '__hst-border-width',
410
+ style: {
411
+ borderWidth: token.value,
412
+ },
413
+ }))),
414
+ },
415
+ {
416
+ id: 'width',
417
+ title: 'Width',
418
+ icon: 'carbon:pan-horizontal',
419
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
420
+ tokens: config.theme.width,
421
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'w' : \`w-\${key}\`),
422
+ }, ({ token }) => h('div', {
423
+ class: '__hst-width',
424
+ }, [
425
+ h('div', {
426
+ class: '__hst-width-box',
427
+ style: {
428
+ width: token.value,
429
+ },
430
+ }),
431
+ ]))),
432
+ },
433
+ {
434
+ id: 'height',
435
+ title: 'Height',
436
+ icon: 'carbon:pan-vertical',
437
+ onMount: (api) => mountApp(api, () => h(HstTokenList, {
438
+ tokens: config.theme.height,
439
+ getName: key => (config.prefix ?? '') + (key === 'DEFAULT' ? 'h' : \`h-\${key}\`),
440
+ }, ({ token }) => h('div', {
441
+ class: '__hst-height',
442
+ style: {
443
+ height: token.value,
444
+ },
445
+ }))),
446
+ },
447
+ {
448
+ id: 'full-config',
449
+ title: 'Full Config',
450
+ icon: 'carbon:code',
451
+ onMount: (api) => mountApp(api, () => h('pre', JSON.stringify(config, null, 2))),
452
+ },
453
+ ],
454
+ }`
455
+
456
+ const css = `.__hst-shade {
439
457
  height: 80px;
440
458
  border-radius: 4px;
441
459
  }
442
460
 
443
- .text {
461
+ .__hst-text {
444
462
  font-size: 4rem;
445
463
  display: flex;
446
464
  align-items: flex-end;
447
465
  }
448
466
 
449
- .border {
467
+ .__hst-border {
450
468
  border-style: solid;
451
469
  border-width: 2px;
452
470
  }
453
471
 
454
- .padding {
472
+ .__hst-padding {
455
473
  background-color: rgb(113 113 122 / 0.1);
456
474
  width: min-content;
457
475
  }
458
476
 
459
- .margin {
477
+ .__hst-margin {
460
478
  border: dashed 1px rgb(113 113 122 / 0.5);
461
479
  width: min-content;
462
480
  }
463
481
 
464
- .padding-box,
465
- .margin-box {
482
+ .__hst-padding-box,
483
+ .__hst-margin-box {
466
484
  width: 5rem;
467
485
  height: 5rem;
468
486
  background-color: rgb(113 113 122 / 0.5);
469
487
  }
470
488
 
471
- .padding,
472
- .padding-box,
473
- .margin,
474
- .margin-box,
475
- .drop-shadow {
489
+ .__hst-padding,
490
+ .__hst-padding-box,
491
+ .__hst-margin,
492
+ .__hst-margin-box,
493
+ .__hst-drop-shadow {
476
494
  border-radius: 4px;
477
495
  }
478
496
 
479
- .truncate {
497
+ .__hst-truncate {
480
498
  overflow: hidden;
481
499
  text-overflow: ellipsis;
482
500
  white-space: nowrap;
483
501
  }
484
502
 
485
- .drop-shadow {
503
+ .__hst-drop-shadow {
486
504
  width: 8rem;
487
505
  height: 8rem;
488
506
  background: white;
489
507
  margin-bottom: 0.5rem;
490
508
  }
491
509
 
492
- .dark .drop-shadow {
510
+ .__hst-drop-shadow {
493
511
  background: #4e4e57;
494
512
  }
495
513
 
496
- .border-radius {
514
+ .__hst-border-radius {
497
515
  width: 8rem;
498
516
  height: 8rem;
499
517
  background-color: rgb(113 113 122 / 0.5);
500
518
  }
501
519
 
502
- .border-width {
520
+ .__hst-border-width {
503
521
  width: 8rem;
504
522
  height: 8rem;
505
523
  border-color: rgb(113 113 122 / 0.5);
506
524
  background-color: rgb(113 113 122 / 0.1);
507
525
  }
508
526
 
509
- .width {
527
+ .__hst-width {
510
528
  background-color: rgb(113 113 122 / 0.1);
511
529
  }
512
530
 
513
- .width-box,
514
- .height {
531
+ .__hst-width-box,
532
+ .__hst-height {
515
533
  background-color: rgb(113 113 122 / 0.5);
516
534
  }
517
535
 
518
- .width-box {
536
+ .__hst-width-box {
519
537
  height: 5rem;
520
- }
521
- </style>`
538
+ }`