diff --git a/.storybook/main.js b/.storybook/main.js index 74017546..391bee1e 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,8 +1,11 @@ import remarkGfm from "remark-gfm"; module.exports = { stories: [ - "../stories/frameworks/**/*.mdx", - "../stories/getting-started/**/*.mdx", + "../stories/style/**/*.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/usage/**/*.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/migration/**/*.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/frameworks/**/*.@(mdx|stories.@(js|jsx|ts|tsx))", + "../stories/getting-started/**/*.@(mdx|stories.@(js|jsx|ts|tsx))", // "../stories/components/*.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Accordion.@(mdx|stories.@(js|jsx|ts|tsx))", "../stories/components/Alert.@(mdx|stories.@(js|jsx|ts|tsx))", diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 13f97d60..36afcee8 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -5,6 +5,7 @@ import customElements from "../custom-elements.json"; import "../lib/index.js"; import "../lib/themes/day.css"; import "../lib/themes/night.css"; +import "../lib/css/sgds.css"; import "./global.css"; import sgdsTheme from "./sgdsTheme"; @@ -54,6 +55,7 @@ export const parameters = { "Migration", "Usage", "Frameworks", + ["Angular", "Vue", "React", "NextJS"], "Style", "Troubleshooting", "Components", diff --git a/docs/FoundationalStyles.md b/docs/FoundationalStyles.md index 1248d4d9..503ddd2b 100644 --- a/docs/FoundationalStyles.md +++ b/docs/FoundationalStyles.md @@ -41,7 +41,7 @@ import "@govtechsg/sgds-web-component/css/sgds.css" @import "@govtechsg/sgds-web-component/css/sgds.css"; ``` -### Cherry pick the styles + -``` + diff --git a/docs/INSTALLATION.md b/docs/INSTALLATION.md index 3c46df10..2a3b2bd0 100644 --- a/docs/INSTALLATION.md +++ b/docs/INSTALLATION.md @@ -62,13 +62,13 @@ This method registers all SGDS elements up front in the Custom Elements Registry // load scoped custom element registry polyfill first (optional, depends on use case) // Load global css file - + // it is recommended to load a particular version when using cdn e.g. https://cdn.jsdelivr.net/npm/@govtechsg/sgds-web-component@1.0.2 - + //or load a single component e.g. Masthead - + ``` diff --git a/docs/Imports.md b/docs/Imports.md index 29369296..f005a407 100644 --- a/docs/Imports.md +++ b/docs/Imports.md @@ -1,5 +1,9 @@ # Imports +## React users + +Are you a react user? If so, skip to the react setup + ## Using the custom elements Once imported, the custom elements can be used throughout the project. @@ -15,7 +19,7 @@ import "@govtechsg/sgds-web-component/components/Button"; // Hello World ``` -## Using the component's class object +## Typescript: Using the component's class object When writing with Typescript, you might be required to type the components in certain cases. Import the component class like so. Each component's Class is exported via named exports, prefixed with `Sgds`. diff --git a/docs/Introduction.md b/docs/Introduction.md index ed328bee..dc49cc0c 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -6,13 +6,13 @@
- SGDS v3 + SGDS v3 Learn more -

The components are shipped with SGDS v2 styles and can be used straight out of the box.

+

The component library for SGDS v3. New skins and dark theme introduced

About web components - Learn more + Learn more

Unfamiliar with web components? Find out more about web components.

@@ -22,12 +22,12 @@ Customisable with CSS - Learn more -

Components are customisable with cssparts, css custom variables and class-like properties.

+ Learn more +

Change up the default theme via CSS variables

Works with CDNs - Learn more + Learn more

Besides whole library CDN, each component also has its own CDN.

@@ -42,6 +42,6 @@ Extendable

Our components are built with LitElement and are extendable. Use them as building blocks to create your complex component.

- Learn more + Learn more
diff --git a/docs/Next.md b/docs/Next.md index 0a97e4fe..8f140131 100644 --- a/docs/Next.md +++ b/docs/Next.md @@ -1,5 +1,7 @@ # NextJs +Pre-requisite: please read documentation on React prior to this. + Web components are client components as they rely heavily on document and window API that is only present in the browser. diff --git a/docs/React.md b/docs/React.md index 23526f34..bde51067 100644 --- a/docs/React.md +++ b/docs/React.md @@ -69,28 +69,4 @@ function MyComponent() { export default MyComponent; -``` - -## Using web components - Importing the library - -Follow [import instructions](/story/getting-started-imports--page) - -## Using web components - Typescript - -For React Typescript users, you will often face this error : `Property 'sgds-masthead' does not exist on type 'JSX.IntrinsicElements'.` - -Solution: Typed the custom elements that you are using in your directory's types.d.ts file - -```jsx -//types.d.ts file -import * as React from 'react' - -declare global { - namespace JSX { - interface IntrinsicElements { - "sgds-masthead": React.DetailedHTMLProps, HTMLElement>; - } - } -} -``` - +``` \ No newline at end of file diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 703e0e3c..dfdd5212 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -3,6 +3,8 @@ const { src, dest, task } = require("gulp"); const { getFolders } = require("./scripts/buildUtils.js"); const fs = require("fs"); const order = require("gulp-order"); +const replace = require("gulp-replace"); +const { version } = require("./package.json"); exports.default = task("build-readme", () => { return src("docs/*.md") @@ -45,3 +47,9 @@ exports.default = task("concat-storybook-mdx", done => { } else return done(); }); }); + +exports.default = task("replace-version", () => { + return src("docs/INSTALLATION.md") + .pipe(replace(//g, version)) + .pipe(dest("./docs")); +}); diff --git a/package-lock.json b/package-lock.json index e6b9be37..3c0ddd19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -71,6 +71,7 @@ "gulp": "^5.0.0", "gulp-concat": "^2.6.1", "gulp-order": "^1.2.0", + "gulp-replace": "^1.1.4", "husky": "^8.0.0", "lodash": "^4.17.21", "nodemon": "^2.0.22", @@ -4253,6 +4254,12 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, + "node_modules/@types/expect": { + "version": "1.20.4", + "resolved": "https://registry.npmjs.org/@types/expect/-/expect-1.20.4.tgz", + "integrity": "sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==", + "dev": true + }, "node_modules/@types/express": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", @@ -4597,6 +4604,16 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, + "node_modules/@types/vinyl": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.12.tgz", + "integrity": "sha512-Sr2fYMBUVGYq8kj3UthXFAu5UN6ZW+rYr4NACjZQJvHvj+c8lYv0CahmZ2P/r7iUkN44gGUBwqxZkrKXYPb7cw==", + "dev": true, + "dependencies": { + "@types/expect": "^1.20.4", + "@types/node": "*" + } + }, "node_modules/@types/ws": { "version": "7.4.7", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", @@ -6778,6 +6795,18 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/binaryextensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binaryextensions/-/binaryextensions-2.3.0.tgz", + "integrity": "sha512-nAihlQsYGyc5Bwq6+EsubvANYGExeJKHDO3RjnvwU042fawQTQfM3Kxn7IHUXQOz4bzfwsGYYHGSvXyW4zOGLg==", + "dev": true, + "engines": { + "node": ">=0.8" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, "node_modules/bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", @@ -11602,6 +11631,22 @@ "node": "*" } }, + "node_modules/gulp-replace": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/gulp-replace/-/gulp-replace-1.1.4.tgz", + "integrity": "sha512-SVSF7ikuWKhpAW4l4wapAqPPSToJoiNKsbDoUnRrSgwZHH7lH8pbPeQj1aOVYQrbZKhfSVBxVW+Py7vtulRktw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "@types/vinyl": "^2.0.4", + "istextorbinary": "^3.0.0", + "replacestream": "^4.0.3", + "yargs-parser": ">=5.0.0-security.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/gulplog": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-2.2.0.tgz", @@ -13068,6 +13113,22 @@ "node": ">=8" } }, + "node_modules/istextorbinary": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istextorbinary/-/istextorbinary-3.3.0.tgz", + "integrity": "sha512-Tvq1W6NAcZeJ8op+Hq7tdZ434rqnMx4CCZ7H0ff83uEloDvVbqAwaMTZcafKGJT0VHkYzuXUiCY4hlXQg6WfoQ==", + "dev": true, + "dependencies": { + "binaryextensions": "^2.2.0", + "textextensions": "^3.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -15724,6 +15785,15 @@ "url": "https://github.com/fb55/nth-check?sponsor=1" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/object-inspect": { "version": "1.13.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -18146,6 +18216,53 @@ "node": ">= 10.13.0" } }, + "node_modules/replacestream": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/replacestream/-/replacestream-4.0.3.tgz", + "integrity": "sha512-AC0FiLS352pBBiZhd4VXB1Ab/lh0lEgpP+GGvZqbQh8a5cmXVoTe5EX/YeTFArnp4SRGTHh1qCHu9lGs1qG8sA==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.3", + "object-assign": "^4.0.1", + "readable-stream": "^2.0.2" + } + }, + "node_modules/replacestream/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/replacestream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/replacestream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/replacestream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/request-progress": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", @@ -20127,6 +20244,18 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, + "node_modules/textextensions": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/textextensions/-/textextensions-3.3.0.tgz", + "integrity": "sha512-mk82dS8eRABNbeVJrEiN5/UMSCliINAuz8mkUwH4SwslkNP//gbEzlWNS5au0z5Dpx40SQxzqZevZkn+WYJ9Dw==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://bevry.me/fund" + } + }, "node_modules/throttleit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", diff --git a/package.json b/package.json index 78990127..2b14de6f 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,13 @@ "build": "npm run build:react && rm -rf lib && rollup --config rollup.config.mjs && node ./scripts/frankBuild.js", "build:react": "npm run cem && node ./scripts/makeReact.mjs", "build:readme": "gulp build-readme", - "write:stories": "npm run cem && node ./scripts/generateStories.mjs && npm run concat:stories", + "write:stories": "npm run cem && node ./scripts/generateStories.mjs && npm run concat:stories && npm run update:version", "write:component": "plop", "test": "rm -rf test-outdir && rollup --config rollup.test.config.js && web-test-runner", "test:scripts": "wtr scripts/__tests__/**/*.test.js --node-resolve", "prepare": "husky install", "concat:stories": "gulp concat-stories-js && gulp concat-storybook-mdx", + "update:version": "gulp replace-version", "format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"", "lint": "eslint --ignore-path .gitignore --ext .js,.ts .", "lint:fix": "npm run lint -- --fix", @@ -106,6 +107,7 @@ "gulp": "^5.0.0", "gulp-concat": "^2.6.1", "gulp-order": "^1.2.0", + "gulp-replace": "^1.1.4", "husky": "^8.0.0", "lodash": "^4.17.21", "nodemon": "^2.0.22", diff --git a/src/css/reboot.css b/src/css/reboot.css index bd6679a5..476a268f 100644 --- a/src/css/reboot.css +++ b/src/css/reboot.css @@ -59,6 +59,7 @@ h6 { color: var(--sgds-header-color); font-family: var(--sgds-font-family-brand); font-style: normal; + margin-top: var(--sgds-margin-none); } h1, h2, @@ -92,7 +93,7 @@ h2 { margin-bottom: var(--sgds-margin-2-xs); } h3 { - font-size: var(---sgds-font-size-5); + font-size: var(--sgds-font-size-5); margin-bottom: var(--sgds-margin-2-xs); } h4 { @@ -126,6 +127,7 @@ p { font-family: var(--sgds-font-family-brand); line-height: var(--sgds-line-height-body); letter-spacing: var(--sgds-letter-spacing-normal); + margin-top: var(--sgds-margin-none); } /* ANCHOR */ diff --git a/stories/getting-started/Frameworks/Angular.mdx b/stories/frameworks/Angular.mdx similarity index 69% rename from stories/getting-started/Frameworks/Angular.mdx rename to stories/frameworks/Angular.mdx index 0e4a3d54..a692e4eb 100644 --- a/stories/getting-started/Frameworks/Angular.mdx +++ b/stories/frameworks/Angular.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import Angular from "../../../docs/Angular.md?raw"; +import Angular from "../../docs/Angular.md?raw"; diff --git a/stories/getting-started/Frameworks/Next.mdx b/stories/frameworks/Next.mdx similarity index 70% rename from stories/getting-started/Frameworks/Next.mdx rename to stories/frameworks/Next.mdx index c8175f37..cd961e94 100644 --- a/stories/getting-started/Frameworks/Next.mdx +++ b/stories/frameworks/Next.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import NextDocs from "../../../docs/Next.md?raw"; +import NextDocs from "../../docs/Next.md?raw"; diff --git a/stories/getting-started/Frameworks/React.mdx b/stories/frameworks/React.mdx similarity index 69% rename from stories/getting-started/Frameworks/React.mdx rename to stories/frameworks/React.mdx index 465813ca..70ba1cab 100644 --- a/stories/getting-started/Frameworks/React.mdx +++ b/stories/frameworks/React.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import ReactDocs from "../../../docs/React.md?raw"; +import ReactDocs from "../../docs/React.md?raw"; diff --git a/stories/getting-started/Frameworks/Vue.mdx b/stories/frameworks/Vue.mdx similarity index 71% rename from stories/getting-started/Frameworks/Vue.mdx rename to stories/frameworks/Vue.mdx index f04db36a..bb7dd4ef 100644 --- a/stories/getting-started/Frameworks/Vue.mdx +++ b/stories/frameworks/Vue.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import Vue from "../../../docs/Vue.md?raw"; +import Vue from "../../docs/Vue.md?raw"; diff --git a/stories/getting-started/Style/FoundationStyle.mdx b/stories/getting-started/Style/FoundationStyle.mdx deleted file mode 100644 index 2e2d483a..00000000 --- a/stories/getting-started/Style/FoundationStyle.mdx +++ /dev/null @@ -1,6 +0,0 @@ -import { Meta, Markdown } from "@storybook/blocks"; -import FoundationalStyles from '../../../docs/FoundationalStyles.md?raw'; - - - -{FoundationalStyles} \ No newline at end of file diff --git a/stories/getting-started/Migration/oneToTwo.mdx b/stories/migration/oneToTwo.mdx similarity index 65% rename from stories/getting-started/Migration/oneToTwo.mdx rename to stories/migration/oneToTwo.mdx index ff7499dc..87bf47d5 100644 --- a/stories/getting-started/Migration/oneToTwo.mdx +++ b/stories/migration/oneToTwo.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import versionOneToTwo from '../../../docs/Migration_v1_to_v2.md?raw'; +import versionOneToTwo from '../../docs/Migration_v1_to_v2.md?raw'; diff --git a/stories/getting-started/Migration/twoToThree.mdx b/stories/migration/twoToThree.mdx similarity index 65% rename from stories/getting-started/Migration/twoToThree.mdx rename to stories/migration/twoToThree.mdx index e2762132..1c6123d0 100644 --- a/stories/getting-started/Migration/twoToThree.mdx +++ b/stories/migration/twoToThree.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import versionTwoToThree from '../../../docs/Migration_v2_to_v3.md?raw'; +import versionTwoToThree from '../../docs/Migration_v2_to_v3.md?raw'; diff --git a/stories/style/FoundationStyle.mdx b/stories/style/FoundationStyle.mdx new file mode 100644 index 00000000..2c0ded16 --- /dev/null +++ b/stories/style/FoundationStyle.mdx @@ -0,0 +1,59 @@ +import { Meta, Markdown, Canvas, Story } from "@storybook/blocks"; +import FoundationalStyles from '../../docs/FoundationalStyles.md?raw'; +import * as FoundationStories from "./foundation.stories.js" + + + +{FoundationalStyles} + +## Headings + + + + + +## Paragraph + + + + + +## Anchor + + + + + +## Caption + + + + + +## Label + + + + + +## List + +### Unordered + + + + + +### Ordered + + + + + +## Source files + + \ No newline at end of file diff --git a/stories/getting-started/Style/Theming.mdx b/stories/style/Theming.mdx similarity index 68% rename from stories/getting-started/Style/Theming.mdx rename to stories/style/Theming.mdx index 5895c874..2b6f6fa2 100644 --- a/stories/getting-started/Style/Theming.mdx +++ b/stories/style/Theming.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import Theming from '../../../docs/Theming.md?raw'; +import Theming from '../../docs/Theming.md?raw'; diff --git a/stories/style/foundation.stories.js b/stories/style/foundation.stories.js new file mode 100644 index 00000000..3a1bc4f8 --- /dev/null +++ b/stories/style/foundation.stories.js @@ -0,0 +1,139 @@ +import { html } from "lit-html"; + +export default { + title: "Style/Foundation" +}; + +const HeaderTemplate = () => { + return html` +
+

Header H1

+

Header H2

+

Header H3

+

Header H4

+
Header H5
+
Header H6
+
+ `; +}; +const ParagraphTemplate = () => { + return html` +

+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's + standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a + type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, + remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing + Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions + of Lorem Ipsum. +

+

+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's + standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a + type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, + remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing + Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions + of Lorem Ipsum. +

+ `; +}; +const LabelTemplate = () => { + return html` `; +}; +const CaptionTemplate = () => { + return html` + + Caption + + `; +}; +const AnchorTemplate = () => { + return html` Anchor link `; +}; +const UListTemplate = () => { + return html` + + `; +}; +const OListTemplate = () => { + return html` +
    +
  1. Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..
  2. +
  3. + Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit.. +
      +
    1. Sub of Second
    2. +
    3. Another Sub
    4. +
    +
  4. +
  5. hello world
  6. +
  7. hello world
  8. +
  9. hello world
  10. +
  11. hello world
  12. +
  13. hello world
  14. +
  15. hello world
  16. +
  17. hello world
  18. +
  19. hello world
  20. +
  21. hello world
  22. +
+ `; +}; +export const Headings = { + render: HeaderTemplate.bind({}), + name: "Headings", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const Paragraph = { + render: ParagraphTemplate.bind({}), + name: "Paragraph", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const Label = { + render: LabelTemplate.bind({}), + name: "Label", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const Caption = { + render: CaptionTemplate.bind({}), + name: "Caption", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const Anchor = { + render: AnchorTemplate.bind({}), + name: "Anchor", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const ULists = { + render: UListTemplate.bind({}), + name: "Unordered lists", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; +export const OLists = { + render: OListTemplate.bind({}), + name: "Ordered lists", + args: {}, + parameters: {}, + tags: ["!dev", "!autodocs"] +}; diff --git a/stories/getting-started/Usage/Attributes.mdx b/stories/usage/Attributes.mdx similarity index 67% rename from stories/getting-started/Usage/Attributes.mdx rename to stories/usage/Attributes.mdx index 80329a3c..6608b1f5 100644 --- a/stories/getting-started/Usage/Attributes.mdx +++ b/stories/usage/Attributes.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import AttributeAndProperties from '../../../docs/Attributes.md?raw'; +import AttributeAndProperties from '../../docs/Attributes.md?raw'; diff --git a/stories/getting-started/Usage/Events.mdx b/stories/usage/Events.mdx similarity index 69% rename from stories/getting-started/Usage/Events.mdx rename to stories/usage/Events.mdx index 3cb67890..c3760c78 100644 --- a/stories/getting-started/Usage/Events.mdx +++ b/stories/usage/Events.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from '@storybook/blocks'; -import Events from '../../../docs/Events.md?raw'; +import Events from '../../docs/Events.md?raw'; diff --git a/stories/getting-started/Usage/Extendable.mdx b/stories/usage/Extendable.mdx similarity index 69% rename from stories/getting-started/Usage/Extendable.mdx rename to stories/usage/Extendable.mdx index edae7439..3cc61aee 100644 --- a/stories/getting-started/Usage/Extendable.mdx +++ b/stories/usage/Extendable.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from '@storybook/blocks'; -import Extendable from '../../../docs/Extendable.md?raw'; +import Extendable from '../../docs/Extendable.md?raw'; diff --git a/stories/getting-started/Usage/ScopedElements.mdx b/stories/usage/ScopedElements.mdx similarity index 94% rename from stories/getting-started/Usage/ScopedElements.mdx rename to stories/usage/ScopedElements.mdx index 762dfd57..3e68bd1b 100644 --- a/stories/getting-started/Usage/ScopedElements.mdx +++ b/stories/usage/ScopedElements.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from "@storybook/blocks"; -import ScopedElements from "../../../docs/ScopedElements.md?raw"; +import ScopedElements from "../../docs/ScopedElements.md?raw"; import { getCustomElements } from "@storybook/web-components"; diff --git a/stories/getting-started/Usage/Slots.mdx b/stories/usage/Slots.mdx similarity index 70% rename from stories/getting-started/Usage/Slots.mdx rename to stories/usage/Slots.mdx index 4dca7d7b..ed883de2 100644 --- a/stories/getting-started/Usage/Slots.mdx +++ b/stories/usage/Slots.mdx @@ -1,5 +1,5 @@ import { Meta, Markdown } from '@storybook/blocks'; -import Slots from '../../../docs/Slots.md?raw'; +import Slots from '../../docs/Slots.md?raw';