From 51d2f601bb8a4f198a831d04184b78372e25ed59 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Fri, 27 Nov 2026 20:50:03 -0600 Subject: [PATCH] merge buttons and triggers together --- .../src/components/Button/index.module.css | 5 ++++ .../src/components/Select/index.module.css | 27 ------------------- .../website/src/components/Select/index.tsx | 21 +++++++++++++++ 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/packages/website/src/components/Button/index.module.css b/packages/website/src/components/Button/index.module.css index dae28ab8c..76165ed34 100644 --- a/packages/website/src/components/Button/index.module.css +++ b/packages/website/src/components/Button/index.module.css @@ -128,6 +128,11 @@ } } + &:focus-visible { + outline: var(--outline-focus); + box-shadow: var(--shadow-focus); + } + &[disabled] { cursor: default; opacity: 0.5; diff --git a/packages/website/src/components/Select/index.module.css b/packages/website/src/components/Select/index.module.css index 535b05b45..bce60f9cf 100644 --- a/packages/website/src/components/Select/index.module.css +++ b/packages/website/src/components/Select/index.module.css @@ -8,34 +8,7 @@ } .Trigger { - display: flex; - align-items: center; justify-content: space-between; - gap: var(--space-3); - - padding: var(--space-3) var(--space-4); - border: none; - border-radius: var(--radius-max); - - background-color: var(--gray-1); - outline: var(--outline-interactive); - outline-offset: calc(-1 * var(--space-1)); - color: var(--gray-12); - font: inherit; - cursor: pointer; - - white-space: nowrap; - - &:focus-visible { - outline: var(--outline-focus); - box-shadow: var(--shadow-focus); - } - - svg, - img { - width: 1em; - height: 1em; - } /* * Another unselectable Radix component, being selected by span instead. diff --git a/packages/website/src/components/Select/index.tsx b/packages/website/src/components/Select/index.tsx index 202b00970..1f18935dc 100644 --- a/packages/website/src/components/Select/index.tsx +++ b/packages/website/src/components/Select/index.tsx @@ -1,12 +1,33 @@ import { Select as _ } from "radix-ui"; +import type { ComponentProps } from "react"; +import { classNames } from "../../ui/classNames"; import { composeRadixComponents } from "../../ui/compose"; +import { Button } from "../Button"; import { Discriminator } from "../DropdownMenu"; import styles from "./index.module.css"; +type SelectTriggerProps = ComponentProps; + +function Trigger({ className, children, ...props }: SelectTriggerProps) { + return ( + <_.Trigger asChild {...props}> + + + ); +} + // TODO: for select, context menu, and dropdown menus, use scroller curtains export const Select = { ...composeRadixComponents(_, styles, { Content: { position: "popper", align: "center" }, }), + Discriminator, + Trigger, };