Skip to content

Commit

Permalink
migrate other components + add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mucsi96 committed Apr 11, 2024
1 parent 1d6a228 commit c0780e3
Show file tree
Hide file tree
Showing 25 changed files with 6,081 additions and 7,643 deletions.
3 changes: 2 additions & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"EditorConfig.EditorConfig",
"esbenp.prettier-vscode",
"runem.lit-plugin",
"GitHub.copilot"
"GitHub.copilot",
"unifiedjs.vscode-mdx"
]
}
},
Expand Down
14 changes: 6 additions & 8 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import { StorybookConfig } from "@storybook/web-components-vite";
import { StorybookConfig } from '@storybook/web-components-vite';

const config: StorybookConfig = {
stories: [
"../src/**/*.stories.ts",
stories: ['../src/**/*.mdx', '../src/**/*.stories.ts'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials'
],
addons: ["@storybook/addon-links", "@storybook/addon-essentials"],
framework: {
name: "@storybook/web-components-vite",
name: '@storybook/web-components-vite',
options: {},
},
docs: {
autodocs: "tag",
}
};
export default config;
30 changes: 22 additions & 8 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import { Preview } from '@storybook/web-components';
import { html } from 'lit-html';
import '../src/components/main';
import { html as beautifyHtml } from 'js-beautify';
import '../src';

const preview: Preview = {
decorators: [
(story) =>
html`<main is="bt-main" style="height: 100vh; padding: 1rem;">
${story()}
</main>`,
],
parameters: {
layout: 'fullscreen',
viewMode: 'docs',
docs: {
canvas: {
sourceState: 'shown',
},
source: {
transform: (source) => {
const sourceWithoutDecorators = source
.replace(/<div><\/div>/g, '')
.replace(/^\s*\n/gm, '')
.match(/^<main data-name="main=decorator"[^>]*?>([\s\S]*?)<\/main>$/);
const formattedSource = beautifyHtml(
sourceWithoutDecorators ? sourceWithoutDecorators[1] : source,
{
indent_size: 2,
},
);
return formattedSource;
},
},
},
},
};

Expand Down
10 changes: 0 additions & 10 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
- add badge
- add button
- add button group
- add header
- add header menu
- add heading
- add loader
- add main
- add notification
- add notifications
- add number input
- add table
- add text
Loading

0 comments on commit c0780e3

Please sign in to comment.