Home / File/ base-color-picker.tsx — ui Source File

base-color-picker.tsx — ui Source File

Architecture documentation for base-color-picker.tsx, a tsx file in the ui codebase. 7 imports, 0 dependents.

File tsx DesignEngine PreviewSystem 7 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  fd704422_fd93_1d98_3856_206449bcc032["base-color-picker.tsx"]
  1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"]
  fd704422_fd93_1d98_3856_206449bcc032 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2
  75d25ec8_fe84_91a4_54c6_20dabb286f91["next-themes"]
  fd704422_fd93_1d98_3856_206449bcc032 --> 75d25ec8_fe84_91a4_54c6_20dabb286f91
  47758573_16e6_4808_88b2_8dba3780ae24["use-mounted"]
  fd704422_fd93_1d98_3856_206449bcc032 --> 47758573_16e6_4808_88b2_8dba3780ae24
  f14cf7ca_f213_afc2_bc66_ebc0fb7d9834["config"]
  fd704422_fd93_1d98_3856_206449bcc032 --> f14cf7ca_f213_afc2_bc66_ebc0fb7d9834
  000a4c85_90c9_57be_0014_4c8e8762dcff["lock-button"]
  fd704422_fd93_1d98_3856_206449bcc032 --> 000a4c85_90c9_57be_0014_4c8e8762dcff
  c97cebd0_0d39_fa69_4337_d0c1787c0b11["picker"]
  fd704422_fd93_1d98_3856_206449bcc032 --> c97cebd0_0d39_fa69_4337_d0c1787c0b11
  c27c6e95_5daf_4dd4_dc3a_add496837570["search-params"]
  fd704422_fd93_1d98_3856_206449bcc032 --> c27c6e95_5daf_4dd4_dc3a_add496837570
  style fd704422_fd93_1d98_3856_206449bcc032 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"use client"

import * as React from "react"
import { useTheme } from "next-themes"

import { useMounted } from "@/hooks/use-mounted"
import { BASE_COLORS, type BaseColorName } from "@/registry/config"
import { LockButton } from "@/app/(create)/components/lock-button"
import {
  Picker,
  PickerContent,
  PickerGroup,
  PickerItem,
  PickerRadioGroup,
  PickerRadioItem,
  PickerSeparator,
  PickerTrigger,
} from "@/app/(create)/components/picker"
import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params"

export function BaseColorPicker({
  isMobile,
  anchorRef,
}: {
  isMobile: boolean
  anchorRef: React.RefObject<HTMLDivElement | null>
}) {
  const { resolvedTheme, setTheme } = useTheme()
  const mounted = useMounted()
  const [params, setParams] = useDesignSystemSearchParams()

  const currentBaseColor = React.useMemo(
    () => BASE_COLORS.find((baseColor) => baseColor.name === params.baseColor),
    [params.baseColor]
  )

  return (
    <div className="group/picker relative">
      <Picker>
        <PickerTrigger>
          <div className="flex flex-col justify-start text-left">
            <div className="text-muted-foreground text-xs">Base Color</div>
            <div className="text-foreground text-sm font-medium">
              {currentBaseColor?.title}
            </div>
          </div>
          {mounted && resolvedTheme && (
            <div
              style={
                {
                  "--color":
                    currentBaseColor?.cssVars?.[
                      resolvedTheme as "light" | "dark"
                    ]?.["muted-foreground"],
                } as React.CSSProperties
              }
              className="pointer-events-none absolute top-1/2 right-4 size-4 -translate-y-1/2 rounded-full bg-(--color) select-none"
            />
          )}
        </PickerTrigger>
// ... (66 more lines)

Domain

Subdomains

Functions

Dependencies

  • config
  • lock-button
  • next-themes
  • picker
  • react
  • search-params
  • use-mounted

Frequently Asked Questions

What does base-color-picker.tsx do?
base-color-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 base-color-picker.tsx?
base-color-picker.tsx defines 1 function(s): BaseColorPicker.
What does base-color-picker.tsx depend on?
base-color-picker.tsx imports 7 module(s): config, lock-button, next-themes, picker, react, search-params, use-mounted.
Where is base-color-picker.tsx in the architecture?
base-color-picker.tsx is located at apps/v4/app/(create)/components/base-color-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