M: Fix TSDoc text

This commit is contained in:
Ivan 2024-10-30 21:35:55 +03:00
parent 9c336e324b
commit 678079192a
15 changed files with 20 additions and 13 deletions

View File

@ -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({ function Button({
icon, icon,

View File

@ -21,7 +21,7 @@ export interface CheckboxProps extends Omit<CProps.Button, 'value' | 'onClick'>
} }
/** /**
* Checkbox component that allows users to toggle a boolean value. * Component that allows toggling a boolean value.
*/ */
function Checkbox({ function Checkbox({
disabled, disabled,

View File

@ -16,7 +16,7 @@ export interface CheckboxTristateProps extends Omit<CheckboxProps, 'value' | 'se
} }
/** /**
* CheckboxTristate component that allows toggling among three states: `true`, `false`, and `null`. * Component that allows toggling among three states: `true`, `false`, and `null`.
*/ */
function CheckboxTristate({ function CheckboxTristate({
disabled, disabled,

View File

@ -11,7 +11,7 @@ export interface DividerProps extends CProps.Styling {
} }
/** /**
* Divider component that renders a horizontal or vertical divider with customizable margins and styling. * Horizontal or vertical divider with customizable margins and styling.
*/ */
function Divider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) { function Divider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) {
return ( return (

View File

@ -17,7 +17,7 @@ interface DropdownProps extends CProps.Styling {
} }
/** /**
* Dropdown animated component that displays a list of children with optional positioning and visibility control. * Animated list of children with optional positioning and visibility control.
*/ */
function Dropdown({ function Dropdown({
isOpen, isOpen,

View File

@ -18,7 +18,7 @@ interface DropdownButtonProps extends CProps.AnimatedButton {
} }
/** /**
* DropdownButton animated component that renders a `button` with optional text, icon, and click functionality. * Animated `button` with optional text, icon, and click functionality.
* It supports optional children for custom content or the default text/icon display. * It supports optional children for custom content or the default text/icon display.
*/ */
function DropdownButton({ function DropdownButton({

View File

@ -5,7 +5,7 @@ import { animateDropdownItem } from '@/styling/animations';
import Checkbox, { CheckboxProps } from './Checkbox'; import Checkbox, { CheckboxProps } from './Checkbox';
/** DropdownCheckbox animated component that renders a {@link Checkbox} inside a {@link Dropdown} item. */ /** Animated {@link Checkbox} inside a {@link Dropdown} item. */
function DropdownCheckbox({ setValue, disabled, ...restProps }: CheckboxProps) { function DropdownCheckbox({ setValue, disabled, ...restProps }: CheckboxProps) {
return ( return (
<motion.div <motion.div

View File

@ -6,7 +6,7 @@ import { animateDropdownItem } from '@/styling/animations';
import { DividerProps } from './Divider'; import { DividerProps } from './Divider';
/** /**
* DropdownDivider component that renders {@link Divider} with animation inside {@link Dropdown}. * {@link Divider} with animation inside {@link Dropdown}.
*/ */
function DropdownDivider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) { function DropdownDivider({ vertical, margins = 'mx-2', className, ...restProps }: DividerProps) {
return ( return (

View File

@ -10,7 +10,7 @@ interface EmbedYoutubeProps {
} }
/** /**
* EmbedYoutube component that embeds a YouTube video into the page using the given video ID and dimensions. * Embeds a YouTube video into the page using the given video ID and dimensions.
*/ */
function EmbedYoutube({ videoID, pxHeight, pxWidth }: EmbedYoutubeProps) { function EmbedYoutube({ videoID, pxHeight, pxWidth }: EmbedYoutubeProps) {
if (!pxWidth) { if (!pxWidth) {

View File

@ -20,7 +20,7 @@ interface FileInputProps extends Omit<CProps.Input, 'accept' | 'type'> {
} }
/** /**
* 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) { function FileInput({ id, label, acceptType, title, className, style, onChange, ...restProps }: FileInputProps) {
const inputRef = useRef<HTMLInputElement | null>(null); const inputRef = useRef<HTMLInputElement | null>(null);

View File

@ -3,7 +3,7 @@ import clsx from 'clsx';
import { CProps } from '../props'; 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. * This component is useful for creating vertical layouts with flexbox.
*/ */
function FlexColumn({ className, children, ...restProps }: CProps.Div) { function FlexColumn({ className, children, ...restProps }: CProps.Div) {

View File

@ -1,4 +1,4 @@
// Reexporting reagraph types to wrap in 'use client'. // Reexporting necessary reagraph types.
'use client'; 'use client';
import { GraphCanvas as GraphUI } from 'reagraph'; import { GraphCanvas as GraphUI } from 'reagraph';

View File

@ -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) { function Indicator({ icon, title, titleHtml, hideTitle, noPadding, className, ...restProps }: IndicatorProps) {
return ( return (

View File

@ -3,9 +3,15 @@ import clsx from 'clsx';
import { CProps } from '../props'; import { CProps } from '../props';
interface LabelProps extends CProps.Label { interface LabelProps extends CProps.Label {
/** Text to display. */
text?: string; 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) { function Label({ text, className, ...restProps }: LabelProps) {
if (!text) { if (!text) {
return null; return null;

View File

@ -7,6 +7,7 @@ import { assertIsNode } from '@/utils/utils';
function useClickedOutside({ ref, callback }: { ref: React.RefObject<HTMLElement>; callback?: () => void }) { function useClickedOutside({ ref, callback }: { ref: React.RefObject<HTMLElement>; callback?: () => void }) {
useEffect(() => { useEffect(() => {
function handleClickOutside(event: MouseEvent) { function handleClickOutside(event: MouseEvent) {
console.log(1);
assertIsNode(event.target); assertIsNode(event.target);
if (ref.current && !ref.current.contains(event.target)) { if (ref.current && !ref.current.contains(event.target)) {
if (callback) callback(); if (callback) callback();