@fanvue/ui 3.41.0 → 3.42.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/Dialog/Dialog.cjs +63 -55
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/Tabs/Tabs.cjs +26 -1
- package/dist/cjs/components/Tabs/Tabs.cjs.map +1 -1
- package/dist/cjs/components/Tabs/TabsList.cjs +163 -22
- package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
- package/dist/cjs/components/Tabs/TabsOverflow.cjs +146 -0
- package/dist/cjs/components/Tabs/TabsOverflow.cjs.map +1 -0
- package/dist/cjs/components/Tabs/TabsTrigger.cjs +27 -14
- package/dist/cjs/components/Tabs/TabsTrigger.cjs.map +1 -1
- package/dist/cjs/index.cjs +3 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Dialog/Dialog.mjs +63 -55
- package/dist/components/Dialog/Dialog.mjs.map +1 -1
- package/dist/components/Tabs/Tabs.mjs +26 -2
- package/dist/components/Tabs/Tabs.mjs.map +1 -1
- package/dist/components/Tabs/TabsList.mjs +164 -23
- package/dist/components/Tabs/TabsList.mjs.map +1 -1
- package/dist/components/Tabs/TabsOverflow.mjs +129 -0
- package/dist/components/Tabs/TabsOverflow.mjs.map +1 -0
- package/dist/components/Tabs/TabsTrigger.mjs +27 -14
- package/dist/components/Tabs/TabsTrigger.mjs.map +1 -1
- package/dist/index.d.ts +90 -19
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsTrigger.mjs","sources":["../../../src/components/Tabs/TabsTrigger.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Props for the {@link TabsTrigger} button component. */\nexport type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;\n\n/**\n * An interactive tab that activates its associated {@link TabsContent} panel.\n *\n * Renders a `<button>` by default. Pass `asChild` to render the tab as another\n * element — e.g. a router link for navigation tabs (`<TabsTrigger asChild><Link\n * href=\"…\">…</Link></TabsTrigger>`). With `asChild` the child element becomes\n * the tab itself (receiving `role=\"tab\"` and focus management), so the tab\n * stays a single interactive control rather than nesting one inside the other.\n */\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n TabsTriggerProps\n>(({ className, children, asChild, ...props }, ref) => {\n const
|
|
1
|
+
{"version":3,"file":"TabsTrigger.mjs","sources":["../../../src/components/Tabs/TabsTrigger.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { TabsAppearanceContext } from \"./TabsList\";\n\n/** Props for the {@link TabsTrigger} button component. */\nexport type TabsTriggerProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>;\n\n/**\n * An interactive tab that activates its associated {@link TabsContent} panel.\n *\n * Renders a `<button>` by default. Pass `asChild` to render the tab as another\n * element — e.g. a router link for navigation tabs (`<TabsTrigger asChild><Link\n * href=\"…\">…</Link></TabsTrigger>`). With `asChild` the child element becomes\n * the tab itself (receiving `role=\"tab\"` and focus management), so the tab\n * stays a single interactive control rather than nesting one inside the other.\n *\n * Inside a `TabsList appearance=\"pill\"` the tab takes the pill styling.\n */\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.Trigger>,\n TabsTriggerProps\n>(({ className, children, asChild, ...props }, ref) => {\n const { appearance, size } = React.useContext(TabsAppearanceContext);\n const labelClassName = cn(\"min-w-0 truncate\", appearance === \"pill\" && \"flex items-center gap-2\");\n const label = <span className={labelClassName}>{children}</span>;\n\n // The `min-w-0 truncate` span keeps long labels ellipsised. With `asChild`\n // the consumer's element becomes the tab, so wrap *its* children in that\n // span (rather than wrapping the element) — the tab stays a single\n // interactive control (no nested link/button) while behaviour matches the\n // default button tab.\n const content =\n asChild && React.isValidElement(children)\n ? React.cloneElement(\n children,\n undefined,\n <span className={labelClassName}>\n {(children.props as { children?: React.ReactNode }).children}\n </span>,\n )\n : label;\n\n return (\n <TabsPrimitive.Trigger\n ref={ref}\n asChild={asChild}\n className={cn(\n \"inline-flex min-w-0 cursor-pointer items-center justify-center\",\n \"motion-safe:transition-colors motion-safe:duration-150 motion-safe:ease-in-out\",\n \"data-disabled:pointer-events-none\",\n \"focus-visible:shadow-focus-ring focus-visible:outline-none\",\n appearance === \"pill\"\n ? [\n \"relative z-0 shrink-0 gap-2 rounded-full px-4 data-pill:z-10\",\n size === \"36\" ? \"h-9\" : \"h-8\",\n \"typography-body-small-14px-semibold\",\n \"motion-safe:duration-[160ms] data-pill:motion-safe:delay-(--pill-arrive)\",\n \"text-content-secondary data-pill:text-content-primary-inverted\",\n \"not-data-pill:hover:text-content-primary\",\n \"data-disabled:data-[state=inactive]:text-neutral-alphas-200\",\n ]\n : [\n \"typography-body-default-16px-semibold\",\n \"data-[orientation=horizontal]:px-4 data-[orientation=horizontal]:py-3\",\n \"data-[orientation=vertical]:justify-start data-[orientation=vertical]:px-4 data-[orientation=vertical]:py-3\",\n \"data-[state=active]:text-content-primary\",\n \"data-[state=inactive]:text-content-tertiary\",\n \"data-[state=active]:hover:text-content-primary/70\",\n \"data-[state=inactive]:hover:text-content-primary\",\n \"data-[state=active]:active:text-content-primary/70\",\n \"data-[state=inactive]:active:text-content-primary\",\n \"data-disabled:data-[state=active]:text-content-tertiary\",\n \"data-disabled:data-[state=inactive]:text-neutral-alphas-200\",\n ],\n className,\n )}\n {...props}\n >\n {content}\n </TabsPrimitive.Trigger>\n );\n});\n\nTabsTrigger.displayName = \"TabsTrigger\";\n"],"names":[],"mappings":";;;;;;AAmBO,MAAM,cAAc,MAAM,WAG/B,CAAC,EAAE,WAAW,UAAU,SAAS,GAAG,MAAA,GAAS,QAAQ;AACrD,QAAM,EAAE,YAAY,KAAA,IAAS,MAAM,WAAW,qBAAqB;AACnE,QAAM,iBAAiB,GAAG,oBAAoB,eAAe,UAAU,yBAAyB;AAChG,QAAM,QAAQ,oBAAC,QAAA,EAAK,WAAW,gBAAiB,UAAS;AAOzD,QAAM,UACJ,WAAW,MAAM,eAAe,QAAQ,IACpC,MAAM;AAAA,IACJ;AAAA,IACA;AAAA,wBACC,QAAA,EAAK,WAAW,gBACb,UAAA,SAAS,MAAyC,SAAA,CACtD;AAAA,EAAA,IAEF;AAEN,SACE;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,SACX;AAAA,UACE;AAAA,UACA,SAAS,OAAO,QAAQ;AAAA,UACxB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,IAEF;AAAA,UACE;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA;AAAA,QAEN;AAAA,MAAA;AAAA,MAED,GAAG;AAAA,MAEH,UAAA;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;AAED,YAAY,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2561,6 +2561,9 @@ export declare type DialogCloseProps = React_2.ComponentPropsWithoutRef<typeof D
|
|
|
2561
2561
|
* render a centered floating card instead (used for small confirmation dialogs).
|
|
2562
2562
|
* On larger viewports it renders centered with full border radius.
|
|
2563
2563
|
*
|
|
2564
|
+
* It animates in and out. While the closing animation plays the panel stays
|
|
2565
|
+
* mounted but ignores pointer input, so a second click can't act on it.
|
|
2566
|
+
*
|
|
2564
2567
|
* @example
|
|
2565
2568
|
* ```tsx
|
|
2566
2569
|
* <Dialog>
|
|
@@ -6482,25 +6485,7 @@ export declare const TableToolbar: React_2.ForwardRefExoticComponent<TableToolba
|
|
|
6482
6485
|
export declare interface TableToolbarProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
6483
6486
|
}
|
|
6484
6487
|
|
|
6485
|
-
|
|
6486
|
-
* Root container for a tabbed interface. Manages the active tab state and
|
|
6487
|
-
* coordinates {@link TabsList}, {@link TabsTrigger}, and {@link TabsContent}.
|
|
6488
|
-
*
|
|
6489
|
-
* Built on Radix UI `Tabs`.
|
|
6490
|
-
*
|
|
6491
|
-
* @example
|
|
6492
|
-
* ```tsx
|
|
6493
|
-
* <Tabs defaultValue="tab1">
|
|
6494
|
-
* <TabsList>
|
|
6495
|
-
* <TabsTrigger value="tab1">Tab 1</TabsTrigger>
|
|
6496
|
-
* <TabsTrigger value="tab2">Tab 2</TabsTrigger>
|
|
6497
|
-
* </TabsList>
|
|
6498
|
-
* <TabsContent value="tab1">Content 1</TabsContent>
|
|
6499
|
-
* <TabsContent value="tab2">Content 2</TabsContent>
|
|
6500
|
-
* </Tabs>
|
|
6501
|
-
* ```
|
|
6502
|
-
*/
|
|
6503
|
-
export declare const Tabs: React_2.ForwardRefExoticComponent<TabsPrimitive.TabsProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6488
|
+
export declare const Tabs: React_2.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
6504
6489
|
|
|
6505
6490
|
/** Renders the content panel for a given tab `value`. Only visible when its value matches the active tab. */
|
|
6506
6491
|
export declare const TabsContent: React_2.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
|
|
@@ -6543,8 +6528,30 @@ export declare const TabsList: React_2.ForwardRefExoticComponent<Omit<TabsPrimit
|
|
|
6543
6528
|
* @default false
|
|
6544
6529
|
*/
|
|
6545
6530
|
scrollable?: boolean;
|
|
6531
|
+
/**
|
|
6532
|
+
* `"underline"` marks the active tab with a line under the row. `"pill"` sits
|
|
6533
|
+
* the tabs in a rounded track, sized to its tabs, and slides a filled pill
|
|
6534
|
+
* behind the active one. A pill list is horizontal and ignores `fullWidth`,
|
|
6535
|
+
* `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.
|
|
6536
|
+
* @default "underline"
|
|
6537
|
+
*/
|
|
6538
|
+
appearance?: TabsListAppearance;
|
|
6539
|
+
/** Height of each tab in a pill list. Ignored by the underline appearance. @default "32" */
|
|
6540
|
+
size?: TabsListPillSize;
|
|
6541
|
+
/**
|
|
6542
|
+
* Pill only: the pill follows the mouse across the tabs and settles back on the
|
|
6543
|
+
* selected one when the pointer leaves. Mouse only, and off when the user prefers
|
|
6544
|
+
* reduced motion. @default false
|
|
6545
|
+
*/
|
|
6546
|
+
followHover?: boolean;
|
|
6546
6547
|
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
6547
6548
|
|
|
6549
|
+
/** Visual style of a {@link TabsList}. */
|
|
6550
|
+
export declare type TabsListAppearance = "underline" | "pill";
|
|
6551
|
+
|
|
6552
|
+
/** Height in pixels of each tab in a pill {@link TabsList}. */
|
|
6553
|
+
export declare type TabsListPillSize = "32" | "36";
|
|
6554
|
+
|
|
6548
6555
|
/** Props for the {@link TabsList} component. */
|
|
6549
6556
|
export declare type TabsListProps = React_2.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {
|
|
6550
6557
|
/** When `true` (the default), the tab list spans the full width of its container and each tab grows equally. Set to `false` for inline sizing. */
|
|
@@ -6580,8 +6587,70 @@ export declare type TabsListProps = React_2.ComponentPropsWithoutRef<typeof Tabs
|
|
|
6580
6587
|
* @default false
|
|
6581
6588
|
*/
|
|
6582
6589
|
scrollable?: boolean;
|
|
6590
|
+
/**
|
|
6591
|
+
* `"underline"` marks the active tab with a line under the row. `"pill"` sits
|
|
6592
|
+
* the tabs in a rounded track, sized to its tabs, and slides a filled pill
|
|
6593
|
+
* behind the active one. A pill list is horizontal and ignores `fullWidth`,
|
|
6594
|
+
* `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.
|
|
6595
|
+
* @default "underline"
|
|
6596
|
+
*/
|
|
6597
|
+
appearance?: TabsListAppearance;
|
|
6598
|
+
/** Height of each tab in a pill list. Ignored by the underline appearance. @default "32" */
|
|
6599
|
+
size?: TabsListPillSize;
|
|
6600
|
+
/**
|
|
6601
|
+
* Pill only: the pill follows the mouse across the tabs and settles back on the
|
|
6602
|
+
* selected one when the pointer leaves. Mouse only, and off when the user prefers
|
|
6603
|
+
* reduced motion. @default false
|
|
6604
|
+
*/
|
|
6605
|
+
followHover?: boolean;
|
|
6583
6606
|
};
|
|
6584
6607
|
|
|
6608
|
+
/**
|
|
6609
|
+
* The last tab in a {@link TabsList}, opening a menu of the tabs that don't fit
|
|
6610
|
+
* the row. It sits in the row's arrow-key order, opens with click, Enter, Space
|
|
6611
|
+
* or ArrowDown, and never selects anything itself. While one of its items is
|
|
6612
|
+
* active it shows that item's label and is the selected tab.
|
|
6613
|
+
*
|
|
6614
|
+
* Reads and sets the value of the surrounding {@link Tabs}, controlled or not.
|
|
6615
|
+
* Renders nothing when it has no items.
|
|
6616
|
+
*
|
|
6617
|
+
* @example
|
|
6618
|
+
* ```tsx
|
|
6619
|
+
* <Tabs value={tab} onValueChange={setTab}>
|
|
6620
|
+
* <TabsList appearance="pill">
|
|
6621
|
+
* <TabsTrigger value="all">All</TabsTrigger>
|
|
6622
|
+
* <TabsOverflow label="More">
|
|
6623
|
+
* <TabsOverflowItem value="tips">Tips</TabsOverflowItem>
|
|
6624
|
+
* </TabsOverflow>
|
|
6625
|
+
* </TabsList>
|
|
6626
|
+
* </Tabs>
|
|
6627
|
+
* ```
|
|
6628
|
+
*/
|
|
6629
|
+
export declare const TabsOverflow: React_2.ForwardRefExoticComponent<TabsOverflowProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6630
|
+
|
|
6631
|
+
/**
|
|
6632
|
+
* A tab listed in a {@link TabsOverflow} menu. The active one takes the menu's
|
|
6633
|
+
* selected style and is announced as the checked option.
|
|
6634
|
+
*/
|
|
6635
|
+
export declare const TabsOverflowItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuItemProps, "onSelect" | "selected"> & {
|
|
6636
|
+
/** The tab's value, as on a {@link TabsTrigger}. */
|
|
6637
|
+
value: string;
|
|
6638
|
+
} & React_2.RefAttributes<HTMLDivElement>>;
|
|
6639
|
+
|
|
6640
|
+
/** Props for the {@link TabsOverflowItem} component. */
|
|
6641
|
+
export declare type TabsOverflowItemProps = Omit<DropdownMenuItemProps, "selected" | "onSelect"> & {
|
|
6642
|
+
/** The tab's value, as on a {@link TabsTrigger}. */
|
|
6643
|
+
value: string;
|
|
6644
|
+
};
|
|
6645
|
+
|
|
6646
|
+
/** Props for the {@link TabsOverflow} component. */
|
|
6647
|
+
export declare interface TabsOverflowProps extends Omit<TabsTriggerProps, "value" | "children" | "asChild"> {
|
|
6648
|
+
/** Text shown on the tab while none of its items is active, e.g. "More". */
|
|
6649
|
+
label: React_2.ReactNode;
|
|
6650
|
+
/** {@link TabsOverflowItem} elements, one per tab that doesn't fit the row. */
|
|
6651
|
+
children?: React_2.ReactNode;
|
|
6652
|
+
}
|
|
6653
|
+
|
|
6585
6654
|
/** Props for the {@link Tabs} root component. Extends Radix `Tabs.Root` props. */
|
|
6586
6655
|
export declare type TabsProps = React_2.ComponentPropsWithoutRef<typeof TabsPrimitive.Root>;
|
|
6587
6656
|
|
|
@@ -6593,6 +6662,8 @@ export declare type TabsProps = React_2.ComponentPropsWithoutRef<typeof TabsPrim
|
|
|
6593
6662
|
* href="…">…</Link></TabsTrigger>`). With `asChild` the child element becomes
|
|
6594
6663
|
* the tab itself (receiving `role="tab"` and focus management), so the tab
|
|
6595
6664
|
* stays a single interactive control rather than nesting one inside the other.
|
|
6665
|
+
*
|
|
6666
|
+
* Inside a `TabsList appearance="pill"` the tab takes the pill styling.
|
|
6596
6667
|
*/
|
|
6597
6668
|
export declare const TabsTrigger: React_2.ForwardRefExoticComponent<Omit<TabsPrimitive.TabsTriggerProps & React_2.RefAttributes<HTMLButtonElement>, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
6598
6669
|
|
package/dist/index.mjs
CHANGED
|
@@ -259,6 +259,7 @@ import { TablePagination } from "./components/Table/TablePagination.mjs";
|
|
|
259
259
|
import { Tabs } from "./components/Tabs/Tabs.mjs";
|
|
260
260
|
import { TabsContent } from "./components/Tabs/TabsContent.mjs";
|
|
261
261
|
import { TabsList } from "./components/Tabs/TabsList.mjs";
|
|
262
|
+
import { TabsOverflow, TabsOverflowItem } from "./components/Tabs/TabsOverflow.mjs";
|
|
262
263
|
import { TabsTrigger } from "./components/Tabs/TabsTrigger.mjs";
|
|
263
264
|
import { TextArea } from "./components/TextArea/TextArea.mjs";
|
|
264
265
|
import { TextField } from "./components/TextField/TextField.mjs";
|
|
@@ -580,6 +581,8 @@ export {
|
|
|
580
581
|
Tabs,
|
|
581
582
|
TabsContent,
|
|
582
583
|
TabsList,
|
|
584
|
+
TabsOverflow,
|
|
585
|
+
TabsOverflowItem,
|
|
583
586
|
TabsTrigger,
|
|
584
587
|
TagIcon,
|
|
585
588
|
TaskIcon,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|