From 8c5b3a1c6591e8644fa0c7aed0698c0bafcbaa42 Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Fri, 12 Jan 2024 14:55:07 -0800 Subject: [PATCH] EuiCopy --- src/components/copy/copy.stories.tsx | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/components/copy/copy.stories.tsx diff --git a/src/components/copy/copy.stories.tsx b/src/components/copy/copy.stories.tsx new file mode 100644 index 00000000000..e3f0217ade7 --- /dev/null +++ b/src/components/copy/copy.stories.tsx @@ -0,0 +1,37 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0 and the Server Side Public License, v 1; you may not use this file except + * in compliance with, at your election, the Elastic License 2.0 or the Server + * Side Public License, v 1. + */ + +import React from 'react'; +import type { Meta, StoryObj } from '@storybook/react'; + +import { EuiButton } from '../button'; + +import { EuiCopy, EuiCopyProps } from './copy'; + +const meta: Meta = { + title: 'EuiCopy', + component: EuiCopy, + argTypes: { + afterMessage: { control: 'text' }, + beforeMessage: { control: 'text' }, + }, + args: { + // Component defaults + afterMessage: 'Copied', + }, +}; + +export default meta; +type Story = StoryObj; + +export const Playground: Story = { + args: { + textToCopy: 'Hello world', + children: (copy) => Click to copy, + }, +};