@allxsmith/bestax-bulma 5.5.0 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +90 -53
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +90 -53
- package/dist/index.esm.js.map +1 -1
- package/dist/types/columns/Columns.d.ts +8 -1
- package/dist/types/grid/Grid.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -680,7 +680,13 @@ const Column = ({ className, textColor, color: _fieldColor, bgColor, size, sizeM
|
|
|
680
680
|
return (jsx("div", { className: columnClasses, ...rest, children: children }));
|
|
681
681
|
};
|
|
682
682
|
|
|
683
|
-
const Columns = ({ className, textColor, color: _fieldColor, bgColor, isCentered, isGapless, isMultiline, isVCentered, isMobile, isDesktop, gapSize, gapSizeMobile, gapSizeTablet, gapSizeDesktop, gapSizeWidescreen, gapSizeFullhd, children, ...props }) => {
|
|
683
|
+
const Columns = ({ className, textColor, color: _fieldColor, bgColor, isCentered, isGapless, isMultiline, isVCentered, isMobile, isDesktop, gap, gapMobile, gapTablet, gapDesktop, gapWidescreen, gapFullhd, gapSize, gapSizeMobile, gapSizeTablet, gapSizeDesktop, gapSizeWidescreen, gapSizeFullhd, children, ...props }) => {
|
|
684
|
+
const resolvedGap = gap ?? gapSize;
|
|
685
|
+
const resolvedGapMobile = gapMobile ?? gapSizeMobile;
|
|
686
|
+
const resolvedGapTablet = gapTablet ?? gapSizeTablet;
|
|
687
|
+
const resolvedGapDesktop = gapDesktop ?? gapSizeDesktop;
|
|
688
|
+
const resolvedGapWidescreen = gapWidescreen ?? gapSizeWidescreen;
|
|
689
|
+
const resolvedGapFullhd = gapFullhd ?? gapSizeFullhd;
|
|
684
690
|
const { bulmaHelperClasses, rest } = useBulmaClasses({
|
|
685
691
|
color: textColor,
|
|
686
692
|
backgroundColor: bgColor,
|
|
@@ -688,12 +694,12 @@ const Columns = ({ className, textColor, color: _fieldColor, bgColor, isCentered
|
|
|
688
694
|
});
|
|
689
695
|
const mainClass = usePrefixedClassNames('columns');
|
|
690
696
|
const gapClasses = usePrefixedClassNames('', {
|
|
691
|
-
[`is-${
|
|
692
|
-
[`is-${
|
|
693
|
-
[`is-${
|
|
694
|
-
[`is-${
|
|
695
|
-
[`is-${
|
|
696
|
-
[`is-${
|
|
697
|
+
[`is-${resolvedGap}`]: resolvedGap !== undefined && resolvedGap !== null,
|
|
698
|
+
[`is-${resolvedGapMobile}-mobile`]: resolvedGapMobile !== undefined && resolvedGapMobile !== null,
|
|
699
|
+
[`is-${resolvedGapTablet}-tablet`]: resolvedGapTablet !== undefined && resolvedGapTablet !== null,
|
|
700
|
+
[`is-${resolvedGapDesktop}-desktop`]: resolvedGapDesktop !== undefined && resolvedGapDesktop !== null,
|
|
701
|
+
[`is-${resolvedGapWidescreen}-widescreen`]: resolvedGapWidescreen !== undefined && resolvedGapWidescreen !== null,
|
|
702
|
+
[`is-${resolvedGapFullhd}-fullhd`]: resolvedGapFullhd !== undefined && resolvedGapFullhd !== null,
|
|
697
703
|
'is-centered': !!isCentered,
|
|
698
704
|
'is-gapless': !!isGapless,
|
|
699
705
|
'is-multiline': !!isMultiline,
|
|
@@ -1675,8 +1681,12 @@ const Loading = ({ active = false, isFullPage = false, size, color, canCancel =
|
|
|
1675
1681
|
[`is-${size}`]: size,
|
|
1676
1682
|
});
|
|
1677
1683
|
const combinedClasses = classNames(loadingClasses, bulmaHelperClasses, className);
|
|
1678
|
-
const combinedOverlayClasses = classNames('loading-overlay', overlayClassName);
|
|
1684
|
+
const combinedOverlayClasses = classNames(usePrefixedClassNames('loading-overlay'), overlayClassName);
|
|
1679
1685
|
const combinedIconClasses = classNames(iconClasses, iconClassName);
|
|
1686
|
+
const loadingContentClass = usePrefixedClassNames('loading-content');
|
|
1687
|
+
const loadingIconCustomClass = usePrefixedClassNames('loading-icon-custom');
|
|
1688
|
+
const loadingTextClass = usePrefixedClassNames('loading-text');
|
|
1689
|
+
const loadingCancelClass = usePrefixedClassNames('loading-cancel');
|
|
1680
1690
|
const handleOverlayClick = () => {
|
|
1681
1691
|
if (canCancel && onCancel) {
|
|
1682
1692
|
onCancel();
|
|
@@ -1705,7 +1715,7 @@ const Loading = ({ active = false, isFullPage = false, size, color, canCancel =
|
|
|
1705
1715
|
if (!active) {
|
|
1706
1716
|
return null;
|
|
1707
1717
|
}
|
|
1708
|
-
return (jsxs("div", { className: combinedClasses, role: "alert", "aria-busy": "true", "aria-label": "Loading", ...rest, children: [jsx("div", { className: combinedOverlayClasses, onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { className:
|
|
1718
|
+
return (jsxs("div", { className: combinedClasses, role: "alert", "aria-busy": "true", "aria-label": "Loading", ...rest, children: [jsx("div", { className: combinedOverlayClasses, onClick: handleOverlayClick, "aria-hidden": "true" }), jsxs("div", { className: loadingContentClass, children: [indicator ? (jsx("span", { className: loadingIconCustomClass, children: indicator })) : (jsx("span", { className: combinedIconClasses })), children && jsx("div", { className: loadingTextClass, children: children }), canCancel && (jsx("button", { type: "button", className: loadingCancelClass, onClick: onCancel, "aria-label": "Cancel loading", children: "Cancel" }))] })] }));
|
|
1709
1719
|
};
|
|
1710
1720
|
|
|
1711
1721
|
const Collapse = ({ open: controlledOpen, defaultOpen = false, onOpen, onClose, trigger, animation = 'fade', position = 'top', ariaId, bordered, children, className, triggerClassName, contentClassName, ...props }) => {
|
|
@@ -1768,10 +1778,10 @@ const Collapse = ({ open: controlledOpen, defaultOpen = false, onOpen, onClose,
|
|
|
1768
1778
|
'is-bordered': bordered,
|
|
1769
1779
|
});
|
|
1770
1780
|
const combinedClasses = classNames(collapseClasses, bulmaHelperClasses, className);
|
|
1771
|
-
const combinedTriggerClasses = classNames('collapse-trigger', triggerClassName);
|
|
1772
|
-
const combinedContentClasses = classNames('collapse-content',
|
|
1781
|
+
const combinedTriggerClasses = classNames(usePrefixedClassNames('collapse-trigger'), triggerClassName);
|
|
1782
|
+
const combinedContentClasses = classNames(usePrefixedClassNames('collapse-content', {
|
|
1773
1783
|
'is-active': isOpen,
|
|
1774
|
-
});
|
|
1784
|
+
}), contentClassName);
|
|
1775
1785
|
let contentWrapperStyle;
|
|
1776
1786
|
if (animation === 'slide') {
|
|
1777
1787
|
contentWrapperStyle = {
|
|
@@ -1953,10 +1963,14 @@ const Tooltip = ({ label, content, position = 'top', color, size, active: always
|
|
|
1953
1963
|
|
|
1954
1964
|
const Step = ({ isActive = false, isCompleted = false, label, icon, clickable = false, onClick, stepNumber, completedIcon, className, children, ...props }) => {
|
|
1955
1965
|
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
1956
|
-
const stepClasses = classNames('steps-segment', {
|
|
1966
|
+
const stepClasses = classNames(usePrefixedClassNames('steps-segment', {
|
|
1957
1967
|
'is-active': isActive,
|
|
1958
1968
|
'is-completed': isCompleted,
|
|
1959
|
-
}, bulmaHelperClasses, className);
|
|
1969
|
+
}), bulmaHelperClasses, className);
|
|
1970
|
+
const stepsLinkClass = usePrefixedClassNames('steps-link');
|
|
1971
|
+
const stepsMarkerClass = usePrefixedClassNames('steps-marker');
|
|
1972
|
+
const stepsContentClass = usePrefixedClassNames('steps-content');
|
|
1973
|
+
const stepsTitleClass = usePrefixedClassNames('steps-title');
|
|
1960
1974
|
const handleClick = () => {
|
|
1961
1975
|
if (clickable && onClick) {
|
|
1962
1976
|
onClick();
|
|
@@ -1973,7 +1987,7 @@ const Step = ({ isActive = false, isCompleted = false, label, icon, clickable =
|
|
|
1973
1987
|
(isCompleted && resolvedCompletedIcon
|
|
1974
1988
|
? resolvedCompletedIcon
|
|
1975
1989
|
: (stepNumber ?? null));
|
|
1976
|
-
return (jsx("li", { className: stepClasses, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: clickable ? 0 : undefined, role: clickable ? 'button' : undefined, "aria-current": isActive ? 'step' : undefined, ...rest, children: jsxs("div", { className:
|
|
1990
|
+
return (jsx("li", { className: stepClasses, onClick: handleClick, onKeyDown: handleKeyDown, tabIndex: clickable ? 0 : undefined, role: clickable ? 'button' : undefined, "aria-current": isActive ? 'step' : undefined, ...rest, children: jsxs("div", { className: stepsLinkClass, children: [jsx("span", { className: stepsMarkerClass, children: markerContent }), (label || children) && (jsx("div", { className: stepsContentClass, children: jsx("p", { className: stepsTitleClass, children: label || children }) }))] }) }));
|
|
1977
1991
|
};
|
|
1978
1992
|
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 }) => {
|
|
1979
1993
|
const { bulmaHelperClasses, rest } = useBulmaClasses(props);
|
|
@@ -1988,9 +2002,14 @@ const Steps = ({ value = 0, items, size, color, hasMarker = true, animated = tru
|
|
|
1988
2002
|
[`is-${mobileMode}`]: mobileMode,
|
|
1989
2003
|
});
|
|
1990
2004
|
const combinedClasses = classNames(stepsClasses, bulmaHelperClasses, className);
|
|
1991
|
-
const listClasses =
|
|
2005
|
+
const listClasses = usePrefixedClassNames('steps-list', {
|
|
1992
2006
|
'is-vertical': vertical,
|
|
1993
2007
|
});
|
|
2008
|
+
const stepsNavigationClass = usePrefixedClassNames('steps-navigation');
|
|
2009
|
+
const prevButtonClass = usePrefixedClassNames('button');
|
|
2010
|
+
const nextButtonClass = usePrefixedClassNames('button', {
|
|
2011
|
+
'is-primary': true,
|
|
2012
|
+
});
|
|
1994
2013
|
const totalSteps = items ? items.length : React.Children.count(children);
|
|
1995
2014
|
const renderSteps = () => {
|
|
1996
2015
|
if (items && items.length > 0) {
|
|
@@ -2013,7 +2032,7 @@ const Steps = ({ value = 0, items, size, color, hasMarker = true, animated = tru
|
|
|
2013
2032
|
}
|
|
2014
2033
|
return null;
|
|
2015
2034
|
};
|
|
2016
|
-
return (jsxs("div", { className: combinedClasses, ...rest, children: [jsx("ul", { className: listClasses, children: renderSteps() }), hasNavigation && (jsxs("div", { className:
|
|
2035
|
+
return (jsxs("div", { className: combinedClasses, ...rest, children: [jsx("ul", { className: listClasses, children: renderSteps() }), hasNavigation && (jsxs("div", { className: stepsNavigationClass, children: [jsx("button", { className: prevButtonClass, disabled: value === 0, onClick: onPrev ?? (() => onStepClick?.(value - 1)), children: prevLabel ?? 'Previous' }), jsx("button", { className: nextButtonClass, disabled: value === totalSteps - 1, onClick: onNext ?? (() => onStepClick?.(value + 1)), children: nextLabel ?? 'Next' })] }))] }));
|
|
2017
2036
|
};
|
|
2018
2037
|
Steps.Step = Step;
|
|
2019
2038
|
|
|
@@ -2080,16 +2099,16 @@ const SidebarComponent = forwardRef(({ isOpen, onClose, position = 'left', width
|
|
|
2080
2099
|
[`is-${position}`]: position,
|
|
2081
2100
|
'is-fullwidth': fullWidth,
|
|
2082
2101
|
});
|
|
2083
|
-
const backgroundClass = usePrefixedClassNames('sidebar-background'
|
|
2102
|
+
const backgroundClass = usePrefixedClassNames('sidebar-background', {
|
|
2103
|
+
'is-active': isOpen,
|
|
2104
|
+
});
|
|
2084
2105
|
const contentClass = usePrefixedClassNames('sidebar-content');
|
|
2085
2106
|
const combinedClasses = classNames(sidebarClasses, bulmaHelperClasses, className);
|
|
2086
2107
|
const sidebarStyle = {
|
|
2087
2108
|
...style,
|
|
2088
2109
|
'--bulma-sidebar-width': fullWidth ? '100%' : width,
|
|
2089
2110
|
};
|
|
2090
|
-
const sidebarContent = (jsxs(Fragment, { children: [overlay && (jsx("div", { className:
|
|
2091
|
-
'is-active': isOpen,
|
|
2092
|
-
}), onClick: handleOverlayClick, "aria-hidden": "true" })), jsx("aside", { ref: combinedRef, className: combinedClasses, style: sidebarStyle, role: "dialog", "aria-modal": overlay ? 'true' : undefined, "aria-hidden": !isOpen, tabIndex: -1, ...rest, children: jsx("div", { className: contentClass, children: children }) })] }));
|
|
2111
|
+
const sidebarContent = (jsxs(Fragment, { children: [overlay && (jsx("div", { className: backgroundClass, onClick: handleOverlayClick, "aria-hidden": "true" })), jsx("aside", { ref: combinedRef, className: combinedClasses, style: sidebarStyle, role: "dialog", "aria-modal": overlay ? 'true' : undefined, "aria-hidden": !isOpen, tabIndex: -1, ...rest, children: jsx("div", { className: contentClass, children: children }) })] }));
|
|
2093
2112
|
if (inline) {
|
|
2094
2113
|
return sidebarContent;
|
|
2095
2114
|
}
|
|
@@ -2194,6 +2213,12 @@ const Toast = forwardRef(({ message, type = 'default', actionType, position = 't
|
|
|
2194
2213
|
'is-rounded': rounded,
|
|
2195
2214
|
});
|
|
2196
2215
|
const combinedClasses = classNames(toastClasses, bulmaHelperClasses, className);
|
|
2216
|
+
const toastMessageClass = usePrefixedClassNames('toast-message');
|
|
2217
|
+
const toastActionsClass = usePrefixedClassNames('toast-actions');
|
|
2218
|
+
const toastCancelClass = usePrefixedClassNames('toast-cancel');
|
|
2219
|
+
const toastActionClass = usePrefixedClassNames('toast-action');
|
|
2220
|
+
const toastButtonClass = usePrefixedClassNames('button');
|
|
2221
|
+
const toastCloseClass = usePrefixedClassNames('delete', 'is-small');
|
|
2197
2222
|
if (!isVisible) {
|
|
2198
2223
|
return null;
|
|
2199
2224
|
}
|
|
@@ -2215,13 +2240,13 @@ const Toast = forwardRef(({ message, type = 'default', actionType, position = 't
|
|
|
2215
2240
|
ref.current = node;
|
|
2216
2241
|
}
|
|
2217
2242
|
};
|
|
2218
|
-
const toastElement = (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: [jsx("span", { className:
|
|
2243
|
+
const toastElement = (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: [jsx("span", { className: toastMessageClass, children: message }), (cancelText || actionText) && (jsxs("div", { className: toastActionsClass, children: [cancelText && (jsx("span", { className: toastCancelClass, children: jsx("button", { type: "button", className: toastButtonClass, onClick: e => {
|
|
2219
2244
|
e.stopPropagation();
|
|
2220
2245
|
handleClose();
|
|
2221
|
-
}, children: cancelText }) })), actionText && (jsx("span", { className:
|
|
2246
|
+
}, children: cancelText }) })), actionText && (jsx("span", { className: toastActionClass, children: jsx("button", { type: "button", className: toastButtonClass, onClick: e => {
|
|
2222
2247
|
e.stopPropagation();
|
|
2223
2248
|
handleAction();
|
|
2224
|
-
}, children: actionText }) }))] })), closable && (jsx("button", { type: "button", className:
|
|
2249
|
+
}, children: actionText }) }))] })), closable && (jsx("button", { type: "button", className: toastCloseClass, onClick: e => {
|
|
2225
2250
|
e.stopPropagation();
|
|
2226
2251
|
handleClose();
|
|
2227
2252
|
}, "aria-label": "Close" }))] }));
|
|
@@ -2502,9 +2527,7 @@ const Button = ({ color, size, isLight, isRounded, isLoading, isStatic, isFullWi
|
|
|
2502
2527
|
};
|
|
2503
2528
|
|
|
2504
2529
|
const CarouselItem = forwardRef(({ active, className, children, ...props }, ref) => {
|
|
2505
|
-
const itemClasses = classNames('carousel-item',
|
|
2506
|
-
'is-active': active,
|
|
2507
|
-
});
|
|
2530
|
+
const itemClasses = classNames(usePrefixedClassNames('carousel-item', { 'is-active': active }), className);
|
|
2508
2531
|
return (jsx("div", { ref: ref, className: itemClasses, ...props, children: children }));
|
|
2509
2532
|
});
|
|
2510
2533
|
CarouselItem.displayName = 'CarouselItem';
|
|
@@ -2690,6 +2713,15 @@ const Carousel = forwardRef(({ value: controlledValue, autoplay = false, interva
|
|
|
2690
2713
|
[`is-indicator-${indicatorStyle}`]: indicatorStyle !== 'dots',
|
|
2691
2714
|
[`is-arrow-${arrowColor}`]: !!arrowColor,
|
|
2692
2715
|
});
|
|
2716
|
+
const classPrefix = useClassPrefix();
|
|
2717
|
+
const carouselContainerClass = usePrefixedClassNames('carousel-container');
|
|
2718
|
+
const carouselSlidesClass = usePrefixedClassNames('carousel-slides');
|
|
2719
|
+
const carouselArrowPrevClass = usePrefixedClassNames('carousel-arrow', 'is-prev', { 'is-transparent': !arrowBackground });
|
|
2720
|
+
const carouselArrowNextClass = usePrefixedClassNames('carousel-arrow', 'is-next', { 'is-transparent': !arrowBackground });
|
|
2721
|
+
const carouselIndicatorClass = usePrefixedClassNames('carousel-indicator', {
|
|
2722
|
+
'is-inside': indicatorInside,
|
|
2723
|
+
'is-top': indicatorPosition === 'top',
|
|
2724
|
+
});
|
|
2693
2725
|
const combinedClasses = classNames(carouselClasses, bulmaHelperClasses, className);
|
|
2694
2726
|
const renderSlides = () => {
|
|
2695
2727
|
const slides = items.map((item, index) => {
|
|
@@ -2720,22 +2752,15 @@ const Carousel = forwardRef(({ value: controlledValue, autoplay = false, interva
|
|
|
2720
2752
|
}
|
|
2721
2753
|
return slides;
|
|
2722
2754
|
};
|
|
2723
|
-
return (jsxs("div", { ref: combinedRef, className: combinedClasses, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, ...rest, children: [jsxs("div", { ref: containerRef, className:
|
|
2755
|
+
return (jsxs("div", { ref: combinedRef, className: combinedClasses, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, role: "region", "aria-roledescription": "carousel", "aria-label": ariaLabel, ...rest, children: [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: {
|
|
2724
2756
|
transform: isDragging ? `translateX(${dragOffset}px)` : undefined,
|
|
2725
2757
|
cursor: hasDrag ? (isDragging ? 'grabbing' : 'grab') : undefined,
|
|
2726
|
-
}, children: [jsx("div", { className:
|
|
2758
|
+
}, children: [jsx("div", { className: carouselSlidesClass, style: {
|
|
2727
2759
|
transform: `translateX(-${(repeat && itemCount > 1 ? displayIndex + 1 : displayIndex) * 100}%)`,
|
|
2728
2760
|
transition: isDragging || skipTransition
|
|
2729
2761
|
? 'none'
|
|
2730
2762
|
: 'transform 0.3s ease-in-out',
|
|
2731
|
-
}, onTransitionEnd: handleTransitionEnd, children: renderSlides() }), arrow && itemCount > 1 && (jsxs(Fragment, { children: [jsx(Button, { className:
|
|
2732
|
-
'is-transparent': !arrowBackground,
|
|
2733
|
-
}), onClick: goToPrev, isDisabled: !canGoPrev, "aria-label": "Previous slide", children: iconPrev ? (jsx(Icon, { name: iconPrev, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsx(DefaultPrevIcon, {})) }), jsx(Button, { className: classNames('carousel-arrow is-next', {
|
|
2734
|
-
'is-transparent': !arrowBackground,
|
|
2735
|
-
}), onClick: goToNext, isDisabled: !canGoNext, "aria-label": "Next slide", children: iconNext ? (jsx(Icon, { name: iconNext, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsx(DefaultNextIcon, {})) })] }))] }), indicator && itemCount > 1 && (jsx("div", { className: classNames('carousel-indicator', {
|
|
2736
|
-
'is-inside': indicatorInside,
|
|
2737
|
-
'is-top': indicatorPosition === 'top',
|
|
2738
|
-
}), role: "tablist", children: items.map((_, index) => (jsx(Button, { className: classNames('indicator-item', {
|
|
2763
|
+
}, onTransitionEnd: handleTransitionEnd, children: renderSlides() }), arrow && itemCount > 1 && (jsxs(Fragment, { children: [jsx(Button, { className: carouselArrowPrevClass, onClick: goToPrev, isDisabled: !canGoPrev, "aria-label": "Previous slide", children: iconPrev ? (jsx(Icon, { name: iconPrev, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsx(DefaultPrevIcon, {})) }), jsx(Button, { className: carouselArrowNextClass, onClick: goToNext, isDisabled: !canGoNext, "aria-label": "Next slide", children: iconNext ? (jsx(Icon, { name: iconNext, library: iconLibrary, variant: iconVariant, size: iconSize, features: iconFeatures })) : (jsx(DefaultNextIcon, {})) })] }))] }), indicator && itemCount > 1 && (jsx("div", { className: carouselIndicatorClass, role: "tablist", children: items.map((_, index) => (jsx(Button, { className: prefixedClassNames(classPrefix, 'indicator-item', {
|
|
2739
2764
|
'is-active': index === activeIndex,
|
|
2740
2765
|
}), onClick: () => goToSlide(index), role: "tab", "aria-selected": index === activeIndex, "aria-label": `Go to slide ${index + 1}` }, index))) }))] }));
|
|
2741
2766
|
});
|
|
@@ -3459,7 +3484,9 @@ const Checkbox = forwardRef(({ color, size, className, children, textColor, disa
|
|
|
3459
3484
|
[`is-${size}`]: size && checkboxSizes.includes(size),
|
|
3460
3485
|
});
|
|
3461
3486
|
const checkboxClass = classNames(mainClass, bulmaHelperClasses, className);
|
|
3462
|
-
|
|
3487
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3488
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3489
|
+
return (jsxs("label", { className: checkboxClass, children: [jsx("input", { ref: ref, type: "checkbox", disabled: disabled, name: effectiveName, value: value, checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, onChange: handleChange, ...rest }), jsx("span", { className: checkClass }), children && jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3463
3490
|
});
|
|
3464
3491
|
Checkbox.displayName = 'Checkbox';
|
|
3465
3492
|
|
|
@@ -3688,7 +3715,9 @@ const Radio = forwardRef(({ color, size, className, children, textColor, disable
|
|
|
3688
3715
|
[`is-${size}`]: size && radioSizes.includes(size),
|
|
3689
3716
|
});
|
|
3690
3717
|
const radioClass = classNames(mainClass, bulmaHelperClasses, className);
|
|
3691
|
-
|
|
3718
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3719
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3720
|
+
return (jsxs("label", { className: radioClass, children: [jsx("input", { ref: ref, type: "radio", disabled: disabled, name: effectiveName, value: value, checked: effectiveChecked, defaultChecked: effectiveDefaultChecked, onChange: handleChange, ...rest }), jsx("span", { className: checkClass }), children && jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3692
3721
|
});
|
|
3693
3722
|
Radio.displayName = 'Radio';
|
|
3694
3723
|
|
|
@@ -3752,7 +3781,9 @@ const Switch = forwardRef(({ color, size, isRounded, isThin, isOutlined, isRtl,
|
|
|
3752
3781
|
[`is-${passiveType}-passive`]: passiveType && switchColors.includes(passiveType),
|
|
3753
3782
|
});
|
|
3754
3783
|
const labelClasses = classNames(switchClasses, bulmaHelperClasses, className);
|
|
3755
|
-
|
|
3784
|
+
const checkClass = usePrefixedClassNames('check');
|
|
3785
|
+
const controlLabelClass = usePrefixedClassNames('control-label');
|
|
3786
|
+
return (jsxs("label", { className: labelClasses, children: [jsx("input", { ref: ref, type: "checkbox", disabled: disabled, ...rest }), jsx("span", { className: checkClass }), children && jsx("span", { className: controlLabelClass, children: children })] }));
|
|
3756
3787
|
});
|
|
3757
3788
|
Switch.displayName = 'Switch';
|
|
3758
3789
|
|
|
@@ -3920,6 +3951,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
3920
3951
|
}
|
|
3921
3952
|
return isCircle ? px * 1.2 : px;
|
|
3922
3953
|
};
|
|
3954
|
+
const classPrefix = useClassPrefix();
|
|
3923
3955
|
const sliderClasses = usePrefixedClassNames('slider', {
|
|
3924
3956
|
[`is-${size}`]: size,
|
|
3925
3957
|
[`is-${color}`]: color,
|
|
@@ -4024,24 +4056,24 @@ const Slider = forwardRef((props, ref) => {
|
|
|
4024
4056
|
const renderTicks = () => {
|
|
4025
4057
|
if (tickPositions.length === 0)
|
|
4026
4058
|
return null;
|
|
4027
|
-
return (jsx("div", { className:
|
|
4059
|
+
return (jsx("div", { className: prefixedClassNames(classPrefix, 'slider-ticks'), children: tickPositions.map((tick, i) => {
|
|
4028
4060
|
const pct = ((tick.value - min) / (max - min)) * 100;
|
|
4029
4061
|
const posStyle = isVertical
|
|
4030
4062
|
? { bottom: `${pct}%` }
|
|
4031
4063
|
: { left: `${pct}%` };
|
|
4032
4064
|
const isEndpoint = tick.value === min || tick.value === max;
|
|
4033
|
-
return (jsx("span", { className:
|
|
4065
|
+
return (jsx("span", { className: prefixedClassNames(classPrefix, 'slider-tick', {
|
|
4034
4066
|
'is-endpoint': isEndpoint,
|
|
4035
|
-
}), style: posStyle, children: tick.label !== undefined && (jsx("span", { className:
|
|
4067
|
+
}), style: posStyle, children: tick.label !== undefined && (jsx("span", { className: prefixedClassNames(classPrefix, 'slider-tick-label'), children: tick.label })) }, i));
|
|
4036
4068
|
}) }));
|
|
4037
4069
|
};
|
|
4038
4070
|
const helpClass = usePrefixedClassNames('help', {
|
|
4039
4071
|
[`is-${messageColor}`]: !!messageColor,
|
|
4040
4072
|
});
|
|
4041
4073
|
const messageEl = message ? jsx("p", { className: helpClass, children: message }) : null;
|
|
4042
|
-
const sliderElement = !range ? (jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [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:
|
|
4074
|
+
const sliderElement = !range ? (jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [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: {
|
|
4043
4075
|
'--slider-progress': `${progressSingle}%`,
|
|
4044
|
-
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), ...rest }), tooltipMode !== 'hidden' && (jsx("output", { ref: outputRef, className:
|
|
4076
|
+
}, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), ...rest }), tooltipMode !== 'hidden' && (jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
|
|
4045
4077
|
'is-visible': showTipLow,
|
|
4046
4078
|
'is-flipped': flipped,
|
|
4047
4079
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4061,7 +4093,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
4061
4093
|
left: getThumbLeft(progressSingle),
|
|
4062
4094
|
transform: `translateX(calc(-50% + ${nudgeX}px))`,
|
|
4063
4095
|
'--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,
|
|
4064
|
-
}, children: formatValue(currentSingle) })), renderTicks()] })) : (jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsx("div", { className:
|
|
4096
|
+
}, children: formatValue(currentSingle) })), renderTicks()] })) : (jsxs("div", { ref: wrapperRef, className: combinedClasses, style: wrapperStyle, children: [jsx("div", { className: prefixedClassNames(classPrefix, 'slider-track'), style: isVertical
|
|
4065
4097
|
? {
|
|
4066
4098
|
'--slider-progress-low': `${progressLow}%`,
|
|
4067
4099
|
'--slider-progress-high': `${progressHigh}%`,
|
|
@@ -4069,7 +4101,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
4069
4101
|
: {
|
|
4070
4102
|
'--slider-progress-low': `${progressLow}%`,
|
|
4071
4103
|
'--slider-progress-high': `${progressHigh}%`,
|
|
4072
|
-
} }), 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:
|
|
4104
|
+
} }), 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 } : {}) }), 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' && (jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-low', {
|
|
4073
4105
|
'is-visible': showTipLow,
|
|
4074
4106
|
'is-flipped': flipped,
|
|
4075
4107
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4089,7 +4121,7 @@ const Slider = forwardRef((props, ref) => {
|
|
|
4089
4121
|
left: getThumbLeft(progressLow),
|
|
4090
4122
|
transform: `translateX(calc(-50% + ${nudgeX}px))`,
|
|
4091
4123
|
'--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,
|
|
4092
|
-
}, children: formatValue(currentRange[0]) })), tooltipMode !== 'hidden' && (jsx("output", { ref: outputHighRef, className:
|
|
4124
|
+
}, children: formatValue(currentRange[0]) })), tooltipMode !== 'hidden' && (jsx("output", { ref: outputHighRef, className: prefixedClassNames(classPrefix, 'slider-output', 'slider-output-high', {
|
|
4093
4125
|
'is-visible': showTipHigh,
|
|
4094
4126
|
'is-flipped': flippedHigh,
|
|
4095
4127
|
'is-flipped-left': isVertical && verticalFlippedLeft,
|
|
@@ -4375,6 +4407,7 @@ const Rate = forwardRef(({ label, labelSize, labelProps, horizontal, message, me
|
|
|
4375
4407
|
}
|
|
4376
4408
|
return currentValue;
|
|
4377
4409
|
};
|
|
4410
|
+
const classPrefix = useClassPrefix();
|
|
4378
4411
|
const rateClasses = usePrefixedClassNames('rate', {
|
|
4379
4412
|
[`is-${size}`]: size,
|
|
4380
4413
|
'is-disabled': disabled,
|
|
@@ -4411,9 +4444,9 @@ const Rate = forwardRef(({ label, labelSize, labelProps, horizontal, message, me
|
|
|
4411
4444
|
return customIcon(iconProps);
|
|
4412
4445
|
}
|
|
4413
4446
|
if (iconName) {
|
|
4414
|
-
return (jsxs("span", { className:
|
|
4447
|
+
return (jsxs("span", { className: prefixedClassNames(classPrefix, 'rate-icon-partial'), style: {
|
|
4415
4448
|
'--rate-fill-percent': `${fillPercent}%`,
|
|
4416
|
-
}, children: [jsx("span", { className:
|
|
4449
|
+
}, children: [jsx("span", { className: prefixedClassNames(classPrefix, 'rate-icon-bg'), children: jsx(Icon, { name: iconName, library: resolvedLibrary, variant: iconVariant, features: iconFeatures }) }), jsx("span", { className: prefixedClassNames(classPrefix, 'rate-icon-fg'), children: jsx(Icon, { name: iconName, library: resolvedLibrary, variant: iconVariant, features: iconFeatures }) })] }));
|
|
4417
4450
|
}
|
|
4418
4451
|
const clipId = `rate-clip-${iconIndex}`;
|
|
4419
4452
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", "aria-hidden": "true", children: [jsx("defs", { children: jsx("clipPath", { id: clipId, children: jsx("rect", { x: "0", y: "0", width: `${(fillPercent / 100) * 24}`, height: "24" }) }) }), 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" }), 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" })] }));
|
|
@@ -4429,7 +4462,7 @@ const Rate = forwardRef(({ label, labelSize, labelProps, horizontal, message, me
|
|
|
4429
4462
|
const icon = isPartial
|
|
4430
4463
|
? renderPartialIcon(iconIndex, fillPercent)
|
|
4431
4464
|
: renderIcon(iconIndex, isActive, fillPercent);
|
|
4432
|
-
icons.push(jsx("span", { className:
|
|
4465
|
+
icons.push(jsx("span", { className: prefixedClassNames(classPrefix, 'rate-item', {
|
|
4433
4466
|
'is-active': isActive,
|
|
4434
4467
|
'is-hovered': isHovered,
|
|
4435
4468
|
}), onClick: e => handleClick(iconIndex, e), onMouseEnter: () => handleMouseEnter(iconIndex), onMouseMove: e => handleMouseMove(iconIndex, e), onMouseLeave: handleMouseLeave, role: "radio", "aria-checked": currentValue === iconIndex + 1 ||
|
|
@@ -4447,7 +4480,11 @@ const Rate = forwardRef(({ label, labelSize, labelProps, horizontal, message, me
|
|
|
4447
4480
|
[`is-${messageColor}`]: !!messageColor,
|
|
4448
4481
|
});
|
|
4449
4482
|
const messageEl = message ? jsx("p", { className: helpClass, children: message }) : null;
|
|
4450
|
-
const
|
|
4483
|
+
const rateItemsClass = usePrefixedClassNames('rate-items');
|
|
4484
|
+
const rateScoreClass = usePrefixedClassNames('rate-score');
|
|
4485
|
+
const rateTextClass = usePrefixedClassNames('rate-text');
|
|
4486
|
+
const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');
|
|
4487
|
+
const rateElement = (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: [jsx("div", { className: rateItemsClass, children: renderIcons() }), showScore && (jsx("span", { className: rateScoreClass, children: getScoreDisplay() })), text && jsx("span", { className: rateTextClass, children: text }), customText && (jsx("span", { className: rateCustomTextClass, children: customText })), name && (jsx("input", { type: "hidden", name: name, value: currentValue, form: form }))] }));
|
|
4451
4488
|
let content = rateElement;
|
|
4452
4489
|
if (!insideControl) {
|
|
4453
4490
|
content = jsx(Control, { children: content });
|
|
@@ -4908,7 +4945,7 @@ const Taginput = forwardRef(({ label, labelSize, labelProps, horizontal, message
|
|
|
4908
4945
|
const messageEl = message ? jsx("p", { className: helpClass, children: message }) : null;
|
|
4909
4946
|
const taginputElement = (jsxs("div", { ref: containerRef, className: combinedClasses, onClick: handleContainerClick, ...rest, children: [jsxs("div", { className: containerClasses, children: [icon && (jsx(Icon, { name: icon, library: resolvedLibrary, variant: iconVariant, features: iconFeatures, containerClassName: pcn('icon', 'is-left') })), jsxs("div", { className: tagsClasses, children: [tags.map((tag, index) => {
|
|
4910
4947
|
const displayVal = getDisplayValue(tag);
|
|
4911
|
-
return (jsxs("span", { className: tagClasses, children: [tagTemplate ? (tagTemplate(tag)) : ellipsis ? (jsx("span", { title: displayVal, children: displayVal })) : (displayVal), closable && !disabled && !readonly && (jsx("button", { type: "button", className:
|
|
4948
|
+
return (jsxs("span", { className: tagClasses, children: [tagTemplate ? (tagTemplate(tag)) : ellipsis ? (jsx("span", { title: displayVal, children: displayVal })) : (displayVal), closable && !disabled && !readonly && (jsx("button", { type: "button", className: pcn('delete', 'is-small'), onClick: e => {
|
|
4912
4949
|
e.stopPropagation();
|
|
4913
4950
|
removeTag(index);
|
|
4914
4951
|
}, "aria-label": ariaCloseLabel || `Remove ${displayVal}` }))] }, index));
|