@allxsmith/bestax-bulma 5.6.2 → 5.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +28 -0
- package/CLAUDE.md +28 -0
- package/README.md +15 -15
- package/dist/index.cjs.js +3885 -243
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3884 -242
- package/dist/index.esm.js.map +1 -1
- package/dist/types/columns/Column.d.ts +43 -0
- package/dist/types/columns/Columns.d.ts +41 -1
- package/dist/types/components/Avatar.d.ts +37 -0
- package/dist/types/components/Avatars.d.ts +15 -2
- package/dist/types/components/Badge.d.ts +42 -0
- package/dist/types/components/Breadcrumb.d.ts +28 -0
- package/dist/types/components/Card.d.ts +70 -18
- package/dist/types/components/Carousel.d.ts +70 -0
- package/dist/types/components/Collapse.d.ts +53 -0
- package/dist/types/components/Dialog.d.ts +94 -0
- package/dist/types/components/Dropdown.d.ts +44 -0
- package/dist/types/components/Loading.d.ts +55 -0
- package/dist/types/components/Menu.d.ts +48 -0
- package/dist/types/components/Message.d.ts +27 -9
- package/dist/types/components/Modal.d.ts +65 -17
- package/dist/types/components/Navbar.d.ts +171 -12
- package/dist/types/components/Pagination.d.ts +84 -7
- package/dist/types/components/Panel.d.ts +109 -9
- package/dist/types/components/Reveal.d.ts +43 -0
- package/dist/types/components/Sidebar.d.ts +40 -0
- package/dist/types/components/Steps.d.ts +66 -1
- package/dist/types/components/Tabs.d.ts +100 -11
- package/dist/types/components/Toast.d.ts +109 -0
- package/dist/types/components/Tooltip.d.ts +50 -0
- package/dist/types/elements/Block.d.ts +20 -0
- package/dist/types/elements/Box.d.ts +23 -1
- package/dist/types/elements/Button.d.ts +26 -0
- package/dist/types/elements/Buttons.d.ts +16 -1
- package/dist/types/elements/Code.d.ts +19 -0
- package/dist/types/elements/Content.d.ts +21 -0
- package/dist/types/elements/Delete.d.ts +22 -0
- package/dist/types/elements/Divider.d.ts +16 -0
- package/dist/types/elements/Emphasis.d.ts +19 -0
- package/dist/types/elements/Figure.d.ts +25 -0
- package/dist/types/elements/Icon.d.ts +28 -0
- package/dist/types/elements/IconText.d.ts +20 -1
- package/dist/types/elements/Image.d.ts +27 -0
- package/dist/types/elements/Link.d.ts +24 -0
- package/dist/types/elements/LinkButton.d.ts +26 -0
- package/dist/types/elements/ListItem.d.ts +20 -0
- package/dist/types/elements/Notification.d.ts +101 -0
- package/dist/types/elements/OrderedList.d.ts +14 -1
- package/dist/types/elements/Paragraph.d.ts +19 -0
- package/dist/types/elements/Pre.d.ts +19 -0
- package/dist/types/elements/Progress.d.ts +20 -0
- package/dist/types/elements/Skeleton.d.ts +31 -0
- package/dist/types/elements/Span.d.ts +18 -0
- package/dist/types/elements/Strong.d.ts +19 -0
- package/dist/types/elements/SubTitle.d.ts +27 -0
- package/dist/types/elements/Table.d.ts +23 -1
- package/dist/types/elements/Tag.d.ts +28 -0
- package/dist/types/elements/Tags.d.ts +11 -1
- package/dist/types/elements/Tbody.d.ts +19 -0
- package/dist/types/elements/Td.d.ts +24 -0
- package/dist/types/elements/Tfoot.d.ts +19 -0
- package/dist/types/elements/Th.d.ts +25 -0
- package/dist/types/elements/Thead.d.ts +19 -0
- package/dist/types/elements/Title.d.ts +28 -0
- package/dist/types/elements/Tr.d.ts +21 -0
- package/dist/types/elements/UnorderedList.d.ts +11 -1
- package/dist/types/form/Autocomplete.d.ts +67 -0
- package/dist/types/form/Checkbox.d.ts +44 -0
- package/dist/types/form/Checkboxes.d.ts +13 -1
- package/dist/types/form/Control.d.ts +36 -0
- package/dist/types/form/DateInput.d.ts +44 -0
- package/dist/types/form/DateInputBase.d.ts +47 -0
- package/dist/types/form/DateTimeInput.d.ts +42 -0
- package/dist/types/form/DateTimeInputBase.d.ts +56 -0
- package/dist/types/form/Field.d.ts +66 -2
- package/dist/types/form/File.d.ts +26 -0
- package/dist/types/form/FormContext.d.ts +46 -0
- package/dist/types/form/Input.d.ts +49 -0
- package/dist/types/form/InputBase.d.ts +22 -0
- package/dist/types/form/Numberinput.d.ts +46 -0
- package/dist/types/form/Radio.d.ts +44 -0
- package/dist/types/form/Radios.d.ts +13 -1
- package/dist/types/form/Rate.d.ts +71 -0
- package/dist/types/form/Select.d.ts +39 -0
- package/dist/types/form/SelectBase.d.ts +25 -0
- package/dist/types/form/Slider.d.ts +71 -0
- package/dist/types/form/Switch.d.ts +53 -0
- package/dist/types/form/Taginput.d.ts +77 -0
- package/dist/types/form/TextArea.d.ts +38 -0
- package/dist/types/form/TextAreaBase.d.ts +25 -0
- package/dist/types/form/TimeInput.d.ts +39 -0
- package/dist/types/form/TimeInputBase.d.ts +72 -0
- package/dist/types/form/_pickerInternals/Calendar.d.ts +6 -0
- package/dist/types/form/_pickerInternals/TimeWheels.d.ts +13 -0
- package/dist/types/form/_pickerInternals/audioTick.d.ts +47 -0
- package/dist/types/form/_pickerInternals/dateUtils.d.ts +13 -0
- package/dist/types/form/_pickerInternals/formatters.d.ts +19 -0
- package/dist/types/form/_pickerInternals/haptics.d.ts +23 -0
- package/dist/types/form/_pickerInternals/pickerTypes.d.ts +8 -0
- package/dist/types/form/_pickerInternals/segmentMap.d.ts +48 -0
- package/dist/types/form/_pickerInternals/useNativeMobilePicker.d.ts +1 -0
- package/dist/types/form/_pickerInternals/useSegmentedEntry.d.ts +30 -0
- package/dist/types/form/fieldProps.d.ts +12 -0
- package/dist/types/grid/Cell.d.ts +26 -0
- package/dist/types/grid/Grid.d.ts +36 -1
- package/dist/types/helpers/Config.d.ts +50 -0
- package/dist/types/helpers/Theme.d.ts +66 -0
- package/dist/types/helpers/bulmaClassHelpers.d.ts +97 -0
- package/dist/types/helpers/classNames.d.ts +50 -0
- package/dist/types/helpers/useBulmaClasses.d.ts +22 -0
- package/dist/types/helpers/useColorClasses.d.ts +20 -0
- package/dist/types/helpers/useFlexboxClasses.d.ts +34 -0
- package/dist/types/helpers/useOtherClasses.d.ts +27 -0
- package/dist/types/helpers/useSpacingClasses.d.ts +27 -0
- package/dist/types/helpers/useTypographyClasses.d.ts +32 -0
- package/dist/types/helpers/useVisibilityClasses.d.ts +25 -0
- package/dist/types/helpers/withSubComponents.d.ts +16 -0
- package/dist/types/layout/Container.d.ts +26 -0
- package/dist/types/layout/Footer.d.ts +23 -0
- package/dist/types/layout/Hero.d.ts +66 -5
- package/dist/types/layout/Level.d.ts +68 -5
- package/dist/types/layout/Media.d.ts +63 -5
- package/dist/types/layout/Section.d.ts +21 -0
- package/dist/types/skill-examples/ExampleMeta.d.ts +5 -0
- package/dist/types/skill-examples/ProfileCard.d.ts +13 -0
- package/llms.txt +9 -0
- package/package.json +13 -11
|
@@ -1,11 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/** Valid sizes for the Numberinput component. */
|
|
4
5
|
export type NumberinputSize = 'small' | 'medium' | 'large';
|
|
6
|
+
/** Valid colors for the Numberinput wrapper and control buttons. */
|
|
5
7
|
export type NumberinputColor = 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'light' | 'dark';
|
|
8
|
+
/** Valid colors for the Numberinput inner input element. */
|
|
6
9
|
export type NumberinputInputColor = 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
10
|
+
/** Position of the increment/decrement control buttons. */
|
|
7
11
|
export type NumberinputControlsPosition = 'left' | 'right' | 'both';
|
|
12
|
+
/** Visual variant for the Numberinput controls. */
|
|
8
13
|
export type NumberinputVariant = 'plusminus' | 'stepper';
|
|
14
|
+
/**
|
|
15
|
+
* Props for the Numberinput component.
|
|
16
|
+
*
|
|
17
|
+
* @property {number} [value] - Controlled numeric value.
|
|
18
|
+
* @property {number} [defaultValue] - Initial value for uncontrolled mode.
|
|
19
|
+
* @property {number} [min] - Minimum allowed value.
|
|
20
|
+
* @property {number} [max] - Maximum allowed value.
|
|
21
|
+
* @property {number} [step] - Step increment (default: 1).
|
|
22
|
+
* @property {NumberinputSize} [size] - Size of the input and buttons.
|
|
23
|
+
* @property {NumberinputColor} [color] - Color for the control buttons.
|
|
24
|
+
* @property {NumberinputInputColor} [inputColor] - Color for the inner input element.
|
|
25
|
+
* @property {NumberinputControlsPosition} [controlsPosition] - Position of increment/decrement buttons (default: 'both').
|
|
26
|
+
* @property {boolean} [controlsRounded] - Whether the control buttons are rounded.
|
|
27
|
+
* @property {boolean} [compact] - Whether to use compact (addons) layout.
|
|
28
|
+
* @property {boolean} [bare] - Bare mode: no outer .field wrapper, for composing inside a parent Field.
|
|
29
|
+
* @property {NumberinputVariant} [variant] - Control variant: 'plusminus' (default) or 'stepper'.
|
|
30
|
+
* @property {boolean} [disabled] - Whether the input is disabled.
|
|
31
|
+
* @property {boolean} [editable] - Whether the user can type directly into the input (default: true).
|
|
32
|
+
* @property {boolean} [isLoading] - Whether to show a loading spinner on the input.
|
|
33
|
+
* @property {boolean} [exponential] - Whether the step grows with the value magnitude.
|
|
34
|
+
* @property {(value: number) => void} [onChange] - Callback when the value changes.
|
|
35
|
+
* @see {@link https://buefy.org/documentation/numberinput | Buefy Numberinput documentation}
|
|
36
|
+
*/
|
|
9
37
|
export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue' | 'type'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
|
|
10
38
|
value?: number;
|
|
11
39
|
defaultValue?: number;
|
|
@@ -26,5 +54,23 @@ export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInp
|
|
|
26
54
|
exponential?: boolean;
|
|
27
55
|
onChange?: (value: number) => void;
|
|
28
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Bulma-styled numeric input with increment/decrement controls.
|
|
59
|
+
*
|
|
60
|
+
* Supports plus/minus buttons or a compact stepper variant,
|
|
61
|
+
* with configurable min/max, step, and exponential stepping.
|
|
62
|
+
*
|
|
63
|
+
* @function
|
|
64
|
+
* @param {NumberinputProps} props - Props for the Numberinput component.
|
|
65
|
+
* @returns {JSX.Element} The rendered numeric input element.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* // Basic number input
|
|
69
|
+
* <Numberinput defaultValue={5} min={0} max={100} />
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* // Stepper variant with color
|
|
73
|
+
* <Numberinput variant="stepper" color="primary" step={10} />
|
|
74
|
+
*/
|
|
29
75
|
export declare const Numberinput: React.ForwardRefExoticComponent<NumberinputProps & React.RefAttributes<HTMLInputElement>>;
|
|
30
76
|
export default Numberinput;
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Valid colors for the Radio component.
|
|
5
|
+
*/
|
|
3
6
|
export declare const radioColors: readonly ["primary", "link", "info", "success", "warning", "danger"];
|
|
7
|
+
/**
|
|
8
|
+
* Valid sizes for the Radio component.
|
|
9
|
+
*/
|
|
4
10
|
export declare const radioSizes: readonly ["small", "normal", "medium", "large"];
|
|
11
|
+
/**
|
|
12
|
+
* Props for the Radio component.
|
|
13
|
+
*
|
|
14
|
+
* @property {(typeof radioColors)[number]} [color] - Color variant for the radio.
|
|
15
|
+
* @property {(typeof radioSizes)[number]} [size] - Size of the radio.
|
|
16
|
+
* @property {boolean} [disabled] - Whether the radio is disabled.
|
|
17
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
18
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color.
|
|
19
|
+
* @property {React.ReactNode} [children] - The label/content for the radio.
|
|
20
|
+
* @see Bulma Radio documentation: https://bulma.io/documentation/form/radio/
|
|
21
|
+
*/
|
|
5
22
|
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
|
|
6
23
|
color?: (typeof radioColors)[number];
|
|
7
24
|
size?: (typeof radioSizes)[number];
|
|
@@ -10,5 +27,32 @@ export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
10
27
|
className?: string;
|
|
11
28
|
children?: React.ReactNode;
|
|
12
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Bulma Radio component with themed styling support.
|
|
32
|
+
*
|
|
33
|
+
* Renders a custom-styled radio button with a visual indicator,
|
|
34
|
+
* supporting colors, sizes, and various states. Inside a `<Radios>` group,
|
|
35
|
+
* Radio inherits `name` and (when the group is in controlled or uncontrolled
|
|
36
|
+
* mode) derives its `checked` state from the group's `value` and dispatches
|
|
37
|
+
* the group's `onChange` when clicked.
|
|
38
|
+
*
|
|
39
|
+
* Local props always win over group context (`name`, `checked`, `onChange`
|
|
40
|
+
* on Radio override the group). Required for opt-out scenarios.
|
|
41
|
+
*
|
|
42
|
+
* @function
|
|
43
|
+
* @param {RadioProps} props - Props for the Radio component.
|
|
44
|
+
* @returns {JSX.Element} The rendered radio element.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Basic radio
|
|
48
|
+
* <Radio name="option">Option A</Radio>
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Inside a group
|
|
52
|
+
* <Radios name="color" defaultValue="red">
|
|
53
|
+
* <Radio value="red">Red</Radio>
|
|
54
|
+
* <Radio value="blue">Blue</Radio>
|
|
55
|
+
* </Radios>
|
|
56
|
+
*/
|
|
13
57
|
export declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
14
58
|
export default Radio;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Radios component.
|
|
6
|
+
*
|
|
7
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
8
|
+
* @property {string} [name] - Form field name shared by every Radio in the group.
|
|
9
|
+
* @property {string} [value] - Currently-selected value (controlled mode).
|
|
10
|
+
* @property {string} [defaultValue] - Initial selected value (uncontrolled mode).
|
|
11
|
+
* @property {(value: string) => void} [onChange] - Fired when the selection changes. Receives the new value.
|
|
12
|
+
* @property {React.ReactNode} children - Radio elements to render in the group.
|
|
13
|
+
*/
|
|
4
14
|
export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
5
15
|
className?: string;
|
|
6
16
|
name?: string;
|
|
@@ -9,5 +19,7 @@ export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormField
|
|
|
9
19
|
onChange?: (value: string) => void;
|
|
10
20
|
children: React.ReactNode;
|
|
11
21
|
}
|
|
12
|
-
export declare const Radios: React.FC<RadiosProps
|
|
22
|
+
export declare const Radios: React.FC<RadiosProps> & {
|
|
23
|
+
Radio: React.ForwardRefExoticComponent<import("./Radio").RadioProps & React.RefAttributes<HTMLInputElement>>;
|
|
24
|
+
};
|
|
13
25
|
export default Radios;
|
|
@@ -1,16 +1,56 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/** Available size modifiers for the Rate component. */
|
|
4
5
|
export type RateSize = 'small' | 'medium' | 'large';
|
|
5
6
|
type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
6
7
|
type BulmaColor = 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
+
/**
|
|
9
|
+
* Props for individual rate icons.
|
|
10
|
+
*
|
|
11
|
+
* @property {number} index - The index of this icon (0-based).
|
|
12
|
+
* @property {boolean} isActive - Whether this icon is currently active (filled).
|
|
13
|
+
* @property {boolean} isHovered - Whether this icon is currently hovered.
|
|
14
|
+
* @property {number} value - The current value.
|
|
15
|
+
* @property {number} fillPercent - Fill percentage for partial icons (0-100). Used with precision < 1.
|
|
16
|
+
*/
|
|
7
17
|
export interface RateIconProps {
|
|
18
|
+
/** The index of this icon (0-based) */
|
|
8
19
|
index: number;
|
|
20
|
+
/** Whether this icon is currently active (filled) */
|
|
9
21
|
isActive: boolean;
|
|
22
|
+
/** Whether this icon is currently hovered */
|
|
10
23
|
isHovered: boolean;
|
|
24
|
+
/** The current value */
|
|
11
25
|
value: number;
|
|
26
|
+
/** Fill percentage for partial icons (0-100). Used with precision < 1. */
|
|
12
27
|
fillPercent: number;
|
|
13
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Props for the Rate component.
|
|
31
|
+
*
|
|
32
|
+
* @property {number} [value] - Controlled rating value.
|
|
33
|
+
* @property {number} [defaultValue] - Initial value for uncontrolled mode. Default: 0.
|
|
34
|
+
* @property {number} [max] - Maximum number of icons. Default: 5.
|
|
35
|
+
* @property {RateSize} [size] - Size modifier for the component.
|
|
36
|
+
* @property {boolean} [disabled] - Whether the rating is disabled.
|
|
37
|
+
* @property {boolean} [showScore] - Display the numeric score next to icons.
|
|
38
|
+
* @property {boolean} [showText] - Display text label for the current value.
|
|
39
|
+
* @property {string[]} [texts] - Text labels per rating level (used with showText).
|
|
40
|
+
* @property {(value: number) => void} [onChange] - Callback when the rating changes.
|
|
41
|
+
* @property {(props: RateIconProps) => React.ReactNode} [customIcon] - Custom icon render function.
|
|
42
|
+
* @property {boolean} [spaced] - Add spacing between icons.
|
|
43
|
+
* @property {boolean} [rtl] - Render icons in right-to-left order.
|
|
44
|
+
* @property {string} [iconName] - Font icon name (e.g., 'star'). When set, renders Icon instead of default SVG.
|
|
45
|
+
* @property {IconLibrary} [iconLibrary] - Icon library to use (defaults to ConfigProvider value or 'fa').
|
|
46
|
+
* @property {string} [iconVariant] - Icon style variant (e.g., 'solid', 'outlined').
|
|
47
|
+
* @property {string|string[]} [iconFeatures] - Additional icon modifiers.
|
|
48
|
+
* @property {BulmaColor} [color] - Bulma color for active icons.
|
|
49
|
+
* @property {number} [precision] - Granularity: 1 for whole stars, 0.5 for half, 0.25 for quarter. Default: 1.
|
|
50
|
+
* @property {string} [customText] - Text displayed after score (e.g., "(128 reviews)").
|
|
51
|
+
* @property {string} [name] - Form field name. When provided, a hidden input is rendered so the rating value is submitted with the surrounding form.
|
|
52
|
+
* @property {string} [form] - The id of the form this hidden input belongs to (for use outside the form element).
|
|
53
|
+
*/
|
|
14
54
|
export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>, Omit<BulmaClassesProps, 'size'>, FormFieldProps {
|
|
15
55
|
name?: string;
|
|
16
56
|
form?: string;
|
|
@@ -26,13 +66,44 @@ export interface RateProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'o
|
|
|
26
66
|
customIcon?: (props: RateIconProps) => React.ReactNode;
|
|
27
67
|
spaced?: boolean;
|
|
28
68
|
rtl?: boolean;
|
|
69
|
+
/** Font icon name (e.g., 'star'). When set, renders <Icon> instead of default SVG. */
|
|
29
70
|
iconName?: string;
|
|
71
|
+
/** Icon library to use (defaults to ConfigProvider value or 'fa'). */
|
|
30
72
|
iconLibrary?: IconLibrary;
|
|
73
|
+
/** Icon style variant (e.g., 'solid', 'outlined'). */
|
|
31
74
|
iconVariant?: string;
|
|
75
|
+
/** Additional icon modifiers. */
|
|
32
76
|
iconFeatures?: string | string[];
|
|
77
|
+
/** Bulma color for active icons. */
|
|
33
78
|
color?: BulmaColor;
|
|
79
|
+
/** Granularity: 1 for whole stars, 0.5 for half, 0.25 for quarter. */
|
|
34
80
|
precision?: number;
|
|
81
|
+
/** Text displayed after score (e.g., "(128 reviews)"). */
|
|
35
82
|
customText?: string;
|
|
36
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Rate component for star/icon-based ratings.
|
|
86
|
+
*
|
|
87
|
+
* Provides an interactive rating system with customizable icons,
|
|
88
|
+
* sizes, and display options. Works in controlled or uncontrolled modes.
|
|
89
|
+
* Supports icon libraries, Bulma color variants, and fractional precision.
|
|
90
|
+
*
|
|
91
|
+
* @function
|
|
92
|
+
* @param {RateProps} props - Props for the Rate component.
|
|
93
|
+
* @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the container element.
|
|
94
|
+
* @returns {JSX.Element} The rendered rating component.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // Basic 5-star rating
|
|
98
|
+
* <Rate defaultValue={3} />
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* // With color and precision
|
|
102
|
+
* <Rate defaultValue={3.5} color="warning" precision={0.5} showScore />
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* // With Font Awesome icons
|
|
106
|
+
* <Rate iconName="star" iconLibrary="fa" iconVariant="solid" />
|
|
107
|
+
*/
|
|
37
108
|
export declare const Rate: React.ForwardRefExoticComponent<RateProps & React.RefAttributes<HTMLDivElement>>;
|
|
38
109
|
export default Rate;
|
|
@@ -2,6 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { FieldProps } from './Field';
|
|
3
3
|
import { ControlBaseProps } from './Control';
|
|
4
4
|
import { SelectBaseProps } from './SelectBase';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Select component.
|
|
7
|
+
*
|
|
8
|
+
* Composes Field, Control, and SelectBase into a single convenience component.
|
|
9
|
+
* Supports all SelectBase props, plus Field-level (label, horizontal) and
|
|
10
|
+
* Control-level (icons, loading) props.
|
|
11
|
+
*
|
|
12
|
+
* @property {React.ReactNode} [label] - Field label.
|
|
13
|
+
* @property {FieldProps['labelSize']} [labelSize] - Size for the label.
|
|
14
|
+
* @property {FieldProps['labelProps']} [labelProps] - Props for the label element.
|
|
15
|
+
* @property {boolean} [horizontal] - Horizontal field layout.
|
|
16
|
+
* @property {ControlBaseProps['iconLeft']} [iconLeft] - Icon props for left icon.
|
|
17
|
+
* @property {string} [iconLeftName] - Shortcut for left icon name.
|
|
18
|
+
* @property {ControlBaseProps['iconLeftSize']} [iconLeftSize] - Shortcut for left icon size.
|
|
19
|
+
* @property {boolean} [hasIconsLeft] - Force left icon container.
|
|
20
|
+
* @property {boolean} [isLoading] - Show loading indicator on the control.
|
|
21
|
+
* @property {boolean} [isExpanded] - Expand the control.
|
|
22
|
+
* @property {'small'|'medium'|'large'} [controlSize] - Control size.
|
|
23
|
+
* @property {React.ReactNode} [message] - Help/validation message below the select.
|
|
24
|
+
* @property {string} [messageColor] - Bulma color for the message.
|
|
25
|
+
* @property {string} [fieldClassName] - Additional CSS classes for the Field.
|
|
26
|
+
* @property {string} [controlClassName] - Additional CSS classes for the Control.
|
|
27
|
+
*/
|
|
5
28
|
export interface SelectProps extends SelectBaseProps {
|
|
6
29
|
label?: React.ReactNode;
|
|
7
30
|
labelSize?: FieldProps['labelSize'];
|
|
@@ -19,5 +42,21 @@ export interface SelectProps extends SelectBaseProps {
|
|
|
19
42
|
fieldClassName?: string;
|
|
20
43
|
controlClassName?: string;
|
|
21
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Select is a convenience component that composes Field, Control, and SelectBase.
|
|
47
|
+
*
|
|
48
|
+
* Use this for typical form fields. For complex layouts (grouped fields,
|
|
49
|
+
* addons, etc.), compose Field, Control, and SelectBase directly.
|
|
50
|
+
*
|
|
51
|
+
* @function
|
|
52
|
+
* @param {SelectProps} props - Props for Select.
|
|
53
|
+
* @returns {JSX.Element} The composed field element.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* <Select label="Country" iconLeftName="globe">
|
|
57
|
+
* <option>United States</option>
|
|
58
|
+
* <option>Canada</option>
|
|
59
|
+
* </Select>
|
|
60
|
+
*/
|
|
22
61
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
23
62
|
export default Select;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Select component.
|
|
5
|
+
*
|
|
6
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the select.
|
|
7
|
+
* @property {'small'|'medium'|'large'} [size] - Size modifier for the select.
|
|
8
|
+
* @property {boolean} [isRounded] - Renders the select with rounded corners.
|
|
9
|
+
* @property {boolean} [isLoading] - Shows loading indicator.
|
|
10
|
+
* @property {boolean} [isActive] - Applies Bulma's is-active modifier.
|
|
11
|
+
* @property {boolean} [isHovered] - Forces the hovered state on the inner select element.
|
|
12
|
+
* @property {boolean} [isFocused] - Forces the focused state on the inner select element.
|
|
13
|
+
* @property {boolean} [isFullwidth] - Makes the select span the full width of its parent.
|
|
14
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
15
|
+
* @property {boolean} [disabled] - Whether the select is disabled.
|
|
16
|
+
* @property {boolean} [multiple] - Whether the select allows multiple values.
|
|
17
|
+
* @property {number} [multipleSize] - For multiple select: number of visible options.
|
|
18
|
+
* @property {React.ReactNode} [children] - Option elements.
|
|
19
|
+
*/
|
|
3
20
|
export interface SelectBaseProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
|
|
4
21
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
5
22
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -15,5 +32,13 @@ export interface SelectBaseProps extends Omit<React.SelectHTMLAttributes<HTMLSel
|
|
|
15
32
|
multipleSize?: number;
|
|
16
33
|
children?: React.ReactNode;
|
|
17
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Bulma Select component with full Bulma helper class support.
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @param {SelectBaseProps} props - Props for the SelectBase component.
|
|
40
|
+
* @returns {JSX.Element} The rendered select element.
|
|
41
|
+
* @see {@link https://bulma.io/documentation/form/select/ | Bulma Select documentation}
|
|
42
|
+
*/
|
|
18
43
|
export declare const SelectBase: React.ForwardRefExoticComponent<SelectBaseProps & React.RefAttributes<HTMLSelectElement>>;
|
|
19
44
|
export default SelectBase;
|
|
@@ -1,14 +1,43 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/** Valid sizes for the Slider component. */
|
|
4
5
|
export type SliderSize = 'small' | 'medium' | 'large';
|
|
6
|
+
/** Valid colors for the Slider component. */
|
|
5
7
|
export type SliderColor = 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
+
/** Tooltip display mode for the Slider component. */
|
|
6
9
|
export type SliderTooltip = 'auto' | 'always' | 'hidden';
|
|
10
|
+
/** Orientation of the Slider component. */
|
|
7
11
|
export type SliderOrientation = 'horizontal' | 'vertical';
|
|
12
|
+
/**
|
|
13
|
+
* A tick mark displayed along the Slider track.
|
|
14
|
+
*
|
|
15
|
+
* @property {number} value - Position of the mark along the slider range.
|
|
16
|
+
* @property {React.ReactNode} [label] - Optional label rendered below the tick mark.
|
|
17
|
+
*/
|
|
8
18
|
export interface SliderMark {
|
|
9
19
|
value: number;
|
|
10
20
|
label?: React.ReactNode;
|
|
11
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Shared base props for single and range Slider modes.
|
|
24
|
+
*
|
|
25
|
+
* @property {number} [min] - Minimum slider value (default: 0).
|
|
26
|
+
* @property {number} [max] - Maximum slider value (default: 100).
|
|
27
|
+
* @property {number} [step] - Step increment (default: 1).
|
|
28
|
+
* @property {SliderSize} [size] - Size of the slider.
|
|
29
|
+
* @property {SliderColor} [color] - Color of the slider.
|
|
30
|
+
* @property {boolean} [isRounded] - Whether the slider thumb is rounded.
|
|
31
|
+
* @property {boolean} [isCircle] - Whether the slider thumb is circular.
|
|
32
|
+
* @property {boolean} [showOutput] - Whether to show a tooltip with the current value (maps to tooltip 'auto').
|
|
33
|
+
* @property {SliderTooltip} [tooltip] - Tooltip display mode (overrides showOutput).
|
|
34
|
+
* @property {boolean} [ticks] - Whether to display tick marks at each step.
|
|
35
|
+
* @property {SliderMark[]} [marks] - Custom tick mark positions and labels.
|
|
36
|
+
* @property {SliderOrientation} [orientation] - Slider orientation (default: 'horizontal').
|
|
37
|
+
* @property {(value: number) => number} [scale] - Non-linear scale function for displayed values.
|
|
38
|
+
* @property {(value: number) => string} [getAriaValueText] - Custom aria-valuetext formatter.
|
|
39
|
+
* @property {(value: number) => string} [formatOutput] - Custom formatter for the tooltip output.
|
|
40
|
+
*/
|
|
12
41
|
interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
|
|
13
42
|
min?: number;
|
|
14
43
|
max?: number;
|
|
@@ -26,6 +55,16 @@ interface SliderBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElemen
|
|
|
26
55
|
getAriaValueText?: (value: number) => string;
|
|
27
56
|
formatOutput?: (value: number) => string;
|
|
28
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Props for the Slider in single-value mode.
|
|
60
|
+
*
|
|
61
|
+
* @property {false} [range] - Must be false or omitted for single-value mode.
|
|
62
|
+
* @property {number} [value] - Controlled slider value.
|
|
63
|
+
* @property {number} [defaultValue] - Initial value for uncontrolled mode.
|
|
64
|
+
* @property {(value: number) => void} [onChange] - Callback when the value changes.
|
|
65
|
+
* @property {never} [minDistance] - Not applicable in single-value mode.
|
|
66
|
+
* @property {string} [ariaLabel] - Accessible label for the slider input.
|
|
67
|
+
*/
|
|
29
68
|
export interface SliderSingleProps extends SliderBaseProps {
|
|
30
69
|
range?: false;
|
|
31
70
|
value?: number;
|
|
@@ -34,6 +73,18 @@ export interface SliderSingleProps extends SliderBaseProps {
|
|
|
34
73
|
minDistance?: never;
|
|
35
74
|
ariaLabel?: string;
|
|
36
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* Props for the Slider in range (dual-thumb) mode.
|
|
78
|
+
*
|
|
79
|
+
* @property {true} range - Must be true to enable range mode.
|
|
80
|
+
* @property {[number, number]} [value] - Controlled range value as [low, high].
|
|
81
|
+
* @property {[number, number]} [defaultValue] - Initial range for uncontrolled mode.
|
|
82
|
+
* @property {(value: [number, number]) => void} [onChange] - Callback when the range changes.
|
|
83
|
+
* @property {number} [minDistance] - Minimum distance between the two thumbs.
|
|
84
|
+
* @property {[string, string]} [ariaLabel] - Accessible labels for the low and high thumb inputs.
|
|
85
|
+
* @property {string} [nameLow] - Form field name for the low thumb. Use this in range mode so each thumb submits with its own name.
|
|
86
|
+
* @property {string} [nameHigh] - Form field name for the high thumb.
|
|
87
|
+
*/
|
|
37
88
|
export interface SliderRangeProps extends SliderBaseProps {
|
|
38
89
|
range: true;
|
|
39
90
|
value?: [number, number];
|
|
@@ -44,6 +95,26 @@ export interface SliderRangeProps extends SliderBaseProps {
|
|
|
44
95
|
nameLow?: string;
|
|
45
96
|
nameHigh?: string;
|
|
46
97
|
}
|
|
98
|
+
/** Props for the Slider component — a discriminated union of single and range modes. */
|
|
47
99
|
export type SliderProps = SliderSingleProps | SliderRangeProps;
|
|
100
|
+
/**
|
|
101
|
+
* Slider component for selecting a value or range from a range.
|
|
102
|
+
*
|
|
103
|
+
* A styled range input that supports different sizes, colors,
|
|
104
|
+
* optional value display, ticks/marks, range mode (dual thumb),
|
|
105
|
+
* vertical orientation, and non-linear scale.
|
|
106
|
+
*
|
|
107
|
+
* @function
|
|
108
|
+
* @param {SliderProps} props - Props for the Slider component.
|
|
109
|
+
* @returns {JSX.Element} The rendered slider element.
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* // Basic slider
|
|
113
|
+
* <Slider defaultValue={50} />
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* // Range slider
|
|
117
|
+
* <Slider range defaultValue={[20, 80]} onChange={([low, high]) => {}} />
|
|
118
|
+
*/
|
|
48
119
|
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLInputElement>>;
|
|
49
120
|
export default Slider;
|
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Valid colors for the Switch component.
|
|
5
|
+
*/
|
|
3
6
|
export declare const switchColors: readonly ["primary", "link", "info", "success", "warning", "danger"];
|
|
7
|
+
/**
|
|
8
|
+
* Valid sizes for the Switch component.
|
|
9
|
+
*/
|
|
4
10
|
export declare const switchSizes: readonly ["small", "normal", "medium", "large"];
|
|
11
|
+
/**
|
|
12
|
+
* Props for the Switch component.
|
|
13
|
+
*
|
|
14
|
+
* @property {(typeof switchColors)[number]} [color] - Color variant for the switch.
|
|
15
|
+
* @property {(typeof switchSizes)[number]} [size] - Size of the switch.
|
|
16
|
+
* @property {boolean} [isRounded] - Use rounded switch style.
|
|
17
|
+
* @property {boolean} [isThin] - Use thin switch style.
|
|
18
|
+
* @property {boolean} [isOutlined] - Use outlined switch style.
|
|
19
|
+
* @property {boolean} [isRtl] - Right-to-left layout (label on left).
|
|
20
|
+
* @property {(typeof switchColors)[number]} [passiveType] - Color for the unchecked (inactive) state.
|
|
21
|
+
* @property {boolean} [checked] - Whether the switch is checked.
|
|
22
|
+
* @property {boolean} [defaultChecked] - Default checked state for uncontrolled usage.
|
|
23
|
+
* @property {boolean} [disabled] - Whether the switch is disabled.
|
|
24
|
+
* @property {string} [className] - Additional CSS classes.
|
|
25
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color.
|
|
26
|
+
* @property {React.ReactNode} [children] - Label content for the switch.
|
|
27
|
+
* @property {(event: React.ChangeEvent<HTMLInputElement>) => void} [onChange] - Change handler.
|
|
28
|
+
*/
|
|
5
29
|
export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
|
|
6
30
|
color?: (typeof switchColors)[number];
|
|
7
31
|
size?: (typeof switchSizes)[number];
|
|
@@ -13,5 +37,34 @@ export interface SwitchProps extends Omit<React.InputHTMLAttributes<HTMLInputEle
|
|
|
13
37
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
14
38
|
children?: React.ReactNode;
|
|
15
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Switch component for toggling between on/off states.
|
|
42
|
+
*
|
|
43
|
+
* A styled checkbox that appears as a toggle switch, commonly used for
|
|
44
|
+
* settings and preferences. Supports various colors, sizes, and styles.
|
|
45
|
+
*
|
|
46
|
+
* @function
|
|
47
|
+
* @param {SwitchProps} props - Props for the Switch component.
|
|
48
|
+
* @returns {JSX.Element} The rendered switch element.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Basic switch
|
|
52
|
+
* <Switch>Enable notifications</Switch>
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Colored and rounded switch
|
|
56
|
+
* <Switch color="success" isRounded checked>
|
|
57
|
+
* Active
|
|
58
|
+
* </Switch>
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* // Controlled switch
|
|
62
|
+
* <Switch
|
|
63
|
+
* checked={isEnabled}
|
|
64
|
+
* onChange={(e) => setIsEnabled(e.target.checked)}
|
|
65
|
+
* >
|
|
66
|
+
* Feature enabled
|
|
67
|
+
* </Switch>
|
|
68
|
+
*/
|
|
16
69
|
export declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLInputElement>>;
|
|
17
70
|
export default Switch;
|
|
@@ -1,13 +1,64 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a tag item object with a value and optional label.
|
|
6
|
+
*
|
|
7
|
+
* @property {string} value - The tag value.
|
|
8
|
+
* @property {string} [label] - Display label for the tag.
|
|
9
|
+
*/
|
|
4
10
|
export interface TaginputItem {
|
|
5
11
|
value: string;
|
|
6
12
|
label?: string;
|
|
7
13
|
[key: string]: unknown;
|
|
8
14
|
}
|
|
15
|
+
/** A tag can be either a TaginputItem object or a plain string. */
|
|
9
16
|
export type TaginputTag = TaginputItem | string;
|
|
10
17
|
type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
18
|
+
/**
|
|
19
|
+
* Props for the Taginput component.
|
|
20
|
+
*
|
|
21
|
+
* @property {TaginputTag[]} [value] - The current tags (controlled).
|
|
22
|
+
* @property {TaginputTag[]} [defaultValue] - Default tags (uncontrolled).
|
|
23
|
+
* @property {string[]} [data] - Autocomplete suggestions.
|
|
24
|
+
* @property {string} [placeholder] - Placeholder text when no tags.
|
|
25
|
+
* @property {string} [field] - Object property to use as display field.
|
|
26
|
+
* @property {boolean} [allowNew] - Allow creating new tags not in suggestions.
|
|
27
|
+
* @property {boolean} [allowDuplicates] - Allow duplicate tags.
|
|
28
|
+
* @property {boolean} [openOnFocus] - Open autocomplete dropdown on focus.
|
|
29
|
+
* @property {boolean} [removeOnKeys] - Remove tag on backspace. Default: true.
|
|
30
|
+
* @property {string[]} [confirmKeys] - Keys to confirm tag creation. Default: ['Enter', ','].
|
|
31
|
+
* @property {boolean} [closable] - Show close button on tags. Default: true.
|
|
32
|
+
* @property {boolean} [attached] - Attach tags visually.
|
|
33
|
+
* @property {number} [maxTags] - Maximum number of tags allowed.
|
|
34
|
+
* @property {number} [maxlength] - Maximum length of input.
|
|
35
|
+
* @property {boolean} [disabled] - Whether the input is disabled.
|
|
36
|
+
* @property {boolean} [readonly] - Whether the input is read-only.
|
|
37
|
+
* @property {boolean} [rounded] - Makes tags rounded.
|
|
38
|
+
* @property {boolean} [ellipsis] - Truncate long tag text with ellipsis and show title tooltip.
|
|
39
|
+
* @property {boolean} [hasCounter] - Show counter for maxTags/maxlength. Default: true.
|
|
40
|
+
* @property {string[]} [onPasteSeparators] - Characters to split on paste. Default: [','].
|
|
41
|
+
* @property {(tag: string) => boolean} [beforeAdding] - Validate before adding a tag.
|
|
42
|
+
* @property {(input: string) => TaginputTag} [createTag] - Transform input string to tag.
|
|
43
|
+
* @property {boolean} [keepFirst] - Auto-highlight first autocomplete result.
|
|
44
|
+
* @property {boolean} [keepOpen] - Keep dropdown open after selecting. Default: true.
|
|
45
|
+
* @property {boolean} [loading] - Show loading spinner in input.
|
|
46
|
+
* @property {string} [ariaCloseLabel] - Accessibility label for close buttons.
|
|
47
|
+
* @property {(tags: TaginputTag[]) => void} [onChange] - Callback when tags change.
|
|
48
|
+
* @property {(tag: TaginputTag) => void} [onAdd] - Callback when tag is added.
|
|
49
|
+
* @property {(tag: TaginputTag, index: number) => void} [onRemove] - Callback when tag is removed.
|
|
50
|
+
* @property {(value: string) => void} [onTyping] - Callback when typing in input.
|
|
51
|
+
* @property {(tag: TaginputTag) => React.ReactNode} [tagTemplate] - Custom render for tags.
|
|
52
|
+
* @property {string} [name] - Form field name. When provided, one hidden input per tag is rendered so tags submit as a standard form-encoded array (e.g., `tags=react&tags=vue`).
|
|
53
|
+
* @property {string} [form] - The id of the form the hidden inputs belong to.
|
|
54
|
+
* @property {string} [icon] - Icon name for the input field.
|
|
55
|
+
* @property {IconLibrary} [iconLibrary] - Icon library to use.
|
|
56
|
+
* @property {string} [iconVariant] - Icon style variant (e.g., 'solid', 'outlined').
|
|
57
|
+
* @property {string | string[]} [iconFeatures] - Additional icon modifiers.
|
|
58
|
+
* @property {'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'} [color] - Bulma color modifier for the input.
|
|
59
|
+
* @property {'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'dark' | 'light'} [tagColor] - Color modifier for tags.
|
|
60
|
+
* @property {'small' | 'medium' | 'large'} [size] - Size modifier for the component.
|
|
61
|
+
*/
|
|
11
62
|
export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
12
63
|
value?: TaginputTag[];
|
|
13
64
|
defaultValue?: TaginputTag[];
|
|
@@ -50,5 +101,31 @@ export interface TaginputProps extends Omit<React.HTMLAttributes<HTMLDivElement>
|
|
|
50
101
|
onTyping?: (value: string) => void;
|
|
51
102
|
tagTemplate?: (tag: TaginputTag) => React.ReactNode;
|
|
52
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Taginput component for managing multiple tags.
|
|
106
|
+
*
|
|
107
|
+
* Allows users to create, edit, and remove tags with optional
|
|
108
|
+
* autocomplete suggestions.
|
|
109
|
+
*
|
|
110
|
+
* @function
|
|
111
|
+
* @param {TaginputProps} props - Props for the Taginput component.
|
|
112
|
+
* @param {React.Ref<HTMLInputElement>} ref - Forwarded ref to the input element.
|
|
113
|
+
* @returns {JSX.Element} The rendered taginput component.
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* // Basic usage
|
|
117
|
+
* <Taginput
|
|
118
|
+
* placeholder="Add a tag..."
|
|
119
|
+
* onChange={(tags) => console.log(tags)}
|
|
120
|
+
* />
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* // With autocomplete
|
|
124
|
+
* <Taginput
|
|
125
|
+
* data={['React', 'Vue', 'Angular', 'Svelte']}
|
|
126
|
+
* allowNew={false}
|
|
127
|
+
* placeholder="Select frameworks..."
|
|
128
|
+
* />
|
|
129
|
+
*/
|
|
53
130
|
export declare const Taginput: React.ForwardRefExoticComponent<TaginputProps & React.RefAttributes<HTMLInputElement>>;
|
|
54
131
|
export default Taginput;
|
|
@@ -2,6 +2,24 @@ import React from 'react';
|
|
|
2
2
|
import { FieldProps } from './Field';
|
|
3
3
|
import { ControlBaseProps } from './Control';
|
|
4
4
|
import { TextAreaBaseProps } from './TextAreaBase';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the TextArea component.
|
|
7
|
+
*
|
|
8
|
+
* Composes Field, Control, and TextAreaBase into a single convenience component.
|
|
9
|
+
* Supports all TextAreaBase props, plus Field-level (label, horizontal) and
|
|
10
|
+
* Control-level (loading) props.
|
|
11
|
+
*
|
|
12
|
+
* @property {React.ReactNode} [label] - Field label.
|
|
13
|
+
* @property {FieldProps['labelSize']} [labelSize] - Size for the label.
|
|
14
|
+
* @property {FieldProps['labelProps']} [labelProps] - Props for the label element.
|
|
15
|
+
* @property {boolean} [horizontal] - Horizontal field layout.
|
|
16
|
+
* @property {boolean} [isLoading] - Show loading indicator on the control.
|
|
17
|
+
* @property {'small'|'medium'|'large'} [controlSize] - Control size.
|
|
18
|
+
* @property {React.ReactNode} [message] - Help/validation message below the textarea.
|
|
19
|
+
* @property {string} [messageColor] - Bulma color for the message.
|
|
20
|
+
* @property {string} [fieldClassName] - Additional CSS classes for the Field.
|
|
21
|
+
* @property {string} [controlClassName] - Additional CSS classes for the Control.
|
|
22
|
+
*/
|
|
5
23
|
export interface TextAreaProps extends TextAreaBaseProps {
|
|
6
24
|
label?: React.ReactNode;
|
|
7
25
|
labelSize?: FieldProps['labelSize'];
|
|
@@ -14,5 +32,25 @@ export interface TextAreaProps extends TextAreaBaseProps {
|
|
|
14
32
|
fieldClassName?: string;
|
|
15
33
|
controlClassName?: string;
|
|
16
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* TextArea is a convenience component that composes Field, Control, and TextAreaBase.
|
|
37
|
+
*
|
|
38
|
+
* Use this for typical form fields. For complex layouts (grouped fields,
|
|
39
|
+
* addons, etc.), compose Field, Control, and TextAreaBase directly.
|
|
40
|
+
*
|
|
41
|
+
* @function
|
|
42
|
+
* @param {TextAreaProps} props - Props for TextArea.
|
|
43
|
+
* @returns {JSX.Element} The composed field element.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <TextArea label="Bio" placeholder="Tell us about yourself" rows={4} />
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* <TextArea
|
|
50
|
+
* label="Comments"
|
|
51
|
+
* message="Max 500 characters"
|
|
52
|
+
* messageColor="info"
|
|
53
|
+
* />
|
|
54
|
+
*/
|
|
17
55
|
export declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
18
56
|
export default TextArea;
|