Home / File/ radius-picker.tsx — ui Source File

radius-picker.tsx — ui Source File

Architecture documentation for radius-picker.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.

File tsx DesignEngine PreviewSystem 4 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  d1d6f82a_dca0_0d91_b321_8bfcd475470b["radius-picker.tsx"]
  f14cf7ca_f213_afc2_bc66_ebc0fb7d9834["config"]
  d1d6f82a_dca0_0d91_b321_8bfcd475470b --> f14cf7ca_f213_afc2_bc66_ebc0fb7d9834
  000a4c85_90c9_57be_0014_4c8e8762dcff["lock-button"]
  d1d6f82a_dca0_0d91_b321_8bfcd475470b --> 000a4c85_90c9_57be_0014_4c8e8762dcff
  c97cebd0_0d39_fa69_4337_d0c1787c0b11["picker"]
  d1d6f82a_dca0_0d91_b321_8bfcd475470b --> c97cebd0_0d39_fa69_4337_d0c1787c0b11
  c27c6e95_5daf_4dd4_dc3a_add496837570["search-params"]
  d1d6f82a_dca0_0d91_b321_8bfcd475470b --> c27c6e95_5daf_4dd4_dc3a_add496837570
  style d1d6f82a_dca0_0d91_b321_8bfcd475470b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import { RADII, type RadiusValue } from "@/registry/config"
import { LockButton } from "@/app/(create)/components/lock-button"
import {
  Picker,
  PickerContent,
  PickerGroup,
  PickerRadioGroup,
  PickerRadioItem,
  PickerSeparator,
  PickerTrigger,
} from "@/app/(create)/components/picker"
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"

export function RadiusPicker({
  isMobile,
  anchorRef,
}: {
  isMobile: boolean
  anchorRef: React.RefObject<HTMLDivElement | null>
}) {
  const [params, setParams] = useDesignSystemSearchParams()

  const currentRadius = RADII.find((radius) => radius.name === params.radius)
  const defaultRadius = RADII.find((radius) => radius.name === "default")
  const otherRadii = RADII.filter((radius) => radius.name !== "default")

  return (
    <div className="group/picker relative">
      <Picker>
        <PickerTrigger>
          <div className="flex flex-col justify-start text-left">
            <div className="text-muted-foreground text-xs">Radius</div>
            <div className="text-foreground text-sm font-medium">
              {currentRadius?.label}
            </div>
          </div>
          <div className="text-foreground pointer-events-none absolute top-1/2 right-4 flex size-4 -translate-y-1/2 rotate-90 items-center justify-center text-base select-none">
            <svg
              xmlns="http://www.w3.org/2000/svg"
              width="24"
              height="24"
              viewBox="0 0 24 24"
              className="text-foreground"
            >
              <path
                fill="none"
                stroke="currentColor"
                strokeLinecap="round"
                strokeLinejoin="round"
                strokeWidth="2"
                d="M4 20v-5C4 8.925 8.925 4 15 4h5"
              />
            </svg>
          </div>
        </PickerTrigger>
        <PickerContent
          anchor={isMobile ? anchorRef : undefined}
          side={isMobile ? "top" : "right"}
          align={isMobile ? "center" : "start"}
        >
          <PickerRadioGroup
            value={currentRadius?.name}
            onValueChange={(value) => {
              setParams({ radius: value as RadiusValue })
            }}
          >
            <PickerGroup>
              {defaultRadius && (
                <PickerRadioItem
                  key={defaultRadius.name}
                  value={defaultRadius.name}
                >
                  <div className="flex flex-col justify-start pointer-coarse:gap-1">
                    <div>{defaultRadius.label}</div>
                    <div className="text-muted-foreground text-xs pointer-coarse:text-sm">
                      Use radius from style
                    </div>
                  </div>
                </PickerRadioItem>
              )}
            </PickerGroup>
            <PickerSeparator />
            <PickerGroup>
              {otherRadii.map((radius) => (
                <PickerRadioItem key={radius.name} value={radius.name}>
                  {radius.label}
                </PickerRadioItem>
              ))}
            </PickerGroup>
          </PickerRadioGroup>
        </PickerContent>
      </Picker>
      <LockButton
        param="radius"
        className="absolute top-1/2 right-10 -translate-y-1/2"
      />
    </div>
  )
}

Domain

Subdomains

Functions

Dependencies

  • config
  • lock-button
  • picker
  • search-params

Frequently Asked Questions

What does radius-picker.tsx do?
radius-picker.tsx is a source file in the ui codebase, written in tsx. It belongs to the DesignEngine domain, PreviewSystem subdomain.
What functions are defined in radius-picker.tsx?
radius-picker.tsx defines 1 function(s): RadiusPicker.
What does radius-picker.tsx depend on?
radius-picker.tsx imports 4 module(s): config, lock-button, picker, search-params.
Where is radius-picker.tsx in the architecture?
radius-picker.tsx is located at apps/v4/app/(create)/components/radius-picker.tsx (domain: DesignEngine, subdomain: PreviewSystem, directory: apps/v4/app/(create)/components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free