{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "action-bar",
  "type": "registry:ui",
  "title": "ActionBar",
  "description": "ActionBar is a fixed floating toolbar that appears at the top or bottom of the screen, used to surface contextual actions when items are selected.",
  "dependencies": [
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/motion.json",
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/action-bar/ActionBar.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-bar/ActionBar.tsx",
      "content": "'use client';\n\nimport { RiCloseLine } from '@remixicon/react';\nimport { forwardRef, useMemo } from 'react';\n\nimport { cn } from '@/lib/wideset/utils';\nimport { useDefaultMotion } from '@/lib/wideset/motion/MotionProvider';\nimport { IconButton } from '../button/IconButton';\nimport type { ActionBarProps } from './ActionBar.types';\nimport { actionBarMotionVariants, actionBarVariants } from './ActionBar.variants';\n\nexport const ActionBar = forwardRef<HTMLDivElement, ActionBarProps>(\n  (\n    {\n      amountSelected,\n      isOpen,\n      position,\n      align,\n      className,\n      children,\n      onClose,\n      closeAriaLabel = 'Close',\n      defaultMotion,\n      ...props\n    },\n    ref,\n  ) => {\n    const motion = useDefaultMotion(defaultMotion);\n    const hasAmountForLeading =\n      amountSelected !== undefined &&\n      (typeof amountSelected !== 'number' || !Number.isNaN(amountSelected));\n\n    const hasLeading = Boolean(onClose || hasAmountForLeading);\n    const hasActions = children != null;\n\n    const amountSelectedLabel = useMemo(() => {\n      if (amountSelected === undefined) {\n        return undefined;\n      }\n\n      if (typeof amountSelected === 'number') {\n        if (Number.isNaN(amountSelected)) {\n          return undefined;\n        }\n        return `${amountSelected} selected`;\n      }\n\n      const [count, format] = amountSelected;\n      return format(count);\n    }, [amountSelected]);\n\n    return (\n      <div\n        ref={ref}\n        data-slot=\"action-bar\"\n        data-state={isOpen ? 'open' : 'closed'}\n        aria-hidden={isOpen ? undefined : true}\n        inert={isOpen ? undefined : true}\n        className={cn(\n          actionBarVariants({ position, align }),\n          actionBarMotionVariants({ enabled: motion, position }),\n          hasLeading && hasActions && 'gap-ws-19',\n          className,\n        )}\n        {...props}\n      >\n        {hasLeading && (\n          <div className=\"gap-ws-9 flex items-center\">\n            {onClose && (\n              <IconButton\n                preset=\"border\"\n                variant=\"secondary\"\n                size=\"sm\"\n                icon={RiCloseLine}\n                onClick={onClose}\n                aria-label={closeAriaLabel}\n                defaultMotion={motion}\n              />\n            )}\n            {amountSelectedLabel != null && (\n              <span className=\"text-ws-static-base typography-label-strong-sm tracking-ws-tight-25 font-ws-medium whitespace-nowrap\">\n                {amountSelectedLabel}\n              </span>\n            )}\n          </div>\n        )}\n        {hasActions && <div className=\"gap-ws-5 flex min-w-0 items-center\">{children}</div>}\n      </div>\n    );\n  },\n);\n\nActionBar.displayName = 'ActionBar';\n"
    },
    {
      "path": "src/components/action-bar/ActionBar.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-bar/ActionBar.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type { ComponentPropsWithoutRef, ReactNode } from 'react';\n\nimport type { MotionProps } from '@/lib/wideset/motion/Motion.types';\nimport type { actionBarVariants } from './ActionBar.variants';\n\n/** Floating actions for the current selection. */\nexport type ActionBarProps = {\n  /** Selected item count, or a count and formatter tuple for a custom selection label. */\n  amountSelected?: number | [count: number, format: (amount: number) => ReactNode];\n  /** Controls visibility of the action bar. Defaults to `false`. */\n  isOpen?: boolean;\n  /** Called when the close button is activated; clear the selection or hide the bar in response. */\n  onClose?: () => void;\n  /** Action content rendered after the close button and selected count — typically buttons or icon buttons. */\n  children?: ReactNode;\n  /** Accessible label for the close button. Defaults to `'Close'`. */\n  closeAriaLabel?: string;\n} & Omit<ComponentPropsWithoutRef<'div'>, 'children'> &\n  VariantProps<typeof actionBarVariants> &\n  MotionProps;\n"
    },
    {
      "path": "src/components/action-bar/ActionBar.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/action-bar/ActionBar.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const actionBarVariants = cva(\n  'rounded-ws-container-lg bg-ws-static-overlay shadow-ws-medium gap-ws-5 px-ws-11 py-ws-9 z-ws-sticky fixed flex items-center data-[state=closed]:pointer-events-none data-[state=closed]:opacity-0',\n  {\n    variants: {\n      position: {\n        top: 'top-ws-9',\n        bottom: 'bottom-ws-9',\n      },\n      align: {\n        left: 'left-ws-9',\n        center: 'left-1/2 -translate-x-1/2',\n        right: 'right-ws-9',\n      },\n    },\n    defaultVariants: {\n      position: 'bottom',\n      align: 'center',\n    },\n  },\n);\n\nexport const actionBarMotionVariants = cva('', {\n  variants: {\n    enabled: {\n      true: cn(\n        'data-[state=open]:animate-in data-[state=closed]:animate-out',\n        'data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0',\n        'ease-(--ws-motion-ease-smooth-out) data-[state=open]:duration-(--ws-motion-duration-slow)',\n        'data-[state=closed]:duration-(--ws-motion-duration-medium)',\n      ),\n      false: '',\n    },\n    position: {\n      top: '',\n      bottom: '',\n    },\n  },\n  compoundVariants: [\n    {\n      enabled: true,\n      position: 'top',\n      className:\n        'data-[state=open]:ws-slide-in-from-top-4 data-[state=closed]:ws-slide-out-to-top-4',\n    },\n    {\n      enabled: true,\n      position: 'bottom',\n      className:\n        'data-[state=open]:slide-in-from-bottom-ws-4 data-[state=closed]:slide-out-to-bottom-ws-4',\n    },\n  ],\n  defaultVariants: { enabled: true, position: 'bottom' },\n});\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
