From 7bc6e362076eeb03c685813989fede063b957b07 Mon Sep 17 00:00:00 2001 From: Eric Doughty-Papassideris Date: Sun, 21 Apr 2024 22:10:42 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20front:=20ad?= =?UTF-8?q?ded=20stories=20for=20access-level-dropdown=20and=20copy-link-b?= =?UTF-8?q?utton=20(#50)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../access-level-dropdown.stories.tsx | 75 +++++++++++++++++++ .../public-link/copy-link-button.stories.tsx | 14 ++++ 2 files changed, 89 insertions(+) create mode 100644 tdrive/frontend/src/app/views/client/body/drive/components/access-level-dropdown.stories.tsx create mode 100644 tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.stories.tsx diff --git a/tdrive/frontend/src/app/views/client/body/drive/components/access-level-dropdown.stories.tsx b/tdrive/frontend/src/app/views/client/body/drive/components/access-level-dropdown.stories.tsx new file mode 100644 index 00000000..df48f591 --- /dev/null +++ b/tdrive/frontend/src/app/views/client/body/drive/components/access-level-dropdown.stories.tsx @@ -0,0 +1,75 @@ +import { Meta } from '@storybook/react'; +import { action } from '@storybook/addon-actions'; + +import { AccessLevelDropdown } from './access-level-dropdown'; +import { Input } from '@atoms/input/input-text'; + +const meta: Meta = { + component: AccessLevelDropdown, + argTypes: { + level: { + options: "none read write manage".split(' '), + }, + size: { + options: "(empty string),sm,md,lg".split(','), + mapping: { '(empty string)': '' }, + }, + } +}; +export default meta; + +export const Default = { + args: { + level: "manage", + disabled: false, + className: '', + hiddenLevels: [], + size: 'md', + labelOverrides: {}, + onChange: action('onChange'), + }, + render: (props: React.ComponentProps) => <> + +
Level "none" has a different appearance:
+ + , +}; + +export const NoRemoveAndRenameNone = { + args: { + ...Default.args, + hiddenLevels: ['remove'], + labelOverrides: { none: "I can't do that, Dave." }, + }, +}; + +export const EndOfInputBox = { + args: { + ...Default.args, + }, + render: (props: React.ComponentProps) => <> +
+
+ +
+
+ +
+
+ , +}; + +export const BorderLess = { + args: { + ...Default.args, + className: '!p-0 leading-tight text-end !pr-8 border-none bg-transparent dark:bg-transparent', + }, +}; diff --git a/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.stories.tsx b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.stories.tsx new file mode 100644 index 00000000..4d3c0729 --- /dev/null +++ b/tdrive/frontend/src/app/views/client/body/drive/modals/public-link/copy-link-button.stories.tsx @@ -0,0 +1,14 @@ +import { Meta } from '@storybook/react'; + +import { CopyLinkButton } from './copy-link-button'; + +const meta: Meta = { + component: CopyLinkButton, +}; +export default meta; + +export const Default = { + args: { + textToCopy: "I should be in your clipboard", + }, +}; \ No newline at end of file