@allxsmith/bestax-bulma 5.6.0 → 5.6.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 +77 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +77 -46
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Navbar.d.ts +1 -0
- package/package.json +7 -2
package/dist/index.cjs.js
CHANGED
|
@@ -1683,8 +1683,12 @@ const Loading = ({ active = false, isFullPage = false, size, color, canCancel =
|
|
|
1683
1683
|
[`is-${size}`]: size,
|
|
1684
1684
|
});
|
|
1685
1685
|
const combinedClasses = classNames(loadingClasses, bulmaHelperClasses, className);
|
|
1686
|
-
const combinedOverlayClasses = classNames('loading-overlay', overlayClassName);
|
|
1686
|
+
const combinedOverlayClasses = classNames(usePrefixedClassNames('loading-overlay'), overlayClassName);
|
|
1687
1687
|
const combinedIconClasses = classNames(iconClasses, iconClassName);
|
|
1688
|
+
const loadingContentClass = usePrefixedClassNames('loading-content');
|
|
1689
|
+
const loadingIconCustomClass = usePrefixedClassNames('loading-icon-custom');
|
|
1690
|
+
const loadingTextClass = usePrefixedClassNames('loading-text');
|
|
1691
|
+
const loadingCancelClass = usePrefixedClassNames('loading-cancel');
|
|
1688
1692
|
const handleOverlayClick = () => {
|
|
1689
1693
|
if (canCancel && onCancel) {
|
|
1690
1694
|
onCancel();
|
|
@@ -1713,7 +1717,7 @@ const Loading = ({ active = false, isFullPage = false, size, color, canCancel =
|
|
|
1713
1717
|
if (!active) {
|
|
1714
1718
|
return null;
|
|
1715
1719
|
}
|
|
1716
|
-
return (jsxRuntime.jsxs("div", { className: combinedClasses, role: "alert", "aria-busy": "true", "aria-label": "Loading", ...rest, children: [jsxRuntime.jsx("div", { className: combinedOverlayClasses, onClick: handleOverlayClick, "aria-hidden": "true" }), jsxRuntime.jsxs("div", { className:
|
|
1720
|
+
return (jsxRuntime.jsxs("div", { className: combinedClasses, role: "alert", "aria-busy": "true", "aria-label": "Loading", ...rest, children: [jsxRuntime.jsx("div", { className: combinedOverlayClasses, onClick: handleOverlayClick, "aria-hidden": "true" }), jsxRuntime.jsxs("div", { className: loadingContentClass, children: [indicator ? (jsxRuntime.jsx("span", { className: loadingIconCustomClass, children: indicator })) : (jsxRuntime.jsx("span", { className: combinedIconClasses })), children && jsxRuntime.jsx("div", { className: loadingTextClass, children: children }), canCancel && (jsxRuntime.jsx("button", { type: "button", className: loadingCancelClass, onClick: onCancel, "aria-label": "Cancel loading", children: "Cancel" }))] })] }));
|
|
1717
1721
|
};
|
|
1718
1722
|
|
|
1719
1723
|
const Collapse = ({ open: controlledOpen, defaultOpen = false, onOpen, onClose, trigger, animation = 'fade', position = 'top', ariaId, bordered, children, className, triggerClassName, contentClassName, ...props }) => {
|
|
@@ -1776,10 +1780,10 @@ const Collapse = ({ open: controlledOpen, defaultOpen = false, onOpen, onClose,
|
|
|
1776
1780
|
'is-bordered': bordered,
|
|
1777
1781
|
});
|
|
1778
1782
|
const combinedClasses = classNames(collapseClasses, bulmaHelperClasses, className);
|
|
1779
|
-
const combinedTriggerClasses = classNames('collapse-trigger', triggerClassName);
|
|
1780
|
-
const combinedContentClasses = classNames('collapse-content',
|
|
1783
|
+
const combinedTriggerClasses = classNames(usePrefixedClassNames('collapse-trigger'), triggerClassName);
|
|
1784
|
+
const combinedContentClasses = classNames(usePrefixedClassNames('collapse-content', {
|
|
1781
1785
|
'is-active': isOpen,
|
|
1782
|
-
});
|
|
1786
|
+
}), contentClassName);
|
|
1783
1787
|
let contentWrapperStyle;
|
|
1784
1788
|
if (animation === 'slide') {
|
|
1785
1789
|
contentWrapperStyle = {
|
|
@@ -1961,10 +1965,14 @@ const Tooltip = ({ label, content, position = 'top', color, size, active: always
|
|
|
1961
1965
|
|
|
1962
1966
|
const Step = ({ isActive = false, isCompleted = false, label, icon, clickable = false, onClick, stepNumber, completedIcon, className, children, ...props }) => {
|
|
1963
1967
|
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
1964
|
-
const stepClasses = classNames('steps-segment', {
|
|
1968
|
+
const stepClasses = classNames(usePrefixedClassNames('steps-segment', {
|
|
1965
1969
|
'is-active': isActive,
|
|
1966
1970
|
'is-completed': isCompleted,
|
|
1967
|
-
}, bulmaHelperClasses, className);
|
|
1971
|
+
}), bulmaHelperClasses, className);
|
|
1972
|
+
const stepsLinkClass = usePrefixedClassNames('steps-link');
|
|
1973
|
+
const stepsMarkerClass = usePrefixedClassNames('steps-marker');
|
|
1974
|
+
const stepsContentClass = usePrefixedClassNames('steps-content');
|
|
1975
|
+
const stepsTitleClass = usePrefixedClassNames('steps-title');
|
|
1968
1976
|
const handleClick = () => {
|
|
1969
1977
|
if (clickable && onClick) {
|
|
1970
1978
|
onClick();
|
|
@@ -1981,7 +1989,7 @@ const Step = ({ isActive = false, isCompleted = false, label, icon, clickable =
|
|
|
1981
1989
|
(isCompleted && resolvedCompletedIcon
|
|
1982
1990
|
? resolvedCompletedIcon
|
|
1983
1991
|
: (stepNumber ?? null));
|
|
1984
|
-
return (jsxRuntime.jsx("li", { className: stepClasses, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: clickable ? 0 : undefined, role: clickable ? 'button' : undefined, "aria-current": isActive ? 'step' : undefined, ...rest, children: jsxRuntime.jsxs("div", { className:
|
|
1992
|
+
return (jsxRuntime.jsx("li", { className: stepClasses, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: clickable ? 0 : undefined, role: clickable ? 'button' : undefined, "aria-current": isActive ? 'step' : undefined, ...rest, children: jsxRuntime.jsxs("div", { className: stepsLinkClass, children: [jsxRuntime.jsx("span", { className: stepsMarkerClass, children: markerContent }), (label || children) && (jsxRuntime.jsx("div", { className: stepsContentClass, children: jsxRuntime.jsx("p", { className: stepsTitleClass, children: label || children }) }))] }) }));
|
|
1985
1993
|
};
|
|
1986
1994
|
const Steps = ({ value = 0, items, size, color, hasMarker = true, animated = true, rounded = true, vertical = false, labelPosition = 'bottom', mobileMode, showStepNumbers = true, hasNavigation = false, prevLabel, nextLabel, onPrev, onNext, onStepClick, className, children, ...props }) => {
|
|
1987
1995
|
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
@@ -1996,9 +2004,14 @@ const Steps = ({ value = 0, items, size, color, hasMarker = true, animated = tru
|
|
|
1996
2004
|
[`is-${mobileMode}`]: mobileMode,
|
|
1997
2005
|
});
|
|
1998
2006
|
const combinedClasses = classNames(stepsClasses, bulmaHelperClasses, className);
|
|
1999
|
-
const listClasses =
|
|
2007
|
+
const listClasses = usePrefixedClassNames('steps-list', {
|
|
2000
2008
|
'is-vertical': vertical,
|
|
2001
2009
|
});
|
|
2010
|
+
const stepsNavigationClass = usePrefixedClassNames('steps-navigation');
|
|
2011
|
+
const prevButtonClass = usePrefixedClassNames('button');
|
|
2012
|
+
const nextButtonClass = usePrefixedClassNames('button', {
|
|
2013
|
+
'is-primary': true,
|
|
2014
|
+
});
|
|
2002
2015
|
const totalSteps = items ? items.length : React.Children.count(children);
|
|
2003
2016
|
const renderSteps = () => {
|
|
2004
2017
|
if (items && items.length > 0) {
|
|
@@ -2021,7 +2034,7 @@ const Steps = ({ value = 0, items, size, color, hasMarker = true, animated = tru
|
|
|
2021
2034
|
}
|
|
2022
2035
|
return null;
|
|
2023
2036
|
};
|
|
2024
|
-
return (jsxRuntime.jsxs("div", { className: combinedClasses, ...rest, children: [jsxRuntime.jsx("ul", { className: listClasses, children: renderSteps() }), hasNavigation && (jsxRuntime.jsxs("div", { className:
|
|
2037
|
+
return (jsxRuntime.jsxs("div", { className: combinedClasses, ...rest, children: [jsxRuntime.jsx("ul", { className: listClasses, children: renderSteps() }), hasNavigation && (jsxRuntime.jsxs("div", { className: stepsNavigationClass, children: [jsxRuntime.jsx("button", { className: prevButtonClass, disabled: value === 0, onClick: onPrev ?? (() => onStepClick?.(value - 1)), children: prevLabel ?? 'Previous' }), jsxRuntime.jsx("button", { className: nextButtonClass, disabled: value === totalSteps - 1, onClick: onNext ?? (() => onStepClick?.(value + 1)), children: nextLabel ?? 'Next' })] }))] }));
|
|
2025
2038
|
};
|
|
2026
2039
|
Steps.Step = Step;
|
|
2027
2040
|
|
|
@@ -2088,16 +2101,16 @@ const SidebarComponent = React.forwardRef(({ isOpen, onClose, position = 'left',
|
|
|
2088
2101
|
[`is-${position}`]: position,
|
|
2089
2102
|
'is-fullwidth': fullWidth,
|
|
2090
2103
|
});
|
|
2091
|
-
const backgroundClass = usePrefixedClassNames('sidebar-background'
|
|
2104
|
+
const backgroundClass = usePrefixedClassNames('sidebar-background', {
|
|
2105
|
+
'is-active': isOpen,
|
|
2106
|
+
});
|
|
2092
2107
|
const contentClass = usePrefixedClassNames('sidebar-content');
|
|
2093
2108
|
const combinedClasses = classNames(sidebarClasses, bulmaHelperClasses, className);
|
|
2094
2109
|
const sidebarStyle = {
|
|
2095
2110
|
...style,
|
|
2096
2111
|
'--bulma-sidebar-width': fullWidth ? '100%' : width,
|
|
2097
2112
|
};
|
|
2098
|
-
const sidebarContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [overlay && (jsxRuntime.jsx("div", { className:
|
|
2099
|
-
'is-active': isOpen,
|
|
2100
|
-
}), onClick: handleOverlayClick, "aria-hidden": "true" })), jsxRuntime.jsx("aside", { ref: combinedRef, className: combinedClasses, style: sidebarStyle, role: "dialog", "aria-modal": overlay ? 'true' : undefined, "aria-hidden": !isOpen, tabIndex: -1, ...rest, children: jsxRuntime.jsx("div", { className: contentClass, children: children }) })] }));
|
|
2113
|
+
const sidebarContent = (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [overlay && (jsxRuntime.jsx("div", { className: backgroundClass, onClick: handleOverlayClick, "aria-hidden": "true" })), jsxRuntime.jsx("aside", { ref: combinedRef, className: combinedClasses, style: sidebarStyle, role: "dialog", "aria-modal": overlay ? 'true' : undefined, "aria-hidden": !isOpen, tabIndex: -1, ...rest, children: jsxRuntime.jsx("div", { className: contentClass, children: children }) })] }));
|
|
2101
2114
|
if (inline) {
|
|
2102
2115
|
return sidebarContent;
|
|
2103
2116
|
}
|
|
@@ -2202,6 +2215,12 @@ const Toast = React.forwardRef(({ message, type = 'default', actionType, positio
|
|
|
2202
2215
|
'is-rounded': rounded,
|
|
2203
2216
|
});
|
|
2204
2217
|
const combinedClasses = classNames(toastClasses, bulmaHelperClasses, className);
|
|
2218
|
+
const toastMessageClass = usePrefixedClassNames('toast-message');
|
|
2219
|
+
const toastActionsClass = usePrefixedClassNames('toast-actions');
|
|
2220
|
+
const toastCancelClass = usePrefixedClassNames('toast-cancel');
|
|
2221
|
+
const toastActionClass = usePrefixedClassNames('toast-action');
|
|
2222
|
+
const toastButtonClass = usePrefixedClassNames('button');
|
|
2223
|
+
const toastCloseClass = usePrefixedClassNames('delete', 'is-small');
|
|
2205
2224
|
if (!isVisible) {
|
|
2206
2225
|
return null;
|
|
2207
2226
|
}
|
|
@@ -2223,13 +2242,13 @@ const Toast = React.forwardRef(({ message, type = 'default', actionType, positio
|
|
|
2223
2242
|
ref.current = node;
|
|
2224
2243
|
}
|
|
2225
2244
|
};
|
|
2226
|
-
const toastElement = (jsxRuntime.jsxs("div", { ref: setRef, className: combinedClasses, role: "alert", "aria-live": type === 'danger' || type === 'warning' ? 'assertive' : 'polite', onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: dismissible ? handleClose : undefined, ...rest, children: [jsxRuntime.jsx("span", { className:
|
|
2245
|
+
const toastElement = (jsxRuntime.jsxs("div", { ref: setRef, className: combinedClasses, role: "alert", "aria-live": type === 'danger' || type === 'warning' ? 'assertive' : 'polite', onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onClick: dismissible ? handleClose : undefined, ...rest, children: [jsxRuntime.jsx("span", { className: toastMessageClass, children: message }), (cancelText || actionText) && (jsxRuntime.jsxs("div", { className: toastActionsClass, children: [cancelText && (jsxRuntime.jsx("span", { className: toastCancelClass, children: jsxRuntime.jsx("button", { type: "button", className: toastButtonClass, onClick: e => {
|
|
2227
2246
|
e.stopPropagation();
|
|
2228
2247
|
handleClose();
|
|
2229
|
-
}, children: cancelText }) })), actionText && (jsxRuntime.jsx("span", { className:
|
|
2248
|
+
}, children: cancelText }) })), actionText && (jsxRuntime.jsx("span", { className: toastActionClass, children: jsxRuntime.jsx("button", { type: "button", className: toastButtonClass, onClick: e => {
|
|
2230
2249
|
e.stopPropagation();
|
|
2231
2250
|
handleAction();
|
|
2232
|
-
}, children: actionText }) }))] })), closable && (jsxRuntime.jsx("button", { type: "button", className:
|
|
2251
|
+
}, children: actionText }) }))] })), closable && (jsxRuntime.jsx("button", { type: "button", className: toastCloseClass, onClick: e => {
|
|
2233
2252
|
e.stopPropagation();
|
|
2234
2253
|
handleClose();
|
|
2235
2254
|
}, "aria-label": "Close" }))] }));
|
|
@@ -2510,9 +2529,7 @@ const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWi
|
|
|
2510
2529
|
};
|
|
2511
2530
|
|
|
2512
2531
|
const CarouselItem = React.forwardRef(({ active, className, children, ...props }, ref) => {
|
|
2513
|
-
const itemClasses = classNames('carousel-item',
|
|
2514
|
-
'is-active': active,
|
|
2515
|
-
});
|
|
2532
|
+
const itemClasses = classNames(usePrefixedClassNames('carousel-item', { 'is-active': active }), className);
|
|
2516
2533
|
return (jsxRuntime.jsx("div", { ref: ref, className: itemClasses, ...props, children: children }));
|
|
2517
2534
|
});
|
|
2518
2535
|
CarouselItem.displayName = 'CarouselItem';
|
|
@@ -2698,6 +2715,15 @@ const Carousel = React.forwardRef(({ value: controlledValue, autoplay = false, i
|
|
|
2698
2715
|
[`is-indicator-${indicatorStyle}`]: indicatorStyle !== 'dots',
|
|
2699
2716
|
[`is-arrow-${arrowColor}`]: !!arrowColor,
|
|
2700
2717
|
});
|
|
2718
|
+
const classPrefix = useClassPrefix();
|
|
2719
|
+
const carouselContainerClass = usePrefixedClassNames('carousel-container');
|
|
2720
|
+
const carouselSlidesClass = usePrefixedClassNames('carousel-slides');
|
|
2721
|
+
const carouselArrowPrevClass = usePrefixedClassNames('carousel-arrow', 'is-prev', { 'is-transparent': !arrowBackground });
|
|
2722
|
+
const carouselArrowNextClass = usePrefixedClassNames('carousel-arrow', 'is-next', { 'is-transparent': !arrowBackground });
|
|
2723
|
+
const carouselIndicatorClass = usePrefixedClassNames('carousel-indicator', {
|
|
2724
|
+
'is-inside': indicatorInside,
|
|
2725
|
+
'is-top': indicatorPosition === 'top',
|
|
2726
|
+
});
|
|
2701
2727
|
const combinedClasses = classNames(carouselClasses, bulmaHelperClasses, className);
|
|
2702
2728
|
const renderSlides = () => {
|
|
2703
2729
|
const slides = items.map((item, index) => {
|
|
@@ -2728,22 +2754,15 @@ const Carousel = React.forwardRef(({ value: controlledValue, autoplay = false, i
|
|
|
2728
2754
|
}
|
|
2729
2755
|
return slides;
|
|
2730
2756
|
};
|
|
2731
|
-
return (jsxRuntime.jsxs("div", { ref: combinedRef, className: combinedClasses, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, ...rest, children: [jsxRuntime.jsxs("div", { ref: containerRef, className:
|
|
2757
|
+
return (jsxRuntime.jsxs("div", { ref: combinedRef, className: combinedClasses, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, ...rest, children: [jsxRuntime.jsxs("div", { ref: containerRef, className: carouselContainerClass, onMouseDown: hasDrag ? handleMouseDown : undefined, onMouseMove: hasDrag && isDragging ? handleMouseMove : undefined, onMouseUp: hasDrag ? handleMouseUp : undefined, onMouseLeave: hasDrag ? handleMouseUp : undefined, onTouchStart: hasDrag ? handleTouchStart : undefined, onTouchMove: hasDrag ? handleTouchMove : undefined, onTouchEnd: hasDrag ? handleTouchEnd : undefined, style: {
|
|
2732
2758
|
transform: isDragging ? `translateX(${dragOffset}px)` : undefined,
|
|
2733
2759
|
cursor: hasDrag ? (isDragging ? 'grabbing' : 'grab') : undefined,
|
|
2734
|
-
}, children: [jsxRuntime.jsx("div", { className:
|
|
2760
|
+
}, children: [jsxRuntime.jsx("div", { className: carouselSlidesClass, style: {
|
|
2735
2761
|
transform: `translateX(-${(repeat && itemCount > 1 ? displayIndex + 1 : displayIndex) * 100}%)`,
|
|
2736
2762
|
transition: isDragging || skipTransition
|
|
2737
2763
|
? 'none'
|
|
2738
2764
|
: 'transform 0.3s ease-in-out',
|
|
2739
|
-
}, onTransitionEnd: handleTransitionEnd, children: renderSlides() }), arrow && itemCount > 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button, { className:
|
|
2740
|
-
'is-transparent': !arrowBackground,
|
|
2741
|
-
}), onClick: goToPrev, isDisabled: !canGoPrev, "aria-label": "Previous slide", children: iconPrev ? (jsxRuntime.jsx(Icon, { name: iconPrev, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsxRuntime.jsx(DefaultPrevIcon, {})) }), jsxRuntime.jsx(Button, { className: classNames('carousel-arrow is-next', {
|
|
2742
|
-
'is-transparent': !arrowBackground,
|
|
2743
|
-
}), onClick: goToNext, isDisabled: !canGoNext, "aria-label": "Next slide", children: iconNext ? (jsxRuntime.jsx(Icon, { name: iconNext, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsxRuntime.jsx(DefaultNextIcon, {})) })] }))] }), indicator && itemCount > 1 && (jsxRuntime.jsx("div", { className: classNames('carousel-indicator', {
|
|
2744
|
-
'is-inside': indicatorInside,
|
|
2745
|
-
'is-top': indicatorPosition === 'top',
|
|
2746
|
-
}), role: "tablist", children: items.map((_, index) => (jsxRuntime.jsx(Button, { className: classNames('indicator-item', {
|
|
2765
|
+
}, onTransitionEnd: handleTransitionEnd, children: renderSlides() }), arrow && itemCount > 1 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Button, { className: carouselArrowPrevClass, onClick: goToPrev, isDisabled: !canGoPrev, "aria-label": "Previous slide", children: iconPrev ? (jsxRuntime.jsx(Icon, { name: iconPrev, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsxRuntime.jsx(DefaultPrevIcon, {})) }), jsxRuntime.jsx(Button, { className: carouselArrowNextClass, onClick: goToNext, isDisabled: !canGoNext, "aria-label": "Next slide", children: iconNext ? (jsxRuntime.jsx(Icon, { name: iconNext, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsxRuntime.jsx(DefaultNextIcon, {})) })] }))] }), indicator && itemCount > 1 && (jsxRuntime.jsx("div", { className: carouselIndicatorClass, role: "tablist", children: items.map((_, index) => (jsxRuntime.jsx(Button, { className: prefixedClassNames(classPrefix, 'indicator-item', {
|
|
2747
2766
|
'is-active': index === activeIndex,
|
|
2748
2767
|
}), onClick: () => goToSlide(index), role: "tab", "aria-selected": index === activeIndex, "aria-label": `Go to slide ${index + 1}` }, index))) }))] }));
|
|
2749
2768
|
});
|
|
@@ -3467,7 +3486,9 @@ const Checkbox = React.forwardRef(({ color, size, className, children, textColor
|
|
|
3467
3486
|
[`is-${size}`]: size && checkboxSizes.includes(size),
|
|
3468
3487
|
});
|
|
3469
3488
|
const checkboxClass = classNames(mainClass, bulmaHelperClasses, className);
|
|
3470
|
-
|
|
3489
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3490
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3491
|
+
return (jsxRuntime.jsxs("label", { className: checkboxClass, children: [jsxRuntime.jsx("input", { ref: ref, type: "checkbox", disabled: disabled, name: effectiveName, value: value, checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, onChange: handleChange, ...rest }), jsxRuntime.jsx("span", { className: checkClass }), children && jsxRuntime.jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3471
3492
|
});
|
|
3472
3493
|
Checkbox.displayName = 'Checkbox';
|
|
3473
3494
|
|
|
@@ -3696,7 +3717,9 @@ const Radio = React.forwardRef(({ color, size, className, children, textColor, d
|
|
|
3696
3717
|
[`is-${size}`]: size && radioSizes.includes(size),
|
|
3697
3718
|
});
|
|
3698
3719
|
const radioClass = classNames(mainClass, bulmaHelperClasses, className);
|
|
3699
|
-
|
|
3720
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3721
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3722
|
+
return (jsxRuntime.jsxs("label", { className: radioClass, children: [jsxRuntime.jsx("input", { ref: ref, type: "radio", disabled: disabled, name: effectiveName, value: value, checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, onChange: handleChange, ...rest }), jsxRuntime.jsx("span", { className: checkClass }), children && jsxRuntime.jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3700
3723
|
});
|
|
3701
3724
|
Radio.displayName = 'Radio';
|
|
3702
3725
|
|
|
@@ -3760,7 +3783,9 @@ const Switch = React.forwardRef(({ color, size, isRounded, isThin, isOutlined, i
|
|
|
3760
3783
|
[`is-${passiveType}-passive`]: passiveType && switchColors.includes(passiveType),
|
|
3761
3784
|
});
|
|
3762
3785
|
const labelClasses = classNames(switchClasses, bulmaHelperClasses, className);
|
|
3763
|
-
|
|
3786
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3787
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3788
|
+
return (jsxRuntime.jsxs("label", { className: labelClasses, children: [jsxRuntime.jsx("input", { ref: ref, type: "checkbox", disabled: disabled, ...rest }), jsxRuntime.jsx("span", { className: checkClass }), children && jsxRuntime.jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3764
3789
|
});
|
|
3765
3790
|
Switch.displayName = 'Switch';
|
|
3766
3791
|
|
|
@@ -3928,6 +3953,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
3928
3953
|
}
|
|
3929
3954
|
return isCircle ? px * 1.2 : px;
|
|
3930
3955
|
};
|
|
3956
|
+
const classPrefix = useClassPrefix();
|
|
3931
3957
|
const sliderClasses = usePrefixedClassNames('slider', {
|
|
3932
3958
|
[`is-${size}`]: size,
|
|
3933
3959
|
[`is-${color}`]: color,
|
|
@@ -4032,24 +4058,24 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
4032
4058
|
const renderTicks = () => {
|
|
4033
4059
|
if (tickPositions.length === 0)
|
|
4034
4060
|
return null;
|
|
4035
|
-
return (jsxRuntime.jsx("div", { className:
|
|
4061
|
+
return (jsxRuntime.jsx("div", { className: prefixedClassNames(classPrefix, 'slider-ticks'), children: tickPositions.map((tick, i) => {
|
|
4036
4062
|
const pct = ((tick.value - min) / (max - min)) * 100;
|
|
4037
4063
|
const posStyle = isVertical
|
|
4038
4064
|
? { bottom: `${pct}%` }
|
|
4039
4065
|
: { left: `${pct}%` };
|
|
4040
4066
|
const isEndpoint = tick.value === min || tick.value === max;
|
|
4041
|
-
return (jsxRuntime.jsx("span", { className:
|
|
4067
|
+
return (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'slider-tick', {
|
|
4042
4068
|
'is-endpoint': isEndpoint,
|
|
4043
|
-
}), style: posStyle, children: tick.label !== undefined && (jsxRuntime.jsx("span", { className:
|
|
4069
|
+
}), style: posStyle, children: tick.label !== undefined && (jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'slider-tick-label'), children: tick.label })) }, i));
|
|
4044
4070
|
}) }));
|
|
4045
4071
|
};
|
|
4046
4072
|
const helpClass = usePrefixedClassNames('help', {
|
|
4047
4073
|
[`is-${messageColor}`]: !!messageColor,
|
|
4048
4074
|
});
|
|
4049
4075
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
4050
|
-
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:
|
|
4076
|
+
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: {
|
|
4051
4077
|
'--slider-progress': `${progressSingle}%`,
|
|
4052
|
-
}, "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:
|
|
4078
|
+
}, "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', {
|
|
4053
4079
|
'is-visible': showTipLow,
|
|
4054
4080
|
'is-flipped': flipped,
|
|
4055
4081
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4069,7 +4095,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
4069
4095
|
left: getThumbLeft(progressSingle),
|
|
4070
4096
|
transform: `translateX(calc(-50% + ${nudgeX}px))`,
|
|
4071
4097
|
'--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,
|
|
4072
|
-
}, children: formatValue(currentSingle) })), renderTicks()] })) : (jsxRuntime.jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsxRuntime.jsx("div", { className:
|
|
4098
|
+
}, children: formatValue(currentSingle) })), renderTicks()] })) : (jsxRuntime.jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsxRuntime.jsx("div", { className: prefixedClassNames(classPrefix, 'slider-track'), style: isVertical
|
|
4073
4099
|
? {
|
|
4074
4100
|
'--slider-progress-low': `${progressLow}%`,
|
|
4075
4101
|
'--slider-progress-high': `${progressHigh}%`,
|
|
@@ -4077,7 +4103,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
4077
4103
|
: {
|
|
4078
4104
|
'--slider-progress-low': `${progressLow}%`,
|
|
4079
4105
|
'--slider-progress-high': `${progressHigh}%`,
|
|
4080
|
-
} }), 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:
|
|
4106
|
+
} }), 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', {
|
|
4081
4107
|
'is-visible': showTipLow,
|
|
4082
4108
|
'is-flipped': flipped,
|
|
4083
4109
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4097,7 +4123,7 @@ const Slider = React.forwardRef((props, ref) => {
|
|
|
4097
4123
|
left: getThumbLeft(progressLow),
|
|
4098
4124
|
transform: `translateX(calc(-50% + ${nudgeX}px))`,
|
|
4099
4125
|
'--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,
|
|
4100
|
-
}, children: formatValue(currentRange[0]) })), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputHighRef, className:
|
|
4126
|
+
}, children: formatValue(currentRange[0]) })), tooltipMode !== 'hidden' && (jsxRuntime.jsx("output", { ref: outputHighRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-high', {
|
|
4101
4127
|
'is-visible': showTipHigh,
|
|
4102
4128
|
'is-flipped': flippedHigh,
|
|
4103
4129
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4383,6 +4409,7 @@ const Rate = React.forwardRef(({ label, labelSize, labelProps, horizontal, messa
|
|
|
4383
4409
|
}
|
|
4384
4410
|
return currentValue;
|
|
4385
4411
|
};
|
|
4412
|
+
const classPrefix = useClassPrefix();
|
|
4386
4413
|
const rateClasses = usePrefixedClassNames('rate', {
|
|
4387
4414
|
[`is-${size}`]: size,
|
|
4388
4415
|
'is-disabled': disabled,
|
|
@@ -4419,9 +4446,9 @@ const Rate = React.forwardRef(({ label, labelSize, labelProps, horizontal, messa
|
|
|
4419
4446
|
return customIcon(iconProps);
|
|
4420
4447
|
}
|
|
4421
4448
|
if (iconName) {
|
|
4422
|
-
return (jsxRuntime.jsxs("span", { className:
|
|
4449
|
+
return (jsxRuntime.jsxs("span", { className: prefixedClassNames(classPrefix, 'rate-icon-partial'), style: {
|
|
4423
4450
|
'--rate-fill-percent': `${fillPercent}%`,
|
|
4424
|
-
}, children: [jsxRuntime.jsx("span", { className:
|
|
4451
|
+
}, children: [jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'rate-icon-bg'), children: jsxRuntime.jsx(Icon, { name: iconName, library: resolvedLibrary, variant: iconVariant, features: iconFeatures }) }), jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'rate-icon-fg'), children: jsxRuntime.jsx(Icon, { name: iconName, library: resolvedLibrary, variant: iconVariant, features: iconFeatures }) })] }));
|
|
4425
4452
|
}
|
|
4426
4453
|
const clipId = `rate-clip-${iconIndex}`;
|
|
4427
4454
|
return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": "true", children: [jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", { id: clipId, children: jsxRuntime.jsx("rect", { x: "0", y: "0", width: `${(fillPercent / 100) * 24}`, height: "24" }) }) }), jsxRuntime.jsx("path", { fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", d: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" }), jsxRuntime.jsx("path", { clipPath: `url(#${clipId})`, fill: "currentColor", d: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" })] }));
|
|
@@ -4437,7 +4464,7 @@ const Rate = React.forwardRef(({ label, labelSize, labelProps, horizontal, messa
|
|
|
4437
4464
|
const icon = isPartial
|
|
4438
4465
|
? renderPartialIcon(iconIndex, fillPercent)
|
|
4439
4466
|
: renderIcon(iconIndex, isActive, fillPercent);
|
|
4440
|
-
icons.push(jsxRuntime.jsx("span", { className:
|
|
4467
|
+
icons.push(jsxRuntime.jsx("span", { className: prefixedClassNames(classPrefix, 'rate-item', {
|
|
4441
4468
|
'is-active': isActive,
|
|
4442
4469
|
'is-hovered': isHovered,
|
|
4443
4470
|
}), onClick: e => handleClick(iconIndex, e), onMouseEnter: () => handleMouseEnter(iconIndex), onMouseMove: e => handleMouseMove(iconIndex, e), onMouseLeave: handleMouseLeave, role: "radio", "aria-checked": currentValue === iconIndex + 1 ||
|
|
@@ -4455,7 +4482,11 @@ const Rate = React.forwardRef(({ label, labelSize, labelProps, horizontal, messa
|
|
|
4455
4482
|
[`is-${messageColor}`]: !!messageColor,
|
|
4456
4483
|
});
|
|
4457
4484
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
4458
|
-
const
|
|
4485
|
+
const rateItemsClass = usePrefixedClassNames('rate-items');
|
|
4486
|
+
const rateScoreClass = usePrefixedClassNames('rate-score');
|
|
4487
|
+
const rateTextClass = usePrefixedClassNames('rate-text');
|
|
4488
|
+
const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');
|
|
4489
|
+
const rateElement = (jsxRuntime.jsxs("div", { ref: ref, className: combinedClasses, role: "radiogroup", "aria-label": "Rating", "aria-valuenow": currentValue, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuetext": ariaValueText, tabIndex: disabled ? -1 : 0, onKeyDown: handleKeyDown, ...rest, children: [jsxRuntime.jsx("div", { className: rateItemsClass, children: renderIcons() }), showScore && (jsxRuntime.jsx("span", { className: rateScoreClass, children: getScoreDisplay() })), text && jsxRuntime.jsx("span", { className: rateTextClass, children: text }), customText && (jsxRuntime.jsx("span", { className: rateCustomTextClass, children: customText })), name && (jsxRuntime.jsx("input", { type: "hidden", name: name, value: currentValue, form: form }))] }));
|
|
4459
4490
|
let content = rateElement;
|
|
4460
4491
|
if (!insideControl) {
|
|
4461
4492
|
content = jsxRuntime.jsx(Control, { children: content });
|
|
@@ -4916,7 +4947,7 @@ const Taginput = React.forwardRef(({ label, labelSize, labelProps, horizontal, m
|
|
|
4916
4947
|
const messageEl = message ? jsxRuntime.jsx("p", { className: helpClass, children: message }) : null;
|
|
4917
4948
|
const taginputElement = (jsxRuntime.jsxs("div", { ref: containerRef, className: combinedClasses, onClick: handleContainerClick, ...rest, children: [jsxRuntime.jsxs("div", { className: containerClasses, children: [icon && (jsxRuntime.jsx(Icon, { name: icon, library: resolvedLibrary, variant: iconVariant, features: iconFeatures, containerClassName: pcn('icon', 'is-left') })), jsxRuntime.jsxs("div", { className: tagsClasses, children: [tags.map((tag, index) => {
|
|
4918
4949
|
const displayVal = getDisplayValue(tag);
|
|
4919
|
-
return (jsxRuntime.jsxs("span", { className: tagClasses, children: [tagTemplate ? (tagTemplate(tag)) : ellipsis ? (jsxRuntime.jsx("span", { title: displayVal, children: displayVal })) : (displayVal), closable && !disabled && !readonly && (jsxRuntime.jsx("button", { type: "button", className:
|
|
4950
|
+
return (jsxRuntime.jsxs("span", { className: tagClasses, children: [tagTemplate ? (tagTemplate(tag)) : ellipsis ? (jsxRuntime.jsx("span", { title: displayVal, children: displayVal })) : (displayVal), closable && !disabled && !readonly && (jsxRuntime.jsx("button", { type: "button", className: pcn('delete', 'is-small'), onClick: e => {
|
|
4920
4951
|
e.stopPropagation();
|
|
4921
4952
|
removeTag(index);
|
|
4922
4953
|
}, "aria-label": ariaCloseLabel || `Remove ${displayVal}` }))] }, index));
|