@mirror-physics/fractal-ui 0.2.0-next.35 → 0.2.0-next.37

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/index.d.ts CHANGED
@@ -232,6 +232,7 @@ interface TabItem {
232
232
  content: ReactNode;
233
233
  disabled?: boolean;
234
234
  }
235
+ type TabsVariant = 'line' | 'surface';
235
236
  interface TabsProps {
236
237
  items: TabItem[];
237
238
  defaultValue?: string;
@@ -241,8 +242,10 @@ interface TabsProps {
241
242
  ariaLabel?: string;
242
243
  /** Extends a subtle divider across the entire tab list. */
243
244
  divider?: boolean;
245
+ /** Visual treatment. Surface tabs sit on a full-width secondary surface with the active tab connected to its panel. */
246
+ variant?: TabsVariant;
244
247
  }
245
- declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, divider, }: TabsProps): React.JSX.Element;
248
+ declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, divider, variant, }: TabsProps): React.JSX.Element;
246
249
 
247
250
  interface ContentSwitcherItem {
248
251
  value: string;
@@ -374,6 +377,8 @@ declare function SidePanelGhost({ className, title, lines, ...props }: SurfaceGh
374
377
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
375
378
  /** Fixed sidebar width. Defaults to the standard application width. */
376
379
  width?: string;
380
+ /** Collapses the sidebar to an icon rail until it is hovered or receives focus. */
381
+ compact?: boolean;
377
382
  }
378
383
  declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLElement>>;
379
384
  declare const SidebarHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
@@ -387,9 +392,11 @@ interface SidebarAccountMenuProps {
387
392
  onSelect: (value: string) => void;
388
393
  /** Accessible label for the account actions menu. */
389
394
  triggerLabel?: string;
395
+ /** Leading profile or workspace mark. */
396
+ icon?: React.ReactNode;
390
397
  className?: string;
391
398
  }
392
- declare function SidebarAccountMenu({ name, items, onSelect, triggerLabel, className, }: SidebarAccountMenuProps): React.JSX.Element;
399
+ declare function SidebarAccountMenu({ name, items, onSelect, triggerLabel, icon, className, }: SidebarAccountMenuProps): React.JSX.Element;
393
400
  declare const SidebarNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
394
401
  declare const SidebarSection: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
395
402
  interface SidebarNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -471,4 +478,4 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
471
478
 
472
479
  declare function cn(...inputs: ClassValue[]): string;
473
480
 
474
- export { Alert, AlertDescription, AlertGhost, AlertTitle, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonColor, ButtonGhost, type ButtonGhostProps, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardGhost, type CardGhostProps, CardHeader, CardTitle, Checkbox, CheckboxGhost, type CheckboxProps, Chip, ChipGhost, type ChipProps, type ChipTone, ContentSwitcher, ContentSwitcherGhost, type ContentSwitcherItem, type ContentSwitcherProps, DataTable, type DataTableColumn, DataTableGhost, type DataTableGhostProps, type DataTableProps, Disclosure, DisclosureGhost, type DisclosureProps, Dropdown, DropdownGhost, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, FileDropzoneGhost, type FileDropzoneProps, FolderCard, type FolderCardProps, type FormFieldGhostProps, Ghost, GhostLine, type GhostLineProps, type GhostProps, Input, InputGhost, type InputProps, Label, LabelGhost, type LabelProps, LatticeLoader, type LatticeLoaderProps, Link, LinkGhost, type LinkProps, type LinkSize, type LinkTheme, Modal, ModalGhost, type ModalProps, Pagination, PaginationGhost, type PaginationProps, PromptCard, PromptCardGhost, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, SidePanelGhost, type SidePanelProps, Sidebar, SidebarAccountMenu, type SidebarAccountMenuProps, SidebarBrand, SidebarFooter, SidebarGhost, type SidebarGhostProps, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableDefaultSort, SortableTableGhost, type SortableTableProps, type SortableTableRowAction, type SurfaceGhostProps, type TabItem, Tabs, TabsGhost, type TabsProps, TextButton, TextButtonGhost, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, TextareaGhost, type TextareaProps, Toggle, ToggleGhost, type ToggleProps, UILoader, type UILoaderProps, type UILoaderTone, cn, useEscapeDismiss };
481
+ export { Alert, AlertDescription, AlertGhost, AlertTitle, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonColor, ButtonGhost, type ButtonGhostProps, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardGhost, type CardGhostProps, CardHeader, CardTitle, Checkbox, CheckboxGhost, type CheckboxProps, Chip, ChipGhost, type ChipProps, type ChipTone, ContentSwitcher, ContentSwitcherGhost, type ContentSwitcherItem, type ContentSwitcherProps, DataTable, type DataTableColumn, DataTableGhost, type DataTableGhostProps, type DataTableProps, Disclosure, DisclosureGhost, type DisclosureProps, Dropdown, DropdownGhost, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, FileDropzoneGhost, type FileDropzoneProps, FolderCard, type FolderCardProps, type FormFieldGhostProps, Ghost, GhostLine, type GhostLineProps, type GhostProps, Input, InputGhost, type InputProps, Label, LabelGhost, type LabelProps, LatticeLoader, type LatticeLoaderProps, Link, LinkGhost, type LinkProps, type LinkSize, type LinkTheme, Modal, ModalGhost, type ModalProps, Pagination, PaginationGhost, type PaginationProps, PromptCard, PromptCardGhost, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, SidePanelGhost, type SidePanelProps, Sidebar, SidebarAccountMenu, type SidebarAccountMenuProps, SidebarBrand, SidebarFooter, SidebarGhost, type SidebarGhostProps, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableDefaultSort, SortableTableGhost, type SortableTableProps, type SortableTableRowAction, type SurfaceGhostProps, type TabItem, Tabs, TabsGhost, type TabsProps, type TabsVariant, TextButton, TextButtonGhost, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, TextareaGhost, type TextareaProps, Toggle, ToggleGhost, type ToggleProps, UILoader, type UILoaderProps, type UILoaderTone, cn, useEscapeDismiss };
package/dist/index.js CHANGED
@@ -941,7 +941,8 @@ function Tabs({
941
941
  onValueChange,
942
942
  className,
943
943
  ariaLabel,
944
- divider = false
944
+ divider = false,
945
+ variant = "line"
945
946
  }) {
946
947
  const reactId = useId2();
947
948
  const [internalValue, setInternalValue] = useState4(
@@ -1003,7 +1004,7 @@ function Tabs({
1003
1004
  selectTab(nextId2);
1004
1005
  requestAnimationFrame(() => tabRefs.current[nextId2]?.focus());
1005
1006
  };
1006
- return /* @__PURE__ */ jsxs12("div", { className: cn("fractal-tabs", divider && "fractal-tabs--divider", className), children: [
1007
+ return /* @__PURE__ */ jsxs12("div", { className: cn("fractal-tabs", `fractal-tabs--${variant}`, divider && "fractal-tabs--divider", className), children: [
1007
1008
  /* @__PURE__ */ jsx16(
1008
1009
  "div",
1009
1010
  {
@@ -1408,13 +1409,14 @@ function SurfaceGhost({ className, title, lines = 3, ...props }) {
1408
1409
 
1409
1410
  // src/components/Sidebar/Sidebar.tsx
1410
1411
  import * as React11 from "react";
1411
- import { jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
1412
+ import { Fragment as Fragment3, jsx as jsx21, jsxs as jsxs16 } from "react/jsx-runtime";
1412
1413
  var Sidebar = React11.forwardRef(
1413
- ({ className, width, style, ...props }, ref) => /* @__PURE__ */ jsx21(
1414
+ ({ className, width, compact = false, style, ...props }, ref) => /* @__PURE__ */ jsx21(
1414
1415
  "aside",
1415
1416
  {
1416
1417
  ref,
1417
1418
  className: cn("fractal-sidebar", className),
1419
+ "data-compact": compact || void 0,
1418
1420
  style: { ...style, ...width ? { "--fractal-sidebar-width": width } : {} },
1419
1421
  ...props
1420
1422
  }
@@ -1434,6 +1436,7 @@ function SidebarAccountMenu({
1434
1436
  items,
1435
1437
  onSelect,
1436
1438
  triggerLabel = "Account menu",
1439
+ icon,
1437
1440
  className
1438
1441
  }) {
1439
1442
  return /* @__PURE__ */ jsx21(
@@ -1446,7 +1449,10 @@ function SidebarAccountMenu({
1446
1449
  panelClassName: "fractal-sidebar__account-panel",
1447
1450
  selectedValue: "",
1448
1451
  triggerClassName: "fractal-sidebar__account-trigger",
1449
- triggerContent: /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__account-name", children: name }),
1452
+ triggerContent: /* @__PURE__ */ jsxs16(Fragment3, { children: [
1453
+ icon && /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__account-icon", "aria-hidden": "true", children: icon }),
1454
+ /* @__PURE__ */ jsx21("span", { className: "fractal-sidebar__account-name", children: name })
1455
+ ] }),
1450
1456
  triggerLabel,
1451
1457
  triggerVariant: "tertiary"
1452
1458
  }