diff --git a/apps/v4/components/component-preview-tabs.tsx b/apps/v4/components/component-preview-tabs.tsx index b88134be7f..2eec84b636 100644 --- a/apps/v4/components/component-preview-tabs.tsx +++ b/apps/v4/components/component-preview-tabs.tsx @@ -3,9 +3,6 @@ import * as React from "react" import { cn } from "@/lib/utils" -import { DirectionProvider as BaseDirectionProvider } from "@/registry/bases/base/ui/direction" -import { DirectionProvider as RadixDirectionProvider } from "@/registry/bases/radix/ui/direction" -import { Button } from "@/registry/new-york-v4/ui/button" import { LanguageProvider, LanguageSelector, @@ -13,6 +10,9 @@ import { useTranslation, type Translations, } from "@/components/language-selector" +import { DirectionProvider as BaseDirectionProvider } from "@/registry/bases/base/ui/direction" +import { DirectionProvider as RadixDirectionProvider } from "@/registry/bases/radix/ui/direction" +import { Button } from "@/registry/new-york-v4/ui/button" export function ComponentPreviewTabs({ className, @@ -52,15 +52,15 @@ export function ComponentPreviewTabs({ {direction === "rtl" ? ( - - + + {component} - - + + ) : ( @@ -76,39 +76,39 @@ export function ComponentPreviewTabs({ )} {!hideCode && (
- {isMobileCodeVisible ? ( - source - ) : ( -
- {sourcePreview} -
-
- -
+ data-slot="code" + data-mobile-code-visible={isMobileCodeVisible} + className="relative overflow-hidden [&_[data-rehype-pretty-code-figure]]:!m-0 [&_[data-rehype-pretty-code-figure]]:rounded-t-none [&_[data-rehype-pretty-code-figure]]:border-t [&_pre]:max-h-72" + > + {isMobileCodeVisible ? ( + source + ) : ( +
+ {sourcePreview} +
+
+
- )} -
- )} +
+ )} +
+ )}
) } @@ -193,9 +193,7 @@ function DirectionProviderWrapper({ if (base === "base") { return ( - - {children} - + {children} ) } diff --git a/apps/v4/components/component-preview.tsx b/apps/v4/components/component-preview.tsx index 222e99086a..5fd8039e64 100644 --- a/apps/v4/components/component-preview.tsx +++ b/apps/v4/components/component-preview.tsx @@ -29,8 +29,12 @@ export function ComponentPreview({ direction?: "ltr" | "rtl" caption?: string }) { - const translationDisclaimer = direction === "rtl" ? "Automatic translation may contain errors." : undefined - const finalCaption = [caption, translationDisclaimer].filter(Boolean).join(" ") || undefined + const translationDisclaimer = + direction === "rtl" + ? "Automatic translation may contain errors." + : undefined + const finalCaption = + [caption, translationDisclaimer].filter(Boolean).join(" ") || undefined if (type === "block") { const content = ( @@ -59,7 +63,7 @@ export function ComponentPreview({ return (
{content} -
+
{finalCaption}
@@ -114,9 +118,12 @@ export function ComponentPreview({ if (finalCaption) { return ( -
+
{content} -
+
{finalCaption}
diff --git a/apps/v4/components/language-selector.tsx b/apps/v4/components/language-selector.tsx index cb6529e21c..4a53291212 100644 --- a/apps/v4/components/language-selector.tsx +++ b/apps/v4/components/language-selector.tsx @@ -9,6 +9,7 @@ import { SelectTrigger, SelectValue, } from "@/examples/base/ui/select" + import { cn } from "@/lib/utils" export type Language = "en" | "ar" | "he" diff --git a/apps/v4/content/docs/(root)/rtl.mdx b/apps/v4/content/docs/(root)/rtl.mdx index e668eb0c6f..29803c668f 100644 --- a/apps/v4/content/docs/(root)/rtl.mdx +++ b/apps/v4/content/docs/(root)/rtl.mdx @@ -3,7 +3,6 @@ title: "RTL" description: "RTL documentation" --- - ## Overview RTL is a feature that allows you to display content from right to left. @@ -69,14 +68,14 @@ className={cn( Replace physical positioning classes with logical equivalents: -| Before | After | -|--------|-------| -| `group-data-[side=left]:-right-4` | `group-data-[side=left]:-end-4` | -| `group-data-[side=right]:left-0` | `group-data-[side=right]:start-0` | -| `after:left-1/2` | `after:start-1/2` | -| `after:left-full` | `after:start-full` | -| `-right-2` | `-end-2` | -| `-left-2` | `-start-2` | +| Before | After | +| --------------------------------- | --------------------------------- | +| `group-data-[side=left]:-right-4` | `group-data-[side=left]:-end-4` | +| `group-data-[side=right]:left-0` | `group-data-[side=right]:start-0` | +| `after:left-1/2` | `after:start-1/2` | +| `after:left-full` | `after:start-full` | +| `-right-2` | `-end-2` | +| `-left-2` | `-start-2` | ### Usage diff --git a/apps/v4/content/docs/components/base/badge.mdx b/apps/v4/content/docs/components/base/badge.mdx index 6b36e0878b..b91a24df94 100644 --- a/apps/v4/content/docs/components/base/badge.mdx +++ b/apps/v4/content/docs/components/base/badge.mdx @@ -89,11 +89,7 @@ You can customize the colors of a badge by adding custom classes such as `bg-gre To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/button.mdx b/apps/v4/content/docs/components/base/button.mdx index b6a2cc3a22..4fdf651371 100644 --- a/apps/v4/content/docs/components/base/button.mdx +++ b/apps/v4/content/docs/components/base/button.mdx @@ -147,11 +147,7 @@ Remember to set the `nativeButton` prop to `false` if you're returning an elemen To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/combobox.mdx b/apps/v4/content/docs/components/base/combobox.mdx index 3077b5263c..b3bca6d0b6 100644 --- a/apps/v4/content/docs/components/base/combobox.mdx +++ b/apps/v4/content/docs/components/base/combobox.mdx @@ -260,11 +260,7 @@ You can add an addon to the combobox by using the `InputGroupAddon` component in To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/dialog.mdx b/apps/v4/content/docs/components/base/dialog.mdx index 0f40d0affa..427da7fc64 100644 --- a/apps/v4/content/docs/components/base/dialog.mdx +++ b/apps/v4/content/docs/components/base/dialog.mdx @@ -115,11 +115,7 @@ Long content can scroll while the header stays in view. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/drawer.mdx b/apps/v4/content/docs/components/base/drawer.mdx index db9710be21..762642e179 100644 --- a/apps/v4/content/docs/components/base/drawer.mdx +++ b/apps/v4/content/docs/components/base/drawer.mdx @@ -112,11 +112,7 @@ You can combine the `Dialog` and `Drawer` components to create a responsive dial To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/empty.mdx b/apps/v4/content/docs/components/base/empty.mdx index 7f5fa9363e..2ecdfaf391 100644 --- a/apps/v4/content/docs/components/base/empty.mdx +++ b/apps/v4/content/docs/components/base/empty.mdx @@ -131,11 +131,7 @@ You can add an `InputGroup` component to the `EmptyContent` component. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/field.mdx b/apps/v4/content/docs/components/base/field.mdx index 20794a890e..f5e5ed3b70 100644 --- a/apps/v4/content/docs/components/base/field.mdx +++ b/apps/v4/content/docs/components/base/field.mdx @@ -162,7 +162,6 @@ Stack `Field` components with `FieldGroup`. Add `FieldSeparator` to divide them. previewClassName="h-96" /> - ## RTL To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). @@ -186,8 +185,6 @@ To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl) previewClassName="h-[650px] p-6 md:h-[500px] md:p-10" /> - - ## Validation and Errors - Add `data-invalid` to `Field` to switch the entire block into an error state. @@ -358,4 +355,3 @@ Accessible error container that accepts children or an `errors` array (e.g., fro When the `errors` array contains multiple messages, the component renders a list automatically. `FieldError` also accepts issues produced by any validator that implements [Standard Schema](https://standardschema.dev/), including Zod, Valibot, and ArkType. Pass the `issues` array from the schema result directly to render a unified error list across libraries. - diff --git a/apps/v4/content/docs/components/base/input-otp.mdx b/apps/v4/content/docs/components/base/input-otp.mdx index 04980097ea..f64f7d6666 100644 --- a/apps/v4/content/docs/components/base/input-otp.mdx +++ b/apps/v4/content/docs/components/base/input-otp.mdx @@ -146,11 +146,7 @@ Use `REGEXP_ONLY_DIGITS_AND_CHARS` to accept both letters and numbers. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/item.mdx b/apps/v4/content/docs/components/base/item.mdx index bc4c9b8cca..a9b17e50c2 100644 --- a/apps/v4/content/docs/components/base/item.mdx +++ b/apps/v4/content/docs/components/base/item.mdx @@ -165,11 +165,7 @@ Use the `render` prop to render the item as a link. The hover and focus states w To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/kbd.mdx b/apps/v4/content/docs/components/base/kbd.mdx index 296833e4bd..ee52f65116 100644 --- a/apps/v4/content/docs/components/base/kbd.mdx +++ b/apps/v4/content/docs/components/base/kbd.mdx @@ -83,11 +83,7 @@ You can use the `Kbd` component inside a `InputGroupAddon` component to display To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/label.mdx b/apps/v4/content/docs/components/base/label.mdx index b0c991c8d3..a697e406d3 100644 --- a/apps/v4/content/docs/components/base/label.mdx +++ b/apps/v4/content/docs/components/base/label.mdx @@ -14,11 +14,7 @@ links: To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + For form fields, use the [Field](/docs/components/base/field) component which diff --git a/apps/v4/content/docs/components/base/menubar.mdx b/apps/v4/content/docs/components/base/menubar.mdx index 6e93609932..d81470267d 100644 --- a/apps/v4/content/docs/components/base/menubar.mdx +++ b/apps/v4/content/docs/components/base/menubar.mdx @@ -116,11 +116,7 @@ Use `MenubarSub`, `MenubarSubTrigger`, and `MenubarSubContent` for nested menus. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/pagination.mdx b/apps/v4/content/docs/components/base/pagination.mdx index 2fb899e375..fe5105032a 100644 --- a/apps/v4/content/docs/components/base/pagination.mdx +++ b/apps/v4/content/docs/components/base/pagination.mdx @@ -132,8 +132,4 @@ const PaginationLink = ({...props }: ) => ( To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + diff --git a/apps/v4/content/docs/components/base/popover.mdx b/apps/v4/content/docs/components/base/popover.mdx index d7984d5eb0..c03e7805f2 100644 --- a/apps/v4/content/docs/components/base/popover.mdx +++ b/apps/v4/content/docs/components/base/popover.mdx @@ -103,11 +103,7 @@ A popover with form fields inside. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/progress.mdx b/apps/v4/content/docs/components/base/progress.mdx index e3df43570d..4e683af40b 100644 --- a/apps/v4/content/docs/components/base/progress.mdx +++ b/apps/v4/content/docs/components/base/progress.mdx @@ -80,11 +80,7 @@ A progress bar that can be controlled by a slider. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/resizable.mdx b/apps/v4/content/docs/components/base/resizable.mdx index 1e9a3ca027..cc00257185 100644 --- a/apps/v4/content/docs/components/base/resizable.mdx +++ b/apps/v4/content/docs/components/base/resizable.mdx @@ -96,11 +96,7 @@ Use the `withHandle` prop on `ResizableHandle` to show a visible handle. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/select.mdx b/apps/v4/content/docs/components/base/select.mdx index f6f078bddc..1a366d5995 100644 --- a/apps/v4/content/docs/components/base/select.mdx +++ b/apps/v4/content/docs/components/base/select.mdx @@ -121,11 +121,7 @@ Add the `data-invalid` attribute to the `Field` component and the `aria-invalid` To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/separator.mdx b/apps/v4/content/docs/components/base/separator.mdx index c9122e0aea..4b3ce305ab 100644 --- a/apps/v4/content/docs/components/base/separator.mdx +++ b/apps/v4/content/docs/components/base/separator.mdx @@ -86,11 +86,7 @@ Horizontal separators between list items. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/sidebar.mdx b/apps/v4/content/docs/components/base/sidebar.mdx index f952671d88..6685663128 100644 --- a/apps/v4/content/docs/components/base/sidebar.mdx +++ b/apps/v4/content/docs/components/base/sidebar.mdx @@ -5,7 +5,12 @@ base: base component: true --- - + Sidebars are one of the most complex components to build. They are central to any application and often contain a lot of moving parts. diff --git a/apps/v4/content/docs/components/base/skeleton.mdx b/apps/v4/content/docs/components/base/skeleton.mdx index 6aee8d47a9..1877d8bf74 100644 --- a/apps/v4/content/docs/components/base/skeleton.mdx +++ b/apps/v4/content/docs/components/base/skeleton.mdx @@ -83,8 +83,4 @@ import { Skeleton } from "@/components/ui/skeleton" To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + diff --git a/apps/v4/content/docs/components/base/slider.mdx b/apps/v4/content/docs/components/base/slider.mdx index 8ecf547844..3cf7331b23 100644 --- a/apps/v4/content/docs/components/base/slider.mdx +++ b/apps/v4/content/docs/components/base/slider.mdx @@ -96,11 +96,7 @@ Use the `disabled` prop to disable the slider. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/spinner.mdx b/apps/v4/content/docs/components/base/spinner.mdx index 98ead48fc5..d209690563 100644 --- a/apps/v4/content/docs/components/base/spinner.mdx +++ b/apps/v4/content/docs/components/base/spinner.mdx @@ -110,8 +110,4 @@ Add a spinner to a badge to indicate a loading state. Remember to use the `data- To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + diff --git a/apps/v4/content/docs/components/base/switch.mdx b/apps/v4/content/docs/components/base/switch.mdx index c3fa9db444..8dad18fe18 100644 --- a/apps/v4/content/docs/components/base/switch.mdx +++ b/apps/v4/content/docs/components/base/switch.mdx @@ -96,11 +96,7 @@ Use the `size` prop to change the size of the switch. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/table.mdx b/apps/v4/content/docs/components/base/table.mdx index 50a1674ebd..6b0ba49b19 100644 --- a/apps/v4/content/docs/components/base/table.mdx +++ b/apps/v4/content/docs/components/base/table.mdx @@ -109,8 +109,4 @@ You can also see an example of a data table in the [Tasks](/examples/tasks) demo To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + diff --git a/apps/v4/content/docs/components/base/textarea.mdx b/apps/v4/content/docs/components/base/textarea.mdx index 4cc455b2eb..ea3c4f565b 100644 --- a/apps/v4/content/docs/components/base/textarea.mdx +++ b/apps/v4/content/docs/components/base/textarea.mdx @@ -103,8 +103,4 @@ Pair with `Button` to create a textarea with a submit button. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + diff --git a/apps/v4/content/docs/components/base/toggle.mdx b/apps/v4/content/docs/components/base/toggle.mdx index 9fecb5ea75..40c661a396 100644 --- a/apps/v4/content/docs/components/base/toggle.mdx +++ b/apps/v4/content/docs/components/base/toggle.mdx @@ -88,11 +88,7 @@ Use the `size` prop to change the size of the toggle. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/base/tooltip.mdx b/apps/v4/content/docs/components/base/tooltip.mdx index 3000d27471..3bddb8a40c 100644 --- a/apps/v4/content/docs/components/base/tooltip.mdx +++ b/apps/v4/content/docs/components/base/tooltip.mdx @@ -93,11 +93,7 @@ Show a tooltip on a disabled button by wrapping it with a span. To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/radix/badge.mdx b/apps/v4/content/docs/components/radix/badge.mdx index 52c645def4..87ad710a6d 100644 --- a/apps/v4/content/docs/components/radix/badge.mdx +++ b/apps/v4/content/docs/components/radix/badge.mdx @@ -85,11 +85,7 @@ You can customize the colors of a badge by adding custom classes such as `bg-gre To enable RTL support in shadcn/ui, see the [RTL configuration guide](/docs/rtl). - + ## API Reference diff --git a/apps/v4/content/docs/components/radix/button.mdx b/apps/v4/content/docs/components/radix/button.mdx index 75746ddce1..10d6fecdd2 100644 --- a/apps/v4/content/docs/components/radix/button.mdx +++ b/apps/v4/content/docs/components/radix/button.mdx @@ -145,11 +145,7 @@ You can use the `asChild` prop on `