@nswds/ui 7.0.2 → 8.1.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.
Files changed (42) hide show
  1. package/dist/components/badge.d.ts +1 -1
  2. package/dist/components/button-group.d.ts +104 -5
  3. package/dist/components/button-group.js +166 -11
  4. package/dist/components/button-group.js.map +1 -1
  5. package/dist/components/button.d.ts +46 -7
  6. package/dist/components/button.js +271 -25
  7. package/dist/components/button.js.map +1 -1
  8. package/dist/components/callout.d.ts +1 -1
  9. package/dist/components/combobox.js +3 -2
  10. package/dist/components/combobox.js.map +1 -1
  11. package/dist/components/drawer.d.ts +1 -1
  12. package/dist/components/drawer.js +3 -2
  13. package/dist/components/drawer.js.map +1 -1
  14. package/dist/components/header.d.ts +1 -1
  15. package/dist/components/hover-card.js +3 -2
  16. package/dist/components/hover-card.js.map +1 -1
  17. package/dist/components/link.d.ts +1 -1
  18. package/dist/components/masthead.d.ts +1 -1
  19. package/dist/components/native-select.d.ts +9 -5
  20. package/dist/components/native-select.js +32 -6
  21. package/dist/components/native-select.js.map +1 -1
  22. package/dist/components/navigation-menu.d.ts +1 -1
  23. package/dist/components/navigation-menu.js +6 -4
  24. package/dist/components/navigation-menu.js.map +1 -1
  25. package/dist/components/popover.js +3 -2
  26. package/dist/components/popover.js.map +1 -1
  27. package/dist/components/select.d.ts +8 -4
  28. package/dist/components/select.js +36 -12
  29. package/dist/components/select.js.map +1 -1
  30. package/dist/components/sheet.js +3 -2
  31. package/dist/components/sheet.js.map +1 -1
  32. package/dist/components/site-search.js +3 -2
  33. package/dist/components/site-search.js.map +1 -1
  34. package/dist/components/skip-link.d.ts +1 -1
  35. package/dist/components/tooltip.js +3 -2
  36. package/dist/components/tooltip.js.map +1 -1
  37. package/dist/index.d.ts +5 -4
  38. package/dist/lib/button-group-context.d.ts +46 -0
  39. package/dist/lib/button-group-context.js +12 -0
  40. package/dist/lib/button-group-context.js.map +1 -0
  41. package/dist/styles.css +1 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C,MAAA;AAAA,MAAA;AAAA,QACC,SAAA,EAAU,8IAAA;AAAA,QACV,aAAA,EAAY;AAAA;AAAA,KACd;AAAA,IACC;AAAA,GAAA,EACH,CAAA;AAEJ","file":"button.js","sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport clsx from 'clsx'\nimport React from 'react'\n\nimport { cn } from '../lib/utils.js'\n\nimport { Link } from '../components/link.js'\nimport { Spinner } from '../components/spinner.js'\n\nconst styles = {\n base: [\n // Base\n // Transitioned properties are named, NOT `transition-all`. `all` includes\n // `outline-width` and `outline-offset`, and animating those out of the\n // initial `outline-style: none` state means the width never commits — the\n // focus ring below never painted, on every button in the system, leaving\n // keyboard users the browser default (WCAG 2.4.7). Isolated by bisection:\n // the focus utilities alone settle at 2px/-2px, adding `transition-all`\n // gives 1.5px/0px, and naming properties is fine. Nothing is lost by\n // naming them — no state in this file animates a transform or a size.\n 'relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-sm border text-base/7 font-bold motion-safe:transition-[color,background-color,border-color,box-shadow,opacity]',\n // Height floor, published per size step as `--btn-h` (see `styles.size`).\n // A floor rather than a fixed height so a wrapped label can still grow.\n 'min-h-(--btn-h)',\n // Border width, so the size steps can subtract it from their padding and\n // keep the outer box identical across variants. `outline` and `surface`\n // draw a 2px border and raise this to match; everything else stays 1px.\n // Without it the steps subtracted a hard-coded 1px and those two variants\n // came out 2px taller than `solid` at every step and breakpoint.\n '[--btn-border-w:1px]',\n // Focus — deliberately `focus:` (paints on pointer clicks too), unlike\n // Link/Input which use `focus-visible:`. Buttons give click feedback with\n // the ring; links only ring for keyboard/AT focus. Do not \"unify\" this.\n // The ring is offset 2px, so it lands on the *page* rather than on the\n // button. `--btn-bg` is the ink (see the note above `styles.colors`), which\n // flips for dark mode, so the ring follows the theme for every variant —\n // including `solid`, whose ring used to be its own fill colour and so went\n // near-invisible on a dark surface.\n 'focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-(--btn-bg)',\n // Disabled\n 'data-disabled:opacity-50 data-disabled:pointer-events-none',\n // State overlays, derived from the ink rather than restated per colour.\n // Deriving them means they follow `--btn-bg` wherever it comes from: the\n // colour token, its dark-mode counterpart, or a surface that re-points the\n // ink at its own (`[--btn-bg:var(--footer-ink)]` in footer.tsx and\n // footer-cta.tsx). `solid` overrides both with its white/black pair at\n // `data-[variant=solid]:` — an attribute selector, so it outranks these\n // regardless of source order. `oklab` matches the interpolation space\n // Tailwind's own `/10` alpha modifier emits, so the painted colour is\n // unchanged from when each colour restated these itself.\n '[--btn-hover-overlay:color-mix(in_oklab,var(--btn-bg)_10%,transparent)]',\n '[--btn-active-overlay:color-mix(in_oklab,var(--btn-bg)_20%,transparent)]',\n // Glyph size beside a label: one value for every step and breakpoint.\n // Every step sets `text-base/7`, so the label is 16px whatever the step —\n // only the padding changes. An icon next to it has to match the *text*,\n // not the box, so scaling it per step pairs a growing glyph with type that\n // never moves: at `lg` a 28px icon sat beside a 16px word, two and a half\n // times its cap height. 24px is 1.5x the label at every step, and the same\n // number `size='icon'` uses. `iconOnly` overrides this per step in\n // `compoundVariants` — with no label to match, it scales with its box.\n '[--btn-icon-size:--spacing(6)]',\n // Icon. No vertical margin: the glyph is `self-center` in a baseline-aligned\n // row, so margin buys it nothing optically and only inflates the flex line.\n // It was inert at `sm`/`default` (glyph + margin stayed inside the 1.75rem\n // line box) but pushed `lg` 2px past its own height below `sm:`, so a `lg`\n // button measured 70px with an icon and 68px without.\n '*:data-[slot=icon]:-mx-0.25 *:data-[slot=icon]:size-(--btn-icon-size) *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:self-center *:data-[slot=icon]:text-(--btn-icon) forced-colors:[--btn-icon:ButtonText] forced-colors:hover:[--btn-icon:ButtonText]',\n ],\n solid: [\n // Text color\n 'text-(--btn-text)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-border)',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-fill)',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-fill)',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n soft: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-bg)/10',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-bg)/20',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-bg)/10',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:bg-white/5',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n surface: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-(--btn-bg)/50 border-2 bg-(--btn-bg)/5 [--btn-border-w:2px]',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-bg)/30',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-bg)/5',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-(--btn-bg)/50',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // Border color on hover\n 'active:border-(--btn-bg) hover:border-(--btn-bg)',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n outline: [\n // Text color\n 'border-(--btn-bg) text-(--btn-bg) border-2 [--btn-border-w:2px]',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'bg-transparent',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-transparent',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-(--btn-bg)',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n ghost: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-transparent)',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-transparent)',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n link: [\n // Text color — inherits from color token, no background or border\n 'text-(--btn-bg) border-transparent bg-transparent',\n // Halo tokens derive from the colour token via color-mix, mirroring Link\n '[--link-halo:color-mix(in_oklch,var(--btn-bg)_10%,transparent)]',\n '[--link-halo-active:color-mix(in_oklch,var(--btn-bg)_18%,transparent)]',\n // Resting underline, thickened on interaction — matching Link\n 'underline underline-offset-4 hover:decoration-2 active:decoration-2',\n // Hover / active halos match the GOV.UK-style halo on Link (see link.tsx\n // styledBase): the fill is painted on the `after` layer — consistent with\n // the other variants' hover overlays — and the box-shadow extends it 2px\n // above and 4px below the line box\n 'after:absolute after:inset-0 after:-z-10',\n 'hover:after:bg-(--link-halo) active:after:bg-(--link-halo-active)',\n 'hover:shadow-[0_-2px_0_var(--link-halo),0_4px_0_var(--link-halo)]',\n 'active:shadow-[0_-2px_0_var(--link-halo-active),0_4px_0_var(--link-halo-active)]',\n ],\n // Two variables, deliberately separate.\n //\n // `--btn-fill` is the block of colour `solid` paints behind `--btn-text`.\n // `--btn-bg` is the *ink*: the glyph and label on every non-solid variant\n // (`text-(--btn-bg)`), the border on `outline`/`surface`, the tint on\n // `soft`/`surface`, the `link` halos, the state overlays derived in\n // `styles.base`, and the focus ring. They start life the same colour, and\n // only part company in dark mode.\n //\n // They used to be one variable, which made the ink un-flippable. The values\n // here are masterbrand palette steps, and palette steps are theme-invariant —\n // `styles.css` re-declares only the *semantic* tokens under\n // `[data-theme=dark], .dark`. Design-system surfaces do flip, though\n // (`Header color='white'` is `bg-white dark:bg-grey-900`), so a non-solid\n // button kept its light-mode ink on a dark surface: `primary-800` on\n // `grey-900` measures 1.32:1, far under the 3:1 WCAG 1.4.11 asks of a UI\n // component, with the overlays and focus ring unpainted for the same reason.\n // Splitting the fill off means `--btn-bg` can flip on its own without\n // repainting `solid`, so the dark counterparts below need no variant scoping\n // and stay at single-class specificity — which is what keeps them overridable\n // by a surface that imposes its own ink (`[--btn-bg:var(--footer-ink)]` in\n // footer.tsx and footer-cta.tsx). Raising their specificity would silently\n // win against those, so keep any future dark value a bare `dark:` utility.\n //\n // `-200` is the package's established ink-on-dark (`--link-color`,\n // `--main-nav-panel-ink`) and clears 10:1 against every dark surface token.\n // `white` and `secondary` are already light inks, so they have no counterpart.\n //\n // Dark values use the raw NSW tokens for the tree-shaking reason spelled out\n // above `danger` below.\n colors: {\n grey: [\n // Base\n '[--btn-fill:var(--color-grey-600)] [--btn-bg:var(--color-grey-600)] [--btn-border:var(--color-grey-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--grey-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n white: [\n // No dark counterpart: white is already the maximum-contrast ink on any\n // dark surface. Surface-conditional in the same way as `secondary` — on a\n // light surface a non-solid `white` button is white on white. See the\n // note on the `color` prop.\n // Base\n '[--btn-fill:var(--color-white)] [--btn-bg:var(--color-white)] [--btn-border:var(--color-white)]/90 [--btn-text:var(--color-grey-800)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-black)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n primary: [\n // Base\n '[--btn-fill:var(--color-primary-800)] [--btn-bg:var(--color-primary-800)] [--btn-border:var(--color-primary-800)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--primary-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n secondary: [\n // No dark counterpart: `primary-200` already *is* the ink the other\n // colours flip to. Like `white`, this token is surface-conditional — it\n // is meant for dark surfaces, where it lands at 15.40:1. As a non-solid\n // ink on a light one it measures ~1.2:1, so that pairing is misuse\n // rather than a defect to fix here. See the note on the `color` prop.\n // Base\n '[--btn-fill:var(--color-primary-200)] [--btn-bg:var(--color-primary-200)] [--btn-border:var(--color-primary-200)]/90 [--btn-text:var(--color-primary-800)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/15',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-primary-800)]/10',\n ],\n tertiary: [\n // Base\n '[--btn-fill:var(--color-primary-600)] [--btn-bg:var(--color-primary-600)] [--btn-border:var(--color-primary-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--primary-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n accent: [\n // Base\n '[--btn-fill:var(--color-accent-600)] [--btn-bg:var(--color-accent-600)] [--btn-border:var(--color-accent-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--accent-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n // Semantic colours use the raw NSW token names (--danger-600, --success-600,\n // --warning-600) rather than Tailwind's `--color-*` bridge aliases. The\n // bridge aliases are tree-shaken by Tailwind v4 unless a matching utility\n // class is detected in scanned source, and arbitrary-property usages like\n // `[--btn-bg:var(--color-success-600)]` do NOT count as a usage signal.\n // The raw tokens are defined on :root by @nswds/tokens (a plain CSS import,\n // not a Tailwind theme), so they always resolve.\n danger: [\n // Base\n '[--btn-fill:var(--danger-600)] [--btn-bg:var(--danger-600)] [--btn-border:var(--danger-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--danger-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n success: [\n // Base\n '[--btn-fill:var(--success-600)] [--btn-bg:var(--success-600)] [--btn-border:var(--success-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--success-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n warning: [\n // Base\n '[--btn-fill:var(--warning-600)] [--btn-bg:var(--warning-600)] [--btn-border:var(--warning-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--warning-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n },\n // Each step publishes its own height as `--btn-h`, built from the same two\n // numbers that produce its box: one line box (`text-base/7` — Tailwind's\n // `/7` is `--spacing(7)`, so this is the same token, not a matching literal)\n // plus twice the vertical padding. `styles.base` pins it with `min-h`, and\n // `styles.iconOnly` reads it as both dimensions of the square — so an\n // icon-only button is exactly as tall as the text button beside it by\n // construction, and stays that way if a step is ever retuned.\n //\n // The border cancels out of that sum: padding is `--spacing(n) -\n // --btn-border-w` and the border adds `--btn-border-w` back, so every\n // variant lands on `--btn-h` whether it draws a 1px or 2px edge, and the\n // outer geometry stays put while the label shifts 1px to make room.\n //\n // The steps set padding and height only. Glyph size lives on the base (one\n // value beside a label) and in `compoundVariants` (per step when icon-only).\n size: {\n default:\n 'px-[calc(--spacing(6)-var(--btn-border-w))] py-[calc(--spacing(4)-var(--btn-border-w))] sm:px-[calc(--spacing(5.5)-var(--btn-border-w))] sm:py-[calc(--spacing(3)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(4)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(3)*2)]',\n sm: 'px-[calc(--spacing(5)-var(--btn-border-w))] py-[calc(--spacing(3)-var(--btn-border-w))] sm:px-[calc(--spacing(4.5)-var(--btn-border-w))] sm:py-[calc(--spacing(2)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(3)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(2)*2)]',\n lg: 'px-[calc(--spacing(7)-var(--btn-border-w))] py-[calc(--spacing(5)-var(--btn-border-w))] sm:px-[calc(--spacing(6.5)-var(--btn-border-w))] sm:py-[calc(--spacing(4)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(5)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(4)*2)]',\n // A compact chrome square that deliberately sits below the text steps —\n // header actions, dialog close buttons, footer social links. For an icon\n // button that must line up with text buttons beside it, use `iconOnly`\n // with `sm`/`default`/`lg` instead. Its glyph is the base 24px.\n icon: 'w-10 h-10 flex-none [--btn-h:--spacing(10)]',\n },\n // Square the button at the current step and drop the horizontal padding, so\n // the scale step and \"is this icon-only\" are independent axes. The glyph\n // needs no adjustment — the step already sizes it off the ladder.\n iconOnly: 'size-(--btn-h) flex-none p-0 sm:p-0',\n}\n\nconst buttonVariants = cva(styles.base, {\n variants: {\n variant: {\n solid: styles.solid,\n soft: styles.soft,\n surface: styles.surface,\n outline: styles.outline,\n ghost: styles.ghost,\n link: styles.link,\n },\n color: {\n white: styles.colors.white,\n grey: styles.colors.grey,\n primary: styles.colors.primary,\n secondary: styles.colors.secondary,\n tertiary: styles.colors.tertiary,\n accent: styles.colors.accent,\n danger: styles.colors.danger,\n success: styles.colors.success,\n warning: styles.colors.warning,\n },\n size: {\n default: styles.size.default,\n sm: styles.size.sm,\n lg: styles.size.lg,\n icon: styles.size.icon,\n },\n // Declared after `size` so its `p-0` reaches `cn()` downstream of the\n // step's `px-*`/`py-*` and wins the tailwind-merge conflict.\n iconOnly: {\n true: styles.iconOnly,\n false: '',\n },\n },\n compoundVariants: [\n // ── Icon-only glyph sizes ────────────────────────────────────────────\n //\n // With no label beside it the glyph has nothing to match, so here — and\n // only here — it scales with its box, off the icon ladder: 20 / 24 / 28 /\n // 32 / 36 / 40px, i.e. `--spacing(5)` through `--spacing(10)`. Every level\n // is a multiple of 4, so glyphs share the grid with the padding and\n // heights around them and land on whole device pixels at 1x. A discrete\n // ladder rather than a proportion of the box, because a glyph is only\n // crisp at the sizes it was drawn for — \"40% of the box\" would ask for\n // sizes no glyph exists at.\n //\n // One value per step, not per breakpoint: the square never gets smaller\n // on a wider viewport, so neither should what sits inside it.\n { size: 'sm', iconOnly: true, className: '[--btn-icon-size:--spacing(5)]' },\n { size: 'default', iconOnly: true, className: '[--btn-icon-size:--spacing(6)]' },\n { size: 'lg', iconOnly: true, className: '[--btn-icon-size:--spacing(7)]' },\n // The link variant reads as an inline Link despite the <button> tag:\n // strip the button chrome (padding from `size`, border, radius, bold\n // weight) and adopt Link's typography and 1em icon sizing so the hover\n // halo hugs the text instead of filling a button-shaped box.\n {\n variant: 'link',\n className: [\n 'rounded-none border-0 p-0 sm:p-0',\n // Release the step's height floor too — an inline link hugs its line\n // box, it does not stand a button's worth of space tall.\n 'min-h-0',\n // Hug the label even in stretching grid/flex contexts so the hover\n // halo wraps the text like an inline Link, not the allocated box.\n // `block` still wins — its w-full is applied after this in cn().\n 'w-fit',\n 'text-[length:inherit] font-medium',\n '*:data-[slot=icon]:size-[1em]',\n ],\n },\n ],\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'default',\n },\n})\n\n/**\n * An icon slot. Takes either form:\n *\n * - the component itself — `leadingVisual={IconDownload}`\n * - a rendered element — `leadingVisual={<IconDownload />}`\n *\n * **From a React Server Component, use the element form.** `Button` and\n * `ButtonLink` are `'use client'` modules, while the icon modules carry no\n * directive — deliberately, so an icon stays server-renderable and ships no\n * JavaScript. That means in a server component `IconDownload` is an ordinary\n * function value, and functions cannot cross the RSC boundary into a client\n * component (\"Functions cannot be passed directly to Client Components\"). A\n * React element can, because it serialises. Client components can use either.\n */\ntype IconSlot = React.ElementType | React.ReactElement\n\n/**\n * Renders an icon slot in whichever form it arrived, stamping `data-slot='icon'`\n * so the `*:data-[slot=icon]:…` rules above size and colour it. An element that\n * sets its own `data-slot` to an actual value keeps it — a consumer who named one\n * deliberately meant it. `undefined` and `null` count as unset and get the stamp,\n * because forwarding an optional prop that happens to be absent is idiomatic React\n * and must not silently strip the icon's sizing and colour.\n *\n * Passing only the key we intend to set is deliberate: `cloneElement` already seeds\n * its props from `slot.props`, so spreading them back into the config would be a\n * no-op — except that React 19 copies every config key across with no undefined-skip\n * (`defaultProps` having been removed), which is exactly how a forwarded\n * `data-slot={undefined}` would erase the stamp.\n */\nfunction renderIconSlot(slot: IconSlot | undefined | null): React.ReactNode {\n if (!slot) return null\n if (React.isValidElement<{ 'data-slot'?: string }>(slot)) {\n return React.cloneElement(slot, { 'data-slot': slot.props['data-slot'] ?? 'icon' })\n }\n // `isValidElement` is a type guard, but its false branch does not subtract\n // ReactElement from the union — TS keeps both members — so name the remaining\n // case explicitly. Anything that is not a valid element is a component type.\n const Icon = slot as React.ElementType\n return <Icon data-slot='icon' />\n}\n\n/** Visual/content props shared by `Button` and `ButtonLink`. */\ntype ButtonOwnProps = Omit<VariantProps<typeof buttonVariants>, 'size' | 'iconOnly' | 'color'> & {\n /**\n * Colour token. Most are safe on any surface: the non-solid variants take\n * their ink from the token and it flips for dark mode, so `primary` reads\n * correctly on a light page and on a dark one.\n *\n * `white` and `secondary` are the exceptions — both are\n * **surface-conditional, for dark surfaces only**. Their inks (`white` and\n * `primary-200`) are already light, which is what makes them right on a\n * dark surface and unusable on a light one: a non-solid button in either\n * colour measures around 1.2:1 on white, against the 3:1 WCAG 1.4.11 asks\n * of a UI component. Reach for them the way `Hero` does — over a\n * `primary-800` panel — and use `primary` on a light or theme-flipping\n * surface. `solid` is unaffected either way, since it pairs `--btn-fill`\n * with `--btn-text` rather than painting the ink.\n */\n color?:\n | 'white'\n | 'grey'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'accent'\n | 'danger'\n | 'success'\n | 'warning'\n | null\n /**\n * Scale step. `sm` / `default` / `lg` render 52 / 60 / 68px tall below\n * `sm:` and 44 / 52 / 60px at or above it. The step changes padding only —\n * the label is 16px and an icon beside it 24px at every step.\n *\n * `icon` is not a fourth step on that ramp — it is a flat 40×40 chrome\n * square (header actions, dialog close buttons, footer social links) that\n * lines up with none of them. For an icon-only button that must sit level\n * with text buttons beside it, pair `iconOnly` with `sm`/`default`/`lg`.\n */\n size?: 'sm' | 'default' | 'lg' | 'icon' | null\n /**\n * Render as a square containing only the icon, at the height of the current\n * `size` step — so `iconOnly` beside a `size='default'` button matches it\n * exactly. Supply an `aria-label`, since there is no visible text.\n *\n * With no label to match, the glyph scales with the square instead of\n * holding the 24px used beside text: 20px at `sm`, 24px at `default`, 28px\n * at `lg`, the same at every breakpoint. For a denser icon button that does\n * not line up with the text steps, use `size='icon'` (24px in a 40×40 box).\n */\n iconOnly?: boolean | null\n className?: string\n /** Button label. Optional for icon-only buttons (supply an `aria-label`). */\n children?: React.ReactNode\n /** Stretch button to fill its container width. */\n block?: boolean\n /** Show a spinner and disable interaction. */\n loading?: boolean\n /** Horizontal alignment of button content. */\n alignContent?: 'center' | 'start'\n disabled?: boolean\n /** Icon rendered before the label. Component or element — see `IconSlot`. */\n leadingVisual?: IconSlot\n /** Icon rendered after the label. Component or element — see `IconSlot`. */\n trailingVisual?: IconSlot\n /** Icon rendered as a trailing action (far end). Component or element. */\n trailingAction?: IconSlot\n /** Allow the button label to wrap onto multiple lines. Defaults to true. */\n labelWrap?: boolean\n /** Optional numeric badge rendered after the label. */\n count?: number\n /**\n * Visually-hidden suffix announced after `count`, giving the bare number\n * context for screen readers (e.g. \"unread messages\" → \"Inbox 3 unread\n * messages\").\n */\n countLabel?: string\n}\n\ntype ButtonProps = ButtonOwnProps & Omit<ButtonPrimitive.Props, 'className' | 'disabled'>\n\ntype ButtonLinkProps = ButtonOwnProps &\n Omit<React.ComponentPropsWithoutRef<typeof Link>, 'className' | 'variant'> & {\n ref?: React.Ref<HTMLAnchorElement>\n }\n\nfunction buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n}: ButtonOwnProps & { effectiveDisabled?: boolean }) {\n return clsx(\n cn(\n buttonVariants({ variant, color, size, iconOnly }),\n block && 'w-full',\n alignContent === 'start' && 'justify-start',\n className,\n ),\n effectiveDisabled ? 'cursor-not-allowed' : 'cursor-pointer',\n )\n}\n\n/** Shared inner layout: spinner, visuals, label, count, touch target. */\nfunction ButtonContent({\n loading,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n children,\n}: Pick<\n ButtonOwnProps,\n | 'loading'\n | 'leadingVisual'\n | 'trailingVisual'\n | 'trailingAction'\n | 'labelWrap'\n | 'count'\n | 'countLabel'\n | 'children'\n>) {\n return (\n <TouchTarget>\n {loading && (\n <Spinner\n data-slot='icon'\n role={undefined}\n aria-hidden\n color='current'\n // The button's own label + aria-busy convey the busy state; the\n // spinner's default \"Loading\" announcement would be redundant.\n label=''\n // `block` overrides Spinner's default `inline` so the svg isn't\n // pushed below centre by the button's line-height; `size-full` fills\n // the icon-sized, self-centred wrapper span.\n svgClassName='block size-full'\n />\n )}\n {renderIconSlot(leadingVisual)}\n {labelWrap === false ? <span className='whitespace-nowrap'>{children}</span> : children}\n {count !== undefined && (\n <span className='rounded-full px-1.5 py-0.5 text-xs font-medium tabular-nums opacity-75'>\n {count}\n {countLabel ? <span className='sr-only'> {countLabel}</span> : null}\n </span>\n )}\n {renderIconSlot(trailingVisual)}\n {renderIconSlot(trailingAction)}\n </TouchTarget>\n )\n}\n\n/**\n * Whether a child tree carries visible text: a non-empty string or a number,\n * at the top level, in an array, or inside a Fragment however deep. Other\n * elements are not looked into — `Children.toArray` flattens arrays but hands\n * a Fragment back whole, so the Fragment case is walked by hand.\n */\nfunction hasTextChild(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((child) => {\n if (typeof child === 'string') return child.trim() !== ''\n if (typeof child === 'number') return true\n if (\n React.isValidElement<{ children?: React.ReactNode }>(child) &&\n child.type === React.Fragment\n ) {\n return hasTextChild(child.props.children)\n }\n return false\n })\n}\n\n/**\n * Dev-only guard shared by `Button` and `ButtonLink`: an icon-only button\n * (`size=\"icon\"` or `iconOnly`) renders no visible text, so it must carry an\n * explicit accessible name. Warns in development when one is missing; a no-op\n * in production. A falsy `aria-label` (including `\"\"`) counts as missing.\n *\n * A text child counts as a label. `size=\"icon\"` is also the square a\n * `PaginationLink` page number sits in, and a bare \"2\" is a visible, readable\n * name — axe accepts it and so does this guard. Only a string or a number\n * qualifies, at the top level or directly inside a fragment or array; an\n * element child is most likely the icon itself, which is the case the guard\n * exists for.\n */\nfunction warnIfIconButtonUnlabelled(\n size: ButtonOwnProps['size'],\n iconOnly: ButtonOwnProps['iconOnly'],\n props: { 'aria-label'?: unknown; 'aria-labelledby'?: unknown },\n children: React.ReactNode,\n) {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (\n (size === 'icon' || iconOnly) &&\n !props['aria-label'] &&\n !props['aria-labelledby'] &&\n !hasTextChild(children)\n ) {\n console.warn(\n '[nswds/ui] Icon-only buttons (size=\"icon\" or iconOnly) have no visible label — pass aria-label or aria-labelledby so the control has an accessible name.',\n )\n }\n}\n\n/**\n * Action button on the Base UI button primitive. For button-styled\n * navigation, use `ButtonLink` — the `href` polymorphism that previously\n * lived on this component was removed in v2.\n *\n * Base UI's `render` prop is available for composition (e.g. rendering a\n * framework-specific element while keeping Button behaviour).\n */\nfunction Button({\n className,\n // Defaulted here rather than left to cva's `defaultVariants` so that\n // `data-variant` below is always present in the DOM. cva resolves its own\n // default internally and emits the right classes either way, but the\n // attribute was simply absent — so the `data-[variant=solid]:` state-overlay\n // rules in `styles.colors` never matched a default `<Button>`. It fell\n // through to the derived overlay in `styles.base` and painted `--btn-bg` at\n // 10% over its own fill, which is the same colour: no visible hover at all.\n variant = 'solid',\n color,\n size,\n iconOnly,\n children,\n block,\n loading,\n alignContent = 'center',\n disabled,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n ref,\n ...props\n}: ButtonProps) {\n const effectiveDisabled = disabled || loading\n\n warnIfIconButtonUnlabelled(size, iconOnly, props, children)\n\n return (\n <ButtonPrimitive\n data-variant={variant}\n aria-busy={loading || undefined}\n {...props}\n disabled={effectiveDisabled}\n className={buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n })}\n ref={ref}\n >\n <ButtonContent\n loading={loading}\n leadingVisual={leadingVisual}\n trailingVisual={trailingVisual}\n trailingAction={trailingAction}\n labelWrap={labelWrap}\n count={count}\n countLabel={countLabel}\n >\n {children}\n </ButtonContent>\n </ButtonPrimitive>\n )\n}\n\n/**\n * Button-styled anchor. Renders through `Link`, so it picks up the\n * framework link component from `LinkProvider` (e.g. next/link) and accepts\n * all anchor props. Disabled/loading states are conveyed with\n * `aria-disabled` and a click guard, since anchors have no `disabled`\n * attribute.\n */\nfunction ButtonLink({\n className,\n // Always emitted as `data-variant` — see the note in `Button`.\n variant = 'solid',\n color,\n size,\n iconOnly,\n children,\n block,\n loading,\n alignContent = 'center',\n disabled,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n ref,\n ...props\n}: ButtonLinkProps) {\n const effectiveDisabled = disabled || loading\n\n warnIfIconButtonUnlabelled(size, iconOnly, props, children)\n\n return (\n <Link\n // Opt out of Link's built-in styling — ButtonLink supplies its own\n // complete visual treatment (background, border, focus ring, icon\n // sizing) and any Link styling layered on top would conflict.\n variant='unstyled'\n data-variant={variant}\n aria-busy={loading || undefined}\n {...props}\n {...(effectiveDisabled\n ? {\n 'aria-disabled': true,\n 'data-disabled': '',\n tabIndex: -1,\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => e.preventDefault(),\n }\n : {})}\n className={buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n })}\n ref={ref}\n >\n <ButtonContent\n loading={loading}\n leadingVisual={leadingVisual}\n trailingVisual={trailingVisual}\n trailingAction={trailingAction}\n labelWrap={labelWrap}\n count={count}\n countLabel={countLabel}\n >\n {children}\n </ButtonContent>\n </Link>\n )\n}\n\n/**\n * Expand the hit area to at least 44×44px on touch devices\n */\nfunction TouchTarget({ children }: { children: React.ReactNode }) {\n return (\n <>\n <span\n className='absolute top-1/2 left-1/2 size-[max(100%,2.75rem)] -translate-x-1/2 -translate-y-1/2 rounded-sm bg-transparent [@media(pointer:fine)]:hidden'\n aria-hidden='true'\n />\n {children}\n </>\n )\n}\n\nexport { Button, ButtonLink, buttonVariants, TouchTarget }\nexport type { ButtonLinkProps, ButtonProps, IconSlot }\n"]}
1
+ {"version":3,"sources":["../../src/components/button.tsx"],"names":["ButtonPrimitive"],"mappings":";;;;;;;;;;AAwBA,MAAM,MAAA,GAAS;AAAA,EACb,IAAA,EAAM;AAAA;AAAA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A,QACV,aAAA,EAAY;AAAA;AAAA,KACd;AAAA,IACC;AAAA,GAAA,EACH,CAAA;AAEJ","file":"button.js","sourcesContent":["'use client'\n\nimport { Button as ButtonPrimitive } from '@base-ui/react/button'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport clsx from 'clsx'\nimport React from 'react'\n\nimport { ButtonGroupContext, type ButtonGroupContextValue } from '../lib/button-group-context.js'\nimport { cn } from '../lib/utils.js'\n\nimport { Link } from '../components/link.js'\nimport { Spinner } from '../components/spinner.js'\n\n/**\n * One entry of `styles.tintInk`: the ink a colour token steps to when its\n * label sits on a tint of itself. Shared by `buttonVariants` and\n * `buttonColorVariants`, which both declare the `onTint` and `color` keys.\n */\ntype TintInkCompound = {\n onTint: true\n color: 'tertiary' | 'accent' | 'success' | 'warning'\n className: string\n}\n\nconst styles = {\n base: [\n // Base\n // Transitioned properties are named, NOT `transition-all`. `all` includes\n // `outline-width` and `outline-offset`, and animating those out of the\n // initial `outline-style: none` state means the width never commits — the\n // focus ring below never painted, on every button in the system, leaving\n // keyboard users the browser default (WCAG 2.4.7). Isolated by bisection:\n // the focus utilities alone settle at 2px/-2px, adding `transition-all`\n // gives 1.5px/0px, and naming properties is fine. Nothing is lost by\n // naming them — no state in this file animates a transform or a size.\n 'relative isolate inline-flex items-baseline justify-center gap-x-2 rounded-sm border text-base/7 font-bold motion-safe:transition-[color,background-color,border-color,box-shadow,opacity]',\n // Height floor, published per size step as `--btn-h` (see `styles.size`).\n // A floor rather than a fixed height so a wrapped label can still grow.\n 'min-h-(--btn-h)',\n // Border width, so the size steps can subtract it from their padding and\n // keep the outer box identical across variants. `outline` and `surface`\n // draw a 2px border and raise this to match; everything else stays 1px.\n // Without it the steps subtracted a hard-coded 1px and those two variants\n // came out 2px taller than `solid` at every step and breakpoint.\n '[--btn-border-w:1px]',\n // Focus — deliberately `focus:` (paints on pointer clicks too), unlike\n // Link/Input which use `focus-visible:`. Buttons give click feedback with\n // the ring; links only ring for keyboard/AT focus. Do not \"unify\" this.\n // The ring is offset 2px, so it lands on the *page* rather than on the\n // button. `--btn-bg` is the ink (see the note above `styles.colors`), which\n // flips for dark mode, so the ring follows the theme for every variant —\n // including `solid`, whose ring used to be its own fill colour and so went\n // near-invisible on a dark surface.\n 'focus:outline focus:outline-2 focus:outline-offset-2 focus:outline-(--btn-bg)',\n // Disabled\n 'data-disabled:opacity-50 data-disabled:pointer-events-none',\n // State overlays, derived from the ink rather than restated per colour.\n // Deriving them means they follow `--btn-bg` wherever it comes from: the\n // colour token, its dark-mode counterpart, or a surface that re-points the\n // ink at its own (`[--btn-bg:var(--footer-ink)]` in footer.tsx and\n // footer-cta.tsx). `solid` overrides both with its white/black pair at\n // `data-[variant=solid]:` — an attribute selector, so it outranks these\n // regardless of source order. `oklab` matches the interpolation space\n // Tailwind's own `/10` alpha modifier emits, so the painted colour is\n // unchanged from when each colour restated these itself.\n '[--btn-hover-overlay:color-mix(in_oklab,var(--btn-bg)_10%,transparent)]',\n '[--btn-active-overlay:color-mix(in_oklab,var(--btn-bg)_20%,transparent)]',\n // Glyph size beside a label: one value for every step and breakpoint.\n // Every step sets `text-base/7`, so the label is 16px whatever the step —\n // only the padding changes. An icon next to it has to match the *text*,\n // not the box, so scaling it per step pairs a growing glyph with type that\n // never moves: at `lg` a 28px icon sat beside a 16px word, two and a half\n // times its cap height. 24px is 1.5x the label at every step, and the same\n // number `size='icon'` uses. `iconOnly` overrides this per step in\n // `compoundVariants` — with no label to match, it scales with its box.\n '[--btn-icon-size:--spacing(6)]',\n // Icon. No vertical margin: the glyph is `self-center` in a baseline-aligned\n // row, so margin buys it nothing optically and only inflates the flex line.\n // It was inert at `sm`/`default` (glyph + margin stayed inside the 1.75rem\n // line box) but pushed `lg` 2px past its own height below `sm:`, so a `lg`\n // button measured 70px with an icon and 68px without.\n '*:data-[slot=icon]:-mx-0.25 *:data-[slot=icon]:size-(--btn-icon-size) *:data-[slot=icon]:shrink-0 *:data-[slot=icon]:self-center *:data-[slot=icon]:text-(--btn-icon) forced-colors:[--btn-icon:ButtonText] forced-colors:hover:[--btn-icon:ButtonText]',\n ],\n solid: [\n // Text color\n 'text-(--btn-text)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-border)',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-fill)',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-fill)',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n soft: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-bg)/10',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-bg)/20',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-bg)/10',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:bg-white/5',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n surface: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-(--btn-bg)/50 border-2 bg-(--btn-bg)/5 [--btn-border-w:2px]',\n // Dark mode: border is rendered on `after` so background is set to button background\n 'dark:bg-(--btn-bg)/30',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-bg)/5',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-(--btn-bg)/50',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // Border color on hover\n 'active:border-(--btn-bg) hover:border-(--btn-bg)',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n outline: [\n // Text color\n 'border-(--btn-bg) text-(--btn-bg) border-2 [--btn-border-w:2px]',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'bg-transparent',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-transparent',\n // Drop shadow, applied to the inset `before` layer so it blends with the border\n 'before:shadow-sm',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-(--btn-bg)',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n ghost: [\n // Text color\n 'text-(--btn-bg)',\n // Optical border, implemented as the button background to avoid corner artifacts\n 'border-transparent bg-(--btn-transparent)',\n // Button background, implemented as foreground layer to stack on top of pseudo-border layer\n 'before:absolute before:inset-0 before:-z-10 before:rounded-[calc(var(--radius-sm)-1px)] before:bg-(--btn-transparent)',\n // Background color is moved to control and shadow is removed in dark mode so hide `before` pseudo\n 'dark:before:hidden',\n // Dark mode: Subtle white outline is applied using a border\n 'dark:border-white/5',\n // Shim/overlay, inset to match button foreground and used for hover state + highlight shadow\n 'after:absolute after:inset-0 after:-z-10 after:rounded-[calc(var(--radius-sm)-1px)]',\n // State overlays\n 'hover:after:bg-(--btn-hover-overlay) active:after:bg-(--btn-active-overlay)',\n // Dark mode: `after` layer expands to cover entire button\n 'dark:after:-inset-px dark:after:rounded-sm',\n // Disabled\n 'data-disabled:before:shadow-none data-disabled:after:shadow-none',\n ],\n link: [\n // Text color — inherits from color token, no background or border\n 'text-(--btn-bg) border-transparent bg-transparent',\n // Halo tokens derive from the colour token via color-mix, mirroring Link\n '[--link-halo:color-mix(in_oklch,var(--btn-bg)_10%,transparent)]',\n '[--link-halo-active:color-mix(in_oklch,var(--btn-bg)_18%,transparent)]',\n // Resting underline, thickened on interaction — matching Link\n 'underline underline-offset-4 hover:decoration-2 active:decoration-2',\n // Hover / active halos match the GOV.UK-style halo on Link (see link.tsx\n // styledBase): the fill is painted on the `after` layer — consistent with\n // the other variants' hover overlays — and the box-shadow extends it 2px\n // above and 4px below the line box\n 'after:absolute after:inset-0 after:-z-10',\n 'hover:after:bg-(--link-halo) active:after:bg-(--link-halo-active)',\n 'hover:shadow-[0_-2px_0_var(--link-halo),0_4px_0_var(--link-halo)]',\n 'active:shadow-[0_-2px_0_var(--link-halo-active),0_4px_0_var(--link-halo-active)]',\n ],\n // Two variables, deliberately separate.\n //\n // `--btn-fill` is the block of colour `solid` paints behind `--btn-text`.\n // `--btn-bg` is the *ink*: the glyph and label on every non-solid variant\n // (`text-(--btn-bg)`), the border on `outline`/`surface`, the tint on\n // `soft`/`surface`, the `link` halos, the state overlays derived in\n // `styles.base`, and the focus ring. They start life the same colour, and\n // part company in two places: dark mode, and — for the four tokens in\n // `styles.tintInk` — on the token's own tint.\n //\n // They used to be one variable, which made the ink un-flippable. The values\n // here are masterbrand palette steps, and palette steps are theme-invariant —\n // `styles.css` re-declares only the *semantic* tokens under\n // `[data-theme=dark], .dark`. Design-system surfaces do flip, though\n // (`Header color='white'` is `bg-white dark:bg-grey-900`), so a non-solid\n // button kept its light-mode ink on a dark surface: `primary-800` on\n // `grey-900` measures 1.32:1, far under the 3:1 WCAG 1.4.11 asks of a UI\n // component, with the overlays and focus ring unpainted for the same reason.\n // Splitting the fill off means `--btn-bg` can flip on its own without\n // repainting `solid`, so the dark counterparts below need no variant scoping\n // and stay at single-class specificity — which is what keeps them overridable\n // by a surface that imposes its own ink (`[--btn-bg:var(--footer-ink)]` in\n // footer.tsx and footer-cta.tsx). Raising their specificity would silently\n // win against those, so keep any future dark value a bare `dark:` utility.\n //\n // `-200` is the package's established ink-on-dark (`--link-color`,\n // `--main-nav-panel-ink`) and clears 10:1 against every dark surface token.\n // `white` and `secondary` are already light inks, so they have no counterpart.\n //\n // Dark values use the raw NSW tokens for the tree-shaking reason spelled out\n // above `danger` below.\n colors: {\n grey: [\n // Base\n '[--btn-fill:var(--color-grey-600)] [--btn-bg:var(--color-grey-600)] [--btn-border:var(--color-grey-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--grey-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n white: [\n // No dark counterpart: white is already the maximum-contrast ink on any\n // dark surface. Surface-conditional in the same way as `secondary` — on a\n // light surface a non-solid `white` button is white on white. See the\n // note on the `color` prop.\n // Base\n '[--btn-fill:var(--color-white)] [--btn-bg:var(--color-white)] [--btn-border:var(--color-white)]/90 [--btn-text:var(--color-grey-800)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-black)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n primary: [\n // Base\n '[--btn-fill:var(--color-primary-800)] [--btn-bg:var(--color-primary-800)] [--btn-border:var(--color-primary-800)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--primary-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n secondary: [\n // No dark counterpart: `primary-200` already *is* the ink the other\n // colours flip to. Like `white`, this token is surface-conditional — it\n // is meant for dark surfaces, where it lands at 15.40:1. As a non-solid\n // ink on a light one it measures ~1.2:1, so that pairing is misuse\n // rather than a defect to fix here. See the note on the `color` prop.\n // Base\n '[--btn-fill:var(--color-primary-200)] [--btn-bg:var(--color-primary-200)] [--btn-border:var(--color-primary-200)]/90 [--btn-text:var(--color-primary-800)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/15',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-primary-800)]/10',\n ],\n tertiary: [\n // Base\n '[--btn-fill:var(--color-primary-600)] [--btn-bg:var(--color-primary-600)] [--btn-border:var(--color-primary-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--primary-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n accent: [\n // Base\n '[--btn-fill:var(--color-accent-600)] [--btn-bg:var(--color-accent-600)] [--btn-border:var(--color-accent-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--accent-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n // Semantic colours use the raw NSW token names (--danger-600, --success-600,\n // --warning-600) rather than Tailwind's `--color-*` bridge aliases. The\n // bridge aliases are tree-shaken by Tailwind v4 unless a matching utility\n // class is detected in scanned source, and arbitrary-property usages like\n // `[--btn-bg:var(--color-success-600)]` do NOT count as a usage signal.\n // The raw tokens are defined on :root by @nswds/tokens (a plain CSS import,\n // not a Tailwind theme), so they always resolve.\n danger: [\n // Base\n '[--btn-fill:var(--danger-600)] [--btn-bg:var(--danger-600)] [--btn-border:var(--danger-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--danger-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n success: [\n // Base\n '[--btn-fill:var(--success-600)] [--btn-bg:var(--success-600)] [--btn-border:var(--success-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--success-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n warning: [\n // Base\n '[--btn-fill:var(--warning-600)] [--btn-bg:var(--warning-600)] [--btn-border:var(--warning-600)]/90 [--btn-text:white]',\n // Dark mode: ink\n 'dark:[--btn-bg:var(--warning-200)]',\n // State: Hover\n 'data-[variant=solid]:[--btn-hover-overlay:var(--color-white)]/10',\n // State: Active\n 'data-[variant=solid]:[--btn-active-overlay:var(--color-black)]/15',\n ],\n },\n // Ink on the tint.\n //\n // `soft` and `surface` paint the label in the ink over a tint of the same\n // ink, and for four tokens that pair cannot carry a label. Their inks are\n // `-600` steps that sit at 4.53–5.18:1 on pure white to begin with, so any\n // tint of themselves takes them under the 4.5:1 WCAG 1.4.3 asks of a 16px\n // bold label: on a 10% band, primary-600 measures 4.00:1, accent-600\n // 4.39:1, success-600 3.96:1 and warning-600 3.96:1, and a lone Button\n // lands lower still (3.49–3.76:1) because its `before` fill layer paints\n // the tint a second time inside the border. No lower tint rescues them —\n // at 3% three of the four still fail — so the tint stays and the ink steps\n // down to `-700`, which measures 7.0:1 or better on the band and 5.9:1 or\n // better on the doubled tint. Not `-800`: for tertiary that is primary's\n // own ink, and a soft tertiary would become a soft primary. Neither step\n // is the ramps' text step (that is `-800`), so the case rests on the\n // measurements, not on a ramp role. The other five tokens keep their ink;\n // their closest pair is danger-600 at 4.71:1.\n //\n // It is `--btn-bg` that steps, not the text colour alone: the tint, the\n // hover and active overlays and the focus ring all derive from it (the\n // Derived State Rule in DESIGN.md). Two things stay outside the step and\n // are known: the press overlay takes a lone soft tertiary to 4.40:1 and a\n // lone soft accent to 4.18:1 for the duration of the press (2.8:1 before),\n // and `outline`, `ghost` and `link` keep the `-600` ink, which clears\n // 4.5:1 on pure white only — on an off-white such as `background-subtle`\n // those three measure 4.15–4.19:1 for the same four tokens.\n //\n // Keyed on `onTint`, not on the variant: a segment of a soft or surface\n // ButtonGroup band sits on the band's tint with `ghost` as its own\n // variant, and it steps its own colour's ink there — a danger segment on a\n // tertiary band stays danger. `buttonVariants` derives `onTint` from the\n // variant for a lone Button; `resolveGroupDefaults` sets it for a segment.\n //\n // These are bare declarations at (0,1,0), so the colour's `dark:` ink at\n // (0,2,0) wins over them exactly as it wins over the light ink above —\n // dark mode is untouched, and its `-200` inks clear 5.8:1 on their tints.\n // The colour's own light ink is not fought in the cascade at all:\n // `buttonVariants` and `buttonColorVariants` merge their class strings\n // before returning them, so one `--btn-bg` declaration reaches the DOM,\n // and a surface that imposes its ink through `className` (footer.tsx) is\n // merged later still.\n //\n // Raw tokens rather than the `--color-*` bridges, for the tree-shaking\n // reason above `danger`: no utility in the package uses the primary,\n // accent, success or warning `-700` steps, so none of those four bridges\n // survives the build (grey-700 does, through step-indicator.tsx). A\n // runtime re-theme that writes only the bridges — Storybook's theme\n // picker — therefore leaves these inks at masterbrand, as it leaves the\n // `dark:` inks; a rebrand that redefines the raw tokens is unaffected.\n // The figures above are for the masterbrand colourway theme.css imports:\n // a colourway swap (AGENTS.md §3) must re-measure this table.\n tintInk: [\n { onTint: true, color: 'tertiary', className: '[--btn-bg:var(--primary-700)]' },\n { onTint: true, color: 'accent', className: '[--btn-bg:var(--accent-700)]' },\n { onTint: true, color: 'success', className: '[--btn-bg:var(--success-700)]' },\n { onTint: true, color: 'warning', className: '[--btn-bg:var(--warning-700)]' },\n ] satisfies TintInkCompound[],\n // Each step publishes its own height as `--btn-h`, built from the same two\n // numbers that produce its box: one line box (`text-base/7` — Tailwind's\n // `/7` is `--spacing(7)`, so this is the same token, not a matching literal)\n // plus twice the vertical padding. `styles.base` pins it with `min-h`, and\n // `styles.iconOnly` reads it as both dimensions of the square — so an\n // icon-only button is exactly as tall as the text button beside it by\n // construction, and stays that way if a step is ever retuned.\n //\n // The border cancels out of that sum: padding is `--spacing(n) -\n // --btn-border-w` and the border adds `--btn-border-w` back, so every\n // variant lands on `--btn-h` whether it draws a 1px or 2px edge, and the\n // outer geometry stays put while the label shifts 1px to make room.\n //\n // The steps set padding and height only. Glyph size lives on the base (one\n // value beside a label) and in `compoundVariants` (per step when icon-only).\n size: {\n default:\n 'px-[calc(--spacing(6)-var(--btn-border-w))] py-[calc(--spacing(4)-var(--btn-border-w))] sm:px-[calc(--spacing(5.5)-var(--btn-border-w))] sm:py-[calc(--spacing(3)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(4)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(3)*2)]',\n sm: 'px-[calc(--spacing(5)-var(--btn-border-w))] py-[calc(--spacing(3)-var(--btn-border-w))] sm:px-[calc(--spacing(4.5)-var(--btn-border-w))] sm:py-[calc(--spacing(2)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(3)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(2)*2)]',\n lg: 'px-[calc(--spacing(7)-var(--btn-border-w))] py-[calc(--spacing(5)-var(--btn-border-w))] sm:px-[calc(--spacing(6.5)-var(--btn-border-w))] sm:py-[calc(--spacing(4)-var(--btn-border-w))] [--btn-h:calc(--spacing(7)+--spacing(5)*2)] sm:[--btn-h:calc(--spacing(7)+--spacing(4)*2)]',\n // A compact chrome square that deliberately sits below the text steps —\n // header actions, dialog close buttons, footer social links. For an icon\n // button that must line up with text buttons beside it, use `iconOnly`\n // with `sm`/`default`/`lg` instead. Its glyph is the base 24px.\n icon: 'w-10 h-10 flex-none [--btn-h:--spacing(10)]',\n },\n // Square the button at the current step and drop the horizontal padding, so\n // the scale step and \"is this icon-only\" are independent axes. The glyph\n // needs no adjustment — the step already sizes it off the ladder.\n iconOnly: 'size-(--btn-h) flex-none p-0 sm:p-0',\n // A segment: this button sits inside a ButtonGroup, which owns the boundary\n // (frame, band, dividers, the 4px corners) and clips to its own radius. The\n // button gives up the parts of its chrome the group now draws. Every rule is\n // keyed on `data-segment` — an attribute selector, (0,2,0) against the\n // variant's (0,1,0) and (0,3,0) against its `dark:` rules — so it wins on\n // specificity, never on emission order (see the two-build note in AGENTS.md\n // §4). InputGroupAction takes the same approach for the same reason.\n segment: [\n // Corners belong to the group. The fill and overlay layers are squared too\n // — left at `calc(var(--radius-sm)-1px)` they notch the shared edges.\n 'data-[segment]:rounded-none data-[segment]:before:rounded-none data-[segment]:after:rounded-none data-[segment]:dark:after:rounded-none',\n // The dark-mode overlay grows 1px to cover the button's own border; inside\n // a group that 1px is the divider, and the hover tint must not paint over it.\n 'data-[segment]:dark:after:inset-0',\n // No shadow: a `shadow-sm` whisper belongs under a button on the page, not\n // under one segment of a control.\n 'data-[segment]:before:shadow-none',\n // A framed group (`outline`, `surface`) draws its frame as an inset ring\n // on the group, which paints beneath its children. A solid segment's own\n // background (the optical border, `bg-(--btn-border)`) would cover that\n // ring on the top and bottom edges, so on those bands backgrounds stop at\n // the padding box and the 1px transparent border lets the frame through.\n // The `before` fill layer is positioned inside the padding box already.\n // Only on framed bands: on `ghost` or `soft` nothing paints beneath that\n // pixel, and clipping there would leave a solid segment 1px short of the\n // group's edge on both sides.\n 'data-[segment]:data-[band=outline]:bg-clip-padding data-[segment]:data-[band=surface]:bg-clip-padding',\n // The group clips its corners (`overflow-hidden`), which would clip a ring\n // sitting 2px outside the button, so the ring moves 2px inside instead —\n // the same inversion the nav rails use inside a scroll container.\n 'data-[segment]:focus:-outline-offset-2',\n // Inside the segment, a ring in the ink on a solid fill is fill on fill:\n // in light mode `--btn-bg` and `--btn-fill` are the same token. So a solid\n // segment rings in its label colour, the pair InputGroupAction's solid\n // variant uses. (0,4,0) against the base ring's (0,2,0). A segment that\n // is not solid keeps the ink ring; on a solid band the rule below re-points\n // its ink to the label colour, so that ring is white there too.\n 'data-[segment]:data-[variant=solid]:focus:outline-(--btn-text)',\n // On a solid band a segment that is not itself solid is painted on the\n // band, so its ink becomes the band's label colour: white label, white/10\n // hover, white ring, and a soft segment's tint becomes white/10 too. The\n // press overlay takes solid's own black/15 so a band and a lone solid\n // Button give the same feedback.\n //\n // The colour comes from `--group-label`, which the GROUP publishes from\n // its own `--btn-text` — resolved at the group, then inherited — so a\n // segment that names its own `color` cannot hijack it through its own\n // `--btn-text` (that would put a `secondary` segment's grey ink on a\n // primary band). And the rule is keyed on `data-band`, which the segment\n // is told by the group through context, never on DOM ancestry: a segment\n // rendered through a trigger's `render` prop, or wrapped in a span for a\n // tooltip, is re-inked like any other. (0,4,0) against the colour token's\n // (0,1,0) and its dark-mode ink at (0,2,0).\n 'data-[segment]:not-data-[variant=solid]:data-[band=solid]:[--btn-bg:var(--group-label)]',\n 'data-[segment]:not-data-[variant=solid]:data-[band=solid]:[--btn-active-overlay:var(--color-black)]/15',\n // ...and it loses its own tint there. `soft` is the only non-solid variant\n // that can reach this rule with a fill of its own (`surface` is not a\n // segment emphasis, `ghost` paints nothing), and it paints TWO 10% layers\n // — its element background and its `before` fill. Re-inked to the label\n // colour those become white on white, and white/10 twice over lifts the\n // band under the label just enough to break it: on the four bands whose\n // white label already sits near the floor the pair measures 3.37:1\n // (success), 3.39:1 (warning), 3.41:1 (tertiary) and 4.15:1 (accent),\n // against 4.53:1 to 5.18:1 for the same bands with the tint gone. So a\n // soft segment on a solid band reads as the ghost segments beside it do,\n // and its emphasis is carried by `data-variant` for the seam rules rather\n // than by a fill. Three attribute selectors, (0,3,0), so it beats both\n // soft's own bare `bg-(--btn-bg)/10` and its `dark:` pair on specificity\n // rather than on emission order (AGENTS.md §4).\n 'data-[segment]:not-data-[variant=solid]:data-[band=solid]:bg-transparent',\n 'data-[segment]:not-data-[variant=solid]:data-[band=solid]:before:bg-transparent',\n ],\n}\n\nconst buttonCva = cva(styles.base, {\n variants: {\n variant: {\n solid: styles.solid,\n soft: styles.soft,\n surface: styles.surface,\n outline: styles.outline,\n ghost: styles.ghost,\n link: styles.link,\n },\n color: {\n white: styles.colors.white,\n grey: styles.colors.grey,\n primary: styles.colors.primary,\n secondary: styles.colors.secondary,\n tertiary: styles.colors.tertiary,\n accent: styles.colors.accent,\n danger: styles.colors.danger,\n success: styles.colors.success,\n warning: styles.colors.warning,\n },\n size: {\n default: styles.size.default,\n sm: styles.size.sm,\n lg: styles.size.lg,\n icon: styles.size.icon,\n },\n // Declared after `size` so its `p-0` reaches `cn()` downstream of the\n // step's `px-*`/`py-*` and wins the tailwind-merge conflict.\n iconOnly: {\n true: styles.iconOnly,\n false: '',\n },\n // Whether the label sits on a tint of its own ink: a lone `soft` or\n // `surface` Button, or any non-solid segment of a soft or surface\n // ButtonGroup band. `buttonVariants` derives it from the variant when a\n // caller leaves it unset; `resolveGroupDefaults` sets it for a segment.\n onTint: {\n true: '',\n false: '',\n },\n },\n compoundVariants: [\n // ── Ink on the tint ──────────────────────────────────────────────────\n //\n // See `styles.tintInk`. The colour's own `--btn-bg` is still in this\n // string; `buttonVariants` merges the two before returning.\n ...styles.tintInk,\n // ── Icon-only glyph sizes ────────────────────────────────────────────\n //\n // With no label beside it the glyph has nothing to match, so here — and\n // only here — it scales with its box, off the icon ladder: 20 / 24 / 28 /\n // 32 / 36 / 40px, i.e. `--spacing(5)` through `--spacing(10)`. Every level\n // is a multiple of 4, so glyphs share the grid with the padding and\n // heights around them and land on whole device pixels at 1x. A discrete\n // ladder rather than a proportion of the box, because a glyph is only\n // crisp at the sizes it was drawn for — \"40% of the box\" would ask for\n // sizes no glyph exists at.\n //\n // One value per step, not per breakpoint: the square never gets smaller\n // on a wider viewport, so neither should what sits inside it.\n { size: 'sm', iconOnly: true, className: '[--btn-icon-size:--spacing(5)]' },\n { size: 'default', iconOnly: true, className: '[--btn-icon-size:--spacing(6)]' },\n { size: 'lg', iconOnly: true, className: '[--btn-icon-size:--spacing(7)]' },\n // The link variant reads as an inline Link despite the <button> tag:\n // strip the button chrome (padding from `size`, border, radius, bold\n // weight) and adopt Link's typography and 1em icon sizing so the hover\n // halo hugs the text instead of filling a button-shaped box.\n {\n variant: 'link',\n className: [\n 'rounded-none border-0 p-0 sm:p-0',\n // Release the step's height floor too — an inline link hugs its line\n // box, it does not stand a button's worth of space tall.\n 'min-h-0',\n // Hug the label even in stretching grid/flex contexts so the hover\n // halo wraps the text like an inline Link, not the allocated box.\n // `block` still wins — its w-full is applied after this in cn().\n 'w-fit',\n 'text-[length:inherit] font-medium',\n '*:data-[slot=icon]:size-[1em]',\n ],\n },\n ],\n defaultVariants: {\n variant: 'solid',\n color: 'primary',\n size: 'default',\n onTint: false,\n },\n})\n\n/** The props `buttonVariants` takes: the cva's own. */\ntype ButtonVariantProps = NonNullable<Parameters<typeof buttonCva>[0]>\n\n/**\n * The variants that paint the label on a tint of its own ink. A lone Button\n * in one of these is on the tint; so is every non-solid segment of a\n * ButtonGroup band in one of these, whatever the segment's own variant.\n */\nconst TINT_VARIANTS: ReadonlySet<string | null | undefined> = new Set(['soft', 'surface'])\n\n/**\n * Button's class string. A thin wrapper over the cva so that two things hold\n * for every caller, not only for `Button` itself: `onTint` defaults to\n * whether the variant is one that paints its label on a tint, so a caller\n * styling its own element with `buttonVariants({ variant: 'soft', … })` gets\n * the stepped ink without knowing about it; and the string is merged before\n * it is returned. The cva's output carries both the colour's own `--btn-bg`\n * and, on the tint, the stepped one from `styles.tintInk`. `cn` keeps the\n * later, so one declaration reaches the DOM and the pair is settled at the\n * class-string level, never by stylesheet order — the two-build hazard in\n * AGENTS.md §4 needs two rules in the cascade, and this leaves it one.\n */\nfunction buttonVariants({ onTint, ...props }: ButtonVariantProps = {}) {\n return cn(buttonCva({ ...props, onTint: onTint ?? TINT_VARIANTS.has(props.variant) }))\n}\n\nconst buttonColorCva = cva('', {\n variants: {\n color: styles.colors,\n // The band: a soft or surface group paints its tint from its own\n // `--btn-bg`, so it is on the tint the way its segments are.\n onTint: {\n true: '',\n false: '',\n },\n },\n compoundVariants: styles.tintInk,\n defaultVariants: { color: 'primary', onTint: false },\n})\n\n/**\n * Button's colour tokens on their own — the `--btn-fill` / `--btn-bg` /\n * `--btn-border` / `--btn-text` pair for each token, with the dark-mode ink\n * flip and, on the tint, the stepped ink those tints need (`styles.tintInk`).\n * ButtonGroup applies this to itself so the frame, band and dividers it draws\n * take the same ink its segments do, and a group's `color` means exactly what\n * a Button's does. Takes the group's `variant` and derives `onTint` from it\n * as `buttonVariants` does, and merges the string for the same reason.\n */\nfunction buttonColorVariants({\n variant,\n onTint,\n ...props\n}: NonNullable<Parameters<typeof buttonColorCva>[0]> & {\n variant?: ButtonVariantProps['variant']\n} = {}) {\n return cn(buttonColorCva({ ...props, onTint: onTint ?? TINT_VARIANTS.has(variant) }))\n}\n\n/**\n * The child variants that carry their own fill into a group. `surface` is\n * not among them: its 2px ink/50 border would stay on the segment's free\n * edges inside the group's own 1px frame, and inside a band it would draw a\n * box on the fill. `soft` and `solid` have transparent borders, so they sit\n * flush.\n */\nconst EMPHASISED_SEGMENT_VARIANTS = new Set<ButtonOwnProps['variant']>(['solid', 'soft'])\n\n/**\n * An icon slot. Takes either form:\n *\n * - the component itself — `leadingVisual={IconDownload}`\n * - a rendered element — `leadingVisual={<IconDownload />}`\n *\n * **From a React Server Component, use the element form.** `Button` and\n * `ButtonLink` are `'use client'` modules, while the icon modules carry no\n * directive — deliberately, so an icon stays server-renderable and ships no\n * JavaScript. That means in a server component `IconDownload` is an ordinary\n * function value, and functions cannot cross the RSC boundary into a client\n * component (\"Functions cannot be passed directly to Client Components\"). A\n * React element can, because it serialises. Client components can use either.\n */\ntype IconSlot = React.ElementType | React.ReactElement\n\n/**\n * Renders an icon slot in whichever form it arrived, stamping `data-slot='icon'`\n * so the `*:data-[slot=icon]:…` rules above size and colour it. An element that\n * sets its own `data-slot` to an actual value keeps it — a consumer who named one\n * deliberately meant it. `undefined` and `null` count as unset and get the stamp,\n * because forwarding an optional prop that happens to be absent is idiomatic React\n * and must not silently strip the icon's sizing and colour.\n *\n * Passing only the key we intend to set is deliberate: `cloneElement` already seeds\n * its props from `slot.props`, so spreading them back into the config would be a\n * no-op — except that React 19 copies every config key across with no undefined-skip\n * (`defaultProps` having been removed), which is exactly how a forwarded\n * `data-slot={undefined}` would erase the stamp.\n */\nfunction renderIconSlot(slot: IconSlot | undefined | null): React.ReactNode {\n if (!slot) return null\n if (React.isValidElement<{ 'data-slot'?: string }>(slot)) {\n return React.cloneElement(slot, { 'data-slot': slot.props['data-slot'] ?? 'icon' })\n }\n // `isValidElement` is a type guard, but its false branch does not subtract\n // ReactElement from the union — TS keeps both members — so name the remaining\n // case explicitly. Anything that is not a valid element is a component type.\n const Icon = slot as React.ElementType\n return <Icon data-slot='icon' />\n}\n\n/** Visual/content props shared by `Button` and `ButtonLink`. */\ntype ButtonOwnProps = Omit<\n VariantProps<typeof buttonVariants>,\n 'size' | 'iconOnly' | 'color' | 'onTint'\n> & {\n /**\n * Colour token. Most are safe on any surface: the non-solid variants take\n * their ink from the token and it flips for dark mode, so `primary` reads\n * correctly on a light page and on a dark one.\n *\n * `white` and `secondary` are the exceptions — both are\n * **surface-conditional, for dark surfaces only**. Their inks (`white` and\n * `primary-200`) are already light, which is what makes them right on a\n * dark surface and unusable on a light one: a non-solid button in either\n * colour measures around 1.2:1 on white, against the 3:1 WCAG 1.4.11 asks\n * of a UI component. Reach for them the way `Hero` does — over a\n * `primary-800` panel — and use `primary` on a light or theme-flipping\n * surface. `solid` is unaffected either way, since it pairs `--btn-fill`\n * with `--btn-text` rather than painting the ink.\n *\n * On a tint — `soft`, `surface`, or any non-solid segment of a soft or\n * surface ButtonGroup — `tertiary`, `accent`, `success` and `warning` step\n * to their `-700` ink so the label clears 4.5:1; see `styles.tintInk`.\n */\n color?:\n | 'white'\n | 'grey'\n | 'primary'\n | 'secondary'\n | 'tertiary'\n | 'accent'\n | 'danger'\n | 'success'\n | 'warning'\n | null\n /**\n * Scale step. `sm` / `default` / `lg` render 52 / 60 / 68px tall below\n * `sm:` and 44 / 52 / 60px at or above it. The step changes padding only —\n * the label is 16px and an icon beside it 24px at every step.\n *\n * `icon` is not a fourth step on that ramp — it is a flat 40×40 chrome\n * square (header actions, dialog close buttons, footer social links) that\n * lines up with none of them. For an icon-only button that must sit level\n * with text buttons beside it, pair `iconOnly` with `sm`/`default`/`lg`.\n * Inside a ButtonGroup `icon` renders exactly that way, as `iconOnly` at\n * the group's own step: the group clips to its own box, so the square's\n * 44px touch expansion would be cut off.\n */\n size?: 'sm' | 'default' | 'lg' | 'icon' | null\n /**\n * Render as a square containing only the icon, at the height of the current\n * `size` step — so `iconOnly` beside a `size='default'` button matches it\n * exactly. Supply an `aria-label`, since there is no visible text.\n *\n * With no label to match, the glyph scales with the square instead of\n * holding the 24px used beside text: 20px at `sm`, 24px at `default`, 28px\n * at `lg`, the same at every breakpoint. For a denser icon button that does\n * not line up with the text steps, use `size='icon'` (24px in a 40×40 box).\n */\n iconOnly?: boolean | null\n className?: string\n /** Button label. Optional for icon-only buttons (supply an `aria-label`). */\n children?: React.ReactNode\n /** Stretch button to fill its container width. */\n block?: boolean\n /** Show a spinner and disable interaction. */\n loading?: boolean\n /** Horizontal alignment of button content. */\n alignContent?: 'center' | 'start'\n disabled?: boolean\n /** Icon rendered before the label. Component or element — see `IconSlot`. */\n leadingVisual?: IconSlot\n /** Icon rendered after the label. Component or element — see `IconSlot`. */\n trailingVisual?: IconSlot\n /** Icon rendered as a trailing action (far end). Component or element. */\n trailingAction?: IconSlot\n /** Allow the button label to wrap onto multiple lines. Defaults to true. */\n labelWrap?: boolean\n /** Optional numeric badge rendered after the label. */\n count?: number\n /**\n * Visually-hidden suffix announced after `count`, giving the bare number\n * context for screen readers (e.g. \"unread messages\" → \"Inbox 3 unread\n * messages\").\n */\n countLabel?: string\n}\n\ntype ButtonProps = ButtonOwnProps & Omit<ButtonPrimitive.Props, 'className' | 'disabled'>\n\ntype ButtonLinkProps = ButtonOwnProps &\n Omit<React.ComponentPropsWithoutRef<typeof Link>, 'className' | 'variant'> & {\n ref?: React.Ref<HTMLAnchorElement>\n }\n\nfunction buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n segment,\n onTint,\n}: ButtonOwnProps & { effectiveDisabled?: boolean; segment?: SegmentKind; onTint?: boolean }) {\n return clsx(\n cn(\n buttonVariants({ variant, color, size, iconOnly, onTint }),\n segment && styles.segment,\n block && 'w-full',\n alignContent === 'start' && 'justify-start',\n className,\n ),\n effectiveDisabled ? 'cursor-not-allowed' : 'cursor-pointer',\n )\n}\n\n/**\n * How a Button relates to the ButtonGroup around it, emitted as\n * `data-segment` for the segment styles to key on: `default` when it took\n * its variant from the group, `override` when it named its own emphasis.\n * Absent outside a group.\n */\ntype SegmentKind = 'default' | 'override'\n\n/** The context, with `color` and `size` narrowed to Button's own unions. */\ntype GroupDefaults = ButtonGroupContextValue<\n NonNullable<ButtonOwnProps['color']>,\n NonNullable<ButtonOwnProps['size']>\n>\n\n/**\n * Resolves the variant, colour and size a Button renders with, from its own\n * props first and the enclosing ButtonGroup second.\n *\n * Outside a group the variant is resolved here rather than left to cva's\n * `defaultVariants` so that `data-variant` is always present in the DOM. cva\n * resolves its own default internally and emits the right classes either\n * way, but the attribute was simply absent — so the `data-[variant=solid]:`\n * state-overlay rules in `styles.colors` never matched a default `<Button>`.\n * It fell through to the derived overlay in `styles.base` and painted\n * `--btn-bg` at 10% over its own fill, which is the same colour: no visible\n * hover at all.\n *\n * Inside a group the group's `color` and `size` become the defaults, and a\n * segment renders as `ghost` whatever the group's variant, because the group\n * paints the frame or band and the segment only paints its label and its\n * hover overlay on top — so a child written as `variant='outline'` inside an\n * outline group (the shadcn idiom, and the previous stories) draws no second\n * border, and `link` gets button chrome like any other segment. A child that\n * asks for emphasis keeps it: `solid` and `soft` paint their own fill, which\n * is how a Save stays solid inside an outline group.\n */\nfunction resolveGroupDefaults(\n group: GroupDefaults | null,\n {\n variant,\n color,\n size,\n iconOnly,\n }: Pick<ButtonOwnProps, 'variant' | 'color' | 'size' | 'iconOnly'>,\n) {\n if (!group) {\n return {\n variant: variant ?? 'solid',\n color,\n size,\n iconOnly,\n segment: undefined,\n band: undefined,\n onTint: undefined,\n }\n }\n const emphasised = EMPHASISED_SEGMENT_VARIANTS.has(variant)\n const resolvedSize = size ?? group.size\n // `icon` is the 40px chrome square, which the group cannot hold: it clips to\n // its own box, so the 44px touch expansion the square relies on would be cut\n // off. Inside a group it becomes an icon-only segment at the GROUP's step\n // instead, which is the only step that lines up with the segments beside it.\n //\n // Not a literal `sm`: `styles.iconOnly` sets `size-(--btn-h)`, a definite\n // cross size, so `items-stretch` on the group cannot stretch it back. A\n // square pinned to `sm` inside a `default` group is 8px short (16px at\n // `lg`), sitting flush to the top of the row with a void beneath it and a\n // divider that stops before the group's bottom edge. Applies whether the\n // segment named `icon` itself or inherited it from an untyped group, which\n // is also why the group's own step is read back through the same guard.\n const iconStep = resolvedSize === 'icon'\n const groupStep = group.size === 'icon' ? undefined : group.size\n const resolved = emphasised ? variant : 'ghost'\n return {\n variant: resolved,\n color: color ?? group.color,\n size: iconStep ? (groupStep ?? 'default') : resolvedSize,\n // `??`, not `||`: an explicit `iconOnly={false}` is the author saying\n // \"not a square\", and the `icon` coercion must not overrule it. Only an\n // unstated `iconOnly` falls through to the coercion.\n iconOnly: iconOnly ?? iconStep,\n segment: emphasised ? ('override' as const) : ('default' as const),\n band: group.band,\n // On a soft or surface band every segment that is not solid sits on the\n // band's tint whatever its own variant, so its ink steps as a lone soft\n // Button's does (`styles.tintInk`) — its own colour's ink, not the\n // band's: the group's colour is a default, never an override, so a\n // danger segment on a tertiary band stays danger. The band is the group's\n // own variant, which is what `band` carries.\n onTint: resolved !== 'solid' && TINT_VARIANTS.has(group.band),\n }\n}\n\n/**\n * `resolveGroupDefaults` against the enclosing ButtonGroup, if any. The\n * context types `band`, `color` and `size` as strings so its module can ship\n * with every popup (see button-group-context.tsx); only ButtonGroup provides\n * it, from props typed with Button's own unions, so the narrowing here is\n * sound.\n */\nfunction useSegmentDefaults(\n props: Pick<ButtonOwnProps, 'variant' | 'color' | 'size' | 'iconOnly'>,\n) {\n const group = React.useContext(ButtonGroupContext) as GroupDefaults | null\n const resolved = resolveGroupDefaults(group, props)\n warnIfIconStepInGroup(group, props.size ?? group?.size)\n return resolved\n}\n\n/** Shared inner layout: spinner, visuals, label, count, touch target. */\nfunction ButtonContent({\n loading,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n children,\n}: Pick<\n ButtonOwnProps,\n | 'loading'\n | 'leadingVisual'\n | 'trailingVisual'\n | 'trailingAction'\n | 'labelWrap'\n | 'count'\n | 'countLabel'\n | 'children'\n>) {\n return (\n <TouchTarget>\n {loading && (\n <Spinner\n data-slot='icon'\n role={undefined}\n aria-hidden\n color='current'\n // The button's own label + aria-busy convey the busy state; the\n // spinner's default \"Loading\" announcement would be redundant.\n label=''\n // `block` overrides Spinner's default `inline` so the svg isn't\n // pushed below centre by the button's line-height; `size-full` fills\n // the icon-sized, self-centred wrapper span.\n svgClassName='block size-full'\n />\n )}\n {renderIconSlot(leadingVisual)}\n {labelWrap === false ? <span className='whitespace-nowrap'>{children}</span> : children}\n {count !== undefined && (\n <span className='rounded-full px-1.5 py-0.5 text-xs font-medium tabular-nums opacity-75'>\n {count}\n {countLabel ? <span className='sr-only'> {countLabel}</span> : null}\n </span>\n )}\n {renderIconSlot(trailingVisual)}\n {renderIconSlot(trailingAction)}\n </TouchTarget>\n )\n}\n\n/**\n * Whether a child tree carries visible text: a non-empty string or a number,\n * at the top level, in an array, or inside a Fragment however deep. Other\n * elements are not looked into — `Children.toArray` flattens arrays but hands\n * a Fragment back whole, so the Fragment case is walked by hand.\n */\nfunction hasTextChild(children: React.ReactNode): boolean {\n return React.Children.toArray(children).some((child) => {\n if (typeof child === 'string') return child.trim() !== ''\n if (typeof child === 'number') return true\n if (\n React.isValidElement<{ children?: React.ReactNode }>(child) &&\n child.type === React.Fragment\n ) {\n return hasTextChild(child.props.children)\n }\n return false\n })\n}\n\n/**\n * Dev-only guard shared by `Button` and `ButtonLink`: an icon-only button\n * (`size=\"icon\"` or `iconOnly`) renders no visible text, so it must carry an\n * explicit accessible name. Warns in development when one is missing; a no-op\n * in production. A falsy `aria-label` (including `\"\"`) counts as missing.\n *\n * A text child counts as a label. `size=\"icon\"` is also the square a\n * `PaginationLink` page number sits in, and a bare \"2\" is a visible, readable\n * name — axe accepts it and so does this guard. Only a string or a number\n * qualifies, at the top level or directly inside a fragment or array; an\n * element child is most likely the icon itself, which is the case the guard\n * exists for.\n */\nfunction warnIfIconButtonUnlabelled(\n size: ButtonOwnProps['size'],\n iconOnly: ButtonOwnProps['iconOnly'],\n props: { 'aria-label'?: unknown; 'aria-labelledby'?: unknown },\n children: React.ReactNode,\n) {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (\n (size === 'icon' || iconOnly) &&\n !props['aria-label'] &&\n !props['aria-labelledby'] &&\n !hasTextChild(children)\n ) {\n console.warn(\n '[nswds/ui] Icon-only buttons (size=\"icon\" or iconOnly) have no visible label — pass aria-label or aria-labelledby so the control has an accessible name.',\n )\n }\n}\n\n/**\n * Dev-only nudge for a segment that asked for the `icon` step: inside a group\n * it renders as `iconOnly` at the group's own step (see\n * `resolveGroupDefaults`), so the author should say that instead of relying\n * on the coercion.\n */\nfunction warnIfIconStepInGroup(group: GroupDefaults | null, size: ButtonOwnProps['size']) {\n if (process.env.NODE_ENV === 'production') {\n return\n }\n if (group && size === 'icon') {\n console.warn(\n '[nswds/ui] size=\"icon\" inside a ButtonGroup renders as iconOnly at the group\\'s own step, so the square lines up with the segments beside it: the group clips its box, so the 40px square would lose its 44px touch target. Pair iconOnly with the group\\'s size instead.',\n )\n }\n}\n\n/**\n * Action button on the Base UI button primitive. For button-styled\n * navigation, use `ButtonLink` — the `href` polymorphism that previously\n * lived on this component was removed in v2.\n *\n * Base UI's `render` prop is available for composition (e.g. rendering a\n * framework-specific element while keeping Button behaviour).\n */\nfunction Button({\n className,\n variant: variantProp,\n color: colorProp,\n size: sizeProp,\n iconOnly: iconOnlyProp,\n children,\n block,\n loading,\n alignContent = 'center',\n disabled,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n ref,\n ...props\n}: ButtonProps) {\n const effectiveDisabled = disabled || loading\n // Always emitted as `data-variant`, and group-aware — see resolveGroupDefaults.\n const { variant, color, size, iconOnly, segment, band, onTint } = useSegmentDefaults({\n variant: variantProp,\n color: colorProp,\n size: sizeProp,\n iconOnly: iconOnlyProp,\n })\n\n warnIfIconButtonUnlabelled(size, iconOnly, props, children)\n\n return (\n <ButtonPrimitive\n data-slot='button'\n data-variant={variant}\n data-segment={segment}\n data-band={band}\n // Read by ButtonGroup, which has to undo the square on its CROSS axis —\n // `styles.iconOnly` sets both dimensions, and a definite cross size is\n // exactly what stops `items-stretch` reaching the segment.\n data-icon-only={iconOnly || undefined}\n aria-busy={loading || undefined}\n {...props}\n disabled={effectiveDisabled}\n className={buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n segment,\n onTint,\n })}\n ref={ref}\n >\n <ButtonContent\n loading={loading}\n leadingVisual={leadingVisual}\n trailingVisual={trailingVisual}\n trailingAction={trailingAction}\n labelWrap={labelWrap}\n count={count}\n countLabel={countLabel}\n >\n {children}\n </ButtonContent>\n </ButtonPrimitive>\n )\n}\n\n/**\n * Button-styled anchor. Renders through `Link`, so it picks up the\n * framework link component from `LinkProvider` (e.g. next/link) and accepts\n * all anchor props. Disabled/loading states are conveyed with\n * `aria-disabled` and a click guard, since anchors have no `disabled`\n * attribute.\n */\nfunction ButtonLink({\n className,\n variant: variantProp,\n color: colorProp,\n size: sizeProp,\n iconOnly: iconOnlyProp,\n children,\n block,\n loading,\n alignContent = 'center',\n disabled,\n leadingVisual,\n trailingVisual,\n trailingAction,\n labelWrap,\n count,\n countLabel,\n ref,\n ...props\n}: ButtonLinkProps) {\n const effectiveDisabled = disabled || loading\n // Always emitted as `data-variant`, and group-aware — see resolveGroupDefaults.\n const { variant, color, size, iconOnly, segment, band, onTint } = useSegmentDefaults({\n variant: variantProp,\n color: colorProp,\n size: sizeProp,\n iconOnly: iconOnlyProp,\n })\n\n warnIfIconButtonUnlabelled(size, iconOnly, props, children)\n\n return (\n <Link\n // Opt out of Link's built-in styling — ButtonLink supplies its own\n // complete visual treatment (background, border, focus ring, icon\n // sizing) and any Link styling layered on top would conflict.\n variant='unstyled'\n data-slot='button'\n data-variant={variant}\n data-segment={segment}\n data-band={band}\n // Read by ButtonGroup, which has to undo the square on its CROSS axis —\n // `styles.iconOnly` sets both dimensions, and a definite cross size is\n // exactly what stops `items-stretch` reaching the segment.\n data-icon-only={iconOnly || undefined}\n aria-busy={loading || undefined}\n {...props}\n {...(effectiveDisabled\n ? {\n 'aria-disabled': true,\n 'data-disabled': '',\n tabIndex: -1,\n onClick: (e: React.MouseEvent<HTMLAnchorElement>) => e.preventDefault(),\n }\n : {})}\n className={buttonClasses({\n variant,\n color,\n size,\n iconOnly,\n block,\n alignContent,\n className,\n effectiveDisabled,\n segment,\n onTint,\n })}\n ref={ref}\n >\n <ButtonContent\n loading={loading}\n leadingVisual={leadingVisual}\n trailingVisual={trailingVisual}\n trailingAction={trailingAction}\n labelWrap={labelWrap}\n count={count}\n countLabel={countLabel}\n >\n {children}\n </ButtonContent>\n </Link>\n )\n}\n\n/**\n * Expand the hit area to at least 44×44px on touch devices\n */\nfunction TouchTarget({ children }: { children: React.ReactNode }) {\n return (\n <>\n <span\n className='absolute top-1/2 left-1/2 size-[max(100%,2.75rem)] -translate-x-1/2 -translate-y-1/2 rounded-sm bg-transparent [@media(pointer:fine)]:hidden'\n aria-hidden='true'\n />\n {children}\n </>\n )\n}\n\nexport { Button, buttonColorVariants, ButtonLink, buttonVariants, TouchTarget }\nexport type { ButtonLinkProps, ButtonProps, IconSlot }\n"]}
@@ -25,7 +25,7 @@ type CalloutStatus = 'info' | 'success' | 'warning' | 'danger';
25
25
  * drift out of step with the token library.
26
26
  */
27
27
  declare const calloutVariants: (props?: ({
28
- status?: "danger" | "success" | "warning" | "info" | null | undefined;
28
+ status?: "success" | "warning" | "danger" | "info" | null | undefined;
29
29
  } & class_variance_authority_types.ClassProp) | undefined) => string;
30
30
  type CalloutProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'title'> & VariantProps<typeof calloutVariants> & {
31
31
  /** Optional bold lead line above the body copy. */
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { IconCheck } from '../icons/check.js';
6
6
  import { IconClose } from '../icons/close.js';
7
7
  import { IconExpandMore } from '../icons/expand-more.js';
8
+ import { ButtonGroupBoundary } from '../lib/button-group-context.js';
8
9
  import { cn } from '../lib/utils.js';
9
10
  import { Button } from './button.js';
10
11
  import { InputGroup, InputGroupInput, InputGroupAddon, InputGroupButton } from './input-group.js';
@@ -77,7 +78,7 @@ function ComboboxContent({
77
78
  anchor,
78
79
  ...props
79
80
  }) {
80
- return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(
81
+ return /* @__PURE__ */ jsx(Combobox$1.Portal, { children: /* @__PURE__ */ jsx(ButtonGroupBoundary, { children: /* @__PURE__ */ jsx(
81
82
  Combobox$1.Positioner,
82
83
  {
83
84
  side,
@@ -99,7 +100,7 @@ function ComboboxContent({
99
100
  }
100
101
  )
101
102
  }
102
- ) });
103
+ ) }) });
103
104
  }
104
105
  function ComboboxList({ className, ...props }) {
105
106
  return /* @__PURE__ */ jsx(
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/combobox.tsx"],"names":["ComboboxPrimitive"],"mappings":";;;;;;;;;;AAYA,MAAM,WAAWA,UAAA,CAAkB;AAEnC,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAkC;AAClE,EAAA,2BAAQA,UAAA,CAAkB,KAAA,EAAlB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEA,SAAS,gBAAgB,EAAE,SAAA,EAAW,QAAA,EAAU,GAAG,OAAM,EAAoC;AAC3F,EAAA,uBACE,IAAA;AAAA,IAACA,UAAA,CAAkB,OAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,kBAAA;AAAA,MACV,YAAA,EAAW,kBAAA;AAAA,MACX,SAAA,EAAW,EAAA,CAAG,wCAAA,EAA0C,SAAS,CAAA;AAAA,MAChE,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,wBACD,GAAA,CAAC,cAAA,EAAA,EAAe,S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wBAAQ,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,OAAA,EAAQ,MAAK,MAAA,EAAO,CAAA;AAAA,YAC5C,YAAA,EAAY,WAAA;AAAA,YACZ,SAAA,EAAU,oCAAA;AAAA,YACV,WAAA,EAAU,sBAAA;AAAA,YAEV,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,qBAAA,EAAsB;AAAA;AAAA;AAC7C;AAAA;AAAA,GAEJ;AAEJ;AAEA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkC;AAClF,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,KAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,8BAAA,EAAgC,SAAS,CAAA;AAAA,MACtD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,GAAoB;AAC3B,EAAA,OAAO,KAAA,CAAM,OAA8B,IAAI,CAAA;AACjD","file":"combobox.js","sourcesContent":["'use client'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport * as React from 'react'\n\nimport { IconCheck } from '../icons/check.js'\nimport { IconClose } from '../icons/close.js'\nimport { IconExpandMore } from '../icons/expand-more.js'\nimport { cn } from '../lib/utils.js'\nimport { Button } from './button.js'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group.js'\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot='combobox-value' {...props} />\n}\n\nfunction ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot='combobox-trigger'\n aria-label='Show suggestions'\n className={cn(\"[&_svg:not([class*='size-'])]:size-3.5\", className)}\n {...props}\n >\n {children}\n <IconExpandMore className='pointer-events-none size-3.5 text-muted-foreground' />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot='combobox-clear'\n aria-label='Clear'\n render={<InputGroupButton variant='ghost' size='icon-xs' />}\n className={cn(className)}\n {...props}\n >\n <IconClose className='pointer-events-none' />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn('w-auto', className)}>\n <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align='inline-end'>\n {showTrigger && (\n <InputGroupButton\n size='icon-xs'\n variant='ghost'\n render={<ComboboxTrigger />}\n data-slot='input-group-button'\n className='group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent'\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'\n >) {\n return (\n <ComboboxPrimitive.Portal>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className='isolate z-50'\n >\n <ComboboxPrimitive.Popup\n data-slot='combobox-content'\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot='combobox-list'\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot='combobox-item'\n className={cn(\n \"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-sm px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5\",\n className,\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className='pointer-events-none absolute end-2 flex items-center justify-center' />\n }\n >\n <IconCheck className='pointer-events-none' />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return <ComboboxPrimitive.Group data-slot='combobox-group' className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot='combobox-label'\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return <ComboboxPrimitive.Collection data-slot='combobox-collection' {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot='combobox-empty'\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground group-data-empty/combobox-content:flex',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot='combobox-separator'\n className={cn('-mx-1 my-1 h-px bg-border/50', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot='combobox-chips'\n className={cn(\n 'flex min-h-7 flex-wrap items-center gap-1 rounded-sm border border-input bg-input/20 bg-clip-padding px-2 py-0.5 text-xs/relaxed transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30 has-aria-invalid:border-destructive has-aria-invalid:ring-2 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n removeLabel = 'Remove',\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n /**\n * Screen-reader name for the chip's remove button. Override to translate it\n * — the button is icon-only, so this string is the only name AT ever hears.\n * Include the chip's own text where a bare \"Remove\" would be ambiguous in a\n * list of chips.\n */\n removeLabel?: string\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot='combobox-chip'\n className={cn(\n 'flex h-[calc(--spacing(4.75))] w-fit items-center justify-center gap-1 rounded-[calc(var(--radius-sm)-2px)] bg-muted-foreground/10 px-1.5 text-xs/relaxed font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0',\n className,\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant='ghost' size='icon' />}\n aria-label={removeLabel}\n className='-ms-1 opacity-50 hover:opacity-100'\n data-slot='combobox-chip-remove'\n >\n <IconClose className='pointer-events-none' />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot='combobox-chip-input'\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"]}
1
+ {"version":3,"sources":["../../src/components/combobox.tsx"],"names":["ComboboxPrimitive"],"mappings":";;;;;;;;;;;AAaA,MAAM,WAAWA,UAAA,CAAkB;AAEnC,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAkC;AAClE,EAAA,2BAA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,MACC,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,YAAA,CAAa;AAAA,EACpB,SAAA;AAAA,EACA,QAAA;AAAA,EACA,UAAA,GAAa,IAAA;AAAA,EACb,WAAA,GAAc,QAAA;AAAA,EACd,GAAG;AACL,CAAA,EASG;AACD,EAAA,uBACE,IAAA;AAAA,IAACA,UAAA,CAAkB,IAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACT,4UAAA;AAAA,QACA;AAAA,OACF;AAAA,MACC,GAAG,KAAA;AAAA,MAEH,QAAA,EAAA;AAAA,QAAA,QAAA;AAAA,QACA,UAAA,oBACC,GAAA;AAAA,UAACA,UAAA,CAAkB,UAAA;AAAA,UAAlB;AAAA,YACC,wBAAQ,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAQ,OAAA,EAAQ,MAAK,MAAA,EAAO,CAAA;AAAA,YAC5C,YAAA,EAAY,WAAA;AAAA,YACZ,SAAA,EAAU,oCAAA;AAAA,YACV,WAAA,EAAU,sBAAA;AAAA,YAEV,QAAA,kBAAA,GAAA,CAAC,SAAA,EAAA,EAAU,SAAA,EAAU,qBAAA,EAAsB;AAAA;AAAA;AAC7C;AAAA;AAAA,GAEJ;AAEJ;AAEA,SAAS,kBAAA,CAAmB,EAAE,SAAA,EAAW,GAAG,OAAM,EAAkC;AAClF,EAAA,uBACE,GAAA;AAAA,IAACA,UAAA,CAAkB,KAAA;AAAA,IAAlB;AAAA,MACC,WAAA,EAAU,qBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,8BAAA,EAAgC,SAAS,CAAA;AAAA,MACtD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,GAAoB;AAC3B,EAAA,OAAO,KAAA,CAAM,OAA8B,IAAI,CAAA;AACjD","file":"combobox.js","sourcesContent":["'use client'\n\nimport { Combobox as ComboboxPrimitive } from '@base-ui/react'\nimport * as React from 'react'\n\nimport { IconCheck } from '../icons/check.js'\nimport { IconClose } from '../icons/close.js'\nimport { IconExpandMore } from '../icons/expand-more.js'\nimport { ButtonGroupBoundary } from '../lib/button-group-context.js'\nimport { cn } from '../lib/utils.js'\nimport { Button } from './button.js'\nimport { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group.js'\n\nconst Combobox = ComboboxPrimitive.Root\n\nfunction ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {\n return <ComboboxPrimitive.Value data-slot='combobox-value' {...props} />\n}\n\nfunction ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {\n return (\n <ComboboxPrimitive.Trigger\n data-slot='combobox-trigger'\n aria-label='Show suggestions'\n className={cn(\"[&_svg:not([class*='size-'])]:size-3.5\", className)}\n {...props}\n >\n {children}\n <IconExpandMore className='pointer-events-none size-3.5 text-muted-foreground' />\n </ComboboxPrimitive.Trigger>\n )\n}\n\nfunction ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {\n return (\n <ComboboxPrimitive.Clear\n data-slot='combobox-clear'\n aria-label='Clear'\n render={<InputGroupButton variant='ghost' size='icon-xs' />}\n className={cn(className)}\n {...props}\n >\n <IconClose className='pointer-events-none' />\n </ComboboxPrimitive.Clear>\n )\n}\n\nfunction ComboboxInput({\n className,\n children,\n disabled = false,\n showTrigger = true,\n showClear = false,\n ...props\n}: ComboboxPrimitive.Input.Props & {\n showTrigger?: boolean\n showClear?: boolean\n}) {\n return (\n <InputGroup className={cn('w-auto', className)}>\n <ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />\n <InputGroupAddon align='inline-end'>\n {showTrigger && (\n <InputGroupButton\n size='icon-xs'\n variant='ghost'\n render={<ComboboxTrigger />}\n data-slot='input-group-button'\n className='group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent'\n disabled={disabled}\n />\n )}\n {showClear && <ComboboxClear disabled={disabled} />}\n </InputGroupAddon>\n {children}\n </InputGroup>\n )\n}\n\nfunction ComboboxContent({\n className,\n side = 'bottom',\n sideOffset = 6,\n align = 'start',\n alignOffset = 0,\n anchor,\n ...props\n}: ComboboxPrimitive.Popup.Props &\n Pick<\n ComboboxPrimitive.Positioner.Props,\n 'side' | 'align' | 'sideOffset' | 'alignOffset' | 'anchor'\n >) {\n return (\n <ComboboxPrimitive.Portal>\n {/* Stops a ButtonGroup's context at the portal — see ButtonGroupBoundary. */}\n <ButtonGroupBoundary>\n <ComboboxPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n anchor={anchor}\n className='isolate z-50'\n >\n <ComboboxPrimitive.Popup\n data-slot='combobox-content'\n data-chips={!!anchor}\n className={cn(\n 'group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-md bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </ComboboxPrimitive.Positioner>\n </ButtonGroupBoundary>\n </ComboboxPrimitive.Portal>\n )\n}\n\nfunction ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {\n return (\n <ComboboxPrimitive.List\n data-slot='combobox-list'\n className={cn(\n 'no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {\n return (\n <ComboboxPrimitive.Item\n data-slot='combobox-item'\n className={cn(\n \"relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-sm px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5\",\n className,\n )}\n {...props}\n >\n {children}\n <ComboboxPrimitive.ItemIndicator\n render={\n <span className='pointer-events-none absolute end-2 flex items-center justify-center' />\n }\n >\n <IconCheck className='pointer-events-none' />\n </ComboboxPrimitive.ItemIndicator>\n </ComboboxPrimitive.Item>\n )\n}\n\nfunction ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {\n return <ComboboxPrimitive.Group data-slot='combobox-group' className={cn(className)} {...props} />\n}\n\nfunction ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {\n return (\n <ComboboxPrimitive.GroupLabel\n data-slot='combobox-label'\n className={cn('px-2 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {\n return <ComboboxPrimitive.Collection data-slot='combobox-collection' {...props} />\n}\n\nfunction ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {\n return (\n <ComboboxPrimitive.Empty\n data-slot='combobox-empty'\n className={cn(\n 'hidden w-full justify-center py-2 text-center text-xs/relaxed text-muted-foreground group-data-empty/combobox-content:flex',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {\n return (\n <ComboboxPrimitive.Separator\n data-slot='combobox-separator'\n className={cn('-mx-1 my-1 h-px bg-border/50', className)}\n {...props}\n />\n )\n}\n\nfunction ComboboxChips({\n className,\n ...props\n}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {\n return (\n <ComboboxPrimitive.Chips\n data-slot='combobox-chips'\n className={cn(\n 'flex min-h-7 flex-wrap items-center gap-1 rounded-sm border border-input bg-input/20 bg-clip-padding px-2 py-0.5 text-xs/relaxed transition-colors focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/30 has-aria-invalid:border-destructive has-aria-invalid:ring-2 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1 dark:bg-input/30 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction ComboboxChip({\n className,\n children,\n showRemove = true,\n removeLabel = 'Remove',\n ...props\n}: ComboboxPrimitive.Chip.Props & {\n showRemove?: boolean\n /**\n * Screen-reader name for the chip's remove button. Override to translate it\n * — the button is icon-only, so this string is the only name AT ever hears.\n * Include the chip's own text where a bare \"Remove\" would be ambiguous in a\n * list of chips.\n */\n removeLabel?: string\n}) {\n return (\n <ComboboxPrimitive.Chip\n data-slot='combobox-chip'\n className={cn(\n 'flex h-[calc(--spacing(4.75))] w-fit items-center justify-center gap-1 rounded-[calc(var(--radius-sm)-2px)] bg-muted-foreground/10 px-1.5 text-xs/relaxed font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pe-0',\n className,\n )}\n {...props}\n >\n {children}\n {showRemove && (\n <ComboboxPrimitive.ChipRemove\n render={<Button variant='ghost' size='icon' />}\n aria-label={removeLabel}\n className='-ms-1 opacity-50 hover:opacity-100'\n data-slot='combobox-chip-remove'\n >\n <IconClose className='pointer-events-none' />\n </ComboboxPrimitive.ChipRemove>\n )}\n </ComboboxPrimitive.Chip>\n )\n}\n\nfunction ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {\n return (\n <ComboboxPrimitive.Input\n data-slot='combobox-chip-input'\n className={cn('min-w-16 flex-1 outline-none', className)}\n {...props}\n />\n )\n}\n\nfunction useComboboxAnchor() {\n return React.useRef<HTMLDivElement | null>(null)\n}\n\nexport {\n Combobox,\n ComboboxChip,\n ComboboxChips,\n ComboboxChipsInput,\n ComboboxCollection,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxGroup,\n ComboboxInput,\n ComboboxItem,\n ComboboxLabel,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue,\n useComboboxAnchor,\n}\n"]}
@@ -3,7 +3,7 @@ import { Drawer as Drawer$1 } from 'vaul';
3
3
 
4
4
  declare function Drawer({ ...props }: React.ComponentProps<typeof Drawer$1.Root>): React.JSX.Element;
5
5
  declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof Drawer$1.Trigger>): React.JSX.Element;
6
- declare function DrawerPortal({ ...props }: React.ComponentProps<typeof Drawer$1.Portal>): React.JSX.Element;
6
+ declare function DrawerPortal({ children, ...props }: React.ComponentProps<typeof Drawer$1.Portal>): React.JSX.Element;
7
7
  declare function DrawerClose({ ...props }: React.ComponentProps<typeof Drawer$1.Close>): React.JSX.Element;
8
8
  declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof Drawer$1.Overlay>): React.JSX.Element;
9
9
  declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof Drawer$1.Content>): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { Drawer as Drawer$1 } from 'vaul';
4
+ import { ButtonGroupBoundary } from '../lib/button-group-context.js';
4
5
  import { cn } from '../lib/utils.js';
5
6
 
6
7
  function Drawer({ ...props }) {
@@ -9,8 +10,8 @@ function Drawer({ ...props }) {
9
10
  function DrawerTrigger({ ...props }) {
10
11
  return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
11
12
  }
12
- function DrawerPortal({ ...props }) {
13
- return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
13
+ function DrawerPortal({ children, ...props }) {
14
+ return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props, children: /* @__PURE__ */ jsx(ButtonGroupBoundary, { children }) });
14
15
  }
15
16
  function DrawerClose({ ...props }) {
16
17
  return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/drawer.tsx"],"names":["DrawerPrimitive"],"mappings":";;;;AAOA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAsD;AAC/E,EAAA,2BAAQA,QAAA,CAAgB,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC7D;AAEA,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAyD;AACzF,EAAA,2BAAQA,QAAA,CAAgB,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEA,SAAS,YAAA,CAAa,EAAE,GAAG,KAAA,EAAM,EAAwD;AACvF,EAAA,2BAAQA,QAAA,CAAgB,MAAA,EAAhB,EAAuB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAAO,CAAA;AACtE;AAEA,SAAS,WAAA,CAAY,EAAE,GAAG,KAAA,EAAM,EAAuD;AACrF,EAAA,2BAAQA,QAAA,CAAgB,KAAA,EAAhB,EAAsB,WAAA,EAAU,cAAA,EAAgB,GAAG,KAAA,EAAO,CAAA;AACpE;AAEA,SAAS,aAAA,CAAc;AAAA,EACrB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAyD;AACvD,EAAA,uBACE,GAAA;AAAA,IAACA,QAA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AAEJ;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuD;AAChG,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,qCAAA,EAAuC,SAAS,CAAA;AAAA,MAC7D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,uCAAA,EAAyC,SAAS,CAAA;AAAA,MAC/D,GAAG;AAAA;AAAA,GACN;AAEJ","file":"drawer.js","sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { cn } from '../lib/utils.js'\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot='drawer' {...props} />\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot='drawer-trigger' {...props} />\n}\n\nfunction DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return <DrawerPrimitive.Portal data-slot='drawer-portal' {...props} />\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot='drawer-close' {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot='drawer-overlay'\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot='drawer-portal'>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot='drawer-content'\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-transparent p-2 text-xs/relaxed text-popover-foreground before:absolute before:inset-2 before:-z-10 before:rounded-md before:border before:border-border before:bg-popover data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n {...props}\n >\n <div className='mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block' />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='drawer-header'\n className={cn(\n 'flex flex-col gap-1 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-start',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='drawer-footer'\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot='drawer-title'\n className={cn('text-sm font-medium text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot='drawer-description'\n className={cn('text-xs/relaxed text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\n"]}
1
+ {"version":3,"sources":["../../src/components/drawer.tsx"],"names":["DrawerPrimitive"],"mappings":";;;;;AAQA,SAAS,MAAA,CAAO,EAAE,GAAG,KAAA,EAAM,EAAsD;AAC/E,EAAA,2BAAQA,QAAA,CAAgB,IAAA,EAAhB,EAAqB,WAAA,EAAU,QAAA,EAAU,GAAG,KAAA,EAAO,CAAA;AAC7D;AAEA,SAAS,aAAA,CAAc,EAAE,GAAG,KAAA,EAAM,EAAyD;AACzF,EAAA,2BAAQA,QAAA,CAAgB,OAAA,EAAhB,EAAwB,WAAA,EAAU,gBAAA,EAAkB,GAAG,KAAA,EAAO,CAAA;AACxE;AAEA,SAAS,YAAA,CAAa,EAAE,QAAA,EAAU,GAAG,OAAM,EAAwD;AACjG,EAAA,uBACE,GAAA,CAACA,QAAA,CAAgB,MAAA,EAAhB,EAAuB,WAAA,EAAU,eAAA,EAAiB,GAAG,KAAA,EAEpD,QAAA,kBAAA,GAAA,CAAC,mBAAA,EAAA,EAAqB,QAAA,EAAS,CAAA,EACjC,CAAA;AAEJ;AAEA,SAAS,WAAA,CAAY,EAAE,GAAG,KAAA,EAAM,EAAuD;AACrF,EAAA,2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,SAAA,EAAW,GAAG,OAAM,EAAgC;AAC1E,EAAA,uBACE,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,eAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,iCAAA,EAAmC,SAAS,CAAA;AAAA,MACzD,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,WAAA,CAAY,EAAE,SAAA,EAAW,GAAG,OAAM,EAAuD;AAChG,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,KAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,cAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,qCAAA,EAAuC,SAAS,CAAA;AAAA,MAC7D,GAAG;AAAA;AAAA,GACN;AAEJ;AAEA,SAAS,iBAAA,CAAkB;AAAA,EACzB,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA6D;AAC3D,EAAA,uBACE,GAAA;AAAA,IAACA,QAAA,CAAgB,WAAA;AAAA,IAAhB;AAAA,MACC,WAAA,EAAU,oBAAA;AAAA,MACV,SAAA,EAAW,EAAA,CAAG,uCAAA,EAAyC,SAAS,CAAA;AAAA,MAC/D,GAAG;AAAA;AAAA,GACN;AAEJ","file":"drawer.js","sourcesContent":["'use client'\n\nimport * as React from 'react'\nimport { Drawer as DrawerPrimitive } from 'vaul'\n\nimport { ButtonGroupBoundary } from '../lib/button-group-context.js'\nimport { cn } from '../lib/utils.js'\n\nfunction Drawer({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n return <DrawerPrimitive.Root data-slot='drawer' {...props} />\n}\n\nfunction DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot='drawer-trigger' {...props} />\n}\n\nfunction DrawerPortal({ children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return (\n <DrawerPrimitive.Portal data-slot='drawer-portal' {...props}>\n {/* Stops a ButtonGroup's context at the portal — see ButtonGroupBoundary. */}\n <ButtonGroupBoundary>{children}</ButtonGroupBoundary>\n </DrawerPrimitive.Portal>\n )\n}\n\nfunction DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot='drawer-close' {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot='drawer-overlay'\n className={cn(\n 'fixed inset-0 z-50 bg-black/80 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot='drawer-portal'>\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot='drawer-content'\n className={cn(\n 'group/drawer-content fixed z-50 flex h-auto flex-col bg-transparent p-2 text-xs/relaxed text-popover-foreground before:absolute before:inset-2 before:-z-10 before:rounded-md before:border before:border-border before:bg-popover data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:start-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:end-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm',\n className,\n )}\n {...props}\n >\n <div className='mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block' />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='drawer-header'\n className={cn(\n 'flex flex-col gap-1 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:text-start',\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot='drawer-footer'\n className={cn('mt-auto flex flex-col gap-2 p-4', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot='drawer-title'\n className={cn('text-sm font-medium text-foreground', className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot='drawer-description'\n className={cn('text-xs/relaxed text-muted-foreground', className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerClose,\n DrawerContent,\n DrawerDescription,\n DrawerFooter,\n DrawerHeader,\n DrawerOverlay,\n DrawerPortal,\n DrawerTitle,\n DrawerTrigger,\n}\n"]}
@@ -30,7 +30,7 @@ declare const headerColors: {
30
30
  };
31
31
  type HeaderColor = keyof typeof headerColors;
32
32
  declare const headerVariants: (props?: ({
33
- color?: "white" | "grey" | "light" | "dark" | null | undefined;
33
+ color?: "light" | "white" | "grey" | "dark" | null | undefined;
34
34
  } & class_variance_authority_types.ClassProp) | undefined) => string;
35
35
  declare const headerContainerVariants: (props?: ({
36
36
  container?: "fluid" | "contained" | null | undefined;
@@ -1,6 +1,7 @@
1
1
  "use client"
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
  import { PreviewCard } from '@base-ui/react/preview-card';
4
+ import { ButtonGroupBoundary } from '../lib/button-group-context.js';
4
5
  import { cn } from '../lib/utils.js';
5
6
 
6
7
  function HoverCard({ ...props }) {
@@ -17,7 +18,7 @@ function HoverCardContent({
17
18
  alignOffset = 4,
18
19
  ...props
19
20
  }) {
20
- return /* @__PURE__ */ jsx(PreviewCard.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
21
+ return /* @__PURE__ */ jsx(PreviewCard.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(ButtonGroupBoundary, { children: /* @__PURE__ */ jsx(
21
22
  PreviewCard.Positioner,
22
23
  {
23
24
  align,
@@ -37,7 +38,7 @@ function HoverCardContent({
37
38
  }
38
39
  )
39
40
  }
40
- ) });
41
+ ) }) });
41
42
  }
42
43
 
43
44
  export { HoverCard, HoverCardContent, HoverCardTrigger };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/components/hover-card.tsx"],"names":["PreviewCardPrimitive"],"mappings":";;;;AAMA,SAAS,SAAA,CAAU,EAAE,GAAG,KAAA,EAAM,EAAoC;AAChE,EAAA,2BAAQA,WAAA,CAAqB,IAAA,EAArB,EAA0B,WAAA,EAAU,YAAA,EAAc,GAAG,KAAA,EAAO,CAAA;AACtE;AAEA,SAAS,gBAAA,CAAiB,EAAE,GAAG,KAAA,EAAM,EAAuC;AAC1E,EAAA,2BAAQA,WAAA,CAAqB,OAAA,EAArB,EAA6B,WAAA,EAAU,oBAAA,EAAsB,GAAG,KAAA,EAAO,CAAA;AACjF;AAEA,SAAS,gBAAA,CAAiB;AAAA,EACxB,SAAA;AAAA,EACA,IAAA,GAAO,QAAA;AAAA,EACP,UAAA,GAAa,CAAA;AAAA,EACb,KAAA,GAAQ,QAAA;AAAA,EACR,WAAA,GAAc,CAAA;AAAA,EACd,GAAG;AACL,CAAA,EACgG;AAC9F,EAAA,uBACE,GAAA,CAACA,WAAA,CAAqB,MAAA,EAArB,EAA4B,aAAU,mBAAA,EACrC,QAAA,kBAAA,GAAA;AAAA,IAACA,WAAA,CAAqB,UAAA;AAAA,IAArB;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA,EAAU,cAAA;AAAA,MAEV,QAAA,kBAAA,GAAA;AAAA,QAACA,WAAA,CAAqB,KAAA;AAAA,QAArB;AAAA,UACC,WAAA,EAAU,oBAAA;AAAA,UACV,SAAA,EAAW,EAAA;AAAA,YACT,siBAAA;AAAA,YACA;AAAA,WACF;AAAA,UACC,GAAG;AAAA;AAAA;AACN;AAAA,GACF,EACF,CAAA;AAEJ","file":"hover-card.js","sourcesContent":["'use client'\n\nimport { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card'\n\nimport { cn } from '../lib/utils.js'\n\nfunction HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {\n return <PreviewCardPrimitive.Root data-slot='hover-card' {...props} />\n}\n\nfunction HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {\n return <PreviewCardPrimitive.Trigger data-slot='hover-card-trigger' {...props} />\n}\n\nfunction HoverCardContent({\n className,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 4,\n ...props\n}: PreviewCardPrimitive.Popup.Props &\n Pick<PreviewCardPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {\n return (\n <PreviewCardPrimitive.Portal data-slot='hover-card-portal'>\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className='isolate z-50'\n >\n <PreviewCardPrimitive.Popup\n data-slot='hover-card-content'\n className={cn(\n 'z-50 w-72 origin-(--transform-origin) rounded-md bg-popover p-2.5 text-xs/relaxed text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </PreviewCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger }\n"]}
1
+ {"version":3,"sources":["../../src/components/hover-card.tsx"],"names":["PreviewCardPrimitive"],"mappings":";;;;;AAOA,SAAS,SAAA,CAAU,EAAE,GAAG,KAAA,EAAM,EAAoC;AAChE,EAAA,2BAAQA,WAAA,CAAqB,IAAA,EAArB,EAA0B,WAAA,EAAU,YAAA,EAAc,GAAG,KAAA,EAAO,CAAA;AACtE;AAEA,SAAS,gBAAA,CAAiB,EAAE,GAAG,KAAA,EAAM,EAAuC;AAC1E,EAAA,2BAAQA,WAAA,CAAqB,OAAA,EAArB,EAA6B,WAAA,EAAU,oBAAA,EAAsB,GAAG,KAAA,EAAO,CAAA;AACjF;AAEA,SAAS,gBAAA,CAAiB;AAAA,EACxB,SAAA;AAAA,EACA,IAAA,GAAO,QAAA;AAAA,EACP,UAAA,GAAa,CAAA;AAAA,EACb,KAAA,GAAQ,QAAA;AAAA,EACR,WAAA,GAAc,CAAA;AAAA,EACd,GAAG;AACL,CAAA,EACgG;AAC9F,EAAA,2BACGA,WAAA,CAAqB,MAAA,EAArB,EAA4B,WAAA,EAAU,mBAAA,EAErC,8BAAC,mBAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,IAACA,WAAA,CAAqB,UAAA;AAAA,IAArB;AAAA,MACC,KAAA;AAAA,MACA,WAAA;AAAA,MACA,IAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA,EAAU,cAAA;AAAA,MAEV,QAAA,kBAAA,GAAA;AAAA,QAACA,WAAA,CAAqB,KAAA;AAAA,QAArB;AAAA,UACC,WAAA,EAAU,oBAAA;AAAA,UACV,SAAA,EAAW,EAAA;AAAA,YACT,siBAAA;AAAA,YACA;AAAA,WACF;AAAA,UACC,GAAG;AAAA;AAAA;AACN;AAAA,KAEJ,CAAA,EACF,CAAA;AAEJ","file":"hover-card.js","sourcesContent":["'use client'\n\nimport { PreviewCard as PreviewCardPrimitive } from '@base-ui/react/preview-card'\n\nimport { ButtonGroupBoundary } from '../lib/button-group-context.js'\nimport { cn } from '../lib/utils.js'\n\nfunction HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {\n return <PreviewCardPrimitive.Root data-slot='hover-card' {...props} />\n}\n\nfunction HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {\n return <PreviewCardPrimitive.Trigger data-slot='hover-card-trigger' {...props} />\n}\n\nfunction HoverCardContent({\n className,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 4,\n ...props\n}: PreviewCardPrimitive.Popup.Props &\n Pick<PreviewCardPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset'>) {\n return (\n <PreviewCardPrimitive.Portal data-slot='hover-card-portal'>\n {/* Stops a ButtonGroup's context at the portal — see ButtonGroupBoundary. */}\n <ButtonGroupBoundary>\n <PreviewCardPrimitive.Positioner\n align={align}\n alignOffset={alignOffset}\n side={side}\n sideOffset={sideOffset}\n className='isolate z-50'\n >\n <PreviewCardPrimitive.Popup\n data-slot='hover-card-content'\n className={cn(\n 'z-50 w-72 origin-(--transform-origin) rounded-md bg-popover p-2.5 text-xs/relaxed text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-start-2 data-[side=inline-start]:slide-in-from-end-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className,\n )}\n {...props}\n />\n </PreviewCardPrimitive.Positioner>\n </ButtonGroupBoundary>\n </PreviewCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger }\n"]}
@@ -3,7 +3,7 @@ import { VariantProps } from 'class-variance-authority';
3
3
  import React__default from 'react';
4
4
 
5
5
  declare const linkVariants: (props?: ({
6
- variant?: "primary" | "secondary" | "white" | "unstyled" | null | undefined;
6
+ variant?: "white" | "primary" | "secondary" | "unstyled" | null | undefined;
7
7
  } & class_variance_authority_types.ClassProp) | undefined) => string;
8
8
  type LinkComponent = React__default.ElementType;
9
9
  /**
@@ -10,7 +10,7 @@ declare const mastheadColors: {
10
10
  };
11
11
  type MastheadColor = keyof typeof mastheadColors;
12
12
  declare const mastheadVariants: (props?: ({
13
- color?: "white" | "grey" | "light" | "dark" | null | undefined;
13
+ color?: "light" | "white" | "grey" | "dark" | null | undefined;
14
14
  } & class_variance_authority_types.ClassProp) | undefined) => string;
15
15
  declare const mastheadContainerVariants: (props?: ({
16
16
  container?: "fluid" | "contained" | null | undefined;