@allxsmith/bestax-bulma 5.43.1 → 5.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bestax.css +1 -1
- package/dist/bestax.css.map +1 -1
- package/dist/esm/components/Carousel.js +2 -2
- package/dist/esm/components/Carousel.js.map +1 -1
- package/dist/esm/elements/Td.js +6 -4
- package/dist/esm/elements/Td.js.map +1 -1
- package/dist/esm/elements/Th.js +2 -2
- package/dist/esm/elements/Th.js.map +1 -1
- package/dist/esm/elements/tableAlignment.js +16 -0
- package/dist/esm/elements/tableAlignment.js.map +1 -0
- package/dist/esm/form/Checkbox.js.map +1 -1
- package/dist/esm/helpers/bulmaClassHelpers.js +2 -2
- package/dist/esm/helpers/bulmaClassHelpers.js.map +1 -1
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +25 -12
- package/dist/index.cjs.map +1 -1
- package/dist/types/components/Carousel.d.ts +29 -3
- package/dist/types/elements/Td.d.ts +4 -1
- package/dist/types/elements/Th.d.ts +1 -6
- package/dist/types/elements/tableAlignment.d.ts +16 -0
- package/dist/types/form/Checkbox.d.ts +8 -6
- package/dist/types-cjs/components/Carousel.d.ts +29 -3
- package/dist/types-cjs/elements/Td.d.ts +4 -1
- package/dist/types-cjs/elements/Th.d.ts +1 -6
- package/dist/types-cjs/elements/tableAlignment.d.ts +16 -0
- package/dist/types-cjs/form/Checkbox.d.ts +8 -6
- package/dist/versions/bestax-no-dark-mode.css +1 -1
- package/dist/versions/bestax-no-dark-mode.css.map +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css +1 -1
- package/dist/versions/bestax-no-helpers-prefixed.css.map +1 -1
- package/dist/versions/bestax-no-helpers.css +1 -1
- package/dist/versions/bestax-no-helpers.css.map +1 -1
- package/dist/versions/bestax-prefixed.css +1 -1
- package/dist/versions/bestax-prefixed.css.map +1 -1
- package/package.json +1 -1
- package/src/scss/components/_carousel.scss +31 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Carousel.js","sources":["../../../src/components/Carousel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useRef,\n useEffect,\n useCallback,\n Children,\n isValidElement,\n cloneElement,\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 { getActiveElementInTree } from '../helpers/shadowDom';\nimport { useLatestRef } from '../helpers/useLatestRef';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { inertProps } from '../helpers/inertProps';\nimport { Icon } from '../elements/Icon';\nimport { Button } from '../elements/Button';\n\n/**\n * Props for the CarouselItem component.\n */\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Whether this item is in view. `Carousel` sets it on every item in view,\n * so with several in view several are active.\n */\n active?: boolean;\n /**\n * The slide's content. An image in it is held to the slide's width at its\n * own height, unless something sizes the image itself: a ratio `Image`\n * fills its frame, and an `Avatar`'s photo its circle, as they do outside a\n * carousel.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Individual carousel item/slide.\n *\n * @function\n * @param {CarouselItemProps} props - Props for the CarouselItem component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the carousel item element.\n * @returns {JSX.Element} The rendered carousel item.\n */\nexport const CarouselItem = forwardRef<HTMLDivElement, CarouselItemProps>(\n ({ active, className, children, ...props }, ref) => {\n const itemClasses = classNames(\n usePrefixedClassNames('carousel-item', { 'is-active': active }),\n className\n );\n\n return (\n <div ref={ref} className={itemClasses} {...props}>\n {children}\n </div>\n );\n }\n);\n\nCarouselItem.displayName = 'CarouselItem';\n\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\n\n/**\n * Default SVG icon for the previous arrow button.\n *\n * @function\n * @returns {JSX.Element} The rendered SVG chevron-left icon.\n */\nconst DefaultPrevIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\n);\n\n/**\n * Default SVG icon for the next arrow button.\n *\n * @function\n * @returns {JSX.Element} The rendered SVG chevron-right icon.\n */\nconst DefaultNextIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n);\n\n/**\n * The media queries Bulma's `fullhd`, `widescreen`, `desktop` and `tablet`\n * mixins open with, widest first, at Bulma's default breakpoints. The\n * stylesheet picks the count in view with those mixins; these tell the\n * script which count that is. Narrower than the last one is `mobile`.\n */\nconst VIEWPORT_QUERIES = [\n 'screen and (min-width: 1408px)',\n 'screen and (min-width: 1216px)',\n 'screen and (min-width: 1024px)',\n 'screen and (min-width: 769px), print',\n];\n\n/** `useBulmaViewport`'s answer below the tablet breakpoint. */\nconst MOBILE = VIEWPORT_QUERIES.length;\n\n/**\n * The `--bulma-carousel-items-to-show*` variable each count prop writes, in\n * the order the component lists them: the viewports as above, mobile, and\n * last `itemsToShow` itself.\n */\nconst COUNT_SUFFIXES = [\n '-fullhd',\n '-widescreen',\n '-desktop',\n '-tablet',\n '-mobile',\n '',\n];\n\n/**\n * Which of Bulma's viewports the window is in: the index of the widest\n * `VIEWPORT_QUERIES` entry that matches, `MOBILE` below them all, or `-1`\n * when that isn't known (on the server, before the first layout effect, and\n * whenever `enabled` is off, so a carousel with one count everywhere\n * subscribes to nothing).\n *\n * @function\n * @param {boolean} enabled - Whether any viewport-specific count is set.\n * @returns {number} The viewport, as described above.\n */\nfunction useBulmaViewport(enabled: boolean): number {\n const [viewport, setViewport] = useState(-1);\n\n useClientLayoutEffect(() => {\n if (!enabled || typeof window.matchMedia !== 'function') return undefined;\n const lists = VIEWPORT_QUERIES.map(query => window.matchMedia(query));\n const update = () => {\n const index = lists.findIndex(list => list.matches);\n setViewport(index < 0 ? MOBILE : index);\n };\n update();\n lists.forEach(list => list.addEventListener('change', update));\n return () =>\n lists.forEach(list => list.removeEventListener('change', update));\n }, [enabled]);\n\n return enabled ? viewport : -1;\n}\n\n/**\n * A count prop as the whole number the carousel works with: rounded down,\n * and never below 1, so a zero or a stray `NaN` can't divide by nothing.\n *\n * @function\n * @param {number | undefined} count - The prop as given.\n * @returns {number | undefined} The count, or `undefined` when unset.\n */\nconst wholeCount = (count: number | undefined) =>\n count === undefined ? undefined : Math.max(1, Math.floor(count) || 1);\n\n/**\n * Props for the Carousel component.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the carousel element.\n */\nexport interface CarouselProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n BulmaClassesProps {\n /**\n * Index of the first item in view (controlled); with one item in view, the\n * slide shown. A value between two of the positions a step lands on (see\n * `itemsToScroll`) is shown as given, and the next step goes on from it.\n * With `repeat`, a value past either end wraps around; without it, one\n * that would leave empty space after the last item shows the last full\n * view. Neither correction calls `onChange`. A value that takes the item\n * holding focus out of view moves focus to the first item in view, as a\n * swipe or a change of width does.\n * @defaultValue 0\n */\n value?: number;\n /**\n * Enable auto-play: one step (`itemsToScroll` items) per `interval`.\n * Without `repeat` it stops at the last position. It waits while the\n * pointer is over the carousel (see `pauseOnHover`) and while focus is\n * inside one of its items, so an item being read or used never moves out\n * of view.\n */\n autoplay?: boolean;\n /** Auto-play interval in milliseconds. Default: 5000. */\n interval?: number;\n /** Pause auto-play on hover. Default: true. */\n pauseOnHover?: boolean;\n /**\n * Loop back to the first position after the last. Default: true. With\n * several items in view, the view runs on past the last item into the\n * first ones, so it can show the end and the start side by side. Only\n * loops when some item is out of view.\n */\n repeat?: boolean;\n /**\n * Enable drag/swipe navigation. Default: true. A swipe moves one step,\n * however far it travels.\n */\n hasDrag?: boolean;\n /**\n * How many items are in view at once, at every width no\n * `itemsToShow<Viewport>` prop covers. Those props read the way a\n * `Column`'s `size<Viewport>` props do: `itemsToShowMobile` applies below\n * Bulma's tablet breakpoint, each of the others from its own breakpoint\n * up, and where several apply the widest one wins. A whole number, rounded\n * down and at least 1. The widths come from the stylesheet, so they are\n * right on the first paint; the arrows, indicators and steps use the\n * count for the window's width once the page has hydrated, and this one\n * until then. With this many children or fewer, every item keeps its\n * share of the width, nothing moves, and no arrows or indicators render.\n * @defaultValue 1\n */\n itemsToShow?: number;\n /**\n * Items in view at any width below Bulma's tablet breakpoint (769px),\n * fractional ones included. Falls back to `itemsToShow`.\n */\n itemsToShowMobile?: number;\n /**\n * Items in view from Bulma's tablet breakpoint (769px) up, until a wider\n * viewport's prop takes over. Falls back to `itemsToShow`.\n */\n itemsToShowTablet?: number;\n /**\n * Items in view from Bulma's desktop breakpoint (1024px) up, until a wider\n * viewport's prop takes over. Falls back to `itemsToShowTablet`, then\n * `itemsToShow`.\n */\n itemsToShowDesktop?: number;\n /**\n * Items in view from Bulma's widescreen breakpoint (1216px) up, until\n * `itemsToShowFullhd` takes over. Falls back to `itemsToShowDesktop`, and\n * on down to `itemsToShow`.\n */\n itemsToShowWidescreen?: number;\n /**\n * Items in view from Bulma's fullhd breakpoint (1408px) up. Falls back to\n * `itemsToShowWidescreen`, and on down to `itemsToShow`.\n */\n itemsToShowFullhd?: number;\n /**\n * How many items one step moves, for an arrow, an arrow key, a swipe or an\n * autoplay tick. A whole number, capped at the count in view so a step\n * never skips an item. Without `repeat`, the last step stops at the last\n * full view, so it can be shorter; with `repeat`, the step after the last\n * position goes on to the first one. The indicators mark these positions,\n * one per step rather than one per item. When the count in view changes\n * with the window's width, the first item in view stays in view.\n * @defaultValue 1\n */\n itemsToScroll?: number;\n /**\n * Show navigation arrows. Default: true. They render `type=\"button\"`, so a\n * carousel inside a form is not submitted by moving between slides.\n */\n arrow?: boolean;\n /** Only show arrows on hover. */\n arrowHover?: boolean;\n /**\n * Show slide indicators. Default: true. There is one for each position a\n * step can land on (see `itemsToScroll`). They render `type=\"button\"`, so\n * a carousel inside a form is not submitted by picking a slide.\n */\n indicator?: boolean;\n /** Position indicators inside carousel. */\n indicatorInside?: boolean;\n /** Indicator position. Default: 'bottom'. */\n indicatorPosition?: 'bottom' | 'top';\n /** Indicator style. Default: 'dots'. */\n indicatorStyle?: 'circles' | 'dots' | 'lines' | 'bars';\n /** Icon name for the previous arrow button. */\n iconPrev?: string;\n /** Icon name for the next arrow button. */\n iconNext?: string;\n /** Icon library to use. */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Icon size modifier. */\n iconSize?: 'small' | 'medium' | 'large';\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Show semi-transparent background on arrow buttons. Set to `false` for icon-only arrows. */\n arrowBackground?: boolean;\n /** Color theme for navigation arrows. */\n arrowColor?: 'light' | 'dark';\n /** Accessible label for the carousel region. Default: 'Image carousel'. */\n ariaLabel?: string;\n /**\n * Called with the index of the first item in view when an arrow, an arrow\n * key, an indicator, a swipe or autoplay moves the carousel.\n */\n onChange?: (value: number) => void;\n /** CarouselItem children. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Carousel` component provides an image/content slider with navigation arrows and indicators.\n *\n * @function\n * @param {CarouselProps} props - Props for the Carousel component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the carousel element.\n * @returns {JSX.Element} The rendered carousel component.\n *\n * @example\n * // Basic carousel\n * <Carousel>\n * <CarouselItem>Slide 1</CarouselItem>\n * <CarouselItem>Slide 2</CarouselItem>\n * <CarouselItem>Slide 3</CarouselItem>\n * </Carousel>\n *\n * @example\n * // Auto-playing carousel\n * <Carousel autoplay interval={3000}>\n * <CarouselItem>\n * <img src=\"image1.jpg\" alt=\"Slide 1\" />\n * </CarouselItem>\n * <CarouselItem>\n * <img src=\"image2.jpg\" alt=\"Slide 2\" />\n * </CarouselItem>\n * </Carousel>\n *\n * @example\n * // Three cards in view on desktop, two on tablet, one on mobile\n * <Carousel itemsToShow={1} itemsToShowTablet={2} itemsToShowDesktop={3}>\n * {cards.map(card => (\n * <CarouselItem key={card.id}>{card.body}</CarouselItem>\n * ))}\n * </Carousel>\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(\n (\n {\n value: controlledValue,\n autoplay = false,\n interval = 5000,\n pauseOnHover = true,\n repeat = true,\n hasDrag = true,\n itemsToShow,\n itemsToShowMobile,\n itemsToShowTablet,\n itemsToShowDesktop,\n itemsToShowWidescreen,\n itemsToShowFullhd,\n itemsToScroll,\n arrow = true,\n arrowHover = false,\n indicator = true,\n indicatorInside = false,\n indicatorPosition = 'bottom',\n indicatorStyle = 'dots',\n iconPrev,\n iconNext,\n iconLibrary,\n iconVariant,\n iconSize,\n iconFeatures,\n arrowBackground = true,\n arrowColor,\n ariaLabel = 'Image carousel',\n onChange,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const carouselRef = useRef<HTMLDivElement>(null);\n // Cleanup returned by a consumer's callback ref on attach, held until detach.\n const consumerCleanupRef = useRef<(() => void) | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const slidesRef = useRef<HTMLDivElement>(null);\n // The item (a child of the track) that holds focus, until focus leaves\n // the items for somewhere else\n const focusedItemRef = useRef<Element | undefined>(undefined);\n\n const [internalValue, setInternalValue] = useState(0);\n const [isPaused, setIsPaused] = useState(false);\n const [isFocusInside, setIsFocusInside] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [dragStart, setDragStart] = useState(0);\n const [dragOffset, setDragOffset] = useState(0);\n const [isWrapping, setIsWrapping] = useState(false);\n const [displayIndex, setDisplayIndex] = useState(0);\n const [skipTransition, setSkipTransition] = useState(false);\n\n // Get valid children\n const items = Children.toArray(children).filter(\n isValidElement\n ) as React.ReactElement<CarouselItemProps>[];\n const itemCount = items.length;\n\n // The count in view. The viewport props come widest first, in the order\n // of VIEWPORT_QUERIES, then mobile; each min-width viewport falls back to\n // the narrower ones, and every viewport to `itemsToShow`, the cascade the\n // stylesheet's `--bulma-carousel-items-to-show-*` defaults spell out.\n const counts = [\n itemsToShowFullhd,\n itemsToShowWidescreen,\n itemsToShowDesktop,\n itemsToShowTablet,\n itemsToShowMobile,\n ].map(wholeCount);\n const baseCount = wholeCount(itemsToShow);\n const viewport = useBulmaViewport(counts.some(c => c !== undefined));\n const inView =\n (viewport === MOBILE\n ? counts[MOBILE]\n : viewport >= 0\n ? counts.slice(viewport, MOBILE).find(c => c !== undefined)\n : undefined) ??\n baseCount ??\n 1;\n // The props as the stylesheet reads them, so the widths are right from\n // the first paint, on the server too.\n const countStyle: Record<string, number> = {};\n [...counts, baseCount].forEach((count, i) => {\n if (count !== undefined) {\n countStyle[`--bulma-carousel-items-to-show${COUNT_SUFFIXES[i]}`] =\n count;\n }\n });\n\n const scroll = Math.min(wholeCount(itemsToScroll) ?? 1, inView);\n const looping = repeat && itemCount > inView;\n const lastStart = Math.max(0, itemCount - inView);\n // Where the view can start: every `scroll` items from the first, and\n // without a loop the last full view as well, which is what keeps the\n // end of the track from showing empty space.\n const positions: number[] = [];\n for (let p = 0; p < (looping ? itemCount : lastStart); p += scroll) {\n positions.push(p);\n }\n if (!looping) positions.push(lastStart);\n const lastPosition = positions[positions.length - 1];\n const canMove = positions.length > 1;\n\n const wrap = (index: number) =>\n ((index % itemCount) + itemCount) % itemCount;\n const fit = (index: number) =>\n looping ? wrap(index) : Math.min(Math.max(index, 0), lastStart);\n\n // Use controlled or internal value, as a start the view can show\n const activeIndex = fit(controlledValue ?? internalValue);\n // The indicator for the last position at or before the first item in view\n const activePosition = positions.reduce(\n (found, position, index) => (position <= activeIndex ? index : found),\n 0\n );\n const nextIndex = positions[activePosition + 1];\n // From between two positions, the previous step is the one just behind\n const prevIndex =\n activeIndex > positions[activePosition]\n ? positions[activePosition]\n : positions[activePosition - 1];\n\n // Sync displayIndex when the value changes externally, or when the count\n // in view moves the start it fits to. Intentional external-prop sync that\n // must not run mid-wrap animation; covered by tests and certified\n // in-browser. Uncontrolled, the fitted start becomes the value too, so a\n // later change of count keeps what was first in view in view.\n useEffect(() => {\n if (!isWrapping) {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- syncing to controlled prop\n setDisplayIndex(activeIndex);\n if (controlledValue === undefined) setInternalValue(activeIndex);\n }\n }, [activeIndex, isWrapping, controlledValue]);\n\n // Update active index\n const setActiveIndex = useCallback(\n (index: number) => {\n if (controlledValue === undefined) {\n setInternalValue(index);\n }\n setDisplayIndex(index);\n setIsWrapping(false);\n onChange?.(index);\n },\n [controlledValue, onChange]\n );\n\n // Navigation handlers\n const goToPrev = useCallback(() => {\n if (prevIndex !== undefined) {\n setActiveIndex(prevIndex);\n } else if (looping) {\n // Animate to the clones before the first item, which show the last\n // position, and snap to the real one when the transition ends\n setDisplayIndex(lastPosition - itemCount);\n setIsWrapping(true);\n }\n }, [prevIndex, looping, lastPosition, itemCount, setActiveIndex]);\n\n const goToNext = useCallback(() => {\n if (nextIndex !== undefined) {\n setActiveIndex(nextIndex);\n } else if (looping) {\n // Animate to the clones after the last item, which show the first\n // position, and snap to the real one when the transition ends\n setDisplayIndex(itemCount);\n setIsWrapping(true);\n }\n }, [nextIndex, looping, itemCount, setActiveIndex]);\n\n // Read when the timer fires or an arrow key arrives, so neither the\n // timer nor the key listener starts over while `onChange` changes\n // identity, as an inline one does on every render of the parent.\n const goToPrevRef = useLatestRef(goToPrev);\n const goToNextRef = useLatestRef(goToNext);\n\n // Auto-play. Each slide gets the whole interval, so a slide change,\n // autoplay's own or the user's, starts the timer over. A render that\n // leaves the slide where it is doesn't. It waits while focus is inside\n // an item, so what someone is reading or using doesn't move away. The\n // timer reads where focus is when it fires, rather than trusting the\n // last focus event alone: a browser moving focus off an element that\n // went inert need not fire one, and the pause would never end. A focus\n // change still starts the timer over, so an item gets the whole\n // interval once focus leaves it.\n const isPlaying =\n autoplay && (looping || nextIndex !== undefined) && !isPaused;\n const isRotating = isPlaying && !isFocusInside;\n\n useEffect(() => {\n if (!isPlaying) return undefined;\n\n const timer = setInterval(() => {\n const track = slidesRef.current;\n if (track?.contains(getActiveElementInTree(track))) return;\n if (isFocusInside) setIsFocusInside(false);\n goToNextRef.current();\n }, interval);\n\n return () => clearInterval(timer);\n }, [isPlaying, isFocusInside, interval, activeIndex, goToNextRef]);\n\n // Pause on hover\n const handleMouseEnter = useCallback(() => {\n if (pauseOnHover) {\n setIsPaused(true);\n }\n }, [pauseOnHover]);\n\n const handleMouseLeave = useCallback(() => {\n if (pauseOnHover) {\n setIsPaused(false);\n }\n }, [pauseOnHover]);\n\n // Drag handlers\n const handleDragStart = useCallback(\n (clientX: number) => {\n if (!hasDrag) return;\n setIsDragging(true);\n setDragStart(clientX);\n setDragOffset(0);\n },\n [hasDrag]\n );\n\n const handleDragMove = useCallback(\n (clientX: number) => {\n if (!isDragging) return;\n setDragOffset(clientX - dragStart);\n },\n [isDragging, dragStart]\n );\n\n const handleDragEnd = useCallback(() => {\n if (!isDragging) return;\n setIsDragging(false);\n\n const threshold = 50;\n if (dragOffset < -threshold) {\n goToNext();\n } else if (dragOffset > threshold) {\n goToPrev();\n }\n\n setDragOffset(0);\n }, [isDragging, dragOffset, goToNext, goToPrev]);\n\n // Mouse events\n const handleMouseDown = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n handleDragStart(e.clientX);\n },\n [handleDragStart]\n );\n\n const handleMouseMove = useCallback(\n (e: React.MouseEvent) => {\n handleDragMove(e.clientX);\n },\n [handleDragMove]\n );\n\n const handleMouseUp = useCallback(() => {\n handleDragEnd();\n }, [handleDragEnd]);\n\n // Touch events\n const handleTouchStart = useCallback(\n (e: React.TouchEvent) => {\n handleDragStart(e.touches[0].clientX);\n },\n [handleDragStart]\n );\n\n const handleTouchMove = useCallback(\n (e: React.TouchEvent) => {\n handleDragMove(e.touches[0].clientX);\n },\n [handleDragMove]\n );\n\n const handleTouchEnd = useCallback(() => {\n handleDragEnd();\n }, [handleDragEnd]);\n\n // Keyboard navigation, from the carousel's own controls. Inside an item\n // the keys are its content's (a field's caret, a slider), and a step\n // from there could take the focused item out of view.\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n const node = carouselRef.current;\n const active = getActiveElementInTree(node);\n if (!node?.contains(active) || slidesRef.current?.contains(active)) {\n return;\n }\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault();\n goToPrevRef.current();\n break;\n case 'ArrowRight':\n e.preventDefault();\n goToNextRef.current();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [goToPrevRef, goToNextRef]);\n\n // Handle wrap-around transition end: the track's own, since an item's\n // content can end a transition of its own that bubbles up to here\n const handleTransitionEnd = useCallback(\n (e: React.TransitionEvent<HTMLDivElement>) => {\n if (isWrapping && e.target === e.currentTarget) {\n // Skip transition for the instant snap from the clones to the\n // real items they copy\n setSkipTransition(true);\n setActiveIndex(((displayIndex % itemCount) + itemCount) % itemCount);\n\n // Re-enable transition after the snap\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setSkipTransition(false);\n });\n });\n }\n },\n [isWrapping, displayIndex, itemCount, setActiveIndex]\n );\n\n // Combined ref\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n (carouselRef as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n if (typeof ref === 'function') {\n // React 19 lets a callback ref return a cleanup function and detaches by\n // running it instead of calling the ref with `null`; React 18 discards the\n // return value entirely. Returning it from here would be a React-19-only\n // contract, so we hold the cleanup and run it ourselves on detach — the\n // same shape as `Dropdown`, `Modal`, `Dialog`, `Sidebar` and `Toast`.\n // The form controls that merge a forwarded ref still discard the cleanup\n // and detach with `ref(null)`, so this is not yet library-wide — grep\n // `typeof ref === 'function'` for the current split.\n if (node === null) {\n const consumerCleanup = consumerCleanupRef.current;\n consumerCleanupRef.current = null;\n if (consumerCleanup) {\n consumerCleanup();\n } else {\n ref(null);\n }\n return;\n }\n const cleanup: unknown = ref(node);\n consumerCleanupRef.current =\n typeof cleanup === 'function' ? (cleanup as () => void) : null;\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n },\n [ref]\n );\n\n // Can navigate\n const canGoPrev = looping || prevIndex !== undefined;\n const canGoNext = looping || nextIndex !== undefined;\n\n // Generate classes\n const carouselClasses = usePrefixedClassNames('carousel', {\n 'is-overlay': indicatorInside,\n 'has-arrow-hover': arrowHover,\n [`is-indicator-${indicatorStyle}`]: indicatorStyle !== 'dots',\n [`is-arrow-${arrowColor}`]: !!arrowColor,\n });\n const classPrefix = useClassPrefix();\n const carouselContainerClass = usePrefixedClassNames('carousel-container');\n const carouselSlidesClass = usePrefixedClassNames('carousel-slides');\n const carouselArrowPrevClass = usePrefixedClassNames(\n 'carousel-arrow',\n 'is-prev',\n { 'is-transparent': !arrowBackground }\n );\n const carouselArrowNextClass = usePrefixedClassNames(\n 'carousel-arrow',\n 'is-next',\n { 'is-transparent': !arrowBackground }\n );\n const carouselIndicatorClass = usePrefixedClassNames('carousel-indicator', {\n 'is-inside': indicatorInside,\n 'is-top': indicatorPosition === 'top',\n });\n\n const combinedClasses = classNames(\n carouselClasses,\n bulmaHelperClasses,\n className\n );\n\n // Where the track is drawn from: mid-wrap the clones, otherwise a start\n // the view can show, so a change in the count in view never paints\n // empty space while the sync above catches up.\n const shownIndex = isWrapping ? displayIndex : fit(displayIndex);\n // Enough clones on each side to fill the widest view any viewport sets,\n // since the stylesheet, not this count, sizes what's on screen\n const cloneCount = looping\n ? Math.min(\n itemCount,\n Math.max(baseCount ?? 1, ...counts.map(c => c ?? 1))\n )\n : 0;\n // The track: a full view's worth of clones of the last items, the items,\n // and clones of the first ones, for a seamless loop. Each entry is the\n // item it shows and its key.\n const slots: [number, React.Key][] = items.map((_, index) => [\n index,\n index,\n ]);\n for (let k = 0; k < cloneCount; k++) {\n slots.splice(k, 0, [itemCount - cloneCount + k, `clone-before-${k}`]);\n slots.push([k, `clone-after-${k}`]);\n }\n\n // Render slides with active state (includes clones for infinite loop).\n // What's in view is a run of slots, so where a looping view runs past\n // the last item, the clones on screen are the live copies and the items\n // they copy, off screen, are the hidden ones: no item is exposed twice,\n // and the copy exposed is the one in view.\n const renderSlides = () =>\n slots.map(([index, key], slot) => {\n const item = items[index];\n const own = item.props;\n const isShown =\n slot >= shownIndex + cloneCount &&\n slot < shownIndex + cloneCount + inView;\n return cloneElement(item, {\n key,\n active: isShown,\n role: own.role ?? 'group',\n 'aria-roledescription': own['aria-roledescription'] ?? 'slide',\n ...(own['aria-label'] || own['aria-labelledby']\n ? {}\n : { 'aria-label': `${index + 1} of ${itemCount}` }),\n // Out of view: hidden from assistive tech, and inert, so nothing\n // in it takes focus or a click\n ...(isShown ? {} : { 'aria-hidden': true, ...inertProps(true) }),\n });\n });\n\n // Hand focus on when the item holding it leaves the view. An item out\n // of view is inert, and a browser drops focus from an inert element to\n // the page, so a swipe, a change of count with the window's width, a new\n // controlled value or the item's removal would leave a keyboard or\n // screen reader user nowhere. Focus goes to the first item in view,\n // given `tabindex=\"-1\"` for it unless it has a tabindex of its own. A\n // layout effect runs before the browser gets to drop the focus; the\n // focused item's removal drops it at once, so focus on the page itself\n // still counts as the item's.\n useClientLayoutEffect(() => {\n const held = focusedItemRef.current;\n if (!held) return;\n const track = slidesRef.current as HTMLDivElement;\n const start = shownIndex + cloneCount;\n const slot = Array.prototype.indexOf.call(track.children, held);\n if (slot >= start && slot < start + inView) return;\n const active = getActiveElementInTree(track);\n if (active !== held.ownerDocument.body && !held.contains(active)) {\n return;\n }\n focusedItemRef.current = undefined;\n const first = track.children[start] as HTMLElement | undefined;\n if (!first) return;\n if (!first.hasAttribute('tabindex')) first.tabIndex = -1;\n first.focus({ preventScroll: true });\n }, [shownIndex, cloneCount, inView, itemCount]);\n\n return (\n <div\n ref={combinedRef}\n className={combinedClasses}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label={ariaLabel}\n style={{ ...countStyle, ...style }}\n {...rest}\n >\n <div\n ref={containerRef}\n className={carouselContainerClass}\n onMouseDown={hasDrag ? handleMouseDown : undefined}\n onMouseMove={hasDrag && isDragging ? handleMouseMove : undefined}\n onMouseUp={hasDrag ? handleMouseUp : undefined}\n onMouseLeave={hasDrag ? handleMouseUp : undefined}\n onTouchStart={hasDrag ? handleTouchStart : undefined}\n onTouchMove={hasDrag ? handleTouchMove : undefined}\n onTouchEnd={hasDrag ? handleTouchEnd : undefined}\n style={{\n transform: isDragging ? `translateX(${dragOffset}px)` : undefined,\n cursor: hasDrag ? (isDragging ? 'grabbing' : 'grab') : undefined,\n }}\n >\n <div\n ref={slidesRef}\n className={carouselSlidesClass}\n style={{\n // One item is the track's width plus a gap, over the count the\n // stylesheet has in view; account for the prepended clones\n transform: `translateX(calc(${-(shownIndex + cloneCount)} * (100% + var(--bulma-carousel-item-gap, 0px)) / var(--bulma-carousel-items-in-view, 1)))`,\n // Disable transition during drag or instant snap after wrap-around\n transition:\n isDragging || skipTransition\n ? 'none'\n : 'transform 0.3s ease-in-out',\n }}\n // Announce what comes into view, except while autoplay turns it\n aria-live={isRotating ? 'off' : 'polite'}\n onFocus={e => {\n setIsFocusInside(true);\n focusedItemRef.current = Array.from(\n e.currentTarget.children\n ).find(item => item.contains(e.target));\n }}\n onBlur={e => {\n const inside = e.currentTarget.contains(e.relatedTarget);\n setIsFocusInside(inside);\n if (!inside) focusedItemRef.current = undefined;\n }}\n onTransitionEnd={handleTransitionEnd}\n >\n {renderSlides()}\n </div>\n {arrow && canMove && (\n <>\n <Button\n type=\"button\"\n className={carouselArrowPrevClass}\n onClick={goToPrev}\n isDisabled={!canGoPrev}\n aria-label=\"Previous slide\"\n >\n {iconPrev ? (\n <Icon\n name={iconPrev}\n library={iconLibrary}\n variant={iconVariant}\n size={iconSize}\n features={iconFeatures}\n />\n ) : (\n <DefaultPrevIcon />\n )}\n </Button>\n <Button\n type=\"button\"\n className={carouselArrowNextClass}\n onClick={goToNext}\n isDisabled={!canGoNext}\n aria-label=\"Next slide\"\n >\n {iconNext ? (\n <Icon\n name={iconNext}\n library={iconLibrary}\n variant={iconVariant}\n size={iconSize}\n features={iconFeatures}\n />\n ) : (\n <DefaultNextIcon />\n )}\n </Button>\n </>\n )}\n </div>\n\n {indicator && canMove && (\n <div className={carouselIndicatorClass} role=\"tablist\">\n {positions.map((position, index) => (\n <Button\n key={position}\n type=\"button\"\n className={prefixedClassNames(classPrefix, 'indicator-item', {\n 'is-active': index === activePosition,\n })}\n onClick={() => setActiveIndex(position)}\n role=\"tab\"\n aria-selected={index === activePosition}\n aria-label={`Go to slide ${position + 1}`}\n />\n ))}\n </div>\n )}\n </div>\n );\n }\n);\n\nCarousel.displayName = 'Carousel';\n\nexport default Carousel;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AA0CA;;;;;;;AAOG;MACU,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACjD,IAAA,MAAM,WAAW,GAAG,UAAU,CAC5B,qBAAqB,CAAC,eAAe,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAC/D,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,KAAM,KAAK,EAAA,QAAA,EAC7C,QAAQ,EAAA,CACL;AAEV,CAAC;AAGH,YAAY,CAAC,WAAW,GAAG,cAAc;AAIzC;;;;;AAKG;AACH,MAAM,eAAe,GAAG,OACtBA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BA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AC,QAAQ,EAAE,KAAK,MAC7BA,GAAA,CAAC,MAAM,EAAA,EAEL,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,kBAAkB,CAAC,WAAW,EAAE,gBAAgB,EAAE;wBAC3D,WAAW,EAAE,KAAK,KAAK,cAAc;AACtC,qBAAA,CAAC,EACF,OAAO,EAAE,MAAM,cAAc,CAAC,QAAQ,CAAC,EACvC,IAAI,EAAC,KAAK,EAAA,eAAA,EACK,KAAK,KAAK,cAAc,EAAA,YAAA,EAC3B,CAAA,YAAA,EAAe,QAAQ,GAAG,CAAC,CAAA,CAAE,EAAA,EARpC,QAAQ,CASb,CACH,CAAC,EAAA,CACE,CACP,CAAA,EAAA,CACG;AAEV,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
1
|
+
{"version":3,"file":"Carousel.js","sources":["../../../src/components/Carousel.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useState,\n useRef,\n useEffect,\n useCallback,\n Children,\n isValidElement,\n cloneElement,\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 { getActiveElementInTree } from '../helpers/shadowDom';\nimport { useLatestRef } from '../helpers/useLatestRef';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { inertProps } from '../helpers/inertProps';\nimport { Icon } from '../elements/Icon';\nimport { Button } from '../elements/Button';\n\n/**\n * Props for the CarouselItem component.\n */\nexport interface CarouselItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /**\n * Whether this item is in view. `Carousel` sets it on every item in view,\n * so with several in view several are active.\n */\n active?: boolean;\n /**\n * The slide's content. An image in it is held to the slide's width at its\n * own height, unless something sizes the image itself: a ratio `Image`\n * fills its frame, and an `Avatar`'s photo its circle, as they do outside a\n * carousel.\n */\n children?: React.ReactNode;\n}\n\n/**\n * Individual carousel item/slide.\n *\n * @function\n * @param {CarouselItemProps} props - Props for the CarouselItem component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the carousel item element.\n * @returns {JSX.Element} The rendered carousel item.\n */\nexport const CarouselItem = forwardRef<HTMLDivElement, CarouselItemProps>(\n ({ active, className, children, ...props }, ref) => {\n const itemClasses = classNames(\n usePrefixedClassNames('carousel-item', { 'is-active': active }),\n className\n );\n\n return (\n <div ref={ref} className={itemClasses} {...props}>\n {children}\n </div>\n );\n }\n);\n\nCarouselItem.displayName = 'CarouselItem';\n\ntype IconLibrary = 'fa' | 'mdi' | 'ion' | 'material-icons' | 'material-symbols';\n\n/**\n * Default SVG icon for the previous arrow button.\n *\n * @function\n * @returns {JSX.Element} The rendered SVG chevron-left icon.\n */\nconst DefaultPrevIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"15 18 9 12 15 6\" />\n </svg>\n);\n\n/**\n * Default SVG icon for the next arrow button.\n *\n * @function\n * @returns {JSX.Element} The rendered SVG chevron-right icon.\n */\nconst DefaultNextIcon = () => (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n >\n <polyline points=\"9 18 15 12 9 6\" />\n </svg>\n);\n\n/**\n * The media queries Bulma's `fullhd`, `widescreen`, `desktop` and `tablet`\n * mixins open with, widest first, at Bulma's default breakpoints. The\n * stylesheet picks the count in view with those mixins; these tell the\n * script which count that is. Narrower than the last one is `mobile`.\n */\nconst VIEWPORT_QUERIES = [\n 'screen and (min-width: 1408px)',\n 'screen and (min-width: 1216px)',\n 'screen and (min-width: 1024px)',\n 'screen and (min-width: 769px), print',\n];\n\n/** `useBulmaViewport`'s answer below the tablet breakpoint. */\nconst MOBILE = VIEWPORT_QUERIES.length;\n\n/**\n * The `--bulma-carousel-items-to-show*` variable each count prop writes, in\n * the order the component lists them: the viewports as above, mobile, and\n * last `itemsToShow` itself.\n */\nconst COUNT_SUFFIXES = [\n '-fullhd',\n '-widescreen',\n '-desktop',\n '-tablet',\n '-mobile',\n '',\n];\n\n/**\n * Which of Bulma's viewports the window is in: the index of the widest\n * `VIEWPORT_QUERIES` entry that matches, `MOBILE` below them all, or `-1`\n * when that isn't known (on the server, before the first layout effect, and\n * whenever `enabled` is off, so a carousel with one count everywhere\n * subscribes to nothing).\n *\n * @function\n * @param {boolean} enabled - Whether any viewport-specific count is set.\n * @returns {number} The viewport, as described above.\n */\nfunction useBulmaViewport(enabled: boolean): number {\n const [viewport, setViewport] = useState(-1);\n\n useClientLayoutEffect(() => {\n if (!enabled || typeof window.matchMedia !== 'function') return undefined;\n const lists = VIEWPORT_QUERIES.map(query => window.matchMedia(query));\n const update = () => {\n const index = lists.findIndex(list => list.matches);\n setViewport(index < 0 ? MOBILE : index);\n };\n update();\n lists.forEach(list => list.addEventListener('change', update));\n return () =>\n lists.forEach(list => list.removeEventListener('change', update));\n }, [enabled]);\n\n return enabled ? viewport : -1;\n}\n\n/**\n * A count prop as the whole number the carousel works with: rounded down,\n * and never below 1, so a zero or a stray `NaN` can't divide by nothing.\n *\n * @function\n * @param {number | undefined} count - The prop as given.\n * @returns {number | undefined} The count, or `undefined` when unset.\n */\nconst wholeCount = (count: number | undefined) =>\n count === undefined ? undefined : Math.max(1, Math.floor(count) || 1);\n\n/**\n * Props for the Carousel component.\n * @extraProp {string} [className] - Additional CSS classes.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the carousel element.\n */\nexport interface CarouselProps\n extends\n Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'color'>,\n BulmaClassesProps {\n /**\n * Index of the first item in view (controlled); with one item in view, the\n * slide shown. A value between two of the positions a step lands on (see\n * `itemsToScroll`) is shown as given, and the next step goes on from it.\n * With `repeat`, a value past either end wraps around; without it, one\n * that would leave empty space after the last item shows the last full\n * view. Neither correction calls `onChange`. A value that takes the item\n * holding focus out of view moves focus to the first item in view, as a\n * swipe or a change of width does.\n * @defaultValue 0\n */\n value?: number;\n /**\n * Enable auto-play: one step (`itemsToScroll` items) per `interval`.\n * Without `repeat` it stops at the last position. It waits while the\n * pointer is over the carousel (see `pauseOnHover`) and while focus is\n * inside one of its items, so an item being read or used never moves out\n * of view.\n */\n autoplay?: boolean;\n /** Auto-play interval in milliseconds. Default: 5000. */\n interval?: number;\n /** Pause auto-play on hover. Default: true. */\n pauseOnHover?: boolean;\n /**\n * Loop back to the first position after the last. Default: true. With\n * several items in view, the view runs on past the last item into the\n * first ones, so it can show the end and the start side by side. Only\n * loops when some item is out of view.\n */\n repeat?: boolean;\n /**\n * Enable drag/swipe navigation. Default: true. A swipe moves one step,\n * however far it travels.\n */\n hasDrag?: boolean;\n /**\n * How many items are in view at once, at every width no\n * `itemsToShow<Viewport>` prop covers. Those props read the way a\n * `Column`'s `size<Viewport>` props do: `itemsToShowMobile` applies below\n * Bulma's tablet breakpoint, each of the others from its own breakpoint\n * up, and where several apply the widest one wins. A whole number, rounded\n * down and at least 1. The widths come from the stylesheet, so they are\n * right on the first paint; the arrows, indicators and steps use the\n * count for the window's width once the page has hydrated, and this one\n * until then. With this many children or fewer, every item keeps its\n * share of the width, nothing moves, and no arrows or indicators render.\n * @defaultValue 1\n */\n itemsToShow?: number;\n /**\n * Items in view at any width below Bulma's tablet breakpoint (769px),\n * fractional ones included. Falls back to `itemsToShow`.\n */\n itemsToShowMobile?: number;\n /**\n * Items in view from Bulma's tablet breakpoint (769px) up, until a wider\n * viewport's prop takes over. Falls back to `itemsToShow`.\n */\n itemsToShowTablet?: number;\n /**\n * Items in view from Bulma's desktop breakpoint (1024px) up, until a wider\n * viewport's prop takes over. Falls back to `itemsToShowTablet`, then\n * `itemsToShow`.\n */\n itemsToShowDesktop?: number;\n /**\n * Items in view from Bulma's widescreen breakpoint (1216px) up, until\n * `itemsToShowFullhd` takes over. Falls back to `itemsToShowDesktop`, and\n * on down to `itemsToShow`.\n */\n itemsToShowWidescreen?: number;\n /**\n * Items in view from Bulma's fullhd breakpoint (1408px) up. Falls back to\n * `itemsToShowWidescreen`, and on down to `itemsToShow`.\n */\n itemsToShowFullhd?: number;\n /**\n * How many items one step moves, for an arrow, an arrow key, a swipe or an\n * autoplay tick. A whole number, capped at the count in view so a step\n * never skips an item. Without `repeat`, the last step stops at the last\n * full view, so it can be shorter; with `repeat`, the step after the last\n * position goes on to the first one. The indicators mark these positions,\n * one per step rather than one per item. When the count in view changes\n * with the window's width, the first item in view stays in view.\n * @defaultValue 1\n */\n itemsToScroll?: number;\n /**\n * Show navigation arrows. Default: true. They render `type=\"button\"`, so a\n * carousel inside a form is not submitted by moving between slides.\n */\n arrow?: boolean;\n /** Only show arrows on hover. */\n arrowHover?: boolean;\n /**\n * Show slide indicators. Default: true. There is one for each position a\n * step can land on (see `itemsToScroll`). They render `type=\"button\"`, so\n * a carousel inside a form is not submitted by picking a slide.\n */\n indicator?: boolean;\n /**\n * Puts the indicators over the slides instead of below them, at the edge\n * `indicatorPosition` names. It also turns on the overlay look unless\n * `overlayControls` says otherwise, so on its own it gives the look made\n * for photos: light arrows, and light indicators on a dark gradient band.\n */\n indicatorInside?: boolean;\n /**\n * The overlay look, made for photos. The arrows take the\n * `--bulma-carousel-overlay-arrow-*` colors, and indicators over the\n * slides take the `--bulma-carousel-overlay-indicator-*` colors on a dark\n * gradient band. Indicators below the slides keep their plain colors,\n * since they sit on the page. It follows `indicatorInside` unless you set\n * it, so `overlayControls={false}` puts the indicators over the slides\n * with the plain look, and `overlayControls` alone gives the arrows the\n * overlay look with the indicators below. While it's on, `arrowColor`\n * doesn't apply.\n * @defaultValue indicatorInside\n */\n overlayControls?: boolean;\n /**\n * The edge of the slides `indicatorInside` puts the indicators on.\n * Default: 'bottom'. Without `indicatorInside` they sit below the slides\n * whatever this says, so leave it unset there.\n */\n indicatorPosition?: 'bottom' | 'top';\n /** Indicator style. Default: 'dots'. */\n indicatorStyle?: 'circles' | 'dots' | 'lines' | 'bars';\n /** Icon name for the previous arrow button. */\n iconPrev?: string;\n /** Icon name for the next arrow button. */\n iconNext?: string;\n /** Icon library to use. */\n iconLibrary?: IconLibrary;\n /** Icon style variant (e.g., 'solid', 'outlined'). */\n iconVariant?: string;\n /** Icon size modifier. */\n iconSize?: 'small' | 'medium' | 'large';\n /** Additional icon modifiers. */\n iconFeatures?: string | string[];\n /** Show semi-transparent background on arrow buttons. Set to `false` for icon-only arrows. */\n arrowBackground?: boolean;\n /**\n * Color theme for navigation arrows. Not applied while the overlay look is\n * on (see `overlayControls`, which `indicatorInside` turns on), whose\n * arrows take `--bulma-carousel-overlay-arrow-color`.\n */\n arrowColor?: 'light' | 'dark';\n /** Accessible label for the carousel region. Default: 'Image carousel'. */\n ariaLabel?: string;\n /**\n * Called with the index of the first item in view when an arrow, an arrow\n * key, an indicator, a swipe or autoplay moves the carousel.\n */\n onChange?: (value: number) => void;\n /** CarouselItem children. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Carousel` component provides an image/content slider with navigation arrows and indicators.\n *\n * @function\n * @param {CarouselProps} props - Props for the Carousel component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the carousel element.\n * @returns {JSX.Element} The rendered carousel component.\n *\n * @example\n * // Basic carousel\n * <Carousel>\n * <CarouselItem>Slide 1</CarouselItem>\n * <CarouselItem>Slide 2</CarouselItem>\n * <CarouselItem>Slide 3</CarouselItem>\n * </Carousel>\n *\n * @example\n * // Auto-playing carousel\n * <Carousel autoplay interval={3000}>\n * <CarouselItem>\n * <img src=\"image1.jpg\" alt=\"Slide 1\" />\n * </CarouselItem>\n * <CarouselItem>\n * <img src=\"image2.jpg\" alt=\"Slide 2\" />\n * </CarouselItem>\n * </Carousel>\n *\n * @example\n * // Three cards in view on desktop, two on tablet, one on mobile\n * <Carousel itemsToShow={1} itemsToShowTablet={2} itemsToShowDesktop={3}>\n * {cards.map(card => (\n * <CarouselItem key={card.id}>{card.body}</CarouselItem>\n * ))}\n * </Carousel>\n */\nexport const Carousel = forwardRef<HTMLDivElement, CarouselProps>(\n (\n {\n value: controlledValue,\n autoplay = false,\n interval = 5000,\n pauseOnHover = true,\n repeat = true,\n hasDrag = true,\n itemsToShow,\n itemsToShowMobile,\n itemsToShowTablet,\n itemsToShowDesktop,\n itemsToShowWidescreen,\n itemsToShowFullhd,\n itemsToScroll,\n arrow = true,\n arrowHover = false,\n indicator = true,\n indicatorInside = false,\n overlayControls = indicatorInside,\n indicatorPosition = 'bottom',\n indicatorStyle = 'dots',\n iconPrev,\n iconNext,\n iconLibrary,\n iconVariant,\n iconSize,\n iconFeatures,\n arrowBackground = true,\n arrowColor,\n ariaLabel = 'Image carousel',\n onChange,\n className,\n style,\n children,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses(props);\n const carouselRef = useRef<HTMLDivElement>(null);\n // Cleanup returned by a consumer's callback ref on attach, held until detach.\n const consumerCleanupRef = useRef<(() => void) | null>(null);\n const containerRef = useRef<HTMLDivElement>(null);\n const slidesRef = useRef<HTMLDivElement>(null);\n // The item (a child of the track) that holds focus, until focus leaves\n // the items for somewhere else\n const focusedItemRef = useRef<Element | undefined>(undefined);\n\n const [internalValue, setInternalValue] = useState(0);\n const [isPaused, setIsPaused] = useState(false);\n const [isFocusInside, setIsFocusInside] = useState(false);\n const [isDragging, setIsDragging] = useState(false);\n const [dragStart, setDragStart] = useState(0);\n const [dragOffset, setDragOffset] = useState(0);\n const [isWrapping, setIsWrapping] = useState(false);\n const [displayIndex, setDisplayIndex] = useState(0);\n const [skipTransition, setSkipTransition] = useState(false);\n\n // Get valid children\n const items = Children.toArray(children).filter(\n isValidElement\n ) as React.ReactElement<CarouselItemProps>[];\n const itemCount = items.length;\n\n // The count in view. The viewport props come widest first, in the order\n // of VIEWPORT_QUERIES, then mobile; each min-width viewport falls back to\n // the narrower ones, and every viewport to `itemsToShow`, the cascade the\n // stylesheet's `--bulma-carousel-items-to-show-*` defaults spell out.\n const counts = [\n itemsToShowFullhd,\n itemsToShowWidescreen,\n itemsToShowDesktop,\n itemsToShowTablet,\n itemsToShowMobile,\n ].map(wholeCount);\n const baseCount = wholeCount(itemsToShow);\n const viewport = useBulmaViewport(counts.some(c => c !== undefined));\n const inView =\n (viewport === MOBILE\n ? counts[MOBILE]\n : viewport >= 0\n ? counts.slice(viewport, MOBILE).find(c => c !== undefined)\n : undefined) ??\n baseCount ??\n 1;\n // The props as the stylesheet reads them, so the widths are right from\n // the first paint, on the server too.\n const countStyle: Record<string, number> = {};\n [...counts, baseCount].forEach((count, i) => {\n if (count !== undefined) {\n countStyle[`--bulma-carousel-items-to-show${COUNT_SUFFIXES[i]}`] =\n count;\n }\n });\n\n const scroll = Math.min(wholeCount(itemsToScroll) ?? 1, inView);\n const looping = repeat && itemCount > inView;\n const lastStart = Math.max(0, itemCount - inView);\n // Where the view can start: every `scroll` items from the first, and\n // without a loop the last full view as well, which is what keeps the\n // end of the track from showing empty space.\n const positions: number[] = [];\n for (let p = 0; p < (looping ? itemCount : lastStart); p += scroll) {\n positions.push(p);\n }\n if (!looping) positions.push(lastStart);\n const lastPosition = positions[positions.length - 1];\n const canMove = positions.length > 1;\n\n const wrap = (index: number) =>\n ((index % itemCount) + itemCount) % itemCount;\n const fit = (index: number) =>\n looping ? wrap(index) : Math.min(Math.max(index, 0), lastStart);\n\n // Use controlled or internal value, as a start the view can show\n const activeIndex = fit(controlledValue ?? internalValue);\n // The indicator for the last position at or before the first item in view\n const activePosition = positions.reduce(\n (found, position, index) => (position <= activeIndex ? index : found),\n 0\n );\n const nextIndex = positions[activePosition + 1];\n // From between two positions, the previous step is the one just behind\n const prevIndex =\n activeIndex > positions[activePosition]\n ? positions[activePosition]\n : positions[activePosition - 1];\n\n // Sync displayIndex when the value changes externally, or when the count\n // in view moves the start it fits to. Intentional external-prop sync that\n // must not run mid-wrap animation; covered by tests and certified\n // in-browser. Uncontrolled, the fitted start becomes the value too, so a\n // later change of count keeps what was first in view in view.\n useEffect(() => {\n if (!isWrapping) {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- syncing to controlled prop\n setDisplayIndex(activeIndex);\n if (controlledValue === undefined) setInternalValue(activeIndex);\n }\n }, [activeIndex, isWrapping, controlledValue]);\n\n // Update active index\n const setActiveIndex = useCallback(\n (index: number) => {\n if (controlledValue === undefined) {\n setInternalValue(index);\n }\n setDisplayIndex(index);\n setIsWrapping(false);\n onChange?.(index);\n },\n [controlledValue, onChange]\n );\n\n // Navigation handlers\n const goToPrev = useCallback(() => {\n if (prevIndex !== undefined) {\n setActiveIndex(prevIndex);\n } else if (looping) {\n // Animate to the clones before the first item, which show the last\n // position, and snap to the real one when the transition ends\n setDisplayIndex(lastPosition - itemCount);\n setIsWrapping(true);\n }\n }, [prevIndex, looping, lastPosition, itemCount, setActiveIndex]);\n\n const goToNext = useCallback(() => {\n if (nextIndex !== undefined) {\n setActiveIndex(nextIndex);\n } else if (looping) {\n // Animate to the clones after the last item, which show the first\n // position, and snap to the real one when the transition ends\n setDisplayIndex(itemCount);\n setIsWrapping(true);\n }\n }, [nextIndex, looping, itemCount, setActiveIndex]);\n\n // Read when the timer fires or an arrow key arrives, so neither the\n // timer nor the key listener starts over while `onChange` changes\n // identity, as an inline one does on every render of the parent.\n const goToPrevRef = useLatestRef(goToPrev);\n const goToNextRef = useLatestRef(goToNext);\n\n // Auto-play. Each slide gets the whole interval, so a slide change,\n // autoplay's own or the user's, starts the timer over. A render that\n // leaves the slide where it is doesn't. It waits while focus is inside\n // an item, so what someone is reading or using doesn't move away. The\n // timer reads where focus is when it fires, rather than trusting the\n // last focus event alone: a browser moving focus off an element that\n // went inert need not fire one, and the pause would never end. A focus\n // change still starts the timer over, so an item gets the whole\n // interval once focus leaves it.\n const isPlaying =\n autoplay && (looping || nextIndex !== undefined) && !isPaused;\n const isRotating = isPlaying && !isFocusInside;\n\n useEffect(() => {\n if (!isPlaying) return undefined;\n\n const timer = setInterval(() => {\n const track = slidesRef.current;\n if (track?.contains(getActiveElementInTree(track))) return;\n if (isFocusInside) setIsFocusInside(false);\n goToNextRef.current();\n }, interval);\n\n return () => clearInterval(timer);\n }, [isPlaying, isFocusInside, interval, activeIndex, goToNextRef]);\n\n // Pause on hover\n const handleMouseEnter = useCallback(() => {\n if (pauseOnHover) {\n setIsPaused(true);\n }\n }, [pauseOnHover]);\n\n const handleMouseLeave = useCallback(() => {\n if (pauseOnHover) {\n setIsPaused(false);\n }\n }, [pauseOnHover]);\n\n // Drag handlers\n const handleDragStart = useCallback(\n (clientX: number) => {\n if (!hasDrag) return;\n setIsDragging(true);\n setDragStart(clientX);\n setDragOffset(0);\n },\n [hasDrag]\n );\n\n const handleDragMove = useCallback(\n (clientX: number) => {\n if (!isDragging) return;\n setDragOffset(clientX - dragStart);\n },\n [isDragging, dragStart]\n );\n\n const handleDragEnd = useCallback(() => {\n if (!isDragging) return;\n setIsDragging(false);\n\n const threshold = 50;\n if (dragOffset < -threshold) {\n goToNext();\n } else if (dragOffset > threshold) {\n goToPrev();\n }\n\n setDragOffset(0);\n }, [isDragging, dragOffset, goToNext, goToPrev]);\n\n // Mouse events\n const handleMouseDown = useCallback(\n (e: React.MouseEvent) => {\n e.preventDefault();\n handleDragStart(e.clientX);\n },\n [handleDragStart]\n );\n\n const handleMouseMove = useCallback(\n (e: React.MouseEvent) => {\n handleDragMove(e.clientX);\n },\n [handleDragMove]\n );\n\n const handleMouseUp = useCallback(() => {\n handleDragEnd();\n }, [handleDragEnd]);\n\n // Touch events\n const handleTouchStart = useCallback(\n (e: React.TouchEvent) => {\n handleDragStart(e.touches[0].clientX);\n },\n [handleDragStart]\n );\n\n const handleTouchMove = useCallback(\n (e: React.TouchEvent) => {\n handleDragMove(e.touches[0].clientX);\n },\n [handleDragMove]\n );\n\n const handleTouchEnd = useCallback(() => {\n handleDragEnd();\n }, [handleDragEnd]);\n\n // Keyboard navigation, from the carousel's own controls. Inside an item\n // the keys are its content's (a field's caret, a slider), and a step\n // from there could take the focused item out of view.\n useEffect(() => {\n const handleKeyDown = (e: KeyboardEvent) => {\n const node = carouselRef.current;\n const active = getActiveElementInTree(node);\n if (!node?.contains(active) || slidesRef.current?.contains(active)) {\n return;\n }\n\n switch (e.key) {\n case 'ArrowLeft':\n e.preventDefault();\n goToPrevRef.current();\n break;\n case 'ArrowRight':\n e.preventDefault();\n goToNextRef.current();\n break;\n }\n };\n\n document.addEventListener('keydown', handleKeyDown);\n return () => document.removeEventListener('keydown', handleKeyDown);\n }, [goToPrevRef, goToNextRef]);\n\n // Handle wrap-around transition end: the track's own, since an item's\n // content can end a transition of its own that bubbles up to here\n const handleTransitionEnd = useCallback(\n (e: React.TransitionEvent<HTMLDivElement>) => {\n if (isWrapping && e.target === e.currentTarget) {\n // Skip transition for the instant snap from the clones to the\n // real items they copy\n setSkipTransition(true);\n setActiveIndex(((displayIndex % itemCount) + itemCount) % itemCount);\n\n // Re-enable transition after the snap\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n setSkipTransition(false);\n });\n });\n }\n },\n [isWrapping, displayIndex, itemCount, setActiveIndex]\n );\n\n // Combined ref\n const combinedRef = useCallback(\n (node: HTMLDivElement | null) => {\n (carouselRef as React.MutableRefObject<HTMLDivElement | null>).current =\n node;\n if (typeof ref === 'function') {\n // React 19 lets a callback ref return a cleanup function and detaches by\n // running it instead of calling the ref with `null`; React 18 discards the\n // return value entirely. Returning it from here would be a React-19-only\n // contract, so we hold the cleanup and run it ourselves on detach — the\n // same shape as `Dropdown`, `Modal`, `Dialog`, `Sidebar` and `Toast`.\n // The form controls that merge a forwarded ref still discard the cleanup\n // and detach with `ref(null)`, so this is not yet library-wide — grep\n // `typeof ref === 'function'` for the current split.\n if (node === null) {\n const consumerCleanup = consumerCleanupRef.current;\n consumerCleanupRef.current = null;\n if (consumerCleanup) {\n consumerCleanup();\n } else {\n ref(null);\n }\n return;\n }\n const cleanup: unknown = ref(node);\n consumerCleanupRef.current =\n typeof cleanup === 'function' ? (cleanup as () => void) : null;\n } else if (ref) {\n (ref as React.MutableRefObject<HTMLDivElement | null>).current = node;\n }\n },\n [ref]\n );\n\n // Can navigate\n const canGoPrev = looping || prevIndex !== undefined;\n const canGoNext = looping || nextIndex !== undefined;\n\n // Generate classes\n const carouselClasses = usePrefixedClassNames('carousel', {\n 'is-overlay': overlayControls,\n 'has-arrow-hover': arrowHover,\n [`is-indicator-${indicatorStyle}`]: indicatorStyle !== 'dots',\n [`is-arrow-${arrowColor}`]: !!arrowColor,\n });\n const classPrefix = useClassPrefix();\n const carouselContainerClass = usePrefixedClassNames('carousel-container');\n const carouselSlidesClass = usePrefixedClassNames('carousel-slides');\n const carouselArrowPrevClass = usePrefixedClassNames(\n 'carousel-arrow',\n 'is-prev',\n { 'is-transparent': !arrowBackground }\n );\n const carouselArrowNextClass = usePrefixedClassNames(\n 'carousel-arrow',\n 'is-next',\n { 'is-transparent': !arrowBackground }\n );\n const carouselIndicatorClass = usePrefixedClassNames('carousel-indicator', {\n 'is-inside': indicatorInside,\n 'is-top': indicatorPosition === 'top',\n });\n\n const combinedClasses = classNames(\n carouselClasses,\n bulmaHelperClasses,\n className\n );\n\n // Where the track is drawn from: mid-wrap the clones, otherwise a start\n // the view can show, so a change in the count in view never paints\n // empty space while the sync above catches up.\n const shownIndex = isWrapping ? displayIndex : fit(displayIndex);\n // Enough clones on each side to fill the widest view any viewport sets,\n // since the stylesheet, not this count, sizes what's on screen\n const cloneCount = looping\n ? Math.min(\n itemCount,\n Math.max(baseCount ?? 1, ...counts.map(c => c ?? 1))\n )\n : 0;\n // The track: a full view's worth of clones of the last items, the items,\n // and clones of the first ones, for a seamless loop. Each entry is the\n // item it shows and its key.\n const slots: [number, React.Key][] = items.map((_, index) => [\n index,\n index,\n ]);\n for (let k = 0; k < cloneCount; k++) {\n slots.splice(k, 0, [itemCount - cloneCount + k, `clone-before-${k}`]);\n slots.push([k, `clone-after-${k}`]);\n }\n\n // Render slides with active state (includes clones for infinite loop).\n // What's in view is a run of slots, so where a looping view runs past\n // the last item, the clones on screen are the live copies and the items\n // they copy, off screen, are the hidden ones: no item is exposed twice,\n // and the copy exposed is the one in view.\n const renderSlides = () =>\n slots.map(([index, key], slot) => {\n const item = items[index];\n const own = item.props;\n const isShown =\n slot >= shownIndex + cloneCount &&\n slot < shownIndex + cloneCount + inView;\n return cloneElement(item, {\n key,\n active: isShown,\n role: own.role ?? 'group',\n 'aria-roledescription': own['aria-roledescription'] ?? 'slide',\n ...(own['aria-label'] || own['aria-labelledby']\n ? {}\n : { 'aria-label': `${index + 1} of ${itemCount}` }),\n // Out of view: hidden from assistive tech, and inert, so nothing\n // in it takes focus or a click\n ...(isShown ? {} : { 'aria-hidden': true, ...inertProps(true) }),\n });\n });\n\n // Hand focus on when the item holding it leaves the view. An item out\n // of view is inert, and a browser drops focus from an inert element to\n // the page, so a swipe, a change of count with the window's width, a new\n // controlled value or the item's removal would leave a keyboard or\n // screen reader user nowhere. Focus goes to the first item in view,\n // given `tabindex=\"-1\"` for it unless it has a tabindex of its own. A\n // layout effect runs before the browser gets to drop the focus; the\n // focused item's removal drops it at once, so focus on the page itself\n // still counts as the item's.\n useClientLayoutEffect(() => {\n const held = focusedItemRef.current;\n if (!held) return;\n const track = slidesRef.current as HTMLDivElement;\n const start = shownIndex + cloneCount;\n const slot = Array.prototype.indexOf.call(track.children, held);\n if (slot >= start && slot < start + inView) return;\n const active = getActiveElementInTree(track);\n if (active !== held.ownerDocument.body && !held.contains(active)) {\n return;\n }\n focusedItemRef.current = undefined;\n const first = track.children[start] as HTMLElement | undefined;\n if (!first) return;\n if (!first.hasAttribute('tabindex')) first.tabIndex = -1;\n first.focus({ preventScroll: true });\n }, [shownIndex, cloneCount, inView, itemCount]);\n\n return (\n <div\n ref={combinedRef}\n className={combinedClasses}\n onMouseEnter={handleMouseEnter}\n onMouseLeave={handleMouseLeave}\n role=\"region\"\n aria-roledescription=\"carousel\"\n aria-label={ariaLabel}\n style={{ ...countStyle, ...style }}\n {...rest}\n >\n <div\n ref={containerRef}\n className={carouselContainerClass}\n onMouseDown={hasDrag ? handleMouseDown : undefined}\n onMouseMove={hasDrag && isDragging ? handleMouseMove : undefined}\n onMouseUp={hasDrag ? handleMouseUp : undefined}\n onMouseLeave={hasDrag ? handleMouseUp : undefined}\n onTouchStart={hasDrag ? handleTouchStart : undefined}\n onTouchMove={hasDrag ? handleTouchMove : undefined}\n onTouchEnd={hasDrag ? handleTouchEnd : undefined}\n style={{\n transform: isDragging ? `translateX(${dragOffset}px)` : undefined,\n cursor: hasDrag ? (isDragging ? 'grabbing' : 'grab') : undefined,\n }}\n >\n <div\n ref={slidesRef}\n className={carouselSlidesClass}\n style={{\n // One item is the track's width plus a gap, over the count the\n // stylesheet has in view; account for the prepended clones\n transform: `translateX(calc(${-(shownIndex + cloneCount)} * (100% + var(--bulma-carousel-item-gap, 0px)) / var(--bulma-carousel-items-in-view, 1)))`,\n // Disable transition during drag or instant snap after wrap-around\n transition:\n isDragging || skipTransition\n ? 'none'\n : 'transform 0.3s ease-in-out',\n }}\n // Announce what comes into view, except while autoplay turns it\n aria-live={isRotating ? 'off' : 'polite'}\n onFocus={e => {\n setIsFocusInside(true);\n focusedItemRef.current = Array.from(\n e.currentTarget.children\n ).find(item => item.contains(e.target));\n }}\n onBlur={e => {\n const inside = e.currentTarget.contains(e.relatedTarget);\n setIsFocusInside(inside);\n if (!inside) focusedItemRef.current = undefined;\n }}\n onTransitionEnd={handleTransitionEnd}\n >\n {renderSlides()}\n </div>\n {arrow && canMove && (\n <>\n <Button\n type=\"button\"\n className={carouselArrowPrevClass}\n onClick={goToPrev}\n isDisabled={!canGoPrev}\n aria-label=\"Previous slide\"\n >\n {iconPrev ? (\n <Icon\n name={iconPrev}\n library={iconLibrary}\n variant={iconVariant}\n size={iconSize}\n features={iconFeatures}\n />\n ) : (\n <DefaultPrevIcon />\n )}\n </Button>\n <Button\n type=\"button\"\n className={carouselArrowNextClass}\n onClick={goToNext}\n isDisabled={!canGoNext}\n aria-label=\"Next slide\"\n >\n {iconNext ? (\n <Icon\n name={iconNext}\n library={iconLibrary}\n variant={iconVariant}\n size={iconSize}\n features={iconFeatures}\n />\n ) : (\n <DefaultNextIcon />\n )}\n </Button>\n </>\n )}\n </div>\n\n {indicator && canMove && (\n <div className={carouselIndicatorClass} role=\"tablist\">\n {positions.map((position, index) => (\n <Button\n key={position}\n type=\"button\"\n className={prefixedClassNames(classPrefix, 'indicator-item', {\n 'is-active': index === activePosition,\n })}\n onClick={() => setActiveIndex(position)}\n role=\"tab\"\n aria-selected={index === activePosition}\n aria-label={`Go to slide ${position + 1}`}\n />\n ))}\n </div>\n )}\n </div>\n );\n }\n);\n\nCarousel.displayName = 'Carousel';\n\nexport default Carousel;\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;AA0CA;;;;;;;AAOG;MACU,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AACjD,IAAA,MAAM,WAAW,GAAG,UAAU,CAC5B,qBAAqB,CAAC,eAAe,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,EAC/D,SAAS,CACV;AAED,IAAA,QACEA,GAAA,CAAA,KAAA,EAAA,EAAK,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,KAAM,KAAK,EAAA,QAAA,EAC7C,QAAQ,EAAA,CACL;AAEV,CAAC;AAGH,YAAY,CAAC,WAAW,GAAG,cAAc;AAIzC;;;;;AAKG;AACH,MAAM,eAAe,GAAG,OACtBA,GAAA,CAAA,KAAA,EAAA,EACE,KAAK,EAAC,4BAA4B,EAClC,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,GAAG,EAAA,QAAA,EAEfA,GAAA,CAAA,UAAA,EAAA,EAAU,MAAM,EAAC,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,EAAE;wBAC3D,WAAW,EAAE,KAAK,KAAK,cAAc;AACtC,qBAAA,CAAC,EACF,OAAO,EAAE,MAAM,cAAc,CAAC,QAAQ,CAAC,EACvC,IAAI,EAAC,KAAK,EAAA,eAAA,EACK,KAAK,KAAK,cAAc,EAAA,YAAA,EAC3B,CAAA,YAAA,EAAe,QAAQ,GAAG,CAAC,CAAA,CAAE,EAAA,EARpC,QAAQ,CASb,CACH,CAAC,EAAA,CACE,CACP,CAAA,EAAA,CACG;AAEV,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
package/dist/esm/elements/Td.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
|
|
4
4
|
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
|
+
import { validTableAlignments } from './tableAlignment.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* The values the table `color` prop accepts, as a readonly tuple.
|
|
@@ -38,22 +39,23 @@ const validTableColors = [
|
|
|
38
39
|
/**
|
|
39
40
|
* Td component for rendering a styled Bulma table cell.
|
|
40
41
|
*
|
|
41
|
-
* Supports Bulma color modifiers and helper classes for additional styling.
|
|
42
|
+
* Supports alignment, Bulma color modifiers, and helper classes for additional styling.
|
|
42
43
|
*
|
|
43
44
|
* @function
|
|
44
45
|
* @param {TdProps} props - Props for the Td component.
|
|
45
46
|
* @returns {JSX.Element} The rendered table cell element.
|
|
46
47
|
* @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}
|
|
47
48
|
*/
|
|
48
|
-
const Td = ({ className, color, children, ...props }) => {
|
|
49
|
-
const
|
|
49
|
+
const Td = ({ className, isAligned, color, children, ...props }) => {
|
|
50
|
+
const bulmaClasses = usePrefixedClassNames('', {
|
|
51
|
+
[`has-text-${isAligned}`]: isAligned && validTableAlignments.includes(isAligned),
|
|
50
52
|
[`is-${color}`]: color && validTableColors.includes(color),
|
|
51
53
|
});
|
|
52
54
|
/**
|
|
53
55
|
* Generates Bulma helper classes and separates out remaining props.
|
|
54
56
|
*/
|
|
55
57
|
const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });
|
|
56
|
-
const tdClasses = classNames(
|
|
58
|
+
const tdClasses = classNames(bulmaClasses, className, bulmaHelperClasses);
|
|
57
59
|
return (jsx("td", { className: tdClasses || undefined, ...rest, children: children }));
|
|
58
60
|
};
|
|
59
61
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Td.js","sources":["../../../src/elements/Td.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\n\n/**\n * The values the table `color` prop accepts, as a readonly tuple.\n *\n * `TableColor` is typed from it, and `Tr`, `Th` and `Td` all take a\n * `TableColor`, so the tuple and those props list the same values. Map over\n * it to build a color picker, or check a value that arrives at runtime before\n * passing it in: the components add no color class for a value outside the\n * tuple.\n *\n * @example\n * import { Tr, Td, validTableColors } from '@allxsmith/bestax-bulma';\n *\n * <Tr>\n * {validTableColors.map(color => (\n * <Td key={color} color={color}>\n * {color}\n * </Td>\n * ))}\n * </Tr>;\n */\nexport const validTableColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'dark',\n 'light',\n 'white',\n] as const;\n\n/**\n * The color values `Tr`, `Th` and `Td` accept, typed from `validTableColors`.\n */\nexport type TableColor = (typeof validTableColors)[number];\n\n/**\n * Props for the Td component.\n */\nexport interface TdProps\n extends\n Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Bulma color modifier for the table cell. */\n color?: TableColor;\n /** Table cell content. */\n children?: React.ReactNode;\n}\n\n/**\n * Td component for rendering a styled Bulma table cell.\n *\n * Supports Bulma color modifiers and helper classes for additional styling.\n *\n * @function\n * @param {TdProps} props - Props for the Td component.\n * @returns {JSX.Element} The rendered table cell element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}\n */\nexport const Td: React.FC<TdProps> = ({\n className,\n color,\n children,\n ...props\n}) => {\n const
|
|
1
|
+
{"version":3,"file":"Td.js","sources":["../../../src/elements/Td.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { TableAlignment, validTableAlignments } from './tableAlignment';\n\n/**\n * The values the table `color` prop accepts, as a readonly tuple.\n *\n * `TableColor` is typed from it, and `Tr`, `Th` and `Td` all take a\n * `TableColor`, so the tuple and those props list the same values. Map over\n * it to build a color picker, or check a value that arrives at runtime before\n * passing it in: the components add no color class for a value outside the\n * tuple.\n *\n * @example\n * import { Tr, Td, validTableColors } from '@allxsmith/bestax-bulma';\n *\n * <Tr>\n * {validTableColors.map(color => (\n * <Td key={color} color={color}>\n * {color}\n * </Td>\n * ))}\n * </Tr>;\n */\nexport const validTableColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'dark',\n 'light',\n 'white',\n] as const;\n\n/**\n * The color values `Tr`, `Th` and `Td` accept, typed from `validTableColors`.\n */\nexport type TableColor = (typeof validTableColors)[number];\n\n/**\n * Props for the Td component.\n */\nexport interface TdProps\n extends\n Omit<React.TdHTMLAttributes<HTMLTableCellElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text alignment for the table cell ('left', 'right', 'centered'). */\n isAligned?: TableAlignment;\n /** Bulma color modifier for the table cell. */\n color?: TableColor;\n /** Table cell content. */\n children?: React.ReactNode;\n}\n\n/**\n * Td component for rendering a styled Bulma table cell.\n *\n * Supports alignment, Bulma color modifiers, and helper classes for additional styling.\n *\n * @function\n * @param {TdProps} props - Props for the Td component.\n * @returns {JSX.Element} The rendered table cell element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-body | Bulma Table documentation}\n */\nexport const Td: React.FC<TdProps> = ({\n className,\n isAligned,\n color,\n children,\n ...props\n}) => {\n const bulmaClasses = usePrefixedClassNames('', {\n [`has-text-${isAligned}`]:\n isAligned && validTableAlignments.includes(isAligned),\n [`is-${color}`]: color && validTableColors.includes(color),\n });\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const tdClasses = classNames(bulmaClasses, className, bulmaHelperClasses);\n\n return (\n <td className={tdClasses || undefined} {...rest}>\n {children}\n </td>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;AAQA;;;;;;;;;;;;;;;;;;;AAmBG;AACI,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,OAAO;;AAyBT;;;;;;;;;AASG;AACI,MAAM,EAAE,GAAsB,CAAC,EACpC,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAC7C,QAAA,CAAC,CAAA,SAAA,EAAY,SAAS,CAAA,CAAE,GACtB,SAAS,IAAI,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC;AACvD,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC3D,KAAA,CAAC;AAEF;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC;AAEzE,IAAA,QACEA,GAAA,CAAA,IAAA,EAAA,EAAI,SAAS,EAAE,SAAS,IAAI,SAAS,EAAA,GAAM,IAAI,EAAA,QAAA,EAC5C,QAAQ,EAAA,CACN;AAET;;"}
|
package/dist/esm/elements/Th.js
CHANGED
|
@@ -3,8 +3,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
3
3
|
import { usePrefixedClassNames, classNames } from '../helpers/classNames.js';
|
|
4
4
|
import { useBulmaClasses } from '../helpers/useBulmaClasses.js';
|
|
5
5
|
import { validTableColors } from './Td.js';
|
|
6
|
+
import { validTableAlignments } from './tableAlignment.js';
|
|
6
7
|
|
|
7
|
-
const validAlignments = ['left', 'right', 'centered'];
|
|
8
8
|
/**
|
|
9
9
|
* Th component for rendering a styled Bulma table header cell.
|
|
10
10
|
*
|
|
@@ -17,7 +17,7 @@ const validAlignments = ['left', 'right', 'centered'];
|
|
|
17
17
|
*/
|
|
18
18
|
const Th = ({ className, isAligned, width, color, children, ...props }) => {
|
|
19
19
|
const bulmaClasses = usePrefixedClassNames('', {
|
|
20
|
-
[`has-text-${isAligned}`]: isAligned &&
|
|
20
|
+
[`has-text-${isAligned}`]: isAligned && validTableAlignments.includes(isAligned),
|
|
21
21
|
[`is-${color}`]: color && validTableColors.includes(color),
|
|
22
22
|
});
|
|
23
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Th.js","sources":["../../../src/elements/Th.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { TableColor, validTableColors } from './Td';\
|
|
1
|
+
{"version":3,"file":"Th.js","sources":["../../../src/elements/Th.tsx"],"sourcesContent":["/**\n * @group Table\n */\nimport React from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { useBulmaClasses, BulmaClassesProps } from '../helpers/useBulmaClasses';\nimport { TableColor, validTableColors } from './Td';\nimport { TableAlignment, validTableAlignments } from './tableAlignment';\n\n/**\n * Props for the Th component.\n */\nexport interface ThProps\n extends\n Omit<React.ThHTMLAttributes<HTMLTableCellElement>, 'color'>,\n Omit<BulmaClassesProps, 'backgroundColor' | 'color'> {\n /** Additional CSS classes to apply. */\n className?: string;\n /** Text alignment for the header cell ('left', 'right', 'centered'). */\n isAligned?: TableAlignment;\n /** Width of the header cell (e.g., '100px' or 100). */\n width?: string | number;\n /** Bulma color modifier for the header cell. */\n color?: TableColor;\n /** Table header cell content. */\n children?: React.ReactNode;\n}\n\n/**\n * Th component for rendering a styled Bulma table header cell.\n *\n * Supports alignment, width, and color modifiers.\n *\n * @function\n * @param {ThProps} props - Props for the Th component.\n * @returns {JSX.Element} The rendered table header cell element.\n * @see {@link https://bulma.io/documentation/elements/table/#table-head | Bulma Table documentation}\n */\nexport const Th: React.FC<ThProps> = ({\n className,\n isAligned,\n width,\n color,\n children,\n ...props\n}) => {\n const bulmaClasses = usePrefixedClassNames('', {\n [`has-text-${isAligned}`]:\n isAligned && validTableAlignments.includes(isAligned),\n [`is-${color}`]: color && validTableColors.includes(color),\n });\n\n /**\n * Generates Bulma helper classes and separates out remaining props.\n */\n const { bulmaHelperClasses, rest } = useBulmaClasses({ ...props });\n\n const thClasses = classNames(bulmaClasses, className, bulmaHelperClasses);\n\n return (\n <th\n className={thClasses || undefined}\n style={\n width\n ? { width: typeof width === 'number' ? `${width}px` : width }\n : undefined\n }\n {...rest}\n >\n {children}\n </th>\n );\n};\n"],"names":["_jsx"],"mappings":";;;;;;;AA4BA;;;;;;;;;AASG;MACU,EAAE,GAAsB,CAAC,EACpC,SAAS,EACT,SAAS,EACT,KAAK,EACL,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,KAAI;AACH,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,EAAE,EAAE;AAC7C,QAAA,CAAC,CAAA,SAAA,EAAY,SAAS,CAAA,CAAE,GACtB,SAAS,IAAI,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC;AACvD,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,gBAAgB,CAAC,QAAQ,CAAC,KAAK,CAAC;AAC3D,KAAA,CAAC;AAEF;;AAEG;AACH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,EAAE,GAAG,KAAK,EAAE,CAAC;IAElE,MAAM,SAAS,GAAG,UAAU,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC;IAEzE,QACEA,GAAA,CAAA,IAAA,EAAA,EACE,SAAS,EAAE,SAAS,IAAI,SAAS,EACjC,KAAK,EACH;AACE,cAAE,EAAE,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,GAAG,GAAG,KAAK,CAAA,EAAA,CAAI,GAAG,KAAK;cACzD,SAAS,EAAA,GAEX,IAAI,YAEP,QAAQ,EAAA,CACN;AAET;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* @allxsmith/bestax-bulma — AI agents: see AGENTS.md in the package root, or https://bestax.io/llms.txt */
|
|
2
|
+
/**
|
|
3
|
+
* The `isAligned` values `Th` and `Td` accept. Each one writes
|
|
4
|
+
* `has-text-<value>` on the cell, and a value outside the tuple adds no class.
|
|
5
|
+
*
|
|
6
|
+
* One copy, imported by both cells, so a header and its body cells always
|
|
7
|
+
* take the same values.
|
|
8
|
+
*
|
|
9
|
+
* Its own module rather than `Th.tsx` or `Td.tsx` because `src/index.ts`
|
|
10
|
+
* wildcard-exports those files, and everything published there is public
|
|
11
|
+
* forever. `iconProps.ts` makes the same call.
|
|
12
|
+
*/
|
|
13
|
+
const validTableAlignments = ['left', 'right', 'centered'];
|
|
14
|
+
|
|
15
|
+
export { validTableAlignments };
|
|
16
|
+
//# sourceMappingURL=tableAlignment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tableAlignment.js","sources":["../../../src/elements/tableAlignment.ts"],"sourcesContent":["/**\n * The `isAligned` values `Th` and `Td` accept. Each one writes\n * `has-text-<value>` on the cell, and a value outside the tuple adds no class.\n *\n * One copy, imported by both cells, so a header and its body cells always\n * take the same values.\n *\n * Its own module rather than `Th.tsx` or `Td.tsx` because `src/index.ts`\n * wildcard-exports those files, and everything published there is public\n * forever. `iconProps.ts` makes the same call.\n */\nexport const validTableAlignments = ['left', 'right', 'centered'] as const;\n\n/**\n * Valid alignment values for the Th and Td components.\n */\nexport type TableAlignment = (typeof validTableAlignments)[number];\n"],"names":[],"mappings":";AAAA;;;;;;;;;;AAUG;AACI,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","sources":["../../../src/form/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { useCheckboxesGroup } from './FormContext';\n\n/**\n * The values the Checkbox `color` prop accepts, as a readonly tuple.\n *\n * `CheckboxProps['color']` is typed from it, so the two list the same values.\n * Map over it to build a color picker, or check a value that arrives at\n * runtime before passing it in: the component adds no color class for a value\n * outside the tuple.\n *\n * @example\n * import { Checkbox, checkboxColors } from '@allxsmith/bestax-bulma';\n *\n * checkboxColors.map(color => (\n * <Checkbox key={color} color={color}>\n * {color}\n * </Checkbox>\n * ));\n */\nexport const checkboxColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const;\n\n/**\n * The values the Checkbox `size` prop accepts, as a readonly tuple.\n *\n * `CheckboxProps['size']` is typed from it, so the two list the same values.\n * Use it to offer a size choice or to check a value that arrives at runtime:\n * the component adds no size class for a value outside the tuple. These are\n * element sizes, not the spacing scale in `validSizes`.\n *\n * @example\n * import { checkboxSizes } from '@allxsmith/bestax-bulma';\n *\n * type CheckboxSize = (typeof checkboxSizes)[number];\n */\nexport const checkboxSizes = ['small', 'normal', 'medium', 'large'] as const;\n\n/**\n * Props for the Checkbox component.\n */\nexport interface CheckboxProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'type' | 'color'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {\n /** Color of the checkbox. */\n color?: (typeof checkboxColors)[number];\n /** Size of the checkbox. */\n size?: (typeof checkboxSizes)[number];\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Whether the checkbox is disabled. */\n disabled?: boolean;\n /**\n * Shows the mixed state, as in a \"Select all\" box when some of what it\n * covers is checked. It's a look and an announcement only: `checked` is\n * still the value, and a click still toggles `checked`. A browser clears\n * the mixed state on a click, so the component sets it again from this\n * prop after every click and every render. Left unset, the component\n * doesn't touch it, and once it has set it, going back to unset clears it\n * once and hands it back. It has no HTML attribute, so server-rendered\n * markup can't carry it, and a mixed box renders unmixed until hydration.\n */\n indeterminate?: boolean;\n /**\n * Additional CSS classes, on the outer `<label>`. That's the element that\n * declares the `--bulma-checkbox-*` variables, so a class is how to set\n * one: `style` and the other input attributes go to the `<input>`. Name\n * `.styled-checkbox` beside your class in the selector, so it beats the\n * label's own declaration whatever order the stylesheets load in. A\n * `color` prop declares the fills again on `.styled-checkbox.is-<color>`,\n * which ties that selector, so leave `color` unset when a class sets them.\n */\n className?: string;\n /** The label/content for the checkbox. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Checkbox` component provides a Bulma-styled checkbox input.\n *\n * @function\n * @param {CheckboxProps} props - Props for the Checkbox component.\n * @returns {JSX.Element} The rendered checkbox element.\n *\n * @example\n * // Basic checkbox\n * <Checkbox>Accept terms</Checkbox>\n *\n * @example\n * // Inside a group\n * <Checkboxes name=\"tags\" defaultValue={['react']}>\n * <Checkbox value=\"react\">React</Checkbox>\n * <Checkbox value=\"vue\">Vue</Checkbox>\n * </Checkboxes>\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n color,\n size,\n className,\n children,\n textColor,\n disabled,\n name,\n value,\n checked,\n defaultChecked,\n indeterminate,\n onChange,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n\n // The input's own ref, merged with the forwarded one. A callback ref's\n // return value is handed back, so React 19 still runs a cleanup it\n // returns, as it did when the ref went straight to the input.\n const inputRef = useRef<HTMLInputElement | null>(null);\n const setRefs = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === 'function') return ref(node);\n if (ref) ref.current = node;\n },\n [ref]\n );\n\n // `indeterminate` is a DOM property with no attribute, so it's set on the\n // input rather than rendered. A click clears it, so this runs after every\n // render, not only when the prop changes. Unset, it's left alone, so a\n // ref that sets the property itself still works. `ownsIndeterminateRef`\n // remembers that this component set it, so a prop that goes back to unset\n // clears the dash once instead of leaving it on.\n const ownsIndeterminateRef = useRef(false);\n useClientLayoutEffect(() => {\n if (indeterminate !== undefined) {\n ownsIndeterminateRef.current = true;\n inputRef.current!.indeterminate = indeterminate;\n } else if (ownsIndeterminateRef.current) {\n ownsIndeterminateRef.current = false;\n inputRef.current!.indeterminate = false;\n }\n });\n\n // Inherit name + selection state from a surrounding <Checkboxes> group.\n // Local props always win over the group (explicit > implicit).\n const group = useCheckboxesGroup();\n const effectiveName = name ?? group?.name;\n\n // Group-managed checked state — only when the group is in\n // controlled/uncontrolled mode (group.value is defined) AND this Checkbox\n // has a value to compare against. Local `checked` always wins.\n const groupManaged = group?.value !== undefined && value !== undefined;\n const groupHas = groupManaged && group!.value!.includes(String(value));\n const effectiveChecked =\n checked !== undefined ? checked : groupManaged ? groupHas : undefined;\n // When the group manages checked, suppress local defaultChecked to avoid\n // the controlled/uncontrolled React warning.\n const effectiveDefaultChecked = groupManaged ? undefined : defaultChecked;\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n // The click that got here cleared the mixed state. Put it back now,\n // since a click that changes no state renders nothing to do it.\n if (indeterminate !== undefined) e.target.indeterminate = indeterminate;\n // Local onChange always fires.\n onChange?.(e);\n // Dispatch to the group additionally — toggle this value's\n // membership in the group's array.\n if (group?.onChange && value !== undefined) {\n const valStr = String(value);\n const currentArr = group.value ?? [];\n const next = e.target.checked\n ? currentArr.includes(valStr)\n ? currentArr\n : [...currentArr, valStr]\n : currentArr.filter(v => v !== valStr);\n group.onChange(next);\n }\n },\n [onChange, group, value, indeterminate]\n );\n\n const mainClass = usePrefixedClassNames('styled-checkbox', 'checkbox', {\n [`is-${color}`]: color && checkboxColors.includes(color),\n [`is-${size}`]: size && checkboxSizes.includes(size),\n });\n const checkboxClass = classNames(mainClass, bulmaHelperClasses, className);\n const checkClass = usePrefixedClassNames('check');\n const controlLabelClass = usePrefixedClassNames('control-label');\n\n return (\n <label className={checkboxClass}>\n <input\n ref={setRefs}\n type=\"checkbox\"\n disabled={disabled}\n name={effectiveName}\n value={value}\n checked={effectiveChecked}\n defaultChecked={effectiveDefaultChecked}\n onChange={handleChange}\n {...rest}\n />\n <span className={checkClass} />\n {children && <span className={controlLabelClass}>{children}</span>}\n </label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,cAAc,GAAG;IAC5B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;;AAGV;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,Q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AA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC;AACxD,QAAA,CAAC,CAAA,GAAA,EAAM,IAAI,CAAA,CAAE,GAAG,IAAI,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC;AACrD,KAAA,CAAC;IACF,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,EAAE,kBAAkB,EAAE,SAAS,CAAC;AAC1E,IAAA,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,CAAC;AACjD,IAAA,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,eAAe,CAAC;IAEhE,QACEA,IAAA,CAAA,OAAA,EAAA,EAAO,SAAS,EAAE,aAAa,EAAA,QAAA,EAAA,CAC7BC,GAAA,CAAA,OAAA,EAAA,EACE,GAAG,EAAE,OAAO,EACZ,IAAI,EAAC,UAAU,EACf,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,aAAa,EACnB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,cAAc,EAAE,uBAAuB,EACvC,QAAQ,EAAE,YAAY,EAAA,GAClB,IAAI,EAAA,CACR,EACFA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,UAAU,EAAA,CAAI,EAC9B,QAAQ,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,iBAAiB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAQ,CAAA,EAAA,CAC5D;AAEZ,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
1
|
+
{"version":3,"file":"Checkbox.js","sources":["../../../src/form/Checkbox.tsx"],"sourcesContent":["import React, { forwardRef, useCallback, useRef } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\nimport { useClientLayoutEffect } from '../helpers/useClientLayoutEffect';\nimport { useCheckboxesGroup } from './FormContext';\n\n/**\n * The values the Checkbox `color` prop accepts, as a readonly tuple.\n *\n * `CheckboxProps['color']` is typed from it, so the two list the same values.\n * Map over it to build a color picker, or check a value that arrives at\n * runtime before passing it in: the component adds no color class for a value\n * outside the tuple.\n *\n * @example\n * import { Checkbox, checkboxColors } from '@allxsmith/bestax-bulma';\n *\n * checkboxColors.map(color => (\n * <Checkbox key={color} color={color}>\n * {color}\n * </Checkbox>\n * ));\n */\nexport const checkboxColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n] as const;\n\n/**\n * The values the Checkbox `size` prop accepts, as a readonly tuple.\n *\n * `CheckboxProps['size']` is typed from it, so the two list the same values.\n * Use it to offer a size choice or to check a value that arrives at runtime:\n * the component adds no size class for a value outside the tuple. These are\n * element sizes, not the spacing scale in `validSizes`.\n *\n * @example\n * import { checkboxSizes } from '@allxsmith/bestax-bulma';\n *\n * type CheckboxSize = (typeof checkboxSizes)[number];\n */\nexport const checkboxSizes = ['small', 'normal', 'medium', 'large'] as const;\n\n/**\n * Props for the Checkbox component.\n */\nexport interface CheckboxProps\n extends\n Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'type' | 'color'\n >,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor' | 'size'> {\n /** Color of the checkbox. */\n color?: (typeof checkboxColors)[number];\n /** Size of the checkbox. */\n size?: (typeof checkboxSizes)[number];\n /** Text color helper. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Whether the checkbox is disabled. */\n disabled?: boolean;\n /**\n * Shows the mixed state, as in a \"Select all\" box when some of what it\n * covers is checked. It's a look and an announcement only: `checked` is\n * still the value, and a click still toggles `checked`. Set to `true` or\n * `false`, it's controlled: a browser clears the mixed state on a click,\n * so the component sets it again from this prop after every click and\n * every render. Unset isn't `false`. The component leaves the input's own\n * `indeterminate` property alone, so a ref can set it, and going from set\n * to unset clears it once and hands it back. It has no HTML attribute, so\n * server-rendered markup can't carry it, and a mixed box renders unmixed\n * until hydration.\n */\n indeterminate?: boolean;\n /**\n * Additional CSS classes, on the outer `<label>`. That's the element that\n * declares the `--bulma-checkbox-*` variables, so a class is how to set\n * one: `style` and the other input attributes go to the `<input>`. Name\n * `.styled-checkbox` beside your class in the selector, so it beats the\n * label's own declaration whatever order the stylesheets load in. A\n * `color` prop declares the fills again on `.styled-checkbox.is-<color>`,\n * which ties that selector, so leave `color` unset when a class sets them.\n */\n className?: string;\n /** The label/content for the checkbox. */\n children?: React.ReactNode;\n}\n\n/**\n * The `Checkbox` component provides a Bulma-styled checkbox input.\n *\n * @function\n * @param {CheckboxProps} props - Props for the Checkbox component.\n * @returns {JSX.Element} The rendered checkbox element.\n *\n * @example\n * // Basic checkbox\n * <Checkbox>Accept terms</Checkbox>\n *\n * @example\n * // Inside a group\n * <Checkboxes name=\"tags\" defaultValue={['react']}>\n * <Checkbox value=\"react\">React</Checkbox>\n * <Checkbox value=\"vue\">Vue</Checkbox>\n * </Checkboxes>\n */\nexport const Checkbox = forwardRef<HTMLInputElement, CheckboxProps>(\n (\n {\n color,\n size,\n className,\n children,\n textColor,\n disabled,\n name,\n value,\n checked,\n defaultChecked,\n indeterminate,\n onChange,\n ...props\n },\n ref\n ) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n ...props,\n });\n\n // The input's own ref, merged with the forwarded one. A callback ref's\n // return value is handed back, so React 19 still runs a cleanup it\n // returns, as it did when the ref went straight to the input.\n const inputRef = useRef<HTMLInputElement | null>(null);\n const setRefs = useCallback(\n (node: HTMLInputElement | null) => {\n inputRef.current = node;\n if (typeof ref === 'function') return ref(node);\n if (ref) ref.current = node;\n },\n [ref]\n );\n\n // `indeterminate` is a DOM property with no attribute, so it's set on the\n // input rather than rendered. A click clears it, so this runs after every\n // render, not only when the prop changes. Unset, it's left alone, so a\n // ref that sets the property itself still works. `ownsIndeterminateRef`\n // remembers that this component set it, so a prop that goes back to unset\n // clears the dash once instead of leaving it on.\n const ownsIndeterminateRef = useRef(false);\n useClientLayoutEffect(() => {\n if (indeterminate !== undefined) {\n ownsIndeterminateRef.current = true;\n inputRef.current!.indeterminate = indeterminate;\n } else if (ownsIndeterminateRef.current) {\n ownsIndeterminateRef.current = false;\n inputRef.current!.indeterminate = false;\n }\n });\n\n // Inherit name + selection state from a surrounding <Checkboxes> group.\n // Local props always win over the group (explicit > implicit).\n const group = useCheckboxesGroup();\n const effectiveName = name ?? group?.name;\n\n // Group-managed checked state — only when the group is in\n // controlled/uncontrolled mode (group.value is defined) AND this Checkbox\n // has a value to compare against. Local `checked` always wins.\n const groupManaged = group?.value !== undefined && value !== undefined;\n const groupHas = groupManaged && group!.value!.includes(String(value));\n const effectiveChecked =\n checked !== undefined ? checked : groupManaged ? groupHas : undefined;\n // When the group manages checked, suppress local defaultChecked to avoid\n // the controlled/uncontrolled React warning.\n const effectiveDefaultChecked = groupManaged ? undefined : defaultChecked;\n\n const handleChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n // The click that got here cleared the mixed state. Put it back now,\n // since a click that changes no state renders nothing to do it.\n if (indeterminate !== undefined) e.target.indeterminate = indeterminate;\n // Local onChange always fires.\n onChange?.(e);\n // Dispatch to the group additionally — toggle this value's\n // membership in the group's array.\n if (group?.onChange && value !== undefined) {\n const valStr = String(value);\n const currentArr = group.value ?? [];\n const next = e.target.checked\n ? currentArr.includes(valStr)\n ? currentArr\n : [...currentArr, valStr]\n : currentArr.filter(v => v !== valStr);\n group.onChange(next);\n }\n },\n [onChange, group, value, indeterminate]\n );\n\n const mainClass = usePrefixedClassNames('styled-checkbox', 'checkbox', {\n [`is-${color}`]: color && checkboxColors.includes(color),\n [`is-${size}`]: size && checkboxSizes.includes(size),\n });\n const checkboxClass = classNames(mainClass, bulmaHelperClasses, className);\n const checkClass = usePrefixedClassNames('check');\n const controlLabelClass = usePrefixedClassNames('control-label');\n\n return (\n <label className={checkboxClass}>\n <input\n ref={setRefs}\n type=\"checkbox\"\n disabled={disabled}\n name={effectiveName}\n value={value}\n checked={effectiveChecked}\n defaultChecked={effectiveDefaultChecked}\n onChange={handleChange}\n {...rest}\n />\n <span className={checkClass} />\n {children && <span className={controlLabelClass}>{children}</span>}\n </label>\n );\n }\n);\n\nCheckbox.displayName = 'Checkbox';\n\nexport default Checkbox;\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;AAUA;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,cAAc,GAAG;IAC5B,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;;AAGV;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO;AA+ClE;;;;;;;;;;;;;;;;;AAiBG;AACI,MAAM,QAAQ,GAAG,UAAU,CAChC,CACE,EACE,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,OAAO,EACP,cAAc,EACd,aAAa,EACb,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,KACD;AACF,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;;;AAKF,IAAA,MAAM,QAAQ,GAAG,MAAM,CAA0B,IAAI,CAAC;AACtD,IAAA,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,IAA6B,KAAI;AAChC,QAAA,QAAQ,CAAC,OAAO,GAAG,IAAI;QACvB,IAAI,OAAO,GAAG,KAAK,UAAU;AAAE,YAAA,OAAO,GAAG,CAAC,IAAI,CAAC;AAC/C,QAAA,IAAI,GAAG;AAAE,YAAA,GAAG,CAAC,OAAO,GAAG,IAAI;AAC7B,IAAA,CAAC,EACD,CAAC,GAAG,CAAC,CACN;;;;;;;AAQD,IAA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S,EAAE,UAAU,EAAA,CAAI,EAC9B,QAAQ,IAAIA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,iBAAiB,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAQ,CAAA,EAAA,CAC5D;AAEZ,CAAC;AAGH,QAAQ,CAAC,WAAW,GAAG,UAAU;;"}
|
|
@@ -115,7 +115,7 @@ const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'];
|
|
|
115
115
|
* Valid Bulma text alignment classes.
|
|
116
116
|
* @example 'centered', 'left', 'right'
|
|
117
117
|
*/
|
|
118
|
-
const validAlignments
|
|
118
|
+
const validAlignments = [
|
|
119
119
|
'centered',
|
|
120
120
|
'justified',
|
|
121
121
|
'left',
|
|
@@ -411,5 +411,5 @@ const createBulmaClassHelpers = (classPrefix, viewport) => {
|
|
|
411
411
|
return { classes, addPrefixedClass, addClass, addClassNoViewport };
|
|
412
412
|
};
|
|
413
413
|
|
|
414
|
-
export { createBulmaClassHelpers, cursorClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments
|
|
414
|
+
export { createBulmaClassHelpers, cursorClasses, validAlignContents, validAlignItems, validAlignSelfs, validAlignments, validAspectRatios, validAxisOverflows, validColorShades, validColors, validCursors, validDisplays, validFlexDirections, validFlexGrowShrink, validFlexWraps, validFloats, validFontFamilies, validGaps, validInteractions, validJustifyContents, validOverflows, validPositions, validRadii, validResponsives, validSchemeColors, validShadows, validSizes$1 as validSizes, validTextSizes, validTextTransforms, validTextWeights, validViewports, validVisibilities };
|
|
415
415
|
//# sourceMappingURL=bulmaClassHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulmaClassHelpers.js","sources":["../../../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma gap steps, taken by `gap`, `columnGap` and `rowGap`. Each whole\n * step is 0.5rem, so `2` is 1rem and `8` is 4rem, and the half steps sit\n * between them. They render `is-gap-<value>`, `is-column-gap-<value>` and\n * `is-row-gap-<value>`.\n *\n * This is a different scale from `validSizes`: `gap=\"2\"` is 1rem where\n * `m=\"2\"` is 0.5rem.\n * @example '0', '0.5', '2', '8'\n */\nexport const validGaps = [\n '0',\n '0.5',\n '1',\n '1.5',\n '2',\n '2.5',\n '3',\n '3.5',\n '4',\n '4.5',\n '5',\n '5.5',\n '6',\n '6.5',\n '7',\n '7.5',\n '8',\n] as const;\n\n// Spelled out rather than built from `validGaps` so the API docs can print\n// it; a type test in useSpacingClasses.test.tsx holds both halves to the\n// tuple.\n/**\n * A gap step as `gap`, `columnGap` and `rowGap` take it: a value from\n * `validGaps`, or the same step written as a number (`gap={2}`,\n * `gap={1.5}`). `Grid` took its gaps as numbers before the gap helpers were\n * shared, so every gap prop still does.\n */\nexport type BulmaGapStep =\n | '0'\n | '0.5'\n | '1'\n | '1.5'\n | '2'\n | '2.5'\n | '3'\n | '3.5'\n | '4'\n | '4.5'\n | '5'\n | '5.5'\n | '6'\n | '6.5'\n | '7'\n | '7.5'\n | '8'\n | 0\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 4.5\n | 5\n | 5.5\n | 6\n | 6.5\n | 7\n | 7.5\n | 8;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow values for one axis, taken by `overflowX` and\n * `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.\n * @example 'auto', 'hidden', 'scroll'\n */\nexport const validAxisOverflows = [\n 'auto',\n 'clip',\n 'hidden',\n 'scroll',\n 'visible',\n] as const;\n\n/**\n * Valid Bulma overflow values for `overflow`.\n *\n * `clipped` renders `is-clipped`, the helper `overflow` started with. Every\n * other value renders `is-overflow-<value>`.\n * @example 'clipped', 'auto', 'hidden'\n */\nexport const validOverflows = ['clipped', ...validAxisOverflows] as const;\n\n/**\n * Valid Bulma position values, taken by `pos`. Each renders\n * `is-position-<value>`.\n * @example 'relative', 'absolute', 'sticky'\n */\nexport const validPositions = [\n 'absolute',\n 'fixed',\n 'relative',\n 'static',\n 'sticky',\n] as const;\n\n/**\n * Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders\n * `is-aspect-ratio-<value>`.\n * @example '1by1', '4by3', '16by9'\n */\nexport const validAspectRatios = [\n '1by1',\n '5by4',\n '4by3',\n '3by2',\n '5by3',\n '16by9',\n '2by1',\n '3by1',\n '4by5',\n '3by4',\n '2by3',\n '3by5',\n '9by16',\n '1by2',\n '1by3',\n] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper values.\n *\n * `radiusless` renders `is-radiusless` and removes the radius. The sizes\n * render `has-radius-<value>` and set one from Bulma's radius scale.\n * @example 'radiusless', 'small', 'rounded'\n */\nexport const validRadii = [\n 'radiusless',\n 'small',\n 'normal',\n 'large',\n 'rounded',\n] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":["validSizes","validAlignments"],"mappings":";AAAA;;;AAGG;AACI,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,MAAM;;AAGR;;;AAGG;AACI,MAAM,gBAA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IAAA,MAAM,QAAQ,GAAG,CACf,MAAc,EACd,KAAyB,EACzB,WAA8B,EAC9B,gBAAgB,GAAG,KAAK,EACxB,kBAAA,GAAwC,cAAc,KACpD;QACF,IAAI,KAAK,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YACxC,MAAM,SAAS,GACb,gBAAgB;gBAChB,QAAQ;AACR,gBAAA,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC;AACjC,gBAAA,kBAAkB,CAAC,QAAQ,CAAC,QAAQ;AAClC,kBAAE,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAA,EAAI,QAAQ,CAAA;AAChC,kBAAE,CAAA,EAAG,MAAM,CAAA,CAAA,EAAI,KAAK,EAAE;YAC1B,gBAAgB,CAAC,SAAS,CAAC;QAC7B;AACF,IAAA,CAAC;;IAGD,MAAM,kBAAkB,GAAG,CACzB,MAAc,EACd,KAAyB,EACzB,WAA8B,KAC5B;AACF,QAAA,IAAI,KAAK,KAAK,CAAC,WAAW,CAAC,MAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;AACjE,YAAA,gBAAgB,CAAC,CAAA,EAAG,MAAM,IAAI,KAAK,CAAA,CAAE,CAAC;QACxC;AACF,IAAA,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE;AACpE;;"}
|
|
1
|
+
{"version":3,"file":"bulmaClassHelpers.js","sources":["../../../src/helpers/bulmaClassHelpers.ts"],"sourcesContent":["/**\n * Valid Bulma color classes.\n * @example 'primary', 'link', 'info'\n */\nexport const validColors = [\n 'primary',\n 'link',\n 'info',\n 'success',\n 'warning',\n 'danger',\n 'black',\n 'black-bis',\n 'black-ter',\n 'grey-darker',\n 'grey-dark',\n 'grey',\n 'grey-light',\n 'grey-lighter',\n 'white',\n 'white-bis',\n 'white-ter',\n 'light',\n 'dark',\n] as const;\n\n/**\n * Valid Bulma color shade suffixes.\n * @example '00', '05', 'invert', 'light', 'dark', 'soft', 'bold', 'on-scheme'\n */\nexport const validColorShades = [\n '00',\n '05',\n '10',\n '15',\n '20',\n '25',\n '30',\n '35',\n '40',\n '45',\n '50',\n '55',\n '60',\n '65',\n '70',\n '75',\n '80',\n '85',\n '90',\n '95',\n 'invert',\n 'light',\n 'dark',\n 'soft',\n 'bold',\n 'on-scheme',\n] as const;\n\n/**\n * Valid Bulma scheme color names for scheme-aware backgrounds.\n *\n * Bulma ships no `has-background-scheme-*` helper classes, so these values\n * never emit a class — components render them as a dark-mode-safe inline\n * `background-color: var(--bulma-<value>)` style instead.\n * @example 'scheme-main', 'scheme-main-bis', 'scheme-invert'\n */\nexport const validSchemeColors = [\n 'scheme-main',\n 'scheme-main-bis',\n 'scheme-main-ter',\n 'scheme-invert',\n 'scheme-invert-bis',\n 'scheme-invert-ter',\n] as const;\n\n/**\n * Valid Bulma size classes for margins and paddings.\n * @example '0', '1', 'auto'\n */\nexport const validSizes = ['0', '1', '2', '3', '4', '5', '6', 'auto'] as const;\n\n/**\n * Valid Bulma gap steps, taken by `gap`, `columnGap` and `rowGap`. Each whole\n * step is 0.5rem, so `2` is 1rem and `8` is 4rem, and the half steps sit\n * between them. They render `is-gap-<value>`, `is-column-gap-<value>` and\n * `is-row-gap-<value>`.\n *\n * This is a different scale from `validSizes`: `gap=\"2\"` is 1rem where\n * `m=\"2\"` is 0.5rem.\n * @example '0', '0.5', '2', '8'\n */\nexport const validGaps = [\n '0',\n '0.5',\n '1',\n '1.5',\n '2',\n '2.5',\n '3',\n '3.5',\n '4',\n '4.5',\n '5',\n '5.5',\n '6',\n '6.5',\n '7',\n '7.5',\n '8',\n] as const;\n\n// Spelled out rather than built from `validGaps` so the API docs can print\n// it; a type test in useSpacingClasses.test.tsx holds both halves to the\n// tuple.\n/**\n * A gap step as `gap`, `columnGap` and `rowGap` take it: a value from\n * `validGaps`, or the same step written as a number (`gap={2}`,\n * `gap={1.5}`). `Grid` took its gaps as numbers before the gap helpers were\n * shared, so every gap prop still does.\n */\nexport type BulmaGapStep =\n | '0'\n | '0.5'\n | '1'\n | '1.5'\n | '2'\n | '2.5'\n | '3'\n | '3.5'\n | '4'\n | '4.5'\n | '5'\n | '5.5'\n | '6'\n | '6.5'\n | '7'\n | '7.5'\n | '8'\n | 0\n | 0.5\n | 1\n | 1.5\n | 2\n | 2.5\n | 3\n | 3.5\n | 4\n | 4.5\n | 5\n | 5.5\n | 6\n | 6.5\n | 7\n | 7.5\n | 8;\n\n/**\n * Valid Bulma text size classes.\n * @example '1', '2', '3'\n */\nexport const validTextSizes = ['1', '2', '3', '4', '5', '6', '7'] as const;\n\n/**\n * Valid Bulma text alignment classes.\n * @example 'centered', 'left', 'right'\n */\nexport const validAlignments = [\n 'centered',\n 'justified',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma text transformation classes.\n * @example 'capitalized', 'uppercase', 'italic'\n */\nexport const validTextTransforms = [\n 'capitalized',\n 'lowercase',\n 'uppercase',\n 'italic',\n] as const;\n\n/**\n * Valid Bulma text weight classes.\n * @example 'light', 'normal', 'bold'\n */\nexport const validTextWeights = [\n 'light',\n 'normal',\n 'medium',\n 'semibold',\n 'bold',\n] as const;\n\n/**\n * Valid Bulma font family classes.\n * @example 'sans-serif', 'monospace', 'code'\n */\nexport const validFontFamilies = [\n 'sans-serif',\n 'monospace',\n 'primary',\n 'secondary',\n 'code',\n] as const;\n\n/**\n * Valid Bulma display classes.\n * @example 'block', 'flex', 'inline'\n */\nexport const validDisplays = [\n 'block',\n 'flex',\n 'inline',\n 'inline-block',\n 'inline-flex',\n 'grid',\n] as const;\n\n/**\n * Valid Bulma visibility classes.\n * These are all the valid visibility options available in Bulma.\n * @example 'hidden', 'sr-only', 'invisible'\n */\nexport const validVisibilities = ['hidden', 'sr-only', 'invisible'] as const;\n\n/**\n * Valid Bulma flex direction classes.\n * @example 'row', 'column', 'row-reverse'\n */\nexport const validFlexDirections = [\n 'row',\n 'row-reverse',\n 'column',\n 'column-reverse',\n] as const;\n\n/**\n * Valid Bulma flex wrap classes.\n * @example 'nowrap', 'wrap', 'wrap-reverse'\n */\nexport const validFlexWraps = ['nowrap', 'wrap', 'wrap-reverse'] as const;\n\n/**\n * Valid Bulma justify-content classes.\n * @example 'flex-start', 'center', 'space-between'\n */\nexport const validJustifyContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'start',\n 'end',\n 'left',\n 'right',\n] as const;\n\n/**\n * Valid Bulma align-content classes.\n * @example 'flex-start', 'center', 'stretch'\n */\nexport const validAlignContents = [\n 'flex-start',\n 'flex-end',\n 'center',\n 'space-between',\n 'space-around',\n 'space-evenly',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma align-items classes.\n * @example 'stretch', 'flex-start', 'center'\n */\nexport const validAlignItems = [\n 'stretch',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'start',\n 'end',\n] as const;\n\n/**\n * Valid Bulma align-self classes.\n * @example 'auto', 'flex-start', 'center'\n */\nexport const validAlignSelfs = [\n 'auto',\n 'flex-start',\n 'flex-end',\n 'center',\n 'baseline',\n 'stretch',\n] as const;\n\n/**\n * Valid Bulma flex grow and shrink values.\n * @example '0', '1', '2', '3', '4', '5'\n */\nexport const validFlexGrowShrink = ['0', '1', '2', '3', '4', '5'] as const;\n\n/**\n * Valid Bulma viewport classes for responsive design.\n * @example 'mobile', 'tablet', 'desktop'\n */\nexport const validViewports = [\n 'mobile',\n 'tablet',\n 'tablet-only',\n 'touch',\n 'desktop',\n 'desktop-only',\n 'widescreen',\n 'widescreen-only',\n 'fullhd',\n] as const;\n\n/**\n * Valid Bulma float classes.\n * @example 'left', 'right'\n */\nexport const validFloats = ['left', 'right'] as const;\n\n/**\n * Valid Bulma overflow values for one axis, taken by `overflowX` and\n * `overflowY`. Each renders `is-overflow-x-<value>` or `is-overflow-y-<value>`.\n * @example 'auto', 'hidden', 'scroll'\n */\nexport const validAxisOverflows = [\n 'auto',\n 'clip',\n 'hidden',\n 'scroll',\n 'visible',\n] as const;\n\n/**\n * Valid Bulma overflow values for `overflow`.\n *\n * `clipped` renders `is-clipped`, the helper `overflow` started with. Every\n * other value renders `is-overflow-<value>`.\n * @example 'clipped', 'auto', 'hidden'\n */\nexport const validOverflows = ['clipped', ...validAxisOverflows] as const;\n\n/**\n * Valid Bulma position values, taken by `pos`. Each renders\n * `is-position-<value>`.\n * @example 'relative', 'absolute', 'sticky'\n */\nexport const validPositions = [\n 'absolute',\n 'fixed',\n 'relative',\n 'static',\n 'sticky',\n] as const;\n\n/**\n * Valid Bulma aspect ratios, taken by `aspectRatio`. Each renders\n * `is-aspect-ratio-<value>`.\n * @example '1by1', '4by3', '16by9'\n */\nexport const validAspectRatios = [\n '1by1',\n '5by4',\n '4by3',\n '3by2',\n '5by3',\n '16by9',\n '2by1',\n '3by1',\n '4by5',\n '3by4',\n '2by3',\n '3by5',\n '9by16',\n '1by2',\n '1by3',\n] as const;\n\n/**\n * Valid Bulma interaction classes.\n * @example 'unselectable', 'clickable'\n */\nexport const validInteractions = ['unselectable', 'clickable'] as const;\n\n/**\n * Valid Bulma cursor helper values.\n *\n * These share no class stem: `pointer` renders `is-clickable` and `help`\n * renders `is-cursor-help`, so the class each one emits lives in\n * `cursorClasses` rather than being built from the value.\n * @example 'pointer', 'help'\n */\nexport const validCursors = ['pointer', 'help'] as const;\n\n/**\n * Cursor helper value to the class it renders.\n *\n * A `Record` over `validCursors` on purpose: TypeScript then rejects a value\n * added to the tuple with no class for it, and a class for a value the tuple\n * does not carry, so the accepted set and the rendered classes cannot drift\n * apart.\n */\nexport const cursorClasses: Record<(typeof validCursors)[number], string> = {\n pointer: 'is-clickable',\n help: 'is-cursor-help',\n};\n\n/**\n * Valid Bulma border-radius helper values.\n *\n * `radiusless` renders `is-radiusless` and removes the radius. The sizes\n * render `has-radius-<value>` and set one from Bulma's radius scale.\n * @example 'radiusless', 'small', 'rounded'\n */\nexport const validRadii = [\n 'radiusless',\n 'small',\n 'normal',\n 'large',\n 'rounded',\n] as const;\n\n/**\n * Valid Bulma shadow helper classes.\n * @example 'shadowless'\n */\nexport const validShadows = ['shadowless'] as const;\n\n/**\n * Valid Bulma responsive helper classes.\n * @example 'mobile', 'narrow'\n */\nexport const validResponsives = ['mobile', 'narrow'] as const;\n\n/**\n * Props for applying a Bulma viewport modifier to viewport-aware helper classes.\n */\nexport interface BulmaViewportProps {\n /** Viewport for responsive classes (e.g., 'mobile', 'desktop'). */\n viewport?: (typeof validViewports)[number];\n}\n\n/**\n * Props for applying Bulma display helper classes, including viewport-specific\n * display variants.\n */\nexport interface BulmaDisplayProps {\n /** Display type (e.g., 'block', 'flex'). */\n display?: (typeof validDisplays)[number] | 'none';\n /** Display type for mobile viewport (up to 768px). */\n displayMobile?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet viewport (769px - 1023px). */\n displayTablet?: (typeof validDisplays)[number] | 'none';\n /** Display type for tablet-only viewport (769px - 1023px, excludes desktop+). */\n displayTabletOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for touch viewport (up to 1023px; mobile + tablet). */\n displayTouch?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop viewport (1024px - 1215px). */\n displayDesktop?: (typeof validDisplays)[number] | 'none';\n /** Display type for desktop-only viewport (1024px - 1215px, excludes widescreen+). */\n displayDesktopOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen viewport (1216px - 1407px). */\n displayWidescreen?: (typeof validDisplays)[number] | 'none';\n /** Display type for widescreen-only viewport (1216px - 1407px, excludes fullhd). */\n displayWidescreenOnly?: (typeof validDisplays)[number] | 'none';\n /** Display type for fullhd viewport (1408px and above). */\n displayFullhd?: (typeof validDisplays)[number] | 'none';\n}\n\n/**\n * Creates the shared class-building helpers used by the Bulma helper hooks.\n *\n * Returns a mutable `classes` array along with the helper functions that push\n * (optionally prefixed, optionally viewport-suffixed) class names onto it.\n *\n * @internal\n * @param classPrefix - Optional prefix applied to all generated class names.\n * @param viewport - Optional viewport modifier for viewport-aware classes.\n */\nexport const createBulmaClassHelpers = (\n classPrefix?: string,\n viewport?: (typeof validViewports)[number]\n) => {\n const classes: string[] = [];\n\n // Helper function to add class with prefix support\n const addPrefixedClass = (className: string) => {\n classes.push(classPrefix ? `${classPrefix}${className}` : className);\n };\n\n // Helper to add class with optional viewport\n //\n // `supportedViewports` narrows which viewports may be suffixed onto this\n // class. It defaults to every viewport, but a few Bulma helper families\n // (notably `is-size-*`, which ships no `-only` bands) support only a subset,\n // so passing the emitting set keeps us from producing dead classes.\n const addClass = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[],\n supportsViewport = false,\n supportedViewports: readonly string[] = validViewports\n ) => {\n if (value && validValues.includes(value)) {\n const className =\n supportsViewport &&\n viewport &&\n validViewports.includes(viewport) &&\n supportedViewports.includes(viewport)\n ? `${prefix}-${value}-${viewport}`\n : `${prefix}-${value}`;\n addPrefixedClass(className);\n }\n };\n\n // Helper specifically for classes that never support viewport modifiers\n const addClassNoViewport = (\n prefix: string,\n value: string | undefined,\n validValues: readonly string[]\n ) => {\n if (value && (!validValues.length || validValues.includes(value))) {\n addPrefixedClass(`${prefix}-${value}`);\n }\n };\n\n return { classes, addPrefixedClass, addClass, addClassNoViewport };\n};\n"],"names":["validSizes"],"mappings":";AAAA;;;AAGG;AACI,MAAM,WAAW,GAAG;IACzB,SAAS;IACT,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,QAAQ;IACR,OAAO;IACP,WAAW;IACX,WAAW;IACX,aAAa;IACb,WAAW;IACX,MAAM;IACN,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,WAAW;IACX,OAAO;IACP,MAAM;;AAGR;;;AAGG;AACI,MAAM,gBAAgB,GAAG;IAC9B,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;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