Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelh1983 committed Feb 13, 2025
2 parents 57a51f7 + d201668 commit 16e76fd
Show file tree
Hide file tree
Showing 9 changed files with 520 additions and 31 deletions.
30 changes: 30 additions & 0 deletions .storybook/DocumentationTemplate.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Meta, Title, Primary, Controls, Stories } from '@storybook/blocks';

{/*
- 👇 The isTemplate property is required to tell Storybook that this is a template
- See https://storybook.js.org/docs/api/doc-blocks/doc-block-meta
- to learn how to use
*/}

<Meta isTemplate />

<Title />

{/* # Default implementation */}

{/* <Primary /> */}

{/* ## Inputs */}

{/* The component accepts the following inputs (props): */}

{/* <Controls /> */}

---

{/* ## Additional variations */}

{/* Listed below are additional variations of the component. */}

<Stories />
18 changes: 17 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { setCustomElementsManifest } from '@storybook/web-components';
import { setWcStorybookHelpersConfig } from 'wc-storybook-helpers';
import { withActions } from '@storybook/addon-actions/decorator';
import prettier from 'prettier-v2'; /* https://github.com/storybookjs/storybook/issues/8078#issuecomment-2325332120 */
import HTMLParser from 'prettier-v2/parser-html'; /* https://github.com/storybookjs/storybook/issues/8078#issuecomment-2325332120 */

import customElements from '../custom-elements.json';
import { customViewports } from './custom-viewport-sizes';
import DocumentationTemplate from './DocumentationTemplate.mdx';

import type { Preview } from '@storybook/web-components';

Expand All @@ -30,7 +33,20 @@ const preview: Preview = {
decorators: [withActions],

parameters: {
docs: { toc: true },
docs: {
toc: true,
source: {
/* FIXME EVENTUALLY https://github.com/storybookjs/storybook/issues/8078#issuecomment-2325332120 */
transform: input =>
prettier.format(input, {
parser: 'html',
plugins: [HTMLParser],
printWidth: 140,
htmlWhitespaceSensitivity: 'ignore'
})
},
page: DocumentationTemplate
},
viewport: { viewports: customViewports },
controls: {
expanded: true,
Expand Down
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
"postcss-import": "^16.1.0",
"postcss-nesting": "^13.0.1",
"prettier": "3.4.2",
"prettier-v2": "npm:[email protected]",
"remark-gfm": "^4.0.0",
"shadow-dom-testing-library": "^1.11.3",
"stampino": "^0.8.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ export const ChoicesMixin = <T extends Constructor<Interaction>>(superClass: T,
`Please select no more than ${this.maxChoices} ${this.maxChoices === 1 ? 'option' : 'options'}.`;
} else if (selectedCount < this.minChoices) {
isValid = false;
validityMessage = `Please select at least ${this.minChoices} ${this.minChoices === 1 ? 'option' : 'options'}.`;
validityMessage =
this.dataset.minSelectionsMessage ||
`Please select at least ${this.minChoices} ${this.minChoices === 1 ? 'option' : 'options'}.`;
}

if (selectedChoices.length > 0) {
Expand Down
Loading

0 comments on commit 16e76fd

Please sign in to comment.