diff --git a/src/components/input/input.stories.mdx b/src/components/input/input.stories.mdx index 4d05624a1..8bf05f56c 100644 --- a/src/components/input/input.stories.mdx +++ b/src/components/input/input.stories.mdx @@ -1,9 +1,28 @@ import { Story, Canvas, Meta } from '@storybook/addon-docs/blocks'; import { useEffect } from '@storybook/client-api'; -import textDemo from './demo/example.twig'; +import { makeTwigInclude } from '../../make-twig-include'; +// The '!!raw-loader!' syntax is a non-standard, Webpack-specific, syntax. +// See: https://github.com/webpack-contrib/raw-loader#examples +// For now, it seems likely Storybook is pretty tied to Webpack, therefore, we are +// okay with the following Webpack-specific raw loader syntax. It's better to leave +// the ESLint rule enabled globally, and only thoughtfully disable as needed (e.g. +// within a Storybook docs page and not within an actual component). +// This can be revisited in the future if Storybook no longer relies on Webpack. +// eslint-disable-next-line @cloudfour/import/no-webpack-loader-syntax +import selectDemoSource from '!!raw-loader!./demo/select.twig'; import selectDemo from './demo/select.twig'; +import input from './input.twig'; import './demo/styles.scss'; import { createElasticTextArea } from './elastic-textarea.ts'; +const elasticTextAreaConfig = { + type: 'textarea', + value: + 'We are a small, versatile team who care passionately about the web. We’re full of what our industry considers unicorns. Our designers code. Our developers went to art school.', + placeholder: 'Placeholder text…', + id: 'demo-elastic', + rows: 2, + class: 'c-input--elastic js-elastic-textarea', +};