aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/atoms/visually-hidden/visually-hidden.stories.tsx
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-10-04 18:16:55 +0200
committerArmand Philippot <git@armandphilippot.com>2023-11-11 18:14:41 +0100
commita724b4b38bacc631410627395b0d1190a0e8de0d (patch)
tree27bd2704fbaf2c3c7455e5cd424765df91db3d02 /src/components/atoms/visually-hidden/visually-hidden.stories.tsx
parent0e60743d140aff66eca6df712f653ee20f5d4ef3 (diff)
feat(components): add a VisuallyHidden component
Diffstat (limited to 'src/components/atoms/visually-hidden/visually-hidden.stories.tsx')
-rw-r--r--src/components/atoms/visually-hidden/visually-hidden.stories.tsx48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/components/atoms/visually-hidden/visually-hidden.stories.tsx b/src/components/atoms/visually-hidden/visually-hidden.stories.tsx
new file mode 100644
index 0000000..24ac921
--- /dev/null
+++ b/src/components/atoms/visually-hidden/visually-hidden.stories.tsx
@@ -0,0 +1,48 @@
+import type { ComponentMeta, ComponentStory } from '@storybook/react';
+import { Link } from '../links';
+import { VisuallyHidden } from './visually-hidden';
+
+/**
+ * Sidebar - Storybook Meta
+ */
+export default {
+ title: 'Atoms/VisuallyHidden',
+ component: VisuallyHidden,
+ argTypes: {
+ children: {
+ control: {
+ type: 'text',
+ },
+ description: 'The contents to visually hide.',
+ type: {
+ name: 'string',
+ required: true,
+ },
+ },
+ },
+} as ComponentMeta<typeof VisuallyHidden>;
+
+const Template: ComponentStory<typeof VisuallyHidden> = (args) => (
+ <VisuallyHidden {...args} />
+);
+
+/**
+ * VisuallyHidden Stories - Not focusable
+ */
+export const NotFocusable = Template.bind({});
+NotFocusable.args = {
+ children: 'Esse quia deserunt animi id sit voluptatem aperiam.',
+};
+
+/**
+ * VisuallyHidden Stories - Focusable
+ */
+export const Focusable = Template.bind({});
+Focusable.args = {
+ children: (
+ <>
+ {'Esse quia deserunt animi id sit voluptatem aperiam. '}
+ <Link href="#">Any link.</Link>
+ </>
+ ),
+};