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.
- package/client.d.ts +1 -3
- package/client.js +1 -0
- package/dist/node/alias.d.ts +0 -1
- package/dist/node/alias.js +5 -6
- package/dist/node/bin.js +1 -0
- package/dist/node/build.js +13 -1
- package/dist/node/builtin-plugins/tailwind-tokens.js +391 -377
- package/dist/node/builtin-plugins/vanilla-support/MountStory.d.ts +14 -0
- package/dist/node/builtin-plugins/vanilla-support/MountStory.js +39 -0
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.d.ts +38 -0
- package/dist/node/builtin-plugins/vanilla-support/RenderStory.js +131 -0
- package/dist/node/builtin-plugins/vanilla-support/client.d.ts +3 -0
- package/dist/node/builtin-plugins/vanilla-support/client.js +5 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.d.ts +2 -0
- package/dist/node/builtin-plugins/vanilla-support/collect.js +33 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.d.ts +2 -0
- package/dist/node/builtin-plugins/vanilla-support/plugin.js +29 -0
- package/dist/node/builtin-plugins/vanilla-support/types.d.ts +35 -0
- package/dist/node/builtin-plugins/vanilla-support/types.js +3 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.d.ts +3 -0
- package/dist/node/builtin-plugins/vanilla-support/vanilla.story.js +55 -0
- package/dist/node/collect/run.js +4 -6
- package/dist/node/config.d.ts +9 -0
- package/dist/node/config.js +16 -0
- package/dist/node/context.d.ts +3 -7
- package/dist/node/context.js +2 -0
- package/dist/node/plugin.d.ts +5 -1
- package/dist/node/server.js +1 -1
- package/dist/node/stories.js +15 -1
- package/dist/node/vite.d.ts +4 -0
- package/dist/node/vite.js +47 -16
- package/package.json +11 -21
- package/src/node/alias.ts +5 -6
- package/src/node/bin.ts +1 -0
- package/src/node/build.ts +13 -1
- package/src/node/builtin-plugins/tailwind-tokens.ts +394 -377
- package/src/node/builtin-plugins/vanilla-support/MountStory.ts +50 -0
- package/src/node/builtin-plugins/vanilla-support/RenderStory.ts +166 -0
- package/src/node/builtin-plugins/vanilla-support/client.ts +6 -0
- package/src/node/builtin-plugins/vanilla-support/collect.ts +42 -0
- package/src/node/builtin-plugins/vanilla-support/plugin.ts +35 -0
- package/src/node/builtin-plugins/vanilla-support/types.ts +40 -0
- package/src/node/builtin-plugins/vanilla-support/vanilla.story.ts +63 -0
- package/src/node/collect/run.ts +4 -8
- package/src/node/config.ts +26 -0
- package/src/node/context.ts +7 -2
- package/src/node/plugin.ts +5 -1
- package/src/node/server.ts +2 -2
- package/src/node/stories.ts +18 -1
- package/src/node/vite.ts +56 -16
- package/tsconfig.json +2 -11
- package/dist/bundled/App.js +0 -166
- package/dist/bundled/_virtual/plugin-vue_export-helper.js +0 -8
- package/dist/bundled/api.js +0 -1
- package/dist/bundled/assets/histoire-text-dark.js +0 -2
- package/dist/bundled/assets/histoire-text.js +0 -2
- package/dist/bundled/assets/histoire.js +0 -2
- package/dist/bundled/components/HomeView.js +0 -24
- package/dist/bundled/components/app/AppHeader.js +0 -67
- package/dist/bundled/components/app/AppLogo.js +0 -26
- package/dist/bundled/components/app/Breadcrumb.js +0 -95
- package/dist/bundled/components/app/Breadcrumb.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/app/InitialLoading.js +0 -48
- package/dist/bundled/components/app/MobileOverlay.js +0 -41
- package/dist/bundled/components/base/BaseCheckbox.js +0 -75
- package/dist/bundled/components/base/BaseEmpty.js +0 -13
- package/dist/bundled/components/base/BaseEmpty.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseListItemLink.js +0 -50
- package/dist/bundled/components/base/BaseOverflowMenu.js +0 -97
- package/dist/bundled/components/base/BaseOverflowTab.js +0 -45
- package/dist/bundled/components/base/BaseSelect.js +0 -88
- package/dist/bundled/components/base/BaseSplitPane.js +0 -184
- package/dist/bundled/components/base/BaseSplitPane.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/base/BaseTab.js +0 -45
- package/dist/bundled/components/misc/CheckerboardPattern.js +0 -41
- package/dist/bundled/components/misc/HatchedPattern.js +0 -11
- package/dist/bundled/components/misc/HatchedPattern.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/panel/ControlsComponentPropItem.js +0 -98
- package/dist/bundled/components/panel/ControlsComponentProps.js +0 -42
- package/dist/bundled/components/panel/PaneTabs.js +0 -131
- package/dist/bundled/components/panel/StatePresets.js +0 -184
- package/dist/bundled/components/panel/StoryControls.js +0 -66
- package/dist/bundled/components/panel/StoryDocs.js +0 -58
- package/dist/bundled/components/panel/StoryEvent.js +0 -56
- package/dist/bundled/components/panel/StoryEvents.js +0 -49
- package/dist/bundled/components/panel/StorySidePanel.js +0 -71
- package/dist/bundled/components/panel/StorySourceCode.js +0 -110
- package/dist/bundled/components/panel/StorySourceCode.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchItem.js +0 -113
- package/dist/bundled/components/search/SearchItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/search/SearchLoading.js +0 -19
- package/dist/bundled/components/search/SearchModal.js +0 -46
- package/dist/bundled/components/search/SearchPane.js +0 -263
- package/dist/bundled/components/search/search-docs-data.js +0 -7
- package/dist/bundled/components/search/search-title-data.js +0 -7
- package/dist/bundled/components/story/StoryResponsivePreview.js +0 -180
- package/dist/bundled/components/story/StoryResponsivePreview.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantGrid.js +0 -94
- package/dist/bundled/components/story/StoryVariantGridItem.js +0 -106
- package/dist/bundled/components/story/StoryVariantGridItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantListItem.js +0 -58
- package/dist/bundled/components/story/StoryVariantListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSingle.js +0 -115
- package/dist/bundled/components/story/StoryVariantSingle.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/story/StoryVariantSinglePreviewNative.js +0 -43
- package/dist/bundled/components/story/StoryVariantSinglePreviewRemote.js +0 -119
- package/dist/bundled/components/story/StoryVariantSingleView.js +0 -49
- package/dist/bundled/components/story/StoryView.js +0 -107
- package/dist/bundled/components/story/StoryViewer.js +0 -57
- package/dist/bundled/components/story/StoryViewer.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantBackground.js +0 -85
- package/dist/bundled/components/toolbar/StoryVariantBackground.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/toolbar/StoryVariantNewTab.js +0 -33
- package/dist/bundled/components/toolbar/StoryVariantResponsiveSize.js +0 -129
- package/dist/bundled/components/toolbar/StoryVariantTitle.js +0 -24
- package/dist/bundled/components/tree/StoryGroup.js +0 -74
- package/dist/bundled/components/tree/StoryList.js +0 -37
- package/dist/bundled/components/tree/StoryListFolder.js +0 -89
- package/dist/bundled/components/tree/StoryListFolder.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/components/tree/StoryListItem.js +0 -72
- package/dist/bundled/components/tree/StoryListItem.vue_vue_type_style_index_0_scoped_true_lang.js +0 -2
- package/dist/bundled/index.js +0 -29
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/common.js +0 -40
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/en.js +0 -5
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/advanced.js +0 -11
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/balance.js +0 -26
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang/latin/simple.js +0 -10
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/lang.js +0 -50
- package/dist/bundled/node_modules/.pnpm/flexsearch@0.7.21/node_modules/flexsearch/dist/module/type.js +0 -8
- package/dist/bundled/router.js +0 -28
- package/dist/bundled/sandbox.js +0 -87
- package/dist/bundled/stores/events.js +0 -29
- package/dist/bundled/stores/folder.js +0 -46
- package/dist/bundled/stores/preview-settings.js +0 -15
- package/dist/bundled/stores/story.js +0 -43
- package/dist/bundled/style.css +0 -102
- package/dist/bundled/util/config.js +0 -4
- package/dist/bundled/util/const.js +0 -5
- package/dist/bundled/util/dark.js +0 -4
- package/dist/bundled/util/env.js +0 -2
- package/dist/bundled/util/events.js +0 -32
- package/dist/bundled/util/keyboard.js +0 -84
- package/dist/bundled/util/mapping.js +0 -94
- package/dist/bundled/util/preview-settings.js +0 -6
- package/dist/bundled/util/responsive.js +0 -3
- package/dist/bundled/util/sandbox.js +0 -8
- package/dist/bundled/util/scroll.js +0 -28
- package/dist/bundled/util/state.js +0 -31
- package/dist/bundled/util/tooltip.js +0 -12
- package/dist/bundled/util/variant.js +0 -35
- package/dist/client/app/App.vue +0 -162
- package/dist/client/app/api.d.ts +0 -1
- package/dist/client/app/api.js +0 -1
- package/dist/client/app/assets/histoire-text-dark.svg +0 -89
- package/dist/client/app/assets/histoire-text.svg +0 -89
- package/dist/client/app/assets/histoire.svg +0 -51
- package/dist/client/app/components/HomeView.vue +0 -17
- package/dist/client/app/components/app/AppHeader.vue +0 -64
- package/dist/client/app/components/app/AppLogo.vue +0 -24
- package/dist/client/app/components/app/Breadcrumb.vue +0 -98
- package/dist/client/app/components/app/InitialLoading.vue +0 -44
- package/dist/client/app/components/app/MobileOverlay.vue +0 -33
- package/dist/client/app/components/base/BaseCheckbox.vue +0 -77
- package/dist/client/app/components/base/BaseCopyIcon.vue +0 -34
- package/dist/client/app/components/base/BaseEmpty.vue +0 -21
- package/dist/client/app/components/base/BaseListItemLink.vue +0 -55
- package/dist/client/app/components/base/BaseOverflowMenu.vue +0 -119
- package/dist/client/app/components/base/BaseOverflowTab.vue +0 -46
- package/dist/client/app/components/base/BaseSelect.vue +0 -72
- package/dist/client/app/components/base/BaseSplitPane.vue +0 -240
- package/dist/client/app/components/base/BaseTab.vue +0 -46
- package/dist/client/app/components/misc/CheckerboardPattern.vue +0 -32
- package/dist/client/app/components/misc/HatchedPattern.vue +0 -13
- package/dist/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
- package/dist/client/app/components/panel/ControlsComponentProps.vue +0 -34
- package/dist/client/app/components/panel/PaneTabs.vue +0 -89
- package/dist/client/app/components/panel/StatePresets.vue +0 -196
- package/dist/client/app/components/panel/StoryControls.vue +0 -68
- package/dist/client/app/components/panel/StoryDocs.vue +0 -61
- package/dist/client/app/components/panel/StoryEvent.vue +0 -54
- package/dist/client/app/components/panel/StoryEvents.vue +0 -45
- package/dist/client/app/components/panel/StorySidePanel.vue +0 -69
- package/dist/client/app/components/panel/StorySourceCode.vue +0 -116
- package/dist/client/app/components/search/SearchItem.vue +0 -110
- package/dist/client/app/components/search/SearchLoading.vue +0 -16
- package/dist/client/app/components/search/SearchModal.vue +0 -43
- package/dist/client/app/components/search/SearchPane.vue +0 -293
- package/dist/client/app/components/search/search-docs-data.d.ts +0 -3
- package/dist/client/app/components/search/search-docs-data.js +0 -7
- package/dist/client/app/components/search/search-title-data.d.ts +0 -3
- package/dist/client/app/components/search/search-title-data.js +0 -7
- package/dist/client/app/components/search/types.d.ts +0 -7
- package/dist/client/app/components/search/types.js +0 -1
- package/dist/client/app/components/story/StoryResponsivePreview.vue +0 -204
- package/dist/client/app/components/story/StoryVariantGrid.vue +0 -112
- package/dist/client/app/components/story/StoryVariantGridItem.vue +0 -110
- package/dist/client/app/components/story/StoryVariantListItem.vue +0 -50
- package/dist/client/app/components/story/StoryVariantSingle.vue +0 -105
- package/dist/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
- package/dist/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
- package/dist/client/app/components/story/StoryVariantSingleView.vue +0 -52
- package/dist/client/app/components/story/StoryView.vue +0 -96
- package/dist/client/app/components/story/StoryViewer.vue +0 -53
- package/dist/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
- package/dist/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
- package/dist/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
- package/dist/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
- package/dist/client/app/components/tree/StoryGroup.vue +0 -75
- package/dist/client/app/components/tree/StoryList.vue +0 -35
- package/dist/client/app/components/tree/StoryListFolder.vue +0 -89
- package/dist/client/app/components/tree/StoryListItem.vue +0 -71
- package/dist/client/app/index.d.ts +0 -2
- package/dist/client/app/index.js +0 -28
- package/dist/client/app/router.d.ts +0 -2
- package/dist/client/app/router.js +0 -26
- package/dist/client/app/sandbox.d.ts +0 -1
- package/dist/client/app/sandbox.js +0 -87
- package/dist/client/app/stores/events.d.ts +0 -29
- package/dist/client/app/stores/events.js +0 -25
- package/dist/client/app/stores/folder.d.ts +0 -10
- package/dist/client/app/stores/folder.js +0 -47
- package/dist/client/app/stores/preview-settings.d.ts +0 -8
- package/dist/client/app/stores/preview-settings.js +0 -14
- package/dist/client/app/stores/story.d.ts +0 -362
- package/dist/client/app/stores/story.js +0 -39
- package/dist/client/app/style/floating-vue.pcss +0 -34
- package/dist/client/app/style/main.pcss +0 -86
- package/dist/client/app/style/sandbox.css +0 -19
- package/dist/client/app/style/transitions.pcss +0 -51
- package/dist/client/app/types.d.ts +0 -34
- package/dist/client/app/types.js +0 -1
- package/dist/client/app/util/config.d.ts +0 -3
- package/dist/client/app/util/config.js +0 -4
- package/dist/client/app/util/const.d.ts +0 -4
- package/dist/client/app/util/const.js +0 -4
- package/dist/client/app/util/dark.d.ts +0 -2
- package/dist/client/app/util/dark.js +0 -3
- package/dist/client/app/util/env.d.ts +0 -1
- package/dist/client/app/util/env.js +0 -1
- package/dist/client/app/util/events.d.ts +0 -1
- package/dist/client/app/util/events.js +0 -31
- package/dist/client/app/util/keyboard.d.ts +0 -8
- package/dist/client/app/util/keyboard.js +0 -82
- package/dist/client/app/util/mapping.d.ts +0 -3
- package/dist/client/app/util/mapping.js +0 -85
- package/dist/client/app/util/preview-settings.d.ts +0 -9
- package/dist/client/app/util/preview-settings.js +0 -5
- package/dist/client/app/util/responsive.d.ts +0 -1
- package/dist/client/app/util/responsive.js +0 -2
- package/dist/client/app/util/sandbox.d.ts +0 -2
- package/dist/client/app/util/sandbox.js +0 -7
- package/dist/client/app/util/scroll.d.ts +0 -4
- package/dist/client/app/util/scroll.js +0 -27
- package/dist/client/app/util/state.d.ts +0 -1
- package/dist/client/app/util/state.js +0 -31
- package/dist/client/app/util/tooltip.d.ts +0 -6
- package/dist/client/app/util/tooltip.js +0 -11
- package/dist/client/app/util/variant.d.ts +0 -18
- package/dist/client/app/util/variant.js +0 -17
- package/dist/client/bundle-index.js +0 -5
- package/dist/client/bundle-main.js +0 -5
- package/dist/client/bundle-sandbox.js +0 -2
- package/dist/client/index.d.ts +0 -9
- package/dist/client/index.js +0 -4
- package/dist/style.css +0 -2382
- package/postcss.config.cjs +0 -8
- package/scripts/copy.mjs +0 -12
- package/scripts/watchAndCopy.mjs +0 -15
- package/src/client/app/App.vue +0 -162
- package/src/client/app/api.ts +0 -1
- package/src/client/app/assets/histoire-text-dark.svg +0 -89
- package/src/client/app/assets/histoire-text.svg +0 -89
- package/src/client/app/assets/histoire.svg +0 -51
- package/src/client/app/components/HomeView.vue +0 -17
- package/src/client/app/components/app/AppHeader.vue +0 -64
- package/src/client/app/components/app/AppLogo.vue +0 -24
- package/src/client/app/components/app/Breadcrumb.vue +0 -98
- package/src/client/app/components/app/InitialLoading.vue +0 -44
- package/src/client/app/components/app/MobileOverlay.vue +0 -33
- package/src/client/app/components/base/BaseCheckbox.vue +0 -77
- package/src/client/app/components/base/BaseCopyIcon.vue +0 -34
- package/src/client/app/components/base/BaseEmpty.vue +0 -21
- package/src/client/app/components/base/BaseListItemLink.vue +0 -55
- package/src/client/app/components/base/BaseOverflowMenu.vue +0 -119
- package/src/client/app/components/base/BaseOverflowTab.vue +0 -46
- package/src/client/app/components/base/BaseSelect.vue +0 -72
- package/src/client/app/components/base/BaseSplitPane.vue +0 -240
- package/src/client/app/components/base/BaseTab.vue +0 -46
- package/src/client/app/components/misc/CheckerboardPattern.vue +0 -32
- package/src/client/app/components/misc/HatchedPattern.vue +0 -13
- package/src/client/app/components/panel/ControlsComponentPropItem.vue +0 -103
- package/src/client/app/components/panel/ControlsComponentProps.vue +0 -34
- package/src/client/app/components/panel/PaneTabs.vue +0 -89
- package/src/client/app/components/panel/StatePresets.vue +0 -196
- package/src/client/app/components/panel/StoryControls.vue +0 -68
- package/src/client/app/components/panel/StoryDocs.vue +0 -61
- package/src/client/app/components/panel/StoryEvent.vue +0 -54
- package/src/client/app/components/panel/StoryEvents.vue +0 -45
- package/src/client/app/components/panel/StorySidePanel.vue +0 -69
- package/src/client/app/components/panel/StorySourceCode.vue +0 -116
- package/src/client/app/components/search/SearchItem.vue +0 -110
- package/src/client/app/components/search/SearchLoading.vue +0 -16
- package/src/client/app/components/search/SearchModal.vue +0 -43
- package/src/client/app/components/search/SearchPane.vue +0 -293
- package/src/client/app/components/search/search-docs-data.ts +0 -10
- package/src/client/app/components/search/search-title-data.ts +0 -10
- package/src/client/app/components/search/types.ts +0 -4
- package/src/client/app/components/story/StoryResponsivePreview.vue +0 -204
- package/src/client/app/components/story/StoryVariantGrid.vue +0 -112
- package/src/client/app/components/story/StoryVariantGridItem.vue +0 -110
- package/src/client/app/components/story/StoryVariantListItem.vue +0 -50
- package/src/client/app/components/story/StoryVariantSingle.vue +0 -105
- package/src/client/app/components/story/StoryVariantSinglePreviewNative.vue +0 -42
- package/src/client/app/components/story/StoryVariantSinglePreviewRemote.vue +0 -139
- package/src/client/app/components/story/StoryVariantSingleView.vue +0 -52
- package/src/client/app/components/story/StoryView.vue +0 -96
- package/src/client/app/components/story/StoryViewer.vue +0 -53
- package/src/client/app/components/toolbar/StoryVariantBackground.vue +0 -67
- package/src/client/app/components/toolbar/StoryVariantNewTab.vue +0 -29
- package/src/client/app/components/toolbar/StoryVariantResponsiveSize.vue +0 -82
- package/src/client/app/components/toolbar/StoryVariantTitle.vue +0 -21
- package/src/client/app/components/tree/StoryGroup.vue +0 -75
- package/src/client/app/components/tree/StoryList.vue +0 -35
- package/src/client/app/components/tree/StoryListFolder.vue +0 -89
- package/src/client/app/components/tree/StoryListItem.vue +0 -71
- package/src/client/app/index.ts +0 -30
- package/src/client/app/router.ts +0 -29
- package/src/client/app/sandbox.ts +0 -95
- package/src/client/app/stores/events.ts +0 -36
- package/src/client/app/stores/folder.ts +0 -59
- package/src/client/app/stores/preview-settings.ts +0 -17
- package/src/client/app/stores/story.ts +0 -47
- package/src/client/app/style/floating-vue.pcss +0 -34
- package/src/client/app/style/main.pcss +0 -86
- package/src/client/app/style/sandbox.css +0 -19
- package/src/client/app/style/transitions.pcss +0 -51
- package/src/client/app/types.ts +0 -46
- package/src/client/app/util/config.ts +0 -6
- package/src/client/app/util/const.ts +0 -4
- package/src/client/app/util/dark.ts +0 -4
- package/src/client/app/util/env.ts +0 -1
- package/src/client/app/util/events.ts +0 -30
- package/src/client/app/util/keyboard.ts +0 -99
- package/src/client/app/util/mapping.ts +0 -91
- package/src/client/app/util/preview-settings.ts +0 -8
- package/src/client/app/util/responsive.ts +0 -3
- package/src/client/app/util/sandbox.ts +0 -10
- package/src/client/app/util/scroll.ts +0 -31
- package/src/client/app/util/state.ts +0 -37
- package/src/client/app/util/tooltip.ts +0 -13
- package/src/client/app/util/variant.ts +0 -20
- package/src/client/bundle-index.js +0 -5
- package/src/client/bundle-main.js +0 -5
- package/src/client/bundle-sandbox.js +0 -2
- package/src/client/index.ts +0 -13
- package/src/client/shim.d.ts +0 -7
- package/tailwind.config.cjs +0 -126
- package/vite.config.ts +0 -87
- 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.
|
|
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) =>
|
|
73
|
-
import '
|
|
74
|
-
import { ref } from 'vue'
|
|
75
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
:
|
|
116
|
-
:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
title
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
:
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
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
|
-
.
|
|
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
|
+
}`;
|