@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.
Files changed (102) hide show
  1. package/README.md +20 -0
  2. package/dist/index.cjs.js +304 -387
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +304 -387
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/types/columns/Column.d.ts +25 -30
  7. package/dist/types/columns/Columns.d.ts +23 -30
  8. package/dist/types/components/Avatar.d.ts +15 -20
  9. package/dist/types/components/Avatars.d.ts +8 -9
  10. package/dist/types/components/Badge.d.ts +13 -21
  11. package/dist/types/components/Breadcrumb.d.ts +6 -9
  12. package/dist/types/components/Card.d.ts +34 -36
  13. package/dist/types/components/Carousel.d.ts +29 -29
  14. package/dist/types/components/Collapse.d.ts +17 -18
  15. package/dist/types/components/Dialog.d.ts +24 -29
  16. package/dist/types/components/Dropdown.d.ts +16 -18
  17. package/dist/types/components/Loading.d.ts +13 -18
  18. package/dist/types/components/Menu.d.ts +11 -15
  19. package/dist/types/components/Message.d.ts +11 -14
  20. package/dist/types/components/Modal.d.ts +23 -29
  21. package/dist/types/components/Navbar.d.ts +60 -72
  22. package/dist/types/components/Pagination.d.ts +39 -35
  23. package/dist/types/components/Panel.d.ts +26 -33
  24. package/dist/types/components/Reveal.d.ts +11 -17
  25. package/dist/types/components/Sidebar.d.ts +17 -20
  26. package/dist/types/components/Steps.d.ts +28 -37
  27. package/dist/types/components/Tabs.d.ts +44 -43
  28. package/dist/types/components/Toast.d.ts +23 -28
  29. package/dist/types/components/Tooltip.d.ts +16 -20
  30. package/dist/types/elements/Block.d.ts +11 -10
  31. package/dist/types/elements/Box.d.ts +12 -10
  32. package/dist/types/elements/Button.d.ts +30 -23
  33. package/dist/types/elements/Buttons.d.ts +13 -9
  34. package/dist/types/elements/Code.d.ts +5 -10
  35. package/dist/types/elements/Content.d.ts +12 -11
  36. package/dist/types/elements/Delete.d.ts +14 -12
  37. package/dist/types/elements/Divider.d.ts +3 -7
  38. package/dist/types/elements/Emphasis.d.ts +5 -10
  39. package/dist/types/elements/Figure.d.ts +8 -10
  40. package/dist/types/elements/Icon.d.ts +18 -18
  41. package/dist/types/elements/IconText.d.ts +14 -11
  42. package/dist/types/elements/Image.d.ts +17 -17
  43. package/dist/types/elements/Link.d.ts +10 -14
  44. package/dist/types/elements/LinkButton.d.ts +3 -9
  45. package/dist/types/elements/ListItem.d.ts +6 -11
  46. package/dist/types/elements/Notification.d.ts +33 -24
  47. package/dist/types/elements/OrderedList.d.ts +7 -8
  48. package/dist/types/elements/Paragraph.d.ts +5 -10
  49. package/dist/types/elements/Pre.d.ts +5 -10
  50. package/dist/types/elements/Progress.d.ts +16 -10
  51. package/dist/types/elements/Skeleton.d.ts +4 -13
  52. package/dist/types/elements/Span.d.ts +5 -9
  53. package/dist/types/elements/Strong.d.ts +5 -10
  54. package/dist/types/elements/SubTitle.d.ts +9 -11
  55. package/dist/types/elements/Table.d.ts +8 -9
  56. package/dist/types/elements/Tag.d.ts +9 -12
  57. package/dist/types/elements/Tags.d.ts +4 -5
  58. package/dist/types/elements/Tbody.d.ts +2 -3
  59. package/dist/types/elements/Td.d.ts +3 -4
  60. package/dist/types/elements/Tfoot.d.ts +2 -3
  61. package/dist/types/elements/Th.d.ts +5 -6
  62. package/dist/types/elements/Thead.d.ts +2 -3
  63. package/dist/types/elements/Title.d.ts +10 -12
  64. package/dist/types/elements/Tr.d.ts +4 -5
  65. package/dist/types/elements/UnorderedList.d.ts +4 -5
  66. package/dist/types/form/Autocomplete.d.ts +35 -38
  67. package/dist/types/form/Checkbox.d.ts +7 -18
  68. package/dist/types/form/Checkboxes.d.ts +6 -7
  69. package/dist/types/form/Control.d.ts +21 -20
  70. package/dist/types/form/DateInput.d.ts +24 -24
  71. package/dist/types/form/DateInputBase.d.ts +36 -34
  72. package/dist/types/form/DateTimeInput.d.ts +22 -22
  73. package/dist/types/form/DateTimeInputBase.d.ts +44 -42
  74. package/dist/types/form/Field.d.ts +23 -26
  75. package/dist/types/form/File.d.ts +20 -16
  76. package/dist/types/form/Input.d.ts +20 -24
  77. package/dist/types/form/InputBase.d.ts +10 -11
  78. package/dist/types/form/Numberinput.d.ts +27 -24
  79. package/dist/types/form/Radio.d.ts +7 -18
  80. package/dist/types/form/Radios.d.ts +6 -7
  81. package/dist/types/form/Rate.d.ts +21 -37
  82. package/dist/types/form/Select.d.ts +16 -20
  83. package/dist/types/form/SelectBase.d.ts +13 -14
  84. package/dist/types/form/Slider.d.ts +62 -41
  85. package/dist/types/form/Switch.d.ts +16 -19
  86. package/dist/types/form/Taginput.d.ts +45 -48
  87. package/dist/types/form/TextArea.d.ts +11 -15
  88. package/dist/types/form/TextAreaBase.d.ts +13 -14
  89. package/dist/types/form/TimeInput.d.ts +24 -23
  90. package/dist/types/form/TimeInputBase.d.ts +38 -59
  91. package/dist/types/form/fieldProps.d.ts +1 -1
  92. package/dist/types/form/useAutoLabelId.d.ts +28 -0
  93. package/dist/types/grid/Cell.d.ts +12 -13
  94. package/dist/types/grid/Grid.d.ts +16 -17
  95. package/dist/types/helpers/colorDeprecations.d.ts +17 -0
  96. package/dist/types/layout/Container.d.ts +16 -13
  97. package/dist/types/layout/Footer.d.ts +7 -8
  98. package/dist/types/layout/Hero.d.ts +34 -28
  99. package/dist/types/layout/Level.d.ts +30 -33
  100. package/dist/types/layout/Media.d.ts +25 -29
  101. package/dist/types/layout/Section.d.ts +7 -8
  102. package/package.json +18 -18
@@ -3,86 +3,83 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
3
  import { FormFieldProps } from './fieldProps';
4
4
  /**
5
5
  * An item in the Autocomplete dropdown list.
6
- *
7
- * @property {string} value - The value used for filtering and selection.
8
- * @property {string} [label] - Display label (falls back to value if omitted).
9
- * @property {boolean} [disabled] - Whether the item is disabled and unselectable.
10
6
  */
11
7
  export interface AutocompleteItem {
8
+ /** The value used for filtering and selection. */
12
9
  value: string;
10
+ /** Display label (optional). */
13
11
  label?: string;
12
+ /** Whether the item is disabled and unselectable. */
14
13
  disabled?: boolean;
15
14
  [key: string]: unknown;
16
15
  }
17
16
  /**
18
17
  * Props for the Autocomplete component.
19
- *
20
- * @property {AutocompleteItem[] | string[]} data - The options data to display.
21
- * @property {string} [value] - The current input value (controlled).
22
- * @property {AutocompleteItem | string | null} [selected] - The selected item (controlled).
23
- * @property {string} [placeholder] - Placeholder text for the input.
24
- * @property {string} [field] - Object property to use as the display field.
25
- * @property {boolean} [clearable] - Whether to show a clear button.
26
- * @property {boolean} [openOnFocus] - Open dropdown when input is focused.
27
- * @property {boolean} [keepFirst] - Keep first option highlighted.
28
- * @property {boolean} [keepOpen] - Keep dropdown open after selection.
29
- * @property {boolean} [selectOnClickOutside] - Select highlighted item on click outside.
30
- * @property {number} [maxHeight] - Maximum dropdown height in pixels.
31
- * @property {boolean} [dropdown] - Render as dropdown style.
32
- * @property {boolean} [loading] - Show loading state.
33
- * @property {boolean} [disabled] - Whether the input is disabled.
34
- * @property {boolean} [checkInfiniteScroll] - Enable infinite scroll detection.
35
- * @property {number} [infiniteScrollDistance] - Distance threshold for infinite scroll.
36
- * @property {(value: string) => void} [onInput] - Callback when input value changes.
37
- * @property {(item: AutocompleteItem | string | null) => void} [onSelect] - Callback when item is selected.
38
- * @property {(active: boolean) => void} [onActiveChange] - Callback when dropdown active state changes.
39
- * @property {() => void} [onInfiniteScroll] - Callback when scrolled to bottom (infinite scroll).
40
- * @property {(item: AutocompleteItem | string) => React.ReactNode} [itemTemplate] - Custom render for items.
41
- * @property {React.ReactNode} [header] - Custom header in dropdown.
42
- * @property {React.ReactNode} [footer] - Custom footer in dropdown.
43
- * @property {React.ReactNode} [empty] - Content to show when no results.
44
- * @property {'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger'} [color] - Bulma color modifier for the input.
45
- * @property {'small' | 'medium' | 'large'} [size] - Size modifier for the input.
46
- * @property {string} [name] - Form field name; forwarded to the inner input so the typed/selected value submits with the surrounding form.
47
- * @property {string} [form] - The id of the form the input belongs to.
48
- * @property {boolean} [required] - Whether the input is required.
18
+ * @extraProp {string} [className] - Additional CSS classes.
19
+ * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.
49
20
  */
50
21
  export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect' | 'onInput'>, Omit<BulmaClassesProps, 'color'>, FormFieldProps {
22
+ /** The options data to display (required). */
51
23
  data: AutocompleteItem[] | string[];
24
+ /** The current input value (controlled). */
52
25
  value?: string;
26
+ /** The selected item (controlled). */
53
27
  selected?: AutocompleteItem | string | null;
28
+ /** Placeholder text for the input. */
54
29
  placeholder?: string;
30
+ /** Object property to use as the display field. */
55
31
  field?: string;
32
+ /** Whether to show a clear button. */
56
33
  clearable?: boolean;
34
+ /** Open dropdown when input is focused. */
57
35
  openOnFocus?: boolean;
36
+ /** Keep first option highlighted. */
58
37
  keepFirst?: boolean;
38
+ /** Keep dropdown open after selection. */
59
39
  keepOpen?: boolean;
40
+ /** Select highlighted item on click outside. */
60
41
  selectOnClickOutside?: boolean;
42
+ /** Maximum dropdown height in pixels. */
61
43
  maxHeight?: number;
44
+ /** Render as dropdown style. */
62
45
  dropdown?: boolean;
46
+ /** Show loading state. */
63
47
  loading?: boolean;
48
+ /** Whether the input is disabled. */
64
49
  disabled?: boolean;
50
+ /** Enables infinite scroll detection in the dropdown. */
65
51
  checkInfiniteScroll?: boolean;
52
+ /** Distance in pixels from the bottom to trigger `onInfiniteScroll`. */
66
53
  infiniteScrollDistance?: number;
54
+ /** Input color variant. */
67
55
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
56
+ /** Size variant. */
68
57
  size?: 'small' | 'medium' | 'large';
58
+ /** Form field name. Forwarded to the inner `<input>`. */
69
59
  name?: string;
60
+ /** Optional id of the form the input belongs to. */
70
61
  form?: string;
62
+ /** Marks the field as required for native HTML form validation. */
71
63
  required?: boolean;
64
+ /** Callback when input value changes. */
72
65
  onInput?: (value: string) => void;
66
+ /** Callback when item is selected. */
73
67
  onSelect?: (item: AutocompleteItem | string | null) => void;
68
+ /** Callback when dropdown active state changes. */
74
69
  onActiveChange?: (active: boolean) => void;
70
+ /** Callback when scrolled to bottom (infinite scroll). */
75
71
  onInfiniteScroll?: () => void;
72
+ /** Custom render for items. */
76
73
  itemTemplate?: (item: AutocompleteItem | string) => React.ReactNode;
74
+ /** Custom header in dropdown. */
77
75
  header?: React.ReactNode;
76
+ /** Custom footer in dropdown. */
78
77
  footer?: React.ReactNode;
78
+ /** Content to show when no results. */
79
79
  empty?: React.ReactNode;
80
80
  }
81
81
  /**
82
- * Autocomplete component with dropdown suggestions.
83
- *
84
- * Provides an input field with a dropdown of suggestions that filter
85
- * based on user input.
82
+ * The `Autocomplete` component provides an input field with dropdown suggestions that filter based on user input.
86
83
  *
87
84
  * @function
88
85
  * @param {AutocompleteProps} props - Props for the Autocomplete component.
@@ -10,34 +10,23 @@ export declare const checkboxColors: readonly ["primary", "link", "info", "succe
10
10
  export declare const checkboxSizes: readonly ["small", "normal", "medium", "large"];
11
11
  /**
12
12
  * Props for the Checkbox component.
13
- *
14
- * @property {(typeof checkboxColors)[number]} [color] - Color variant for the checkbox.
15
- * @property {(typeof checkboxSizes)[number]} [size] - Size of the checkbox.
16
- * @property {boolean} [disabled] - Whether the checkbox 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 checkbox.
20
- * @see Bulma Checkbox documentation: https://bulma.io/documentation/form/checkbox/
21
13
  */
22
14
  export interface CheckboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'color'>, Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {
15
+ /** Color of the checkbox. */
23
16
  color?: (typeof checkboxColors)[number];
17
+ /** Size of the checkbox. */
24
18
  size?: (typeof checkboxSizes)[number];
19
+ /** Text color helper. */
25
20
  textColor?: (typeof validColors)[number] | 'inherit' | 'current';
21
+ /** Whether the checkbox is disabled. */
26
22
  disabled?: boolean;
23
+ /** Additional CSS classes to apply. */
27
24
  className?: string;
25
+ /** The label/content for the checkbox. */
28
26
  children?: React.ReactNode;
29
27
  }
30
28
  /**
31
- * Bulma Checkbox component with themed styling support.
32
- *
33
- * Renders a custom-styled checkbox with a visual check indicator,
34
- * supporting colors, sizes, and various states. Inside a `<Checkboxes>`
35
- * group, Checkbox inherits `name` and (when the group is in controlled or
36
- * uncontrolled mode) derives its `checked` state from membership in the
37
- * group's `value` array. On click, dispatches the new array via the group's
38
- * `onChange`.
39
- *
40
- * Local props always win over group context.
29
+ * The `Checkbox` component provides a Bulma-styled checkbox input.
41
30
  *
42
31
  * @function
43
32
  * @param {CheckboxProps} props - Props for the Checkbox component.
@@ -3,20 +3,19 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses';
3
3
  import { FormFieldProps } from './fieldProps';
4
4
  /**
5
5
  * Props for the Checkboxes component.
6
- *
7
- * @property {string} [className] - Additional CSS classes to apply.
8
- * @property {string} [name] - Form field name shared by every Checkbox in the group.
9
- * @property {string[]} [value] - Currently-selected values (controlled mode).
10
- * @property {string[]} [defaultValue] - Initial selected values (uncontrolled mode).
11
- * @property {(values: string[]) => void} [onChange] - Fired when the selection changes. Receives the new array of selected values.
12
- * @property {React.ReactNode} [children] - Checkbox elements to render in the group.
13
6
  */
14
7
  export interface CheckboxesProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
8
+ /** Additional CSS classes to apply. */
15
9
  className?: string;
10
+ /** Form field name shared by every Checkbox in the group (via context). */
16
11
  name?: string;
12
+ /** Currently-selected values (controlled mode). */
17
13
  value?: string[];
14
+ /** Initial selected values (uncontrolled mode). */
18
15
  defaultValue?: string[];
16
+ /** Fires when the selection changes; receives the new array. */
19
17
  onChange?: (values: string[]) => void;
18
+ /** Checkbox elements to render in the group. */
20
19
  children?: React.ReactNode;
21
20
  }
22
21
  export declare const Checkboxes: React.FC<CheckboxesProps> & {
@@ -3,46 +3,43 @@ import { BulmaClassesProps, validColors } from '../helpers/useBulmaClasses';
3
3
  import { IconProps } from '../elements/Icon';
4
4
  /**
5
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
6
  */
26
7
  export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>, Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {
8
+ /** Adds left icon container. */
27
9
  hasIconsLeft?: boolean;
10
+ /** Adds right icon container. */
28
11
  hasIconsRight?: boolean;
12
+ /** Shows loading indicator. */
29
13
  isLoading?: boolean;
14
+ /** Makes the control expand to fill available space. */
30
15
  isExpanded?: boolean;
16
+ /** Sets the control size. */
31
17
  size?: 'small' | 'medium' | 'large';
18
+ /** Sets text color. */
32
19
  textColor?: (typeof validColors)[number] | 'inherit' | 'current';
20
+ /** Bulma color for the control. */
33
21
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
22
+ /** Background color. */
34
23
  bgColor?: (typeof validColors)[number] | 'inherit' | 'current';
24
+ /** Icon props for left icon. */
35
25
  iconLeft?: IconProps;
26
+ /** Icon props for right icon. */
36
27
  iconRight?: IconProps;
28
+ /** Shortcut for left icon name. */
37
29
  iconLeftName?: string;
30
+ /** Shortcut for left icon size. */
38
31
  iconLeftSize?: 'small' | 'medium' | 'large';
32
+ /** Shortcut for right icon name. */
39
33
  iconRightName?: string;
34
+ /** Shortcut for right icon size. */
40
35
  iconRightSize?: 'small' | 'medium' | 'large';
36
+ /** Additional CSS classes to apply. */
41
37
  className?: string;
38
+ /** Content inside the control. */
42
39
  children?: React.ReactNode;
43
40
  }
44
41
  /**
45
- * Bulma Control component for form controls, with icons, loading, and Bulma helper support.
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.
46
43
  *
47
44
  * @function
48
45
  * @param {ControlProps} props - Props for the Control component.
@@ -56,12 +53,16 @@ export interface ControlBaseProps extends React.HTMLAttributes<HTMLDivElement>,
56
53
  * </Control>
57
54
  */
58
55
  export declare const Control: React.ForwardRefExoticComponent<(Omit<{
56
+ /** Element type for the control (`div` by default). */
59
57
  as?: "div";
60
58
  } & ControlBaseProps & {
59
+ /** Ref for the control element. */
61
60
  ref?: React.Ref<HTMLDivElement>;
62
61
  }, "ref"> | Omit<{
62
+ /** Element type for the control (`div` by default). */
63
63
  as: "p";
64
64
  } & Omit<ControlBaseProps, keyof React.HTMLAttributes<HTMLDivElement>> & React.HTMLAttributes<HTMLParagraphElement> & {
65
+ /** Ref for the control element. */
65
66
  ref?: React.Ref<HTMLParagraphElement>;
66
67
  }, "ref">) & React.RefAttributes<HTMLDivElement | HTMLParagraphElement>>;
67
68
  export default Control;
@@ -5,52 +5,52 @@ import { DateInputBaseProps } from './DateInputBase';
5
5
  /**
6
6
  * Props for the DateInput convenience wrapper. Extends `DateInputBaseProps`
7
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.
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>`.
27
13
  */
28
14
  export interface DateInputProps extends DateInputBaseProps {
15
+ /** Field label (component auto-wraps in a `Field` if not already inside). Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
29
16
  label?: React.ReactNode;
17
+ /** Size for the label. */
30
18
  labelSize?: FieldProps['labelSize'];
19
+ /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
31
20
  labelProps?: FieldProps['labelProps'];
21
+ /** Render the field with horizontal layout. */
32
22
  horizontal?: boolean;
23
+ /** Icon props for the left icon. */
33
24
  iconLeft?: ControlBaseProps['iconLeft'];
25
+ /** Icon props for the right icon. */
34
26
  iconRight?: ControlBaseProps['iconRight'];
27
+ /** Shortcut for the right icon name. */
35
28
  iconRightName?: string;
29
+ /** Shortcut for left icon size. */
36
30
  iconLeftSize?: ControlBaseProps['iconLeftSize'];
31
+ /** Shortcut for right icon size. */
37
32
  iconRightSize?: ControlBaseProps['iconRightSize'];
33
+ /** Force the left icon container. */
38
34
  hasIconsLeft?: boolean;
35
+ /** Force the right icon container. */
39
36
  hasIconsRight?: boolean;
37
+ /** Show a loading indicator on the control. */
40
38
  isLoading?: boolean;
39
+ /** Expand the control to fill its container. */
41
40
  isExpanded?: boolean;
41
+ /** Size of the wrapping Control. */
42
42
  controlSize?: ControlBaseProps['size'];
43
+ /** Help/validation text below the input. */
43
44
  message?: React.ReactNode;
45
+ /** Color modifier for the help message. */
44
46
  messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
47
+ /** Additional CSS classes for the Field wrapper. */
45
48
  fieldClassName?: string;
49
+ /** Additional CSS classes for the Control wrapper. */
46
50
  controlClassName?: string;
47
51
  }
48
52
  /**
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.
53
+ * The `DateInput` component is a form input that opens a popover calendar for date selection.
54
54
  *
55
55
  * @function
56
56
  * @param {DateInputProps} props - Props for the DateInput.
@@ -5,74 +5,76 @@ import { DateFormatOption } from './_pickerInternals/formatters';
5
5
  /**
6
6
  * Props for the raw DateInput base. Use the higher-level `DateInput` for
7
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
8
  */
43
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. */
44
11
  value?: Date | null;
12
+ /** Initial date for uncontrolled usage. */
45
13
  defaultValue?: Date | null;
14
+ /** Fired when the value changes. */
46
15
  onChange?: (d: Date | null) => void;
16
+ /** Fired when the popover opens. */
47
17
  onOpen?: () => void;
18
+ /** Fired when the popover closes. */
48
19
  onClose?: () => void;
20
+ /** Earliest selectable date. */
49
21
  min?: Date;
22
+ /** Latest selectable date. */
50
23
  max?: Date;
24
+ /** Disable the input. */
51
25
  disabled?: boolean;
26
+ /** Make the input read-only. */
52
27
  readOnly?: boolean;
28
+ /** Placeholder text for the input. */
53
29
  placeholder?: string;
30
+ /**
31
+ * Token format string or `Intl.DateTimeFormat` options. Default `'YYYY-MM-DD'`.
32
+ * @defaultValue 'YYYY-MM-DD'
33
+ */
54
34
  format?: DateFormatOption;
35
+ /** Custom parser (use when `format` is `Intl.DateTimeFormatOptions`). */
55
36
  parse?: (s: string) => Date | null;
37
+ /** BCP-47 locale tag for day/month names and Intl formatting. */
56
38
  locale?: string;
39
+ /** Render the calendar inline (no popover). */
57
40
  inline?: boolean;
41
+ /** Use `<input type="date">` on coarse-pointer + small-viewport devices. */
58
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. */
59
44
  editable?: boolean;
45
+ /** Whether the calendar popover exists. `false` makes the field input-only (segmented typing, no popover). */
60
46
  popover?: boolean;
47
+ /** Open the popover when the input is focused. */
61
48
  openOnFocus?: boolean;
49
+ /** Close the popover after a date is selected. */
62
50
  closeOnSelect?: boolean;
51
+ /** Popover anchor position relative to the input. */
63
52
  position?: PickerPosition;
53
+ /** Render the popover into `document.body` via portal. */
64
54
  appendToBody?: boolean;
55
+ /** Bulma color modifier. */
65
56
  color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
57
+ /** Size variant. */
66
58
  size?: 'small' | 'medium' | 'large';
59
+ /** Render the input with rounded corners. */
67
60
  isRounded?: boolean;
61
+ /** Predicate to disable specific dates (e.g. weekends). Blocked dates are also rejected during manual typing. */
68
62
  shouldDisableDate?: (d: Date) => boolean;
63
+ /** Convenience array of disabled dates; merged with `shouldDisableDate`. Matched by calendar day and also rejected during manual typing. */
69
64
  unselectableDates?: Date[];
65
+ /** Day the week starts on (0 = Sunday). */
70
66
  firstDayOfWeek?: DayOfWeek;
67
+ /** Override the 7 day-name labels (in calendar order, post-rotation). */
71
68
  dayNames?: string[];
69
+ /** Override the 12 month-name labels. */
72
70
  monthNames?: string[];
71
+ /** Show dimmed dates from adjacent months in the grid. */
73
72
  nearbyMonthDays?: boolean;
73
+ /** Decorative left icon glyph for the wrapping `Control` (shown by default). Set `''` to hide. */
74
74
  iconLeftName?: string;
75
+ /** Show a clickable launcher button on the right that toggles the popover. Default `true`. */
75
76
  triggerIcon?: boolean;
77
+ /** Glyph for the right launcher button. */
76
78
  triggerIconName?: string;
77
79
  /** Optional translatable string overrides (ARIA labels, button text). */
78
80
  labels?: PickerLabels;
@@ -5,50 +5,50 @@ import { DateTimeInputBaseProps } from './DateTimeInputBase';
5
5
  /**
6
6
  * Props for the DateTimeInput convenience wrapper. Extends
7
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.
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.
27
11
  */
28
12
  export interface DateTimeInputProps extends DateTimeInputBaseProps {
13
+ /** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Not wired in `inline` mode (no visible input to label) and dropped inside an outer `Field`. */
29
14
  label?: React.ReactNode;
15
+ /** Size for the label. */
30
16
  labelSize?: FieldProps['labelSize'];
17
+ /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */
31
18
  labelProps?: FieldProps['labelProps'];
19
+ /** Render the field with horizontal layout. */
32
20
  horizontal?: boolean;
21
+ /** Icon props for the left icon. */
33
22
  iconLeft?: ControlBaseProps['iconLeft'];
23
+ /** Icon props for the right icon. */
34
24
  iconRight?: ControlBaseProps['iconRight'];
25
+ /** Shortcut for the right icon name. */
35
26
  iconRightName?: string;
27
+ /** Shortcut for left icon size. */
36
28
  iconLeftSize?: ControlBaseProps['iconLeftSize'];
29
+ /** Shortcut for right icon size. */
37
30
  iconRightSize?: ControlBaseProps['iconRightSize'];
31
+ /** Force the left icon container. */
38
32
  hasIconsLeft?: boolean;
33
+ /** Force the right icon container. */
39
34
  hasIconsRight?: boolean;
35
+ /** Show a loading indicator on the control. */
40
36
  isLoading?: boolean;
37
+ /** Expand the control to fill its container. */
41
38
  isExpanded?: boolean;
39
+ /** Size of the wrapping Control. */
42
40
  controlSize?: ControlBaseProps['size'];
41
+ /** Help/validation text below the input. */
43
42
  message?: React.ReactNode;
43
+ /** Message color. */
44
44
  messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';
45
+ /** Additional CSS classes for the Field wrapper. */
45
46
  fieldClassName?: string;
47
+ /** Additional CSS classes for the Control wrapper. */
46
48
  controlClassName?: string;
47
49
  }
48
50
  /**
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.
51
+ * The `DateTimeInput` combines a calendar and a time **wheel spinner** in a single popover — an iOS-style layout.
52
52
  *
53
53
  * @function
54
54
  * @param {DateTimeInputProps} props