@allxsmith/bestax-bulma 5.7.0 → 5.8.1
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 +24 -0
- package/dist/index.cjs.js +3485 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3485 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/types/columns/Column.d.ts +38 -0
- package/dist/types/columns/Columns.d.ts +31 -0
- package/dist/types/components/Avatar.d.ts +32 -0
- package/dist/types/components/Avatars.d.ts +12 -0
- package/dist/types/components/Badge.d.ts +34 -0
- package/dist/types/components/Breadcrumb.d.ts +25 -0
- package/dist/types/components/Card.d.ts +60 -0
- package/dist/types/components/Carousel.d.ts +70 -0
- package/dist/types/components/Collapse.d.ts +52 -0
- package/dist/types/components/Dialog.d.ts +89 -0
- package/dist/types/components/Dropdown.d.ts +42 -0
- package/dist/types/components/Loading.d.ts +50 -0
- package/dist/types/components/Menu.d.ts +44 -0
- package/dist/types/components/Message.d.ts +20 -0
- package/dist/types/components/Modal.d.ts +50 -0
- package/dist/types/components/Navbar.d.ts +147 -0
- package/dist/types/components/Pagination.d.ts +81 -0
- package/dist/types/components/Panel.d.ts +93 -0
- package/dist/types/components/Reveal.d.ts +37 -0
- package/dist/types/components/Sidebar.d.ts +37 -0
- package/dist/types/components/Steps.d.ts +56 -0
- package/dist/types/components/Tabs.d.ts +90 -0
- package/dist/types/components/Toast.d.ts +104 -0
- package/dist/types/components/Tooltip.d.ts +46 -0
- package/dist/types/elements/Block.d.ts +21 -0
- package/dist/types/elements/Box.d.ts +25 -1
- package/dist/types/elements/Button.d.ts +33 -0
- package/dist/types/elements/Buttons.d.ts +16 -0
- package/dist/types/elements/Code.d.ts +14 -0
- package/dist/types/elements/Content.d.ts +22 -0
- package/dist/types/elements/Delete.d.ts +24 -0
- package/dist/types/elements/Divider.d.ts +12 -0
- package/dist/types/elements/Emphasis.d.ts +14 -0
- package/dist/types/elements/Figure.d.ts +23 -0
- package/dist/types/elements/Icon.d.ts +28 -0
- package/dist/types/elements/IconText.d.ts +20 -0
- package/dist/types/elements/Image.d.ts +27 -0
- package/dist/types/elements/Link.d.ts +20 -0
- package/dist/types/elements/LinkButton.d.ts +20 -0
- package/dist/types/elements/ListItem.d.ts +15 -0
- package/dist/types/elements/Notification.d.ts +110 -0
- package/dist/types/elements/OrderedList.d.ts +10 -0
- package/dist/types/elements/Paragraph.d.ts +14 -0
- package/dist/types/elements/Pre.d.ts +14 -0
- package/dist/types/elements/Progress.d.ts +26 -0
- package/dist/types/elements/Skeleton.d.ts +22 -0
- package/dist/types/elements/Span.d.ts +14 -0
- package/dist/types/elements/Strong.d.ts +14 -0
- package/dist/types/elements/SubTitle.d.ts +25 -0
- package/dist/types/elements/Table.d.ts +14 -0
- package/dist/types/elements/Tag.d.ts +25 -0
- package/dist/types/elements/Tags.d.ts +7 -0
- package/dist/types/elements/Tbody.d.ts +18 -0
- package/dist/types/elements/Td.d.ts +23 -0
- package/dist/types/elements/Tfoot.d.ts +18 -0
- package/dist/types/elements/Th.d.ts +24 -0
- package/dist/types/elements/Thead.d.ts +18 -0
- package/dist/types/elements/Title.d.ts +26 -0
- package/dist/types/elements/Tr.d.ts +20 -0
- package/dist/types/elements/UnorderedList.d.ts +7 -0
- package/dist/types/form/Autocomplete.d.ts +64 -0
- package/dist/types/form/Checkbox.d.ts +33 -0
- package/dist/types/form/Checkboxes.d.ts +9 -0
- package/dist/types/form/Control.d.ts +37 -0
- package/dist/types/form/DateInput.d.ts +44 -0
- package/dist/types/form/DateInputBase.d.ts +49 -0
- package/dist/types/form/DateTimeInput.d.ts +42 -0
- package/dist/types/form/DateTimeInputBase.d.ts +58 -0
- package/dist/types/form/Field.d.ts +52 -0
- package/dist/types/form/File.d.ts +24 -0
- package/dist/types/form/FormContext.d.ts +46 -0
- package/dist/types/form/Input.d.ts +45 -0
- package/dist/types/form/InputBase.d.ts +21 -0
- package/dist/types/form/Numberinput.d.ts +43 -0
- package/dist/types/form/Radio.d.ts +33 -0
- package/dist/types/form/Radios.d.ts +9 -0
- package/dist/types/form/Rate.d.ts +55 -0
- package/dist/types/form/Select.d.ts +35 -0
- package/dist/types/form/SelectBase.d.ts +24 -0
- package/dist/types/form/Slider.d.ts +86 -0
- package/dist/types/form/Switch.d.ts +50 -0
- package/dist/types/form/Taginput.d.ts +74 -0
- package/dist/types/form/TextArea.d.ts +34 -0
- package/dist/types/form/TextAreaBase.d.ts +24 -0
- package/dist/types/form/TimeInput.d.ts +40 -0
- package/dist/types/form/TimeInputBase.d.ts +51 -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 +25 -0
- package/dist/types/grid/Grid.d.ts +32 -0
- 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/colorDeprecations.d.ts +17 -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 +13 -0
- package/dist/types/layout/Container.d.ts +29 -0
- package/dist/types/layout/Footer.d.ts +22 -0
- package/dist/types/layout/Hero.d.ts +67 -0
- package/dist/types/layout/Level.d.ts +60 -0
- package/dist/types/layout/Media.d.ts +56 -0
- package/dist/types/layout/Section.d.ts +20 -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 +30 -28
|
@@ -1,31 +1,68 @@
|
|
|
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
|
+
*/
|
|
4
7
|
export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
8
|
+
/** Adds left icon container. */
|
|
5
9
|
hasIconsLeft?: boolean;
|
|
10
|
+
/** Adds right icon container. */
|
|
6
11
|
hasIconsRight?: boolean;
|
|
12
|
+
/** Shows loading indicator. */
|
|
7
13
|
isLoading?: boolean;
|
|
14
|
+
/** Makes the control expand to fill available space. */
|
|
8
15
|
isExpanded?: boolean;
|
|
16
|
+
/** Sets the control size. */
|
|
9
17
|
size?: 'small' | 'medium' | 'large';
|
|
18
|
+
/** Sets text color. */
|
|
10
19
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
20
|
+
/** Bulma color for the control. */
|
|
11
21
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
22
|
+
/** Background color. */
|
|
12
23
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
24
|
+
/** Icon props for left icon. */
|
|
13
25
|
iconLeft?: IconProps;
|
|
26
|
+
/** Icon props for right icon. */
|
|
14
27
|
iconRight?: IconProps;
|
|
28
|
+
/** Shortcut for left icon name. */
|
|
15
29
|
iconLeftName?: string;
|
|
30
|
+
/** Shortcut for left icon size. */
|
|
16
31
|
iconLeftSize?: 'small' | 'medium' | 'large';
|
|
32
|
+
/** Shortcut for right icon name. */
|
|
17
33
|
iconRightName?: string;
|
|
34
|
+
/** Shortcut for right icon size. */
|
|
18
35
|
iconRightSize?: 'small' | 'medium' | 'large';
|
|
36
|
+
/** Additional CSS classes to apply. */
|
|
19
37
|
className?: string;
|
|
38
|
+
/** Content inside the control. */
|
|
20
39
|
children?: React.ReactNode;
|
|
21
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* The `Control` component is a Bulma-styled wrapper for form controls (`Input`, `Select`, `TextArea`, etc.), supporting icons (left/right), loading state, expansion, size, and Bulma helper props for layout and color.
|
|
43
|
+
*
|
|
44
|
+
* @function
|
|
45
|
+
* @param {ControlProps} props - Props for the Control component.
|
|
46
|
+
* @returns {JSX.Element} The rendered control container.
|
|
47
|
+
* @see {@link https://bulma.io/documentation/form/general/#control | Bulma Control documentation}
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Control with left icon
|
|
51
|
+
* <Control iconLeftName="envelope" iconLeftSize="small">
|
|
52
|
+
* <input className="input" type="email" placeholder="Email" />
|
|
53
|
+
* </Control>
|
|
54
|
+
*/
|
|
22
55
|
export declare const Control: React.ForwardRefExoticComponent<(Omit<{
|
|
56
|
+
/** Element type for the control (`div` by default). */
|
|
23
57
|
as?: "div";
|
|
24
58
|
} & ControlBaseProps & {
|
|
59
|
+
/** Ref for the control element. */
|
|
25
60
|
ref?: React.Ref<HTMLDivElement>;
|
|
26
61
|
}, "ref"> | Omit<{
|
|
62
|
+
/** Element type for the control (`div` by default). */
|
|
27
63
|
as: "p";
|
|
28
64
|
} & Omit<ControlBaseProps, keyof React.HTMLAttributes<HTMLDivElement>> & React.HTMLAttributes<HTMLParagraphElement> & {
|
|
65
|
+
/** Ref for the control element. */
|
|
29
66
|
ref?: React.Ref<HTMLParagraphElement>;
|
|
30
67
|
}, "ref">) & React.RefAttributes<HTMLDivElement | HTMLParagraphElement>>;
|
|
31
68
|
export default Control;
|
|
@@ -2,25 +2,69 @@ 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
|
+
* @extraProp {string} [name] - Form field name. Forwarded to a hidden ISO-formatted input.
|
|
9
|
+
* @extraProp {string} [form] - Form id the input belongs to.
|
|
10
|
+
* @extraProp {boolean} [required=false] - Marks the input as required.
|
|
11
|
+
* @extraProp {string} [className] - Additional CSS classes for the input.
|
|
12
|
+
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Forwarded to the underlying `<input>`.
|
|
13
|
+
*/
|
|
5
14
|
export interface DateInputProps extends DateInputBaseProps {
|
|
15
|
+
/** Field label (component auto-wraps in a `Field` if not already inside). */
|
|
6
16
|
label?: React.ReactNode;
|
|
17
|
+
/** Size for the label. */
|
|
7
18
|
labelSize?: FieldProps['labelSize'];
|
|
19
|
+
/** Props for the label element. */
|
|
8
20
|
labelProps?: FieldProps['labelProps'];
|
|
21
|
+
/** Render the field with horizontal layout. */
|
|
9
22
|
horizontal?: boolean;
|
|
23
|
+
/** Icon props for the left icon. */
|
|
10
24
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
25
|
+
/** Icon props for the right icon. */
|
|
11
26
|
iconRight?: ControlBaseProps['iconRight'];
|
|
27
|
+
/** Shortcut for the right icon name. */
|
|
12
28
|
iconRightName?: string;
|
|
29
|
+
/** Shortcut for left icon size. */
|
|
13
30
|
iconLeftSize?: ControlBaseProps['iconLeftSize'];
|
|
31
|
+
/** Shortcut for right icon size. */
|
|
14
32
|
iconRightSize?: ControlBaseProps['iconRightSize'];
|
|
33
|
+
/** Force the left icon container. */
|
|
15
34
|
hasIconsLeft?: boolean;
|
|
35
|
+
/** Force the right icon container. */
|
|
16
36
|
hasIconsRight?: boolean;
|
|
37
|
+
/** Show a loading indicator on the control. */
|
|
17
38
|
isLoading?: boolean;
|
|
39
|
+
/** Expand the control to fill its container. */
|
|
18
40
|
isExpanded?: boolean;
|
|
41
|
+
/** Size of the wrapping Control. */
|
|
19
42
|
controlSize?: ControlBaseProps['size'];
|
|
43
|
+
/** Help/validation text below the input. */
|
|
20
44
|
message?: React.ReactNode;
|
|
45
|
+
/** Color modifier for the help message. */
|
|
21
46
|
messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
47
|
+
/** Additional CSS classes for the Field wrapper. */
|
|
22
48
|
fieldClassName?: string;
|
|
49
|
+
/** Additional CSS classes for the Control wrapper. */
|
|
23
50
|
controlClassName?: string;
|
|
24
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* The `DateInput` component is a form input that opens a popover calendar for date selection.
|
|
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,41 +2,90 @@ 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
|
+
*/
|
|
5
9
|
export interface DateInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'defaultValue' | 'onChange' | 'size' | 'color' | 'min' | 'max' | 'type' | 'popover'>, Omit<BulmaClassesProps, 'color'> {
|
|
10
|
+
/** Controlled selected date. */
|
|
6
11
|
value?: Date | null;
|
|
12
|
+
/** Initial date for uncontrolled usage. */
|
|
7
13
|
defaultValue?: Date | null;
|
|
14
|
+
/** Fired when the value changes. */
|
|
8
15
|
onChange?: (d: Date | null) => void;
|
|
16
|
+
/** Fired when the popover opens. */
|
|
9
17
|
onOpen?: () => void;
|
|
18
|
+
/** Fired when the popover closes. */
|
|
10
19
|
onClose?: () => void;
|
|
20
|
+
/** Earliest selectable date. */
|
|
11
21
|
min?: Date;
|
|
22
|
+
/** Latest selectable date. */
|
|
12
23
|
max?: Date;
|
|
24
|
+
/** Disable the input. */
|
|
13
25
|
disabled?: boolean;
|
|
26
|
+
/** Make the input read-only. */
|
|
14
27
|
readOnly?: boolean;
|
|
28
|
+
/** Placeholder text for the input. */
|
|
15
29
|
placeholder?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Token format string or `Intl.DateTimeFormat` options. Default `'YYYY-MM-DD'`.
|
|
32
|
+
* @defaultValue 'YYYY-MM-DD'
|
|
33
|
+
*/
|
|
16
34
|
format?: DateFormatOption;
|
|
35
|
+
/** Custom parser (use when `format` is `Intl.DateTimeFormatOptions`). */
|
|
17
36
|
parse?: (s: string) => Date | null;
|
|
37
|
+
/** BCP-47 locale tag for day/month names and Intl formatting. */
|
|
18
38
|
locale?: string;
|
|
39
|
+
/** Render the calendar inline (no popover). */
|
|
19
40
|
inline?: boolean;
|
|
41
|
+
/** Use `<input type="date">` on coarse-pointer + small-viewport devices. */
|
|
20
42
|
mobileNative?: boolean | 'auto';
|
|
43
|
+
/** Allow segmented keyboard typing in the input (type the date directly, auto-advancing across segments). `false` makes the field picker-only. */
|
|
21
44
|
editable?: boolean;
|
|
45
|
+
/** Whether the calendar popover exists. `false` makes the field input-only (segmented typing, no popover). */
|
|
22
46
|
popover?: boolean;
|
|
47
|
+
/** Open the popover when the input is focused. */
|
|
23
48
|
openOnFocus?: boolean;
|
|
49
|
+
/** Close the popover after a date is selected. */
|
|
24
50
|
closeOnSelect?: boolean;
|
|
51
|
+
/** Popover anchor position relative to the input. */
|
|
25
52
|
position?: PickerPosition;
|
|
53
|
+
/** Render the popover into `document.body` via portal. */
|
|
26
54
|
appendToBody?: boolean;
|
|
55
|
+
/** Bulma color modifier. */
|
|
27
56
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
57
|
+
/** Size variant. */
|
|
28
58
|
size?: 'small' | 'medium' | 'large';
|
|
59
|
+
/** Render the input with rounded corners. */
|
|
29
60
|
isRounded?: boolean;
|
|
61
|
+
/** Predicate to disable specific dates (e.g. weekends). Blocked dates are also rejected during manual typing. */
|
|
30
62
|
shouldDisableDate?: (d: Date) => boolean;
|
|
63
|
+
/** Convenience array of disabled dates; merged with `shouldDisableDate`. Matched by calendar day and also rejected during manual typing. */
|
|
31
64
|
unselectableDates?: Date[];
|
|
65
|
+
/** Day the week starts on (0 = Sunday). */
|
|
32
66
|
firstDayOfWeek?: DayOfWeek;
|
|
67
|
+
/** Override the 7 day-name labels (in calendar order, post-rotation). */
|
|
33
68
|
dayNames?: string[];
|
|
69
|
+
/** Override the 12 month-name labels. */
|
|
34
70
|
monthNames?: string[];
|
|
71
|
+
/** Show dimmed dates from adjacent months in the grid. */
|
|
35
72
|
nearbyMonthDays?: boolean;
|
|
73
|
+
/** Decorative left icon glyph for the wrapping `Control` (shown by default). Set `''` to hide. */
|
|
36
74
|
iconLeftName?: string;
|
|
75
|
+
/** Show a clickable launcher button on the right that toggles the popover. Default `true`. */
|
|
37
76
|
triggerIcon?: boolean;
|
|
77
|
+
/** Glyph for the right launcher button. */
|
|
38
78
|
triggerIconName?: string;
|
|
79
|
+
/** Optional translatable string overrides (ARIA labels, button text). */
|
|
39
80
|
labels?: PickerLabels;
|
|
40
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Raw DateInput — input + popover calendar without Field/Control wrapping.
|
|
84
|
+
* Use `DateInput` for the convenience wrapper.
|
|
85
|
+
*
|
|
86
|
+
* @function
|
|
87
|
+
* @param {DateInputBaseProps} props
|
|
88
|
+
* @returns {JSX.Element}
|
|
89
|
+
*/
|
|
41
90
|
export declare const DateInputBase: React.ForwardRefExoticComponent<DateInputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
42
91
|
export default DateInputBase;
|
|
@@ -2,25 +2,67 @@ 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
|
+
* @extraProp {string} [name] - Form field name.
|
|
9
|
+
* @extraProp {string} [form] - Optional id of the form the input belongs to.
|
|
10
|
+
* @extraProp {boolean} [required=false] - Marks the field as required for native HTML form validation.
|
|
11
|
+
*/
|
|
5
12
|
export interface DateTimeInputProps extends DateTimeInputBaseProps {
|
|
13
|
+
/** Field label. */
|
|
6
14
|
label?: React.ReactNode;
|
|
15
|
+
/** Size for the label. */
|
|
7
16
|
labelSize?: FieldProps['labelSize'];
|
|
17
|
+
/** Props for the label element. */
|
|
8
18
|
labelProps?: FieldProps['labelProps'];
|
|
19
|
+
/** Render the field with horizontal layout. */
|
|
9
20
|
horizontal?: boolean;
|
|
21
|
+
/** Icon props for the left icon. */
|
|
10
22
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
23
|
+
/** Icon props for the right icon. */
|
|
11
24
|
iconRight?: ControlBaseProps['iconRight'];
|
|
25
|
+
/** Shortcut for the right icon name. */
|
|
12
26
|
iconRightName?: string;
|
|
27
|
+
/** Shortcut for left icon size. */
|
|
13
28
|
iconLeftSize?: ControlBaseProps['iconLeftSize'];
|
|
29
|
+
/** Shortcut for right icon size. */
|
|
14
30
|
iconRightSize?: ControlBaseProps['iconRightSize'];
|
|
31
|
+
/** Force the left icon container. */
|
|
15
32
|
hasIconsLeft?: boolean;
|
|
33
|
+
/** Force the right icon container. */
|
|
16
34
|
hasIconsRight?: boolean;
|
|
35
|
+
/** Show a loading indicator on the control. */
|
|
17
36
|
isLoading?: boolean;
|
|
37
|
+
/** Expand the control to fill its container. */
|
|
18
38
|
isExpanded?: boolean;
|
|
39
|
+
/** Size of the wrapping Control. */
|
|
19
40
|
controlSize?: ControlBaseProps['size'];
|
|
41
|
+
/** Help/validation text below the input. */
|
|
20
42
|
message?: React.ReactNode;
|
|
43
|
+
/** Message color. */
|
|
21
44
|
messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
45
|
+
/** Additional CSS classes for the Field wrapper. */
|
|
22
46
|
fieldClassName?: string;
|
|
47
|
+
/** Additional CSS classes for the Control wrapper. */
|
|
23
48
|
controlClassName?: string;
|
|
24
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* The `DateTimeInput` combines a calendar and a time **wheel spinner** in a single popover — an iOS-style layout.
|
|
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,49 +2,107 @@ 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
|
+
*/
|
|
5
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. */
|
|
6
12
|
value?: Date | null;
|
|
13
|
+
/** Initial value for uncontrolled usage. */
|
|
7
14
|
defaultValue?: Date | null;
|
|
15
|
+
/** Fired when either the date or time portion changes. */
|
|
8
16
|
onChange?: (d: Date | null) => void;
|
|
17
|
+
/** Fired when the popover opens. */
|
|
9
18
|
onOpen?: () => void;
|
|
19
|
+
/** Fired when the popover closes. */
|
|
10
20
|
onClose?: () => void;
|
|
21
|
+
/** Lower bound for the combined date-time. */
|
|
11
22
|
min?: Date;
|
|
23
|
+
/** Upper bound for the combined date-time. */
|
|
12
24
|
max?: Date;
|
|
25
|
+
/** Disable the input. */
|
|
13
26
|
disabled?: boolean;
|
|
27
|
+
/** Read-only input. */
|
|
14
28
|
readOnly?: boolean;
|
|
29
|
+
/** Placeholder text. */
|
|
15
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
|
+
*/
|
|
16
35
|
format?: DateFormatOption;
|
|
36
|
+
/** Custom parser. */
|
|
17
37
|
parse?: (s: string) => Date | null;
|
|
38
|
+
/** BCP-47 locale tag. */
|
|
18
39
|
locale?: string;
|
|
40
|
+
/** Render the panel inline (no popover). */
|
|
19
41
|
inline?: boolean;
|
|
42
|
+
/** Use `<input type="datetime-local">` on coarse-pointer devices. */
|
|
20
43
|
mobileNative?: boolean | 'auto';
|
|
44
|
+
/** Allow segmented keyboard typing (type the date-time directly across all segments). `false` makes the field picker-only. */
|
|
21
45
|
editable?: boolean;
|
|
46
|
+
/** Whether the calendar + time popover exists. `false` makes the field input-only (segmented typing with no popover). Default `true`. */
|
|
22
47
|
popover?: boolean;
|
|
48
|
+
/** Open the popover on focus. Default `true`. */
|
|
23
49
|
openOnFocus?: boolean;
|
|
50
|
+
/** Off by default — users typically tweak both halves before committing. */
|
|
24
51
|
closeOnSelect?: boolean;
|
|
52
|
+
/** Popover anchor position. */
|
|
25
53
|
position?: PickerPosition;
|
|
54
|
+
/** Render the popover into `document.body` via portal. */
|
|
26
55
|
appendToBody?: boolean;
|
|
56
|
+
/** Bulma color modifier. */
|
|
27
57
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
58
|
+
/** Size variant. */
|
|
28
59
|
size?: 'small' | 'medium' | 'large';
|
|
60
|
+
/** Rounded input corners. */
|
|
29
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). */
|
|
30
63
|
shouldDisableDate?: (d: Date) => boolean;
|
|
64
|
+
/** Convenience array of disabled dates, matched by calendar day; also rejected by manual typing. */
|
|
31
65
|
unselectableDates?: Date[];
|
|
66
|
+
/** Day the calendar week starts on. */
|
|
32
67
|
firstDayOfWeek?: DayOfWeek;
|
|
68
|
+
/** Override the 7 day-name labels. */
|
|
33
69
|
dayNames?: string[];
|
|
70
|
+
/** Override the 12 month-name labels. */
|
|
34
71
|
monthNames?: string[];
|
|
72
|
+
/** Show dimmed dates from adjacent months. */
|
|
35
73
|
nearbyMonthDays?: boolean;
|
|
74
|
+
/** Time format. */
|
|
36
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. */
|
|
37
77
|
enableSeconds?: boolean;
|
|
78
|
+
/** Hour step. */
|
|
38
79
|
incrementHours?: number;
|
|
80
|
+
/** Step between minute-wheel values (`1` = every minute, iOS-style). */
|
|
39
81
|
incrementMinutes?: number;
|
|
82
|
+
/** Step between second-wheel values (only with `enableSeconds`). */
|
|
40
83
|
incrementSeconds?: number;
|
|
84
|
+
/** Block specific times. Blocked times are also rejected during manual typing. */
|
|
41
85
|
unselectableTimes?: (d: Date) => boolean;
|
|
86
|
+
/** Decorative left icon glyph for the wrapping `Control` (shown by default). Set `''` to hide. */
|
|
42
87
|
iconLeftName?: string;
|
|
88
|
+
/** Show a clickable launcher button on the right that toggles the popover. Default `true`. */
|
|
43
89
|
triggerIcon?: boolean;
|
|
90
|
+
/** Glyph for the right launcher button. */
|
|
44
91
|
triggerIconName?: string;
|
|
92
|
+
/** Play a short audible tick on each time-wheel crossing. Default `false`. */
|
|
45
93
|
audioTick?: boolean;
|
|
94
|
+
/** Auto-route tactile feedback per wheel tick (vibrate on Android, audio thunk on iOS). Default `false`. */
|
|
46
95
|
haptics?: boolean;
|
|
96
|
+
/** Optional translatable string overrides. */
|
|
47
97
|
labels?: PickerLabels;
|
|
48
98
|
}
|
|
99
|
+
/**
|
|
100
|
+
* Raw DateTimeInput — combined input + calendar + time spinner without
|
|
101
|
+
* Field/Control wrapping. Use `DateTimeInput` for the convenience wrapper.
|
|
102
|
+
*
|
|
103
|
+
* @function
|
|
104
|
+
* @param {DateTimeInputBaseProps} props
|
|
105
|
+
* @returns {JSX.Element}
|
|
106
|
+
*/
|
|
49
107
|
export declare const DateTimeInputBase: React.ForwardRefExoticComponent<DateTimeInputBaseProps & React.RefAttributes<HTMLInputElement>>;
|
|
50
108
|
export default DateTimeInputBase;
|
|
@@ -1,37 +1,89 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the Field component.
|
|
5
|
+
*/
|
|
3
6
|
export interface FieldProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
7
|
+
/** Renders the field as horizontal (label and control side by side). */
|
|
4
8
|
horizontal?: boolean;
|
|
9
|
+
/** Group controls in a row (optionally centered, right, or multiline). */
|
|
5
10
|
grouped?: boolean | 'centered' | 'right' | 'multiline';
|
|
11
|
+
/** Group controls as addons (optionally centered or right-aligned). */
|
|
6
12
|
hasAddons?: boolean | 'centered' | 'right';
|
|
13
|
+
/** Constrains the field to its content's width (used inside horizontal field bodies). */
|
|
7
14
|
narrow?: boolean;
|
|
15
|
+
/** Field label, rendered above the widget. */
|
|
8
16
|
label?: React.ReactNode;
|
|
17
|
+
/** Size for the label. */
|
|
9
18
|
labelSize?: 'small' | 'normal' | 'medium' | 'large';
|
|
19
|
+
/** Props for the label element. */
|
|
10
20
|
labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {
|
|
11
21
|
[key: string]: unknown;
|
|
12
22
|
};
|
|
23
|
+
/** Text color for the field. */
|
|
13
24
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
25
|
+
/** Bulma color for the field. */
|
|
14
26
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
27
|
+
/** Background color for the field. */
|
|
15
28
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
29
|
+
/** Additional CSS classes. */
|
|
16
30
|
className?: string;
|
|
31
|
+
/** Field content. */
|
|
17
32
|
children?: React.ReactNode;
|
|
18
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Props for the FieldLabel component.
|
|
36
|
+
*/
|
|
19
37
|
export interface FieldLabelProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
38
|
+
/** Size for the field label. */
|
|
20
39
|
size?: 'small' | 'normal' | 'medium' | 'large';
|
|
40
|
+
/** Text color for the label. */
|
|
21
41
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
42
|
+
/** Bulma color for the label. */
|
|
22
43
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
44
|
+
/** Background color for the label. */
|
|
23
45
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
46
|
+
/** Additional CSS classes. */
|
|
24
47
|
className?: string;
|
|
48
|
+
/** Field label content. */
|
|
25
49
|
children?: React.ReactNode;
|
|
26
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Props for the FieldBody component.
|
|
53
|
+
*/
|
|
27
54
|
export interface FieldBodyProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
|
|
55
|
+
/** Text color for the field body. */
|
|
28
56
|
textColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
57
|
+
/** Bulma color for the field body. */
|
|
29
58
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
|
|
59
|
+
/** Background color for the field body. */
|
|
30
60
|
bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
|
|
61
|
+
/** Additional CSS classes. */
|
|
31
62
|
className?: string;
|
|
63
|
+
/** Field body content. */
|
|
32
64
|
children?: React.ReactNode;
|
|
33
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* FieldLabel component for rendering a Bulma field label.
|
|
68
|
+
*
|
|
69
|
+
* @function
|
|
70
|
+
* @param {FieldLabelProps} props - Props for the FieldLabel component.
|
|
71
|
+
* @returns {JSX.Element} The rendered field label.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* <FieldLabel size="normal">Name</FieldLabel>
|
|
75
|
+
*/
|
|
34
76
|
export declare const FieldLabel: React.FC<FieldLabelProps>;
|
|
77
|
+
/**
|
|
78
|
+
* FieldBody component for rendering Bulma field body.
|
|
79
|
+
*
|
|
80
|
+
* @function
|
|
81
|
+
* @param {FieldBodyProps} props - Props for the FieldBody component.
|
|
82
|
+
* @returns {JSX.Element} The rendered field body.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* <FieldBody><input className="input" /></FieldBody>
|
|
86
|
+
*/
|
|
35
87
|
export declare const FieldBody: React.FC<FieldBodyProps>;
|
|
36
88
|
export declare const Field: React.FC<FieldProps> & {
|
|
37
89
|
Label: React.FC<FieldLabelProps>;
|
|
@@ -1,20 +1,44 @@
|
|
|
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
|
+
*/
|
|
4
7
|
export interface FileProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'color' | 'type'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
8
|
+
/** Bulma color modifier for the file input. */
|
|
5
9
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
10
|
+
/** Size modifier for the file input. */
|
|
6
11
|
size?: 'small' | 'medium' | 'large';
|
|
12
|
+
/** Boxed file input. */
|
|
7
13
|
isBoxed?: boolean;
|
|
14
|
+
/** Whether the file input expands to full width. */
|
|
8
15
|
isFullwidth?: boolean;
|
|
16
|
+
/** Position the CTA on the right (with `hasName`). */
|
|
9
17
|
isRight?: boolean;
|
|
18
|
+
/** Center the file input within its container. */
|
|
10
19
|
isCentered?: boolean;
|
|
20
|
+
/** Show a file name indicator. */
|
|
11
21
|
hasName?: boolean;
|
|
22
|
+
/** Text on the file CTA button (defaults to "Choose a file…"). */
|
|
12
23
|
buttonLabel?: React.ReactNode;
|
|
24
|
+
/** Left icon element. */
|
|
13
25
|
iconLeft?: React.ReactNode;
|
|
26
|
+
/** Right icon element. */
|
|
14
27
|
iconRight?: React.ReactNode;
|
|
28
|
+
/** Additional CSS classes to apply. */
|
|
15
29
|
className?: string;
|
|
30
|
+
/** Additional CSS classes for the `<input>`. */
|
|
16
31
|
inputClassName?: string;
|
|
32
|
+
/** File name to display. */
|
|
17
33
|
fileName?: string;
|
|
18
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The `File` component provides a Bulma-styled file input, supporting color, size, boxed/fullwidth/align styles, icons, "has name", and filename display.
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @param {FileProps} props - Props for the File component.
|
|
40
|
+
* @returns {JSX.Element} The rendered file upload field.
|
|
41
|
+
* @see {@link https://bulma.io/documentation/form/file/ | Bulma File documentation}
|
|
42
|
+
*/
|
|
19
43
|
export declare const File: React.ForwardRefExoticComponent<FileProps & React.RefAttributes<HTMLInputElement>>;
|
|
20
44
|
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>;
|