@allxsmith/bestax-bulma 5.27.1 → 5.27.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/bestax.css +1 -1
  2. package/dist/bestax.css.map +1 -1
  3. package/dist/esm/form/Autocomplete.js.map +1 -1
  4. package/dist/esm/form/Checkboxes.js +1 -0
  5. package/dist/esm/form/Checkboxes.js.map +1 -1
  6. package/dist/esm/form/DateInput.js +2 -1
  7. package/dist/esm/form/DateInput.js.map +1 -1
  8. package/dist/esm/form/DateRangeInput.js +1 -0
  9. package/dist/esm/form/DateRangeInput.js.map +1 -1
  10. package/dist/esm/form/DateTimeInput.js +2 -1
  11. package/dist/esm/form/DateTimeInput.js.map +1 -1
  12. package/dist/esm/form/Field.js +18 -4
  13. package/dist/esm/form/Field.js.map +1 -1
  14. package/dist/esm/form/File.js +5 -1
  15. package/dist/esm/form/File.js.map +1 -1
  16. package/dist/esm/form/FormContext.js +27 -3
  17. package/dist/esm/form/FormContext.js.map +1 -1
  18. package/dist/esm/form/Input.js +1 -1
  19. package/dist/esm/form/Input.js.map +1 -1
  20. package/dist/esm/form/Numberinput.js +3 -1
  21. package/dist/esm/form/Numberinput.js.map +1 -1
  22. package/dist/esm/form/Radios.js +1 -0
  23. package/dist/esm/form/Radios.js.map +1 -1
  24. package/dist/esm/form/Rate.js +1 -0
  25. package/dist/esm/form/Rate.js.map +1 -1
  26. package/dist/esm/form/Select.js +1 -1
  27. package/dist/esm/form/Select.js.map +1 -1
  28. package/dist/esm/form/Slider.js +4 -2
  29. package/dist/esm/form/Slider.js.map +1 -1
  30. package/dist/esm/form/Taginput.js +4 -5
  31. package/dist/esm/form/Taginput.js.map +1 -1
  32. package/dist/esm/form/TextArea.js +1 -1
  33. package/dist/esm/form/TextArea.js.map +1 -1
  34. package/dist/esm/form/TimeInput.js +2 -1
  35. package/dist/esm/form/TimeInput.js.map +1 -1
  36. package/dist/esm/form/useAutoLabelId.js +42 -8
  37. package/dist/esm/form/useAutoLabelId.js.map +1 -1
  38. package/dist/esm/helpers/Config.js.map +1 -1
  39. package/dist/esm/helpers/Theme.js.map +1 -1
  40. package/dist/extras.css +1 -1
  41. package/dist/extras.css.map +1 -1
  42. package/dist/index.cjs +113 -28
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/types/form/Autocomplete.d.ts +1 -1
  45. package/dist/types/form/Checkboxes.d.ts +1 -1
  46. package/dist/types/form/DateInput.d.ts +1 -1
  47. package/dist/types/form/DateRangeInput.d.ts +1 -1
  48. package/dist/types/form/DateTimeInput.d.ts +1 -1
  49. package/dist/types/form/Field.d.ts +2 -2
  50. package/dist/types/form/File.d.ts +4 -3
  51. package/dist/types/form/FormContext.d.ts +24 -2
  52. package/dist/types/form/Numberinput.d.ts +1 -1
  53. package/dist/types/form/Radios.d.ts +1 -1
  54. package/dist/types/form/Rate.d.ts +1 -1
  55. package/dist/types/form/Slider.d.ts +1 -1
  56. package/dist/types/form/Taginput.d.ts +1 -1
  57. package/dist/types/form/TimeInput.d.ts +1 -1
  58. package/dist/types/form/useAutoLabelId.d.ts +25 -4
  59. package/dist/types/helpers/Config.d.ts +3 -4
  60. package/dist/types/helpers/Theme.d.ts +44 -40
  61. package/dist/types-cjs/form/Autocomplete.d.ts +1 -1
  62. package/dist/types-cjs/form/Checkboxes.d.ts +1 -1
  63. package/dist/types-cjs/form/DateInput.d.ts +1 -1
  64. package/dist/types-cjs/form/DateRangeInput.d.ts +1 -1
  65. package/dist/types-cjs/form/DateTimeInput.d.ts +1 -1
  66. package/dist/types-cjs/form/Field.d.ts +2 -2
  67. package/dist/types-cjs/form/File.d.ts +4 -3
  68. package/dist/types-cjs/form/FormContext.d.ts +24 -2
  69. package/dist/types-cjs/form/Numberinput.d.ts +1 -1
  70. package/dist/types-cjs/form/Radios.d.ts +1 -1
  71. package/dist/types-cjs/form/Rate.d.ts +1 -1
  72. package/dist/types-cjs/form/Slider.d.ts +1 -1
  73. package/dist/types-cjs/form/Taginput.d.ts +1 -1
  74. package/dist/types-cjs/form/TimeInput.d.ts +1 -1
  75. package/dist/types-cjs/form/useAutoLabelId.d.ts +25 -4
  76. package/dist/types-cjs/helpers/Config.d.ts +3 -4
  77. package/dist/types-cjs/helpers/Theme.d.ts +44 -40
  78. package/dist/versions/bestax-no-dark-mode.css +1 -1
  79. package/dist/versions/bestax-no-dark-mode.css.map +1 -1
  80. package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
  81. package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
  82. package/dist/versions/bestax-no-helpers.css +1 -1
  83. package/dist/versions/bestax-no-helpers.css.map +1 -1
  84. package/dist/versions/bestax-prefixed.css +1 -1
  85. package/dist/versions/bestax-prefixed.css.map +1 -1
  86. package/package.json +1 -1
  87. package/src/scss/form/_file.scss +9 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Rate.js","sources":["../../../src/form/Rate.tsx"],"sourcesContent":["import React, { forwardRef, useState, useCallback, useId } from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Icon } from '../elements/Icon';\nimport { useClassPrefix, useIconLibrary } from '../helpers/Config';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelledBy } from './useAutoLabelId';\n\n/** Available size modifiers for the Rate component. */\nexport type RateSize = 'small' | 'medium' | 'large';\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\ntype BulmaColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Props for individual rate icons.\n */\nexport interface RateIconProps {\n /** The index of this icon (0-based) */\n index: number;\n /** Whether this icon is currently active (filled) */\n isActive: boolean;\n /** Whether this icon is currently hovered */\n isHovered: boolean;\n /** The current value */\n value: number;\n /** Fill percentage for partial icons (0-100). Used with precision < 1. */\n fillPercent: number;\n}\n\n/**\n * Props for the Rate component.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.\n */\nexport interface RateProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n Omit<BulmaClassesProps, 'size'>,\n FormFieldProps {\n /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label=\"Rating\"`. Dropped inside an outer `Field` (label that `Field` yourself). */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Form field name. When set, a hidden input is rendered. */\n name?: string;\n /** Optional id of the form this hidden input belongs to (use when the input lives outside the form element). */\n form?: string;\n /** Controlled value (0 to max). */\n value?: number;\n /** Default value for uncontrolled usage. */\n defaultValue?: number;\n /** Maximum rating value. */\n max?: number;\n /** Size variant. */\n size?: RateSize;\n /** Whether the rating is disabled. */\n disabled?: boolean;\n /** Show the numeric score next to stars. */\n showScore?: boolean;\n /** Show custom text based on value. */\n showText?: boolean;\n /** Array of text labels for each rating value. */\n texts?: string[];\n /** Callback when rating changes. */\n onChange?: (value: number) => void;\n /** Custom icon renderer. */\n customIcon?: (props: RateIconProps) => React.ReactNode;\n /** Add spacing between icons. */\n spaced?: boolean;\n /** Right-to-left direction. */\n rtl?: boolean;\n /** Custom icon name for the rating stars. */\n iconName?: string;\n /** Icon library to use (defaults to ConfigProvider value or 'fa'). */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Color of the active rating icons. */\n color?: BulmaColor;\n /** Rating precision (e.g., `0.5` for half stars). */\n precision?: number;\n /** Custom text displayed next to the rating. */\n customText?: string;\n}\n\n/**\n * Default star icon component.\n */\nconst StarIcon: React.FC<{ filled: boolean }> = ({ filled }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill={filled ? 'currentColor' : 'none'}\n stroke=\"currentColor\"\n strokeWidth={filled ? 0 : 2}\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n 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\"\n />\n </svg>\n);\n\n/** Snap a value to the nearest precision step. */\nfunction snapToPrecision(val: number, precision: number): number {\n return Math.round(val / precision) * precision;\n}\n\n/** Get fill percentage for a given icon index based on current value. */\nfunction getFillPercent(iconIndex: number, value: number): number {\n if (value >= iconIndex + 1) return 100;\n if (value <= iconIndex) return 0;\n return Math.round((value - iconIndex) * 100);\n}\n\n/**\n * The `Rate` component provides a star/icon-based rating system.\n *\n * @function\n * @param {RateProps} props - Props for the Rate component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the container element.\n * @returns {JSX.Element} The rendered rating component.\n *\n * @example\n * // Basic 5-star rating\n * <Rate defaultValue={3} />\n *\n * @example\n * // With color and precision\n * <Rate defaultValue={3.5} color=\"warning\" precision={0.5} showScore />\n *\n * @example\n * // With Font Awesome icons\n * <Rate iconName=\"star\" iconLibrary=\"fa\" iconVariant=\"solid\" />\n */\nexport const Rate = forwardRef<HTMLDivElement, RateProps>(\n (\n {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n value: controlledValue,\n defaultValue = 0,\n max = 5,\n size,\n disabled = false,\n showScore = false,\n showText = false,\n texts,\n onChange,\n customIcon,\n spaced = false,\n rtl = false,\n iconName,\n iconLibrary: iconLibraryProp,\n iconVariant,\n iconFeatures,\n color,\n precision = 1,\n customText,\n name,\n form,\n className,\n ...props\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Rate', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { ariaLabelledBy, fieldLabelProps } = useAutoLabelledBy({\n label,\n labelProps,\n rendersLabel: ownField,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const starBaseId = useId();\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [hoverValue, setHoverValue] = useState<number | null>(null);\n\n const defaultIconLibrary = useIconLibrary();\n const resolvedLibrary = iconLibraryProp || defaultIconLibrary || 'fa';\n\n // Determine if controlled\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n const displayValue = hoverValue !== null ? hoverValue : currentValue;\n\n // Update value\n const updateValue = useCallback(\n (newValue: number) => {\n if (disabled) return;\n\n // Allow clicking same value to deselect (set to 0)\n const finalValue = newValue === currentValue ? 0 : newValue;\n\n if (!isControlled) {\n setInternalValue(finalValue);\n }\n onChange?.(finalValue);\n },\n [isControlled, currentValue, disabled, onChange]\n );\n\n // Handle click with precision support\n const handleClick = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled) return;\n\n if (precision < 1) {\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n updateValue(clamped);\n } else {\n updateValue(iconIndex + 1);\n }\n },\n [disabled, precision, rtl, max, updateValue]\n );\n\n // Handle mouse enter on icon\n const handleMouseEnter = useCallback(\n (iconIndex: number) => {\n if (disabled) return;\n setHoverValue(iconIndex + 1);\n },\n [disabled]\n );\n\n // Handle mouse move with precision support\n const handleMouseMove = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled || precision >= 1) return;\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n setHoverValue(clamped);\n },\n [disabled, precision, rtl, max]\n );\n\n // Handle mouse leave\n const handleMouseLeave = useCallback(() => {\n setHoverValue(null);\n }, []);\n\n // Handle keyboard\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n let newValue = currentValue;\n const step = precision < 1 ? precision : 1;\n\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n newValue = Math.min(currentValue + step, max);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n newValue = Math.max(currentValue - step, 0);\n } else if (e.key === 'Home') {\n e.preventDefault();\n newValue = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n newValue = max;\n }\n\n // Round to avoid floating point issues\n newValue = Math.round(newValue * 1000) / 1000;\n\n if (newValue !== currentValue) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n }\n },\n [currentValue, max, precision, disabled, isControlled, onChange]\n );\n\n // Get text for current value\n const getText = () => {\n if (!showText || !texts) return null;\n const wholeIndex = Math.ceil(displayValue) - 1;\n const baseText = texts[wholeIndex] || null;\n if (!baseText) return null;\n // For fractional hover values with precision < 1, append \"+\"\n if (precision < 1 && hoverValue !== null && hoverValue % 1 !== 0) {\n return `${baseText}+`;\n }\n return baseText;\n };\n\n // Format score display\n const getScoreDisplay = () => {\n if (precision < 1 && currentValue % 1 !== 0) {\n return currentValue.toFixed(1);\n }\n return currentValue;\n };\n\n // Generate classes\n const classPrefix = useClassPrefix();\n const rateClasses = usePrefixedClassNames('rate', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n 'is-spaced': spaced,\n 'is-rtl': rtl,\n [`is-${color}`]: color,\n });\n\n const combinedClasses = classNames(\n rateClasses,\n bulmaHelperClasses,\n className\n );\n\n // Render a single icon based on priority: customIcon > iconName > default SVG\n const renderIcon = (\n iconIndex: number,\n isActive: boolean,\n fillPercent: number\n ) => {\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive,\n isHovered: hoverValue !== null && iconIndex < hoverValue,\n value: displayValue,\n fillPercent,\n };\n\n if (customIcon) {\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n );\n }\n\n return <StarIcon filled={isActive} />;\n };\n\n // Render partial icon with layered approach\n const renderPartialIcon = (iconIndex: number, fillPercent: number) => {\n if (customIcon) {\n // For custom icons, pass fillPercent and let consumer handle it\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive: fillPercent > 0,\n isHovered: hoverValue !== null && iconIndex < (hoverValue ?? 0),\n value: displayValue,\n fillPercent,\n };\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <span\n className={prefixedClassNames(classPrefix, 'rate-icon-partial')}\n style={\n {\n '--rate-fill-percent': `${fillPercent}%`,\n } as React.CSSProperties\n }\n >\n <span className={prefixedClassNames(classPrefix, 'rate-icon-bg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n <span className={prefixedClassNames(classPrefix, 'rate-icon-fg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n </span>\n );\n }\n\n // Default SVG with clipPath for partial fill\n const clipId = `rate-clip-${iconIndex}`;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <defs>\n <clipPath id={clipId}>\n <rect\n x=\"0\"\n y=\"0\"\n width={`${(fillPercent / 100) * 24}`}\n height=\"24\"\n />\n </clipPath>\n </defs>\n {/* Background: empty star */}\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n 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\"\n />\n {/* Foreground: filled portion */}\n <path\n clipPath={`url(#${clipId})`}\n fill=\"currentColor\"\n 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\"\n />\n </svg>\n );\n };\n\n // The star the value falls in is the checked radio, and it carries the\n // value: a radiogroup takes no aria-value* of its own. A fractional value\n // names that star by the value itself (\"3.5 stars\"). Both go by the value\n // as that name writes it, to hundredths, so a value a hair over a whole\n // number checks that number's star under its own name, and no two stars\n // share a name.\n const shownValue = Number(currentValue.toFixed(2));\n const checkedIndex =\n shownValue > 0 ? Math.min(Math.ceil(shownValue), max) - 1 : -1;\n\n // Render icons\n const renderIcons = () => {\n const icons = [];\n\n for (let i = 0; i < max; i++) {\n const iconIndex = rtl ? max - 1 - i : i;\n const fillPercent = getFillPercent(iconIndex, displayValue);\n const isActive = fillPercent === 100;\n const isHovered = hoverValue !== null && iconIndex < hoverValue;\n const isPartial = fillPercent > 0 && fillPercent < 100;\n\n const icon = isPartial\n ? renderPartialIcon(iconIndex, fillPercent)\n : renderIcon(iconIndex, isActive, fillPercent);\n\n icons.push(\n <span\n key={iconIndex}\n className={prefixedClassNames(classPrefix, 'rate-item', {\n 'is-active': isActive,\n 'is-hovered': isHovered,\n })}\n onClick={e => handleClick(iconIndex, e)}\n onMouseEnter={() => handleMouseEnter(iconIndex)}\n onMouseMove={e => handleMouseMove(iconIndex, e)}\n onMouseLeave={handleMouseLeave}\n id={`${starBaseId}-${iconIndex}`}\n role=\"radio\"\n aria-checked={iconIndex === checkedIndex}\n aria-label={\n iconIndex === checkedIndex && shownValue % 1 !== 0\n ? `${shownValue} stars`\n : `${iconIndex + 1} star${iconIndex === 0 ? '' : 's'}`\n }\n tabIndex={-1}\n >\n {icon}\n </span>\n );\n }\n\n return icons;\n };\n\n const text = getText();\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n const rateItemsClass = usePrefixedClassNames('rate-items');\n const rateScoreClass = usePrefixedClassNames('rate-score');\n const rateTextClass = usePrefixedClassNames('rate-text');\n const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');\n\n const rateElement = (\n <div\n ref={ref}\n className={combinedClasses}\n role=\"radiogroup\"\n // Fallback name only: a wired label names the group via labelledby.\n aria-label={ariaLabelledBy ? undefined : 'Rating'}\n aria-labelledby={ariaLabelledBy}\n // Focus stays on the group, so point it at the checked star for\n // assistive technology to announce as the value changes.\n aria-activedescendant={\n checkedIndex >= 0 ? `${starBaseId}-${checkedIndex}` : undefined\n }\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div className={rateItemsClass}>{renderIcons()}</div>\n {showScore && (\n <span className={rateScoreClass}>{getScoreDisplay()}</span>\n )}\n {text && <span className={rateTextClass}>{text}</span>}\n {customText && (\n <span className={rateCustomTextClass}>{customText}</span>\n )}\n {name && (\n <input type=\"hidden\" name={name} value={currentValue} form={form} />\n )}\n </div>\n );\n\n let content = rateElement;\n\n if (rendersOwnControl('Rate', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nRate.displayName = 'Rate';\n\nexport default Rate;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;AA6GA;;AAEG;AACH,MAAM,QAAQ,GAAkC,CAAC,EAAE,MAAM,EAAE,MACzDA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,MAAM,EACtC,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,MAAM,GAAG,CAAC,GAAG,CAAC,iBACf,MAAM,EAAA,QAAA,EAElBA,GAAA,CAAA,MAAA,EAAA,EACE,aAAa,EAAC,OAAO,EACrB,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C,EAAE;AAChD,QAAA,OAAO,GAAGA,GAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAE,OAAO,GAAW;IACxC;IAEA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
1
+ {"version":3,"file":"Rate.js","sources":["../../../src/form/Rate.tsx"],"sourcesContent":["import React, { forwardRef, useState, useCallback, useId } from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { Icon } from '../elements/Icon';\nimport { useClassPrefix, useIconLibrary } from '../helpers/Config';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelledBy } from './useAutoLabelId';\n\n/** Available size modifiers for the Rate component. */\nexport type RateSize = 'small' | 'medium' | 'large';\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\ntype BulmaColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/**\n * Props for individual rate icons.\n */\nexport interface RateIconProps {\n /** The index of this icon (0-based) */\n index: number;\n /** Whether this icon is currently active (filled) */\n isActive: boolean;\n /** Whether this icon is currently hovered */\n isHovered: boolean;\n /** The current value */\n value: number;\n /** Fill percentage for partial icons (0-100). Used with precision < 1. */\n fillPercent: number;\n}\n\n/**\n * Props for the Rate component.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the container element.\n */\nexport interface RateProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n Omit<BulmaClassesProps, 'size'>,\n FormFieldProps {\n /** Field label naming the rating group. Automatically associated via `aria-labelledby` on the `role=\"radiogroup\"` container — uses your `labelProps.id` when provided, otherwise a generated one; it also replaces the default `aria-label=\"Rating\"`. Dropped inside an outer `Field`, whose own label names the group instead through `aria-labelledby` when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`), and replaces the `aria-label=\"Rating\"` fallback too. An `aria-label` or `aria-labelledby` you set on the group wins over either label, which still renders but no longer names it. An `aria-labelledby` key counts even when undefined, since it is spread over the group's own, and leaves the `\"Rating\"` fallback. */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `id` here is used as the `aria-labelledby` target instead of a generated one; any `htmlFor` is ignored (a group label names the group, never a single control). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Form field name. When set, a hidden input is rendered. */\n name?: string;\n /** Optional id of the form this hidden input belongs to (use when the input lives outside the form element). */\n form?: string;\n /** Controlled value (0 to max). */\n value?: number;\n /** Default value for uncontrolled usage. */\n defaultValue?: number;\n /** Maximum rating value. */\n max?: number;\n /** Size variant. */\n size?: RateSize;\n /** Whether the rating is disabled. */\n disabled?: boolean;\n /** Show the numeric score next to stars. */\n showScore?: boolean;\n /** Show custom text based on value. */\n showText?: boolean;\n /** Array of text labels for each rating value. */\n texts?: string[];\n /** Callback when rating changes. */\n onChange?: (value: number) => void;\n /** Custom icon renderer. */\n customIcon?: (props: RateIconProps) => React.ReactNode;\n /** Add spacing between icons. */\n spaced?: boolean;\n /** Right-to-left direction. */\n rtl?: boolean;\n /** Custom icon name for the rating stars. */\n iconName?: string;\n /** Icon library to use (defaults to ConfigProvider value or 'fa'). */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Color of the active rating icons. */\n color?: BulmaColor;\n /** Rating precision (e.g., `0.5` for half stars). */\n precision?: number;\n /** Custom text displayed next to the rating. */\n customText?: string;\n}\n\n/**\n * Default star icon component.\n */\nconst StarIcon: React.FC<{ filled: boolean }> = ({ filled }) => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill={filled ? 'currentColor' : 'none'}\n stroke=\"currentColor\"\n strokeWidth={filled ? 0 : 2}\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n 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\"\n />\n </svg>\n);\n\n/** Snap a value to the nearest precision step. */\nfunction snapToPrecision(val: number, precision: number): number {\n return Math.round(val / precision) * precision;\n}\n\n/** Get fill percentage for a given icon index based on current value. */\nfunction getFillPercent(iconIndex: number, value: number): number {\n if (value >= iconIndex + 1) return 100;\n if (value <= iconIndex) return 0;\n return Math.round((value - iconIndex) * 100);\n}\n\n/**\n * The `Rate` component provides a star/icon-based rating system.\n *\n * @function\n * @param {RateProps} props - Props for the Rate component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the container element.\n * @returns {JSX.Element} The rendered rating component.\n *\n * @example\n * // Basic 5-star rating\n * <Rate defaultValue={3} />\n *\n * @example\n * // With color and precision\n * <Rate defaultValue={3.5} color=\"warning\" precision={0.5} showScore />\n *\n * @example\n * // With Font Awesome icons\n * <Rate iconName=\"star\" iconLibrary=\"fa\" iconVariant=\"solid\" />\n */\nexport const Rate = forwardRef<HTMLDivElement, RateProps>(\n (\n {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n value: controlledValue,\n defaultValue = 0,\n max = 5,\n size,\n disabled = false,\n showScore = false,\n showText = false,\n texts,\n onChange,\n customIcon,\n spaced = false,\n rtl = false,\n iconName,\n iconLibrary: iconLibraryProp,\n iconVariant,\n iconFeatures,\n color,\n precision = 1,\n customText,\n name,\n form,\n className,\n ...props\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Rate', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { ariaLabelledBy, fieldLabelProps } = useAutoLabelledBy({\n label,\n labelProps,\n rendersLabel: ownField,\n callerProps: props,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const starBaseId = useId();\n const [internalValue, setInternalValue] = useState(defaultValue);\n const [hoverValue, setHoverValue] = useState<number | null>(null);\n\n const defaultIconLibrary = useIconLibrary();\n const resolvedLibrary = iconLibraryProp || defaultIconLibrary || 'fa';\n\n // Determine if controlled\n const isControlled = controlledValue !== undefined;\n const currentValue = isControlled ? controlledValue : internalValue;\n const displayValue = hoverValue !== null ? hoverValue : currentValue;\n\n // Update value\n const updateValue = useCallback(\n (newValue: number) => {\n if (disabled) return;\n\n // Allow clicking same value to deselect (set to 0)\n const finalValue = newValue === currentValue ? 0 : newValue;\n\n if (!isControlled) {\n setInternalValue(finalValue);\n }\n onChange?.(finalValue);\n },\n [isControlled, currentValue, disabled, onChange]\n );\n\n // Handle click with precision support\n const handleClick = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled) return;\n\n if (precision < 1) {\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n updateValue(clamped);\n } else {\n updateValue(iconIndex + 1);\n }\n },\n [disabled, precision, rtl, max, updateValue]\n );\n\n // Handle mouse enter on icon\n const handleMouseEnter = useCallback(\n (iconIndex: number) => {\n if (disabled) return;\n setHoverValue(iconIndex + 1);\n },\n [disabled]\n );\n\n // Handle mouse move with precision support\n const handleMouseMove = useCallback(\n (iconIndex: number, e: React.MouseEvent<HTMLSpanElement>) => {\n if (disabled || precision >= 1) return;\n const rect = e.currentTarget.getBoundingClientRect();\n let relativeX = (e.clientX - rect.left) / rect.width;\n if (rtl) relativeX = 1 - relativeX;\n const rawValue = iconIndex + relativeX;\n const snapped = snapToPrecision(rawValue, precision);\n const clamped = Math.max(precision, Math.min(snapped, max));\n setHoverValue(clamped);\n },\n [disabled, precision, rtl, max]\n );\n\n // Handle mouse leave\n const handleMouseLeave = useCallback(() => {\n setHoverValue(null);\n }, []);\n\n // Handle keyboard\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent) => {\n if (disabled) return;\n\n let newValue = currentValue;\n const step = precision < 1 ? precision : 1;\n\n if (e.key === 'ArrowRight' || e.key === 'ArrowUp') {\n e.preventDefault();\n newValue = Math.min(currentValue + step, max);\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowDown') {\n e.preventDefault();\n newValue = Math.max(currentValue - step, 0);\n } else if (e.key === 'Home') {\n e.preventDefault();\n newValue = 0;\n } else if (e.key === 'End') {\n e.preventDefault();\n newValue = max;\n }\n\n // Round to avoid floating point issues\n newValue = Math.round(newValue * 1000) / 1000;\n\n if (newValue !== currentValue) {\n if (!isControlled) {\n setInternalValue(newValue);\n }\n onChange?.(newValue);\n }\n },\n [currentValue, max, precision, disabled, isControlled, onChange]\n );\n\n // Get text for current value\n const getText = () => {\n if (!showText || !texts) return null;\n const wholeIndex = Math.ceil(displayValue) - 1;\n const baseText = texts[wholeIndex] || null;\n if (!baseText) return null;\n // For fractional hover values with precision < 1, append \"+\"\n if (precision < 1 && hoverValue !== null && hoverValue % 1 !== 0) {\n return `${baseText}+`;\n }\n return baseText;\n };\n\n // Format score display\n const getScoreDisplay = () => {\n if (precision < 1 && currentValue % 1 !== 0) {\n return currentValue.toFixed(1);\n }\n return currentValue;\n };\n\n // Generate classes\n const classPrefix = useClassPrefix();\n const rateClasses = usePrefixedClassNames('rate', {\n [`is-${size}`]: size,\n 'is-disabled': disabled,\n 'is-spaced': spaced,\n 'is-rtl': rtl,\n [`is-${color}`]: color,\n });\n\n const combinedClasses = classNames(\n rateClasses,\n bulmaHelperClasses,\n className\n );\n\n // Render a single icon based on priority: customIcon > iconName > default SVG\n const renderIcon = (\n iconIndex: number,\n isActive: boolean,\n fillPercent: number\n ) => {\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive,\n isHovered: hoverValue !== null && iconIndex < hoverValue,\n value: displayValue,\n fillPercent,\n };\n\n if (customIcon) {\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n );\n }\n\n return <StarIcon filled={isActive} />;\n };\n\n // Render partial icon with layered approach\n const renderPartialIcon = (iconIndex: number, fillPercent: number) => {\n if (customIcon) {\n // For custom icons, pass fillPercent and let consumer handle it\n const iconProps: RateIconProps = {\n index: iconIndex,\n isActive: fillPercent > 0,\n isHovered: hoverValue !== null && iconIndex < (hoverValue ?? 0),\n value: displayValue,\n fillPercent,\n };\n return customIcon(iconProps);\n }\n\n if (iconName) {\n return (\n <span\n className={prefixedClassNames(classPrefix, 'rate-icon-partial')}\n style={\n {\n '--rate-fill-percent': `${fillPercent}%`,\n } as React.CSSProperties\n }\n >\n <span className={prefixedClassNames(classPrefix, 'rate-icon-bg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n <span className={prefixedClassNames(classPrefix, 'rate-icon-fg')}>\n <Icon\n name={iconName}\n library={resolvedLibrary}\n variant={iconVariant}\n features={iconFeatures}\n />\n </span>\n </span>\n );\n }\n\n // Default SVG with clipPath for partial fill\n const clipId = `rate-clip-${iconIndex}`;\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n aria-hidden=\"true\"\n >\n <defs>\n <clipPath id={clipId}>\n <rect\n x=\"0\"\n y=\"0\"\n width={`${(fillPercent / 100) * 24}`}\n height=\"24\"\n />\n </clipPath>\n </defs>\n {/* Background: empty star */}\n <path\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n 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\"\n />\n {/* Foreground: filled portion */}\n <path\n clipPath={`url(#${clipId})`}\n fill=\"currentColor\"\n 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\"\n />\n </svg>\n );\n };\n\n // The star the value falls in is the checked radio, and it carries the\n // value: a radiogroup takes no aria-value* of its own. A fractional value\n // names that star by the value itself (\"3.5 stars\"). Both go by the value\n // as that name writes it, to hundredths, so a value a hair over a whole\n // number checks that number's star under its own name, and no two stars\n // share a name.\n const shownValue = Number(currentValue.toFixed(2));\n const checkedIndex =\n shownValue > 0 ? Math.min(Math.ceil(shownValue), max) - 1 : -1;\n\n // Render icons\n const renderIcons = () => {\n const icons = [];\n\n for (let i = 0; i < max; i++) {\n const iconIndex = rtl ? max - 1 - i : i;\n const fillPercent = getFillPercent(iconIndex, displayValue);\n const isActive = fillPercent === 100;\n const isHovered = hoverValue !== null && iconIndex < hoverValue;\n const isPartial = fillPercent > 0 && fillPercent < 100;\n\n const icon = isPartial\n ? renderPartialIcon(iconIndex, fillPercent)\n : renderIcon(iconIndex, isActive, fillPercent);\n\n icons.push(\n <span\n key={iconIndex}\n className={prefixedClassNames(classPrefix, 'rate-item', {\n 'is-active': isActive,\n 'is-hovered': isHovered,\n })}\n onClick={e => handleClick(iconIndex, e)}\n onMouseEnter={() => handleMouseEnter(iconIndex)}\n onMouseMove={e => handleMouseMove(iconIndex, e)}\n onMouseLeave={handleMouseLeave}\n id={`${starBaseId}-${iconIndex}`}\n role=\"radio\"\n aria-checked={iconIndex === checkedIndex}\n aria-label={\n iconIndex === checkedIndex && shownValue % 1 !== 0\n ? `${shownValue} stars`\n : `${iconIndex + 1} star${iconIndex === 0 ? '' : 's'}`\n }\n tabIndex={-1}\n >\n {icon}\n </span>\n );\n }\n\n return icons;\n };\n\n const text = getText();\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n const rateItemsClass = usePrefixedClassNames('rate-items');\n const rateScoreClass = usePrefixedClassNames('rate-score');\n const rateTextClass = usePrefixedClassNames('rate-text');\n const rateCustomTextClass = usePrefixedClassNames('rate-custom-text');\n\n const rateElement = (\n <div\n ref={ref}\n className={combinedClasses}\n role=\"radiogroup\"\n // Fallback name only: a wired label names the group via labelledby.\n aria-label={ariaLabelledBy ? undefined : 'Rating'}\n aria-labelledby={ariaLabelledBy}\n // Focus stays on the group, so point it at the checked star for\n // assistive technology to announce as the value changes.\n aria-activedescendant={\n checkedIndex >= 0 ? `${starBaseId}-${checkedIndex}` : undefined\n }\n tabIndex={disabled ? -1 : 0}\n onKeyDown={handleKeyDown}\n {...rest}\n >\n <div className={rateItemsClass}>{renderIcons()}</div>\n {showScore && (\n <span className={rateScoreClass}>{getScoreDisplay()}</span>\n )}\n {text && <span className={rateTextClass}>{text}</span>}\n {customText && (\n <span className={rateCustomTextClass}>{customText}</span>\n )}\n {name && (\n <input type=\"hidden\" name={name} value={currentValue} form={form} />\n )}\n </div>\n );\n\n let content = rateElement;\n\n if (rendersOwnControl('Rate', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nRate.displayName = 'Rate';\n\nexport default Rate;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;AA6GA;;AAEG;AACH,MAAM,QAAQ,GAAkC,CAAC,EAAE,MAAM,EAAE,MACzDA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAE,MAAM,GAAG,cA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EAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAA,CAAI,CACrE,CAAA,EAAA,CACG,CACP;IAED,IAAI,OAAO,GAAG,WAAW;IAEzB,IAAI,iBAAiB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAChD,QAAA,OAAO,GAAGA,GAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAE,OAAO,GAAW;IACxC;IAEA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,IAAI,CAAC,WAAW,GAAG,MAAM;;"}
@@ -65,7 +65,7 @@ fieldClassName, controlClassName,
65
65
  const helpClass = usePrefixedClassNames('help', {
66
66
  [`is-${messageColor}`]: !!messageColor,
67
67
  });
68
- let content = jsx(SelectBase, { ref: ref, id: controlId, ...selectProps });
68
+ let content = jsx(SelectBase, { ref: ref, ...selectProps, id: controlId });
69
69
  if (ownControl) {
70
70
  content = (jsx(Control, { iconLeft: iconLeft, iconLeftName: iconLeftName, iconLeftSize: iconLeftSize, hasIconsLeft: hasIconsLeft, isExpanded: isExpanded, size: controlSize, className: controlClassName, children: content }));
71
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../src/form/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport { usePrefixedClassNames } from '../helpers/classNames';\nimport { Field, FieldProps } from './Field';\nimport { Control, ControlBaseProps } from './Control';\nimport { SelectBase, SelectBaseProps } from './SelectBase';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/**\n * Props for the Select component.\n *\n * Composes Field, Control, and SelectBase into a single convenience component.\n * Supports all SelectBase props, plus Field-level (label, horizontal) and\n * Control-level (icons) props.\n * Inside an existing `Control` it renders no `Control` of its own, so its\n * Control-level props do nothing there and warn in development; set them on\n * that `Control` instead. Inside an outer `Field`, or a `Control` with no\n * `Field` around it, it renders no `Field` of its own either.\n * The exception is `label`, `message`, `horizontal` or `fieldClassName` in that\n * bare `Control`: it keeps a `Field` for them, nested in the `.control`, and\n * warns in development. Wrap the `Control` in a `Field` instead, and set the\n * `label`, `horizontal` and class name on that `Field`.\n */\nexport interface SelectProps extends SelectBaseProps {\n /** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */\n label?: React.ReactNode;\n /** Size for the label. */\n labelSize?: FieldProps['labelSize'];\n /** Props for the label element when the component renders its own `Field`; dropped inside an outer `Field` (use that `Field`'s `labelProps` instead). An explicit `htmlFor` key — even `undefined` — overrides the automatic association and no id is generated. */\n labelProps?: FieldProps['labelProps'];\n /** Horizontal field layout. */\n horizontal?: boolean;\n /**\n * Icon props for left icon.\n * Bulma gives control icons `pointer-events: none`, so a clickable node here\n * never receives a click. Put a button beside the input in its own addon `Control` instead.\n */\n iconLeft?: ControlBaseProps['iconLeft'];\n /** Shortcut for left icon name. */\n iconLeftName?: string;\n /** Shortcut for left icon size. */\n iconLeftSize?: ControlBaseProps['iconLeftSize'];\n /** Force left icon container. */\n hasIconsLeft?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Expand the control. */\n isExpanded?: boolean;\n /** Control size. */\n controlSize?: ControlBaseProps['size'];\n /** Help/validation message below the select. */\n message?: React.ReactNode;\n /** Bulma color for the message. */\n messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Additional CSS classes for the Field. */\n fieldClassName?: string;\n /** Additional CSS classes for the Control. */\n controlClassName?: string;\n}\n\n/**\n * The `Select` component provides a Bulma-styled dropdown for selecting one or more options.\n *\n * @function\n * @param {SelectProps} props - Props for Select.\n * @returns {JSX.Element} The composed field element.\n *\n * @example\n * <Select label=\"Country\" iconLeftName=\"globe\">\n * <option>United States</option>\n * <option>Canada</option>\n * </Select>\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n // Field props\n label,\n labelSize,\n labelProps,\n horizontal,\n // Control props\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n // Message props\n message,\n messageColor,\n // Container class overrides\n fieldClassName,\n controlClassName,\n // Everything else (including isLoading) goes to Select.\n // Note: isLoading on a select is rendered on the .select wrapper itself\n // (replacing the chevron with a spinner), not on .control — this matches\n // Bulma's documented behavior for `<div class=\"select is-loading\">`.\n ...selectProps\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Select', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n // Not isLoading, which the select draws itself and so keeps in a Control.\n const ownControl = rendersOwnControl('Select', {\n insideControl,\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n controlClassName,\n });\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: selectProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n\n let content = <SelectBase ref={ref} id={controlId} {...selectProps} />;\n\n if (ownControl) {\n content = (\n <Control\n iconLeft={iconLeft}\n iconLeftName={iconLeftName}\n iconLeftSize={iconLeftSize}\n hasIconsLeft={hasIconsLeft}\n isExpanded={isExpanded}\n size={controlSize}\n className={controlClassName}\n >\n {content}\n </Control>\n );\n }\n\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AAqEA;;;;;;;;;;;;AAYG;AACI,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE;AACE;AACA,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU;AACV;AACA,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW;AACX;AACA,OAAO,EACP,YAAY;AACZ;AACA,cAAc,EACd,gBAAgB;AAChB;AACA;AACA;AACA;AACA,GAAG,WAAW,EACf,EACD,GAAG,KACD;AACF,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;AACpC,IAAA,MAAM,aAAa,GAAG,gBAAgB,EAAE;AACxC,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE;QACzC,WAAW;QACX,aAAa;QACb,KAAK;QACL,OAAO;QACP,UAAU;QACV,cAAc;AACf,KAAA,CAAC;;AAEF,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,EAAE;QAC7C,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,WAAW;QACX,gBAAgB;AACjB,KAAA,CAAC;AACF,IAAA,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,cAAc,CAAC;QACpD,KAAK;QACL,EAAE,EAAE,WAAW,CAAC,EAAE;QA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usePrefixedClassNames } from '../helpers/classNames';\nimport { Field, FieldProps } from './Field';\nimport { Control, ControlBaseProps } from './Control';\nimport { SelectBase, SelectBaseProps } from './SelectBase';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/**\n * Props for the Select component.\n *\n * Composes Field, Control, and SelectBase into a single convenience component.\n * Supports all SelectBase props, plus Field-level (label, horizontal) and\n * Control-level (icons) props.\n * Inside an existing `Control` it renders no `Control` of its own, so its\n * Control-level props do nothing there and warn in development; set them on\n * that `Control` instead. Inside an outer `Field`, or a `Control` with no\n * `Field` around it, it renders no `Field` of its own either.\n * The exception is `label`, `message`, `horizontal` or `fieldClassName` in that\n * bare `Control`: it keeps a `Field` for them, nested in the `.control`, and\n * warns in development. Wrap the `Control` in a `Field` instead, and set the\n * `label`, `horizontal` and class name on that `Field`.\n */\nexport interface SelectProps extends SelectBaseProps {\n /** Field label. Automatically associated with the select via `htmlFor` — uses your `id` when provided, otherwise a generated one. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */\n label?: React.ReactNode;\n /** Size for the label. */\n labelSize?: FieldProps['labelSize'];\n /** Props for the label element when the component renders its own `Field`; dropped inside an outer `Field` (use that `Field`'s `labelProps` instead). An explicit `htmlFor` key — even `undefined` — overrides the automatic association and no id is generated. */\n labelProps?: FieldProps['labelProps'];\n /** Horizontal field layout. */\n horizontal?: boolean;\n /**\n * Icon props for left icon.\n * Bulma gives control icons `pointer-events: none`, so a clickable node here\n * never receives a click. Put a button beside the input in its own addon `Control` instead.\n */\n iconLeft?: ControlBaseProps['iconLeft'];\n /** Shortcut for left icon name. */\n iconLeftName?: string;\n /** Shortcut for left icon size. */\n iconLeftSize?: ControlBaseProps['iconLeftSize'];\n /** Force left icon container. */\n hasIconsLeft?: boolean;\n /**\n * Replaces the chevron with a loading spinner.\n * Under `prefers-reduced-motion: reduce` the spinner stops and stays\n * drawn (with bestax's CSS loaded).\n */\n isLoading?: boolean;\n /** Expand the control. */\n isExpanded?: boolean;\n /** Control size. */\n controlSize?: ControlBaseProps['size'];\n /** Help/validation message below the select. */\n message?: React.ReactNode;\n /** Bulma color for the message. */\n messageColor?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Additional CSS classes for the Field. */\n fieldClassName?: string;\n /** Additional CSS classes for the Control. */\n controlClassName?: string;\n}\n\n/**\n * The `Select` component provides a Bulma-styled dropdown for selecting one or more options.\n *\n * @function\n * @param {SelectProps} props - Props for Select.\n * @returns {JSX.Element} The composed field element.\n *\n * @example\n * <Select label=\"Country\" iconLeftName=\"globe\">\n * <option>United States</option>\n * <option>Canada</option>\n * </Select>\n */\nexport const Select = forwardRef<HTMLSelectElement, SelectProps>(\n (\n {\n // Field props\n label,\n labelSize,\n labelProps,\n horizontal,\n // Control props\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n // Message props\n message,\n messageColor,\n // Container class overrides\n fieldClassName,\n controlClassName,\n // Everything else (including isLoading) goes to Select.\n // Note: isLoading on a select is rendered on the .select wrapper itself\n // (replacing the chevron with a spinner), not on .control — this matches\n // Bulma's documented behavior for `<div class=\"select is-loading\">`.\n ...selectProps\n },\n ref\n ) => {\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Select', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n // Not isLoading, which the select draws itself and so keeps in a Control.\n const ownControl = rendersOwnControl('Select', {\n insideControl,\n iconLeft,\n iconLeftName,\n iconLeftSize,\n hasIconsLeft,\n isExpanded,\n controlSize,\n controlClassName,\n });\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: selectProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n\n let content = <SelectBase ref={ref} {...selectProps} id={controlId} />;\n\n if (ownControl) {\n content = (\n <Control\n iconLeft={iconLeft}\n iconLeftName={iconLeftName}\n iconLeftSize={iconLeftSize}\n hasIconsLeft={hasIconsLeft}\n isExpanded={isExpanded}\n size={controlSize}\n className={controlClassName}\n >\n {content}\n </Control>\n );\n }\n\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSelect.displayName = 'Select';\n\nexport default Select;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;AAqEA;;;;;;;;;;;;AAYG;AACI,MAAM,MAAM,GAAG,UAAU,CAC9B,CACE;AACE;AACA,KAAK,EACL,SAAS,EACT,UAAU,EACV,UAAU;AACV;AACA,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW;AACX;AACA,OAAO,EACP,YAAY;AACZ;AACA,cAAc,EACd,gBAAgB;AAChB;AACA;AACA;AACA;AACA,GAAG,WAAW,EACf,EACD,GAAG,KACD;AACF,IAAA,MAAM,WAAW,GAAG,cAAc,EAAE;AACpC,IAAA,MAAM,aAAa,GAAG,gBAAgB,EAAE;AACxC,IAAA,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,EAAE;QACzC,WAAW;QACX,aAAa;QACb,KAAK;QACL,OAAO;QACP,UAAU;QACV,cAAc;AACf,KAAA,CAAC;;AAEF,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ,EAAE;QAC7C,aAAa;QACb,QAAQ;QACR,YAAY;QACZ,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,WAAW;QACX,gBAAgB;AACjB,KAAA,CAAC;AACF,IAAA,MAAM,EAAE,SAAS,EAAE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@@ -375,7 +375,9 @@ const Slider = forwardRef((props, ref) => {
375
375
  // --- Single slider ---
376
376
  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: {
377
377
  '--slider-progress': `${progressSingle}%`,
378
- }, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), id: controlId, ...rest }), tooltipMode !== 'hidden' && (jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
378
+ }, "aria-valuenow": currentSingle, "aria-valuemin": min, "aria-valuemax": max, "aria-orientation": isVertical ? 'vertical' : undefined, "aria-label": ariaLabel, ...getAriaProps(currentSingle), ...rest,
379
+ // After the spread: an undefined `id` key in rest would wipe it.
380
+ id: controlId }), tooltipMode !== 'hidden' && (jsx("output", { ref: outputRef, className: prefixedClassNames(classPrefix, 'slider-output', {
379
381
  'is-visible': showTipLow,
380
382
  'is-flipped': flipped,
381
383
  'is-flipped-left': isVertical && verticalFlippedLeft,
@@ -403,7 +405,7 @@ const Slider = forwardRef((props, ref) => {
403
405
  : {
404
406
  '--slider-progress-low': `${progressLow}%`,
405
407
  '--slider-progress-high': `${progressHigh}%`,
406
- } }), 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 } : {}) }), 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', {
408
+ } }), 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, id: controlId, ...(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', {
407
409
  'is-visible': showTipLow,
408
410
  'is-flipped': flipped,
409
411
  'is-flipped-left': isVertical && verticalFlippedLeft,
@@ -1 +1 @@
1
- {"version":3,"file":"Slider.js","sources":["../../../src/form/Slider.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useCallback,\n useRef,\n useMemo,\n useLayoutEffect,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useClassPrefix } from '../helpers/Config';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/** Valid sizes for the Slider component. */\nexport type SliderSize = 'small' | 'medium' | 'large';\n\n/** Valid colors for the Slider component. */\nexport type SliderColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Tooltip display mode for the Slider component. */\nexport type SliderTooltip = 'auto' | 'always' | 'hidden';\n\n/** Orientation of the Slider component. */\nexport type SliderOrientation = 'horizontal' | 'vertical';\n\n/**\n * A tick mark displayed along the Slider track.\n */\nexport interface SliderMark {\n /** Controlled value. */\n value: number;\n /** Optional label rendered below the tick mark. */\n label?: React.ReactNode;\n}\n\n/**\n * Shared base props for single and range Slider modes.\n */\ninterface SliderBaseProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>,\n FormFieldProps {\n /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the label targets the low (minimum) thumb. Dropped inside an outer `Field` (label that `Field` yourself). */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Minimum value. */\n min?: number;\n /** Maximum value. */\n max?: number;\n /** Step increment (default: 1). */\n step?: number;\n /** Size variant. */\n size?: SliderSize;\n /** Color variant. */\n color?: SliderColor;\n /** Use rounded track ends. */\n isRounded?: boolean;\n /** Use circular thumb. */\n isCircle?: boolean;\n /** Show current value tooltip. */\n showOutput?: boolean;\n /** Controls tooltip visibility on the thumb. */\n tooltip?: SliderTooltip;\n /** Shows tick marks along the track. */\n ticks?: boolean;\n /** Custom labeled marks along the track. Each mark has `{ value: number; label?: ReactNode }`. */\n marks?: SliderMark[];\n /** Orientation of the slider. */\n orientation?: SliderOrientation;\n /** Function to scale the displayed value. */\n scale?: (value: number) => number;\n /** Function to generate the `aria-valuetext` attribute. */\n getAriaValueText?: (value: number) => string;\n /** Format function for output display. */\n formatOutput?: (value: number) => string;\n}\n\n/**\n * Props for the Slider in single-value mode.\n */\nexport interface SliderSingleProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range?: false;\n /** Controlled value. */\n value?: number;\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: number;\n /** Callback when value changes. */\n onChange?: (value: number) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: never;\n /** ARIA label(s) for the slider thumb(s). */\n ariaLabel?: string;\n}\n\n/**\n * Props for the Slider in range (dual-thumb) mode.\n */\nexport interface SliderRangeProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range: true;\n /** Controlled value. */\n value?: [number, number];\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: [number, number];\n /** Callback when value changes. */\n onChange?: (value: [number, number]) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: number;\n /** ARIA label(s) for the slider thumb(s). */\n ariaLabel?: [string, string];\n /** Form field name for the low thumb. Use this in range mode so each thumb submits with its own name. */\n nameLow?: string;\n /** Form field name for the high thumb. */\n nameHigh?: string;\n}\n\n/**\n * Props for the Slider component — a discriminated union of single and range modes.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {boolean} [disabled=false] - Whether the slider is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.\n */\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\n/**\n * Helper to compute tick positions.\n * If `marks` are provided, those positions are used.\n * If `ticks` is true, generates ticks at every step (capped at 100).\n */\nfunction getTickPositions(\n min: number,\n max: number,\n step: number,\n ticks?: boolean,\n marks?: SliderMark[]\n): SliderMark[] {\n if (marks && marks.length > 0) return marks;\n if (!ticks) return [];\n const positions: SliderMark[] = [];\n const count = Math.round((max - min) / step);\n if (count > 100) {\n // Cap at 100 ticks to prevent perf issues\n const tickStep = (max - min) / 100;\n // Skip first (i=0) and last (i=100) — no ticks at endpoints\n for (let i = 1; i < 100; i++) {\n positions.push({ value: min + i * tickStep });\n }\n } else {\n // Skip first (i=0) and last (i=count) — no ticks at endpoints\n for (let i = 1; i < count; i++) {\n positions.push({ value: min + i * step });\n }\n }\n return positions;\n}\n\n/**\n * The `Slider` component provides a range slider input for selecting values within a range.\n *\n * @function\n * @param {SliderProps} props - Props for the Slider component.\n * @returns {JSX.Element} The rendered slider element.\n *\n * @example\n * // Basic slider\n * <Slider defaultValue={50} />\n *\n * @example\n * // Range slider\n * <Slider range defaultValue={[20, 80]} onChange={([low, high]) => {}} />\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(\n (props, ref) => {\n // Pull out fields that differ between the single and range branches\n // *first*, by narrowing on the `range` discriminator. We then destructure\n // the remaining base props from a `SliderBaseProps` view of `props`.\n //\n // Why not destructure everything via `props as SliderRangeProps & SliderSingleProps`?\n // Because intersecting the two halves of a discriminated union collapses\n // overlapping fields (e.g. `range: true & false`, `value: number & [number, number]`,\n // `onChange`, `ariaLabel`) to `never`, which breaks call sites and rest spreads.\n let range: boolean | undefined;\n let controlledValue: number | [number, number] | undefined;\n let defaultValue: number | [number, number] | undefined;\n let onChange:\n ((v: number) => void) | ((v: [number, number]) => void) | undefined;\n let ariaLabel: string | [string, string] | undefined;\n let minDistance = 0;\n let nameLow: string | undefined;\n let nameHigh: string | undefined;\n if (props.range === true) {\n range = true;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n minDistance = props.minDistance ?? 0;\n nameLow = props.nameLow;\n nameHigh = props.nameHigh;\n } else {\n range = props.range;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n }\n\n // Destructure base / shared props from a `SliderBaseProps` view. None of\n // these fields differ between the two branches, so this view is safe.\n const {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n min = 0,\n max = 100,\n step = 1,\n size,\n color,\n isRounded = false,\n isCircle = false,\n disabled = false,\n showOutput = false,\n tooltip,\n ticks,\n marks,\n orientation = 'horizontal',\n scale,\n getAriaValueText,\n formatOutput,\n className,\n // Strip the discriminated/union fields from `restProps` so they don't\n // flow back into `useBulmaClasses` / spread onto inputs.\n range: _range,\n value: _value,\n defaultValue: _defaultValue,\n onChange: _onChange,\n ariaLabel: _ariaLabel,\n minDistance: _minDistance,\n nameLow: _nameLow,\n nameHigh: _nameHigh,\n ...restProps\n } = props as SliderBaseProps & {\n range?: boolean;\n value?: number | [number, number];\n defaultValue?: number | [number, number];\n onChange?: (v: never) => void;\n ariaLabel?: string | [string, string];\n minDistance?: number;\n nameLow?: string;\n nameHigh?: string;\n };\n void _range;\n void _value;\n void _defaultValue;\n void _onChange;\n void _ariaLabel;\n void _minDistance;\n void _nameLow;\n void _nameHigh;\n\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Slider', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(restProps);\n // In range mode the low thumb carries `rest` (and any user id), so the\n // label targets it; each thumb keeps its own aria-label for AT.\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: restProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n\n // Resolve tooltip mode: explicit tooltip prop takes precedence, else showOutput maps to 'auto'\n const tooltipMode: SliderTooltip =\n tooltip ?? (showOutput ? 'auto' : 'hidden');\n\n // --- Range mode state ---\n const [internalRange, setInternalRange] = useState<[number, number]>(() =>\n range ? ((defaultValue as [number, number]) ?? [min, max]) : [min, min]\n );\n const [internalSingle, setInternalSingle] = useState<number>(() =>\n !range ? ((defaultValue as number) ?? 0) : 0\n );\n const [showTooltip, setShowTooltip] = useState(false);\n const [showTooltipHigh, setShowTooltipHigh] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputHighRef = useRef<HTMLInputElement>(null);\n const outputRef = useRef<HTMLOutputElement>(null);\n const outputHighRef = useRef<HTMLOutputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [flipped, setFlipped] = useState(false);\n const [flippedHigh, setFlippedHigh] = useState(false);\n const [nudgeX, setNudgeX] = useState(0);\n const [nudgeXHigh, setNudgeXHigh] = useState(0);\n const [verticalFlippedLeft, setVerticalFlippedLeft] = useState(false);\n\n const isControlled = controlledValue !== undefined;\n\n // Current values\n const currentRange: [number, number] = range\n ? isControlled\n ? (controlledValue as [number, number])\n : internalRange\n : [0, 0];\n const currentSingle: number = !range\n ? isControlled\n ? (controlledValue as number)\n : internalSingle\n : 0;\n\n // Progress percentages\n const progressSingle = !range\n ? ((currentSingle - min) / (max - min)) * 100\n : 0;\n const progressLow = range\n ? ((currentRange[0] - min) / (max - min)) * 100\n : 0;\n const progressHigh = range\n ? ((currentRange[1] - min) / (max - min)) * 100\n : 0;\n\n // Scale helper\n const scaleValue = useCallback(\n (v: number) => (scale ? scale(v) : v),\n [scale]\n );\n\n // Format helper\n const formatValue = useCallback(\n (v: number) => {\n const scaled = scaleValue(v);\n return formatOutput ? formatOutput(scaled) : scaled.toString();\n },\n [formatOutput, scaleValue]\n );\n\n // --- Handlers ---\n const handleSingleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = parseFloat(e.target.value);\n if (!isControlled) setInternalSingle(newValue);\n (onChange as ((v: number) => void) | undefined)?.(newValue);\n },\n [isControlled, onChange]\n );\n\n const handleRangeLowChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.min(raw, currentRange[1] - minDistance);\n const newRange: [number, number] = [clamped, currentRange[1]];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n const handleRangeHighChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.max(raw, currentRange[0] + minDistance);\n const newRange: [number, number] = [currentRange[0], clamped];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n // Key handler for Home/End\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Home') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(min);\n (onChange as ((v: number) => void) | undefined)?.(min);\n }\n } else if (e.key === 'End') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(max);\n (onChange as ((v: number) => void) | undefined)?.(max);\n }\n }\n },\n [range, isControlled, onChange, min, max]\n );\n\n // Tick positions\n const tickPositions = useMemo(\n () => getTickPositions(min, max, step, ticks, marks),\n [min, max, step, ticks, marks]\n );\n\n const hasLabels = tickPositions.some(t => t.label !== undefined);\n const isVertical = orientation === 'vertical';\n\n // Compute corrected thumb position CSS calc expression.\n // The browser insets the range input thumb by half its size from each edge,\n // so the tooltip left must account for this to align with the thumb center.\n const thumbVarName = size\n ? `slider-thumb-size-${size}`\n : 'slider-thumb-size';\n const thumbCssVar = `var(--bulma-${thumbVarName})`;\n const effectiveThumbExpr = isCircle\n ? `(${thumbCssVar} * 1.2)`\n : thumbCssVar;\n\n const getThumbLeft = (progressPct: number) => {\n const fraction = progressPct / 100;\n return `calc(${effectiveThumbExpr} / 2 + ${fraction} * (100% - ${effectiveThumbExpr}))`;\n };\n\n // Vertical tooltip offset: position to the right or left of the thumb\n const verticalTooltipOffset = `calc(50% + ${effectiveThumbExpr} / 2 + 0.5rem)`;\n\n // Get effective thumb size in px for nudge computation\n const getThumbSizePx = (): number => {\n const el = inputRef.current;\n if (!el) return 0;\n const style = getComputedStyle(el);\n const raw = style.getPropertyValue(`--bulma-${thumbVarName}`).trim();\n const value = parseFloat(raw);\n if (isNaN(value)) return 0;\n let px: number;\n if (raw.includes('rem')) {\n const rootFs =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n px = value * rootFs;\n } else {\n px = value;\n }\n return isCircle ? px * 1.2 : px;\n };\n\n // Generate wrapper classes\n const classPrefix = useClassPrefix();\n const sliderClasses = usePrefixedClassNames('slider', {\n [`is-${size}`]: size,\n [`is-${color}`]: color,\n 'is-rounded': isRounded,\n 'is-circle': isCircle,\n 'is-disabled': disabled,\n 'has-output': tooltipMode !== 'hidden',\n 'has-output-always': tooltipMode === 'always',\n 'is-vertical': isVertical,\n 'is-range': range,\n 'has-ticks': tickPositions.length > 0,\n 'has-tick-labels': hasLabels,\n });\n\n const combinedClasses = classNames(\n sliderClasses,\n bulmaHelperClasses,\n className\n );\n\n // Combined ref for the first (or only) input\n const combinedRef = (node: HTMLInputElement | null) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n }\n };\n\n // Tooltip show/hide for auto mode\n const showTipLow =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltip);\n const showTipHigh =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltipHigh);\n\n // Aria value text\n const getAriaProps = (value: number) => {\n const ariaProps: Record<string, string> = {};\n if (getAriaValueText) {\n ariaProps['aria-valuetext'] = getAriaValueText(value);\n } else if (scale) {\n ariaProps['aria-valuetext'] = scaleValue(value).toString();\n }\n return ariaProps;\n };\n\n // Detect tooltip overflow: flip vertically if clipped at top,\n // nudge horizontally if clipped at left/right edge.\n // We compute the un-nudged tooltip position from the progress %\n // and wrapper rect to avoid feedback loops.\n const computeNudge = useCallback(\n (\n el: HTMLElement,\n wrapper: HTMLElement,\n progressPct: number,\n thumbSizePx: number\n ): number => {\n const wr = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n // Corrected center: accounts for thumb inset from track edges\n const fraction = progressPct / 100;\n const centerX =\n wr.left + thumbSizePx / 2 + fraction * (wr.width - thumbSizePx);\n const tooltipLeft = centerX - tooltipWidth / 2;\n const tooltipRight = centerX + tooltipWidth / 2;\n if (tooltipLeft < wr.left) {\n return wr.left - tooltipLeft; // nudge right\n }\n if (tooltipRight > wr.right) {\n return wr.right - tooltipRight; // nudge left (negative)\n }\n return 0;\n },\n []\n );\n\n useLayoutEffect(() => {\n if (isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlipped(wrapperTop < tooltipHeight);\n const pct = range ? progressLow : progressSingle;\n const thumbPx = getThumbSizePx();\n setNudgeX(computeNudge(el, wrapper, pct, thumbPx));\n }\n });\n\n useLayoutEffect(() => {\n if (isVertical || !range) return;\n const wrapper = wrapperRef.current;\n const el = outputHighRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlippedHigh(wrapperTop < tooltipHeight);\n const thumbPx = getThumbSizePx();\n setNudgeXHigh(computeNudge(el, wrapper, progressHigh, thumbPx));\n }\n });\n\n // Detect vertical tooltip overflow: flip to left if no space on right\n useLayoutEffect(() => {\n if (!isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (!wrapper || !el) return;\n const wrapperRect = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n const thumbPx = getThumbSizePx();\n const gap = 8; // 0.5rem\n // Tooltip right edge if placed to the right of the thumb\n const tooltipRightEdge =\n wrapperRect.left +\n wrapperRect.width / 2 +\n thumbPx / 2 +\n gap +\n tooltipWidth;\n setVerticalFlippedLeft(tooltipRightEdge > window.innerWidth);\n });\n\n // Vertical wrapper style\n const wrapperStyle = isVertical\n ? ({\n height: 'var(--bulma-slider-vertical-height, 200px)',\n } as React.CSSProperties)\n : undefined;\n\n // Render ticks\n const renderTicks = () => {\n if (tickPositions.length === 0) return null;\n return (\n <div className={prefixedClassNames(classPrefix, 'slider-ticks')}>\n {tickPositions.map((tick, i) => {\n const pct = ((tick.value - min) / (max - min)) * 100;\n const posStyle = isVertical\n ? { bottom: `${pct}%` }\n : { left: `${pct}%` };\n const isEndpoint = tick.value === min || tick.value === max;\n return (\n <span\n key={i}\n className={prefixedClassNames(classPrefix, 'slider-tick', {\n 'is-endpoint': isEndpoint,\n })}\n style={posStyle}\n >\n {tick.label !== undefined && (\n <span\n className={prefixedClassNames(\n classPrefix,\n 'slider-tick-label'\n )}\n >\n {tick.label}\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n };\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n // --- Single slider ---\n const sliderElement = !range ? (\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentSingle}\n disabled={disabled}\n onChange={handleSingleChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(classPrefix, 'slider-input')}\n style={\n {\n '--slider-progress': `${progressSingle}%`,\n } as React.CSSProperties\n }\n aria-valuenow={currentSingle}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={ariaLabel as string | undefined}\n {...getAriaProps(currentSingle)}\n id={controlId}\n {...rest}\n />\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(classPrefix, 'slider-output', {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n })}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressSingle),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressSingle),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressSingle),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentSingle)}\n </output>\n )}\n {renderTicks()}\n </div>\n ) : (\n // --- Range slider ---\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n {/* Visible track background */}\n <div\n className={prefixedClassNames(classPrefix, 'slider-track')}\n style={\n isVertical\n ? ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n : ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n }\n />\n {/* Low thumb. nameLow overrides any `name` from rest so each thumb has its own form field. */}\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[0]}\n disabled={disabled}\n onChange={handleRangeLowChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-low'\n )}\n aria-valuenow={currentRange[0]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={\n (ariaLabel as [string, string] | undefined)?.[0] ?? 'Minimum value'\n }\n {...getAriaProps(currentRange[0])}\n id={controlId}\n {...rest}\n {...(nameLow !== undefined ? { name: nameLow } : {})}\n />\n {/* High thumb */}\n <input\n ref={inputHighRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[1]}\n disabled={disabled}\n onChange={handleRangeHighChange}\n onMouseEnter={() => setShowTooltipHigh(true)}\n onMouseLeave={() => setShowTooltipHigh(false)}\n onFocus={() => setShowTooltipHigh(true)}\n onBlur={() => setShowTooltipHigh(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-high'\n )}\n aria-valuenow={currentRange[1]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={\n (ariaLabel as [string, string] | undefined)?.[1] ?? 'Maximum value'\n }\n {...getAriaProps(currentRange[1])}\n name={nameHigh}\n />\n {/* Low tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-low',\n {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressLow),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressLow),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressLow),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[0])}\n </output>\n )}\n {/* High tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputHighRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-high',\n {\n 'is-visible': showTipHigh,\n 'is-flipped': flippedHigh,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressHigh),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressHigh),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressHigh),\n transform: `translateX(calc(-50% + ${nudgeXHigh}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeXHigh}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[1])}\n </output>\n )}\n {renderTicks()}\n </div>\n );\n\n let content = sliderElement;\n\n if (rendersOwnControl('Slider', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;AA2KA;;;;AAIG;AACH,SAAS,gBAAgB,CACvB,GAAW,EACX,GAAW,EACX,IAAY,EACZ,KAAe,EACf,KAAoB,EAAA;AAEpB,IAAA,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;AAC3C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;IACrB,MAAM,SAAS,GAAiB,EAAE;AAClC,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,IAAI,IAAI,CAAC;AAC5C,IAAA,IAAI,KAAK,GAAG,GAAG,EAAE;;QAEf,MAAM,QAAQ,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,GAAG;;AAElC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;AAC5B,YAAA,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,QAAQ,EAAE,CAAC;QAC/C;IACF;SAAO;;AAEL,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;AAC9B,YAAA,SAAS,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC;QAC3C;IACF;AACA,IAAA,OAAO,SAAS;AAClB;AAEA;;;;;;;;;;;;;;AAcG;AACI,MAAM,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C;wBAChC,SAAS,EAAE,CAAA,uBAAA,EAA0B,UAAU,CAAA,IAAA,CAAM;wBACrD,8BAA8B,EAAE,CAAA,WAAA,EAAc,UAAU,CAAA,GAAA,CAAK;AACtC,qBAAA,EAAA,QAAA,EAG9B,WAAW,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAA,CACtB,CACV,EACA,WAAW,EAAE,CAAA,EAAA,CACV,CACP;IAED,IAAI,OAAO,GAAG,aAAa;IAE3B,IAAI,iBAAiB,CAAC,QAAQ,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE;AAClD,QAAA,OAAO,GAAGA,GAAA,CAAC,OAAO,EAAA,EAAA,QAAA,EAAE,OAAO,GAAW;IACxC;IAEA,IAAI,QAAQ,EAAE;AACZ,QAAA,QACEC,IAAA,CAAC,KAAK,EAAA,EACJ,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,eAAe,EAC3B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
1
+ {"version":3,"file":"Slider.js","sources":["../../../src/form/Slider.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useCallback,\n useRef,\n useMemo,\n useLayoutEffect,\n} from 'react';\nimport {\n classNames,\n prefixedClassNames,\n usePrefixedClassNames,\n} from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { useClassPrefix } from '../helpers/Config';\nimport {\n useInsideField,\n useInsideControl,\n rendersOwnField,\n rendersOwnControl,\n} from './FormContext';\nimport { Field } from './Field';\nimport { Control } from './Control';\nimport { FormFieldProps } from './fieldProps';\nimport { useAutoLabelId } from './useAutoLabelId';\n\n/** Valid sizes for the Slider component. */\nexport type SliderSize = 'small' | 'medium' | 'large';\n\n/** Valid colors for the Slider component. */\nexport type SliderColor =\n 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n\n/** Tooltip display mode for the Slider component. */\nexport type SliderTooltip = 'auto' | 'always' | 'hidden';\n\n/** Orientation of the Slider component. */\nexport type SliderOrientation = 'horizontal' | 'vertical';\n\n/**\n * A tick mark displayed along the Slider track.\n */\nexport interface SliderMark {\n /** Controlled value. */\n value: number;\n /** Optional label rendered below the tick mark. */\n label?: React.ReactNode;\n}\n\n/**\n * Shared base props for single and range Slider modes.\n */\ninterface SliderBaseProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'color' | 'size' | 'onChange' | 'value' | 'defaultValue'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'>,\n FormFieldProps {\n /** Field label. Automatically associated with the slider input via `htmlFor` — uses your `id` when provided, otherwise a generated one. In range mode the label targets the low (minimum) thumb. Dropped inside an outer `Field`, whose own label associates instead when that `Field` generates a target id (not `grouped`/`hasAddons`, no explicit `labelProps.htmlFor`). */\n label?: React.ReactNode;\n /** Props for the label element. An explicit `htmlFor` here overrides the automatic association (no id is generated then). */\n labelProps?: React.LabelHTMLAttributes<HTMLLabelElement> & {\n [key: string]: unknown;\n };\n /** Minimum value. */\n min?: number;\n /** Maximum value. */\n max?: number;\n /** Step increment (default: 1). */\n step?: number;\n /** Size variant. */\n size?: SliderSize;\n /** Color variant. */\n color?: SliderColor;\n /** Use rounded track ends. */\n isRounded?: boolean;\n /** Use circular thumb. */\n isCircle?: boolean;\n /** Show current value tooltip. */\n showOutput?: boolean;\n /** Controls tooltip visibility on the thumb. */\n tooltip?: SliderTooltip;\n /** Shows tick marks along the track. */\n ticks?: boolean;\n /** Custom labeled marks along the track. Each mark has `{ value: number; label?: ReactNode }`. */\n marks?: SliderMark[];\n /** Orientation of the slider. */\n orientation?: SliderOrientation;\n /** Function to scale the displayed value. */\n scale?: (value: number) => number;\n /** Function to generate the `aria-valuetext` attribute. */\n getAriaValueText?: (value: number) => string;\n /** Format function for output display. */\n formatOutput?: (value: number) => string;\n}\n\n/**\n * Props for the Slider in single-value mode.\n */\nexport interface SliderSingleProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range?: false;\n /** Controlled value. */\n value?: number;\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: number;\n /** Callback when value changes. */\n onChange?: (value: number) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: never;\n /** ARIA label(s) for the slider thumb(s). */\n ariaLabel?: string;\n}\n\n/**\n * Props for the Slider in range (dual-thumb) mode.\n */\nexport interface SliderRangeProps extends SliderBaseProps {\n /**\n * Enables range mode with two thumbs.\n * @defaultValue false\n */\n range: true;\n /** Controlled value. */\n value?: [number, number];\n /**\n * Default value for uncontrolled usage.\n * @defaultValue 0\n */\n defaultValue?: [number, number];\n /** Callback when value changes. */\n onChange?: (value: [number, number]) => void;\n /**\n * Minimum distance between thumbs in range mode.\n * @defaultValue 0\n */\n minDistance?: number;\n /** ARIA label(s) for the slider thumb(s). */\n ariaLabel?: [string, string];\n /** Form field name for the low thumb. Use this in range mode so each thumb submits with its own name. */\n nameLow?: string;\n /** Form field name for the high thumb. */\n nameHigh?: string;\n}\n\n/**\n * Props for the Slider component — a discriminated union of single and range modes.\n * Inside an existing `Control` it renders no `Control` of its own. Inside an\n * outer `Field`, or a `Control` with no `Field` around it, it renders no\n * `Field` of its own either. The exception is `label`, `message`, `horizontal`\n * or `fieldClassName` in that bare `Control`: it keeps a `Field` for them,\n * nested in the `.control`, and warns in development. Wrap the `Control` in a\n * `Field` instead, and set the `label`, `horizontal` and class name on that\n * `Field`.\n * @extraProp {boolean} [disabled=false] - Whether the slider is disabled.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the input element.\n */\nexport type SliderProps = SliderSingleProps | SliderRangeProps;\n\n/**\n * Helper to compute tick positions.\n * If `marks` are provided, those positions are used.\n * If `ticks` is true, generates ticks at every step (capped at 100).\n */\nfunction getTickPositions(\n min: number,\n max: number,\n step: number,\n ticks?: boolean,\n marks?: SliderMark[]\n): SliderMark[] {\n if (marks && marks.length > 0) return marks;\n if (!ticks) return [];\n const positions: SliderMark[] = [];\n const count = Math.round((max - min) / step);\n if (count > 100) {\n // Cap at 100 ticks to prevent perf issues\n const tickStep = (max - min) / 100;\n // Skip first (i=0) and last (i=100) — no ticks at endpoints\n for (let i = 1; i < 100; i++) {\n positions.push({ value: min + i * tickStep });\n }\n } else {\n // Skip first (i=0) and last (i=count) — no ticks at endpoints\n for (let i = 1; i < count; i++) {\n positions.push({ value: min + i * step });\n }\n }\n return positions;\n}\n\n/**\n * The `Slider` component provides a range slider input for selecting values within a range.\n *\n * @function\n * @param {SliderProps} props - Props for the Slider component.\n * @returns {JSX.Element} The rendered slider element.\n *\n * @example\n * // Basic slider\n * <Slider defaultValue={50} />\n *\n * @example\n * // Range slider\n * <Slider range defaultValue={[20, 80]} onChange={([low, high]) => {}} />\n */\nexport const Slider = forwardRef<HTMLInputElement, SliderProps>(\n (props, ref) => {\n // Pull out fields that differ between the single and range branches\n // *first*, by narrowing on the `range` discriminator. We then destructure\n // the remaining base props from a `SliderBaseProps` view of `props`.\n //\n // Why not destructure everything via `props as SliderRangeProps & SliderSingleProps`?\n // Because intersecting the two halves of a discriminated union collapses\n // overlapping fields (e.g. `range: true & false`, `value: number & [number, number]`,\n // `onChange`, `ariaLabel`) to `never`, which breaks call sites and rest spreads.\n let range: boolean | undefined;\n let controlledValue: number | [number, number] | undefined;\n let defaultValue: number | [number, number] | undefined;\n let onChange:\n ((v: number) => void) | ((v: [number, number]) => void) | undefined;\n let ariaLabel: string | [string, string] | undefined;\n let minDistance = 0;\n let nameLow: string | undefined;\n let nameHigh: string | undefined;\n if (props.range === true) {\n range = true;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n minDistance = props.minDistance ?? 0;\n nameLow = props.nameLow;\n nameHigh = props.nameHigh;\n } else {\n range = props.range;\n controlledValue = props.value;\n defaultValue = props.defaultValue;\n onChange = props.onChange;\n ariaLabel = props.ariaLabel;\n }\n\n // Destructure base / shared props from a `SliderBaseProps` view. None of\n // these fields differ between the two branches, so this view is safe.\n const {\n label,\n labelSize,\n labelProps,\n horizontal,\n message,\n messageColor,\n fieldClassName,\n min = 0,\n max = 100,\n step = 1,\n size,\n color,\n isRounded = false,\n isCircle = false,\n disabled = false,\n showOutput = false,\n tooltip,\n ticks,\n marks,\n orientation = 'horizontal',\n scale,\n getAriaValueText,\n formatOutput,\n className,\n // Strip the discriminated/union fields from `restProps` so they don't\n // flow back into `useBulmaClasses` / spread onto inputs.\n range: _range,\n value: _value,\n defaultValue: _defaultValue,\n onChange: _onChange,\n ariaLabel: _ariaLabel,\n minDistance: _minDistance,\n nameLow: _nameLow,\n nameHigh: _nameHigh,\n ...restProps\n } = props as SliderBaseProps & {\n range?: boolean;\n value?: number | [number, number];\n defaultValue?: number | [number, number];\n onChange?: (v: never) => void;\n ariaLabel?: string | [string, string];\n minDistance?: number;\n nameLow?: string;\n nameHigh?: string;\n };\n void _range;\n void _value;\n void _defaultValue;\n void _onChange;\n void _ariaLabel;\n void _minDistance;\n void _nameLow;\n void _nameHigh;\n\n const insideField = useInsideField();\n const insideControl = useInsideControl();\n const ownField = rendersOwnField('Slider', {\n insideField,\n insideControl,\n label,\n message,\n horizontal,\n fieldClassName,\n });\n const { bulmaHelperClasses, rest } = useBulmaClasses(restProps);\n // In range mode the low thumb carries `rest` (and any user id), so the\n // label targets it; each thumb keeps its own aria-label for AT.\n const { controlId, fieldLabelProps } = useAutoLabelId({\n label,\n id: restProps.id,\n labelProps,\n rendersLabel: ownField,\n });\n\n // Resolve tooltip mode: explicit tooltip prop takes precedence, else showOutput maps to 'auto'\n const tooltipMode: SliderTooltip =\n tooltip ?? (showOutput ? 'auto' : 'hidden');\n\n // --- Range mode state ---\n const [internalRange, setInternalRange] = useState<[number, number]>(() =>\n range ? ((defaultValue as [number, number]) ?? [min, max]) : [min, min]\n );\n const [internalSingle, setInternalSingle] = useState<number>(() =>\n !range ? ((defaultValue as number) ?? 0) : 0\n );\n const [showTooltip, setShowTooltip] = useState(false);\n const [showTooltipHigh, setShowTooltipHigh] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n const inputHighRef = useRef<HTMLInputElement>(null);\n const outputRef = useRef<HTMLOutputElement>(null);\n const outputHighRef = useRef<HTMLOutputElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const [flipped, setFlipped] = useState(false);\n const [flippedHigh, setFlippedHigh] = useState(false);\n const [nudgeX, setNudgeX] = useState(0);\n const [nudgeXHigh, setNudgeXHigh] = useState(0);\n const [verticalFlippedLeft, setVerticalFlippedLeft] = useState(false);\n\n const isControlled = controlledValue !== undefined;\n\n // Current values\n const currentRange: [number, number] = range\n ? isControlled\n ? (controlledValue as [number, number])\n : internalRange\n : [0, 0];\n const currentSingle: number = !range\n ? isControlled\n ? (controlledValue as number)\n : internalSingle\n : 0;\n\n // Progress percentages\n const progressSingle = !range\n ? ((currentSingle - min) / (max - min)) * 100\n : 0;\n const progressLow = range\n ? ((currentRange[0] - min) / (max - min)) * 100\n : 0;\n const progressHigh = range\n ? ((currentRange[1] - min) / (max - min)) * 100\n : 0;\n\n // Scale helper\n const scaleValue = useCallback(\n (v: number) => (scale ? scale(v) : v),\n [scale]\n );\n\n // Format helper\n const formatValue = useCallback(\n (v: number) => {\n const scaled = scaleValue(v);\n return formatOutput ? formatOutput(scaled) : scaled.toString();\n },\n [formatOutput, scaleValue]\n );\n\n // --- Handlers ---\n const handleSingleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = parseFloat(e.target.value);\n if (!isControlled) setInternalSingle(newValue);\n (onChange as ((v: number) => void) | undefined)?.(newValue);\n },\n [isControlled, onChange]\n );\n\n const handleRangeLowChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.min(raw, currentRange[1] - minDistance);\n const newRange: [number, number] = [clamped, currentRange[1]];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n const handleRangeHighChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const raw = parseFloat(e.target.value);\n const clamped = Math.max(raw, currentRange[0] + minDistance);\n const newRange: [number, number] = [currentRange[0], clamped];\n if (!isControlled) setInternalRange(newRange);\n (onChange as ((v: [number, number]) => void) | undefined)?.(newRange);\n },\n [isControlled, onChange, currentRange, minDistance]\n );\n\n // Key handler for Home/End\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Home') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(min);\n (onChange as ((v: number) => void) | undefined)?.(min);\n }\n } else if (e.key === 'End') {\n e.preventDefault();\n if (!range) {\n if (!isControlled) setInternalSingle(max);\n (onChange as ((v: number) => void) | undefined)?.(max);\n }\n }\n },\n [range, isControlled, onChange, min, max]\n );\n\n // Tick positions\n const tickPositions = useMemo(\n () => getTickPositions(min, max, step, ticks, marks),\n [min, max, step, ticks, marks]\n );\n\n const hasLabels = tickPositions.some(t => t.label !== undefined);\n const isVertical = orientation === 'vertical';\n\n // Compute corrected thumb position CSS calc expression.\n // The browser insets the range input thumb by half its size from each edge,\n // so the tooltip left must account for this to align with the thumb center.\n const thumbVarName = size\n ? `slider-thumb-size-${size}`\n : 'slider-thumb-size';\n const thumbCssVar = `var(--bulma-${thumbVarName})`;\n const effectiveThumbExpr = isCircle\n ? `(${thumbCssVar} * 1.2)`\n : thumbCssVar;\n\n const getThumbLeft = (progressPct: number) => {\n const fraction = progressPct / 100;\n return `calc(${effectiveThumbExpr} / 2 + ${fraction} * (100% - ${effectiveThumbExpr}))`;\n };\n\n // Vertical tooltip offset: position to the right or left of the thumb\n const verticalTooltipOffset = `calc(50% + ${effectiveThumbExpr} / 2 + 0.5rem)`;\n\n // Get effective thumb size in px for nudge computation\n const getThumbSizePx = (): number => {\n const el = inputRef.current;\n if (!el) return 0;\n const style = getComputedStyle(el);\n const raw = style.getPropertyValue(`--bulma-${thumbVarName}`).trim();\n const value = parseFloat(raw);\n if (isNaN(value)) return 0;\n let px: number;\n if (raw.includes('rem')) {\n const rootFs =\n parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;\n px = value * rootFs;\n } else {\n px = value;\n }\n return isCircle ? px * 1.2 : px;\n };\n\n // Generate wrapper classes\n const classPrefix = useClassPrefix();\n const sliderClasses = usePrefixedClassNames('slider', {\n [`is-${size}`]: size,\n [`is-${color}`]: color,\n 'is-rounded': isRounded,\n 'is-circle': isCircle,\n 'is-disabled': disabled,\n 'has-output': tooltipMode !== 'hidden',\n 'has-output-always': tooltipMode === 'always',\n 'is-vertical': isVertical,\n 'is-range': range,\n 'has-ticks': tickPositions.length > 0,\n 'has-tick-labels': hasLabels,\n });\n\n const combinedClasses = classNames(\n sliderClasses,\n bulmaHelperClasses,\n className\n );\n\n // Combined ref for the first (or only) input\n const combinedRef = (node: HTMLInputElement | null) => {\n (inputRef as React.MutableRefObject<HTMLInputElement | null>).current =\n node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLInputElement | null>).current = node;\n }\n };\n\n // Tooltip show/hide for auto mode\n const showTipLow =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltip);\n const showTipHigh =\n tooltipMode === 'always' || (tooltipMode === 'auto' && showTooltipHigh);\n\n // Aria value text\n const getAriaProps = (value: number) => {\n const ariaProps: Record<string, string> = {};\n if (getAriaValueText) {\n ariaProps['aria-valuetext'] = getAriaValueText(value);\n } else if (scale) {\n ariaProps['aria-valuetext'] = scaleValue(value).toString();\n }\n return ariaProps;\n };\n\n // Detect tooltip overflow: flip vertically if clipped at top,\n // nudge horizontally if clipped at left/right edge.\n // We compute the un-nudged tooltip position from the progress %\n // and wrapper rect to avoid feedback loops.\n const computeNudge = useCallback(\n (\n el: HTMLElement,\n wrapper: HTMLElement,\n progressPct: number,\n thumbSizePx: number\n ): number => {\n const wr = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n // Corrected center: accounts for thumb inset from track edges\n const fraction = progressPct / 100;\n const centerX =\n wr.left + thumbSizePx / 2 + fraction * (wr.width - thumbSizePx);\n const tooltipLeft = centerX - tooltipWidth / 2;\n const tooltipRight = centerX + tooltipWidth / 2;\n if (tooltipLeft < wr.left) {\n return wr.left - tooltipLeft; // nudge right\n }\n if (tooltipRight > wr.right) {\n return wr.right - tooltipRight; // nudge left (negative)\n }\n return 0;\n },\n []\n );\n\n useLayoutEffect(() => {\n if (isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlipped(wrapperTop < tooltipHeight);\n const pct = range ? progressLow : progressSingle;\n const thumbPx = getThumbSizePx();\n setNudgeX(computeNudge(el, wrapper, pct, thumbPx));\n }\n });\n\n useLayoutEffect(() => {\n if (isVertical || !range) return;\n const wrapper = wrapperRef.current;\n const el = outputHighRef.current;\n if (wrapper && el) {\n const wrapperTop = wrapper.getBoundingClientRect().top;\n const tooltipHeight = el.offsetHeight + 10;\n setFlippedHigh(wrapperTop < tooltipHeight);\n const thumbPx = getThumbSizePx();\n setNudgeXHigh(computeNudge(el, wrapper, progressHigh, thumbPx));\n }\n });\n\n // Detect vertical tooltip overflow: flip to left if no space on right\n useLayoutEffect(() => {\n if (!isVertical) return;\n const wrapper = wrapperRef.current;\n const el = outputRef.current;\n if (!wrapper || !el) return;\n const wrapperRect = wrapper.getBoundingClientRect();\n const tooltipWidth = el.offsetWidth;\n const thumbPx = getThumbSizePx();\n const gap = 8; // 0.5rem\n // Tooltip right edge if placed to the right of the thumb\n const tooltipRightEdge =\n wrapperRect.left +\n wrapperRect.width / 2 +\n thumbPx / 2 +\n gap +\n tooltipWidth;\n setVerticalFlippedLeft(tooltipRightEdge > window.innerWidth);\n });\n\n // Vertical wrapper style\n const wrapperStyle = isVertical\n ? ({\n height: 'var(--bulma-slider-vertical-height, 200px)',\n } as React.CSSProperties)\n : undefined;\n\n // Render ticks\n const renderTicks = () => {\n if (tickPositions.length === 0) return null;\n return (\n <div className={prefixedClassNames(classPrefix, 'slider-ticks')}>\n {tickPositions.map((tick, i) => {\n const pct = ((tick.value - min) / (max - min)) * 100;\n const posStyle = isVertical\n ? { bottom: `${pct}%` }\n : { left: `${pct}%` };\n const isEndpoint = tick.value === min || tick.value === max;\n return (\n <span\n key={i}\n className={prefixedClassNames(classPrefix, 'slider-tick', {\n 'is-endpoint': isEndpoint,\n })}\n style={posStyle}\n >\n {tick.label !== undefined && (\n <span\n className={prefixedClassNames(\n classPrefix,\n 'slider-tick-label'\n )}\n >\n {tick.label}\n </span>\n )}\n </span>\n );\n })}\n </div>\n );\n };\n\n const helpClass = usePrefixedClassNames('help', {\n [`is-${messageColor}`]: !!messageColor,\n });\n const messageEl = message ? <p className={helpClass}>{message}</p> : null;\n\n // --- Single slider ---\n const sliderElement = !range ? (\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentSingle}\n disabled={disabled}\n onChange={handleSingleChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(classPrefix, 'slider-input')}\n style={\n {\n '--slider-progress': `${progressSingle}%`,\n } as React.CSSProperties\n }\n aria-valuenow={currentSingle}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={ariaLabel as string | undefined}\n {...getAriaProps(currentSingle)}\n {...rest}\n // After the spread: an undefined `id` key in rest would wipe it.\n id={controlId}\n />\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(classPrefix, 'slider-output', {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n })}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressSingle),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressSingle),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressSingle),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentSingle)}\n </output>\n )}\n {renderTicks()}\n </div>\n ) : (\n // --- Range slider ---\n <div ref={wrapperRef} className={combinedClasses} style={wrapperStyle}>\n {/* Visible track background */}\n <div\n className={prefixedClassNames(classPrefix, 'slider-track')}\n style={\n isVertical\n ? ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n : ({\n '--slider-progress-low': `${progressLow}%`,\n '--slider-progress-high': `${progressHigh}%`,\n } as React.CSSProperties)\n }\n />\n {/* Low thumb. nameLow overrides any `name` from rest so each thumb has its own form field. */}\n <input\n ref={combinedRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[0]}\n disabled={disabled}\n onChange={handleRangeLowChange}\n onKeyDown={handleKeyDown}\n onMouseEnter={() => setShowTooltip(true)}\n onMouseLeave={() => setShowTooltip(false)}\n onFocus={() => setShowTooltip(true)}\n onBlur={() => setShowTooltip(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-low'\n )}\n aria-valuenow={currentRange[0]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={\n (ariaLabel as [string, string] | undefined)?.[0] ?? 'Minimum value'\n }\n {...getAriaProps(currentRange[0])}\n {...rest}\n id={controlId}\n {...(nameLow !== undefined ? { name: nameLow } : {})}\n />\n {/* High thumb */}\n <input\n ref={inputHighRef}\n type=\"range\"\n min={min}\n max={max}\n step={step}\n value={currentRange[1]}\n disabled={disabled}\n onChange={handleRangeHighChange}\n onMouseEnter={() => setShowTooltipHigh(true)}\n onMouseLeave={() => setShowTooltipHigh(false)}\n onFocus={() => setShowTooltipHigh(true)}\n onBlur={() => setShowTooltipHigh(false)}\n className={prefixedClassNames(\n classPrefix,\n 'slider-input',\n 'slider-input-high'\n )}\n aria-valuenow={currentRange[1]}\n aria-valuemin={min}\n aria-valuemax={max}\n aria-orientation={isVertical ? 'vertical' : undefined}\n aria-label={\n (ariaLabel as [string, string] | undefined)?.[1] ?? 'Maximum value'\n }\n {...getAriaProps(currentRange[1])}\n name={nameHigh}\n />\n {/* Low tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-low',\n {\n 'is-visible': showTipLow,\n 'is-flipped': flipped,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressLow),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressLow),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressLow),\n transform: `translateX(calc(-50% + ${nudgeX}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeX}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[0])}\n </output>\n )}\n {/* High tooltip */}\n {tooltipMode !== 'hidden' && (\n <output\n ref={outputHighRef}\n className={prefixedClassNames(\n classPrefix,\n 'slider-output',\n 'slider-output-high',\n {\n 'is-visible': showTipHigh,\n 'is-flipped': flippedHigh,\n 'is-flipped-left': isVertical && verticalFlippedLeft,\n }\n )}\n style={\n isVertical\n ? ((verticalFlippedLeft\n ? {\n bottom: getThumbLeft(progressHigh),\n right: verticalTooltipOffset,\n left: 'auto',\n }\n : {\n bottom: getThumbLeft(progressHigh),\n left: verticalTooltipOffset,\n right: 'auto',\n }) as React.CSSProperties)\n : ({\n left: getThumbLeft(progressHigh),\n transform: `translateX(calc(-50% + ${nudgeXHigh}px))`,\n '--slider-output-arrow-offset': `calc(50% - ${nudgeXHigh}px)`,\n } as React.CSSProperties)\n }\n >\n {formatValue(currentRange[1])}\n </output>\n )}\n {renderTicks()}\n </div>\n );\n\n let content = sliderElement;\n\n if (rendersOwnControl('Slider', { insideControl })) {\n content = <Control>{content}</Control>;\n }\n\n if (ownField) {\n return (\n <Field\n label={label}\n labelSize={labelSize}\n labelProps={fieldLabelProps}\n horizontal={horizontal}\n className={fieldClassName}\n >\n {content}\n {messageEl}\n </Field>\n );\n }\n\n return (\n <>\n {content}\n {messageEl}\n </>\n );\n }\n);\n\nSlider.displayName = 'Slider';\n\nexport default Slider;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;AA2KA;;;;AAIG;AACH,SAAS,gBAAgB,CACvB,GAAW,EACX,GAAW,EACX,IAAY,EACZ,KAAe,EACf,KAAoB,EAAA;AAEpB,IAAA,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;AAAE,QAAA,OAAO,KAAK;AAC3C,IAAA,IAAI,CAAC,KAAK;AAAE,QAAA,OAAO,EAAE;IACrB,MAAM,SAAS,GAAiB,EAAE;AAClC,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,IAA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E,cAAc,EAAA,QAAA,EAAA,CAExB,OAAO,EACP,SAAS,CAAA,EAAA,CACJ;IAEZ;AAEA,IAAA,QACEA,IAAA,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,CACG,OAAO,EACP,SAAS,CAAA,EAAA,CACT;AAEP,CAAC;AAGH,MAAM,CAAC,WAAW,GAAG,QAAQ;;"}
@@ -62,12 +62,13 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
62
62
  const tags = controlledValue !== undefined ? controlledValue : internalTags;
63
63
  const isMaxReached = maxTags !== undefined && tags.length >= maxTags;
64
64
  // At the tag limit the text input is not rendered, so there is nothing to
65
- // wire the label to.
66
- const { controlId, fieldLabelProps } = useAutoLabelId({
65
+ // wire a label to, its own or a surrounding Field's.
66
+ const { controlId, fieldLabelProps, labelled } = useAutoLabelId({
67
67
  label,
68
68
  id,
69
69
  labelProps,
70
70
  rendersLabel: ownField && !isMaxReached,
71
+ hasInput: !isMaxReached,
71
72
  });
72
73
  // Get display value from tag
73
74
  const getDisplayValue = (tag) => {
@@ -333,9 +334,7 @@ label, labelSize, labelProps, horizontal, message, messageColor, fieldClassName,
333
334
  e.stopPropagation();
334
335
  removeTag(index);
335
336
  }, "aria-label": ariaCloseLabel || `Remove ${displayVal}` }))] }, index));
336
- }), !isMaxReached && (jsx("input", { ref: combinedRef, type: "text", className: inputClasses, id: controlId, value: inputValue, placeholder: tags.length === 0 ? placeholder : undefined, disabled: disabled, readOnly: readonly, maxLength: maxlength, onChange: handleInputChange, onFocus: handleFocus, onKeyDown: handleKeyDown, onPaste: handlePaste, "aria-label": controlId && fieldLabelProps?.htmlFor === controlId
337
- ? undefined
338
- : 'Add tag' }))] }), loading && (jsx("span", { className: iconRightClass, children: jsx("span", { className: loaderClass }) }))] }), isActive && filteredData.length > 0 && (jsx("div", { className: dropdownMenuClasses, children: jsx("div", { ref: dropdownRef, className: dropdownContentClasses, role: "listbox", children: filteredData.map((item, index) => (jsx("a", { className: pcn('dropdown-item', {
337
+ }), !isMaxReached && (jsx("input", { ref: combinedRef, type: "text", className: inputClasses, id: controlId, value: inputValue, placeholder: tags.length === 0 ? placeholder : undefined, disabled: disabled, readOnly: readonly, maxLength: maxlength, onChange: handleInputChange, onFocus: handleFocus, onKeyDown: handleKeyDown, onPaste: handlePaste, "aria-label": labelled ? undefined : 'Add tag' }))] }), loading && (jsx("span", { className: iconRightClass, children: jsx("span", { className: loaderClass }) }))] }), isActive && filteredData.length > 0 && (jsx("div", { className: dropdownMenuClasses, children: jsx("div", { ref: dropdownRef, className: dropdownContentClasses, role: "listbox", children: filteredData.map((item, index) => (jsx("a", { className: pcn('dropdown-item', {
339
338
  'is-active': index === highlightedIndex,
340
339
  }), onClick: () => addTag(item), onMouseEnter: () => setHighlightedIndex(index), role: "option", "aria-selected": index === highlightedIndex, children: item }, index))) }) })), showCounter && jsx("small", { className: counterClasses, children: counterText }), name &&
341
340
  tags.map((tag, i) => (jsx("input", { type: "hidden", name: name, value: getDisplayValue(tag), form: form }, `tag-input-${i}`)))] }));