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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Added docs for text field
Parimal Satyal6bab602c3525
diff --git a/.gitignore b/.gitignoreindex df9f9436af5..30ef630ff2d 100644--- a/.gitignore+++ b/.gitignore@@ -132,3 +132,4 @@ structure.sql# lefthook.yml user overridelefthook-local.yml+frontend/package-lock.jsondiff --git a/frontend/src/app/spot/components/text-field/stories/TextField.stories.mdx b/frontend/src/app/spot/components/text-field/stories/TextField.stories.mdxindex 1a92487ea5f..91b7b1a0ad0 100644--- a/frontend/src/app/spot/components/text-field/stories/TextField.stories.mdx+++ b/frontend/src/app/spot/components/text-field/stories/TextField.stories.mdx@@ -22,7 +22,13 @@ import { SpotTextFieldComponent } from '../text-field.component';}}/>-# Text Fields+# Text Field++The text field is one of the most common input elements used in a wide range of scenarios: fill a form, enter work package details, search for something, pick a date.++## Structure and Options++The most basic text field is simply an input field where the user can type in text.<Canvas><Story@@ -46,33 +52,83 @@ export const Template = (args) => ({},})++The text field component affords a few optional elements:++An optional icon can be added to the left edge to provide additional context when this is necessary (in a search field, for example):++> Example: A search bar with a icon to the left++An icon can also optionally be placed on the right edge. This arrow can provide additional hints on how the text input field will behave; for example, a right arrow might suggest that the value will be immediately submitted, or a down arrow might indicate that the text field will open a drop modal underneath it (a list of assignees, for example).++The right icon can also be converted to an icon-only link that allows the user to clear the field.++> Example: A text field with a search icon, preset text and a clear icon on the right++## Behaviour++Clicking on a text field will move it to the focused state.++A text field can have placeholder text to provide additionanl context or information; this text is replaced by actual text that the user inputs, and is shown again only if the field is cleared.+<Canvas><Story- name="Preset value"+ name="Placeholder"args={{- value: 'I have a value set',+ placeholder: 'Placeholders get cut off if they\'re too long',}}>{Template.bind({})}</Story></Canvas>++The clear icon-only link on the right only appears on some text fields.++The width of a text field is fixed and defined either manually, or by the width of the containing element. When text exceeds the available width, it scrolls with the cursor within the text field (and clips on the other end).++## States++The **Default** state indicates that a text field is ready to accept text input.++<Canvas><Story- name="Disabled"+ name="Preset value"args={{- disabled: true,+ value: 'I have a value set',}}>{Template.bind({})}</Story></Canvas>++The **Focus** state has a coloured outline, the same as any focused element in OpenProject.++The **Hover** element has a darker border.++The **Disabled** state shows all elements (including icons and any placeholder or input text) in grey, and makes any interaction impossible.+<Canvas><Story- name="Placeholder"+ name="Disabled"args={{- placeholder: 'Placeholders get cut off if they\'re too long',+ disabled: true,}}>{Template.bind({})}</Story></Canvas>++The **Error** state puts a red outline around the text input. (_Note_: This state is only used when the text input is part of a _Form element_, which supplements this red outline with an message error message). The error state is usually temporary; fixing the cause of the error (via asyncronous form validation) usually allows it to revert back to the focus++> Example: Error state++## Margins and Spacing++The text field has 0.5 rem left and right margins, and a 0.25 rem top and bottom margins.++There is also a 0.25 rem spacing between items (icon and text).++++