@allxsmith/bestax-bulma 5.60.0 → 5.62.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 +3 -43
- package/dist/esm/components/Carousel.js.map +1 -1
- package/dist/esm/components/Command.js +3 -3
- package/dist/esm/components/Navbar.js +3 -1
- package/dist/esm/components/Navbar.js.map +1 -1
- package/dist/esm/components/Popover.js +7 -27
- package/dist/esm/components/Popover.js.map +1 -1
- package/dist/esm/components/Sidebar.js +17 -58
- package/dist/esm/components/Sidebar.js.map +1 -1
- package/dist/esm/components/TreeView.js +14 -10
- package/dist/esm/components/TreeView.js.map +1 -1
- package/dist/esm/form/ColorPicker.js +4 -4
- package/dist/esm/form/ColorPicker.js.map +1 -1
- package/dist/esm/form/Combobox.js +11 -16
- package/dist/esm/form/Combobox.js.map +1 -1
- package/dist/esm/form/Field.js.map +1 -1
- package/dist/esm/form/TreeSelect.js +395 -0
- package/dist/esm/form/TreeSelect.js.map +1 -0
- package/dist/esm/form/_pickerInternals/PickerPopover.js +5 -1
- package/dist/esm/form/_pickerInternals/PickerPopover.js.map +1 -1
- package/dist/esm/form/_selectInternals/DialogSelect.js +208 -0
- package/dist/esm/form/_selectInternals/DialogSelect.js.map +1 -0
- package/dist/esm/form/_selectInternals/ValueTags.js +28 -0
- package/dist/esm/form/_selectInternals/ValueTags.js.map +1 -0
- package/dist/esm/helpers/overlayStack.js +33 -1
- package/dist/esm/helpers/overlayStack.js.map +1 -1
- package/dist/esm/helpers/treeData.js +97 -0
- package/dist/esm/helpers/treeData.js.map +1 -0
- package/dist/esm/helpers/useBulmaViewport.js +82 -0
- package/dist/esm/helpers/useBulmaViewport.js.map +1 -0
- package/dist/esm/helpers/useComboboxEngine.js +2 -2
- package/dist/esm/helpers/useComboboxEngine.js.map +1 -1
- package/dist/esm/helpers/useControlled.js +30 -0
- package/dist/esm/helpers/useControlled.js.map +1 -0
- package/dist/esm/helpers/useInertSiblings.js +7 -3
- package/dist/esm/helpers/useInertSiblings.js.map +1 -1
- package/dist/esm/helpers/useOutsidePress.js +53 -0
- package/dist/esm/helpers/useOutsidePress.js.map +1 -0
- package/dist/esm/helpers/useOverlayFocus.js +74 -0
- package/dist/esm/helpers/useOverlayFocus.js.map +1 -0
- package/dist/esm/helpers/useTreeView.js +15 -13
- package/dist/esm/helpers/useTreeView.js.map +1 -1
- package/dist/esm/layout/AppFrame.js +438 -0
- package/dist/esm/layout/AppFrame.js.map +1 -0
- package/dist/extras.css +1 -1
- package/dist/extras.css.map +1 -1
- package/dist/index.cjs +1767 -518
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -1
- package/dist/types/components/Navbar.d.ts +4 -3
- package/dist/types/form/Field.d.ts +1 -1
- package/dist/types/form/TreeSelect.d.ts +308 -0
- package/dist/types/form/_pickerInternals/PickerPopover.d.ts +8 -0
- package/dist/types/form/_selectInternals/DialogSelect.d.ts +86 -0
- package/dist/types/form/_selectInternals/ValueTags.d.ts +40 -0
- package/dist/types/helpers/overlayStack.d.ts +17 -0
- package/dist/types/helpers/treeData.d.ts +48 -0
- package/dist/types/helpers/useBulmaViewport.d.ts +34 -0
- package/dist/types/helpers/useControlled.d.ts +14 -0
- package/dist/types/helpers/useInertSiblings.d.ts +4 -1
- package/dist/types/helpers/useOutsidePress.d.ts +24 -0
- package/dist/types/helpers/useOverlayFocus.d.ts +44 -0
- package/dist/types/helpers/useTreeView.d.ts +30 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/layout/AppFrame.d.ts +306 -0
- package/dist/types-cjs/components/Navbar.d.ts +4 -3
- package/dist/types-cjs/form/Field.d.ts +1 -1
- package/dist/types-cjs/form/TreeSelect.d.ts +308 -0
- package/dist/types-cjs/form/_pickerInternals/PickerPopover.d.ts +8 -0
- package/dist/types-cjs/form/_selectInternals/DialogSelect.d.ts +86 -0
- package/dist/types-cjs/form/_selectInternals/ValueTags.d.ts +40 -0
- package/dist/types-cjs/helpers/overlayStack.d.ts +17 -0
- package/dist/types-cjs/helpers/treeData.d.ts +48 -0
- package/dist/types-cjs/helpers/useBulmaViewport.d.ts +34 -0
- package/dist/types-cjs/helpers/useControlled.d.ts +14 -0
- package/dist/types-cjs/helpers/useInertSiblings.d.ts +4 -1
- package/dist/types-cjs/helpers/useOutsidePress.d.ts +24 -0
- package/dist/types-cjs/helpers/useOverlayFocus.d.ts +44 -0
- package/dist/types-cjs/helpers/useTreeView.d.ts +30 -0
- package/dist/types-cjs/index.d.ts +2 -0
- package/dist/types-cjs/layout/AppFrame.d.ts +306 -0
- 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/form/_index.scss +1 -0
- package/src/scss/form/_picker-popover.scss +6 -0
- package/src/scss/form/_treeselect.scss +146 -0
- package/src/scss/layout/_appframe.scss +306 -0
- package/src/scss/layout/_index.scss +1 -0
|
@@ -8,6 +8,7 @@ import { useClassPrefix } from '../helpers/Config.js';
|
|
|
8
8
|
import { getActiveElementInTree } from '../helpers/shadowDom.js';
|
|
9
9
|
import { useLatestRef } from '../helpers/useLatestRef.js';
|
|
10
10
|
import { useClientLayoutEffect } from '../helpers/useClientLayoutEffect.js';
|
|
11
|
+
import { useBulmaViewport, MOBILE } from '../helpers/useBulmaViewport.js';
|
|
11
12
|
import { inertProps } from '../helpers/inertProps.js';
|
|
12
13
|
import { Icon } from '../elements/Icon.js';
|
|
13
14
|
import { Button } from '../elements/Button.js';
|
|
@@ -39,24 +40,10 @@ const DefaultPrevIcon = () => (jsx("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
|
39
40
|
* @returns {JSX.Element} The rendered SVG chevron-right icon.
|
|
40
41
|
*/
|
|
41
42
|
const DefaultNextIcon = () => (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: jsx("polyline", { points: "9 18 15 12 9 6" }) }));
|
|
42
|
-
/**
|
|
43
|
-
* The media queries Bulma's `fullhd`, `widescreen`, `desktop` and `tablet`
|
|
44
|
-
* mixins open with, widest first, at Bulma's default breakpoints. The
|
|
45
|
-
* stylesheet picks the count in view with those mixins; these tell the
|
|
46
|
-
* script which count that is. Narrower than the last one is `mobile`.
|
|
47
|
-
*/
|
|
48
|
-
const VIEWPORT_QUERIES = [
|
|
49
|
-
'screen and (min-width: 1408px)',
|
|
50
|
-
'screen and (min-width: 1216px)',
|
|
51
|
-
'screen and (min-width: 1024px)',
|
|
52
|
-
'screen and (min-width: 769px), print',
|
|
53
|
-
];
|
|
54
|
-
/** `useBulmaViewport`'s answer below the tablet breakpoint. */
|
|
55
|
-
const MOBILE = VIEWPORT_QUERIES.length;
|
|
56
43
|
/**
|
|
57
44
|
* The `--bulma-carousel-items-to-show*` variable each count prop writes, in
|
|
58
|
-
* the order the component lists them:
|
|
59
|
-
* last `itemsToShow` itself.
|
|
45
|
+
* the order the component lists them: `useBulmaViewport`'s viewports, widest
|
|
46
|
+
* first, then mobile, and last `itemsToShow` itself.
|
|
60
47
|
*/
|
|
61
48
|
const COUNT_SUFFIXES = [
|
|
62
49
|
'-fullhd',
|
|
@@ -66,33 +53,6 @@ const COUNT_SUFFIXES = [
|
|
|
66
53
|
'-mobile',
|
|
67
54
|
'',
|
|
68
55
|
];
|
|
69
|
-
/**
|
|
70
|
-
* Which of Bulma's viewports the window is in: the index of the widest
|
|
71
|
-
* `VIEWPORT_QUERIES` entry that matches, `MOBILE` below them all, or `-1`
|
|
72
|
-
* when that isn't known (on the server, before the first layout effect, and
|
|
73
|
-
* whenever `enabled` is off, so a carousel with one count everywhere
|
|
74
|
-
* subscribes to nothing).
|
|
75
|
-
*
|
|
76
|
-
* @function
|
|
77
|
-
* @param {boolean} enabled - Whether any viewport-specific count is set.
|
|
78
|
-
* @returns {number} The viewport, as described above.
|
|
79
|
-
*/
|
|
80
|
-
function useBulmaViewport(enabled) {
|
|
81
|
-
const [viewport, setViewport] = useState(-1);
|
|
82
|
-
useClientLayoutEffect(() => {
|
|
83
|
-
if (!enabled || typeof window.matchMedia !== 'function')
|
|
84
|
-
return undefined;
|
|
85
|
-
const lists = VIEWPORT_QUERIES.map(query => window.matchMedia(query));
|
|
86
|
-
const update = () => {
|
|
87
|
-
const index = lists.findIndex(list => list.matches);
|
|
88
|
-
setViewport(index < 0 ? MOBILE : index);
|
|
89
|
-
};
|
|
90
|
-
update();
|
|
91
|
-
lists.forEach(list => list.addEventListener('change', update));
|
|
92
|
-
return () => lists.forEach(list => list.removeEventListener('change', update));
|
|
93
|
-
}, [enabled]);
|
|
94
|
-
return enabled ? viewport : -1;
|
|
95
|
-
}
|
|
96
56
|
/**
|
|
97
57
|
* A count prop as the whole number the carousel works with: rounded down,
|
|
98
58
|
* and never below 1, so a zero or a stray `NaN` can't divide by nothing.
|
|
@@ -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 /**\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,EA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AAA,CAAC,eAAe,KAAG,CACpB,EAAA,CACM,CAAA,EAAA,CACR,CACJ,IACG,EAEL,SAAS,IAAI,OAAO,KACnBA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,sBAAsB,EAAE,IAAI,EAAC,SAAS,YACnD,SAAS,CAAC,GAAG,CAAC,CAAC,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 { MOBILE, useBulmaViewport } from '../helpers/useBulmaViewport';\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 `--bulma-carousel-items-to-show*` variable each count prop writes, in\n * the order the component lists them: `useBulmaViewport`'s viewports, widest\n * first, then mobile, and last `itemsToShow` itself.\n */\nconst COUNT_SUFFIXES = [\n '-fullhd',\n '-widescreen',\n '-desktop',\n '-tablet',\n '-mobile',\n '',\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":";;;;;;;;;;;;;;;AA2CA;;;;;;;AAOG;MACU,YAAY,GAAG,UAAU,CACpC,CAAC,EAAE,MAAM,EAAE,S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useCommand = () => useContext(CommandContext) ?? standalone$2;
|
|
65
65
|
/** Hands a node to a forwarded ref and to one of the component's own. */
|
|
66
|
-
function setRefs$
|
|
66
|
+
function setRefs$3(node, own, forwarded) {
|
|
67
67
|
own.current = node;
|
|
68
68
|
if (typeof forwarded === 'function')
|
|
69
69
|
forwarded(node);
|
|
@@ -180,7 +180,7 @@ const CommandParts = forwardRef(({ children, label, query: controlledQuery, defa
|
|
|
180
180
|
registerHandler,
|
|
181
181
|
};
|
|
182
182
|
const { rootRef } = engine;
|
|
183
|
-
const rootRefs = useCallback((node) => setRefs$
|
|
183
|
+
const rootRefs = useCallback((node) => setRefs$3(node, rootRef, ref), [rootRef, ref]);
|
|
184
184
|
return (jsxs("div", { className: classNames(rootClass, bulmaHelperClasses, className), ...rest, ref: rootRefs, children: [jsx(CommandContext.Provider, { value: context, children: children }), jsx(StatusRegion, { items: announced, describe: describeEmpty })] }));
|
|
185
185
|
});
|
|
186
186
|
CommandParts.displayName = 'CommandParts';
|
|
@@ -200,7 +200,7 @@ const CommandInput = forwardRef(({ isLoading, iconLeft, iconLeftName, onKeyDown,
|
|
|
200
200
|
return () => reportLoading(false);
|
|
201
201
|
}, [reportLoading, isLoading]);
|
|
202
202
|
const { inputRef } = engine;
|
|
203
|
-
const inputRefs = useCallback((node) => setRefs$
|
|
203
|
+
const inputRefs = useCallback((node) => setRefs$3(node, inputRef, ref), [inputRef, ref]);
|
|
204
204
|
const { expanded, highlighted } = engine;
|
|
205
205
|
// A name the caller gave the field wins over the Command's `label`.
|
|
206
206
|
const callerNamed = !!props['aria-label'] || 'aria-labelledby' in props;
|
|
@@ -83,7 +83,9 @@ const NavbarBurger = forwardRef(function NavbarBurger({ className, active, textC
|
|
|
83
83
|
});
|
|
84
84
|
return (jsxs("button", { ref: ref, className: classNames(usePrefixedClassNames('navbar-burger', {
|
|
85
85
|
'is-active': active,
|
|
86
|
-
}), bulmaHelperClasses, className), ...rest, "aria-label": rest['aria-label'] || 'menu', "aria-expanded": rest['aria-expanded']
|
|
86
|
+
}), bulmaHelperClasses, className), ...rest, "aria-label": rest['aria-label'] || 'menu', "aria-expanded": rest['aria-expanded'] === null
|
|
87
|
+
? undefined
|
|
88
|
+
: (rest['aria-expanded'] ?? !!active), type: buttonType(rest.type), children: [jsx("span", { "aria-hidden": "true" }), jsx("span", { "aria-hidden": "true" }), jsx("span", { "aria-hidden": "true" }), jsx("span", { "aria-hidden": "true" }), children] }));
|
|
87
89
|
});
|
|
88
90
|
NavbarBurger.displayName = 'NavbarBurger';
|
|
89
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Navbar.js","sources":["../../../src/components/Navbar.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useEffect, useState } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\nimport { buttonType } from '../helpers/buttonType';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Shared state a `Navbar.Dropdown` exposes to its `Navbar.Link` trigger so the\n * trigger needs no hand-wired ARIA or keyboard handling.\n */\ninterface NavbarDropdownContextValue {\n /** Whether the dropdown is currently open. */\n active: boolean;\n /** Flips the open state. */\n toggle: () => void;\n /** Closes the dropdown (no-op if already closed). */\n close: () => void;\n}\n\nconst NavbarDropdownContext =\n React.createContext<NavbarDropdownContextValue | null>(null);\n\n/**\n * Props for the Navbar component.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the root `<nav>` element.\n */\nexport interface NavbarProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes for the navbar. */\n className?: string;\n /** Text color for the navbar. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Bulma color modifier for the navbar. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'black'\n | 'dark'\n | 'light'\n | 'white';\n /** Background color for the navbar. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Renders the navbar with a transparent background. */\n transparent?: boolean;\n /**\n * Renders Bulma's `is-spaced`: padding around the navbar, rounded items\n * and boxed dropdowns. Bulma applies it from the desktop breakpoint up, so\n * below that the navbar looks the same either way. With `fixed=\"top\"`, put\n * `has-spaced-navbar-fixed-top` on `<html>` beside `has-navbar-fixed-top`\n * (the `-bottom` pair for `fixed=\"bottom\"`). From desktop up the spaced\n * navbar is taller than `has-navbar-fixed-top` pads the page for, and\n * there the spaced class pads it for the taller navbar.\n */\n isSpaced?: boolean;\n /**\n * Renders Bulma's `has-shadow`: a shadow below the navbar, or above it with\n * `fixed=\"bottom\"`. Off unless set, since Bulma's navbar has no shadow of\n * its own. `Box` and `Card` take a `hasShadow` that defaults to `true`\n * instead, because Bulma gives those a shadow already.\n */\n hasShadow?: boolean;\n /** Fixes the navbar to the top or bottom of the viewport. */\n fixed?: 'top' | 'bottom';\n /** Navbar content (compose with subcomponents). */\n children?: React.ReactNode;\n}\n\n/**\n * The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.\n *\n * @function\n * @param {NavbarProps} props - Props for the Navbar component.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the root `<nav>` element.\n * @returns {JSX.Element} The rendered navbar.\n * @see {@link https://bulma.io/documentation/components/navbar/ | Bulma Navbar documentation}\n */\nconst NavbarComponent = forwardRef<HTMLElement, NavbarProps>(\n function NavbarComponent(\n {\n className,\n textColor,\n bgColor,\n color,\n transparent,\n isSpaced,\n hasShadow,\n fixed,\n children,\n ...props\n },\n ref\n ) {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Generate Bulma classes with prefix\n const bulmaClasses = usePrefixedClassNames('navbar', {\n [`is-${color}`]: color,\n 'is-transparent': transparent,\n 'is-spaced': isSpaced,\n 'has-shadow': hasShadow,\n [`is-fixed-${fixed}`]: fixed,\n });\n\n const navbarClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <nav\n ref={ref}\n className={navbarClasses}\n role=\"navigation\"\n aria-label=\"main navigation\"\n {...rest}\n >\n {children}\n </nav>\n );\n }\n);\n\n/**\n * Props for the NavbarBrand component.\n */\nexport interface NavbarBrandProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the brand. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-brand.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Brand content. */\n children?: React.ReactNode;\n}\n\n/**\n * For logo and branding (left side)\n *\n * @function\n * @param {NavbarBrandProps} props - Props for the NavbarBrand component.\n * @returns {JSX.Element} The rendered brand area.\n */\nexport const NavbarBrand: React.FC<NavbarBrandProps> = ({\n className,\n children,\n textColor,\n color,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-brand'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * The NavbarItem component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface NavbarItemOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` here would be the deprecated presentational HTML\n * attribute, and `useBulmaClasses` consumes any `color` key as a Bulma helper\n * before the target could see it — so it is declared unavailable rather than\n * silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes. */\n className?: string;\n /** Whether the item is active. */\n active?: boolean;\n /** Text color for the item. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color for the item. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Navbar item content. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the NavbarItem component. The DOM attributes and the `ref` both\n * follow `as`: rendering as a router link accepts that component's props (`to`\n * and friends) by inference, and `as=\"span\"` rejects `href`.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type NavbarItemProps<T extends React.ElementType = 'a'> =\n NavbarItemOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarItemOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'span'`, `'div'`, `'button'`) or a custom component (e.g. a router link). Defaults to `'a'`.\n *\n * `'button'` renders `type=\"button\"`, so an item inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `NavbarItemProps<T>` above — the body cannot see through `T`.\n */\ntype NavbarItemImplProps = NavbarItemOwnProps & {\n as?: React.ElementType;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * Navigation links, buttons, or custom content\n *\n * @function\n * @param {NavbarItemProps} props - Props for the NavbarItem component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered item.\n */\nexport const NavbarItem = forwardRef(function NavbarItem(\n itemProps: NavbarItemProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n as: Component = 'a',\n active,\n textColor,\n bgColor,\n children,\n ...props\n } = itemProps as NavbarItemImplProps;\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n return (\n <Component\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-item', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n // A `<button>` defaults to type=\"submit\", and a navbar inside a form must\n // not submit it. After the spread, reading through it, so a spread\n // carrying `type: undefined` cannot erase the default. A caller's\n // `submit` or `reset` still wins; `buttonType` says more.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<NavbarItemOwnProps, 'a'>;\n\nNavbarItem.displayName = 'NavbarItem';\n\n/**\n * Props for the NavbarBurger component.\n * @extraProp {React.Ref<HTMLButtonElement>} [ref] - Ref forwarded to the burger button element.\n * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a burger inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.\n */\nexport interface NavbarBurgerProps\n extends\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the burger. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-burger.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Whether the burger is active. */\n active?: boolean;\n /**\n * Custom content inside the burger, rendered after its four bar spans.\n * Bulma styles every `<span>` in the burger as a bar, so an extra span here\n * draws an extra bar.\n */\n children?: React.ReactNode;\n /**\n * Accessible name. Pass your own to replace it. An empty one, or a spread\n * carrying `'aria-label': undefined`, keeps the default rather than leaving\n * the button unnamed.\n * @defaultValue 'menu'\n */\n 'aria-label'?: string;\n /**\n * Expanded state for assistive technology. It follows `active` unless you\n * pass `true` or `false`; a spread carrying `'aria-expanded': undefined`\n * still follows `active`.\n * @defaultValue active\n */\n 'aria-expanded'?: boolean;\n /** Click handler. */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\n/**\n * Responsive menu toggle (mobile)\n *\n * @function\n * @param {NavbarBurgerProps} props - Props for the NavbarBurger component.\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref to the burger button element.\n * @returns {JSX.Element} The rendered burger.\n */\nexport const NavbarBurger = forwardRef<HTMLButtonElement, NavbarBurgerProps>(\n function NavbarBurger(\n { className, active, textColor, color, children, ...props },\n ref\n ) {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <button\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-burger', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n // After the spread, reading through it: a key the spread carries with\n // no value would otherwise erase the default, leaving a nameless\n // button that submits the form around it. An empty label falls back\n // too: the button is drawn as an icon, so `''` would leave it unnamed.\n // A caller's own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || 'menu'}\n aria-expanded={rest['aria-expanded'] ?? !!active}\n type={buttonType(rest.type)}\n >\n {/* Bulma v1's burger mixin positions four spans: the first two meet\n in the middle (they rotate into the X), the third and fourth draw\n the top and bottom bars. */}\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n {children}\n </button>\n );\n }\n);\n\nNavbarBurger.displayName = 'NavbarBurger';\n\n/**\n * Props for the NavbarMenu component.\n */\nexport interface NavbarMenuProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the menu. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-menu.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Whether the menu is active. */\n active?: boolean;\n /** Menu content. */\n children?: React.ReactNode;\n}\n\n/**\n * Collapsible content (contains `Navbar.Start` and `Navbar.End`)\n *\n * @function\n * @param {NavbarMenuProps} props - Props for the NavbarMenu component.\n * @returns {JSX.Element} The rendered menu.\n */\nexport const NavbarMenu: React.FC<NavbarMenuProps> = ({\n className,\n active,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-menu', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Props for the NavbarStartEnd component.\n */\nexport interface NavbarStartEndProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `is-<color>` rule for this area, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Content. */\n children?: React.ReactNode;\n}\n\n/**\n * Left-aligned menu area\n *\n * @function\n * @param {NavbarStartEndProps} props - Props for the NavbarStart component.\n * @returns {JSX.Element} The rendered start area.\n */\nexport const NavbarStart: React.FC<NavbarStartEndProps> = ({\n className,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-start'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Right-aligned menu area\n *\n * @function\n * @param {NavbarStartEndProps} props - Props for the NavbarEnd component.\n * @returns {JSX.Element} The rendered end area.\n */\nexport const NavbarEnd: React.FC<NavbarStartEndProps> = ({\n className,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-end'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * The NavbarLink component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface NavbarLinkOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` here would be the deprecated presentational HTML\n * attribute, and `useBulmaClasses` consumes any `color` key as a Bulma helper\n * before the target could see it — so it is declared unavailable rather than\n * silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes. */\n className?: string;\n /** Remove the dropdown arrow indicator. */\n arrowless?: boolean;\n /** Text color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Link content. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the NavbarLink component. The DOM attributes and the `ref` both\n * follow `as`: `as=\"button\"` accepts the button attributes and a button ref,\n * and `as=\"span\"` rejects `href` and `target`. Not `rel` — React declares it on\n * `HTMLAttributes<T>`, so it is valid on every element, and rejecting it would\n * mean diverging from React's own typing.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type NavbarLinkProps<T extends React.ElementType = 'a'> =\n NavbarLinkOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.\n *\n * Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom\n * component is taken to be interactive already — a router link, typically — so it\n * keeps its own role and click behaviour. An intrinsic tag is judged on what it is:\n * `'button'`, or anything carrying an `href`, is left alone, and everything else\n * (`'span'`, a bare `'a'`, a custom element) gets `role=\"button\"`, `tabIndex` and a\n * click that opens the dropdown.\n *\n * If your custom component renders something non-interactive, pass `role=\"button\"` and\n * it takes that fallback too — `tabIndex` and click included. The keyboard path is\n * attached either way.\n *\n * `'button'` renders `type=\"button\"`, so a link inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `NavbarLinkProps<T>` above — the body cannot see through `T`, so it names the\n * handful of DOM props it actually reads back off `rest`.\n */\ntype NavbarLinkImplProps = NavbarLinkOwnProps & {\n as?: React.ElementType;\n href?: string;\n role?: React.AriaRole;\n onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement>;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * Dropdown trigger with arrow indicator (use as first child of `Navbar.Dropdown`)\n *\n * @function\n * @param {NavbarLinkProps} props - Props for the NavbarLink component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered navbar link.\n */\nexport const NavbarLink = forwardRef(function NavbarLink(\n linkProps: NavbarLinkProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n as: Component = 'a',\n arrowless,\n textColor,\n bgColor,\n children,\n ...props\n } = linkProps as NavbarLinkImplProps;\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n const dropdownContext = useContext(NavbarDropdownContext);\n const hasHref = rest.href !== undefined;\n // What a custom component renders cannot be read off its input props, and the\n // prop that ends in an anchor belongs to the router, not to us — `to`, `state`,\n // `params` and a dozen further spellings all get there. Sniffing for more names\n // trades one wrong guess for another, so a non-string `as` counts as\n // interactive: announcing a real anchor as a button, and layering a synthetic\n // click over its navigation, is the worse of the two failures (#668).\n //\n // A custom ELEMENT stays out of it. A hyphenated tag is a real DOM element and\n // none of those is natively interactive, so `<x-trigger>` keeps the fallback\n // exactly like `as=\"span\"` — the same line `Avatar` draws for `role=\"img\"`.\n //\n // Where we are guessing, the caller settles it: a custom target that declares\n // `role=\"button\"` is saying it is a button and not a link, so it takes the\n // whole fallback — including the click, which is the half it could not supply\n // itself. `Avatar` gives the same escape hatch to the same guess. An `href`\n // still wins: a target with somewhere to navigate is a link whatever role it\n // claims.\n const customTargetIsButton =\n typeof Component !== 'string' && rest.role === 'button';\n\n const isNativeInteractive =\n Component === 'button' ||\n (typeof Component !== 'string' && !customTargetIsButton) ||\n hasHref;\n\n // Guarded like Button's disabled blocker: these run on whatever `as` renders,\n // and a custom target's callback need not take a DOM event. One declaring\n // `onKeyDown: (k: {key: string}) => void` reaches `e.preventDefault()` and\n // throws. Composing the caller's handler is unconditional; acting on the\n // event is not ours to do when the payload is foreign.\n const isDomEvent = (e: unknown): e is { preventDefault: () => void } =>\n typeof (e as { preventDefault?: unknown })?.preventDefault === 'function';\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n rest.onKeyDown?.(e);\n if (!isDomEvent(e)) return;\n if (!dropdownContext || e.defaultPrevented) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n dropdownContext.toggle();\n } else if (e.key === 'Escape' && dropdownContext.active) {\n e.preventDefault();\n dropdownContext.close();\n }\n };\n\n // When the link is not natively interactive (no `href`, not a `<button>`) it\n // renders as `role=\"button\"`, so a mouse/touch click has no default action to\n // open the dropdown. Compose the caller's handler and toggle the dropdown\n // unless the caller prevented the default. Native links/buttons keep their own\n // click semantics (navigation / the caller's handler).\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n rest.onClick?.(e);\n if (!isDomEvent(e)) return;\n if (!dropdownContext || isNativeInteractive || e.defaultPrevented) return;\n dropdownContext.toggle();\n };\n\n return (\n <Component\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-link', {\n 'is-arrowless': arrowless,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n {...(dropdownContext && {\n 'aria-haspopup': 'true',\n 'aria-expanded': dropdownContext.active,\n onKeyDown: handleKeyDown,\n ...(!isNativeInteractive && {\n role: 'button',\n tabIndex: 0,\n onClick: handleClick,\n }),\n })}\n // The same button type default as `Navbar.Item`, for the same reason.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<NavbarLinkOwnProps, 'a'>;\n\nNavbarLink.displayName = 'NavbarLink';\n\n/**\n * Props for the NavbarDropdown component.\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the dropdown container element.\n */\nexport interface NavbarDropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Additional CSS classes. */\n className?: string;\n /** Dropdown aligned right. */\n right?: boolean;\n /** Dropdown opens upwards. */\n up?: boolean;\n /** Dropdown opens on hover. */\n hoverable?: boolean;\n /** Dropdown is open. */\n active?: boolean;\n /** Callback when dropdown active state changes. */\n onActiveChange?: (active: boolean) => void;\n /** Dropdown content. */\n children?: React.ReactNode;\n}\n\n/**\n * Dropdown parent (with options for hover, up, right, active)\n *\n * @function\n * @param {NavbarDropdownProps} props - Props for the NavbarDropdown component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the dropdown container element.\n * @returns {JSX.Element} The rendered dropdown.\n */\nexport const NavbarDropdown = forwardRef<HTMLDivElement, NavbarDropdownProps>(\n function NavbarDropdown(\n {\n className,\n right,\n up,\n hoverable,\n active: activeProp,\n onActiveChange,\n children,\n ...props\n },\n ref\n ) {\n const [active, setActive] = useState<boolean>(!!activeProp);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- syncing to controlled prop\n if (typeof activeProp === 'boolean') setActive(activeProp);\n }, [activeProp]);\n\n // Keep `onActiveChange` out of the state updater (a pure function) so Strict\n // Mode's double-invoked updaters don't double-fire it — mirrors `Dropdown`.\n const toggle = () => {\n const next = !active;\n setActive(next);\n onActiveChange?.(next);\n };\n\n const close = () => {\n /* istanbul ignore next: close() is only invoked once already active */\n if (!active) return;\n setActive(false);\n onActiveChange?.(false);\n };\n\n return (\n <NavbarDropdownContext.Provider value={{ active, toggle, close }}>\n <div\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-item', 'has-dropdown', {\n 'has-dropdown-up': up,\n 'is-right': right,\n 'is-hoverable': hoverable,\n 'is-active': active,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n </NavbarDropdownContext.Provider>\n );\n }\n);\n\nNavbarDropdown.displayName = 'NavbarDropdown';\n\n/**\n * Props for the NavbarDropdownMenu component.\n */\nexport interface NavbarDropdownMenuProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Additional CSS classes. */\n className?: string;\n /** Dropdown aligned right. */\n right?: boolean;\n /** Dropdown opens upwards. */\n up?: boolean;\n /** Dropdown menu content. */\n children?: React.ReactNode;\n}\n\n/**\n * Dropdown menu container\n *\n * @function\n * @param {NavbarDropdownMenuProps} props - Props for the NavbarDropdownMenu component.\n * @returns {JSX.Element} The rendered dropdown menu.\n */\nexport const NavbarDropdownMenu: React.FC<NavbarDropdownMenuProps> = ({\n className,\n right,\n up,\n children,\n ...props\n}) => (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-dropdown', {\n 'is-right': right,\n 'is-up': up,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\n/**\n * Divider in dropdown menus.\n *\n * @function\n * @param {React.HTMLAttributes<HTMLHRElement>} props - Standard hr props.\n * @returns {JSX.Element} The rendered divider.\n */\nexport const NavbarDivider: React.FC<React.HTMLAttributes<HTMLHRElement>> = ({\n className,\n ...props\n}) => (\n <hr\n className={classNames(usePrefixedClassNames('navbar-divider'), className)}\n {...props}\n />\n);\n\n// Attach subcomponents\nexport const Navbar = withSubComponents(\n NavbarComponent,\n {\n Brand: NavbarBrand,\n Item: NavbarItem,\n Link: NavbarLink,\n Burger: NavbarBurger,\n Menu: NavbarMenu,\n Start: NavbarStart,\n End: NavbarEnd,\n Dropdown: NavbarDropdown,\n DropdownMenu: NavbarDropdownMenu,\n Divider: NavbarDivider,\n },\n 'Navbar'\n);\n\nexport default Navbar;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;AAwBA,MAAM,qBAAqB,GACzB,KAAK,CAAC,aAAa,CAAoC,IAAI,CAAC;AAqD9D;;;;;;;;AAQG;AACH,MAAM,eAAe,GAAG,UAAU,CAChC,SAAS,eAAe,CACtB,EACE,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EAAA;AAEH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;AAGF,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,QAAQ,EAAE;AACnD,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GA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":"Navbar.js","sources":["../../../src/components/Navbar.tsx"],"sourcesContent":["import React, { forwardRef, useContext, useEffect, useState } from 'react';\nimport { classNames, usePrefixedClassNames } from '../helpers/classNames';\nimport { withSubComponents } from '../helpers/withSubComponents';\nimport type { PolymorphicComponent } from '../helpers/polymorphic';\nimport { buttonType } from '../helpers/buttonType';\nimport {\n useBulmaClasses,\n BulmaClassesProps,\n validColors,\n} from '../helpers/useBulmaClasses';\n\n/**\n * Shared state a `Navbar.Dropdown` exposes to its `Navbar.Link` trigger so the\n * trigger needs no hand-wired ARIA or keyboard handling.\n */\ninterface NavbarDropdownContextValue {\n /** Whether the dropdown is currently open. */\n active: boolean;\n /** Flips the open state. */\n toggle: () => void;\n /** Closes the dropdown (no-op if already closed). */\n close: () => void;\n}\n\nconst NavbarDropdownContext =\n React.createContext<NavbarDropdownContextValue | null>(null);\n\n/**\n * Props for the Navbar component.\n * @extraProp {React.Ref<HTMLElement>} [ref] - Ref forwarded to the root `<nav>` element.\n */\nexport interface NavbarProps\n extends\n React.HTMLAttributes<HTMLElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes for the navbar. */\n className?: string;\n /** Text color for the navbar. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Bulma color modifier for the navbar. */\n color?:\n | 'primary'\n | 'link'\n | 'info'\n | 'success'\n | 'warning'\n | 'danger'\n | 'black'\n | 'dark'\n | 'light'\n | 'white';\n /** Background color for the navbar. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Renders the navbar with a transparent background. */\n transparent?: boolean;\n /**\n * Renders Bulma's `is-spaced`: padding around the navbar, rounded items\n * and boxed dropdowns. Bulma applies it from the desktop breakpoint up, so\n * below that the navbar looks the same either way. With `fixed=\"top\"`, put\n * `has-spaced-navbar-fixed-top` on `<html>` beside `has-navbar-fixed-top`\n * (the `-bottom` pair for `fixed=\"bottom\"`). From desktop up the spaced\n * navbar is taller than `has-navbar-fixed-top` pads the page for, and\n * there the spaced class pads it for the taller navbar.\n */\n isSpaced?: boolean;\n /**\n * Renders Bulma's `has-shadow`: a shadow below the navbar, or above it with\n * `fixed=\"bottom\"`. Off unless set, since Bulma's navbar has no shadow of\n * its own. `Box` and `Card` take a `hasShadow` that defaults to `true`\n * instead, because Bulma gives those a shadow already.\n */\n hasShadow?: boolean;\n /** Fixes the navbar to the top or bottom of the viewport. */\n fixed?: 'top' | 'bottom';\n /** Navbar content (compose with subcomponents). */\n children?: React.ReactNode;\n}\n\n/**\n * The `Navbar` component implements Bulma's powerful, responsive navigation bar for your Bulma React UI.\n *\n * @function\n * @param {NavbarProps} props - Props for the Navbar component.\n * @param {React.Ref<HTMLElement>} ref - Forwarded ref to the root `<nav>` element.\n * @returns {JSX.Element} The rendered navbar.\n * @see {@link https://bulma.io/documentation/components/navbar/ | Bulma Navbar documentation}\n */\nconst NavbarComponent = forwardRef<HTMLElement, NavbarProps>(\n function NavbarComponent(\n {\n className,\n textColor,\n bgColor,\n color,\n transparent,\n isSpaced,\n hasShadow,\n fixed,\n children,\n ...props\n },\n ref\n ) {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n // Generate Bulma classes with prefix\n const bulmaClasses = usePrefixedClassNames('navbar', {\n [`is-${color}`]: color,\n 'is-transparent': transparent,\n 'is-spaced': isSpaced,\n 'has-shadow': hasShadow,\n [`is-fixed-${fixed}`]: fixed,\n });\n\n const navbarClasses = classNames(\n bulmaClasses,\n bulmaHelperClasses,\n className\n );\n\n return (\n <nav\n ref={ref}\n className={navbarClasses}\n role=\"navigation\"\n aria-label=\"main navigation\"\n {...rest}\n >\n {children}\n </nav>\n );\n }\n);\n\n/**\n * Props for the NavbarBrand component.\n */\nexport interface NavbarBrandProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the brand. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-brand.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Brand content. */\n children?: React.ReactNode;\n}\n\n/**\n * For logo and branding (left side)\n *\n * @function\n * @param {NavbarBrandProps} props - Props for the NavbarBrand component.\n * @returns {JSX.Element} The rendered brand area.\n */\nexport const NavbarBrand: React.FC<NavbarBrandProps> = ({\n className,\n children,\n textColor,\n color,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-brand'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * The NavbarItem component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface NavbarItemOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` here would be the deprecated presentational HTML\n * attribute, and `useBulmaClasses` consumes any `color` key as a Bulma helper\n * before the target could see it — so it is declared unavailable rather than\n * silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes. */\n className?: string;\n /** Whether the item is active. */\n active?: boolean;\n /** Text color for the item. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color for the item. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Navbar item content. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the NavbarItem component. The DOM attributes and the `ref` both\n * follow `as`: rendering as a router link accepts that component's props (`to`\n * and friends) by inference, and `as=\"span\"` rejects `href`.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type NavbarItemProps<T extends React.ElementType = 'a'> =\n NavbarItemOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarItemOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'span'`, `'div'`, `'button'`) or a custom component (e.g. a router link). Defaults to `'a'`.\n *\n * `'button'` renders `type=\"button\"`, so an item inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `NavbarItemProps<T>` above — the body cannot see through `T`.\n */\ntype NavbarItemImplProps = NavbarItemOwnProps & {\n as?: React.ElementType;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * Navigation links, buttons, or custom content\n *\n * @function\n * @param {NavbarItemProps} props - Props for the NavbarItem component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered item.\n */\nexport const NavbarItem = forwardRef(function NavbarItem(\n itemProps: NavbarItemProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n as: Component = 'a',\n active,\n textColor,\n bgColor,\n children,\n ...props\n } = itemProps as NavbarItemImplProps;\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n return (\n <Component\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-item', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n // A `<button>` defaults to type=\"submit\", and a navbar inside a form must\n // not submit it. After the spread, reading through it, so a spread\n // carrying `type: undefined` cannot erase the default. A caller's\n // `submit` or `reset` still wins; `buttonType` says more.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<NavbarItemOwnProps, 'a'>;\n\nNavbarItem.displayName = 'NavbarItem';\n\n/**\n * Props for the NavbarBurger component.\n * @extraProp {React.Ref<HTMLButtonElement>} [ref] - Ref forwarded to the burger button element.\n * @extraProp {'button' | 'submit' | 'reset'} [type='button'] - Button type. Defaults to `'button'`, so a burger inside a form does not submit it. Pass `'submit'` or `'reset'` and yours is used; any other value, or a spread carrying `type: undefined`, renders `'button'`.\n */\nexport interface NavbarBurgerProps\n extends\n Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'aria-expanded'>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the burger. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-burger.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Whether the burger is active. */\n active?: boolean;\n /**\n * Custom content inside the burger, rendered after its four bar spans.\n * Bulma styles every `<span>` in the burger as a bar, so an extra span here\n * draws an extra bar.\n */\n children?: React.ReactNode;\n /**\n * Accessible name. Pass your own to replace it. An empty one, or a spread\n * carrying `'aria-label': undefined`, keeps the default rather than leaving\n * the button unnamed.\n * @defaultValue 'menu'\n */\n 'aria-label'?: string;\n /**\n * Expanded state for assistive technology. It follows `active` unless you\n * pass `true` or `false`, and `null` leaves it off, for a burger whose\n * state isn't known yet; a spread carrying `'aria-expanded': undefined`\n * still follows `active`.\n * @defaultValue active\n */\n 'aria-expanded'?: boolean | null;\n /** Click handler. */\n onClick?: React.MouseEventHandler<HTMLButtonElement>;\n}\n\n/**\n * Responsive menu toggle (mobile)\n *\n * @function\n * @param {NavbarBurgerProps} props - Props for the NavbarBurger component.\n * @param {React.Ref<HTMLButtonElement>} ref - Forwarded ref to the burger button element.\n * @returns {JSX.Element} The rendered burger.\n */\nexport const NavbarBurger = forwardRef<HTMLButtonElement, NavbarBurgerProps>(\n function NavbarBurger(\n { className, active, textColor, color, children, ...props },\n ref\n ) {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <button\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-burger', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n // After the spread, reading through it: a key the spread carries with\n // no value would otherwise erase the default, leaving a nameless\n // button that submits the form around it. An empty label falls back\n // too: the button is drawn as an icon, so `''` would leave it unnamed.\n // A caller's own value still wins; `buttonType` says more.\n aria-label={rest['aria-label'] || 'menu'}\n aria-expanded={\n rest['aria-expanded'] === null\n ? undefined\n : (rest['aria-expanded'] ?? !!active)\n }\n type={buttonType(rest.type)}\n >\n {/* Bulma v1's burger mixin positions four spans: the first two meet\n in the middle (they rotate into the X), the third and fourth draw\n the top and bottom bars. */}\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n <span aria-hidden=\"true\"></span>\n {children}\n </button>\n );\n }\n);\n\nNavbarBurger.displayName = 'NavbarBurger';\n\n/**\n * Props for the NavbarMenu component.\n */\nexport interface NavbarMenuProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color for the menu. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `.navbar-menu.is-<color>` rule, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Whether the menu is active. */\n active?: boolean;\n /** Menu content. */\n children?: React.ReactNode;\n}\n\n/**\n * Collapsible content (contains `Navbar.Start` and `Navbar.End`)\n *\n * @function\n * @param {NavbarMenuProps} props - Props for the NavbarMenu component.\n * @returns {JSX.Element} The rendered menu.\n */\nexport const NavbarMenu: React.FC<NavbarMenuProps> = ({\n className,\n active,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-menu', {\n 'is-active': active,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Props for the NavbarStartEnd component.\n */\nexport interface NavbarStartEndProps\n extends\n React.HTMLAttributes<HTMLDivElement>,\n Omit<BulmaClassesProps, 'color' | 'backgroundColor'> {\n /** Additional CSS classes. */\n className?: string;\n /** Text color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /**\n * Renders `has-text-<color>`, exactly like `textColor`. Bulma has no\n * `is-<color>` rule for this area, so this is not a filled variant.\n * `textColor` takes precedence when both are set, and is the one that\n * reaches the full color list.\n */\n color?: 'primary' | 'link' | 'info' | 'success' | 'warning' | 'danger';\n /** Content. */\n children?: React.ReactNode;\n}\n\n/**\n * Left-aligned menu area\n *\n * @function\n * @param {NavbarStartEndProps} props - Props for the NavbarStart component.\n * @returns {JSX.Element} The rendered start area.\n */\nexport const NavbarStart: React.FC<NavbarStartEndProps> = ({\n className,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-start'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * Right-aligned menu area\n *\n * @function\n * @param {NavbarStartEndProps} props - Props for the NavbarEnd component.\n * @returns {JSX.Element} The rendered end area.\n */\nexport const NavbarEnd: React.FC<NavbarStartEndProps> = ({\n className,\n textColor,\n color,\n children,\n ...props\n}) => {\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor ?? color,\n ...props,\n });\n return (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-end'),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n >\n {children}\n </div>\n );\n};\n\n/**\n * The NavbarLink component's own props — everything it adds on top of the\n * attributes of whatever element `as` renders.\n */\nexport interface NavbarLinkOwnProps extends Omit<\n BulmaClassesProps,\n 'color' | 'backgroundColor'\n> {\n /**\n * Not accepted. `color` here would be the deprecated presentational HTML\n * attribute, and `useBulmaClasses` consumes any `color` key as a Bulma helper\n * before the target could see it — so it is declared unavailable rather than\n * silently eaten. Use `textColor` / `bgColor`.\n * @internal\n */\n color?: never;\n /**\n * Not accepted under this name. `useBulmaClasses` consumes any\n * `backgroundColor` key before `rest` is spread, so a custom `as` target\n * declaring one would never receive it. Use `bgColor`.\n * @internal\n */\n backgroundColor?: never;\n /** Additional CSS classes. */\n className?: string;\n /** Remove the dropdown arrow indicator. */\n arrowless?: boolean;\n /** Text color. */\n textColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Background color. */\n bgColor?: (typeof validColors)[number] | 'inherit' | 'current';\n /** Link content. */\n children?: React.ReactNode;\n}\n\n/**\n * Props for the NavbarLink component. The DOM attributes and the `ref` both\n * follow `as`: `as=\"button\"` accepts the button attributes and a button ref,\n * and `as=\"span\"` rejects `href` and `target`. Not `rel` — React declares it on\n * `HTMLAttributes<T>`, so it is valid on every element, and rejecting it would\n * mean diverging from React's own typing.\n *\n * @extraProp {PolymorphicRef<React.ElementType>} [ref] - Ref forwarded to the element `as` renders, typed from `as`: the DOM node for an intrinsic tag, or whatever handle a custom component exposes.\n */\nexport type NavbarLinkProps<T extends React.ElementType = 'a'> =\n NavbarLinkOwnProps &\n Omit<React.ComponentPropsWithoutRef<T>, keyof NavbarLinkOwnProps | 'as'> & {\n /**\n * Render as another intrinsic element (`'button'`, `'span'`) or a custom component. Defaults to `'a'`.\n *\n * Inside a `Navbar.Dropdown` this also decides the trigger's semantics. A custom\n * component is taken to be interactive already — a router link, typically — so it\n * keeps its own role and click behaviour. An intrinsic tag is judged on what it is:\n * `'button'`, or anything carrying an `href`, is left alone, and everything else\n * (`'span'`, a bare `'a'`, a custom element) gets `role=\"button\"`, `tabIndex` and a\n * click that opens the dropdown.\n *\n * If your custom component renders something non-interactive, pass `role=\"button\"` and\n * it takes that fallback too — `tabIndex` and click included. The keyboard path is\n * attached either way.\n *\n * `'button'` renders `type=\"button\"`, so a link inside a form does not submit it. Pass\n * `type=\"submit\"` or `type=\"reset\"` and yours is used; any other value, or a spread\n * carrying `type: undefined`, renders `type=\"button\"`.\n */\n as?: T;\n };\n\n/**\n * The shape the implementation destructures. The public contract is the generic\n * `NavbarLinkProps<T>` above — the body cannot see through `T`, so it names the\n * handful of DOM props it actually reads back off `rest`.\n */\ntype NavbarLinkImplProps = NavbarLinkOwnProps & {\n as?: React.ElementType;\n href?: string;\n role?: React.AriaRole;\n onKeyDown?: React.KeyboardEventHandler<HTMLAnchorElement>;\n onClick?: React.MouseEventHandler<HTMLAnchorElement>;\n type?: React.ButtonHTMLAttributes<HTMLButtonElement>['type'];\n};\n\n/**\n * Dropdown trigger with arrow indicator (use as first child of `Navbar.Dropdown`)\n *\n * @function\n * @param {NavbarLinkProps} props - Props for the NavbarLink component.\n * @param {React.Ref} ref - Forwarded ref to the element `as` renders.\n * @returns {JSX.Element} The rendered navbar link.\n */\nexport const NavbarLink = forwardRef(function NavbarLink(\n linkProps: NavbarLinkProps,\n ref: React.Ref<HTMLElement>\n) {\n const {\n className,\n as: Component = 'a',\n arrowless,\n textColor,\n bgColor,\n children,\n ...props\n } = linkProps as NavbarLinkImplProps;\n const { bulmaHelperClasses, rest } = useBulmaClasses({\n color: textColor,\n backgroundColor: bgColor,\n ...props,\n });\n\n const dropdownContext = useContext(NavbarDropdownContext);\n const hasHref = rest.href !== undefined;\n // What a custom component renders cannot be read off its input props, and the\n // prop that ends in an anchor belongs to the router, not to us — `to`, `state`,\n // `params` and a dozen further spellings all get there. Sniffing for more names\n // trades one wrong guess for another, so a non-string `as` counts as\n // interactive: announcing a real anchor as a button, and layering a synthetic\n // click over its navigation, is the worse of the two failures (#668).\n //\n // A custom ELEMENT stays out of it. A hyphenated tag is a real DOM element and\n // none of those is natively interactive, so `<x-trigger>` keeps the fallback\n // exactly like `as=\"span\"` — the same line `Avatar` draws for `role=\"img\"`.\n //\n // Where we are guessing, the caller settles it: a custom target that declares\n // `role=\"button\"` is saying it is a button and not a link, so it takes the\n // whole fallback — including the click, which is the half it could not supply\n // itself. `Avatar` gives the same escape hatch to the same guess. An `href`\n // still wins: a target with somewhere to navigate is a link whatever role it\n // claims.\n const customTargetIsButton =\n typeof Component !== 'string' && rest.role === 'button';\n\n const isNativeInteractive =\n Component === 'button' ||\n (typeof Component !== 'string' && !customTargetIsButton) ||\n hasHref;\n\n // Guarded like Button's disabled blocker: these run on whatever `as` renders,\n // and a custom target's callback need not take a DOM event. One declaring\n // `onKeyDown: (k: {key: string}) => void` reaches `e.preventDefault()` and\n // throws. Composing the caller's handler is unconditional; acting on the\n // event is not ours to do when the payload is foreign.\n const isDomEvent = (e: unknown): e is { preventDefault: () => void } =>\n typeof (e as { preventDefault?: unknown })?.preventDefault === 'function';\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLAnchorElement>) => {\n rest.onKeyDown?.(e);\n if (!isDomEvent(e)) return;\n if (!dropdownContext || e.defaultPrevented) return;\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n dropdownContext.toggle();\n } else if (e.key === 'Escape' && dropdownContext.active) {\n e.preventDefault();\n dropdownContext.close();\n }\n };\n\n // When the link is not natively interactive (no `href`, not a `<button>`) it\n // renders as `role=\"button\"`, so a mouse/touch click has no default action to\n // open the dropdown. Compose the caller's handler and toggle the dropdown\n // unless the caller prevented the default. Native links/buttons keep their own\n // click semantics (navigation / the caller's handler).\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\n rest.onClick?.(e);\n if (!isDomEvent(e)) return;\n if (!dropdownContext || isNativeInteractive || e.defaultPrevented) return;\n dropdownContext.toggle();\n };\n\n return (\n <Component\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-link', {\n 'is-arrowless': arrowless,\n }),\n bulmaHelperClasses,\n className\n )}\n {...rest}\n {...(dropdownContext && {\n 'aria-haspopup': 'true',\n 'aria-expanded': dropdownContext.active,\n onKeyDown: handleKeyDown,\n ...(!isNativeInteractive && {\n role: 'button',\n tabIndex: 0,\n onClick: handleClick,\n }),\n })}\n // The same button type default as `Navbar.Item`, for the same reason.\n {...(Component === 'button' ? { type: buttonType(rest.type) } : {})}\n >\n {children}\n </Component>\n );\n}) as PolymorphicComponent<NavbarLinkOwnProps, 'a'>;\n\nNavbarLink.displayName = 'NavbarLink';\n\n/**\n * Props for the NavbarDropdown component.\n * @extraProp {React.Ref<HTMLDivElement>} [ref] - Ref forwarded to the dropdown container element.\n */\nexport interface NavbarDropdownProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Additional CSS classes. */\n className?: string;\n /** Dropdown aligned right. */\n right?: boolean;\n /** Dropdown opens upwards. */\n up?: boolean;\n /** Dropdown opens on hover. */\n hoverable?: boolean;\n /** Dropdown is open. */\n active?: boolean;\n /** Callback when dropdown active state changes. */\n onActiveChange?: (active: boolean) => void;\n /** Dropdown content. */\n children?: React.ReactNode;\n}\n\n/**\n * Dropdown parent (with options for hover, up, right, active)\n *\n * @function\n * @param {NavbarDropdownProps} props - Props for the NavbarDropdown component.\n * @param {React.Ref<HTMLDivElement>} ref - Forwarded ref to the dropdown container element.\n * @returns {JSX.Element} The rendered dropdown.\n */\nexport const NavbarDropdown = forwardRef<HTMLDivElement, NavbarDropdownProps>(\n function NavbarDropdown(\n {\n className,\n right,\n up,\n hoverable,\n active: activeProp,\n onActiveChange,\n children,\n ...props\n },\n ref\n ) {\n const [active, setActive] = useState<boolean>(!!activeProp);\n\n useEffect(() => {\n // eslint-disable-next-line react-hooks/set-state-in-effect -- syncing to controlled prop\n if (typeof activeProp === 'boolean') setActive(activeProp);\n }, [activeProp]);\n\n // Keep `onActiveChange` out of the state updater (a pure function) so Strict\n // Mode's double-invoked updaters don't double-fire it — mirrors `Dropdown`.\n const toggle = () => {\n const next = !active;\n setActive(next);\n onActiveChange?.(next);\n };\n\n const close = () => {\n /* istanbul ignore next: close() is only invoked once already active */\n if (!active) return;\n setActive(false);\n onActiveChange?.(false);\n };\n\n return (\n <NavbarDropdownContext.Provider value={{ active, toggle, close }}>\n <div\n ref={ref}\n className={classNames(\n usePrefixedClassNames('navbar-item', 'has-dropdown', {\n 'has-dropdown-up': up,\n 'is-right': right,\n 'is-hoverable': hoverable,\n 'is-active': active,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n </NavbarDropdownContext.Provider>\n );\n }\n);\n\nNavbarDropdown.displayName = 'NavbarDropdown';\n\n/**\n * Props for the NavbarDropdownMenu component.\n */\nexport interface NavbarDropdownMenuProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Additional CSS classes. */\n className?: string;\n /** Dropdown aligned right. */\n right?: boolean;\n /** Dropdown opens upwards. */\n up?: boolean;\n /** Dropdown menu content. */\n children?: React.ReactNode;\n}\n\n/**\n * Dropdown menu container\n *\n * @function\n * @param {NavbarDropdownMenuProps} props - Props for the NavbarDropdownMenu component.\n * @returns {JSX.Element} The rendered dropdown menu.\n */\nexport const NavbarDropdownMenu: React.FC<NavbarDropdownMenuProps> = ({\n className,\n right,\n up,\n children,\n ...props\n}) => (\n <div\n className={classNames(\n usePrefixedClassNames('navbar-dropdown', {\n 'is-right': right,\n 'is-up': up,\n }),\n className\n )}\n {...props}\n >\n {children}\n </div>\n);\n\n/**\n * Divider in dropdown menus.\n *\n * @function\n * @param {React.HTMLAttributes<HTMLHRElement>} props - Standard hr props.\n * @returns {JSX.Element} The rendered divider.\n */\nexport const NavbarDivider: React.FC<React.HTMLAttributes<HTMLHRElement>> = ({\n className,\n ...props\n}) => (\n <hr\n className={classNames(usePrefixedClassNames('navbar-divider'), className)}\n {...props}\n />\n);\n\n// Attach subcomponents\nexport const Navbar = withSubComponents(\n NavbarComponent,\n {\n Brand: NavbarBrand,\n Item: NavbarItem,\n Link: NavbarLink,\n Burger: NavbarBurger,\n Menu: NavbarMenu,\n Start: NavbarStart,\n End: NavbarEnd,\n Dropdown: NavbarDropdown,\n DropdownMenu: NavbarDropdownMenu,\n Divider: NavbarDivider,\n },\n 'Navbar'\n);\n\nexport default Navbar;\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;;;;;AAwBA,MAAM,qBAAqB,GACzB,KAAK,CAAC,aAAa,CAAoC,IAAI,CAAC;AAqD9D;;;;;;;;AAQG;AACH,MAAM,eAAe,GAAG,UAAU,CAChC,SAAS,eAAe,CACtB,EACE,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,EAAA;AAEH,IAAA,MAAM,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC;AACnD,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,eAAe,EAAE,OAAO;AACxB,QAAA,GAAG,KAAK;AACT,KAAA,CAAC;;AAGF,IAAA,MAAM,YAAY,GAAG,qBAAqB,CAAC,QAAQ,EAAE;AACnD,QAAA,CAAC,CAAA,GAAA,EAAM,KAAK,CAAA,CAAE,GAAG,KAAK;AACtB,QAAA,gBAAgB,EAAE,WAAW;AAC7B,QAAA,WAAW,EAAE,QAAQ;AACrB,QAAA,YAAY,EAAE,SAAS;AACvB,QAAA,CAAC,CAAA,SAAA,EAAY,KAAK,CAAA,CAAE,GAAG,KAAK;AAC7B,KAAA,CAAC;IAEF,MAAM,aAAa,GAAG,UAAU,CAC9B,YAAY,EACZ,kBAAkB,EAClB,SAAS,CACV;IAED,QACEA,aACE,GAAG,EAAE,GAAG,EACR,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