@allxsmith/bestax-bulma 5.26.2 → 5.26.4
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/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +992 -580
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +992 -580
- package/dist/index.esm.js.map +1 -1
- package/dist/types/elements/Progress.d.ts +6 -1
- package/dist/types/form/Checkboxes.d.ts +7 -0
- package/dist/types/form/Control.d.ts +14 -2
- package/dist/types/form/DateInput.d.ts +28 -3
- package/dist/types/form/DateInputBase.d.ts +17 -3
- package/dist/types/form/DateTimeInput.d.ts +28 -3
- package/dist/types/form/DateTimeInputBase.d.ts +17 -3
- package/dist/types/form/File.d.ts +6 -0
- package/dist/types/form/FormContext.d.ts +39 -7
- package/dist/types/form/Input.d.ts +21 -4
- package/dist/types/form/InputBase.d.ts +5 -2
- package/dist/types/form/Radios.d.ts +7 -0
- package/dist/types/form/Rate.d.ts +7 -0
- package/dist/types/form/Select.d.ts +13 -2
- package/dist/types/form/Slider.d.ts +7 -0
- package/dist/types/form/Taginput.d.ts +6 -0
- package/dist/types/form/TextArea.d.ts +9 -2
- package/dist/types/form/TextAreaBase.d.ts +12 -3
- package/dist/types/form/TimeInput.d.ts +28 -3
- package/dist/types/form/TimeInputBase.d.ts +21 -4
- package/dist/types/form/_pickerInternals/Calendar.d.ts +17 -2
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +6 -0
- package/dist/types/form/_pickerInternals/dateUtils.d.ts +17 -0
- package/dist/types/form/controlLoading.d.ts +4 -0
- package/dist/types/helpers/Theme.d.ts +13 -4
- package/dist/types/helpers/portal.d.ts +2 -1
- package/dist/types/helpers/useAnchoredPosition.d.ts +10 -1
- package/dist/types/helpers/useFocusTrap.d.ts +13 -5
- package/dist/types/helpers/useOtherClasses.d.ts +13 -1
- package/dist/types-cjs/elements/Progress.d.ts +6 -1
- package/dist/types-cjs/form/Checkboxes.d.ts +7 -0
- package/dist/types-cjs/form/Control.d.ts +14 -2
- package/dist/types-cjs/form/DateInput.d.ts +28 -3
- package/dist/types-cjs/form/DateInputBase.d.ts +17 -3
- package/dist/types-cjs/form/DateTimeInput.d.ts +28 -3
- package/dist/types-cjs/form/DateTimeInputBase.d.ts +17 -3
- package/dist/types-cjs/form/File.d.ts +6 -0
- package/dist/types-cjs/form/FormContext.d.ts +39 -7
- package/dist/types-cjs/form/Input.d.ts +21 -4
- package/dist/types-cjs/form/InputBase.d.ts +5 -2
- package/dist/types-cjs/form/Radios.d.ts +7 -0
- package/dist/types-cjs/form/Rate.d.ts +7 -0
- package/dist/types-cjs/form/Select.d.ts +13 -2
- package/dist/types-cjs/form/Slider.d.ts +7 -0
- package/dist/types-cjs/form/Taginput.d.ts +6 -0
- package/dist/types-cjs/form/TextArea.d.ts +9 -2
- package/dist/types-cjs/form/TextAreaBase.d.ts +12 -3
- package/dist/types-cjs/form/TimeInput.d.ts +28 -3
- package/dist/types-cjs/form/TimeInputBase.d.ts +21 -4
- package/dist/types-cjs/form/_pickerInternals/Calendar.d.ts +17 -2
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +6 -0
- package/dist/types-cjs/form/_pickerInternals/dateUtils.d.ts +17 -0
- package/dist/types-cjs/form/controlLoading.d.ts +4 -0
- package/dist/types-cjs/helpers/Theme.d.ts +13 -4
- package/dist/types-cjs/helpers/portal.d.ts +2 -1
- package/dist/types-cjs/helpers/useAnchoredPosition.d.ts +10 -1
- package/dist/types-cjs/helpers/useFocusTrap.d.ts +13 -5
- package/dist/types-cjs/helpers/useOtherClasses.d.ts +13 -1
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/elements/_index.scss +2 -0
- package/src/scss/elements/_progress.scss +17 -0
- package/src/scss/elements/_skeleton.scss +21 -0
- package/src/scss/form/_datetimeinput.scss +9 -0
- package/src/scss/form/_picker-popover.scss +23 -4
- package/src/scss/form/_rate.scss +3 -1
- package/src/scss/form/_timeinput.scss +12 -2
|
@@ -8,6 +8,13 @@ import { InputBaseProps } from './InputBase.js';
|
|
|
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
|
+
* Inside an existing `Control` it renders no `Control` of its own, so set the
|
|
12
|
+
* Control-level props on that `Control` instead. Inside an outer `Field`, or a
|
|
13
|
+
* `Control` with no `Field` around it, it renders no `Field` of its own either.
|
|
14
|
+
* The exception is `label`, `message`, `horizontal` or `fieldClassName` in that
|
|
15
|
+
* bare `Control`: it keeps a `Field` for them, nested in the `.control`, and
|
|
16
|
+
* warns in development. Wrap the `Control` in a `Field` instead, and set the
|
|
17
|
+
* `label`, `horizontal` and class name on that `Field`.
|
|
11
18
|
*/
|
|
12
19
|
export interface InputProps extends InputBaseProps {
|
|
13
20
|
/** Field label. Automatically associated with the input via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
|
|
@@ -18,9 +25,17 @@ export interface InputProps extends InputBaseProps {
|
|
|
18
25
|
labelProps?: FieldProps['labelProps'];
|
|
19
26
|
/** Horizontal field layout. */
|
|
20
27
|
horizontal?: boolean;
|
|
21
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Icon props for left icon.
|
|
30
|
+
* Bulma gives control icons `pointer-events: none`, so a clickable node here
|
|
31
|
+
* never receives a click. Put a button beside the input in its own addon `Control` instead.
|
|
32
|
+
*/
|
|
22
33
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
23
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Icon props for right icon.
|
|
36
|
+
* Bulma gives control icons `pointer-events: none`, so a clickable node here
|
|
37
|
+
* never receives a click. Put a button beside the input in its own addon `Control` instead.
|
|
38
|
+
*/
|
|
24
39
|
iconRight?: ControlBaseProps['iconRight'];
|
|
25
40
|
/** Shortcut for left icon name. */
|
|
26
41
|
iconLeftName?: string;
|
|
@@ -35,9 +50,11 @@ export interface InputProps extends InputBaseProps {
|
|
|
35
50
|
/** Force right icon container. */
|
|
36
51
|
hasIconsRight?: boolean;
|
|
37
52
|
/**
|
|
38
|
-
* Shows a loading spinner on the
|
|
53
|
+
* Shows a loading spinner on the `Control` it renders.
|
|
39
54
|
* Under `prefers-reduced-motion: reduce` the spinner stops and stays
|
|
40
55
|
* drawn (with bestax's CSS loaded).
|
|
56
|
+
* The spinner sits at the right edge, where `iconRight` also sits, and the
|
|
57
|
+
* two overlap; leave the right icon out while loading.
|
|
41
58
|
*/
|
|
42
59
|
isLoading?: boolean;
|
|
43
60
|
/** Expand the control. */
|
|
@@ -54,7 +71,7 @@ export interface InputProps extends InputBaseProps {
|
|
|
54
71
|
controlClassName?: string;
|
|
55
72
|
}
|
|
56
73
|
/**
|
|
57
|
-
* The `Input` component provides a Bulma-styled text input, supporting colors, sizes, rounded corners, static
|
|
74
|
+
* The `Input` component provides a Bulma-styled text input, supporting colors, sizes, rounded corners, static state, hover/focus/loading states, and all Bulma helper props.
|
|
58
75
|
*
|
|
59
76
|
* @function
|
|
60
77
|
* @param {InputProps} props - Props for Input.
|
|
@@ -10,13 +10,16 @@ export interface InputBaseProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
10
10
|
size?: 'small' | 'medium' | 'large';
|
|
11
11
|
/** Rounded input corners. */
|
|
12
12
|
isRounded?: boolean;
|
|
13
|
-
/**
|
|
13
|
+
/** Styles the input as static text. It stays editable; add `readOnly` to stop edits. */
|
|
14
14
|
isStatic?: boolean;
|
|
15
15
|
/** Applies hovered state. */
|
|
16
16
|
isHovered?: boolean;
|
|
17
17
|
/** Applies focused state. */
|
|
18
18
|
isFocused?: boolean;
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Adds the `is-loading` class to the `<input>`. Bulma draws no spinner for it there: the
|
|
21
|
+
* spinner belongs to the wrapping `Control`, so set `isLoading` on that `Control`.
|
|
22
|
+
*/
|
|
20
23
|
isLoading?: boolean;
|
|
21
24
|
/** Additional CSS classes to apply. */
|
|
22
25
|
className?: string;
|
|
@@ -3,6 +3,13 @@ import { BulmaClassesProps } from '../helpers/useBulmaClasses.js';
|
|
|
3
3
|
import { FormFieldProps } from './fieldProps.js';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Radios component.
|
|
6
|
+
* Inside an existing `Control` it renders no `Control` of its own. Inside an
|
|
7
|
+
* outer `Field`, or a `Control` with no `Field` around it, it renders no
|
|
8
|
+
* `Field` of its own either. The exception is `label`, `message`, `horizontal`
|
|
9
|
+
* or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,
|
|
10
|
+
* nested in the `.control`, and warns in development. Wrap the `Control` in a
|
|
11
|
+
* `Field` instead, and set the `label`, `horizontal` and class name on that
|
|
12
|
+
* `Field`.
|
|
6
13
|
*/
|
|
7
14
|
export interface RadiosProps extends Omit<BulmaClassesProps, 'color'>, FormFieldProps {
|
|
8
15
|
/** Field label naming the whole group. Automatically associated via `aria-labelledby` on the `role="radiogroup"` wrapper — uses your `labelProps.id` when provided, otherwise a generated one. Dropped inside an outer `Field` (label that `Field` yourself). */
|
|
@@ -22,6 +22,13 @@ export interface RateIconProps {
|
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
24
|
* Props for the Rate component.
|
|
25
|
+
* Inside an existing `Control` it renders no `Control` of its own. Inside an
|
|
26
|
+
* outer `Field`, or a `Control` with no `Field` around it, it renders no
|
|
27
|
+
* `Field` of its own either. The exception is `label`, `message`, `horizontal`
|
|
28
|
+
* or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,
|
|
29
|
+
* nested in the `.control`, and warns in development. Wrap the `Control` in a
|
|
30
|
+
* `Field` instead, and set the `label`, `horizontal` and class name on that
|
|
31
|
+
* `Field`.
|
|
25
32
|
* @extraProp {string} [className] - Additional CSS classes.
|
|
26
33
|
* @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.
|
|
27
34
|
*/
|
|
@@ -7,7 +7,14 @@ import { SelectBaseProps } from './SelectBase.js';
|
|
|
7
7
|
*
|
|
8
8
|
* Composes Field, Control, and SelectBase into a single convenience component.
|
|
9
9
|
* Supports all SelectBase props, plus Field-level (label, horizontal) and
|
|
10
|
-
* Control-level (icons
|
|
10
|
+
* Control-level (icons) props.
|
|
11
|
+
* Inside an existing `Control` it renders no `Control` of its own, so set the
|
|
12
|
+
* Control-level props on that `Control` instead. Inside an outer `Field`, or a
|
|
13
|
+
* `Control` with no `Field` around it, it renders no `Field` of its own either.
|
|
14
|
+
* The exception is `label`, `message`, `horizontal` or `fieldClassName` in that
|
|
15
|
+
* bare `Control`: it keeps a `Field` for them, nested in the `.control`, and
|
|
16
|
+
* warns in development. Wrap the `Control` in a `Field` instead, and set the
|
|
17
|
+
* `label`, `horizontal` and class name on that `Field`.
|
|
11
18
|
*/
|
|
12
19
|
export interface SelectProps extends SelectBaseProps {
|
|
13
20
|
/** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
|
|
@@ -18,7 +25,11 @@ export interface SelectProps extends SelectBaseProps {
|
|
|
18
25
|
labelProps?: FieldProps['labelProps'];
|
|
19
26
|
/** Horizontal field layout. */
|
|
20
27
|
horizontal?: boolean;
|
|
21
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Icon props for left icon.
|
|
30
|
+
* Bulma gives control icons `pointer-events: none`, so a clickable node here
|
|
31
|
+
* never receives a click. Put a button beside the input in its own addon `Control` instead.
|
|
32
|
+
*/
|
|
22
33
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
23
34
|
/** Shortcut for left icon name. */
|
|
24
35
|
iconLeftName?: string;
|
|
@@ -117,6 +117,13 @@ export interface SliderRangeProps extends SliderBaseProps {
|
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
119
119
|
* Props for the Slider component — a discriminated union of single and range modes.
|
|
120
|
+
* Inside an existing `Control` it renders no `Control` of its own. Inside an
|
|
121
|
+
* outer `Field`, or a `Control` with no `Field` around it, it renders no
|
|
122
|
+
* `Field` of its own either. The exception is `label`, `message`, `horizontal`
|
|
123
|
+
* or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,
|
|
124
|
+
* nested in the `.control`, and warns in development. Wrap the `Control` in a
|
|
125
|
+
* `Field` instead, and set the `label`, `horizontal` and class name on that
|
|
126
|
+
* `Field`.
|
|
120
127
|
* @extraProp {boolean} [disabled=false] - Whether the slider is disabled.
|
|
121
128
|
* @extraProp {string} [className] - Additional CSS classes.
|
|
122
129
|
* @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.
|
|
@@ -16,6 +16,12 @@ export type TaginputTag = TaginputItem | string;
|
|
|
16
16
|
type IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';
|
|
17
17
|
/**
|
|
18
18
|
* Props for the Taginput component.
|
|
19
|
+
* Inside an outer `Field`, or a `Control` with no `Field` around it, it
|
|
20
|
+
* renders no `Field` of its own. The exception is `label`, `message`,
|
|
21
|
+
* `horizontal` or `fieldClassName` in that bare `Control`: it keeps a `Field`
|
|
22
|
+
* for them, nested in the `.control`, and warns in development. Wrap the
|
|
23
|
+
* `Control` in a `Field` instead, and set the `label`, `horizontal` and class
|
|
24
|
+
* name on that `Field`.
|
|
19
25
|
* @extraProp {string} [className] - Additional CSS classes.
|
|
20
26
|
* @extraProp {React.Ref<HTMLInputElement>} [ref] - Ref forwarded to the input element.
|
|
21
27
|
*/
|
|
@@ -8,6 +8,13 @@ import { TextAreaBaseProps } from './TextAreaBase.js';
|
|
|
8
8
|
* Composes Field, Control, and TextAreaBase into a single convenience component.
|
|
9
9
|
* Supports all TextAreaBase props, plus Field-level (label, horizontal) and
|
|
10
10
|
* Control-level (loading) props.
|
|
11
|
+
* Inside an existing `Control` it renders no `Control` of its own, so set the
|
|
12
|
+
* Control-level props on that `Control` instead. Inside an outer `Field`, or a
|
|
13
|
+
* `Control` with no `Field` around it, it renders no `Field` of its own either.
|
|
14
|
+
* The exception is `label`, `message`, `horizontal` or `fieldClassName` in that
|
|
15
|
+
* bare `Control`: it keeps a `Field` for them, nested in the `.control`, and
|
|
16
|
+
* warns in development. Wrap the `Control` in a `Field` instead, and set the
|
|
17
|
+
* `label`, `horizontal` and class name on that `Field`.
|
|
11
18
|
*/
|
|
12
19
|
export interface TextAreaProps extends TextAreaBaseProps {
|
|
13
20
|
/** Field label. Automatically associated with the textarea via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */
|
|
@@ -19,7 +26,7 @@ export interface TextAreaProps extends TextAreaBaseProps {
|
|
|
19
26
|
/** Horizontal field layout. */
|
|
20
27
|
horizontal?: boolean;
|
|
21
28
|
/**
|
|
22
|
-
* Shows a loading spinner on the
|
|
29
|
+
* Shows a loading spinner on the `Control` it renders.
|
|
23
30
|
* Under `prefers-reduced-motion: reduce` the spinner stops and stays
|
|
24
31
|
* drawn (with bestax's CSS loaded).
|
|
25
32
|
*/
|
|
@@ -36,7 +43,7 @@ export interface TextAreaProps extends TextAreaBaseProps {
|
|
|
36
43
|
controlClassName?: string;
|
|
37
44
|
}
|
|
38
45
|
/**
|
|
39
|
-
* The `TextArea` component provides a Bulma-styled multi-line text input, supporting color, size,
|
|
46
|
+
* The `TextArea` component provides a Bulma-styled multi-line text input, supporting color, size, hover/focus/loading states, fixed size, and all Bulma helper props.
|
|
40
47
|
*
|
|
41
48
|
* @function
|
|
42
49
|
* @param {TextAreaProps} props - Props for TextArea.
|
|
@@ -8,15 +8,24 @@ export interface TextAreaBaseProps extends Omit<React.TextareaHTMLAttributes<HTM
|
|
|
8
8
|
color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger' | 'black' | 'dark' | 'light' | 'white';
|
|
9
9
|
/** Size modifier for the textarea. */
|
|
10
10
|
size?: 'small' | 'medium' | 'large';
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Adds the `is-rounded` class to the `<textarea>`. Bulma styles it on `.input` only, so the
|
|
13
|
+
* textarea's corners don't change.
|
|
14
|
+
*/
|
|
12
15
|
isRounded?: boolean;
|
|
13
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Adds the `is-static` class to the `<textarea>`. Bulma styles it on `.input` only, so the
|
|
18
|
+
* textarea keeps its border, background and padding.
|
|
19
|
+
*/
|
|
14
20
|
isStatic?: boolean;
|
|
15
21
|
/** Applies hovered state. */
|
|
16
22
|
isHovered?: boolean;
|
|
17
23
|
/** Applies focused state. */
|
|
18
24
|
isFocused?: boolean;
|
|
19
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Accepted and ignored: `TextAreaBase` renders no loading state. The spinner belongs to the
|
|
27
|
+
* wrapping `Control`, so set `isLoading` on that `Control`.
|
|
28
|
+
*/
|
|
20
29
|
isLoading?: boolean;
|
|
21
30
|
/** Applies Bulma's is-active modifier. */
|
|
22
31
|
isActive?: boolean;
|
|
@@ -5,6 +5,13 @@ import { TimeInputBaseProps } from './TimeInputBase.js';
|
|
|
5
5
|
/**
|
|
6
6
|
* Props for the TimeInput convenience wrapper. Extends `TimeInputBaseProps`
|
|
7
7
|
* with Field-level (label, horizontal) and Control-level (icons, loading) props.
|
|
8
|
+
* Inside an existing `Control` it renders no `Control` of its own, so set the
|
|
9
|
+
* Control-level props on that `Control` instead. Inside an outer `Field`, or a
|
|
10
|
+
* `Control` with no `Field` around it, it renders no `Field` of its own either.
|
|
11
|
+
* The exception is `label`, `message`, `horizontal` or `fieldClassName` in that
|
|
12
|
+
* bare `Control`: it keeps a `Field` for them, nested in the `.control`, and
|
|
13
|
+
* warns in development. Wrap the `Control` in a `Field` instead, and set the
|
|
14
|
+
* `label`, `horizontal` and class name on that `Field`.
|
|
8
15
|
* @extraProp {string} [name] - Form field name.
|
|
9
16
|
* @extraProp {string} [form] - Form id the input belongs to.
|
|
10
17
|
* @extraProp {boolean} [required=false] - Marks the input as required.
|
|
@@ -20,9 +27,17 @@ export interface TimeInputProps extends TimeInputBaseProps {
|
|
|
20
27
|
labelProps?: FieldProps['labelProps'];
|
|
21
28
|
/** Render the field with horizontal layout. */
|
|
22
29
|
horizontal?: boolean;
|
|
23
|
-
/**
|
|
30
|
+
/**
|
|
31
|
+
* Icon props for the left icon.
|
|
32
|
+
* Bulma gives control icons `pointer-events: none`, so a clickable node here
|
|
33
|
+
* never receives a click. Put a button beside the input in its own addon `Control` instead.
|
|
34
|
+
*/
|
|
24
35
|
iconLeft?: ControlBaseProps['iconLeft'];
|
|
25
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Icon props for the right icon.
|
|
38
|
+
* Bulma gives control icons `pointer-events: none`, so a clickable node here
|
|
39
|
+
* never receives a click. Put a button beside the input in its own addon `Control` instead.
|
|
40
|
+
*/
|
|
26
41
|
iconRight?: ControlBaseProps['iconRight'];
|
|
27
42
|
/** Shortcut for the right icon name. */
|
|
28
43
|
iconRightName?: string;
|
|
@@ -35,11 +50,21 @@ export interface TimeInputProps extends TimeInputBaseProps {
|
|
|
35
50
|
/** Force the right icon container. */
|
|
36
51
|
hasIconsRight?: boolean;
|
|
37
52
|
/**
|
|
38
|
-
*
|
|
53
|
+
* Shows a loading spinner on the `Control` it renders, and hides the
|
|
54
|
+
* launcher (`triggerIcon`) while it does. Inside your own `Control` it
|
|
55
|
+
* renders none, so this draws nothing; set `isLoading` on that `Control`.
|
|
39
56
|
* Under `prefers-reduced-motion: reduce` the spinner stops and stays
|
|
40
57
|
* drawn (with bestax's CSS loaded).
|
|
41
58
|
*/
|
|
42
59
|
isLoading?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Show a clickable launcher button on the right that toggles the popover.
|
|
62
|
+
* Hidden by default while a spinner shows at the same right edge: this
|
|
63
|
+
* component's `isLoading` when it renders its own `Control`, or the
|
|
64
|
+
* enclosing `Control`'s `isLoading` inside one.
|
|
65
|
+
* @defaultValue true
|
|
66
|
+
*/
|
|
67
|
+
triggerIcon?: boolean;
|
|
43
68
|
/** Expand the control to fill its container. */
|
|
44
69
|
isExpanded?: boolean;
|
|
45
70
|
/** Size of the wrapping Control. */
|
|
@@ -17,7 +17,11 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
|
|
|
17
17
|
onOpen?: () => void;
|
|
18
18
|
/** Fired when the popover closes. */
|
|
19
19
|
onClose?: () => void;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Earliest selectable time. A `min` before year 1 is raised to midnight on
|
|
22
|
+
* 1 January of year 1, and a `value` dated before then is out of range, so
|
|
23
|
+
* the wheels and typing change nothing on it, as in the date pickers.
|
|
24
|
+
*/
|
|
21
25
|
min?: Date;
|
|
22
26
|
/** Latest selectable time. */
|
|
23
27
|
max?: Date;
|
|
@@ -32,7 +36,11 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
|
|
|
32
36
|
* @defaultValue (see below)
|
|
33
37
|
*/
|
|
34
38
|
format?: DateFormatOption;
|
|
35
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Custom parser. Enter and leaving the field call it only if the user
|
|
41
|
+
* changed the text, so focus passing through commits nothing and the value
|
|
42
|
+
* keeps what the format leaves out, such as seconds and the date.
|
|
43
|
+
*/
|
|
36
44
|
parse?: (s: string) => Date | null;
|
|
37
45
|
/** BCP-47 locale tag for Intl formatting. */
|
|
38
46
|
locale?: string;
|
|
@@ -55,7 +63,11 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
|
|
|
55
63
|
closeOnSelect?: boolean;
|
|
56
64
|
/** Popover anchor position relative to the input. */
|
|
57
65
|
position?: PickerPosition;
|
|
58
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Render the popover into `document.body` via portal. On a narrow screen
|
|
68
|
+
* an in-place popover spans the bottom of the viewport, while a portaled
|
|
69
|
+
* one stays on its `position` corner.
|
|
70
|
+
*/
|
|
59
71
|
appendToBody?: boolean;
|
|
60
72
|
/**
|
|
61
73
|
* Bulma color modifier for the input, also carried by the wheels, where it
|
|
@@ -83,7 +95,12 @@ export interface TimeInputBaseProps extends Omit<React.InputHTMLAttributes<HTMLI
|
|
|
83
95
|
unselectableTimes?: (d: Date) => boolean;
|
|
84
96
|
/** Decorative left icon glyph for the wrapping `Control` (shown by default). Set `''` to hide. */
|
|
85
97
|
iconLeftName?: string;
|
|
86
|
-
/**
|
|
98
|
+
/**
|
|
99
|
+
* Show a clickable launcher button on the right that toggles the popover.
|
|
100
|
+
* Hidden by default while a `Control` it sits in shows its `isLoading`
|
|
101
|
+
* spinner, which shares that right edge.
|
|
102
|
+
* @defaultValue true
|
|
103
|
+
*/
|
|
87
104
|
triggerIcon?: boolean;
|
|
88
105
|
/** Glyph for the right launcher button. */
|
|
89
106
|
triggerIconName?: string;
|
|
@@ -5,6 +5,10 @@ export interface CalendarProps {
|
|
|
5
5
|
focusedDate: Date;
|
|
6
6
|
onSelect: (d: Date) => void;
|
|
7
7
|
onFocusedDateChange: (d: Date) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Earliest selectable date. One before year 1, or none, counts as the start
|
|
10
|
+
* of year 1.
|
|
11
|
+
*/
|
|
8
12
|
min?: Date;
|
|
9
13
|
max?: Date;
|
|
10
14
|
shouldDisableDate?: (d: Date) => boolean;
|
|
@@ -18,13 +22,18 @@ export interface CalendarProps {
|
|
|
18
22
|
size?: 'small' | 'medium' | 'large';
|
|
19
23
|
className?: string;
|
|
20
24
|
id?: string;
|
|
21
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* When true, the day or month grid takes focus as it renders, and again as
|
|
27
|
+
* it comes back from the year list. With or without it, once a grid has
|
|
28
|
+
* focus, focus follows its tab stop from cell to cell.
|
|
29
|
+
*/
|
|
22
30
|
autoFocusCell?: boolean;
|
|
23
31
|
/** Optional translatable string overrides. */
|
|
24
32
|
labels?: PickerLabels;
|
|
25
33
|
/**
|
|
26
34
|
* Inclusive `[min, max]` year range shown in the year-dropdown view.
|
|
27
|
-
* Defaults to ±100 years around the focused year, clamped by `min`/`max
|
|
35
|
+
* Defaults to ±100 years around the focused year, clamped by `min`/`max`
|
|
36
|
+
* and never reaching below year 1.
|
|
28
37
|
* At `'year'` granularity the window centres on the year focused when the
|
|
29
38
|
* calendar mounted, so moving focus never reflows the list.
|
|
30
39
|
*/
|
|
@@ -38,5 +47,11 @@ export interface CalendarProps {
|
|
|
38
47
|
*/
|
|
39
48
|
granularity?: DateGranularity;
|
|
40
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Selects the calendar's focused cell, the one tab stop of whichever grid or
|
|
52
|
+
* year list is on show, for a popover to put focus on as it opens. It runs
|
|
53
|
+
* against the whole panel, so it matches only inside the grid or the list.
|
|
54
|
+
*/
|
|
55
|
+
export declare const CALENDAR_FOCUSED_CELL = "[role=\"grid\"] [data-focused=\"true\"], [role=\"listbox\"] [data-focused-year=\"true\"]";
|
|
41
56
|
export declare const Calendar: React.FC<CalendarProps>;
|
|
42
57
|
export default Calendar;
|
|
@@ -22,6 +22,12 @@ export interface PickerPopoverProps {
|
|
|
22
22
|
* would be recorded instead, and that cell leaves with the panel.
|
|
23
23
|
*/
|
|
24
24
|
restoreFocusRef?: React.RefObject<HTMLElement | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Selects the element in the panel that takes focus as it opens, such as a
|
|
27
|
+
* calendar's focused date rather than the first button in its header. When
|
|
28
|
+
* nothing matches, or the match can't take focus, the first tab stop does.
|
|
29
|
+
*/
|
|
30
|
+
initialFocusSelector?: string;
|
|
25
31
|
}
|
|
26
32
|
export declare const PickerPopover: React.FC<PickerPopoverProps>;
|
|
27
33
|
export default PickerPopover;
|
|
@@ -19,6 +19,18 @@ export declare function endOfMonth(d: Date): Date;
|
|
|
19
19
|
* turning into 1900–1999.
|
|
20
20
|
*/
|
|
21
21
|
export declare function makeDate(year: number, month?: number, day?: number): Date;
|
|
22
|
+
/**
|
|
23
|
+
* The earliest year the pickers accept. HTML's date, month and datetime-local
|
|
24
|
+
* inputs hold no year below 1, so the calendar, typing and parsing stop there
|
|
25
|
+
* too.
|
|
26
|
+
*/
|
|
27
|
+
export declare const FIRST_YEAR = 1;
|
|
28
|
+
/**
|
|
29
|
+
* The lower bound a picker applies: `min`, raised to local midnight on
|
|
30
|
+
* 1 January of {@link FIRST_YEAR} when it is earlier or absent. A `min` in
|
|
31
|
+
* range comes back as the same object.
|
|
32
|
+
*/
|
|
33
|
+
export declare function floorMin(min?: Date): Date;
|
|
22
34
|
/**
|
|
23
35
|
* First instant of the day, month or year containing `d`. Works by setters on
|
|
24
36
|
* a copy rather than the `Date(y, m, d)` constructor, which reads years 0–99
|
|
@@ -64,6 +76,11 @@ export declare function getTimeOfDay(d: Date): {
|
|
|
64
76
|
minutes: number;
|
|
65
77
|
seconds: number;
|
|
66
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* A copy of `d` moved into `[min, max]`. When `min` is after `max` nothing is
|
|
81
|
+
* in range and `min` wins, so clamping twice gives the same date and a
|
|
82
|
+
* picker's focus stays off the years before 1 under a `max` before then.
|
|
83
|
+
*/
|
|
67
84
|
export declare function clampDate(d: Date, min?: Date, max?: Date): Date;
|
|
68
85
|
/**
|
|
69
86
|
* Snap a Date's time-of-day to the nearest grid defined by the given
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Provider for the loading state, used internally by `Control`. */
|
|
2
|
+
export declare const ControlLoadingProvider: import("react").Provider<boolean>;
|
|
3
|
+
/** Whether the nearest enclosing `Control` is loading; `false` outside one. */
|
|
4
|
+
export declare const useControlLoading: () => boolean;
|
|
@@ -11,10 +11,6 @@ type BulmaVars = Partial<Record<BulmaVarKey, string>>;
|
|
|
11
11
|
*
|
|
12
12
|
* @property {React.ReactNode} children - Content to render inside the theme scope.
|
|
13
13
|
* @property {string} [className] - Additional CSS classes (only when isRoot is false).
|
|
14
|
-
* @property {'light' | 'dark' | 'system'} [colorMode] - Set Bulma's light/dark scheme by writing
|
|
15
|
-
* the `data-theme` attribute on the document root (`<html>`). This is always global, even on a
|
|
16
|
-
* scoped Theme. `'system'` removes the attribute so Bulma follows the OS `prefers-color-scheme`.
|
|
17
|
-
* Omit to leave the current setting untouched.
|
|
18
14
|
* @property {BulmaVars} [bulmaVars] - Object mapping Bulma CSS variable names to values.
|
|
19
15
|
* @property {string} [schemeH] - Scheme hue value.
|
|
20
16
|
* @property {string} [schemeS] - Scheme saturation value.
|
|
@@ -76,6 +72,19 @@ export interface ThemeProps extends Omit<BulmaClassesProps, 'color' | 'backgroun
|
|
|
76
72
|
* server render does not include them.
|
|
77
73
|
*/
|
|
78
74
|
isRoot?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Set Bulma's light/dark scheme by writing its theme attribute on the
|
|
77
|
+
* document root (`<html>`). This is always global, even on a scoped Theme.
|
|
78
|
+
* `'system'` removes the attribute so Bulma follows the OS
|
|
79
|
+
* `prefers-color-scheme`. Omit to leave the current setting untouched.
|
|
80
|
+
*
|
|
81
|
+
* The attribute is `data-theme`. A stylesheet built with a class prefix
|
|
82
|
+
* reads Bulma's prefixed form instead (`data-bestax-theme` for the
|
|
83
|
+
* `bestax-prefixed` builds), so under a `ConfigProvider` `classPrefix`
|
|
84
|
+
* Theme writes both, and `'system'` or unmounting clears or restores both.
|
|
85
|
+
* If the prefix cannot form an attribute name, `'light'` and `'dark'`
|
|
86
|
+
* write only `data-theme` and warn in development.
|
|
87
|
+
*/
|
|
79
88
|
colorMode?: 'light' | 'dark' | 'system';
|
|
80
89
|
bulmaVars?: BulmaVars;
|
|
81
90
|
/**
|
|
@@ -56,7 +56,8 @@ export interface PortalProps {
|
|
|
56
56
|
* Tab order and focus follow the DOM too. Content portaled from inside a
|
|
57
57
|
* focus trap is no longer inside the trapped element, so the trap neither
|
|
58
58
|
* reaches it nor holds focus there: render nested overlays inside the
|
|
59
|
-
* trapped element, or give them a trap of their own.
|
|
59
|
+
* trapped element, or give them a trap of their own. To trap portaled
|
|
60
|
+
* content, put `useFocusTrap`'s ref on the element inside the `Portal`.
|
|
60
61
|
*
|
|
61
62
|
* @function
|
|
62
63
|
* @param {PortalProps} props - Props for the Portal component.
|
|
@@ -28,7 +28,10 @@ export interface UseAnchoredPositionOptions {
|
|
|
28
28
|
/**
|
|
29
29
|
* The gap between the anchor and the panel, in pixels, that the hook puts
|
|
30
30
|
* there itself: added to the fixed coordinates and to the room `auto` asks
|
|
31
|
-
* for below the anchor.
|
|
31
|
+
* for below the anchor. Popover and the pickers' popover pass `0` and take
|
|
32
|
+
* their gap from a margin in their stylesheet, read through `styledGap`, so
|
|
33
|
+
* a theme's offset moves the panel and `auto` alike. A new panel should do
|
|
34
|
+
* the same rather than rely on this default, which no stylesheet sees.
|
|
32
35
|
* @defaultValue 4
|
|
33
36
|
*/
|
|
34
37
|
offset?: number;
|
|
@@ -39,6 +42,12 @@ export interface UseAnchoredPositionOptions {
|
|
|
39
42
|
*/
|
|
40
43
|
styledGap?: (panel: HTMLElement) => number;
|
|
41
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* A `styledGap` for a panel whose stylesheet puts the gap in a margin on the
|
|
47
|
+
* side facing the anchor, negative on a portaled panel above it, so the
|
|
48
|
+
* larger magnitude is the gap. In pixels.
|
|
49
|
+
*/
|
|
50
|
+
export declare function marginGap(panel: HTMLElement): number;
|
|
42
51
|
/**
|
|
43
52
|
* Places a floating panel against its anchor: resolves `auto` to a corner
|
|
44
53
|
* and, for a panel fixed to the viewport, works out its coordinates. It
|
|
@@ -61,12 +61,20 @@ export interface UseFocusTrapOptions {
|
|
|
61
61
|
* behaviour, and a modal also has to block the page behind it, which `Modal`
|
|
62
62
|
* does. Content the container renders through a portal lives elsewhere in
|
|
63
63
|
* the DOM, so it is outside the trap: render nested overlays inside the
|
|
64
|
-
* container, or give them a trap of their own.
|
|
64
|
+
* container, or give them a trap of their own. To trap content a `Portal`
|
|
65
|
+
* renders, pass a ref to the element inside the `Portal` as `containerRef`.
|
|
65
66
|
*
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
67
|
+
* The trap looks at `containerRef` again each time the component calling it
|
|
68
|
+
* renders. A container that mounts after the trap turns on, such as a panel
|
|
69
|
+
* waiting for a `Portal` target held in state, has it attach once that
|
|
70
|
+
* component renders with the container in the DOM. When the container leaves
|
|
71
|
+
* or is replaced, the trap lets go of it as it would turning off, handing
|
|
72
|
+
* focus back, and attaches to the next one.
|
|
73
|
+
* A child that mounts the container in a render of its own (from its own
|
|
74
|
+
* state, or as a `Suspense` boundary resolves) goes unseen until the
|
|
75
|
+
* component calling the hook renders again. The trap waits for hydration, so
|
|
76
|
+
* that component renders again when the page hydrates, and portaled content,
|
|
77
|
+
* which first appears then, is found.
|
|
70
78
|
*
|
|
71
79
|
* @function useFocusTrap
|
|
72
80
|
* @param containerRef - Ref to the element focus stays inside.
|
|
@@ -25,7 +25,17 @@ export interface BulmaOtherProps {
|
|
|
25
25
|
* on this axis.
|
|
26
26
|
*/
|
|
27
27
|
overflowY?: (typeof validAxisOverflows)[number];
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Covers the nearest positioned ancestor (`is-overlay`): `position:
|
|
30
|
+
* absolute` with `top`, `right`, `bottom` and `left` at 0.
|
|
31
|
+
*
|
|
32
|
+
* `pos` and `relative` set `position` with `!important`, so beside
|
|
33
|
+
* `overlay` either one replaces the `absolute` and keeps the zero offsets.
|
|
34
|
+
* `pos="fixed"` then covers the viewport instead of the ancestor. `sticky`,
|
|
35
|
+
* `relative` and `static` put the element back in the normal flow, where it
|
|
36
|
+
* covers nothing, and a sticky one sticks at every edge of its scroll
|
|
37
|
+
* container.
|
|
38
|
+
*/
|
|
29
39
|
overlay?: boolean;
|
|
30
40
|
/** Interaction behavior (e.g., 'unselectable', 'clickable'). */
|
|
31
41
|
interaction?: (typeof validInteractions)[number];
|
|
@@ -63,6 +73,8 @@ export interface BulmaOtherProps {
|
|
|
63
73
|
* own CSS. `sticky` in particular does nothing until one is set.
|
|
64
74
|
*
|
|
65
75
|
* When `pos` is set it decides the position, and `relative` adds nothing.
|
|
76
|
+
* Beside `overlay` it replaces the overlay's `absolute` but not its zero
|
|
77
|
+
* offsets; see `overlay`.
|
|
66
78
|
*/
|
|
67
79
|
pos?: (typeof validPositions)[number];
|
|
68
80
|
/**
|