@allxsmith/bestax-bulma 5.8.0 → 5.8.2
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/README.md +20 -0
- package/dist/index.cjs.js +304 -387
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +304 -387
- package/dist/index.esm.js.map +1 -1
- package/dist/types/columns/Column.d.ts +25 -30
- package/dist/types/columns/Columns.d.ts +23 -30
- package/dist/types/components/Avatar.d.ts +15 -20
- package/dist/types/components/Avatars.d.ts +8 -9
- package/dist/types/components/Badge.d.ts +13 -21
- package/dist/types/components/Breadcrumb.d.ts +6 -9
- package/dist/types/components/Card.d.ts +34 -36
- package/dist/types/components/Carousel.d.ts +29 -29
- package/dist/types/components/Collapse.d.ts +17 -18
- package/dist/types/components/Dialog.d.ts +24 -29
- package/dist/types/components/Dropdown.d.ts +16 -18
- package/dist/types/components/Loading.d.ts +13 -18
- package/dist/types/components/Menu.d.ts +11 -15
- package/dist/types/components/Message.d.ts +11 -14
- package/dist/types/components/Modal.d.ts +23 -29
- package/dist/types/components/Navbar.d.ts +60 -72
- package/dist/types/components/Pagination.d.ts +39 -35
- package/dist/types/components/Panel.d.ts +26 -33
- package/dist/types/components/Reveal.d.ts +11 -17
- package/dist/types/components/Sidebar.d.ts +17 -20
- package/dist/types/components/Steps.d.ts +28 -37
- package/dist/types/components/Tabs.d.ts +44 -43
- package/dist/types/components/Toast.d.ts +23 -28
- package/dist/types/components/Tooltip.d.ts +16 -20
- package/dist/types/elements/Block.d.ts +11 -10
- package/dist/types/elements/Box.d.ts +12 -10
- package/dist/types/elements/Button.d.ts +30 -23
- package/dist/types/elements/Buttons.d.ts +13 -9
- package/dist/types/elements/Code.d.ts +5 -10
- package/dist/types/elements/Content.d.ts +12 -11
- package/dist/types/elements/Delete.d.ts +14 -12
- package/dist/types/elements/Divider.d.ts +3 -7
- package/dist/types/elements/Emphasis.d.ts +5 -10
- package/dist/types/elements/Figure.d.ts +8 -10
- package/dist/types/elements/Icon.d.ts +18 -18
- package/dist/types/elements/IconText.d.ts +14 -11
- package/dist/types/elements/Image.d.ts +17 -17
- package/dist/types/elements/Link.d.ts +10 -14
- package/dist/types/elements/LinkButton.d.ts +3 -9
- package/dist/types/elements/ListItem.d.ts +6 -11
- package/dist/types/elements/Notification.d.ts +33 -24
- package/dist/types/elements/OrderedList.d.ts +7 -8
- package/dist/types/elements/Paragraph.d.ts +5 -10
- package/dist/types/elements/Pre.d.ts +5 -10
- package/dist/types/elements/Progress.d.ts +16 -10
- package/dist/types/elements/Skeleton.d.ts +4 -13
- package/dist/types/elements/Span.d.ts +5 -9
- package/dist/types/elements/Strong.d.ts +5 -10
- package/dist/types/elements/SubTitle.d.ts +9 -11
- package/dist/types/elements/Table.d.ts +8 -9
- package/dist/types/elements/Tag.d.ts +9 -12
- package/dist/types/elements/Tags.d.ts +4 -5
- package/dist/types/elements/Tbody.d.ts +2 -3
- package/dist/types/elements/Td.d.ts +3 -4
- package/dist/types/elements/Tfoot.d.ts +2 -3
- package/dist/types/elements/Th.d.ts +5 -6
- package/dist/types/elements/Thead.d.ts +2 -3
- package/dist/types/elements/Title.d.ts +10 -12
- package/dist/types/elements/Tr.d.ts +4 -5
- package/dist/types/elements/UnorderedList.d.ts +4 -5
- package/dist/types/form/Autocomplete.d.ts +35 -38
- package/dist/types/form/Checkbox.d.ts +7 -18
- package/dist/types/form/Checkboxes.d.ts +6 -7
- package/dist/types/form/Control.d.ts +21 -20
- package/dist/types/form/DateInput.d.ts +24 -24
- package/dist/types/form/DateInputBase.d.ts +36 -34
- package/dist/types/form/DateTimeInput.d.ts +22 -22
- package/dist/types/form/DateTimeInputBase.d.ts +44 -42
- package/dist/types/form/Field.d.ts +23 -26
- package/dist/types/form/File.d.ts +20 -16
- package/dist/types/form/Input.d.ts +20 -24
- package/dist/types/form/InputBase.d.ts +10 -11
- package/dist/types/form/Numberinput.d.ts +27 -24
- package/dist/types/form/Radio.d.ts +7 -18
- package/dist/types/form/Radios.d.ts +6 -7
- package/dist/types/form/Rate.d.ts +21 -37
- package/dist/types/form/Select.d.ts +16 -20
- package/dist/types/form/SelectBase.d.ts +13 -14
- package/dist/types/form/Slider.d.ts +62 -41
- package/dist/types/form/Switch.d.ts +16 -19
- package/dist/types/form/Taginput.d.ts +45 -48
- package/dist/types/form/TextArea.d.ts +11 -15
- package/dist/types/form/TextAreaBase.d.ts +13 -14
- package/dist/types/form/TimeInput.d.ts +24 -23
- package/dist/types/form/TimeInputBase.d.ts +38 -59
- package/dist/types/form/fieldProps.d.ts +1 -1
- package/dist/types/form/useAutoLabelId.d.ts +28 -0
- package/dist/types/grid/Cell.d.ts +12 -13
- package/dist/types/grid/Grid.d.ts +16 -17
- package/dist/types/helpers/colorDeprecations.d.ts +17 -0
- package/dist/types/layout/Container.d.ts +16 -13
- package/dist/types/layout/Footer.d.ts +7 -8
- package/dist/types/layout/Hero.d.ts +34 -28
- package/dist/types/layout/Level.d.ts +30 -33
- package/dist/types/layout/Media.d.ts +25 -29
- package/dist/types/layout/Section.d.ts +7 -8
- package/package.json +18 -18
|
@@ -6,90 +6,92 @@ import { DateFormatOption } from './_pickerInternals/formatters';
|
|
|
6
6
|
* Props for the raw DateTimeInput base. Use the higher-level `DateTimeInput`
|
|
7
7
|
* for Field/Control composition. Combines the prop set of `DateInputBaseProps`
|
|
8
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
9
|
*/
|
|
52
10
|
export interface DateTimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'color' | 'min' | 'max' | 'type' | 'popover'>, Omit<BulmaClassesProps, 'color'> {
|
|
11
|
+
/** Controlled selected date-time. */
|
|
53
12
|
value?: Date | null;
|
|
13
|
+
/** Initial value for uncontrolled usage. */
|
|
54
14
|
defaultValue?: Date | null;
|
|
15
|
+
/** Fired when either the date or time portion changes. */
|
|
55
16
|
onChange?: (d: Date | null) => void;
|
|
17
|
+
/** Fired when the popover opens. */
|
|
56
18
|
onOpen?: () => void;
|
|
19
|
+
/** Fired when the popover closes. */
|
|
57
20
|
onClose?: () => void;
|
|
21
|
+
/** Lower bound for the combined date-time. */
|
|
58
22
|
min?: Date;
|
|
23
|
+
/** Upper bound for the combined date-time. */
|
|
59
24
|
max?: Date;
|
|
25
|
+
/** Disable the input. */
|
|
60
26
|
disabled?: boolean;
|
|
27
|
+
/** Read-only input. */
|
|
61
28
|
readOnly?: boolean;
|
|
29
|
+
/** Placeholder text. */
|
|
62
30
|
placeholder?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Token format string or `Intl.DateTimeFormat` options. Default `'YYYY-MM-DD HH:mm'`.
|
|
33
|
+
* @defaultValue 'YYYY-MM-DD HH:mm'
|
|
34
|
+
*/
|
|
63
35
|
format?: DateFormatOption;
|
|
36
|
+
/** Custom parser. */
|
|
64
37
|
parse?: (s: string) => Date | null;
|
|
38
|
+
/** BCP-47 locale tag. */
|
|
65
39
|
locale?: string;
|
|
40
|
+
/** Render the panel inline (no popover). */
|
|
66
41
|
inline?: boolean;
|
|
42
|
+
/** Use `<input type="datetime-local">` on coarse-pointer devices. */
|
|
67
43
|
mobileNative?: boolean | 'auto';
|
|
44
|
+
/** Allow segmented keyboard typing (type the date-time directly across all segments). `false` makes the field picker-only. */
|
|
68
45
|
editable?: boolean;
|
|
46
|
+
/** Whether the calendar + time popover exists. `false` makes the field input-only (segmented typing with no popover). Default `true`. */
|
|
69
47
|
popover?: boolean;
|
|
48
|
+
/** Open the popover on focus. Default `true`. */
|
|
70
49
|
openOnFocus?: boolean;
|
|
50
|
+
/** Off by default — users typically tweak both halves before committing. */
|
|
71
51
|
closeOnSelect?: boolean;
|
|
52
|
+
/** Popover anchor position. */
|
|
72
53
|
position?: PickerPosition;
|
|
54
|
+
/** Render the popover into `document.body` via portal. */
|
|
73
55
|
appendToBody?: boolean;
|
|
56
|
+
/** Bulma color modifier. */
|
|
74
57
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
58
|
+
/** Size variant. */
|
|
75
59
|
size?: 'small' | 'medium' | 'large';
|
|
60
|
+
/** Rounded input corners. */
|
|
76
61
|
isRounded?: boolean;
|
|
62
|
+
/** Disable specific dates. Blocked dates are also rejected during manual typing (the predicate receives the full candidate date-time — prefer day-based checks). */
|
|
77
63
|
shouldDisableDate?: (d: Date) => boolean;
|
|
64
|
+
/** Convenience array of disabled dates, matched by calendar day; also rejected by manual typing. */
|
|
78
65
|
unselectableDates?: Date[];
|
|
66
|
+
/** Day the calendar week starts on. */
|
|
79
67
|
firstDayOfWeek?: DayOfWeek;
|
|
68
|
+
/** Override the 7 day-name labels. */
|
|
80
69
|
dayNames?: string[];
|
|
70
|
+
/** Override the 12 month-name labels. */
|
|
81
71
|
monthNames?: string[];
|
|
72
|
+
/** Show dimmed dates from adjacent months. */
|
|
82
73
|
nearbyMonthDays?: boolean;
|
|
74
|
+
/** Time format. */
|
|
83
75
|
hourFormat?: HourFormat;
|
|
76
|
+
/** Show seconds column. Note: iOS Safari's native datetime-local picker UI does not include a seconds wheel; pass `mobileNative={false}` if you need one on iOS. */
|
|
84
77
|
enableSeconds?: boolean;
|
|
78
|
+
/** Hour step. */
|
|
85
79
|
incrementHours?: number;
|
|
80
|
+
/** Step between minute-wheel values (`1` = every minute, iOS-style). */
|
|
86
81
|
incrementMinutes?: number;
|
|
82
|
+
/** Step between second-wheel values (only with `enableSeconds`). */
|
|
87
83
|
incrementSeconds?: number;
|
|
84
|
+
/** Block specific times. Blocked times are also rejected during manual typing. */
|
|
88
85
|
unselectableTimes?: (d: Date) => boolean;
|
|
86
|
+
/** Decorative left icon glyph for the wrapping `Control` (shown by default). Set `''` to hide. */
|
|
89
87
|
iconLeftName?: string;
|
|
88
|
+
/** Show a clickable launcher button on the right that toggles the popover. Default `true`. */
|
|
90
89
|
triggerIcon?: boolean;
|
|
90
|
+
/** Glyph for the right launcher button. */
|
|
91
91
|
triggerIconName?: string;
|
|
92
|
+
/** Play a short audible tick on each time-wheel crossing. Default `false`. */
|
|
92
93
|
audioTick?: boolean;
|
|
94
|
+
/** Auto-route tactile feedback per wheel tick (vibrate on Android, audio thunk on iOS). Default `false`. */
|
|
93
95
|
haptics?: boolean;
|
|
94
96
|
/** Optional translatable string overrides. */
|
|
95
97
|
labels?: PickerLabels;
|
|
@@ -2,68 +2,65 @@ import React from 'react';
|
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
3
|
/**
|
|
4
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
5
|
*/
|
|
19
6
|
export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Renders the field as horizontal (label and control side by side). */
|
|
20
8
|
horizontal?: boolean;
|
|
9
|
+
/** Group controls in a row (optionally centered, right, or multiline). */
|
|
21
10
|
grouped?: boolean | 'centered' | 'right' | 'multiline';
|
|
11
|
+
/** Group controls as addons (optionally centered or right-aligned). */
|
|
22
12
|
hasAddons?: boolean | 'centered' | 'right';
|
|
13
|
+
/** Constrains the field to its content's width (used inside horizontal field bodies). */
|
|
23
14
|
narrow?: boolean;
|
|
15
|
+
/** Field label, rendered above the widget. `Field` itself does not associate it with any control — pass `labelProps={{ htmlFor }}` and a matching `id` on your control (the single-control convenience inputs do this automatically when they render their own `Field`). */
|
|
24
16
|
label?: React.ReactNode;
|
|
17
|
+
/** Size for the label. */
|
|
25
18
|
labelSize?: 'small' | 'normal' | 'medium' | 'large';
|
|
19
|
+
/** Props for the label element — where `htmlFor` goes when composing. */
|
|
26
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
27
21
|
[key: string]: unknown;
|
|
28
22
|
};
|
|
23
|
+
/** Text color for the field. */
|
|
29
24
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
25
|
+
/** Bulma color for the field. */
|
|
30
26
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
27
|
+
/** Background color for the field. */
|
|
31
28
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
29
|
+
/** Additional CSS classes. */
|
|
32
30
|
className?: string;
|
|
31
|
+
/** Field content. */
|
|
33
32
|
children?: React.ReactNode;
|
|
34
33
|
}
|
|
35
34
|
/**
|
|
36
35
|
* 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
36
|
*/
|
|
45
37
|
export interface FieldLabelProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
38
|
+
/** Size for the field label. */
|
|
46
39
|
size?: 'small' | 'normal' | 'medium' | 'large';
|
|
40
|
+
/** Text color for the label. */
|
|
47
41
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
42
|
+
/** Bulma color for the label. */
|
|
48
43
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
44
|
+
/** Background color for the label. */
|
|
49
45
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
46
|
+
/** Additional CSS classes. */
|
|
50
47
|
className?: string;
|
|
48
|
+
/** Field label content. */
|
|
51
49
|
children?: React.ReactNode;
|
|
52
50
|
}
|
|
53
51
|
/**
|
|
54
52
|
* 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
53
|
*/
|
|
62
54
|
export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
55
|
+
/** Text color for the field body. */
|
|
63
56
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
57
|
+
/** Bulma color for the field body. */
|
|
64
58
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
59
|
+
/** Background color for the field body. */
|
|
65
60
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
61
|
+
/** Additional CSS classes. */
|
|
66
62
|
className?: string;
|
|
63
|
+
/** Field body content. */
|
|
67
64
|
children?: React.ReactNode;
|
|
68
65
|
}
|
|
69
66
|
/**
|
|
@@ -3,39 +3,43 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
4
|
/**
|
|
5
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
6
|
*/
|
|
21
7
|
export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
8
|
+
/** Field label. Automatically associated with the file input via `htmlFor` — uses your `id` when provided, otherwise a generated one. The input then has two labels (this one plus the wrapping `file-label`); assistive tech reads both. Dropped inside an outer `Field` (label that `Field` yourself). */
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
|
|
11
|
+
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
/** Bulma color modifier for the file input. */
|
|
22
15
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
16
|
+
/** Size modifier for the file input. */
|
|
23
17
|
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
/** Boxed file input. */
|
|
24
19
|
isBoxed?: boolean;
|
|
20
|
+
/** Whether the file input expands to full width. */
|
|
25
21
|
isFullwidth?: boolean;
|
|
22
|
+
/** Position the CTA on the right (with `hasName`). */
|
|
26
23
|
isRight?: boolean;
|
|
24
|
+
/** Center the file input within its container. */
|
|
27
25
|
isCentered?: boolean;
|
|
26
|
+
/** Show a file name indicator. */
|
|
28
27
|
hasName?: boolean;
|
|
28
|
+
/** Text on the file CTA button (defaults to "Choose a file…"). */
|
|
29
29
|
buttonLabel?: React.ReactNode;
|
|
30
|
+
/** Left icon element. */
|
|
30
31
|
iconLeft?: React.ReactNode;
|
|
32
|
+
/** Right icon element. */
|
|
31
33
|
iconRight?: React.ReactNode;
|
|
34
|
+
/** Additional CSS classes to apply. */
|
|
32
35
|
className?: string;
|
|
36
|
+
/** Additional CSS classes for the `<input>`. */
|
|
33
37
|
inputClassName?: string;
|
|
38
|
+
/** File name to display. */
|
|
34
39
|
fileName?: string;
|
|
35
40
|
}
|
|
36
41
|
/**
|
|
37
|
-
*
|
|
38
|
-
* isRight and isCentered are mutually exclusive (Bulma spec).
|
|
42
|
+
* The `File` component provides a Bulma-styled file input, supporting color, size, boxed/fullwidth/align styles, icons, "has name", and filename display.
|
|
39
43
|
*
|
|
40
44
|
* @function
|
|
41
45
|
* @param {FileProps} props - Props for the File component.
|
|
@@ -8,53 +8,49 @@ import { InputBaseProps } from './InputBase';
|
|
|
8
8
|
* Composes Field, Control, and Input into a single convenience component.
|
|
9
9
|
* Supports all Input props, plus Field-level (label, horizontal) and
|
|
10
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
11
|
*/
|
|
32
12
|
export interface InputProps extends InputBaseProps {
|
|
13
|
+
/** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
|
|
33
14
|
label?: React.ReactNode;
|
|
15
|
+
/** Size for the label. */
|
|
34
16
|
labelSize?: FieldProps['labelSize'];
|
|
17
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
|
|
35
18
|
labelProps?: FieldProps['labelProps'];
|
|
19
|
+
/** Horizontal field layout. */
|
|
36
20
|
horizontal?: boolean;
|
|
21
|
+
/** Icon props for left icon. */
|
|
37
22
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
23
|
+
/** Icon props for right icon. */
|
|
38
24
|
iconRight?: ControlBaseProps['iconRight'];
|
|
25
|
+
/** Shortcut for left icon name. */
|
|
39
26
|
iconLeftName?: string;
|
|
27
|
+
/** Shortcut for right icon name. */
|
|
40
28
|
iconRightName?: string;
|
|
29
|
+
/** Shortcut for left icon size. */
|
|
41
30
|
iconLeftSize?: ControlBaseProps['iconLeftSize'];
|
|
31
|
+
/** Shortcut for right icon size. */
|
|
42
32
|
iconRightSize?: ControlBaseProps['iconRightSize'];
|
|
33
|
+
/** Force left icon container. */
|
|
43
34
|
hasIconsLeft?: boolean;
|
|
35
|
+
/** Force right icon container. */
|
|
44
36
|
hasIconsRight?: boolean;
|
|
37
|
+
/** Shows loading indicator. */
|
|
45
38
|
isLoading?: boolean;
|
|
39
|
+
/** Expand the control. */
|
|
46
40
|
isExpanded?: boolean;
|
|
41
|
+
/** Control size. */
|
|
47
42
|
controlSize?: ControlBaseProps['size'];
|
|
43
|
+
/** Help/validation message below the input. */
|
|
48
44
|
message?: React.ReactNode;
|
|
45
|
+
/** Bulma color for the message. */
|
|
49
46
|
messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
47
|
+
/** Additional CSS classes for the Field. */
|
|
50
48
|
fieldClassName?: string;
|
|
49
|
+
/** Additional CSS classes for the Control. */
|
|
51
50
|
controlClassName?: string;
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
54
|
-
* Input
|
|
55
|
-
*
|
|
56
|
-
* Use this for typical form fields. For complex layouts (grouped fields,
|
|
57
|
-
* addons, etc.), compose Field, Control, and Input directly.
|
|
53
|
+
* The `Input` component provides a Bulma-styled text input, supporting colors, sizes, rounded corners, static/read-only state, hover/focus/loading states, and all Bulma helper props.
|
|
58
54
|
*
|
|
59
55
|
* @function
|
|
60
56
|
* @param {InputProps} props - Props for Input.
|
|
@@ -2,28 +2,27 @@ import React from 'react';
|
|
|
2
2
|
import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
3
3
|
/**
|
|
4
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
5
|
*/
|
|
17
6
|
export interface InputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, Omit<BulmaClassesProps, 'color'> {
|
|
7
|
+
/** Bulma color modifier for the input. */
|
|
18
8
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
9
|
+
/** Size modifier for the input. */
|
|
19
10
|
size?: 'small' | 'medium' | 'large';
|
|
11
|
+
/** Rounded input corners. */
|
|
20
12
|
isRounded?: boolean;
|
|
13
|
+
/** Renders input as static (read only, styled). */
|
|
21
14
|
isStatic?: boolean;
|
|
15
|
+
/** Applies hovered state. */
|
|
22
16
|
isHovered?: boolean;
|
|
17
|
+
/** Applies focused state. */
|
|
23
18
|
isFocused?: boolean;
|
|
19
|
+
/** Shows loading indicator. */
|
|
24
20
|
isLoading?: boolean;
|
|
21
|
+
/** Additional CSS classes to apply. */
|
|
25
22
|
className?: string;
|
|
23
|
+
/** Disabled input. */
|
|
26
24
|
disabled?: boolean;
|
|
25
|
+
/** Read-only input. */
|
|
27
26
|
readOnly?: boolean;
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
@@ -13,52 +13,55 @@ export type NumberinputControlsPosition = 'left' | 'right' | 'both';
|
|
|
13
13
|
export type NumberinputVariant = 'plusminus' | 'stepper';
|
|
14
14
|
/**
|
|
15
15
|
* Props for the Numberinput component.
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
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}
|
|
16
|
+
* @extraProp {string} [className] - Additional CSS classes.
|
|
17
|
+
* @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.
|
|
36
18
|
*/
|
|
37
19
|
export interface NumberinputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size' | 'onChange' | 'value' | 'defaultValue' | 'type'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>, FormFieldProps {
|
|
20
|
+
/** Field label. Automatically associated with the number input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired when no Field wrapper is rendered (inside a `Field`, or plusminus `bare`). */
|
|
21
|
+
label?: React.ReactNode;
|
|
22
|
+
/** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
|
|
23
|
+
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
};
|
|
26
|
+
/** Controlled value. */
|
|
38
27
|
value?: number;
|
|
28
|
+
/** Default value for uncontrolled usage. */
|
|
39
29
|
defaultValue?: number;
|
|
30
|
+
/** Minimum allowed value. */
|
|
40
31
|
min?: number;
|
|
32
|
+
/** Maximum allowed value. */
|
|
41
33
|
max?: number;
|
|
34
|
+
/** Step increment (default: 1). */
|
|
42
35
|
step?: number;
|
|
36
|
+
/** Size variant. */
|
|
43
37
|
size?: NumberinputSize;
|
|
38
|
+
/** Color variant for buttons. */
|
|
44
39
|
color?: NumberinputColor;
|
|
40
|
+
/** Color of the input field itself. */
|
|
45
41
|
inputColor?: NumberinputInputColor;
|
|
42
|
+
/** Position of +/- buttons. */
|
|
46
43
|
controlsPosition?: NumberinputControlsPosition;
|
|
44
|
+
/** Use rounded buttons. */
|
|
47
45
|
controlsRounded?: boolean;
|
|
46
|
+
/** Uses compact button spacing. */
|
|
48
47
|
compact?: boolean;
|
|
48
|
+
/** Removes button borders and background. */
|
|
49
49
|
bare?: boolean;
|
|
50
|
+
/** Style variant for the control buttons. */
|
|
50
51
|
variant?: NumberinputVariant;
|
|
52
|
+
/** Whether the input is disabled. */
|
|
51
53
|
disabled?: boolean;
|
|
54
|
+
/** Whether the input can be typed in. */
|
|
52
55
|
editable?: boolean;
|
|
56
|
+
/** Shows a loading state. */
|
|
53
57
|
isLoading?: boolean;
|
|
58
|
+
/** Enables exponential step increments when holding buttons. */
|
|
54
59
|
exponential?: boolean;
|
|
60
|
+
/** Callback when value changes. */
|
|
55
61
|
onChange?: (value: number) => void;
|
|
56
62
|
}
|
|
57
63
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* Supports plus/minus buttons or a compact stepper variant,
|
|
61
|
-
* with configurable min/max, step, and exponential stepping.
|
|
64
|
+
* The `Numberinput` component provides a number input with increment/decrement buttons.
|
|
62
65
|
*
|
|
63
66
|
* @function
|
|
64
67
|
* @param {NumberinputProps} props - Props for the Numberinput component.
|
|
@@ -10,34 +10,23 @@ export declare const radioColors: readonly ["primary", "link", "info", "success"
|
|
|
10
10
|
export declare const radioSizes: readonly ["small", "normal", "medium", "large"];
|
|
11
11
|
/**
|
|
12
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
13
|
*/
|
|
22
14
|
export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
|
|
15
|
+
/** Color of the radio button. */
|
|
23
16
|
color?: (typeof radioColors)[number];
|
|
17
|
+
/** Size of the radio button. */
|
|
24
18
|
size?: (typeof radioSizes)[number];
|
|
19
|
+
/** Text color helper. */
|
|
25
20
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
21
|
+
/** Whether the radio is disabled. */
|
|
26
22
|
disabled?: boolean;
|
|
23
|
+
/** Additional CSS classes to apply. */
|
|
27
24
|
className?: string;
|
|
25
|
+
/** The label/content for the radio. */
|
|
28
26
|
children?: React.ReactNode;
|
|
29
27
|
}
|
|
30
28
|
/**
|
|
31
|
-
*
|
|
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.
|
|
29
|
+
* The `Radio` component provides a Bulma-styled radio button input with flexible labels and helper classes.
|
|
41
30
|
*
|
|
42
31
|
* @function
|
|
43
32
|
* @param {RadioProps} props - Props for the Radio component.
|
|
@@ -3,20 +3,19 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
|
|
|
3
3
|
import { FormFieldProps } from './fieldProps';
|
|
4
4
|
/**
|
|
5
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
6
|
*/
|
|
14
7
|
export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
8
|
+
/** Additional CSS classes to apply. */
|
|
15
9
|
className?: string;
|
|
10
|
+
/** Form field name shared by every Radio in the group (via context). */
|
|
16
11
|
name?: string;
|
|
12
|
+
/** Currently-selected value (controlled mode). */
|
|
17
13
|
value?: string;
|
|
14
|
+
/** Initial selected value (uncontrolled mode). */
|
|
18
15
|
defaultValue?: string;
|
|
16
|
+
/** Fires when the selection changes. */
|
|
19
17
|
onChange?: (value: string) => void;
|
|
18
|
+
/** Radio elements to render in the group. */
|
|
20
19
|
children: React.ReactNode;
|
|
21
20
|
}
|
|
22
21
|
export declare const Radios: React.FC<RadiosProps> & {
|