Skip to content

Commit 1f5ef95

Browse files
authored
Web components: Refactor usa-banner and improve Storybook integration (#189)
* limit custom elements manifest to src/components directory with new config file * remove chromatic plugin * remove unused prop * add storybook helpers to project * hide argref * refactor: move translations to constants and improve type safety * render styles in storybook * fix icon color * use enum instead of type alias to get dropdown in storybook * use template helper * add await for async event * use template helper for custom content. Add slotted selector to make the lock icon work like magic * clean up import * remove tld prop and add tld to slot * remove comment * provide guidance and info about component * update copy * formatting file * add syntax highlighting * add link * update icon aria label
1 parent bd6ba19 commit 1f5ef95

File tree

10 files changed

+295
-7084
lines changed

10 files changed

+295
-7084
lines changed

.storybook/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const config = {
77
addons: [
88
"@storybook/addon-links",
99
"@storybook/addon-docs",
10-
"@chromatic-com/storybook",
1110
"@storybook/addon-a11y",
1211
],
1312
framework: {

.storybook/preview.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
* Custom elements for component docs generation.
33
*/
44
import { setCustomElementsManifest } from "@storybook/web-components-vite";
5+
import { setStorybookHelpersConfig } from "@wc-toolkit/storybook-helpers";
56
import customElements from "../custom-elements.json";
67

78
setCustomElementsManifest(customElements);
9+
setStorybookHelpersConfig({
10+
hideArgRef: true,
11+
});
812

913
/**
1014
*

custom-elements-manifest.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export default {
2+
globs: ["./src/components/**/*.{js,ts}"],
3+
exclude: [
4+
"./src/components/**/*.spec.{js,ts}",
5+
"./src/components/**/*.stories.{js,ts}",
6+
],
7+
litelement: true,
8+
};

0 commit comments

Comments
 (0)