@fanvue/ui 3.48.0 → 3.50.0
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/README.md +1 -1
- package/dist/animated-icons.d.ts +4 -1
- package/dist/charts.d.ts +37 -0
- package/dist/charts.mjs +2 -0
- package/dist/charts.mjs.map +1 -1
- package/dist/cjs/charts.cjs +2 -0
- package/dist/cjs/charts.cjs.map +1 -1
- package/dist/cjs/components/Alert/Alert.cjs +45 -36
- package/dist/cjs/components/Alert/Alert.cjs.map +1 -1
- package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs +7 -3
- package/dist/cjs/components/AnimatedNumber/AnimatedNumber.cjs.map +1 -1
- package/dist/cjs/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/cjs/components/Autocomplete/Autocomplete.cjs.map +1 -1
- package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs +1 -1
- package/dist/cjs/components/Autocomplete/AutocompleteDropdownContent.cjs.map +1 -1
- package/dist/cjs/components/Button/Button.cjs +1 -1
- package/dist/cjs/components/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/Chart/ChartGrid.cjs +40 -0
- package/dist/cjs/components/Chart/ChartGrid.cjs.map +1 -0
- package/dist/cjs/components/ChatInput/ChatInput.cjs +21 -11
- package/dist/cjs/components/ChatInput/ChatInput.cjs.map +1 -1
- package/dist/cjs/components/Dialog/Dialog.cjs +29 -23
- package/dist/cjs/components/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs +31 -34
- package/dist/cjs/components/DropdownMenu/DropdownMenuItem.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs +5 -4
- package/dist/cjs/components/DropdownMenu/DropdownMenuReorderItem.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs +10 -10
- package/dist/cjs/components/DropdownMenu/DropdownMenuRoot.cjs.map +1 -1
- package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs +12 -7
- package/dist/cjs/components/DropdownMenu/DropdownMenuSelectionItems.cjs.map +1 -1
- package/dist/cjs/components/EmptyState/EmptyState.cjs +9 -1
- package/dist/cjs/components/EmptyState/EmptyState.cjs.map +1 -1
- package/dist/cjs/components/IconButton/IconButton.cjs +8 -2
- package/dist/cjs/components/IconButton/IconButton.cjs.map +1 -1
- package/dist/cjs/components/Icons/BaseIcon.cjs +7 -2
- package/dist/cjs/components/Icons/BaseIcon.cjs.map +1 -1
- package/dist/cjs/components/Icons/IconDefaults.cjs +26 -0
- package/dist/cjs/components/Icons/IconDefaults.cjs.map +1 -0
- package/dist/cjs/components/Icons/MenuRowIcon.cjs +26 -0
- package/dist/cjs/components/Icons/MenuRowIcon.cjs.map +1 -0
- package/dist/cjs/components/Icons/SpinnerIcon.cjs +4 -2
- package/dist/cjs/components/Icons/SpinnerIcon.cjs.map +1 -1
- package/dist/cjs/components/Icons/iconSpinClass.cjs +6 -0
- package/dist/cjs/components/Icons/iconSpinClass.cjs.map +1 -0
- package/dist/cjs/components/Link/Link.cjs +7 -3
- package/dist/cjs/components/Link/Link.cjs.map +1 -1
- package/dist/cjs/components/Loader/Loader.cjs +1 -1
- package/dist/cjs/components/Loader/Loader.cjs.map +1 -1
- package/dist/cjs/components/MediaPlayChip/MediaPlayChip.cjs +56 -0
- package/dist/cjs/components/MediaPlayChip/MediaPlayChip.cjs.map +1 -0
- package/dist/cjs/components/Select/Select.cjs +13 -10
- package/dist/cjs/components/Select/Select.cjs.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.cjs +17 -1
- package/dist/cjs/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/cjs/components/Tabs/TabsList.cjs +3 -1
- package/dist/cjs/components/Tabs/TabsList.cjs.map +1 -1
- package/dist/cjs/components/Tabs/TabsListSkeleton.cjs +30 -0
- package/dist/cjs/components/Tabs/TabsListSkeleton.cjs.map +1 -0
- package/dist/cjs/components/UserItem/UserItem.cjs +6 -1
- package/dist/cjs/components/UserItem/UserItem.cjs.map +1 -1
- package/dist/cjs/index.cjs +5 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/components/Alert/Alert.mjs +45 -36
- package/dist/components/Alert/Alert.mjs.map +1 -1
- package/dist/components/AnimatedNumber/AnimatedNumber.mjs +7 -3
- package/dist/components/AnimatedNumber/AnimatedNumber.mjs.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.mjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.mjs.map +1 -1
- package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs +1 -1
- package/dist/components/Autocomplete/AutocompleteDropdownContent.mjs.map +1 -1
- package/dist/components/Button/Button.mjs +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Chart/ChartGrid.mjs +40 -0
- package/dist/components/Chart/ChartGrid.mjs.map +1 -0
- package/dist/components/ChatInput/ChatInput.mjs +21 -11
- package/dist/components/ChatInput/ChatInput.mjs.map +1 -1
- package/dist/components/Dialog/Dialog.mjs +29 -23
- package/dist/components/Dialog/Dialog.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs +32 -35
- package/dist/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs +5 -4
- package/dist/components/DropdownMenu/DropdownMenuReorderItem.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs +10 -10
- package/dist/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
- package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs +12 -7
- package/dist/components/DropdownMenu/DropdownMenuSelectionItems.mjs.map +1 -1
- package/dist/components/EmptyState/EmptyState.mjs +9 -1
- package/dist/components/EmptyState/EmptyState.mjs.map +1 -1
- package/dist/components/IconButton/IconButton.mjs +8 -2
- package/dist/components/IconButton/IconButton.mjs.map +1 -1
- package/dist/components/Icons/BaseIcon.mjs +7 -2
- package/dist/components/Icons/BaseIcon.mjs.map +1 -1
- package/dist/components/Icons/IconDefaults.mjs +9 -0
- package/dist/components/Icons/IconDefaults.mjs.map +1 -0
- package/dist/components/Icons/MenuRowIcon.mjs +26 -0
- package/dist/components/Icons/MenuRowIcon.mjs.map +1 -0
- package/dist/components/Icons/SpinnerIcon.mjs +4 -2
- package/dist/components/Icons/SpinnerIcon.mjs.map +1 -1
- package/dist/components/Icons/iconSpinClass.mjs +6 -0
- package/dist/components/Icons/iconSpinClass.mjs.map +1 -0
- package/dist/components/Link/Link.mjs +7 -3
- package/dist/components/Link/Link.mjs.map +1 -1
- package/dist/components/Loader/Loader.mjs +1 -1
- package/dist/components/Loader/Loader.mjs.map +1 -1
- package/dist/components/MediaPlayChip/MediaPlayChip.mjs +39 -0
- package/dist/components/MediaPlayChip/MediaPlayChip.mjs.map +1 -0
- package/dist/components/Select/Select.mjs +13 -10
- package/dist/components/Select/Select.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs +17 -1
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/components/Tabs/TabsList.mjs +3 -1
- package/dist/components/Tabs/TabsList.mjs.map +1 -1
- package/dist/components/Tabs/TabsListSkeleton.mjs +13 -0
- package/dist/components/Tabs/TabsListSkeleton.mjs.map +1 -0
- package/dist/components/UserItem/UserItem.mjs +6 -1
- package/dist/components/UserItem/UserItem.mjs.map +1 -1
- package/dist/index.d.ts +171 -18
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.mjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Shape variant of the skeleton placeholder. */\nexport type SkeletonVariant = \"text\" | \"circular\" | \"rectangular\" | \"rounded\";\n\n/** Animation style of the skeleton. `false` disables animation. */\nexport type SkeletonAnimation = \"pulse\" | \"wave\" | false;\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Shape variant of the skeleton.\n *\n * - `text` – a single line of text with slight vertical margin and rounded ends\n * - `circular` – a circle (width and height should match)\n * - `rectangular` – a sharp-cornered rectangle\n * - `rounded` – a rectangle with rounded corners\n *\n * @default \"text\"\n */\n variant?: SkeletonVariant;\n /** Animation style. Set to `false` to disable animation. @default \"pulse\" */\n animation?: SkeletonAnimation;\n /** Width of the skeleton. Accepts a CSS value (number is treated as `px`). */\n width?: number | string;\n /** Height of the skeleton. Accepts a CSS value (number is treated as `px`). */\n height?: number | string;\n}\n\nconst VARIANT_CLASSES: Record<SkeletonVariant, string> = {\n text: \"rounded my-0.5\",\n circular: \"rounded-full\",\n rectangular: \"\",\n rounded: \"rounded-xs\",\n};\n\n/**\n * A placeholder preview of content before data is loaded, reducing perceived\n * load time. Mirrors common MUI Skeleton props for easy migration.\n *\n * When used as a loading state, wrap the skeleton region with `aria-busy=\"true\"`\n * and provide an accessible label so screen readers can convey the loading state.\n *\n * @example\n * ```tsx\n * <Skeleton variant=\"text\" width={200} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * <Skeleton variant=\"rectangular\" width=\"100%\" height={120} />\n * ```\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n (\n {
|
|
1
|
+
{"version":3,"file":"Skeleton.mjs","sources":["../../../src/components/Skeleton/Skeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Shape variant of the skeleton placeholder. */\nexport type SkeletonVariant = \"text\" | \"circular\" | \"rectangular\" | \"rounded\";\n\n/** Corner radius of the skeleton, on the kit radius scale. */\nexport type SkeletonRadius = \"sm\" | \"md\" | \"lg\";\n\n/** Animation style of the skeleton. `false` disables animation. */\nexport type SkeletonAnimation = \"pulse\" | \"wave\" | false;\n\nexport interface SkeletonProps extends React.HTMLAttributes<HTMLSpanElement> {\n /** Shape variant of the skeleton.\n *\n * - `text` – a single line of text with slight vertical margin and rounded ends\n * - `circular` – a circle (width and height should match)\n * - `rectangular` – a sharp-cornered rectangle\n * - `rounded` – a rectangle with rounded corners\n *\n * @default \"text\"\n */\n variant?: SkeletonVariant;\n /**\n * Corner radius on the kit scale, so a skeleton can match the corners of the\n * surface it stands in for. Overrides the radius the `variant` sets.\n *\n * - `sm` – `--radius-sm` (12px)\n * - `md` – `--radius-md` (16px)\n * - `lg` – `--radius-lg` (24px)\n *\n * Leave unset to keep the variant's own radius.\n */\n radius?: SkeletonRadius;\n /** Animation style. Set to `false` to disable animation. @default \"pulse\" */\n animation?: SkeletonAnimation;\n /** Width of the skeleton. Accepts a CSS value (number is treated as `px`). */\n width?: number | string;\n /** Height of the skeleton. Accepts a CSS value (number is treated as `px`). */\n height?: number | string;\n}\n\nconst VARIANT_CLASSES: Record<SkeletonVariant, string> = {\n text: \"rounded my-0.5\",\n circular: \"rounded-full\",\n rectangular: \"\",\n rounded: \"rounded-xs\",\n};\n\nconst RADIUS_CLASSES: Record<SkeletonRadius, string> = {\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n};\n\n/**\n * A placeholder preview of content before data is loaded, reducing perceived\n * load time. Mirrors common MUI Skeleton props for easy migration.\n *\n * When used as a loading state, wrap the skeleton region with `aria-busy=\"true\"`\n * and provide an accessible label so screen readers can convey the loading state.\n *\n * @example\n * ```tsx\n * <Skeleton variant=\"text\" width={200} />\n * <Skeleton variant=\"circular\" width={40} height={40} />\n * <Skeleton variant=\"rectangular\" width=\"100%\" height={120} />\n * <Skeleton variant=\"rectangular\" radius=\"lg\" width=\"100%\" height={240} />\n * ```\n */\nexport const Skeleton = React.forwardRef<HTMLSpanElement, SkeletonProps>(\n (\n {\n className,\n variant = \"text\",\n radius,\n animation = \"pulse\",\n width,\n height,\n style,\n children,\n ...props\n },\n ref,\n ) => {\n const hasChildren = React.Children.count(children) > 0;\n const sizeStyle: React.CSSProperties = {\n ...style,\n ...(width !== undefined && {\n width: typeof width === \"number\" ? `${width}px` : width,\n }),\n ...(height !== undefined && {\n height: typeof height === \"number\" ? `${height}px` : height,\n }),\n };\n\n return (\n <span\n ref={ref}\n aria-hidden=\"true\"\n className={cn(\n \"block bg-[color-mix(in_srgb,var(--color-content-primary)_11%,var(--color-background-primary))]\",\n VARIANT_CLASSES[variant],\n radius && RADIUS_CLASSES[radius],\n variant === \"text\" && !height && !hasChildren && \"h-[1em]\",\n animation === \"pulse\" && \"animate-pulse\",\n animation === \"wave\" && \"fv-skeleton-wave\",\n hasChildren && \"relative overflow-hidden [&>*]:invisible\",\n className,\n )}\n style={sizeStyle}\n {...props}\n >\n {children}\n </span>\n );\n },\n);\n\nSkeleton.displayName = \"Skeleton\";\n"],"names":[],"mappings":";;;;AA0CA,MAAM,kBAAmD;AAAA,EACvD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,aAAa;AAAA,EACb,SAAS;AACX;AAEA,MAAM,iBAAiD;AAAA,EACrD,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AACN;AAiBO,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,UAAM,cAAc,MAAM,SAAS,MAAM,QAAQ,IAAI;AACrD,UAAM,YAAiC;AAAA,MACrC,GAAG;AAAA,MACH,GAAI,UAAU,UAAa;AAAA,QACzB,OAAO,OAAO,UAAU,WAAW,GAAG,KAAK,OAAO;AAAA,MAAA;AAAA,MAEpD,GAAI,WAAW,UAAa;AAAA,QAC1B,QAAQ,OAAO,WAAW,WAAW,GAAG,MAAM,OAAO;AAAA,MAAA;AAAA,IACvD;AAGF,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,eAAY;AAAA,QACZ,WAAW;AAAA,UACT;AAAA,UACA,gBAAgB,OAAO;AAAA,UACvB,UAAU,eAAe,MAAM;AAAA,UAC/B,YAAY,UAAU,CAAC,UAAU,CAAC,eAAe;AAAA,UACjD,cAAc,WAAW;AAAA,UACzB,cAAc,UAAU;AAAA,UACxB,eAAe;AAAA,UACf;AAAA,QAAA;AAAA,QAEF,OAAO;AAAA,QACN,GAAG;AAAA,QAEH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGP;AACF;AAEA,SAAS,cAAc;"}
|
|
@@ -4,6 +4,7 @@ import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { cn } from "../../utils/cn.mjs";
|
|
6
6
|
const TabsAppearanceContext = React.createContext({ appearance: "underline", size: "32" });
|
|
7
|
+
const PILL_TRACK_CLASS = "bg-(image:--fv-raised-control-fill) inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-(--fv-raised-control-shadow) [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
7
8
|
const PILL_EASE = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
8
9
|
const PILL_STEP_MS = 360;
|
|
9
10
|
const PILL_STEP_MS_TOUCH = 200;
|
|
@@ -242,7 +243,7 @@ const TabsList = React.forwardRef(
|
|
|
242
243
|
// context. Without it, `relative` alone creates no stacking context, so
|
|
243
244
|
// the indicator escapes and paints above page chrome (e.g. the header).
|
|
244
245
|
"relative isolate",
|
|
245
|
-
isPill ?
|
|
246
|
+
isPill ? PILL_TRACK_CLASS : [
|
|
246
247
|
getLayoutClass(variant, fullWidth, alignLeft),
|
|
247
248
|
// Horizontal only: in the vertical orientation the leading padding is
|
|
248
249
|
// the row's left inset, not a label offset, so zeroing it would pull
|
|
@@ -280,6 +281,7 @@ const TabsList = React.forwardRef(
|
|
|
280
281
|
);
|
|
281
282
|
TabsList.displayName = "TabsList";
|
|
282
283
|
export {
|
|
284
|
+
PILL_TRACK_CLASS,
|
|
283
285
|
TabsAppearanceContext,
|
|
284
286
|
TabsList
|
|
285
287
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabsList.mjs","sources":["../../../src/components/Tabs/TabsList.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Breakpoint values for responsive props. */\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Visual style of a {@link TabsList}. */\nexport type TabsListAppearance = \"underline\" | \"pill\";\n\n/** Height in pixels of each tab in a pill {@link TabsList}. */\nexport type TabsListPillSize = \"32\" | \"36\";\n\nexport const TabsAppearanceContext = React.createContext<{\n appearance: TabsListAppearance;\n size: TabsListPillSize;\n}>({ appearance: \"underline\", size: \"32\" });\n\ntype TabBox = { left: number; top: number; width: number; height: number };\n\nconst PILL_EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\nconst PILL_STEP_MS = 360;\nconst PILL_STEP_MS_TOUCH = 200;\nconst PILL_EXTRA_STEP_MS = 220;\nconst PILL_MAX_MS = 1000;\n/** Share of a slide by which the eased pill has covered 80% of the way, so the label recolours under it. */\nconst PILL_ARRIVAL_SHARE = 0.27;\n\nfunction pillStepMs(canHover: boolean) {\n return canHover ? PILL_STEP_MS : PILL_STEP_MS_TOUCH;\n}\n\nfunction pillSlideMs(distance: number, canHover: boolean) {\n if (!canHover) return PILL_STEP_MS_TOUCH;\n return Math.min(PILL_STEP_MS + Math.max(distance - 1, 0) * PILL_EXTRA_STEP_MS, PILL_MAX_MS);\n}\n\nconst prefersReducedMotion = () =>\n window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches ?? false;\n\nfunction pillTarget(list: HTMLElement, hovered: HTMLElement | null, activeTab: HTMLElement) {\n return (\n list.querySelector<HTMLElement>('[role=\"tab\"][aria-expanded=\"true\"]') ??\n (hovered?.isConnected ? hovered : activeTab)\n );\n}\n\nfunction measureTabs(list: HTMLElement, observer: ResizeObserver | null) {\n const boxes = new Map<Element, TabBox>();\n const order = new Map<Element, number>();\n for (const tab of list.querySelectorAll<HTMLElement>('[role=\"tab\"]')) {\n observer?.observe(tab);\n order.set(tab, order.size);\n boxes.set(tab, {\n left: tab.offsetLeft,\n top: tab.offsetTop,\n width: tab.offsetWidth,\n height: tab.offsetHeight,\n });\n }\n return { boxes, order };\n}\n\nfunction slideFromPrevious(\n list: HTMLElement,\n previous: Map<Element, TabBox>,\n next: Map<Element, TabBox>,\n durationMs: number,\n) {\n const moved: HTMLElement[] = [];\n for (const [tab, box] of next) {\n const before = previous.get(tab);\n if (!before || before.left === box.left || !(tab instanceof HTMLElement)) continue;\n tab.style.transition = \"none\";\n tab.style.transform = `translateX(${before.left - box.left}px)`;\n moved.push(tab);\n }\n if (moved.length === 0) return;\n list.getBoundingClientRect();\n for (const tab of moved) {\n tab.style.transition = `transform ${durationMs}ms var(--pill-ease)`;\n tab.style.transform = \"\";\n const settle = (event: TransitionEvent) => {\n if (event.propertyName !== \"transform\") return;\n tab.style.transition = \"\";\n tab.removeEventListener(\"transitionend\", settle);\n };\n tab.addEventListener(\"transitionend\", settle);\n }\n}\n\nconst alignLeftClasses: Record<Breakpoint | \"always\", string> = {\n always: \"[&>[role=tab]]:flex-initial\",\n sm: \"[&>[role=tab]]:sm:flex-initial\",\n md: \"[&>[role=tab]]:md:flex-initial\",\n lg: \"[&>[role=tab]]:lg:flex-initial\",\n xl: \"[&>[role=tab]]:xl:flex-initial\",\n};\n\nfunction getLayoutClass(\n variant: \"fill\" | \"hug\" | undefined,\n fullWidth: boolean,\n alignLeft?: boolean | Breakpoint,\n): string {\n if (variant === \"hug\") return \"inline-flex\";\n if (variant === \"fill\") return \"flex w-full [&>[role=tab]]:flex-1\";\n\n if (!fullWidth) return \"inline-flex\";\n\n const base = \"flex w-full [&>[role=tab]]:flex-1\";\n if (alignLeft === true) return `${base} ${alignLeftClasses.always}`;\n if (typeof alignLeft === \"string\") return `${base} ${alignLeftClasses[alignLeft]}`;\n return base;\n}\n\n/** Props for the {@link TabsList} component. */\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n /** 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. */\n fullWidth?: boolean;\n /**\n * Controls tab alignment within a full-width container.\n * - `false` (default): tabs spread evenly\n * - `true`: tabs left-aligned, sized to content\n * - `\"md\"` (breakpoint): spread on mobile, left-aligned at breakpoint and up\n */\n alignLeft?: boolean | Breakpoint;\n /** Explicit layout variant. `\"hug\"` sizes the list to its content; `\"fill\"` stretches it full-width with equal-width tabs. Takes precedence over `fullWidth`/`alignLeft`. */\n variant?: \"fill\" | \"hug\";\n /**\n * Drops the leading padding on the first tab so its label sits flush with the\n * list's left edge, lining it up with page content above or below the bar\n * (a heading, for instance) rather than being indented by the tab's own\n * padding. Spacing between tabs is unaffected. Pair with `alignLeft` or\n * `variant=\"hug\"`. @default false\n */\n flushLeft?: boolean;\n /**\n * Scrolls the row horizontally when the tabs don't fit, instead of letting\n * them compress. By default a tab may shrink until its label ellipsises,\n * which on a narrow viewport can truncate every label at once; here each tab\n * keeps its natural width and the overflow scrolls. The scrollbar itself is\n * hidden — the clipped tab at the edge is the affordance.\n *\n * Because the tabs are content-sized, they no longer spread to fill the row:\n * a set that does fit sits left-aligned, as with `alignLeft`.\n *\n * Horizontal orientation only: a vertical list already grows downwards.\n * @default false\n */\n scrollable?: boolean;\n /**\n * `\"underline\"` marks the active tab with a line under the row. `\"pill\"` sits\n * the tabs in a rounded track, sized to its tabs, and slides a filled pill\n * behind the active one. A pill list is horizontal and ignores `fullWidth`,\n * `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.\n * @default \"underline\"\n */\n appearance?: TabsListAppearance;\n /** Height of each tab in a pill list. Ignored by the underline appearance. @default \"32\" */\n size?: TabsListPillSize;\n /**\n * Pill only: the pill follows the mouse across the tabs and settles back on the\n * selected one when the pointer leaves. Mouse only, and off when the user prefers\n * reduced motion. @default false\n */\n followHover?: boolean;\n};\n\n/** Container for {@link TabsTrigger} elements. Renders a sliding active-tab indicator that animates between tabs. */\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n TabsListProps\n>(\n (\n {\n className,\n children,\n fullWidth = true,\n alignLeft,\n variant,\n flushLeft = false,\n scrollable = false,\n appearance = \"underline\",\n size = \"32\",\n followHover = false,\n onPointerOver,\n onPointerLeave,\n style,\n ...props\n },\n ref,\n ) => {\n const innerRef = React.useRef<HTMLDivElement>(null);\n const indicatorRef = React.useRef<HTMLSpanElement>(null);\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement);\n\n const tabBoxes = React.useRef(new Map<Element, TabBox>());\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n const listWidth = React.useRef<number | null>(null);\n const hoveredTab = React.useRef<HTMLElement | null>(null);\n const pillTab = React.useRef<HTMLElement | null>(null);\n const tabOrder = React.useRef(new Map<Element, number>());\n const canHover = React.useRef(false);\n\n const placePill = React.useCallback((tab: HTMLElement) => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n const box = tabBoxes.current.get(tab);\n if (!box) return;\n const from = pillTab.current;\n pillTab.current = tab;\n const distance =\n from && from !== tab\n ? Math.abs((tabOrder.current.get(tab) ?? 0) - (tabOrder.current.get(from) ?? 0))\n : 0;\n const slideMs = pillSlideMs(distance, canHover.current);\n list.style.setProperty(\"--pill-slide\", `${slideMs}ms`);\n list.style.setProperty(\"--pill-arrive\", `${Math.round(slideMs * PILL_ARRIVAL_SHARE)}ms`);\n indicator.style.width = `${box.width}px`;\n indicator.style.height = `${box.height}px`;\n indicator.style.transform = `translate(${box.left}px, ${box.top}px)`;\n for (const marked of list.querySelectorAll(\"[data-pill]\")) {\n if (marked !== tab) marked.removeAttribute(\"data-pill\");\n }\n tab.setAttribute(\"data-pill\", \"\");\n }, []);\n\n const layoutPill = React.useCallback(\n (list: HTMLElement, indicator: HTMLElement, activeTab: HTMLElement) => {\n indicator.style.background = \"var(--color-content-primary)\";\n indicator.style.inset = \"0 auto auto 0\";\n const previous = tabBoxes.current;\n const rowResized = listWidth.current !== null && listWidth.current !== list.offsetWidth;\n listWidth.current = list.offsetWidth;\n const { boxes, order } = measureTabs(list, resizeObserverRef.current);\n tabBoxes.current = boxes;\n tabOrder.current = order;\n if (!rowResized && previous.size > 0 && !prefersReducedMotion()) {\n slideFromPrevious(list, previous, boxes, pillStepMs(canHover.current));\n }\n placePill(pillTarget(list, hoveredTab.current, activeTab));\n },\n [placePill],\n );\n\n const updateIndicator = React.useCallback(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) {\n indicator.style.opacity = \"0\";\n list.querySelector(\"[data-pill]\")?.removeAttribute(\"data-pill\");\n return;\n }\n\n const isVertical = list.dataset.orientation === \"vertical\";\n\n indicator.style.opacity = \"1\";\n\n if (appearance === \"pill\") {\n layoutPill(list, indicator, activeTab);\n } else if (isVertical) {\n indicator.style.background =\n \"linear-gradient(180deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = `0 -1px auto auto`;\n indicator.style.width = \"1px\";\n indicator.style.height = `${activeTab.offsetHeight}px`;\n indicator.style.transform = `translateY(${activeTab.offsetTop}px)`;\n } else {\n indicator.style.background =\n \"linear-gradient(90deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = \"auto auto 0 0\";\n indicator.style.height = \"1px\";\n indicator.style.width = `${activeTab.offsetWidth}px`;\n indicator.style.transform = `translateX(${activeTab.offsetLeft}px)`;\n }\n }, [appearance, layoutPill]);\n\n const followsHover = appearance === \"pill\" && followHover;\n\n const handlePointerOver = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerOver?.(event);\n if (!followsHover || event.pointerType !== \"mouse\") return;\n if (prefersReducedMotion()) return;\n const tab = (event.target as Element).closest<HTMLElement>('[role=\"tab\"]');\n if (!tab || tab === hoveredTab.current || !event.currentTarget.contains(tab)) return;\n hoveredTab.current = tab;\n placePill(pillTarget(event.currentTarget, tab, tab));\n };\n\n const handlePointerLeave = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n if (!hoveredTab.current) return;\n hoveredTab.current = null;\n const list = innerRef.current;\n const activeTab = list?.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (list && activeTab) placePill(pillTarget(list, null, activeTab));\n };\n\n // Radix scrolls a tab into view when it takes focus, and mount is not focus, so\n // URL-driven state can land on a tab that is off to the right with nothing on\n // screen to say so: no indicator, and tab one showing as though it were active.\n // Assigns `scrollLeft` rather than calling `scrollIntoView`, which would also\n // scroll every ancestor and the page with it. Only ever scrolls further right, so\n // re-running it after the webfont settles corrects a short initial scroll without\n // yanking the row back from wherever the user has since dragged it.\n const revealActiveTab = React.useCallback(() => {\n const list = innerRef.current;\n const scrolls = scrollable || appearance === \"pill\";\n if (!list || !scrolls || list.dataset.orientation === \"vertical\") return;\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) return;\n const overshoot = activeTab.offsetLeft + activeTab.offsetWidth - list.clientWidth;\n if (overshoot > list.scrollLeft) list.scrollLeft = overshoot;\n }, [scrollable, appearance]);\n\n React.useLayoutEffect(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n canHover.current = window.matchMedia?.(\"(hover: hover)\").matches ?? false;\n\n const resizeObserver = new ResizeObserver(updateIndicator);\n resizeObserver.observe(list);\n resizeObserverRef.current = resizeObserver;\n\n indicator.style.transitionDuration = \"0s\";\n updateIndicator();\n indicator.getBoundingClientRect();\n indicator.style.transitionDuration = \"\";\n revealActiveTab();\n\n const mutationObserver = new MutationObserver(updateIndicator);\n mutationObserver.observe(list, {\n attributes: true,\n attributeFilter: [\"data-state\", \"aria-expanded\"],\n childList: true,\n subtree: true,\n });\n\n let cancelled = false;\n if (document.fonts?.status !== \"loaded\") {\n document.fonts?.ready.then(() => {\n if (cancelled) return;\n updateIndicator();\n // The tabs are wider once the real font is in, so the mount-time scroll can\n // fall short of the active tab. Recomputed here against the settled layout.\n revealActiveTab();\n });\n }\n\n return () => {\n cancelled = true;\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [updateIndicator, revealActiveTab]);\n\n const isPill = appearance === \"pill\";\n const listStyle: React.CSSProperties & { \"--pill-ease\"?: string } = isPill\n ? { \"--pill-ease\": PILL_EASE, ...style }\n : { ...style };\n\n return (\n <TabsAppearanceContext.Provider value={{ appearance, size }}>\n <TabsPrimitive.List\n ref={innerRef}\n onPointerOver={handlePointerOver}\n onPointerLeave={handlePointerLeave}\n style={listStyle}\n className={cn(\n // `isolate` scopes the active indicator's `z-10` to a local stacking\n // context. Without it, `relative` alone creates no stacking context, so\n // the indicator escapes and paints above page chrome (e.g. the header).\n \"relative isolate\",\n isPill\n ? \"bg-(image:--fv-raised-control-fill) inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-(--fv-raised-control-shadow) [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n : [\n getLayoutClass(variant, fullWidth, alignLeft),\n // Horizontal only: in the vertical orientation the leading padding is\n // the row's left inset, not a label offset, so zeroing it would pull\n // the first label out of line with the others.\n flushLeft && \"data-[orientation=horizontal]:[&>[role=tab]:first-child]:pl-0\",\n // `flex-none` is what stops the tabs compressing — without it they\n // share the row and never overflow, so there is nothing to scroll.\n // The scrollbar is hidden in both engines: Firefox reads\n // `scrollbar-width`, WebKit and Blink the pseudo-element.\n scrollable &&\n \"data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:[scrollbar-width:none] data-[orientation=horizontal]:[&::-webkit-scrollbar]:hidden data-[orientation=horizontal]:[&>[role=tab]]:flex-none\",\n \"data-[orientation=horizontal]:items-center data-[orientation=horizontal]:shadow-[inset_0_-1px_0_0_var(--color-border-primary)]\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:shadow-[inset_-1px_0_0_0_var(--color-border-primary)]\",\n ],\n className,\n )}\n {...props}\n >\n {children}\n <span\n ref={indicatorRef}\n aria-hidden\n className={cn(\n \"pointer-events-none absolute rounded-full motion-safe:transition-[transform,width,height]\",\n isPill\n ? \"z-5 shadow-(--fv-raised-control-thumb-shadow) motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)\"\n : \"z-10 motion-safe:duration-200 motion-safe:ease-in-out\",\n )}\n style={{ opacity: 0 }}\n />\n </TabsPrimitive.List>\n </TabsAppearanceContext.Provider>\n );\n },\n);\n\nTabsList.displayName = \"TabsList\";\n"],"names":[],"mappings":";;;;;AAaO,MAAM,wBAAwB,MAAM,cAGxC,EAAE,YAAY,aAAa,MAAM,MAAM;AAI1C,MAAM,YAAY;AAClB,MAAM,eAAe;AACrB,MAAM,qBAAqB;AAC3B,MAAM,qBAAqB;AAC3B,MAAM,cAAc;AAEpB,MAAM,qBAAqB;AAE3B,SAAS,WAAW,UAAmB;AACrC,SAAO,WAAW,eAAe;AACnC;AAEA,SAAS,YAAY,UAAkB,UAAmB;AACxD,MAAI,CAAC,SAAU,QAAO;AACtB,SAAO,KAAK,IAAI,eAAe,KAAK,IAAI,WAAW,GAAG,CAAC,IAAI,oBAAoB,WAAW;AAC5F;AAEA,MAAM,uBAAuB,MAC3B,OAAO,aAAa,kCAAkC,EAAE,WAAW;AAErE,SAAS,WAAW,MAAmB,SAA6B,WAAwB;AAC1F,SACE,KAAK,cAA2B,oCAAoC,MACnE,SAAS,cAAc,UAAU;AAEtC;AAEA,SAAS,YAAY,MAAmB,UAAiC;AACvE,QAAM,4BAAY,IAAA;AAClB,QAAM,4BAAY,IAAA;AAClB,aAAW,OAAO,KAAK,iBAA8B,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Y,QACnD,UAAA;AAAA,MAAC,cAAc;AAAA,MAAd;AAAA,QACC,KAAK;AAAA,QACL,eAAe;AAAA,QACf,gBAAgB;AAAA,QAChB,OAAO;AAAA,QACP,WAAW;AAAA;AAAA;AAAA;AAAA,UAIT;AAAA,UACA,SACI,0OACA;AAAA,YACE,eAAe,SAAS,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA,YAI5C,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA,YAKb,cACE;AAAA,YACF;AAAA,YACA;AAAA,UAAA;AAAA,UAEN;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA;AAAA,UACD;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAK;AAAA,cACL,eAAW;AAAA,cACX,WAAW;AAAA,gBACT;AAAA,gBACA,SACI,qHACA;AAAA,cAAA;AAAA,cAEN,OAAO,EAAE,SAAS,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,QACtB;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;"}
|
|
1
|
+
{"version":3,"file":"TabsList.mjs","sources":["../../../src/components/Tabs/TabsList.tsx"],"sourcesContent":["import * as TabsPrimitive from \"@radix-ui/react-tabs\";\nimport * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\n\n/** Breakpoint values for responsive props. */\ntype Breakpoint = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\n/** Visual style of a {@link TabsList}. */\nexport type TabsListAppearance = \"underline\" | \"pill\";\n\n/** Height in pixels of each tab in a pill {@link TabsList}. */\nexport type TabsListPillSize = \"32\" | \"36\";\n\nexport const TabsAppearanceContext = React.createContext<{\n appearance: TabsListAppearance;\n size: TabsListPillSize;\n}>({ appearance: \"underline\", size: \"32\" });\n\ntype TabBox = { left: number; top: number; width: number; height: number };\n\n/** Track styling shared by the pill {@link TabsList} and {@link TabsListSkeleton}. */\nexport const PILL_TRACK_CLASS =\n \"bg-(image:--fv-raised-control-fill) inline-flex w-fit max-w-full items-center gap-1 overflow-x-auto rounded-full bg-background-secondary p-1 shadow-(--fv-raised-control-shadow) [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\";\n\nconst PILL_EASE = \"cubic-bezier(0.22, 1, 0.36, 1)\";\nconst PILL_STEP_MS = 360;\nconst PILL_STEP_MS_TOUCH = 200;\nconst PILL_EXTRA_STEP_MS = 220;\nconst PILL_MAX_MS = 1000;\n/** Share of a slide by which the eased pill has covered 80% of the way, so the label recolours under it. */\nconst PILL_ARRIVAL_SHARE = 0.27;\n\nfunction pillStepMs(canHover: boolean) {\n return canHover ? PILL_STEP_MS : PILL_STEP_MS_TOUCH;\n}\n\nfunction pillSlideMs(distance: number, canHover: boolean) {\n if (!canHover) return PILL_STEP_MS_TOUCH;\n return Math.min(PILL_STEP_MS + Math.max(distance - 1, 0) * PILL_EXTRA_STEP_MS, PILL_MAX_MS);\n}\n\nconst prefersReducedMotion = () =>\n window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches ?? false;\n\nfunction pillTarget(list: HTMLElement, hovered: HTMLElement | null, activeTab: HTMLElement) {\n return (\n list.querySelector<HTMLElement>('[role=\"tab\"][aria-expanded=\"true\"]') ??\n (hovered?.isConnected ? hovered : activeTab)\n );\n}\n\nfunction measureTabs(list: HTMLElement, observer: ResizeObserver | null) {\n const boxes = new Map<Element, TabBox>();\n const order = new Map<Element, number>();\n for (const tab of list.querySelectorAll<HTMLElement>('[role=\"tab\"]')) {\n observer?.observe(tab);\n order.set(tab, order.size);\n boxes.set(tab, {\n left: tab.offsetLeft,\n top: tab.offsetTop,\n width: tab.offsetWidth,\n height: tab.offsetHeight,\n });\n }\n return { boxes, order };\n}\n\nfunction slideFromPrevious(\n list: HTMLElement,\n previous: Map<Element, TabBox>,\n next: Map<Element, TabBox>,\n durationMs: number,\n) {\n const moved: HTMLElement[] = [];\n for (const [tab, box] of next) {\n const before = previous.get(tab);\n if (!before || before.left === box.left || !(tab instanceof HTMLElement)) continue;\n tab.style.transition = \"none\";\n tab.style.transform = `translateX(${before.left - box.left}px)`;\n moved.push(tab);\n }\n if (moved.length === 0) return;\n list.getBoundingClientRect();\n for (const tab of moved) {\n tab.style.transition = `transform ${durationMs}ms var(--pill-ease)`;\n tab.style.transform = \"\";\n const settle = (event: TransitionEvent) => {\n if (event.propertyName !== \"transform\") return;\n tab.style.transition = \"\";\n tab.removeEventListener(\"transitionend\", settle);\n };\n tab.addEventListener(\"transitionend\", settle);\n }\n}\n\nconst alignLeftClasses: Record<Breakpoint | \"always\", string> = {\n always: \"[&>[role=tab]]:flex-initial\",\n sm: \"[&>[role=tab]]:sm:flex-initial\",\n md: \"[&>[role=tab]]:md:flex-initial\",\n lg: \"[&>[role=tab]]:lg:flex-initial\",\n xl: \"[&>[role=tab]]:xl:flex-initial\",\n};\n\nfunction getLayoutClass(\n variant: \"fill\" | \"hug\" | undefined,\n fullWidth: boolean,\n alignLeft?: boolean | Breakpoint,\n): string {\n if (variant === \"hug\") return \"inline-flex\";\n if (variant === \"fill\") return \"flex w-full [&>[role=tab]]:flex-1\";\n\n if (!fullWidth) return \"inline-flex\";\n\n const base = \"flex w-full [&>[role=tab]]:flex-1\";\n if (alignLeft === true) return `${base} ${alignLeftClasses.always}`;\n if (typeof alignLeft === \"string\") return `${base} ${alignLeftClasses[alignLeft]}`;\n return base;\n}\n\n/** Props for the {@link TabsList} component. */\nexport type TabsListProps = React.ComponentPropsWithoutRef<typeof TabsPrimitive.List> & {\n /** 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. */\n fullWidth?: boolean;\n /**\n * Controls tab alignment within a full-width container.\n * - `false` (default): tabs spread evenly\n * - `true`: tabs left-aligned, sized to content\n * - `\"md\"` (breakpoint): spread on mobile, left-aligned at breakpoint and up\n */\n alignLeft?: boolean | Breakpoint;\n /** Explicit layout variant. `\"hug\"` sizes the list to its content; `\"fill\"` stretches it full-width with equal-width tabs. Takes precedence over `fullWidth`/`alignLeft`. */\n variant?: \"fill\" | \"hug\";\n /**\n * Drops the leading padding on the first tab so its label sits flush with the\n * list's left edge, lining it up with page content above or below the bar\n * (a heading, for instance) rather than being indented by the tab's own\n * padding. Spacing between tabs is unaffected. Pair with `alignLeft` or\n * `variant=\"hug\"`. @default false\n */\n flushLeft?: boolean;\n /**\n * Scrolls the row horizontally when the tabs don't fit, instead of letting\n * them compress. By default a tab may shrink until its label ellipsises,\n * which on a narrow viewport can truncate every label at once; here each tab\n * keeps its natural width and the overflow scrolls. The scrollbar itself is\n * hidden — the clipped tab at the edge is the affordance.\n *\n * Because the tabs are content-sized, they no longer spread to fill the row:\n * a set that does fit sits left-aligned, as with `alignLeft`.\n *\n * Horizontal orientation only: a vertical list already grows downwards.\n * @default false\n */\n scrollable?: boolean;\n /**\n * `\"underline\"` marks the active tab with a line under the row. `\"pill\"` sits\n * the tabs in a rounded track, sized to its tabs, and slides a filled pill\n * behind the active one. A pill list is horizontal and ignores `fullWidth`,\n * `alignLeft`, `variant` and `flushLeft`; it scrolls when it doesn't fit.\n * @default \"underline\"\n */\n appearance?: TabsListAppearance;\n /** Height of each tab in a pill list. Ignored by the underline appearance. @default \"32\" */\n size?: TabsListPillSize;\n /**\n * Pill only: the pill follows the mouse across the tabs and settles back on the\n * selected one when the pointer leaves. Mouse only, and off when the user prefers\n * reduced motion. @default false\n */\n followHover?: boolean;\n};\n\n/** Container for {@link TabsTrigger} elements. Renders a sliding active-tab indicator that animates between tabs. */\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof TabsPrimitive.List>,\n TabsListProps\n>(\n (\n {\n className,\n children,\n fullWidth = true,\n alignLeft,\n variant,\n flushLeft = false,\n scrollable = false,\n appearance = \"underline\",\n size = \"32\",\n followHover = false,\n onPointerOver,\n onPointerLeave,\n style,\n ...props\n },\n ref,\n ) => {\n const innerRef = React.useRef<HTMLDivElement>(null);\n const indicatorRef = React.useRef<HTMLSpanElement>(null);\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement);\n\n const tabBoxes = React.useRef(new Map<Element, TabBox>());\n const resizeObserverRef = React.useRef<ResizeObserver | null>(null);\n const listWidth = React.useRef<number | null>(null);\n const hoveredTab = React.useRef<HTMLElement | null>(null);\n const pillTab = React.useRef<HTMLElement | null>(null);\n const tabOrder = React.useRef(new Map<Element, number>());\n const canHover = React.useRef(false);\n\n const placePill = React.useCallback((tab: HTMLElement) => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n const box = tabBoxes.current.get(tab);\n if (!box) return;\n const from = pillTab.current;\n pillTab.current = tab;\n const distance =\n from && from !== tab\n ? Math.abs((tabOrder.current.get(tab) ?? 0) - (tabOrder.current.get(from) ?? 0))\n : 0;\n const slideMs = pillSlideMs(distance, canHover.current);\n list.style.setProperty(\"--pill-slide\", `${slideMs}ms`);\n list.style.setProperty(\"--pill-arrive\", `${Math.round(slideMs * PILL_ARRIVAL_SHARE)}ms`);\n indicator.style.width = `${box.width}px`;\n indicator.style.height = `${box.height}px`;\n indicator.style.transform = `translate(${box.left}px, ${box.top}px)`;\n for (const marked of list.querySelectorAll(\"[data-pill]\")) {\n if (marked !== tab) marked.removeAttribute(\"data-pill\");\n }\n tab.setAttribute(\"data-pill\", \"\");\n }, []);\n\n const layoutPill = React.useCallback(\n (list: HTMLElement, indicator: HTMLElement, activeTab: HTMLElement) => {\n indicator.style.background = \"var(--color-content-primary)\";\n indicator.style.inset = \"0 auto auto 0\";\n const previous = tabBoxes.current;\n const rowResized = listWidth.current !== null && listWidth.current !== list.offsetWidth;\n listWidth.current = list.offsetWidth;\n const { boxes, order } = measureTabs(list, resizeObserverRef.current);\n tabBoxes.current = boxes;\n tabOrder.current = order;\n if (!rowResized && previous.size > 0 && !prefersReducedMotion()) {\n slideFromPrevious(list, previous, boxes, pillStepMs(canHover.current));\n }\n placePill(pillTarget(list, hoveredTab.current, activeTab));\n },\n [placePill],\n );\n\n const updateIndicator = React.useCallback(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) {\n indicator.style.opacity = \"0\";\n list.querySelector(\"[data-pill]\")?.removeAttribute(\"data-pill\");\n return;\n }\n\n const isVertical = list.dataset.orientation === \"vertical\";\n\n indicator.style.opacity = \"1\";\n\n if (appearance === \"pill\") {\n layoutPill(list, indicator, activeTab);\n } else if (isVertical) {\n indicator.style.background =\n \"linear-gradient(180deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = `0 -1px auto auto`;\n indicator.style.width = \"1px\";\n indicator.style.height = `${activeTab.offsetHeight}px`;\n indicator.style.transform = `translateY(${activeTab.offsetTop}px)`;\n } else {\n indicator.style.background =\n \"linear-gradient(90deg, var(--color-buttons-tertiary-default) 0%, var(--color-tab-active) 50%, var(--color-buttons-tertiary-default) 100%)\";\n indicator.style.inset = \"auto auto 0 0\";\n indicator.style.height = \"1px\";\n indicator.style.width = `${activeTab.offsetWidth}px`;\n indicator.style.transform = `translateX(${activeTab.offsetLeft}px)`;\n }\n }, [appearance, layoutPill]);\n\n const followsHover = appearance === \"pill\" && followHover;\n\n const handlePointerOver = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerOver?.(event);\n if (!followsHover || event.pointerType !== \"mouse\") return;\n if (prefersReducedMotion()) return;\n const tab = (event.target as Element).closest<HTMLElement>('[role=\"tab\"]');\n if (!tab || tab === hoveredTab.current || !event.currentTarget.contains(tab)) return;\n hoveredTab.current = tab;\n placePill(pillTarget(event.currentTarget, tab, tab));\n };\n\n const handlePointerLeave = (event: React.PointerEvent<HTMLDivElement>) => {\n onPointerLeave?.(event);\n if (!hoveredTab.current) return;\n hoveredTab.current = null;\n const list = innerRef.current;\n const activeTab = list?.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (list && activeTab) placePill(pillTarget(list, null, activeTab));\n };\n\n // Radix scrolls a tab into view when it takes focus, and mount is not focus, so\n // URL-driven state can land on a tab that is off to the right with nothing on\n // screen to say so: no indicator, and tab one showing as though it were active.\n // Assigns `scrollLeft` rather than calling `scrollIntoView`, which would also\n // scroll every ancestor and the page with it. Only ever scrolls further right, so\n // re-running it after the webfont settles corrects a short initial scroll without\n // yanking the row back from wherever the user has since dragged it.\n const revealActiveTab = React.useCallback(() => {\n const list = innerRef.current;\n const scrolls = scrollable || appearance === \"pill\";\n if (!list || !scrolls || list.dataset.orientation === \"vertical\") return;\n const activeTab = list.querySelector<HTMLElement>('[data-state=\"active\"]');\n if (!activeTab) return;\n const overshoot = activeTab.offsetLeft + activeTab.offsetWidth - list.clientWidth;\n if (overshoot > list.scrollLeft) list.scrollLeft = overshoot;\n }, [scrollable, appearance]);\n\n React.useLayoutEffect(() => {\n const list = innerRef.current;\n const indicator = indicatorRef.current;\n if (!list || !indicator) return;\n\n canHover.current = window.matchMedia?.(\"(hover: hover)\").matches ?? false;\n\n const resizeObserver = new ResizeObserver(updateIndicator);\n resizeObserver.observe(list);\n resizeObserverRef.current = resizeObserver;\n\n indicator.style.transitionDuration = \"0s\";\n updateIndicator();\n indicator.getBoundingClientRect();\n indicator.style.transitionDuration = \"\";\n revealActiveTab();\n\n const mutationObserver = new MutationObserver(updateIndicator);\n mutationObserver.observe(list, {\n attributes: true,\n attributeFilter: [\"data-state\", \"aria-expanded\"],\n childList: true,\n subtree: true,\n });\n\n let cancelled = false;\n if (document.fonts?.status !== \"loaded\") {\n document.fonts?.ready.then(() => {\n if (cancelled) return;\n updateIndicator();\n // The tabs are wider once the real font is in, so the mount-time scroll can\n // fall short of the active tab. Recomputed here against the settled layout.\n revealActiveTab();\n });\n }\n\n return () => {\n cancelled = true;\n mutationObserver.disconnect();\n resizeObserver.disconnect();\n resizeObserverRef.current = null;\n };\n }, [updateIndicator, revealActiveTab]);\n\n const isPill = appearance === \"pill\";\n const listStyle: React.CSSProperties & { \"--pill-ease\"?: string } = isPill\n ? { \"--pill-ease\": PILL_EASE, ...style }\n : { ...style };\n\n return (\n <TabsAppearanceContext.Provider value={{ appearance, size }}>\n <TabsPrimitive.List\n ref={innerRef}\n onPointerOver={handlePointerOver}\n onPointerLeave={handlePointerLeave}\n style={listStyle}\n className={cn(\n // `isolate` scopes the active indicator's `z-10` to a local stacking\n // context. Without it, `relative` alone creates no stacking context, so\n // the indicator escapes and paints above page chrome (e.g. the header).\n \"relative isolate\",\n isPill\n ? PILL_TRACK_CLASS\n : [\n getLayoutClass(variant, fullWidth, alignLeft),\n // Horizontal only: in the vertical orientation the leading padding is\n // the row's left inset, not a label offset, so zeroing it would pull\n // the first label out of line with the others.\n flushLeft && \"data-[orientation=horizontal]:[&>[role=tab]:first-child]:pl-0\",\n // `flex-none` is what stops the tabs compressing — without it they\n // share the row and never overflow, so there is nothing to scroll.\n // The scrollbar is hidden in both engines: Firefox reads\n // `scrollbar-width`, WebKit and Blink the pseudo-element.\n scrollable &&\n \"data-[orientation=horizontal]:overflow-x-auto data-[orientation=horizontal]:[scrollbar-width:none] data-[orientation=horizontal]:[&::-webkit-scrollbar]:hidden data-[orientation=horizontal]:[&>[role=tab]]:flex-none\",\n \"data-[orientation=horizontal]:items-center data-[orientation=horizontal]:shadow-[inset_0_-1px_0_0_var(--color-border-primary)]\",\n \"data-[orientation=vertical]:flex-col data-[orientation=vertical]:shadow-[inset_-1px_0_0_0_var(--color-border-primary)]\",\n ],\n className,\n )}\n {...props}\n >\n {children}\n <span\n ref={indicatorRef}\n aria-hidden\n className={cn(\n \"pointer-events-none absolute rounded-full motion-safe:transition-[transform,width,height]\",\n isPill\n ? \"z-5 shadow-(--fv-raised-control-thumb-shadow) motion-safe:duration-(--pill-slide) motion-safe:ease-(--pill-ease)\"\n : \"z-10 motion-safe:duration-200 motion-safe:ease-in-out\",\n )}\n style={{ opacity: 0 }}\n />\n </TabsPrimitive.List>\n </TabsAppearanceContext.Provider>\n );\n },\n);\n\nTabsList.displayName = \"TabsList\";\n"],"names":[],"mappings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AAA,cAEN,OAAO,EAAE,SAAS,EAAA;AAAA,YAAE;AAAA,UAAA;AAAA,QACtB;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF;AAEA,SAAS,cAAc;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { PILL_TRACK_CLASS } from "./TabsList.mjs";
|
|
6
|
+
const TabsListSkeleton = React.forwardRef(
|
|
7
|
+
({ className, children, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, "aria-hidden": "true", className: cn(PILL_TRACK_CLASS, className), ...props, children })
|
|
8
|
+
);
|
|
9
|
+
TabsListSkeleton.displayName = "TabsListSkeleton";
|
|
10
|
+
export {
|
|
11
|
+
TabsListSkeleton
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=TabsListSkeleton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TabsListSkeleton.mjs","sources":["../../../src/components/Tabs/TabsListSkeleton.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { PILL_TRACK_CLASS } from \"./TabsList\";\n\n/** Props for the {@link TabsListSkeleton} component. */\nexport type TabsListSkeletonProps = React.HTMLAttributes<HTMLDivElement>;\n\n/**\n * Loading placeholder for a pill {@link TabsList}. Renders the same track, so\n * the row does not jump when the real tabs replace it. Pass placeholder items\n * (for example {@link Skeleton} pills) as children.\n *\n * The track is hidden from assistive technology; announce the loading state on\n * the surrounding region with `aria-busy`.\n *\n * @example\n * ```tsx\n * <TabsListSkeleton>\n * <Skeleton variant=\"rounded\" width={64} height={32} className=\"rounded-full\" />\n * <Skeleton variant=\"rounded\" width={80} height={32} className=\"rounded-full\" />\n * </TabsListSkeleton>\n * ```\n */\nexport const TabsListSkeleton = React.forwardRef<HTMLDivElement, TabsListSkeletonProps>(\n ({ className, children, ...props }, ref) => (\n <div ref={ref} aria-hidden=\"true\" className={cn(PILL_TRACK_CLASS, className)} {...props}>\n {children}\n </div>\n ),\n);\n\nTabsListSkeleton.displayName = \"TabsListSkeleton\";\n"],"names":[],"mappings":";;;;;AAuBO,MAAM,mBAAmB,MAAM;AAAA,EACpC,CAAC,EAAE,WAAW,UAAU,GAAG,MAAA,GAAS,QAClC,oBAAC,OAAA,EAAI,KAAU,eAAY,QAAO,WAAW,GAAG,kBAAkB,SAAS,GAAI,GAAG,OAC/E,SAAA,CACH;AAEJ;AAEA,iBAAiB,cAAc;"}
|
|
@@ -14,6 +14,7 @@ const getNearestAvatarSize = (size) => AVATAR_SIZES.reduce(
|
|
|
14
14
|
const UserItem = React.forwardRef(
|
|
15
15
|
({
|
|
16
16
|
user,
|
|
17
|
+
padding = "md",
|
|
17
18
|
avatarSize,
|
|
18
19
|
isOnline = false,
|
|
19
20
|
isMuted = false,
|
|
@@ -34,7 +35,11 @@ const UserItem = React.forwardRef(
|
|
|
34
35
|
"div",
|
|
35
36
|
{
|
|
36
37
|
ref,
|
|
37
|
-
className: cn(
|
|
38
|
+
className: cn(
|
|
39
|
+
"relative flex w-full items-center justify-start",
|
|
40
|
+
padding === "md" && "px-2 py-1",
|
|
41
|
+
className
|
|
42
|
+
),
|
|
38
43
|
...props,
|
|
39
44
|
children: [
|
|
40
45
|
isMuted && /* @__PURE__ */ jsx("div", { className: "absolute bottom-0 left-0 z-1 flex rounded-xs bg-surface-primary p-1", children: /* @__PURE__ */ jsx(BellOffIcon, { size: 16 }) }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserItem.mjs","sources":["../../../src/components/UserItem/UserItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { getInitials } from \"../../utils/getInitials\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { BellOffIcon } from \"../Icons/BellOffIcon\";\nimport { UserDisplayName } from \"../UserDisplayName/UserDisplayName\";\nimport { UserHandle } from \"../UserHandle/UserHandle\";\n\nconst AVATAR_SIZES = [16, 24, 32, 40, 48, 64, 88, 148] as const;\ntype AvatarSizeToken = (typeof AVATAR_SIZES)[number];\n\n/** Snap an arbitrary pixel size to the nearest supported {@link Avatar} size token. */\nconst getNearestAvatarSize = (size: number): AvatarSizeToken =>\n AVATAR_SIZES.reduce((prev, curr) =>\n Math.abs(curr - size) < Math.abs(prev - size) ? curr : prev,\n );\n\n/** Minimal user shape consumed by {@link UserItem}. */\nexport type UserItemUser = {\n avatarUri?: { url: string; url2x?: string };\n displayName: string;\n handle: string;\n nickname?: string;\n};\n\nexport interface UserItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The user to display. */\n user: UserItemUser;\n /** Desired avatar size in px; snapped to the nearest supported token. @default 48 */\n avatarSize?: number;\n /** Show the muted indicator in the bottom-left corner. @default false */\n isMuted?: boolean;\n /** Whether the user is online (only shown when `showOnlineStatus` is also set). @default false */\n isOnline?: boolean;\n /** Render the avatar. @default true */\n showAvatar?: boolean;\n /** Render the handle line under the display name. @default true */\n showHandle?: boolean;\n /** Enable the avatar online indicator (combined with `isOnline`). */\n showOnlineStatus?: boolean;\n /** Render an AI-disclosure badge after the display name. @default false */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Render a verified badge after the display name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /**\n * Content pinned to the end of the row — a value, count, timestamp or action.\n * It keeps its intrinsic width while the name block absorbs the remaining\n * space, so trailing content stays aligned down the rows of a list.\n *\n * Prefer {@link UserItemTrailing} over composing the lines yourself.\n */\n trailing?: React.ReactNode;\n /**\n * Replace the display-name line with arbitrary content, for rows that read as\n * a sentence about the user rather than their name — an activity feed entry,\n * for instance. Badges do not apply to custom content.\n */\n primary?: React.ReactNode;\n /**\n * A supporting line under the name, mirroring {@link UserItemTrailing}'s `meta`.\n * Both are block lines on the same 18px advance, so a row using `secondary` on\n * the left and `meta` on the right reads as two aligned tiers. Prefer it over\n * letting a long primary wrap, which mixes line heights and drifts out of step.\n */\n secondary?: React.ReactNode;\n}\n\n/**\n * A compact user row showing an avatar, display name (or nickname) and handle,\n * with optional verified and AI-disclosure badges and online and muted indicators.\n *\n * Pass {@link UserItemProps.trailing} to pin a value to the end of the row, the\n * shape most list rows need — top spenders, most active fans, a recent-activity\n * feed.\n *\n * @example\n * ```tsx\n * <UserItem user={{ displayName: \"Jane Doe\", handle: \"jane_doe\" }} />\n * ```\n *\n * @example A list row with a trailing value\n * ```tsx\n * <UserItem\n * user={user}\n * avatarSize={32}\n * showHandle={false}\n * trailing={<span className=\"typography-body-small-14px-semibold\">$14,523.59</span>}\n * />\n * ```\n */\nexport const UserItem = React.forwardRef<HTMLDivElement, UserItemProps>(\n (\n {\n user,\n avatarSize,\n isOnline = false,\n isMuted = false,\n showOnlineStatus,\n showHandle = true,\n showAvatar = true,\n aiDisclosure = false,\n aiDisclosureLabel,\n verified = false,\n verifiedLabel,\n trailing,\n primary,\n secondary,\n className,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\"relative flex w-full items-center justify-start px-2 py-1\"
|
|
1
|
+
{"version":3,"file":"UserItem.mjs","sources":["../../../src/components/UserItem/UserItem.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { getInitials } from \"../../utils/getInitials\";\nimport { Avatar } from \"../Avatar/Avatar\";\nimport { BellOffIcon } from \"../Icons/BellOffIcon\";\nimport { UserDisplayName } from \"../UserDisplayName/UserDisplayName\";\nimport { UserHandle } from \"../UserHandle/UserHandle\";\n\nconst AVATAR_SIZES = [16, 24, 32, 40, 48, 64, 88, 148] as const;\ntype AvatarSizeToken = (typeof AVATAR_SIZES)[number];\n\n/** Snap an arbitrary pixel size to the nearest supported {@link Avatar} size token. */\nconst getNearestAvatarSize = (size: number): AvatarSizeToken =>\n AVATAR_SIZES.reduce((prev, curr) =>\n Math.abs(curr - size) < Math.abs(prev - size) ? curr : prev,\n );\n\n/** Minimal user shape consumed by {@link UserItem}. */\nexport type UserItemUser = {\n avatarUri?: { url: string; url2x?: string };\n displayName: string;\n handle: string;\n nickname?: string;\n};\n\n/**\n * Padding of the row. `\"md\"` insets it by 8px left and right and 4px top and bottom;\n * `\"none\"` removes the inset so the row aligns with its container's content edge.\n */\nexport type UserItemPadding = \"none\" | \"md\";\n\nexport interface UserItemProps extends React.HTMLAttributes<HTMLDivElement> {\n /** The user to display. */\n user: UserItemUser;\n /** Padding of the row. @default \"md\" */\n padding?: UserItemPadding;\n /** Desired avatar size in px; snapped to the nearest supported token. @default 48 */\n avatarSize?: number;\n /** Show the muted indicator in the bottom-left corner. @default false */\n isMuted?: boolean;\n /** Whether the user is online (only shown when `showOnlineStatus` is also set). @default false */\n isOnline?: boolean;\n /** Render the avatar. @default true */\n showAvatar?: boolean;\n /** Render the handle line under the display name. @default true */\n showHandle?: boolean;\n /** Enable the avatar online indicator (combined with `isOnline`). */\n showOnlineStatus?: boolean;\n /** Render an AI-disclosure badge after the display name. @default false */\n aiDisclosure?: boolean;\n /** Accessible label for the AI-disclosure badge. @default \"AI creator\" */\n aiDisclosureLabel?: string;\n /** Render a verified badge after the display name. @default false */\n verified?: boolean;\n /** Accessible label for the verified badge. @default \"Verified\" */\n verifiedLabel?: string;\n /**\n * Content pinned to the end of the row — a value, count, timestamp or action.\n * It keeps its intrinsic width while the name block absorbs the remaining\n * space, so trailing content stays aligned down the rows of a list.\n *\n * Prefer {@link UserItemTrailing} over composing the lines yourself.\n */\n trailing?: React.ReactNode;\n /**\n * Replace the display-name line with arbitrary content, for rows that read as\n * a sentence about the user rather than their name — an activity feed entry,\n * for instance. Badges do not apply to custom content.\n */\n primary?: React.ReactNode;\n /**\n * A supporting line under the name, mirroring {@link UserItemTrailing}'s `meta`.\n * Both are block lines on the same 18px advance, so a row using `secondary` on\n * the left and `meta` on the right reads as two aligned tiers. Prefer it over\n * letting a long primary wrap, which mixes line heights and drifts out of step.\n */\n secondary?: React.ReactNode;\n}\n\n/**\n * A compact user row showing an avatar, display name (or nickname) and handle,\n * with optional verified and AI-disclosure badges and online and muted indicators.\n *\n * Pass {@link UserItemProps.trailing} to pin a value to the end of the row, the\n * shape most list rows need — top spenders, most active fans, a recent-activity\n * feed.\n *\n * @example\n * ```tsx\n * <UserItem user={{ displayName: \"Jane Doe\", handle: \"jane_doe\" }} />\n * ```\n *\n * @example A list row with a trailing value\n * ```tsx\n * <UserItem\n * user={user}\n * avatarSize={32}\n * showHandle={false}\n * trailing={<span className=\"typography-body-small-14px-semibold\">$14,523.59</span>}\n * />\n * ```\n */\nexport const UserItem = React.forwardRef<HTMLDivElement, UserItemProps>(\n (\n {\n user,\n padding = \"md\",\n avatarSize,\n isOnline = false,\n isMuted = false,\n showOnlineStatus,\n showHandle = true,\n showAvatar = true,\n aiDisclosure = false,\n aiDisclosureLabel,\n verified = false,\n verifiedLabel,\n trailing,\n primary,\n secondary,\n className,\n ...props\n },\n ref,\n ) => {\n return (\n <div\n ref={ref}\n className={cn(\n \"relative flex w-full items-center justify-start\",\n padding === \"md\" && \"px-2 py-1\",\n className,\n )}\n {...props}\n >\n {isMuted && (\n <div className=\"absolute bottom-0 left-0 z-1 flex rounded-xs bg-surface-primary p-1\">\n <BellOffIcon size={16} />\n </div>\n )}\n {showAvatar && (\n <Avatar\n size={getNearestAvatarSize(avatarSize || 48)}\n src={user.avatarUri?.url}\n alt={user.displayName}\n fallback={getInitials(user.displayName)}\n onlineIndicator={Boolean(showOnlineStatus && isOnline)}\n />\n )}\n <div className=\"flex-1 overflow-hidden pl-2\">\n {primary ?? (\n <UserDisplayName\n aiDisclosure={aiDisclosure}\n aiDisclosureLabel={aiDisclosureLabel}\n verified={verified}\n verifiedLabel={verifiedLabel}\n className=\"typography-body-small-14px-semibold\"\n >\n {user.nickname || user.displayName}\n </UserDisplayName>\n )}\n {secondary && (\n <p className=\"typography-description-12px-regular truncate text-content-secondary\">\n {secondary}\n </p>\n )}\n {showHandle && <UserHandle>{user.handle}</UserHandle>}\n </div>\n {trailing && <div className=\"shrink-0 pl-2\">{trailing}</div>}\n </div>\n );\n },\n);\n\nUserItem.displayName = \"UserItem\";\n"],"names":[],"mappings":";;;;;;;;;AAQA,MAAM,eAAe,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,GAAG;AAIrD,MAAM,uBAAuB,CAAC,SAC5B,aAAa;AAAA,EAAO,CAAC,MAAM,SACzB,KAAK,IAAI,OAAO,IAAI,IAAI,KAAK,IAAI,OAAO,IAAI,IAAI,OAAO;AACzD;AAuFK,MAAM,WAAW,MAAM;AAAA,EAC5B,CACE;AAAA,IACE;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,WAAW;AAAA,IACX,UAAU;AAAA,IACV;AAAA,IACA,aAAa;AAAA,IACb,aAAa;AAAA,IACb,eAAe;AAAA,IACf;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EAAA,GAEL,QACG;AACH,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA,YAAY,QAAQ;AAAA,UACpB;AAAA,QAAA;AAAA,QAED,GAAG;AAAA,QAEH,UAAA;AAAA,UAAA,WACC,oBAAC,SAAI,WAAU,uEACb,8BAAC,aAAA,EAAY,MAAM,IAAI,EAAA,CACzB;AAAA,UAED,cACC;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM,qBAAqB,cAAc,EAAE;AAAA,cAC3C,KAAK,KAAK,WAAW;AAAA,cACrB,KAAK,KAAK;AAAA,cACV,UAAU,YAAY,KAAK,WAAW;AAAA,cACtC,iBAAiB,QAAQ,oBAAoB,QAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,UAGzD,qBAAC,OAAA,EAAI,WAAU,+BACZ,UAAA;AAAA,YAAA,WACC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,WAAU;AAAA,gBAET,UAAA,KAAK,YAAY,KAAK;AAAA,cAAA;AAAA,YAAA;AAAA,YAG1B,aACC,oBAAC,KAAA,EAAE,WAAU,uEACV,UAAA,WACH;AAAA,YAED,cAAc,oBAAC,YAAA,EAAY,UAAA,KAAK,OAAA,CAAO;AAAA,UAAA,GAC1C;AAAA,UACC,YAAY,oBAAC,OAAA,EAAI,WAAU,iBAAiB,UAAA,SAAA,CAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG5D;AACF;AAEA,SAAS,cAAc;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1021,6 +1021,11 @@ export declare interface BaseIconProps extends Omit<React_2.SVGAttributes<SVGSVG
|
|
|
1021
1021
|
size?: IconSize;
|
|
1022
1022
|
/** Render the filled variant when available; falls back to outlined. @default false */
|
|
1023
1023
|
filled?: boolean;
|
|
1024
|
+
/**
|
|
1025
|
+
* Rotate the icon continuously, for loading and busy states. Under
|
|
1026
|
+
* `prefers-reduced-motion` it pulses in place instead. @default false
|
|
1027
|
+
*/
|
|
1028
|
+
spin?: boolean;
|
|
1024
1029
|
}
|
|
1025
1030
|
|
|
1026
1031
|
/**
|
|
@@ -2597,6 +2602,7 @@ export declare type DialogCloseProps = React_2.ComponentPropsWithoutRef<typeof D
|
|
|
2597
2602
|
* with top-only border radius by default; pass `mobilePresentation="card"` to
|
|
2598
2603
|
* render a centered floating card instead (used for small confirmation dialogs).
|
|
2599
2604
|
* On larger viewports it renders centered with full border radius.
|
|
2605
|
+
* `size="full"` skips both and fills the viewport with no chrome.
|
|
2600
2606
|
*
|
|
2601
2607
|
* It animates in and out. While the closing animation plays the panel stays
|
|
2602
2608
|
* mounted but ignores pointer input, so a second click can't act on it.
|
|
@@ -2626,14 +2632,19 @@ export declare const DialogContent: React_2.ForwardRefExoticComponent<DialogCont
|
|
|
2626
2632
|
|
|
2627
2633
|
export declare interface DialogContentProps extends React_2.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
2628
2634
|
/**
|
|
2629
|
-
*
|
|
2635
|
+
* Size preset for the dialog.
|
|
2630
2636
|
* - `"sm"` — 400px max-width (confirmations, simple forms)
|
|
2631
2637
|
* - `"md"` — 440px max-width (default, standard dialogs)
|
|
2632
2638
|
* - `"lg"` — 600px max-width (complex content, tables)
|
|
2639
|
+
* - `"full"` — edge to edge with no border, radius, padding or pull handle, on the
|
|
2640
|
+
* theme's `bg-background-primary` surface, for media viewers. A viewer that wants a
|
|
2641
|
+
* black stage passes its own surface through `className`. Its height follows
|
|
2642
|
+
* `--visual-viewport-h` when the page sets it (to track the on-screen keyboard)
|
|
2643
|
+
* and falls back to `100dvh`.
|
|
2633
2644
|
*
|
|
2634
2645
|
* @default "md"
|
|
2635
2646
|
*/
|
|
2636
|
-
size?:
|
|
2647
|
+
size?: DialogContentSize;
|
|
2637
2648
|
/** When true, renders overlay automatically. @default true */
|
|
2638
2649
|
overlay?: boolean;
|
|
2639
2650
|
/**
|
|
@@ -2657,6 +2668,9 @@ export declare interface DialogContentProps extends React_2.ComponentPropsWithou
|
|
|
2657
2668
|
overlayProps?: DialogOverlayProps;
|
|
2658
2669
|
}
|
|
2659
2670
|
|
|
2671
|
+
/** Size preset of {@link DialogContent}. */
|
|
2672
|
+
export declare type DialogContentSize = "sm" | "md" | "lg" | "full";
|
|
2673
|
+
|
|
2660
2674
|
/** Accessible description for the dialog. Rendered as secondary text. */
|
|
2661
2675
|
export declare const DialogDescription: React_2.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React_2.RefAttributes<HTMLParagraphElement>, "ref"> & React_2.RefAttributes<HTMLParagraphElement>>;
|
|
2662
2676
|
|
|
@@ -3191,7 +3205,11 @@ export declare interface DropdownMenuItemProps extends React_2.ComponentPropsWit
|
|
|
3191
3205
|
size?: DropdownMenuItemSize;
|
|
3192
3206
|
/** Applies the destructive (error) treatment. Use for irreversible actions. @default false */
|
|
3193
3207
|
destructive?: boolean;
|
|
3194
|
-
/**
|
|
3208
|
+
/**
|
|
3209
|
+
* Icon (or other node) rendered before the label. Ignored when {@link DropdownMenuItemProps.avatar} is set.
|
|
3210
|
+
* Icons sit in a 16px box in `Icons/Secondary`, and prop-based icons draw filled at 16px unless they set
|
|
3211
|
+
* `filled` or `size` themselves (`filled={false}` opts out). Legacy icons such as `TrashBinIcon` stay outlined.
|
|
3212
|
+
*/
|
|
3195
3213
|
leadingIcon?: React_2.ReactNode;
|
|
3196
3214
|
/**
|
|
3197
3215
|
* Leading avatar rendered in place of {@link DropdownMenuItemProps.leadingIcon},
|
|
@@ -3200,7 +3218,7 @@ export declare interface DropdownMenuItemProps extends React_2.ComponentPropsWit
|
|
|
3200
3218
|
*/
|
|
3201
3219
|
avatar?: React_2.ReactNode;
|
|
3202
3220
|
/**
|
|
3203
|
-
* Icon (or other node) rendered after the label.
|
|
3221
|
+
* Icon (or other node) rendered after the label. Treated like {@link DropdownMenuItemProps.leadingIcon}.
|
|
3204
3222
|
*/
|
|
3205
3223
|
trailingIcon?: React_2.ReactNode;
|
|
3206
3224
|
/** Trailing count or number (e.g. an unread total) rendered before {@link DropdownMenuItemProps.trailingIcon}. */
|
|
@@ -3449,10 +3467,18 @@ export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
3449
3467
|
/** Main heading. Strings use library heading styles; pass a node for full control. */
|
|
3450
3468
|
title?: EmptyStateSlot;
|
|
3451
3469
|
/**
|
|
3452
|
-
*
|
|
3470
|
+
* How large the title looks, mapped to bold heading typography tokens. Independent of
|
|
3471
|
+
* `titleAs`, which sets the heading level.
|
|
3453
3472
|
* @default "lg"
|
|
3454
3473
|
*/
|
|
3455
3474
|
titleSize?: EmptyStateTitleSize;
|
|
3475
|
+
/**
|
|
3476
|
+
* Heading level of a string title, for screen readers and the page's heading outline
|
|
3477
|
+
* (for example `"h1"` on a whole-page state). Does not change how the title looks; use
|
|
3478
|
+
* `titleSize` for that. Ignored when `title` is a node.
|
|
3479
|
+
* @default "h2"
|
|
3480
|
+
*/
|
|
3481
|
+
titleAs?: EmptyStateTitleAs;
|
|
3456
3482
|
/** Supporting body copy. Strings use library body styles; pass a node for rich text. */
|
|
3457
3483
|
description?: EmptyStateSlot;
|
|
3458
3484
|
/**
|
|
@@ -3480,6 +3506,9 @@ export declare interface EmptyStateProps extends Omit<React_2.HTMLAttributes<HTM
|
|
|
3480
3506
|
/** Slot that can be plain copy (styled by `EmptyState`) or custom markup. */
|
|
3481
3507
|
export declare type EmptyStateSlot = string | React_2.ReactNode;
|
|
3482
3508
|
|
|
3509
|
+
/** Heading element rendered for a string title. */
|
|
3510
|
+
export declare type EmptyStateTitleAs = "h1" | "h2" | "h3";
|
|
3511
|
+
|
|
3483
3512
|
declare type EmptyStateTitleSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3484
3513
|
|
|
3485
3514
|
export declare type EmptyStateVariant = "default" | "centered";
|
|
@@ -3662,6 +3691,19 @@ export declare const FolderIcon: React_2.ForwardRefExoticComponent<BaseIconProps
|
|
|
3662
3691
|
/** Props for {@link FolderIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
3663
3692
|
export declare type FolderIconProps = BaseIconProps;
|
|
3664
3693
|
|
|
3694
|
+
/**
|
|
3695
|
+
* A video's length as the chip shows it: `mm:ss`, or `hh:mm:ss` from an hour.
|
|
3696
|
+
* Returns `undefined` for a missing, non-finite or sub-second length. Use it to
|
|
3697
|
+
* put the same length in the label of the tile the chip sits on.
|
|
3698
|
+
*
|
|
3699
|
+
* @example
|
|
3700
|
+
* ```ts
|
|
3701
|
+
* formatPlayChipDuration(42); // "00:42"
|
|
3702
|
+
* formatPlayChipDuration(3725); // "01:02:05"
|
|
3703
|
+
* ```
|
|
3704
|
+
*/
|
|
3705
|
+
export declare function formatPlayChipDuration(duration?: number): string | undefined;
|
|
3706
|
+
|
|
3665
3707
|
/**
|
|
3666
3708
|
* Formats a duration in seconds as `m:ss`, or `--:--` when unknown. Matches the
|
|
3667
3709
|
* timestamp {@link VoiceNote} renders, so waveforms built elsewhere read the
|
|
@@ -3841,8 +3883,8 @@ export declare type HourglassIconProps = BaseIconProps;
|
|
|
3841
3883
|
* icon alone (e.g. close, send). Always pair with an `aria-label` for
|
|
3842
3884
|
* accessibility.
|
|
3843
3885
|
*
|
|
3844
|
-
* Shape is size-driven for the standard variants
|
|
3845
|
-
* (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,
|
|
3886
|
+
* Shape is size-driven for the standard variants and `overlay`: the `24` size is
|
|
3887
|
+
* squared (`rounded-xs`), every larger size is circular. Bespoke variants (`brand`,
|
|
3846
3888
|
* `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop`,
|
|
3847
3889
|
* `microphone`) stay circular at all sizes. `field` is the exception that is
|
|
3848
3890
|
* never circular — it takes the inputs' `rounded-sm` so it matches the fields it
|
|
@@ -3883,10 +3925,15 @@ export declare type IconButtonSize = "24" | "32" | "40" | "48" | "52" | "72";
|
|
|
3883
3925
|
* `24` size, circular otherwise). Of these, `primary`, `secondary`, `tertiary`
|
|
3884
3926
|
* and `outline` also honour the {@link IconButtonProps.negative} prop.
|
|
3885
3927
|
*
|
|
3928
|
+
* `overlay` is a translucent dark fill with a backdrop blur, for buttons that sit
|
|
3929
|
+
* on photos or video. Its fill and icon look the same in light and dark themes, while
|
|
3930
|
+
* the keyboard focus ring still follows the theme. It takes the same size-driven
|
|
3931
|
+
* shape as the standard variants.
|
|
3932
|
+
*
|
|
3886
3933
|
* `brand`, `contrast`, `messaging`, `navTray`, `tertiaryDestructive`, `stop` and
|
|
3887
3934
|
* `microphone` are bespoke variants that stay circular at every size.
|
|
3888
3935
|
*/
|
|
3889
|
-
export declare type IconButtonVariant = "primary" | "secondary" | "tertiary" | "outline" | "error" | "white" | "black" | "brand" | "contrast" | "messaging" | "navTray" | "tertiaryDestructive" | "stop" | "microphone" | "field";
|
|
3936
|
+
export declare type IconButtonVariant = "primary" | "secondary" | "tertiary" | "outline" | "error" | "white" | "black" | "brand" | "contrast" | "messaging" | "navTray" | "tertiaryDestructive" | "stop" | "microphone" | "overlay" | "field";
|
|
3890
3937
|
|
|
3891
3938
|
/** A single drawable path within an icon variant. */
|
|
3892
3939
|
export declare type IconPath = {
|
|
@@ -4096,7 +4143,9 @@ export declare type LanguageIconProps = BaseIconProps;
|
|
|
4096
4143
|
/**
|
|
4097
4144
|
* An inline text link for navigating to a related page or section without
|
|
4098
4145
|
* using a button. Use `primary` for standard navigation and `brand` for the
|
|
4099
|
-
* Fanvue green accent on calls to action within content.
|
|
4146
|
+
* Fanvue green accent on calls to action within content. Use `inherit` with
|
|
4147
|
+
* `size="inherit"` for a link inside copy that sets its own colour and type,
|
|
4148
|
+
* such as a tooltip.
|
|
4100
4149
|
*
|
|
4101
4150
|
* Renders an underlined `<a>` by default. Pass `asChild` to compose with a
|
|
4102
4151
|
* router link (e.g. Next.js `Link`). When rendering without a visible label,
|
|
@@ -4137,11 +4186,19 @@ export declare interface LinkProps extends React_2.AnchorHTMLAttributes<HTMLAnch
|
|
|
4137
4186
|
asChild?: boolean;
|
|
4138
4187
|
}
|
|
4139
4188
|
|
|
4140
|
-
/**
|
|
4141
|
-
|
|
4189
|
+
/**
|
|
4190
|
+
* Text size of the link in pixels. `inherit` keeps the font size and weight of
|
|
4191
|
+
* the surrounding text, for a link that sits inside a sentence. Without icons it
|
|
4192
|
+
* renders inline, so a long link wraps with the sentence.
|
|
4193
|
+
*/
|
|
4194
|
+
export declare type LinkSize = "16" | "14" | "inherit";
|
|
4142
4195
|
|
|
4143
|
-
/**
|
|
4144
|
-
|
|
4196
|
+
/**
|
|
4197
|
+
* Visual style variant of the link. `inherit` takes the colour of the
|
|
4198
|
+
* surrounding text, for links inside tooltips, alerts and other copy that sets
|
|
4199
|
+
* its own colour.
|
|
4200
|
+
*/
|
|
4201
|
+
export declare type LinkVariant = "primary" | "brand" | "inherit";
|
|
4145
4202
|
|
|
4146
4203
|
/**
|
|
4147
4204
|
* List view icon. Renders at sizes 16, 24, or 32 px.
|
|
@@ -4334,6 +4391,40 @@ export declare const MassMessageIcon: React_2.ForwardRefExoticComponent<BaseIcon
|
|
|
4334
4391
|
/** Props for {@link MassMessageIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
4335
4392
|
export declare type MassMessageIconProps = BaseIconProps;
|
|
4336
4393
|
|
|
4394
|
+
/**
|
|
4395
|
+
* Marks a video tile with a play icon and its length, or a 32px circle with the
|
|
4396
|
+
* icon alone when the length is unknown. The chip is decorative, so the tile it
|
|
4397
|
+
* sits on carries the label and the action. It is white on a translucent white
|
|
4398
|
+
* fill on every theme, as it sits over media rather than the page.
|
|
4399
|
+
*
|
|
4400
|
+
* The chip has no position of its own; the host places it, e.g. centred with
|
|
4401
|
+
* `absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2`.
|
|
4402
|
+
*
|
|
4403
|
+
* @example
|
|
4404
|
+
* ```tsx
|
|
4405
|
+
* <button
|
|
4406
|
+
* type="button"
|
|
4407
|
+
* aria-label={[alt, formatPlayChipDuration(duration)].filter(Boolean).join(", ")}
|
|
4408
|
+
* className="relative"
|
|
4409
|
+
* >
|
|
4410
|
+
* <img src={poster} alt="" />
|
|
4411
|
+
* <MediaPlayChip
|
|
4412
|
+
* duration={duration}
|
|
4413
|
+
* className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2"
|
|
4414
|
+
* />
|
|
4415
|
+
* </button>
|
|
4416
|
+
* ```
|
|
4417
|
+
*/
|
|
4418
|
+
export declare const MediaPlayChip: React_2.ForwardRefExoticComponent<MediaPlayChipProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
4419
|
+
|
|
4420
|
+
export declare interface MediaPlayChipProps extends Omit<React_2.HTMLAttributes<HTMLSpanElement>, "children"> {
|
|
4421
|
+
/**
|
|
4422
|
+
* Length of the video in seconds, shown next to the icon as mm:ss, or
|
|
4423
|
+
* hh:mm:ss from an hour. Lengths under a second are not shown.
|
|
4424
|
+
*/
|
|
4425
|
+
duration?: number;
|
|
4426
|
+
}
|
|
4427
|
+
|
|
4337
4428
|
/**
|
|
4338
4429
|
* A compact circular indicator that surfaces the moderation state of a piece of
|
|
4339
4430
|
* media — flagged, removed, or sensitive. Typically overlaid on a thumbnail or
|
|
@@ -5571,7 +5662,11 @@ export declare const SelectItem: React_2.ForwardRefExoticComponent<SelectItemPro
|
|
|
5571
5662
|
export declare interface SelectItemProps extends React_2.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> {
|
|
5572
5663
|
/** Row height. Defaults to the parent {@link Select} size (`48`/`40` → `40`, `32` → `32`). */
|
|
5573
5664
|
size?: SelectItemSize;
|
|
5574
|
-
/**
|
|
5665
|
+
/**
|
|
5666
|
+
* Icon (or other node) rendered before the label. Ignored when {@link SelectItemProps.avatar} is set.
|
|
5667
|
+
* Treated like `DropdownMenuItem`'s icons: a 16px box in `Icons/Secondary`, prop-based icons filled at 16px
|
|
5668
|
+
* unless they set `filled` or `size` themselves.
|
|
5669
|
+
*/
|
|
5575
5670
|
leadingIcon?: React_2.ReactNode;
|
|
5576
5671
|
/**
|
|
5577
5672
|
* Leading avatar rendered in place of {@link SelectItemProps.leadingIcon}, for rows
|
|
@@ -5689,6 +5784,7 @@ export declare type ShareIconProps = BaseIconProps;
|
|
|
5689
5784
|
* <Skeleton variant="text" width={200} />
|
|
5690
5785
|
* <Skeleton variant="circular" width={40} height={40} />
|
|
5691
5786
|
* <Skeleton variant="rectangular" width="100%" height={120} />
|
|
5787
|
+
* <Skeleton variant="rectangular" radius="lg" width="100%" height={240} />
|
|
5692
5788
|
* ```
|
|
5693
5789
|
*/
|
|
5694
5790
|
export declare const Skeleton: React_2.ForwardRefExoticComponent<SkeletonProps & React_2.RefAttributes<HTMLSpanElement>>;
|
|
@@ -5707,6 +5803,17 @@ export declare interface SkeletonProps extends React_2.HTMLAttributes<HTMLSpanEl
|
|
|
5707
5803
|
* @default "text"
|
|
5708
5804
|
*/
|
|
5709
5805
|
variant?: SkeletonVariant;
|
|
5806
|
+
/**
|
|
5807
|
+
* Corner radius on the kit scale, so a skeleton can match the corners of the
|
|
5808
|
+
* surface it stands in for. Overrides the radius the `variant` sets.
|
|
5809
|
+
*
|
|
5810
|
+
* - `sm` – `--radius-sm` (12px)
|
|
5811
|
+
* - `md` – `--radius-md` (16px)
|
|
5812
|
+
* - `lg` – `--radius-lg` (24px)
|
|
5813
|
+
*
|
|
5814
|
+
* Leave unset to keep the variant's own radius.
|
|
5815
|
+
*/
|
|
5816
|
+
radius?: SkeletonRadius;
|
|
5710
5817
|
/** Animation style. Set to `false` to disable animation. @default "pulse" */
|
|
5711
5818
|
animation?: SkeletonAnimation;
|
|
5712
5819
|
/** Width of the skeleton. Accepts a CSS value (number is treated as `px`). */
|
|
@@ -5715,6 +5822,9 @@ export declare interface SkeletonProps extends React_2.HTMLAttributes<HTMLSpanEl
|
|
|
5715
5822
|
height?: number | string;
|
|
5716
5823
|
}
|
|
5717
5824
|
|
|
5825
|
+
/** Corner radius of the skeleton, on the kit radius scale. */
|
|
5826
|
+
export declare type SkeletonRadius = "sm" | "md" | "lg";
|
|
5827
|
+
|
|
5718
5828
|
/** Shape variant of the skeleton placeholder. */
|
|
5719
5829
|
export declare type SkeletonVariant = "text" | "circular" | "rectangular" | "rounded";
|
|
5720
5830
|
|
|
@@ -5826,10 +5936,24 @@ export declare const SoundIcon: React_2.ForwardRefExoticComponent<BaseIconProps
|
|
|
5826
5936
|
/** Props for {@link SoundIcon}. See {@link BaseIconProps} for the shared shape. */
|
|
5827
5937
|
export declare type SoundIconProps = BaseIconProps;
|
|
5828
5938
|
|
|
5829
|
-
/**
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5939
|
+
/**
|
|
5940
|
+
* A circular spinner glyph for loading states. It is a plain icon: pass `spin`
|
|
5941
|
+
* to turn it, as with any other prop-based icon. Prefer `spin`: a raw `animate-spin`
|
|
5942
|
+
* class keeps rotating under reduced motion. Combining the two never doubles the
|
|
5943
|
+
* speed. For a full-area loading state use the `Loader` component.
|
|
5944
|
+
*
|
|
5945
|
+
* @example
|
|
5946
|
+
* ```tsx
|
|
5947
|
+
* <SpinnerIcon size={16} spin />
|
|
5948
|
+
* ```
|
|
5949
|
+
*/
|
|
5950
|
+
export declare const SpinnerIcon: React_2.ForwardRefExoticComponent<SpinnerIconProps & React_2.RefAttributes<SVGSVGElement>>;
|
|
5951
|
+
|
|
5952
|
+
/** Props for {@link SpinnerIcon}. */
|
|
5953
|
+
export declare interface SpinnerIconProps extends Omit<IconProps, "size">, Pick<BaseIconProps, "spin"> {
|
|
5954
|
+
/** Pixel size of the spinner. Defaults to 20px when omitted. */
|
|
5955
|
+
size?: IconSize;
|
|
5956
|
+
}
|
|
5833
5957
|
|
|
5834
5958
|
/**
|
|
5835
5959
|
* Star icon. Renders at sizes 16, 24, or 32 px with outlined and filled variants.
|
|
@@ -6774,6 +6898,27 @@ export declare type TabsListProps = React_2.ComponentPropsWithoutRef<typeof Tabs
|
|
|
6774
6898
|
followHover?: boolean;
|
|
6775
6899
|
};
|
|
6776
6900
|
|
|
6901
|
+
/**
|
|
6902
|
+
* Loading placeholder for a pill {@link TabsList}. Renders the same track, so
|
|
6903
|
+
* the row does not jump when the real tabs replace it. Pass placeholder items
|
|
6904
|
+
* (for example {@link Skeleton} pills) as children.
|
|
6905
|
+
*
|
|
6906
|
+
* The track is hidden from assistive technology; announce the loading state on
|
|
6907
|
+
* the surrounding region with `aria-busy`.
|
|
6908
|
+
*
|
|
6909
|
+
* @example
|
|
6910
|
+
* ```tsx
|
|
6911
|
+
* <TabsListSkeleton>
|
|
6912
|
+
* <Skeleton variant="rounded" width={64} height={32} className="rounded-full" />
|
|
6913
|
+
* <Skeleton variant="rounded" width={80} height={32} className="rounded-full" />
|
|
6914
|
+
* </TabsListSkeleton>
|
|
6915
|
+
* ```
|
|
6916
|
+
*/
|
|
6917
|
+
export declare const TabsListSkeleton: React_2.ForwardRefExoticComponent<TabsListSkeletonProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
6918
|
+
|
|
6919
|
+
/** Props for the {@link TabsListSkeleton} component. */
|
|
6920
|
+
export declare type TabsListSkeletonProps = React_2.HTMLAttributes<HTMLDivElement>;
|
|
6921
|
+
|
|
6777
6922
|
/**
|
|
6778
6923
|
* The last tab in a {@link TabsList}, opening a menu of the tabs that don't fit
|
|
6779
6924
|
* the row. It sits in the row's arrow-key order, opens with click, Enter, Space
|
|
@@ -7552,9 +7697,17 @@ export declare type UserIconProps = BaseIconProps;
|
|
|
7552
7697
|
*/
|
|
7553
7698
|
export declare const UserItem: React_2.ForwardRefExoticComponent<UserItemProps & React_2.RefAttributes<HTMLDivElement>>;
|
|
7554
7699
|
|
|
7700
|
+
/**
|
|
7701
|
+
* Padding of the row. `"md"` insets it by 8px left and right and 4px top and bottom;
|
|
7702
|
+
* `"none"` removes the inset so the row aligns with its container's content edge.
|
|
7703
|
+
*/
|
|
7704
|
+
export declare type UserItemPadding = "none" | "md";
|
|
7705
|
+
|
|
7555
7706
|
export declare interface UserItemProps extends React_2.HTMLAttributes<HTMLDivElement> {
|
|
7556
7707
|
/** The user to display. */
|
|
7557
7708
|
user: UserItemUser;
|
|
7709
|
+
/** Padding of the row. @default "md" */
|
|
7710
|
+
padding?: UserItemPadding;
|
|
7558
7711
|
/** Desired avatar size in px; snapped to the nearest supported token. @default 48 */
|
|
7559
7712
|
avatarSize?: number;
|
|
7560
7713
|
/** Show the muted indicator in the bottom-left corner. @default false */
|