@allxsmith/bestax-bulma 5.8.1 → 5.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +99 -20
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +99 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/types/form/DateInput.d.ts +2 -2
- package/dist/types/form/DateTimeInput.d.ts +2 -2
- package/dist/types/form/Field.d.ts +2 -2
- package/dist/types/form/File.d.ts +6 -0
- package/dist/types/form/Input.d.ts +2 -2
- package/dist/types/form/Numberinput.d.ts +6 -0
- package/dist/types/form/Select.d.ts +2 -2
- package/dist/types/form/Slider.d.ts +6 -0
- package/dist/types/form/TextArea.d.ts +2 -2
- package/dist/types/form/TimeInput.d.ts +2 -2
- package/dist/types/form/useAutoLabelId.d.ts +28 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -5903,6 +5903,25 @@ const CheckboxesComponent = ({ label, labelSize, labelProps, horizontal, message
|
|
|
5903
5903
|
};
|
|
5904
5904
|
const Checkboxes = withSubComponents(CheckboxesComponent, { Checkbox }, 'Checkboxes');
|
|
5905
5905
|
|
|
5906
|
+
/**
|
|
5907
|
+
* Associates the convenience `label` prop with its control (#368): generates
|
|
5908
|
+
* an id for the control and returns labelProps carrying a matching `htmlFor`.
|
|
5909
|
+
* A user-supplied `id` is used as the target instead of the generated one, and
|
|
5910
|
+
* an explicit `labelProps.htmlFor` disables generation entirely — the user has
|
|
5911
|
+
* taken over the association. Internal; not part of the public API.
|
|
5912
|
+
*/
|
|
5913
|
+
function useAutoLabelId({ label, id, labelProps, rendersLabel, }) {
|
|
5914
|
+
// Called unconditionally per the rules of hooks; SSR-safe on React 18 and 19.
|
|
5915
|
+
const generatedId = React.useId();
|
|
5916
|
+
// Truthiness mirrors Field's own `if (label)` render gate.
|
|
5917
|
+
const active = !!label && rendersLabel;
|
|
5918
|
+
const controlId = id ?? (active && !labelProps?.htmlFor ? generatedId : undefined);
|
|
5919
|
+
const fieldLabelProps = active
|
|
5920
|
+
? { htmlFor: controlId, ...labelProps }
|
|
5921
|
+
: labelProps;
|
|
5922
|
+
return { controlId, fieldLabelProps };
|
|
5923
|
+
}
|
|
5924
|
+
|
|
5906
5925
|
/**
|
|
5907
5926
|
* The `File` component provides a Bulma-styled file input, supporting color, size, boxed/fullwidth/align styles, icons, "has name", and filename display.
|
|
5908
5927
|
*
|
|
@@ -5915,6 +5934,12 @@ const File = React.forwardRef(({
|
|
|
5915
5934
|
// Field props
|
|
5916
5935
|
label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName, color, size, isBoxed, isFullwidth, isRight, isCentered, hasName, buttonLabel, iconLeft, iconRight, className, inputClassName, fileName, ...props }, ref) => {
|
|
5917
5936
|
const insideField = useInsideField();
|
|
5937
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
5938
|
+
label,
|
|
5939
|
+
id: props.id,
|
|
5940
|
+
labelProps,
|
|
5941
|
+
rendersLabel: !insideField,
|
|
5942
|
+
});
|
|
5918
5943
|
const { classPrefix } = useConfig();
|
|
5919
5944
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
5920
5945
|
color,
|
|
@@ -5944,9 +5969,9 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
5944
5969
|
[`is-${messageColor}`]: !!messageColor,
|
|
5945
5970
|
});
|
|
5946
5971
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
5947
|
-
const fileElement = (jsxRuntime.jsx("div", { className: fileClass, children: jsxRuntime.jsxs("label", { className: usePrefixedClassNames('file-label'), children: [jsxRuntime.jsx("input", { ref: ref, className: classNames(usePrefixedClassNames('file-input'), inputClassName), type: "file", ...rest }), jsxRuntime.jsxs("span", { className: usePrefixedClassNames('file-cta'), children: [iconLeft && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-icon'), children: iconLeft })), jsxRuntime.jsx("span", { className: usePrefixedClassNames('file-label'), children: buttonLabel || 'Choose a file\u2026' }), iconRight && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-icon'), children: iconRight }))] }), hasName && fileName && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-name'), children: fileName }))] }) }));
|
|
5972
|
+
const fileElement = (jsxRuntime.jsx("div", { className: fileClass, children: jsxRuntime.jsxs("label", { className: usePrefixedClassNames('file-label'), children: [jsxRuntime.jsx("input", { ref: ref, className: classNames(usePrefixedClassNames('file-input'), inputClassName), type: "file", id: controlId, ...rest }), jsxRuntime.jsxs("span", { className: usePrefixedClassNames('file-cta'), children: [iconLeft && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-icon'), children: iconLeft })), jsxRuntime.jsx("span", { className: usePrefixedClassNames('file-label'), children: buttonLabel || 'Choose a file\u2026' }), iconRight && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-icon'), children: iconRight }))] }), hasName && fileName && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'file-name'), children: fileName }))] }) }));
|
|
5948
5973
|
if (!insideField) {
|
|
5949
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
5974
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [fileElement, messageEl] }));
|
|
5950
5975
|
}
|
|
5951
5976
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [fileElement, messageEl] }));
|
|
5952
5977
|
});
|
|
@@ -6239,6 +6264,14 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
6239
6264
|
const insideField = useInsideField();
|
|
6240
6265
|
const insideControl = useInsideControl();
|
|
6241
6266
|
const { bulmaHelperClasses, rest } = useBulmaClasses(restProps);
|
|
6267
|
+
// In range mode the low thumb carries `rest` (and any user id), so the
|
|
6268
|
+
// label targets it; each thumb keeps its own aria-label for AT.
|
|
6269
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
6270
|
+
label,
|
|
6271
|
+
id: restProps.id,
|
|
6272
|
+
labelProps,
|
|
6273
|
+
rendersLabel: !insideField,
|
|
6274
|
+
});
|
|
6242
6275
|
// Resolve tooltip mode: explicit tooltip prop takes precedence, else showOutput maps to 'auto'
|
|
6243
6276
|
const tooltipMode = tooltip ?? (showOutput ? 'auto' : 'hidden');
|
|
6244
6277
|
// --- Range mode state ---
|
|
@@ -6503,7 +6536,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
6503
6536
|
// --- Single slider ---
|
|
6504
6537
|
const sliderElement = !range ? (jsxRuntime.jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentSingle, disabled: disabled, onChange: handleSingleChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input'), style: {
|
|
6505
6538
|
'--slider-progress': `${progressSingle}%`,
|
|
6506
|
-
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), ...rest }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
|
|
6539
|
+
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), id: controlId, ...rest }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
|
|
6507
6540
|
'is-visible': showTipLow,
|
|
6508
6541
|
'is-flipped': flipped,
|
|
6509
6542
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -6531,7 +6564,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
6531
6564
|
: {
|
|
6532
6565
|
'--slider-progress-low': `${progressLow}%`,
|
|
6533
6566
|
'--slider-progress-high': `${progressHigh}%`,
|
|
6534
|
-
} }), jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentRange[0], disabled: disabled, onChange: handleRangeLowChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-low'), "aria-valuenow": currentRange[0], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[0] ?? 'Minimum value', ...getAriaProps(currentRange[0]), ...rest, ...(nameLow !== undefined ? { name: nameLow } : {}) }), jsxRuntime.jsx("input", { ref: inputHighRef, type: "range", min: min, max: max, step: step, value: currentRange[1], disabled: disabled, onChange: handleRangeHighChange, onMouseEnter: () => setShowTooltipHigh(true), onMouseLeave: () => setShowTooltipHigh(false), onFocus: () => setShowTooltipHigh(true), onBlur: () => setShowTooltipHigh(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-high'), "aria-valuenow": currentRange[1], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[1] ?? 'Maximum value', ...getAriaProps(currentRange[1]), name: nameHigh }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-low', {
|
|
6567
|
+
} }), jsxRuntime.jsx("input", { ref: combinedRef, type: "range", min: min, max: max, step: step, value: currentRange[0], disabled: disabled, onChange: handleRangeLowChange, onKeyDown: handleKeyDown, onMouseEnter: () => setShowTooltip(true), onMouseLeave: () => setShowTooltip(false), onFocus: () => setShowTooltip(true), onBlur: () => setShowTooltip(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-low'), "aria-valuenow": currentRange[0], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[0] ?? 'Minimum value', ...getAriaProps(currentRange[0]), id: controlId, ...rest, ...(nameLow !== undefined ? { name: nameLow } : {}) }), jsxRuntime.jsx("input", { ref: inputHighRef, type: "range", min: min, max: max, step: step, value: currentRange[1], disabled: disabled, onChange: handleRangeHighChange, onMouseEnter: () => setShowTooltipHigh(true), onMouseLeave: () => setShowTooltipHigh(false), onFocus: () => setShowTooltipHigh(true), onBlur: () => setShowTooltipHigh(false), className: prefixedClassNames(classPrefix, 'slider-input', 'slider-input-high'), "aria-valuenow": currentRange[1], "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel?.[1] ?? 'Maximum value', ...getAriaProps(currentRange[1]), name: nameHigh }), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-low', {
|
|
6535
6568
|
'is-visible': showTipLow,
|
|
6536
6569
|
'is-flipped': flipped,
|
|
6537
6570
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -6577,7 +6610,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
6577
6610
|
content = jsxRuntime.jsx(Control, { children: content });
|
|
6578
6611
|
}
|
|
6579
6612
|
if (!insideField) {
|
|
6580
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
6613
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
6581
6614
|
}
|
|
6582
6615
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
6583
6616
|
});
|
|
@@ -6615,6 +6648,13 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
6615
6648
|
const isStepper = variant === 'stepper';
|
|
6616
6649
|
const isAddons = compact || isStepper;
|
|
6617
6650
|
const effectiveControlsPosition = isStepper ? 'right' : controlsPosition;
|
|
6651
|
+
// The plusminus bare branch renders no Field and no label at all.
|
|
6652
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
6653
|
+
label,
|
|
6654
|
+
id: props.id,
|
|
6655
|
+
labelProps,
|
|
6656
|
+
rendersLabel: !insideField && (isStepper || !effectiveBare),
|
|
6657
|
+
});
|
|
6618
6658
|
// Clamp value to min/max
|
|
6619
6659
|
const clampValue = React.useCallback((val) => {
|
|
6620
6660
|
let clamped = val;
|
|
@@ -6713,12 +6753,12 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
6713
6753
|
}
|
|
6714
6754
|
};
|
|
6715
6755
|
// Shared input element
|
|
6716
|
-
const inputControl = (jsxRuntime.jsx("div", { className: expandedControlClasses, children: jsxRuntime.jsx("input", { ref: combinedRef, type: "number", className: inputClasses, value: currentValue ?? '', min: min, max: max, step: step, disabled: disabled, readOnly: !editable, onChange: handleInputChange, onKeyDown: handleKeyDown, "aria-valuenow": currentValue ?? undefined, "aria-valuemin": min, "aria-valuemax": max, ...rest }) }));
|
|
6756
|
+
const inputControl = (jsxRuntime.jsx("div", { className: expandedControlClasses, children: jsxRuntime.jsx("input", { ref: combinedRef, type: "number", className: inputClasses, value: currentValue ?? '', min: min, max: max, step: step, disabled: disabled, readOnly: !editable, onChange: handleInputChange, onKeyDown: handleKeyDown, "aria-valuenow": currentValue ?? undefined, "aria-valuemin": min, "aria-valuemax": max, id: controlId, ...rest }) }));
|
|
6717
6757
|
// Stepper variant
|
|
6718
6758
|
if (isStepper) {
|
|
6719
6759
|
const stepperElement = (jsxRuntime.jsxs("div", { className: combinedClasses, children: [inputControl, jsxRuntime.jsx("div", { className: controlClasses, children: jsxRuntime.jsxs("div", { className: stepperClasses, children: [jsxRuntime.jsx("button", { type: "button", className: stepperButtonClasses, onClick: handleIncrement, disabled: disabled || isAtMax, tabIndex: -1, "aria-label": "Increase value", children: jsxRuntime.jsx(ArrowDropUp, {}) }), jsxRuntime.jsx("button", { type: "button", className: stepperButtonClasses, onClick: handleDecrement, disabled: disabled || isAtMin, tabIndex: -1, "aria-label": "Decrease value", children: jsxRuntime.jsx(ArrowDropDown, {}) })] }) })] }));
|
|
6720
6760
|
if (!insideField) {
|
|
6721
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
6761
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [stepperElement, messageEl] }));
|
|
6722
6762
|
}
|
|
6723
6763
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [stepperElement, messageEl] }));
|
|
6724
6764
|
}
|
|
@@ -6752,7 +6792,7 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
|
|
|
6752
6792
|
numberinputElement = (jsxRuntime.jsxs("div", { className: combinedClasses, children: [decrementControl, inputControl, incrementControl] }));
|
|
6753
6793
|
}
|
|
6754
6794
|
if (!insideField) {
|
|
6755
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
6795
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [numberinputElement, messageEl] }));
|
|
6756
6796
|
}
|
|
6757
6797
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [numberinputElement, messageEl] }));
|
|
6758
6798
|
});
|
|
@@ -7696,16 +7736,22 @@ fieldClassName, controlClassName,
|
|
|
7696
7736
|
...inputProps }, ref) => {
|
|
7697
7737
|
const insideField = useInsideField();
|
|
7698
7738
|
const insideControl = useInsideControl();
|
|
7739
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
7740
|
+
label,
|
|
7741
|
+
id: inputProps.id,
|
|
7742
|
+
labelProps,
|
|
7743
|
+
rendersLabel: !insideField,
|
|
7744
|
+
});
|
|
7699
7745
|
const helpClass = usePrefixedClassNames('help', {
|
|
7700
7746
|
[`is-${messageColor}`]: !!messageColor,
|
|
7701
7747
|
});
|
|
7702
|
-
let content = jsxRuntime.jsx(InputBase, { ref: ref, ...inputProps });
|
|
7748
|
+
let content = jsxRuntime.jsx(InputBase, { ref: ref, id: controlId, ...inputProps });
|
|
7703
7749
|
if (!insideControl) {
|
|
7704
7750
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconRight: iconRight, iconLeftName: iconLeftName, iconRightName: iconRightName, iconLeftSize: iconLeftSize, iconRightSize: iconRightSize, hasIconsLeft: hasIconsLeft, hasIconsRight: hasIconsRight, isLoading: isLoading, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
7705
7751
|
}
|
|
7706
7752
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
7707
7753
|
if (!insideField) {
|
|
7708
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
7754
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
7709
7755
|
}
|
|
7710
7756
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
7711
7757
|
});
|
|
@@ -7740,16 +7786,22 @@ fieldClassName, controlClassName,
|
|
|
7740
7786
|
...selectProps }, ref) => {
|
|
7741
7787
|
const insideField = useInsideField();
|
|
7742
7788
|
const insideControl = useInsideControl();
|
|
7789
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
7790
|
+
label,
|
|
7791
|
+
id: selectProps.id,
|
|
7792
|
+
labelProps,
|
|
7793
|
+
rendersLabel: !insideField,
|
|
7794
|
+
});
|
|
7743
7795
|
const helpClass = usePrefixedClassNames('help', {
|
|
7744
7796
|
[`is-${messageColor}`]: !!messageColor,
|
|
7745
7797
|
});
|
|
7746
|
-
let content = jsxRuntime.jsx(SelectBase, { ref: ref, ...selectProps });
|
|
7798
|
+
let content = jsxRuntime.jsx(SelectBase, { ref: ref, id: controlId, ...selectProps });
|
|
7747
7799
|
if (!insideControl) {
|
|
7748
7800
|
content = (jsxRuntime.jsx(Control, { iconLeft: iconLeft, iconLeftName: iconLeftName, iconLeftSize: iconLeftSize, hasIconsLeft: hasIconsLeft, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
|
|
7749
7801
|
}
|
|
7750
7802
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
7751
7803
|
if (!insideField) {
|
|
7752
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
7804
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
7753
7805
|
}
|
|
7754
7806
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
7755
7807
|
});
|
|
@@ -7785,16 +7837,22 @@ fieldClassName, controlClassName,
|
|
|
7785
7837
|
...textAreaProps }, ref) => {
|
|
7786
7838
|
const insideField = useInsideField();
|
|
7787
7839
|
const insideControl = useInsideControl();
|
|
7840
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
7841
|
+
label,
|
|
7842
|
+
id: textAreaProps.id,
|
|
7843
|
+
labelProps,
|
|
7844
|
+
rendersLabel: !insideField,
|
|
7845
|
+
});
|
|
7788
7846
|
const helpClass = usePrefixedClassNames('help', {
|
|
7789
7847
|
[`is-${messageColor}`]: !!messageColor,
|
|
7790
7848
|
});
|
|
7791
|
-
let content = jsxRuntime.jsx(TextAreaBase, { ref: ref, ...textAreaProps });
|
|
7849
|
+
let content = jsxRuntime.jsx(TextAreaBase, { ref: ref, id: controlId, ...textAreaProps });
|
|
7792
7850
|
if (!insideControl) {
|
|
7793
7851
|
content = (jsxRuntime.jsx(Control, { isLoading: controlIsLoading, size: controlSize, className: controlClassName, children: content }));
|
|
7794
7852
|
}
|
|
7795
7853
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
7796
7854
|
if (!insideField) {
|
|
7797
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
7855
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
7798
7856
|
}
|
|
7799
7857
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
7800
7858
|
});
|
|
@@ -9471,12 +9529,19 @@ DateInputBase.displayName = 'DateInputBase';
|
|
|
9471
9529
|
const DateInput = React.forwardRef(({ label, labelSize, labelProps, horizontal, iconLeft, iconRight, iconLeftName = 'calendar', iconRightName, iconLeftSize, iconRightSize, hasIconsLeft, hasIconsRight, isLoading, isExpanded, controlSize, message, messageColor, fieldClassName, controlClassName, ...baseProps }, ref) => {
|
|
9472
9530
|
const insideField = useInsideField();
|
|
9473
9531
|
const insideControl = useInsideControl();
|
|
9532
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
9533
|
+
label,
|
|
9534
|
+
id: baseProps.id,
|
|
9535
|
+
labelProps,
|
|
9536
|
+
// Inline mode renders a bare calendar with no input to label.
|
|
9537
|
+
rendersLabel: !insideField && !baseProps.inline,
|
|
9538
|
+
});
|
|
9474
9539
|
const helpClass = usePrefixedClassNames('help', {
|
|
9475
9540
|
[`is-${messageColor}`]: !!messageColor,
|
|
9476
9541
|
});
|
|
9477
9542
|
// The right-side launcher is on by default; suppress it while the Control
|
|
9478
9543
|
// shows its loading spinner (also on the right) unless explicitly set.
|
|
9479
|
-
let content = (jsxRuntime.jsx(DateInputBase, { ref: ref, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
9544
|
+
let content = (jsxRuntime.jsx(DateInputBase, { ref: ref, id: controlId, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
9480
9545
|
// Inline mode renders a bare calendar with no input, so the Control's
|
|
9481
9546
|
// icon-left container has nothing to anchor to. Skip the Control wrap.
|
|
9482
9547
|
if (!insideControl && !baseProps.inline) {
|
|
@@ -9484,7 +9549,7 @@ const DateInput = React.forwardRef(({ label, labelSize, labelProps, horizontal,
|
|
|
9484
9549
|
}
|
|
9485
9550
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
9486
9551
|
if (!insideField) {
|
|
9487
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
9552
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
9488
9553
|
}
|
|
9489
9554
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
9490
9555
|
});
|
|
@@ -10555,12 +10620,19 @@ TimeInputBase.displayName = 'TimeInputBase';
|
|
|
10555
10620
|
const TimeInput = React.forwardRef(({ label, labelSize, labelProps, horizontal, iconLeft, iconRight, iconLeftName = 'clock', iconRightName, iconLeftSize, iconRightSize, hasIconsLeft, hasIconsRight, isLoading, isExpanded, controlSize, message, messageColor, fieldClassName, controlClassName, ...baseProps }, ref) => {
|
|
10556
10621
|
const insideField = useInsideField();
|
|
10557
10622
|
const insideControl = useInsideControl();
|
|
10623
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
10624
|
+
label,
|
|
10625
|
+
id: baseProps.id,
|
|
10626
|
+
labelProps,
|
|
10627
|
+
// Inline mode renders a bare panel with no input to label.
|
|
10628
|
+
rendersLabel: !insideField && !baseProps.inline,
|
|
10629
|
+
});
|
|
10558
10630
|
const helpClass = usePrefixedClassNames('help', {
|
|
10559
10631
|
[`is-${messageColor}`]: !!messageColor,
|
|
10560
10632
|
});
|
|
10561
10633
|
// The right-side launcher is on by default; suppress it while the Control
|
|
10562
10634
|
// shows its loading spinner (also on the right) unless explicitly set.
|
|
10563
|
-
let content = (jsxRuntime.jsx(TimeInputBase, { ref: ref, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
10635
|
+
let content = (jsxRuntime.jsx(TimeInputBase, { ref: ref, id: controlId, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
10564
10636
|
// Inline mode renders a bare panel with no input, so the Control's
|
|
10565
10637
|
// icon-left container has nothing to anchor to. Skip the Control wrap.
|
|
10566
10638
|
if (!insideControl && !baseProps.inline) {
|
|
@@ -10568,7 +10640,7 @@ const TimeInput = React.forwardRef(({ label, labelSize, labelProps, horizontal,
|
|
|
10568
10640
|
}
|
|
10569
10641
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
10570
10642
|
if (!insideField) {
|
|
10571
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
10643
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
10572
10644
|
}
|
|
10573
10645
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
10574
10646
|
});
|
|
@@ -10844,12 +10916,19 @@ DateTimeInputBase.displayName = 'DateTimeInputBase';
|
|
|
10844
10916
|
const DateTimeInput = React.forwardRef(({ label, labelSize, labelProps, horizontal, iconLeft, iconRight, iconLeftName = 'calendar-alt', iconRightName, iconLeftSize, iconRightSize, hasIconsLeft, hasIconsRight, isLoading, isExpanded, controlSize, message, messageColor, fieldClassName, controlClassName, ...baseProps }, ref) => {
|
|
10845
10917
|
const insideField = useInsideField();
|
|
10846
10918
|
const insideControl = useInsideControl();
|
|
10919
|
+
const { controlId, fieldLabelProps } = useAutoLabelId({
|
|
10920
|
+
label,
|
|
10921
|
+
id: baseProps.id,
|
|
10922
|
+
labelProps,
|
|
10923
|
+
// Inline mode renders a bare picker with no input to label.
|
|
10924
|
+
rendersLabel: !insideField && !baseProps.inline,
|
|
10925
|
+
});
|
|
10847
10926
|
const helpClass = usePrefixedClassNames('help', {
|
|
10848
10927
|
[`is-${messageColor}`]: !!messageColor,
|
|
10849
10928
|
});
|
|
10850
10929
|
// The right-side launcher is on by default; suppress it while the Control
|
|
10851
10930
|
// shows its loading spinner (also on the right) unless explicitly set.
|
|
10852
|
-
let content = (jsxRuntime.jsx(DateTimeInputBase, { ref: ref, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
10931
|
+
let content = (jsxRuntime.jsx(DateTimeInputBase, { ref: ref, id: controlId, ...baseProps, triggerIcon: baseProps.triggerIcon ?? !isLoading }));
|
|
10853
10932
|
// Inline mode renders a bare picker with no input, so the Control's
|
|
10854
10933
|
// icon-left container has nothing to anchor to. Skip the Control wrap.
|
|
10855
10934
|
if (!insideControl && !baseProps.inline) {
|
|
@@ -10857,7 +10936,7 @@ const DateTimeInput = React.forwardRef(({ label, labelSize, labelProps, horizont
|
|
|
10857
10936
|
}
|
|
10858
10937
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
10859
10938
|
if (!insideField) {
|
|
10860
|
-
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps:
|
|
10939
|
+
return (jsxRuntime.jsxs(Field, { label: label, labelSize: labelSize, labelProps: fieldLabelProps, horizontal: horizontal, className: fieldClassName, children: [content, messageEl] }));
|
|
10861
10940
|
}
|
|
10862
10941
|
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [content, messageEl] }));
|
|
10863
10942
|
});
|