Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

766 B
Raw Blame
'use client'

import { Toggle as BaseToggle } from '@base-ui/react/toggle'
import { cn } from '../cn'
import { focusRingClassName } from '../internal/focus'
import { resolveClassName } from '../internal/resolve-class-name'

type ToggleProps<Value extends string = string> = BaseToggle.Props<Value>
type ToggleChangeEventReason = BaseToggle.ChangeEventReason
type ToggleChangeEventDetails = BaseToggle.ChangeEventDetails

function Toggle<Value extends string = string>({ className, ...props }: ToggleProps<Value>) {
  return (
    <BaseToggle<Value>
      className={(state) => cn(focusRingClassName, resolveClassName(className, state))}
      {...props}
    />
  )
}

export { Toggle }

export type { ToggleChangeEventDetails, ToggleChangeEventReason, ToggleProps }