From c2c4364ccc0f587ae5465a8a4d4265c2fbe1460c Mon Sep 17 00:00:00 2001 From: "Irsyad A. Panjaitan" Date: Sun, 13 Oct 2024 15:48:59 +0700 Subject: [PATCH] remove touch-target --- components/ui/aside.tsx | 5 +--- components/ui/button.tsx | 5 +--- components/ui/dialog.tsx | 5 +--- components/ui/disclosure.tsx | 5 ++-- components/ui/index.ts | 1 - components/ui/link.tsx | 5 +--- components/ui/menu.tsx | 5 +--- components/ui/show-more.tsx | 3 +-- components/ui/table.tsx | 9 ++++---- components/ui/text-field.tsx | 5 ++-- components/ui/toggle.tsx | 3 +-- components/ui/touch-target.tsx | 15 ------------ components/ui/tree.tsx | 5 ++-- .../docs/components/buttons/button.mdx | 3 --- .../docs/components/buttons/toggle.mdx | 3 --- .../docs/components/buttons/touch-target.mdx | 23 ------------------- .../docs/components/collections/tree.mdx | 2 +- .../content/docs/prologue/release-notes.mdx | 2 ++ 18 files changed, 20 insertions(+), 84 deletions(-) delete mode 100644 components/ui/touch-target.tsx delete mode 100644 resources/content/docs/components/buttons/touch-target.mdx diff --git a/components/ui/aside.tsx b/components/ui/aside.tsx index 89cc4c39..bd88a62b 100644 --- a/components/ui/aside.tsx +++ b/components/ui/aside.tsx @@ -16,7 +16,6 @@ import { tv } from "tailwind-variants" import { Button, ButtonPrimitive } from "./button" import { cr, useMediaQuery } from "./primitive" import { Sheet } from "./sheet" -import { TouchTarget } from "./touch-target" const aside = tv({ slots: { @@ -162,9 +161,7 @@ const Item = ({ isCurrent, children, className, icon: Icon, ...props }: ItemProp <> {Icon && } - - {typeof children === "function" ? children(values) : children} - + {typeof children === "function" ? children(values) : children} {props.badge && (
{props.badge} diff --git a/components/ui/button.tsx b/components/ui/button.tsx index 590c720f..a15e53c8 100644 --- a/components/ui/button.tsx +++ b/components/ui/button.tsx @@ -9,7 +9,6 @@ import { import { tv } from "tailwind-variants" import { cr, focusButtonStyles } from "./primitive" -import { TouchTarget } from "./touch-target" const buttonStyles = tv( { @@ -119,9 +118,7 @@ const Button = React.forwardRef( )} > {(values) => ( - - {typeof props.children === "function" ? props.children(values) : props.children} - + <>{typeof props.children === "function" ? props.children(values) : props.children} )} ) diff --git a/components/ui/dialog.tsx b/components/ui/dialog.tsx index 52bde5c5..3b73193d 100644 --- a/components/ui/dialog.tsx +++ b/components/ui/dialog.tsx @@ -18,7 +18,6 @@ import { tv } from "tailwind-variants" import { Button, type ButtonProps } from "./button" import { useMediaQuery } from "./primitive" -import { TouchTarget } from "./touch-target" const dialogStyles = tv({ slots: { @@ -53,9 +52,7 @@ type DialogHeaderProps = React.HTMLAttributes & { const Trigger = (props: ButtonPrimitiveProps) => ( {(values) => ( - - {typeof props.children === "function" ? props.children(values) : props.children} - + <>{typeof props.children === "function" ? props.children(values) : props.children} )} ) diff --git a/components/ui/disclosure.tsx b/components/ui/disclosure.tsx index f6d43d20..801e82a8 100644 --- a/components/ui/disclosure.tsx +++ b/components/ui/disclosure.tsx @@ -18,7 +18,6 @@ import { import { tv } from "tailwind-variants" import { cn, cr, tm } from "./primitive" -import { TouchTarget } from "./touch-target" interface DisclosureGroupProps extends DisclosureGroupPrimitiveProps { hideBorder?: boolean @@ -128,7 +127,7 @@ const Trigger = ({ className, ...props }: ButtonProps) => { )} > {(values) => ( - + <> {typeof props.children === "function" ? props.children(values) : props.children} {!hideIndicator && ( { )} /> )} - + )} ) diff --git a/components/ui/index.ts b/components/ui/index.ts index 39915851..66e9060a 100644 --- a/components/ui/index.ts +++ b/components/ui/index.ts @@ -1,6 +1,5 @@ export * from './primitive'; export * from './progress-circle'; -export * from './touch-target'; export * from './aside'; export * from './tree'; export * from './chart'; diff --git a/components/ui/link.tsx b/components/ui/link.tsx index b93090a0..e7de31f8 100644 --- a/components/ui/link.tsx +++ b/components/ui/link.tsx @@ -6,7 +6,6 @@ import { Link as LinkPrimitive, type LinkProps as LinkPrimitiveProps } from "rea import { tv } from "tailwind-variants" import { cr } from "./primitive" -import { TouchTarget } from "./touch-target" const linkStyles = tv({ base: "forced-colors:outline-[Highlight] relative focus-visible:outline-2 outline outline-offset-2 disabled:focus-visible:outline-0 outline-0 outline-primary rounded disabled:opacity-60 forced-colors:disabled:text-[GrayText] border-transparent transition-colors disabled:cursor-default", @@ -38,9 +37,7 @@ const Link = ({ className, ...props }: LinkProps) => { )} > {(values) => ( - - {typeof props.children === "function" ? props.children(values) : props.children} - + <>{typeof props.children === "function" ? props.children(values) : props.children} )} ) diff --git a/components/ui/menu.tsx b/components/ui/menu.tsx index 6380bba1..421564ec 100644 --- a/components/ui/menu.tsx +++ b/components/ui/menu.tsx @@ -27,7 +27,6 @@ import { DropdownItemDetails, dropdownItemStyles, DropdownSection } from "./drop import { Keyboard } from "./keyboard" import { Popover } from "./popover" import { cn, cr, tm } from "./primitive" -import { TouchTarget } from "./touch-target" interface MenuContextProps { respectScreen: boolean @@ -72,9 +71,7 @@ interface MenuTriggerProps extends ButtonProps { const Trigger = ({ className, ...props }: MenuTriggerProps) => ( ) diff --git a/components/ui/show-more.tsx b/components/ui/show-more.tsx index 9950880a..8a9a2842 100644 --- a/components/ui/show-more.tsx +++ b/components/ui/show-more.tsx @@ -7,7 +7,6 @@ import { tv } from "tailwind-variants" import { buttonStyles } from "./button" import { cr } from "./primitive" -import { TouchTarget } from "./touch-target" const showMoreStyles = tv({ base: "text-sm leading-6 after:border-muted before:border-muted", @@ -55,7 +54,7 @@ const ShowMore = ({ className={buttonStyles({ shape: "circle", appearance: "outline", size: "small" })} > {cr(props.children, (children) => ( - {children} + <>{children} ))} ) : ( diff --git a/components/ui/table.tsx b/components/ui/table.tsx index ae2088eb..9a06179b 100644 --- a/components/ui/table.tsx +++ b/components/ui/table.tsx @@ -29,7 +29,6 @@ import { tv } from "tailwind-variants" import { Checkbox } from "./checkbox" import { cn, cr } from "./primitive" -import { TouchTarget } from "./touch-target" const table = tv({ slots: { @@ -143,13 +142,13 @@ const TableColumn = ({ children, isResizable = false, className, ...props }: Tab <> {children} {allowsSorting && ( - + <> - + )} {isResizable && } @@ -204,9 +203,9 @@ const TableRow = ({ className="relative bg-transparent pl-3.5 py-1.5 text-muted-fg pressed:text-fg" slot="drag" > - + <> - + )} diff --git a/components/ui/text-field.tsx b/components/ui/text-field.tsx index 2bd328ea..f692c74b 100644 --- a/components/ui/text-field.tsx +++ b/components/ui/text-field.tsx @@ -13,7 +13,6 @@ import { import type { FieldProps } from "./field" import { Description, FieldError, FieldGroup, fieldGroupPrefixStyles, Input, Label } from "./field" import { ctr } from "./primitive" -import { TouchTarget } from "./touch-target" type InputType = Exclude @@ -80,13 +79,13 @@ const TextField = ({ onPress={handleTogglePasswordVisibility} className="atrs relative isSfx x2e2 [&_[data-slot=icon]]:text-muted-fg focus:outline-none focus-visible:ring-1 focus-visible:ring-primary rounded" > - + <> {isPasswordVisible ? ( ) : ( )} - + ) : isLoading && indicatorPlace === "suffix" ? ( diff --git a/components/ui/toggle.tsx b/components/ui/toggle.tsx index 1431cfaf..35a402b1 100644 --- a/components/ui/toggle.tsx +++ b/components/ui/toggle.tsx @@ -6,7 +6,6 @@ import { ToggleButton as ToggleButtonPrimitive, ToggleButtonProps } from "react- import { tv, VariantProps } from "tailwind-variants" import { cr, focusButtonStyles } from "./primitive" -import { TouchTarget } from "./touch-target" const toggleStyles = tv({ extend: focusButtonStyles, @@ -59,7 +58,7 @@ const Toggle = ({ className, ...props }: ToggleProps) => { )} > {cr(props.children, (children) => ( - {children} + <>{children} ))} ) diff --git a/components/ui/touch-target.tsx b/components/ui/touch-target.tsx deleted file mode 100644 index dc852430..00000000 --- a/components/ui/touch-target.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import * as React from "react" - -const TouchTarget = ({ children }: { children: React.ReactNode }) => { - return ( - <> -