Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Added new documentation

Parimal Satyal9f5b87a22c11
diff --git a/frontend/src/app/spot/components/tooltip/stories/Tooltip.stories.mdx b/frontend/src/app/spot/components/tooltip/stories/Tooltip.stories.mdx
index 1dcbe7cf44a..aa5f7ac8ae6 100644
--- a/frontend/src/app/spot/components/tooltip/stories/Tooltip.stories.mdx
+++ b/frontend/src/app/spot/components/tooltip/stories/Tooltip.stories.mdx
@@ -27,15 +27,17 @@ import { SbTooltipComponent } from './Tooltip.component';
> Example of a tooltip
-Tooltips are used to provide additional information about an interactive element on mouse hover.
+The tooltip provides additional textual context on hover over interactive elements.
+
+This context can be used to provide additional information (hover over a "help" icon) or to signal state information (for example, if a certain item is disabled).
By default, they take 100% of the width of the containing element. However, max-width should be specified manually for each tooltip, depending on the circumstances and placement of the element.
-Tooltips have a min-width of X rem.
+> Eg. Tooltip on a file list, on a file that is not available due to permissions issues
-Tooltips automatically align themselves to the top or the bottom of the element it is attached to, depending on the positioning of the element in the viewport.
+## Structure and Options
-## Options
+The tooltip is simply a text label.
Tooltips by default have a dark gray background (_Gray 1: #333_), but a lighter version is also available with a sky blue background in the default theme (_Feedback/Info/Light_).
@@ -65,3 +67,23 @@ export const Template = (args) => ({
{Template.bind({})}
</Story>
</Canvas>
+
+
+## Behaviour
+
+The tooltip appears next to the item being hovered (which must never be covered), but does not follow the cursor. Hovering out of the element that triggered it will cause the tooltip disappear.
+
+Tooltips automatically align themselves to the top or the bottom of the element it is attached to, depending on the positioning of the element in the viewport.
+
+## Margins and Spacing
+
+A tooltip's width is generally determined by the containing text.
+
+However, due to technical limitations, there is a hard min-width of 20-rem and a max-width of 90vw. Tooltips shorter than 20-rem will have additional space on the rigth.
+
+The minimum width of the tooltip depends on the length of the text, and the maximum width depends on the width of the containing element.
+
+A tooltip can be multi-line if necessary (?) It is never truncated.
+
+> Eg. A long multi-line tooltip
+
diff --git a/frontend/src/stories/DropdownButton.stories.mdx b/frontend/src/stories/DropdownButton.stories.mdx
new file mode 100644
index 00000000000..50159c5b4da
--- /dev/null
+++ b/frontend/src/stories/DropdownButton.stories.mdx
@@ -0,0 +1,26 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+
+<Meta title="Components/Dropdown button" />
+
+# Dropdown button
+
+> Example: Filter button with a badge value of 3.
+
+## Description
+
+The dropdown button is a special type of button with a permanent down arrow on the right edge (suggesting further actions) and an optional badge.
+
+## Behaviour
+
+Clicking on a dropdown button generally opens the dropdown menu, or a drop modal. When the menu or modal is open, clicking on the button again closes it.
+
+> Example: A more button that opens a dropdown menu
+
+In some (rarer) cases, it can open a panel. An example of this is the Filter button.
+
+## Options
+
+The badge is optional and can hold a number from 0 to 99. After 99, the number simply reads "99+".
+
+
+
diff --git a/frontend/src/stories/DropdownMenu.stories.mdx b/frontend/src/stories/DropdownMenu.stories.mdx
new file mode 100644
index 00000000000..60a69b688b7
--- /dev/null
+++ b/frontend/src/stories/DropdownMenu.stories.mdx
@@ -0,0 +1,32 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+
+<Meta title="Patterns/Dropdown menu" />
+
+# Dropdown menu
+
+> Example: A dropdown menu with four items
+
+The dropdown menu is a contextual menu triggered by clicking on a dropdown button. It provides options to the use.
+
+## Structure and Options
+
+The dropdown menu consists of a list of items, generally *menu rows*, with an optional title.
+
+The title is not interactive. It serves to provide additional context, if necessary.
+
+A menu item is interactive and generally represents an action.
+
+## States
+
+Each menu item has three states: regular, hover and clicked.
+
+## Margins and Spacing
+
+Each item has a height of 1.5 rem. There is a 0.25 rem spacing between the optional icon and the label, and a 0.5 rem rem spacing to the left and right.
+
+The width is determined by the longest object, or can be defined manually. If defined manually, items that are very long and exceed this length are truncated.
+
+> Eg: a menu item that's very long and truncated
+
+
+
diff --git a/frontend/src/stories/Toast.stories.mdx b/frontend/src/stories/Toast.stories.mdx
new file mode 100644
index 00000000000..2511ad77c7a
--- /dev/null
+++ b/frontend/src/stories/Toast.stories.mdx
@@ -0,0 +1,51 @@
+import { Meta, Story, Canvas } from '@storybook/addon-docs';
+
+<Meta title="Components/Toast" />
+
+# Toast
+
+> Example: A success toast
+
+Toasts are small generally one-line messages that appear to inform the user of the result of an action, or an update to the current view.
+
+## Structure and Options
+
+The toast consists of:
+
+- An optional icon
+- A text
+- A close button
+
+There are four types of toasts, each with a specific icon and colour associated with it:
+
+An **Information** toast is blue and provides the user with helpful information about the current view.
+
+> Eg: a blue notification toast (as it exists today)
+
+A **Success** toast is green and indicates to the user that an action has been successfully carried out.
+
+> Eg: a green success toast (as it exists today)
+
+A **Warning** toast is orange and indicates that there are potential risks or possibility of error.
+
+> Eg: an orange toast (is this used somewhere?)
+
+An **Error** toast is red and indicates that something did not not go as expected, and that there is a problem.
+
+> Eg: a red toast (as it exists today, when moving an WP in GANTT view is not possible)
+
+## Behaviour
+
+The toast appears either as result of user action (a work package attribute is modified, for example) or a background action (there are new notifications).
+
+The text is generally merely informational, although there might sometimes be a link with an approproate action.
+
+> Eg. Blue notification toast with "Load new notifications" link.
+
+Toasts do not disappear automatically; they must be manually closed by the user.
+
+Ideally, only one toast should be visible at any time. Hoever, there are circumstances where multiple toasts might be generated and visible to the user; in this case, the toasts must "pile" vertically with a 1 rem (?) spacing between them.
+
+## Margins and Spacing
+
+The toast has a height of 2.5 rem, with a 0.5 rem padding on all sides, and a 0.5 rem spacing between the icon, text and the close button.