From 678079192a7ab0dfb7a9734398753d826f7e48a2 Mon Sep 17 00:00:00 2001 From: Ivan <8611739+IRBorisov@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:35:55 +0300 Subject: [PATCH] M: Fix TSDoc text --- rsconcept/frontend/src/components/ui/Button.tsx | 2 +- rsconcept/frontend/src/components/ui/Checkbox.tsx | 2 +- rsconcept/frontend/src/components/ui/CheckboxTristate.tsx | 2 +- rsconcept/frontend/src/components/ui/Divider.tsx | 2 +- rsconcept/frontend/src/components/ui/Dropdown.tsx | 2 +- rsconcept/frontend/src/components/ui/DropdownButton.tsx | 2 +- rsconcept/frontend/src/components/ui/DropdownCheckbox.tsx | 2 +- rsconcept/frontend/src/components/ui/DropdownDivider.tsx | 2 +- rsconcept/frontend/src/components/ui/EmbedYoutube.tsx | 2 +- rsconcept/frontend/src/components/ui/FileInput.tsx | 2 +- rsconcept/frontend/src/components/ui/FlexColumn.tsx | 2 +- rsconcept/frontend/src/components/ui/GraphUI.tsx | 2 +- rsconcept/frontend/src/components/ui/Indicator.tsx | 2 +- rsconcept/frontend/src/components/ui/Label.tsx | 6 ++++++ rsconcept/frontend/src/hooks/useClickedOutside.ts | 1 + 15 files changed, 20 insertions(+), 13 deletions(-) diff --git a/rsconcept/frontend/src/components/ui/Button.tsx b/rsconcept/frontend/src/components/ui/Button.tsx index 15d54704..7a018819 100644 --- a/rsconcept/frontend/src/components/ui/Button.tsx +++ b/rsconcept/frontend/src/components/ui/Button.tsx @@ -19,7 +19,7 @@ interface ButtonProps extends CProps.Control, CProps.Colors, CProps.Button { } /** - * Button component that provides a customizable `button` with text, icon, tooltips and various styles. + * Customizable `button` with text, icon, tooltips and various styles. */ function Button({ icon, diff --git a/rsconcept/frontend/src/components/ui/Checkbox.tsx b/rsconcept/frontend/src/components/ui/Checkbox.tsx index ff4b956c..e4c8c8ab 100644 --- a/rsconcept/frontend/src/components/ui/Checkbox.tsx +++ b/rsconcept/frontend/src/components/ui/Checkbox.tsx @@ -21,7 +21,7 @@ export interface CheckboxProps extends Omit } /** - * Checkbox component that allows users to toggle a boolean value. + * Component that allows toggling a boolean value. */ function Checkbox({ disabled, diff --git a/rsconcept/frontend/src/components/ui/CheckboxTristate.tsx b/rsconcept/frontend/src/components/ui/CheckboxTristate.tsx index 6c99f311..9bd08706 100644 --- a/rsconcept/frontend/src/components/ui/CheckboxTristate.tsx +++ b/rsconcept/frontend/src/components/ui/CheckboxTristate.tsx @@ -16,7 +16,7 @@ export interface CheckboxTristateProps extends Omit { } /** - * FileInput component for selecting a `file`, displaying the selected file name. + * FileInput is a component for selecting a `file`, displaying the selected file name. */ function FileInput({ id, label, acceptType, title, className, style, onChange, ...restProps }: FileInputProps) { const inputRef = useRef(null); diff --git a/rsconcept/frontend/src/components/ui/FlexColumn.tsx b/rsconcept/frontend/src/components/ui/FlexColumn.tsx index 19d66bf2..622614d2 100644 --- a/rsconcept/frontend/src/components/ui/FlexColumn.tsx +++ b/rsconcept/frontend/src/components/ui/FlexColumn.tsx @@ -3,7 +3,7 @@ import clsx from 'clsx'; import { CProps } from '../props'; /** - * FlexColumn component that renders a `flex` column container. + * `flex` column container. * This component is useful for creating vertical layouts with flexbox. */ function FlexColumn({ className, children, ...restProps }: CProps.Div) { diff --git a/rsconcept/frontend/src/components/ui/GraphUI.tsx b/rsconcept/frontend/src/components/ui/GraphUI.tsx index ff620cfc..0c5a1a62 100644 --- a/rsconcept/frontend/src/components/ui/GraphUI.tsx +++ b/rsconcept/frontend/src/components/ui/GraphUI.tsx @@ -1,4 +1,4 @@ -// Reexporting reagraph types to wrap in 'use client'. +// Reexporting necessary reagraph types. 'use client'; import { GraphCanvas as GraphUI } from 'reagraph'; diff --git a/rsconcept/frontend/src/components/ui/Indicator.tsx b/rsconcept/frontend/src/components/ui/Indicator.tsx index 1e599aac..a4c65980 100644 --- a/rsconcept/frontend/src/components/ui/Indicator.tsx +++ b/rsconcept/frontend/src/components/ui/Indicator.tsx @@ -13,7 +13,7 @@ interface IndicatorProps extends CProps.Titled, CProps.Styling { } /** - * Indicator component that displays a status `icon` with a tooltip. + * Displays a status `icon` with a tooltip. */ function Indicator({ icon, title, titleHtml, hideTitle, noPadding, className, ...restProps }: IndicatorProps) { return ( diff --git a/rsconcept/frontend/src/components/ui/Label.tsx b/rsconcept/frontend/src/components/ui/Label.tsx index 5dcb25b8..dbcfdc4a 100644 --- a/rsconcept/frontend/src/components/ui/Label.tsx +++ b/rsconcept/frontend/src/components/ui/Label.tsx @@ -3,9 +3,15 @@ import clsx from 'clsx'; import { CProps } from '../props'; interface LabelProps extends CProps.Label { + /** Text to display. */ text?: string; } +/** + * Displays a label with optional text. + * + * Note: Html label component is used only if `htmlFor` prop is set. + */ function Label({ text, className, ...restProps }: LabelProps) { if (!text) { return null; diff --git a/rsconcept/frontend/src/hooks/useClickedOutside.ts b/rsconcept/frontend/src/hooks/useClickedOutside.ts index c4283ce3..2ae34ecf 100644 --- a/rsconcept/frontend/src/hooks/useClickedOutside.ts +++ b/rsconcept/frontend/src/hooks/useClickedOutside.ts @@ -7,6 +7,7 @@ import { assertIsNode } from '@/utils/utils'; function useClickedOutside({ ref, callback }: { ref: React.RefObject; callback?: () => void }) { useEffect(() => { function handleClickOutside(event: MouseEvent) { + console.log(1); assertIsNode(event.target); if (ref.current && !ref.current.contains(event.target)) { if (callback) callback();