@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,6 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { IconProps } from '../elements/Icon';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the Control component.
|
|
6
|
+
*
|
|
7
|
+
* @property {boolean} [hasIconsLeft] - Adds left icon container.
|
|
8
|
+
* @property {boolean} [hasIconsRight] - Adds right icon container.
|
|
9
|
+
* @property {boolean} [isLoading] - Shows loading indicator.
|
|
10
|
+
* @property {boolean} [isExpanded] - Makes the control expand to fill available space.
|
|
11
|
+
* @property {'small'|'medium'|'large'} [size] - Sets the control size.
|
|
12
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Sets text color.
|
|
13
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the control.
|
|
14
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color.
|
|
15
|
+
* @property {IconProps} [iconLeft] - Icon props for left icon.
|
|
16
|
+
* @property {IconProps} [iconRight] - Icon props for right icon.
|
|
17
|
+
* @property {string} [iconLeftName] - Shortcut for left icon name.
|
|
18
|
+
* @property {'small'|'medium'|'large'} [iconLeftSize] - Shortcut for left icon size.
|
|
19
|
+
* @property {string} [iconRightName] - Shortcut for right icon name.
|
|
20
|
+
* @property {'small'|'medium'|'large'} [iconRightSize] - Shortcut for right icon size.
|
|
21
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
22
|
+
* @property {React.ReactNode} [children] - Content inside the control.
|
|
23
|
+
* @property {'div'|'p'} [as] - Element type for the control (default: 'div').
|
|
24
|
+
* @property {React.Ref<HTMLDivElement|HTMLParagraphElement>} [ref] - Ref for the control element.
|
|
25
|
+
*/
|
|
4
26
|
export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
5
27
|
hasIconsLeft?: boolean;
|
|
6
28
|
hasIconsRight?: boolean;
|
|
@@ -19,6 +41,20 @@ export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>,
|
|
|
19
41
|
className?: string;
|
|
20
42
|
children?: React.ReactNode;
|
|
21
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Bulma Control component for form controls, with icons, loading, and Bulma helper support.
|
|
46
|
+
*
|
|
47
|
+
* @function
|
|
48
|
+
* @param {ControlProps} props - Props for the Control component.
|
|
49
|
+
* @returns {JSX.Element} The rendered control container.
|
|
50
|
+
* @see {@link https://bulma.io/documentation/form/general/#control | Bulma Control documentation}
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* // Control with left icon
|
|
54
|
+
* <Control iconLeftName="envelope" iconLeftSize="small">
|
|
55
|
+
* <input className="input" type="email" placeholder="Email" />
|
|
56
|
+
* </Control>
|
|
57
|
+
*/
|
|
22
58
|
export declare const Control: React.ForwardRefExoticComponent<(Omit<{
|
|
23
59
|
as?: "div";
|
|
24
60
|
} & ControlBaseProps & {
|
|
@@ -2,6 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { FieldProps } from './Field';
|
|
3
3
|
import { ControlBaseProps } from './Control';
|
|
4
4
|
import { DateInputBaseProps } from './DateInputBase';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the DateInput convenience wrapper. Extends `DateInputBaseProps`
|
|
7
|
+
* with Field-level (label, horizontal) and Control-level (icons, loading) props.
|
|
8
|
+
*
|
|
9
|
+
* @property {React.ReactNode} [label] - Field label.
|
|
10
|
+
* @property {FieldProps['labelSize']} [labelSize] - Size for the label.
|
|
11
|
+
* @property {FieldProps['labelProps']} [labelProps] - Props for the label element.
|
|
12
|
+
* @property {boolean} [horizontal] - Render the field with horizontal layout.
|
|
13
|
+
* @property {ControlBaseProps['iconLeft']} [iconLeft] - Icon props for the left icon.
|
|
14
|
+
* @property {ControlBaseProps['iconRight']} [iconRight] - Icon props for the right icon.
|
|
15
|
+
* @property {string} [iconRightName] - Shortcut for the right icon name.
|
|
16
|
+
* @property {ControlBaseProps['iconLeftSize']} [iconLeftSize] - Shortcut for left icon size.
|
|
17
|
+
* @property {ControlBaseProps['iconRightSize']} [iconRightSize] - Shortcut for right icon size.
|
|
18
|
+
* @property {boolean} [hasIconsLeft] - Force the left icon container.
|
|
19
|
+
* @property {boolean} [hasIconsRight] - Force the right icon container.
|
|
20
|
+
* @property {boolean} [isLoading] - Show a loading indicator on the control.
|
|
21
|
+
* @property {boolean} [isExpanded] - Expand the control to fill its container.
|
|
22
|
+
* @property {ControlBaseProps['size']} [controlSize] - Size of the wrapping Control.
|
|
23
|
+
* @property {React.ReactNode} [message] - Help/validation text below the input.
|
|
24
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [messageColor] - Message color.
|
|
25
|
+
* @property {string} [fieldClassName] - Additional CSS classes for the Field wrapper.
|
|
26
|
+
* @property {string} [controlClassName] - Additional CSS classes for the Control wrapper.
|
|
27
|
+
*/
|
|
5
28
|
export interface DateInputProps extends DateInputBaseProps {
|
|
6
29
|
label?: React.ReactNode;
|
|
7
30
|
labelSize?: FieldProps['labelSize'];
|
|
@@ -22,5 +45,26 @@ export interface DateInputProps extends DateInputBaseProps {
|
|
|
22
45
|
fieldClassName?: string;
|
|
23
46
|
controlClassName?: string;
|
|
24
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* DateInput is a form input that opens a popover calendar for date selection.
|
|
50
|
+
* Uses native `Date` and `Intl` only (no extra dependencies). Supports min/max
|
|
51
|
+
* bounds, disabled-date predicates, custom formats, locale-aware day/month
|
|
52
|
+
* names, an inline mode, and a native `<input type="date">` fallback for touch
|
|
53
|
+
* devices.
|
|
54
|
+
*
|
|
55
|
+
* @function
|
|
56
|
+
* @param {DateInputProps} props - Props for the DateInput.
|
|
57
|
+
* @returns {JSX.Element}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* <DateInput label="Date of birth" defaultValue={new Date(1990, 0, 1)} />
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* <DateInput
|
|
64
|
+
* label="Booking"
|
|
65
|
+
* min={new Date()}
|
|
66
|
+
* shouldDisableDate={d => d.getDay() === 0 || d.getDay() === 6}
|
|
67
|
+
* />
|
|
68
|
+
*/
|
|
25
69
|
export declare const DateInput: React.ForwardRefExoticComponent<DateInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
70
|
export default DateInput;
|
|
@@ -2,6 +2,44 @@ import React from 'react';
|
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { PickerPosition, DayOfWeek, PickerLabels } from './_pickerInternals/pickerTypes';
|
|
4
4
|
import { DateFormatOption } from './_pickerInternals/formatters';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the raw DateInput base. Use the higher-level `DateInput` for
|
|
7
|
+
* Field/Control composition; `DateInputBase` is the input + popover only.
|
|
8
|
+
*
|
|
9
|
+
* @property {Date | null} [value] - Controlled selected date.
|
|
10
|
+
* @property {Date | null} [defaultValue] - Initial date for uncontrolled usage.
|
|
11
|
+
* @property {(d: Date | null) => void} [onChange] - Fired when the value changes.
|
|
12
|
+
* @property {() => void} [onOpen] - Fired when the popover opens.
|
|
13
|
+
* @property {() => void} [onClose] - Fired when the popover closes.
|
|
14
|
+
* @property {Date} [min] - Earliest selectable date.
|
|
15
|
+
* @property {Date} [max] - Latest selectable date.
|
|
16
|
+
* @property {boolean} [disabled] - Disable the input.
|
|
17
|
+
* @property {boolean} [readOnly] - Make the input read-only.
|
|
18
|
+
* @property {string} [placeholder] - Placeholder text.
|
|
19
|
+
* @property {DateFormatOption} [format] - Token format string or `Intl.DateTimeFormat` options. Default `'YYYY-MM-DD'`.
|
|
20
|
+
* @property {(s: string) => Date | null} [parse] - Custom parser (use when `format` is `Intl.DateTimeFormatOptions`).
|
|
21
|
+
* @property {string} [locale] - BCP-47 locale tag for day/month names.
|
|
22
|
+
* @property {boolean} [inline] - Render the calendar inline (no popover).
|
|
23
|
+
* @property {boolean | 'auto'} [mobileNative] - Use native `<input type="date">` on coarse-pointer + small-viewport devices.
|
|
24
|
+
* @property {boolean} [editable] - Allow segmented keyboard typing in the input (type the date directly, auto-advancing across segments). Default `true`.
|
|
25
|
+
* @property {boolean} [popover] - Whether the calendar popover exists. `false` makes the field input-only (segmented typing with no popover). Default `true`.
|
|
26
|
+
* @property {boolean} [openOnFocus] - Open the popover on focus. Default `true`.
|
|
27
|
+
* @property {boolean} [closeOnSelect] - Close the popover after selection. Default `true`.
|
|
28
|
+
* @property {PickerPosition} [position] - Popover anchor position.
|
|
29
|
+
* @property {boolean} [appendToBody] - Render the popover into `document.body` via portal.
|
|
30
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color modifier.
|
|
31
|
+
* @property {'small'|'medium'|'large'} [size] - Size variant.
|
|
32
|
+
* @property {boolean} [isRounded] - Render the input with rounded corners.
|
|
33
|
+
* @property {(d: Date) => boolean} [shouldDisableDate] - Predicate to disable specific dates. Blocked dates can't be selected in the calendar and are rejected by manual typing (segmented and free-form).
|
|
34
|
+
* @property {Date[]} [unselectableDates] - Convenience array of disabled dates, matched by calendar day; also rejected by manual typing.
|
|
35
|
+
* @property {DayOfWeek} [firstDayOfWeek] - Day the week starts on (0 = Sunday).
|
|
36
|
+
* @property {string[]} [dayNames] - Override the 7 day-name labels.
|
|
37
|
+
* @property {string[]} [monthNames] - Override the 12 month-name labels.
|
|
38
|
+
* @property {boolean} [nearbyMonthDays] - Show dimmed dates from adjacent months. Default `true`.
|
|
39
|
+
* @property {string} [iconLeftName] - Decorative left icon glyph for the wrapping Control (shown by default; set to '' to hide).
|
|
40
|
+
* @property {boolean} [triggerIcon] - Show a clickable launcher button on the right that toggles the popover. Default `true`.
|
|
41
|
+
* @property {string} [triggerIconName] - Glyph name for the right launcher button. Default `'chevron-down'`.
|
|
42
|
+
*/
|
|
5
43
|
export interface DateInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'color' | 'min' | 'max' | 'type' | 'popover'>, Omit<BulmaClassesProps, 'color'> {
|
|
6
44
|
value?: Date | null;
|
|
7
45
|
defaultValue?: Date | null;
|
|
@@ -36,7 +74,16 @@ export interface DateInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
|
|
|
36
74
|
iconLeftName?: string;
|
|
37
75
|
triggerIcon?: boolean;
|
|
38
76
|
triggerIconName?: string;
|
|
77
|
+
/** Optional translatable string overrides (ARIA labels, button text). */
|
|
39
78
|
labels?: PickerLabels;
|
|
40
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Raw DateInput — input + popover calendar without Field/Control wrapping.
|
|
82
|
+
* Use `DateInput` for the convenience wrapper.
|
|
83
|
+
*
|
|
84
|
+
* @function
|
|
85
|
+
* @param {DateInputBaseProps} props
|
|
86
|
+
* @returns {JSX.Element}
|
|
87
|
+
*/
|
|
41
88
|
export declare const DateInputBase: React.ForwardRefExoticComponent<DateInputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
42
89
|
export default DateInputBase;
|
|
@@ -2,6 +2,29 @@ import React from 'react';
|
|
|
2
2
|
import { FieldProps } from './Field';
|
|
3
3
|
import { ControlBaseProps } from './Control';
|
|
4
4
|
import { DateTimeInputBaseProps } from './DateTimeInputBase';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the DateTimeInput convenience wrapper. Extends
|
|
7
|
+
* `DateTimeInputBaseProps` with Field-level and Control-level props.
|
|
8
|
+
*
|
|
9
|
+
* @property {React.ReactNode} [label] - Field label.
|
|
10
|
+
* @property {FieldProps['labelSize']} [labelSize] - Size for the label.
|
|
11
|
+
* @property {FieldProps['labelProps']} [labelProps] - Props for the label element.
|
|
12
|
+
* @property {boolean} [horizontal] - Render the field with horizontal layout.
|
|
13
|
+
* @property {ControlBaseProps['iconLeft']} [iconLeft] - Icon props for the left icon.
|
|
14
|
+
* @property {ControlBaseProps['iconRight']} [iconRight] - Icon props for the right icon.
|
|
15
|
+
* @property {string} [iconRightName] - Shortcut for the right icon name.
|
|
16
|
+
* @property {ControlBaseProps['iconLeftSize']} [iconLeftSize] - Shortcut for left icon size.
|
|
17
|
+
* @property {ControlBaseProps['iconRightSize']} [iconRightSize] - Shortcut for right icon size.
|
|
18
|
+
* @property {boolean} [hasIconsLeft] - Force the left icon container.
|
|
19
|
+
* @property {boolean} [hasIconsRight] - Force the right icon container.
|
|
20
|
+
* @property {boolean} [isLoading] - Show a loading indicator on the control.
|
|
21
|
+
* @property {boolean} [isExpanded] - Expand the control to fill its container.
|
|
22
|
+
* @property {ControlBaseProps['size']} [controlSize] - Size of the wrapping Control.
|
|
23
|
+
* @property {React.ReactNode} [message] - Help/validation text below the input.
|
|
24
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [messageColor] - Message color.
|
|
25
|
+
* @property {string} [fieldClassName] - Additional CSS classes for the Field wrapper.
|
|
26
|
+
* @property {string} [controlClassName] - Additional CSS classes for the Control wrapper.
|
|
27
|
+
*/
|
|
5
28
|
export interface DateTimeInputProps extends DateTimeInputBaseProps {
|
|
6
29
|
label?: React.ReactNode;
|
|
7
30
|
labelSize?: FieldProps['labelSize'];
|
|
@@ -22,5 +45,24 @@ export interface DateTimeInputProps extends DateTimeInputBaseProps {
|
|
|
22
45
|
fieldClassName?: string;
|
|
23
46
|
controlClassName?: string;
|
|
24
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* DateTimeInput is a form input that opens a popover combining a calendar
|
|
50
|
+
* (above) and a time spinner (below). Footer offers Today / Now / Clear / OK.
|
|
51
|
+
* Includes a native `<input type="datetime-local">` fallback for touch devices.
|
|
52
|
+
*
|
|
53
|
+
* @function
|
|
54
|
+
* @param {DateTimeInputProps} props
|
|
55
|
+
* @returns {JSX.Element}
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* <DateTimeInput label="Appointment" defaultValue={new Date()} />
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* <DateTimeInput
|
|
62
|
+
* label="When"
|
|
63
|
+
* hourFormat="12"
|
|
64
|
+
* shouldDisableDate={d => d.getDay() === 0 || d.getDay() === 6}
|
|
65
|
+
* />
|
|
66
|
+
*/
|
|
25
67
|
export declare const DateTimeInput: React.ForwardRefExoticComponent<DateTimeInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
26
68
|
export default DateTimeInput;
|
|
@@ -2,6 +2,53 @@ import React from 'react';
|
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { PickerPosition, HourFormat, DayOfWeek, PickerLabels } from './_pickerInternals/pickerTypes';
|
|
4
4
|
import { DateFormatOption } from './_pickerInternals/formatters';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the raw DateTimeInput base. Use the higher-level `DateTimeInput`
|
|
7
|
+
* for Field/Control composition. Combines the prop set of `DateInputBaseProps`
|
|
8
|
+
* and `TimeInputBaseProps`.
|
|
9
|
+
*
|
|
10
|
+
* @property {Date | null} [value] - Controlled selected date-time.
|
|
11
|
+
* @property {Date | null} [defaultValue] - Initial value for uncontrolled usage.
|
|
12
|
+
* @property {(d: Date | null) => void} [onChange] - Fired when either half changes.
|
|
13
|
+
* @property {() => void} [onOpen] - Fired when the popover opens.
|
|
14
|
+
* @property {() => void} [onClose] - Fired when the popover closes.
|
|
15
|
+
* @property {Date} [min] - Lower bound for the combined date-time.
|
|
16
|
+
* @property {Date} [max] - Upper bound for the combined date-time.
|
|
17
|
+
* @property {boolean} [disabled] - Disable the input.
|
|
18
|
+
* @property {boolean} [readOnly] - Read-only input.
|
|
19
|
+
* @property {string} [placeholder] - Placeholder text.
|
|
20
|
+
* @property {DateFormatOption} [format] - Token format string or `Intl.DateTimeFormat` options. Default `'YYYY-MM-DD HH:mm'`.
|
|
21
|
+
* @property {(s: string) => Date | null} [parse] - Custom parser.
|
|
22
|
+
* @property {string} [locale] - BCP-47 locale tag.
|
|
23
|
+
* @property {boolean} [inline] - Render the panel inline (no popover).
|
|
24
|
+
* @property {boolean | 'auto'} [mobileNative] - Use native `<input type="datetime-local">` on coarse-pointer devices.
|
|
25
|
+
* @property {boolean} [editable] - Allow segmented keyboard typing in the input (type the date-time directly, auto-advancing across segments). Default `true`.
|
|
26
|
+
* @property {boolean} [popover] - Whether the calendar + time popover exists. `false` makes the field input-only (segmented typing with no popover). Default `true`.
|
|
27
|
+
* @property {boolean} [openOnFocus] - Open the popover on focus. Default `true`.
|
|
28
|
+
* @property {boolean} [closeOnSelect] - Close after selection. Default `false`.
|
|
29
|
+
* @property {PickerPosition} [position] - Popover anchor position.
|
|
30
|
+
* @property {boolean} [appendToBody] - Render the popover into `document.body` via portal.
|
|
31
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color modifier.
|
|
32
|
+
* @property {'small'|'medium'|'large'} [size] - Size variant.
|
|
33
|
+
* @property {boolean} [isRounded] - Rounded input corners.
|
|
34
|
+
* @property {(d: Date) => boolean} [shouldDisableDate] - Predicate for disabled dates. Blocked dates can't be picked in the calendar and are rejected by manual typing; during entry the predicate receives the full candidate date-time, so prefer day-based checks.
|
|
35
|
+
* @property {Date[]} [unselectableDates] - Convenience array of disabled dates, matched by calendar day; also rejected by manual typing.
|
|
36
|
+
* @property {DayOfWeek} [firstDayOfWeek] - Day the calendar week starts on.
|
|
37
|
+
* @property {string[]} [dayNames] - Override the 7 day-name labels.
|
|
38
|
+
* @property {string[]} [monthNames] - Override the 12 month-name labels.
|
|
39
|
+
* @property {boolean} [nearbyMonthDays] - Show dimmed dates from adjacent months.
|
|
40
|
+
* @property {HourFormat} [hourFormat] - `'12'` or `'24'`. Default `'24'`.
|
|
41
|
+
* @property {boolean} [enableSeconds] - Show a seconds column. Note: iOS Safari's native datetime-local picker has no seconds wheel; combine with `mobileNative={false}` if a seconds wheel is required on iOS.
|
|
42
|
+
* @property {number} [incrementHours] - Hour step.
|
|
43
|
+
* @property {number} [incrementMinutes] - Minute step.
|
|
44
|
+
* @property {number} [incrementSeconds] - Second step.
|
|
45
|
+
* @property {(d: Date) => boolean} [unselectableTimes] - Predicate for blocked times (the wheels skip ahead; manual typing rejects them).
|
|
46
|
+
* @property {string} [iconLeftName] - Decorative left icon glyph for the wrapping Control (shown by default; set to '' to hide).
|
|
47
|
+
* @property {boolean} [triggerIcon] - Show a clickable launcher button on the right that toggles the popover. Default `true`.
|
|
48
|
+
* @property {string} [triggerIconName] - Glyph name for the right launcher button. Default `'chevron-down'`.
|
|
49
|
+
* @property {boolean} [audioTick] - Play a short audible tick on each time-wheel crossing. Default `false`.
|
|
50
|
+
* @property {boolean} [haptics] - Auto-route tactile feedback per wheel tick (vibrate on Android, audio thunk on iOS). Default `false`.
|
|
51
|
+
*/
|
|
5
52
|
export interface DateTimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'color' | 'min' | 'max' | 'type' | 'popover'>, Omit<BulmaClassesProps, 'color'> {
|
|
6
53
|
value?: Date | null;
|
|
7
54
|
defaultValue?: Date | null;
|
|
@@ -44,7 +91,16 @@ export interface DateTimeInputBaseProps extends Omit<React.InputHTMLAttributes<H
|
|
|
44
91
|
triggerIconName?: string;
|
|
45
92
|
audioTick?: boolean;
|
|
46
93
|
haptics?: boolean;
|
|
94
|
+
/** Optional translatable string overrides. */
|
|
47
95
|
labels?: PickerLabels;
|
|
48
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Raw DateTimeInput — combined input + calendar + time spinner without
|
|
99
|
+
* Field/Control wrapping. Use `DateTimeInput` for the convenience wrapper.
|
|
100
|
+
*
|
|
101
|
+
* @function
|
|
102
|
+
* @param {DateTimeInputBaseProps} props
|
|
103
|
+
* @returns {JSX.Element}
|
|
104
|
+
*/
|
|
49
105
|
export declare const DateTimeInputBase: React.ForwardRefExoticComponent<DateTimeInputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
106
|
export default DateTimeInputBase;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Field component.
|
|
5
|
+
*
|
|
6
|
+
* @property {boolean} [horizontal] - Renders the field as horizontal (label and control side by side).
|
|
7
|
+
* @property {boolean|'centered'|'right'|'multiline'} [grouped] - Group controls in a row (optionally centered, right, or multiline).
|
|
8
|
+
* @property {boolean|'centered'|'right'} [hasAddons] - Group controls as addons (optionally centered or right-aligned).
|
|
9
|
+
* @property {boolean} [narrow] - Constrains the field to its content's width (used inside horizontal field bodies).
|
|
10
|
+
* @property {React.ReactNode} [label] - Field label.
|
|
11
|
+
* @property {'small'|'normal'|'medium'|'large'} [labelSize] - Size for the label.
|
|
12
|
+
* @property {object} [labelProps] - Props for the label element.
|
|
13
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the field.
|
|
14
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the field.
|
|
15
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the field.
|
|
16
|
+
* @property {string} [className] - Additional CSS classes.
|
|
17
|
+
* @property {React.ReactNode} [children] - Field content.
|
|
18
|
+
*/
|
|
3
19
|
export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
4
20
|
horizontal?: boolean;
|
|
5
21
|
grouped?: boolean | 'centered' | 'right' | 'multiline';
|
|
@@ -16,6 +32,16 @@ export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<B
|
|
|
16
32
|
className?: string;
|
|
17
33
|
children?: React.ReactNode;
|
|
18
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Props for the FieldLabel component.
|
|
37
|
+
*
|
|
38
|
+
* @property {'small'|'normal'|'medium'|'large'} [size] - Size for the field label.
|
|
39
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the label.
|
|
40
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the label.
|
|
41
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the label.
|
|
42
|
+
* @property {string} [className] - Additional CSS classes.
|
|
43
|
+
* @property {React.ReactNode} [children] - Field label content.
|
|
44
|
+
*/
|
|
19
45
|
export interface FieldLabelProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
20
46
|
size?: 'small' | 'normal' | 'medium' | 'large';
|
|
21
47
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
@@ -24,6 +50,15 @@ export interface FieldLabelProps extends React.HTMLAttributes<HTMLDivElement>, O
|
|
|
24
50
|
className?: string;
|
|
25
51
|
children?: React.ReactNode;
|
|
26
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Props for the FieldBody component.
|
|
55
|
+
*
|
|
56
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [textColor] - Text color for the field body.
|
|
57
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'} [color] - Bulma color for the field body.
|
|
58
|
+
* @property {(typeof validColors)[number] | 'inherit' | 'current'} [bgColor] - Background color for the field body.
|
|
59
|
+
* @property {string} [className] - Additional CSS classes.
|
|
60
|
+
* @property {React.ReactNode} [children] - Field body content.
|
|
61
|
+
*/
|
|
27
62
|
export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
28
63
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
29
64
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
@@ -31,10 +66,39 @@ export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Om
|
|
|
31
66
|
className?: string;
|
|
32
67
|
children?: React.ReactNode;
|
|
33
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* FieldLabel component for rendering a Bulma field label.
|
|
71
|
+
*
|
|
72
|
+
* @function
|
|
73
|
+
* @param {FieldLabelProps} props - Props for the FieldLabel component.
|
|
74
|
+
* @returns {JSX.Element} The rendered field label.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* <FieldLabel size="normal">Name</FieldLabel>
|
|
78
|
+
*/
|
|
34
79
|
export declare const FieldLabel: React.FC<FieldLabelProps>;
|
|
80
|
+
/**
|
|
81
|
+
* FieldBody component for rendering Bulma field body.
|
|
82
|
+
*
|
|
83
|
+
* @function
|
|
84
|
+
* @param {FieldBodyProps} props - Props for the FieldBody component.
|
|
85
|
+
* @returns {JSX.Element} The rendered field body.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* <FieldBody><input className="input" /></FieldBody>
|
|
89
|
+
*/
|
|
35
90
|
export declare const FieldBody: React.FC<FieldBodyProps>;
|
|
36
91
|
export declare const Field: React.FC<FieldProps> & {
|
|
37
|
-
Label:
|
|
38
|
-
Body:
|
|
92
|
+
Label: React.FC<FieldLabelProps>;
|
|
93
|
+
Body: React.FC<FieldBodyProps>;
|
|
94
|
+
Control: React.ForwardRefExoticComponent<(Omit<{
|
|
95
|
+
as?: "div";
|
|
96
|
+
} & import("./Control").ControlBaseProps & {
|
|
97
|
+
ref?: React.Ref<HTMLDivElement>;
|
|
98
|
+
}, "ref"> | Omit<{
|
|
99
|
+
as: "p";
|
|
100
|
+
} & Omit<import("./Control").ControlBaseProps, keyof React.HTMLAttributes<HTMLDivElement>> & React.HTMLAttributes<HTMLParagraphElement> & {
|
|
101
|
+
ref?: React.Ref<HTMLParagraphElement>;
|
|
102
|
+
}, "ref">) & React.RefAttributes<HTMLDivElement | HTMLParagraphElement>>;
|
|
39
103
|
};
|
|
40
104
|
export default Field;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the File component.
|
|
6
|
+
*
|
|
7
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the file input.
|
|
8
|
+
* @property {'small'|'medium'|'large'} [size] - Size modifier for the file input.
|
|
9
|
+
* @property {boolean} [isBoxed] - Whether the file input is boxed.
|
|
10
|
+
* @property {boolean} [isFullwidth] - Whether the file input expands to full width.
|
|
11
|
+
* @property {boolean} [isRight] - Align file input to the right.
|
|
12
|
+
* @property {boolean} [isCentered] - Center the file input.
|
|
13
|
+
* @property {boolean} [hasName] - Show a file name indicator.
|
|
14
|
+
* @property {React.ReactNode} [buttonLabel] - Custom button label text or node.
|
|
15
|
+
* @property {React.ReactNode} [iconLeft] - Left icon element.
|
|
16
|
+
* @property {React.ReactNode} [iconRight] - Right icon element.
|
|
17
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
18
|
+
* @property {string} [inputClassName] - Additional CSS classes for the input.
|
|
19
|
+
* @property {string} [fileName] - File name to display.
|
|
20
|
+
*/
|
|
4
21
|
export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
5
22
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
6
23
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -16,5 +33,14 @@ export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputEleme
|
|
|
16
33
|
inputClassName?: string;
|
|
17
34
|
fileName?: string;
|
|
18
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Bulma File upload component with full Bulma helper class support.
|
|
38
|
+
* isRight and isCentered are mutually exclusive (Bulma spec).
|
|
39
|
+
*
|
|
40
|
+
* @function
|
|
41
|
+
* @param {FileProps} props - Props for the File component.
|
|
42
|
+
* @returns {JSX.Element} The rendered file upload field.
|
|
43
|
+
* @see {@link https://bulma.io/documentation/form/file/ | Bulma File documentation}
|
|
44
|
+
*/
|
|
19
45
|
export declare const File: React.ForwardRefExoticComponent<FileProps & React.RefAttributes<HTMLInputElement>>;
|
|
20
46
|
export default File;
|
|
@@ -1,22 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to detect if the component is inside a Field wrapper.
|
|
3
|
+
* Form components use this to skip rendering their own Field.
|
|
4
|
+
*/
|
|
1
5
|
export declare const useInsideField: () => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Hook to detect if the component is inside a Control wrapper.
|
|
8
|
+
* Form components use this to skip rendering their own Control.
|
|
9
|
+
*/
|
|
2
10
|
export declare const useInsideControl: () => boolean;
|
|
11
|
+
/** Provider for Field context — used internally by Field component. */
|
|
3
12
|
export declare const FieldProvider: import("react").Provider<boolean>;
|
|
13
|
+
/** Provider for Control context — used internally by Control component. */
|
|
4
14
|
export declare const ControlProvider: import("react").Provider<boolean>;
|
|
15
|
+
/**
|
|
16
|
+
* Shape of the Radios group context. The group provides:
|
|
17
|
+
* - `name`: shared form field name (Stage 1)
|
|
18
|
+
* - `value`: currently-selected radio value (Stage 2 — group-managed selection)
|
|
19
|
+
* - `onChange`: dispatched by child Radios when clicked (Stage 2)
|
|
20
|
+
*
|
|
21
|
+
* Group sets `value`/`onChange` only when actively managing selection
|
|
22
|
+
* (i.e., the user passed `value`, `defaultValue`, or `onChange` to `<Radios>`).
|
|
23
|
+
* When only `name` is provided, the group is in "name-only" mode and child
|
|
24
|
+
* Radios manage their own checked state independently.
|
|
25
|
+
*/
|
|
5
26
|
export interface RadiosGroupContextValue {
|
|
6
27
|
name?: string;
|
|
7
28
|
value?: string;
|
|
8
29
|
onChange?: (value: string) => void;
|
|
9
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Shape of the Checkboxes group context. Like Radios but with array semantics
|
|
33
|
+
* for multi-select.
|
|
34
|
+
*/
|
|
10
35
|
export interface CheckboxesGroupContextValue {
|
|
11
36
|
name?: string;
|
|
12
37
|
value?: string[];
|
|
13
38
|
onChange?: (values: string[]) => void;
|
|
14
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Hook to read the full surrounding `<Radios>` group context (name + selection).
|
|
42
|
+
* Returns `undefined` when not inside a `<Radios>` group.
|
|
43
|
+
*/
|
|
15
44
|
export declare const useRadiosGroup: () => RadiosGroupContextValue | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Hook to read the full surrounding `<Checkboxes>` group context.
|
|
47
|
+
* Returns `undefined` when not inside a `<Checkboxes>` group.
|
|
48
|
+
*/
|
|
16
49
|
export declare const useCheckboxesGroup: () => CheckboxesGroupContextValue | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Hook to read just the shared `name` from a surrounding `<Radios>` group.
|
|
52
|
+
* Child `<Radio>` components fall back to this when no local `name` prop is set.
|
|
53
|
+
* Returns `undefined` outside of a `<Radios>` group.
|
|
54
|
+
*/
|
|
17
55
|
export declare const useRadiosName: () => string | undefined;
|
|
56
|
+
/**
|
|
57
|
+
* Hook to read just the shared `name` from a surrounding `<Checkboxes>` group.
|
|
58
|
+
* Returns `undefined` outside of a `<Checkboxes>` group.
|
|
59
|
+
*/
|
|
18
60
|
export declare const useCheckboxesName: () => string | undefined;
|
|
61
|
+
/** Provider for the Radios group context — used internally by Radios. */
|
|
19
62
|
export declare const RadiosProvider: import("react").Provider<RadiosGroupContextValue | undefined>;
|
|
63
|
+
/** Provider for the Checkboxes group context — used internally by Checkboxes. */
|
|
20
64
|
export declare const CheckboxesProvider: import("react").Provider<CheckboxesGroupContextValue | undefined>;
|
|
65
|
+
/** @deprecated Use `RadiosProvider` (provides {name, value, onChange}). */
|
|
21
66
|
export declare const RadiosNameProvider: import("react").Provider<RadiosGroupContextValue | undefined>;
|
|
67
|
+
/** @deprecated Use `CheckboxesProvider` (provides {name, value, onChange}). */
|
|
22
68
|
export declare const CheckboxesNameProvider: import("react").Provider<CheckboxesGroupContextValue | undefined>;
|
|
@@ -2,6 +2,33 @@ import React from 'react';
|
|
|
2
2
|
import { FieldProps } from './Field';
|
|
3
3
|
import { ControlBaseProps } from './Control';
|
|
4
4
|
import { InputBaseProps } from './InputBase';
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Input component.
|
|
7
|
+
*
|
|
8
|
+
* Composes Field, Control, and Input into a single convenience component.
|
|
9
|
+
* Supports all Input 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 {ControlBaseProps['iconRight']} [iconRight] - Icon props for right icon.
|
|
18
|
+
* @property {string} [iconLeftName] - Shortcut for left icon name.
|
|
19
|
+
* @property {string} [iconRightName] - Shortcut for right icon name.
|
|
20
|
+
* @property {ControlBaseProps['iconLeftSize']} [iconLeftSize] - Shortcut for left icon size.
|
|
21
|
+
* @property {ControlBaseProps['iconRightSize']} [iconRightSize] - Shortcut for right icon size.
|
|
22
|
+
* @property {boolean} [hasIconsLeft] - Force left icon container.
|
|
23
|
+
* @property {boolean} [hasIconsRight] - Force right icon container.
|
|
24
|
+
* @property {boolean} [isLoading] - Show loading indicator on the control.
|
|
25
|
+
* @property {boolean} [isExpanded] - Expand the control.
|
|
26
|
+
* @property {'small'|'medium'|'large'} [controlSize] - Control size.
|
|
27
|
+
* @property {React.ReactNode} [message] - Help/validation message below the input.
|
|
28
|
+
* @property {string} [messageColor] - Bulma color for the message.
|
|
29
|
+
* @property {string} [fieldClassName] - Additional CSS classes for the Field.
|
|
30
|
+
* @property {string} [controlClassName] - Additional CSS classes for the Control.
|
|
31
|
+
*/
|
|
5
32
|
export interface InputProps extends InputBaseProps {
|
|
6
33
|
label?: React.ReactNode;
|
|
7
34
|
labelSize?: FieldProps['labelSize'];
|
|
@@ -23,5 +50,27 @@ export interface InputProps extends InputBaseProps {
|
|
|
23
50
|
fieldClassName?: string;
|
|
24
51
|
controlClassName?: string;
|
|
25
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Input is a convenience component that composes Field, Control, and Input.
|
|
55
|
+
*
|
|
56
|
+
* Use this for typical form fields. For complex layouts (grouped fields,
|
|
57
|
+
* addons, etc.), compose Field, Control, and Input directly.
|
|
58
|
+
*
|
|
59
|
+
* @function
|
|
60
|
+
* @param {InputProps} props - Props for Input.
|
|
61
|
+
* @returns {JSX.Element} The composed field element.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* <Input label="Username" placeholder="Enter username" iconLeftName="user" />
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* <Input
|
|
68
|
+
* label="Email"
|
|
69
|
+
* type="email"
|
|
70
|
+
* message="Please enter a valid email"
|
|
71
|
+
* messageColor="danger"
|
|
72
|
+
* color="danger"
|
|
73
|
+
* />
|
|
74
|
+
*/
|
|
26
75
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
27
76
|
export default Input;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Input component.
|
|
5
|
+
*
|
|
6
|
+
* @property {'primary'|'link'|'info'|'success'|'warning'|'danger'|'black'|'dark'|'light'|'white'} [color] - Bulma color modifier for the input.
|
|
7
|
+
* @property {'small'|'medium'|'large'} [size] - Size modifier for the input.
|
|
8
|
+
* @property {boolean} [isRounded] - Renders the input with rounded corners.
|
|
9
|
+
* @property {boolean} [isStatic] - Renders the input as static text.
|
|
10
|
+
* @property {boolean} [isHovered] - Applies the hovered state.
|
|
11
|
+
* @property {boolean} [isFocused] - Applies the focused state.
|
|
12
|
+
* @property {boolean} [isLoading] - Shows loading indicator.
|
|
13
|
+
* @property {string} [className] - Additional CSS classes to apply.
|
|
14
|
+
* @property {boolean} [disabled] - Whether the input is disabled.
|
|
15
|
+
* @property {boolean} [readOnly] - Whether the input is read-only.
|
|
16
|
+
*/
|
|
3
17
|
export interface InputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
|
|
4
18
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
5
19
|
size?: 'small' | 'medium' | 'large';
|
|
@@ -12,5 +26,13 @@ export interface InputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
12
26
|
disabled?: boolean;
|
|
13
27
|
readOnly?: boolean;
|
|
14
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Bulma Input component with full Bulma helper class support.
|
|
31
|
+
*
|
|
32
|
+
* @function
|
|
33
|
+
* @param {InputBaseProps} props - Props for the Input component.
|
|
34
|
+
* @returns {JSX.Element} The rendered input element.
|
|
35
|
+
* @see {@link https://bulma.io/documentation/form/input/ | Bulma Input documentation}
|
|
36
|
+
*/
|
|
15
37
|
export declare const InputBase: React.ForwardRefExoticComponent<InputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
16
38
|
export default InputBase;
|