@sofya-ds/react 1.8.0 → 1.10.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/dist/index.d.ts CHANGED
@@ -307,7 +307,9 @@ declare const legacyIconToTablerNameMap: {
307
307
  readonly "caret-up": "IconChevronUp";
308
308
  readonly "caret-left": "IconChevronLeft";
309
309
  readonly "caret-right": "IconChevronRight";
310
+ readonly copy: "IconCopy";
310
311
  readonly logout: "IconLogout";
312
+ readonly star: "IconStar";
311
313
  readonly "users-group": "IconUsersGroup";
312
314
  readonly archive: "IconArchive";
313
315
  readonly folder: "IconFolder";
@@ -683,33 +685,54 @@ interface SwitchProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimit
683
685
  }
684
686
  declare const Switch: React.ForwardRefExoticComponent<SwitchProps & React.RefAttributes<HTMLButtonElement>>;
685
687
 
688
+ declare const tableDensityOptions: readonly ["default", "compact"];
686
689
  declare const tableCellVariantOptions: readonly ["default", "primary", "muted"];
687
- declare const tableStatusToneOptions: readonly ["active", "inactive", "warning"];
690
+ declare const tableStatusToneOptions: readonly ["active", "inactive", "info", "warning"];
688
691
  declare const tableActionToneOptions: readonly ["primary", "neutral", "danger"];
692
+ type TableDensity = (typeof tableDensityOptions)[number];
693
+ type TableTextSize = "default" | "compact";
689
694
  declare const tableCellVariants: (props?: ({
695
+ density?: "default" | "compact" | null | undefined;
690
696
  variant?: "default" | "primary" | "muted" | null | undefined;
691
697
  } & class_variance_authority_types.ClassProp) | undefined) => string;
692
698
  declare const tableStatusBadgeVariants: (props?: ({
693
- tone?: "warning" | "active" | "inactive" | null | undefined;
699
+ density?: "default" | "compact" | null | undefined;
700
+ tone?: "warning" | "active" | "inactive" | "info" | null | undefined;
694
701
  } & class_variance_authority_types.ClassProp) | undefined) => string;
695
702
  declare const tableActionButtonVariants: (props?: ({
696
703
  tone?: "primary" | "neutral" | "danger" | null | undefined;
697
704
  } & class_variance_authority_types.ClassProp) | undefined) => string;
698
- declare const Table: React.ForwardRefExoticComponent<React.TableHTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
705
+ interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
706
+ density?: TableDensity;
707
+ }
708
+ declare const Table: React.ForwardRefExoticComponent<TableProps & React.RefAttributes<HTMLTableElement>>;
699
709
  declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
700
710
  declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
701
711
  declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
702
- declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
712
+ interface TableRowProps extends React.HTMLAttributes<HTMLTableRowElement> {
713
+ density?: TableDensity;
714
+ }
715
+ declare const TableRow: React.ForwardRefExoticComponent<TableRowProps & React.RefAttributes<HTMLTableRowElement>>;
703
716
  declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
704
- interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement>, VariantProps<typeof tableCellVariants> {
717
+ interface TableCellProps extends React.TdHTMLAttributes<HTMLTableCellElement>, Omit<VariantProps<typeof tableCellVariants>, "density"> {
718
+ density?: TableDensity;
705
719
  /** When true, truncates overflowing text with an ellipsis. */
706
720
  truncate?: boolean;
707
721
  }
708
722
  declare const TableCell: React.ForwardRefExoticComponent<TableCellProps & React.RefAttributes<HTMLTableCellElement>>;
709
723
  declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
710
- interface TableStatusBadgeProps extends Omit<React.ComponentPropsWithoutRef<typeof Badge>, "variant" | "pillTone">, VariantProps<typeof tableStatusBadgeVariants> {
724
+ interface TableCellTitleProps extends React.HTMLAttributes<HTMLSpanElement> {
725
+ size?: TableTextSize;
726
+ }
727
+ declare const TableCellTitle: React.ForwardRefExoticComponent<TableCellTitleProps & React.RefAttributes<HTMLSpanElement>>;
728
+ interface TableCellDescriptionProps extends React.HTMLAttributes<HTMLSpanElement> {
729
+ size?: TableTextSize;
730
+ }
731
+ declare const TableCellDescription: React.ForwardRefExoticComponent<TableCellDescriptionProps & React.RefAttributes<HTMLSpanElement>>;
732
+ interface TableStatusBadgeProps extends Omit<React.ComponentPropsWithoutRef<typeof Badge>, "variant" | "pillTone">, Omit<VariantProps<typeof tableStatusBadgeVariants>, "density"> {
733
+ density?: TableDensity;
711
734
  }
712
- declare function TableStatusBadge({ className, tone, children, ...props }: TableStatusBadgeProps): react_jsx_runtime.JSX.Element;
735
+ declare function TableStatusBadge({ className, density, tone, children, ...props }: TableStatusBadgeProps): react_jsx_runtime.JSX.Element;
713
736
  interface TableActionButtonProps extends Omit<React.ComponentPropsWithoutRef<typeof Button>, "size" | "variant">, VariantProps<typeof tableActionButtonVariants> {
714
737
  }
715
738
  declare const TableActionButton: React.ForwardRefExoticComponent<TableActionButtonProps & React.RefAttributes<HTMLButtonElement>>;
@@ -789,4 +812,4 @@ interface SofyaProviderProps extends React.HTMLAttributes<HTMLDivElement> {
789
812
  }
790
813
  declare function SofyaProvider({ preset, overrides, className, style, children, ...props }: SofyaProviderProps): react_jsx_runtime.JSX.Element;
791
814
 
792
- export { Accordion, type AccordionAppearance, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, type AlertProps, type AlertSize, AlertTitle, type AlertTone, Avatar, type AvatarProps, Badge, type BadgeAlert, type BadgePillTone, type BadgeProps, type BadgeVariant, Button, type ButtonLanguageLocale, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, Cluster, type ClusterProps, Container, type ContainerProps, Dialog, DialogBody, DialogCancel, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocumentCard, type DocumentCardProps, Dropdown, type DropdownAppearance, type DropdownItem, type DropdownProps, DropdownSearch, type DropdownSearchOption, type DropdownSearchProps, type DropdownSubItem, type DropdownTriggerSize, type DropdownVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, Icon, type IconColor, type IconName, type IconProps, type IconSize, Inline, type InlineProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, type InputVariant, Label, Link, type LinkProps, Logo, type LogoProps, type LogoSize, type LogoVariant, type NotificationVariant, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverPortal, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, type ProgressSize, ProseDialogBody, ProseDialogContent, type ProseDialogContentProps, ProseDialogDescription, ProseDialogHeader, ProseDialogTitle, RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupOption, RadioGroupOptionAvatar, type RadioGroupOptionAvatarProps, RadioGroupOptionDescription, type RadioGroupOptionDescriptionProps, RadioGroupOptionIndicator, type RadioGroupOptionIndicatorProps, RadioGroupOptionLabel, type RadioGroupOptionLabelProps, type RadioGroupOptionProps, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupVariant, RightRailAction, type RightRailActionProps, ScrollArea, ScrollAreaCorner, type ScrollAreaOrientation, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, type SelectSize, SelectTrigger, SelectValue, Separator, Skeleton, type SkeletonProps, Slider, type SliderProps, SofyaProvider, type SofyaProviderProps, Spinner, type SpinnerProps, type SpinnerSize, Stack, type StackProps, Surface, type SurfaceVariant, Switch, type SwitchProps, type SwitchSize, Table, TableActionButton, type TableActionButtonProps, TableActions, TableBody, TableCaption, TableCell, type TableCellProps, TableFooter, TableHead, TableHeader, TableRow, TableStatusBadge, type TableStatusBadgeProps, Tabs, type TabsItem, type TabsProps, Text, type TextProps, type TextSize, type TextSplitType, type TextVariant, type TextWeight, Textarea, type TextareaProps, Toaster, type ToasterProps, Toggle, type ToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadKind, accordionAppearanceOptions, alertSizeOptions, alertToneOptions, avatarSizeOptions, avatarVariants, badgeAlertOptions, badgeAlertVariants, badgePillToneOptions, badgePillVariants, badgeVariantOptions, badgeVariants, buttonLanguageLocaleOptions, buttonSizeOptions, buttonVariantOptions, buttonVariants, cardVariants, dropdownAppearanceOptions, dropdownLanguageItems, dropdownTriggerSizeOptions, dropdownVariantOptions, emptyMediaVariantOptions, iconColorOptions, iconNames, iconSizeMap, iconSizeOptions, inputVariantOptions, isTextContent, logoSizeOptions, logoVariants, notificationVariantOptions, paginationLinkVariants, progressSizeOptions, radioGroupOrientationOptions, radioGroupVariantOptions, renderTextContent, scrollAreaOrientationOptions, selectSizeOptions, spinnerSizeOptions, surfaceVariantOptions, switchSizeOptions, tableActionToneOptions, tableCellVariantOptions, tableStatusToneOptions, textSizeOptions, textSplitTypeOptions, textVariantOptions, uploadKindOptions };
815
+ export { Accordion, type AccordionAppearance, AccordionContent, type AccordionContentProps, AccordionItem, type AccordionProps, AccordionTrigger, type AccordionTriggerProps, Alert, AlertDescription, type AlertProps, type AlertSize, AlertTitle, type AlertTone, Avatar, type AvatarProps, Badge, type BadgeAlert, type BadgePillTone, type BadgeProps, type BadgeVariant, Button, type ButtonLanguageLocale, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, type CardProps, CardTitle, Checkbox, type CheckboxProps, Cluster, type ClusterProps, Container, type ContainerProps, Dialog, DialogBody, DialogCancel, DialogClose, DialogContent, type DialogContentProps, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DocumentCard, type DocumentCardProps, Dropdown, type DropdownAppearance, type DropdownItem, type DropdownProps, DropdownSearch, type DropdownSearchOption, type DropdownSearchProps, type DropdownSubItem, type DropdownTriggerSize, type DropdownVariant, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, type EmptyMediaProps, type EmptyProps, EmptyTitle, Icon, type IconColor, type IconName, type IconProps, type IconSize, Inline, type InlineProps, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, type InputProps, type InputVariant, Label, Link, type LinkProps, Logo, type LogoProps, type LogoSize, type LogoVariant, type NotificationVariant, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverDescription, PopoverPortal, PopoverTitle, PopoverTrigger, Progress, type ProgressProps, type ProgressSize, ProseDialogBody, ProseDialogContent, type ProseDialogContentProps, ProseDialogDescription, ProseDialogHeader, ProseDialogTitle, RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupOption, RadioGroupOptionAvatar, type RadioGroupOptionAvatarProps, RadioGroupOptionDescription, type RadioGroupOptionDescriptionProps, RadioGroupOptionIndicator, type RadioGroupOptionIndicatorProps, RadioGroupOptionLabel, type RadioGroupOptionLabelProps, type RadioGroupOptionProps, type RadioGroupOrientation, type RadioGroupProps, type RadioGroupVariant, RightRailAction, type RightRailActionProps, ScrollArea, ScrollAreaCorner, type ScrollAreaOrientation, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaViewport, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, type SelectSize, SelectTrigger, SelectValue, Separator, Skeleton, type SkeletonProps, Slider, type SliderProps, SofyaProvider, type SofyaProviderProps, Spinner, type SpinnerProps, type SpinnerSize, Stack, type StackProps, Surface, type SurfaceVariant, Switch, type SwitchProps, type SwitchSize, Table, TableActionButton, type TableActionButtonProps, TableActions, TableBody, TableCaption, TableCell, TableCellDescription, type TableCellDescriptionProps, type TableCellProps, TableCellTitle, type TableCellTitleProps, type TableDensity, TableFooter, TableHead, TableHeader, type TableProps, TableRow, type TableRowProps, TableStatusBadge, type TableStatusBadgeProps, type TableTextSize, Tabs, type TabsItem, type TabsProps, Text, type TextProps, type TextSize, type TextSplitType, type TextVariant, type TextWeight, Textarea, type TextareaProps, Toaster, type ToasterProps, Toggle, type ToggleProps, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UploadKind, accordionAppearanceOptions, alertSizeOptions, alertToneOptions, avatarSizeOptions, avatarVariants, badgeAlertOptions, badgeAlertVariants, badgePillToneOptions, badgePillVariants, badgeVariantOptions, badgeVariants, buttonLanguageLocaleOptions, buttonSizeOptions, buttonVariantOptions, buttonVariants, cardVariants, dropdownAppearanceOptions, dropdownLanguageItems, dropdownTriggerSizeOptions, dropdownVariantOptions, emptyMediaVariantOptions, iconColorOptions, iconNames, iconSizeMap, iconSizeOptions, inputVariantOptions, isTextContent, logoSizeOptions, logoVariants, notificationVariantOptions, paginationLinkVariants, progressSizeOptions, radioGroupOrientationOptions, radioGroupVariantOptions, renderTextContent, scrollAreaOrientationOptions, selectSizeOptions, spinnerSizeOptions, surfaceVariantOptions, switchSizeOptions, tableActionToneOptions, tableCellVariantOptions, tableDensityOptions, tableStatusToneOptions, textSizeOptions, textSplitTypeOptions, textVariantOptions, uploadKindOptions };
package/dist/index.js CHANGED
@@ -118,6 +118,7 @@ import {
118
118
  IconChevronLeft,
119
119
  IconChevronDown,
120
120
  IconChevronUp,
121
+ IconCopy,
121
122
  IconEdit,
122
123
  IconFile,
123
124
  IconFolders,
@@ -133,6 +134,7 @@ import {
133
134
  IconSearch,
134
135
  IconSquareToggle,
135
136
  IconSparkles,
137
+ IconStar,
136
138
  IconUser,
137
139
  IconUserFilled,
138
140
  IconUserCircle,
@@ -161,6 +163,7 @@ var tablerIconRegistry = {
161
163
  IconChevronLeft,
162
164
  IconChevronDown,
163
165
  IconChevronUp,
166
+ IconCopy,
164
167
  IconEdit,
165
168
  IconFile,
166
169
  IconFolders,
@@ -176,6 +179,7 @@ var tablerIconRegistry = {
176
179
  IconSearch,
177
180
  IconSquareToggle,
178
181
  IconSparkles,
182
+ IconStar,
179
183
  IconUser,
180
184
  IconUserFilled,
181
185
  IconUserCircle,
@@ -232,7 +236,9 @@ var legacyIconToTablerNameMap = {
232
236
  "caret-up": "IconChevronUp",
233
237
  "caret-left": "IconChevronLeft",
234
238
  "caret-right": "IconChevronRight",
239
+ "copy": "IconCopy",
235
240
  "logout": "IconLogout",
241
+ "star": "IconStar",
236
242
  "users-group": "IconUsersGroup",
237
243
  "archive": "IconArchive",
238
244
  "folder": "IconFolder",
@@ -5472,17 +5478,28 @@ Switch.displayName = SwitchPrimitives.Root.displayName;
5472
5478
  import { cva as cva8 } from "class-variance-authority";
5473
5479
  import * as React37 from "react";
5474
5480
  import { jsx as jsx39 } from "react/jsx-runtime";
5481
+ var tableDensityOptions = ["default", "compact"];
5475
5482
  var tableCellVariantOptions = ["default", "primary", "muted"];
5476
5483
  var tableStatusToneOptions = [
5477
5484
  "active",
5478
5485
  "inactive",
5486
+ "info",
5479
5487
  "warning"
5480
5488
  ];
5481
5489
  var tableActionToneOptions = ["primary", "neutral", "danger"];
5490
+ var TableDensityContext = React37.createContext("default");
5491
+ function useTableDensity(density) {
5492
+ const inheritedDensity = React37.useContext(TableDensityContext);
5493
+ return density ?? inheritedDensity;
5494
+ }
5482
5495
  var tableCellVariants = cva8(
5483
- "px-2 py-6 align-middle [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] font-normal leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)]",
5496
+ "px-4 align-middle [font-family:var(--sofya-text-body-font-family)] text-[length:var(--sofya-text-body-font-size)] font-normal leading-[var(--sofya-text-body-line-height)] tracking-[var(--sofya-text-body-letter-spacing)]",
5484
5497
  {
5485
5498
  variants: {
5499
+ density: {
5500
+ default: "py-5",
5501
+ compact: "h-[72px] py-3"
5502
+ },
5486
5503
  variant: {
5487
5504
  default: "text-[color:var(--sofya-text-soft)]",
5488
5505
  primary: "font-medium text-[color:var(--sofya-text-default)]",
@@ -5490,24 +5507,31 @@ var tableCellVariants = cva8(
5490
5507
  }
5491
5508
  },
5492
5509
  defaultVariants: {
5510
+ density: "default",
5493
5511
  variant: "default"
5494
5512
  }
5495
5513
  }
5496
5514
  );
5497
5515
  var tableStatusBadgeVariants = cva8("normal-case", {
5498
5516
  variants: {
5517
+ density: {
5518
+ default: "",
5519
+ compact: "h-6 min-h-6 px-4 py-1"
5520
+ },
5499
5521
  tone: {
5500
5522
  active: "border-[color:var(--sofya-tone-success-border)] bg-[color:var(--sofya-tone-success-background)] text-[color:var(--sofya-tone-success-foreground)]",
5501
5523
  inactive: "border-[color:var(--sofya-tone-default-border)] bg-[color:var(--sofya-tone-default-background)] text-[color:var(--sofya-text-subtle)]",
5524
+ info: "border-transparent bg-primary/10 text-primary",
5502
5525
  warning: "border-[color:var(--sofya-tone-warning-border)] bg-[color:var(--sofya-tone-warning-background)] text-[color:var(--sofya-tone-warning-foreground)]"
5503
5526
  }
5504
5527
  },
5505
5528
  defaultVariants: {
5529
+ density: "default",
5506
5530
  tone: "active"
5507
5531
  }
5508
5532
  });
5509
5533
  var tableActionButtonVariants = cva8(
5510
- "text-[length:var(--sofya-text-body-font-size)] leading-[var(--sofya-text-body-line-height)] shadow-none motion-safe:active:scale-[0.97] focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0 disabled:opacity-40 [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
5534
+ "h-8 w-8 text-[length:var(--sofya-text-body-font-size)] leading-[var(--sofya-text-body-line-height)] shadow-none motion-safe:active:scale-[0.97] focus-visible:ring-[color:var(--sofya-focus-ring-soft)] focus-visible:ring-offset-0 disabled:opacity-40 [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
5511
5535
  {
5512
5536
  variants: {
5513
5537
  tone: {
@@ -5521,8 +5545,8 @@ var tableActionButtonVariants = cva8(
5521
5545
  }
5522
5546
  }
5523
5547
  );
5524
- var Table = React37.forwardRef(function Table2({ className, ...props }, ref) {
5525
- return /* @__PURE__ */ jsx39(
5548
+ var Table = React37.forwardRef(function Table2({ className, density = "default", ...props }, ref) {
5549
+ return /* @__PURE__ */ jsx39(TableDensityContext.Provider, { value: density, children: /* @__PURE__ */ jsx39(
5526
5550
  "div",
5527
5551
  {
5528
5552
  "data-slot": "table-container",
@@ -5530,31 +5554,32 @@ var Table = React37.forwardRef(function Table2({ className, ...props }, ref) {
5530
5554
  children: /* @__PURE__ */ jsx39(
5531
5555
  "table",
5532
5556
  {
5557
+ "data-density": density,
5533
5558
  "data-slot": "table",
5534
5559
  ref,
5535
5560
  className: cn(
5536
- "w-full min-w-[1040px] caption-bottom border-collapse bg-card",
5561
+ "w-full min-w-[1040px] caption-bottom border-separate border-spacing-0 bg-card",
5537
5562
  className
5538
5563
  ),
5539
5564
  ...props
5540
5565
  }
5541
5566
  )
5542
5567
  }
5543
- );
5568
+ ) });
5544
5569
  });
5545
5570
  var TableHeader = React37.forwardRef(function TableHeader2({ className, ...props }, ref) {
5546
- return /* @__PURE__ */ jsx39(
5571
+ return /* @__PURE__ */ jsx39(TableDensityContext.Provider, { value: "default", children: /* @__PURE__ */ jsx39(
5547
5572
  "thead",
5548
5573
  {
5549
5574
  "data-slot": "table-header",
5550
5575
  ref,
5551
5576
  className: cn(
5552
- "[&_tr]:border-b [&_tr]:border-[color:var(--sofya-border-strong)] [&_tr:hover]:bg-transparent",
5577
+ "[&_tr]:border-0 [&_tr:hover]:bg-transparent [&_th]:bg-[color:var(--sofya-tone-default-background)] [&_th:first-child]:rounded-tl-[var(--sofya-radius-md)] [&_th:last-child]:rounded-tr-[var(--sofya-radius-md)]",
5553
5578
  className
5554
5579
  ),
5555
5580
  ...props
5556
5581
  }
5557
- );
5582
+ ) });
5558
5583
  });
5559
5584
  var TableBody = React37.forwardRef(function TableBody2({ className, ...props }, ref) {
5560
5585
  return /* @__PURE__ */ jsx39(
@@ -5562,7 +5587,7 @@ var TableBody = React37.forwardRef(function TableBody2({ className, ...props },
5562
5587
  {
5563
5588
  "data-slot": "table-body",
5564
5589
  ref,
5565
- className: cn("[&_tr:last-child]:border-0", className),
5590
+ className: cn("[&_tr:last-child>td]:border-0", className),
5566
5591
  ...props
5567
5592
  }
5568
5593
  );
@@ -5581,20 +5606,25 @@ var TableFooter = React37.forwardRef(function TableFooter2({ className, ...props
5581
5606
  }
5582
5607
  );
5583
5608
  });
5584
- var TableRow = React37.forwardRef(function TableRow2({ className, ...props }, ref) {
5585
- return /* @__PURE__ */ jsx39(
5586
- "tr",
5587
- {
5588
- "data-slot": "table-row",
5589
- ref,
5590
- className: cn(
5591
- "border-b border-[color:var(--sofya-border-soft)] transition-colors duration-sofya ease-sofya hover:bg-[color:var(--sofya-tone-default-background)] data-[state=selected]:bg-[color:var(--sofya-tone-default-background)]",
5592
- className
5593
- ),
5594
- ...props
5595
- }
5596
- );
5597
- });
5609
+ var TableRow = React37.forwardRef(
5610
+ function TableRow2({ className, density, ...props }, ref) {
5611
+ const resolvedDensity = useTableDensity(density);
5612
+ return /* @__PURE__ */ jsx39(TableDensityContext.Provider, { value: resolvedDensity, children: /* @__PURE__ */ jsx39(
5613
+ "tr",
5614
+ {
5615
+ "data-density": resolvedDensity,
5616
+ "data-slot": "table-row",
5617
+ ref,
5618
+ className: cn(
5619
+ "border-b border-[color:var(--sofya-border-soft)] transition-colors duration-sofya ease-sofya hover:bg-[color:var(--sofya-tone-default-background)] data-[state=selected]:bg-[color:var(--sofya-tone-default-background)] [&>td]:border-b [&>td]:border-[color:var(--sofya-border-soft)]",
5620
+ resolvedDensity === "compact" && "h-[72px]",
5621
+ className
5622
+ ),
5623
+ ...props
5624
+ }
5625
+ ) });
5626
+ }
5627
+ );
5598
5628
  var TableHead = React37.forwardRef(function TableHead2({ className, children, ...props }, ref) {
5599
5629
  return /* @__PURE__ */ jsx39(
5600
5630
  "th",
@@ -5602,7 +5632,7 @@ var TableHead = React37.forwardRef(function TableHead2({ className, children, ..
5602
5632
  "data-slot": "table-head",
5603
5633
  ref,
5604
5634
  className: cn(
5605
- "whitespace-nowrap px-2 py-8 text-left align-middle [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-medium uppercase leading-4 tracking-[0.12em] text-[color:var(--sofya-text-default)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
5635
+ "whitespace-nowrap px-4 py-4 text-left align-middle [font-family:var(--sofya-text-tiny-font-family)] text-[length:var(--sofya-text-tiny-font-size)] font-medium uppercase leading-4 tracking-[0.08em] text-[color:var(--sofya-text-default)] [&_svg]:h-[1em] [&_svg]:w-[1em] [&_svg]:shrink-0",
5606
5636
  className
5607
5637
  ),
5608
5638
  ...props,
@@ -5616,14 +5646,16 @@ var TableHead = React37.forwardRef(function TableHead2({ className, children, ..
5616
5646
  );
5617
5647
  });
5618
5648
  var TableCell = React37.forwardRef(
5619
- function TableCell2({ className, variant, truncate, children, ...props }, ref) {
5649
+ function TableCell2({ className, density, variant, truncate, children, ...props }, ref) {
5650
+ const resolvedDensity = useTableDensity(density);
5620
5651
  return /* @__PURE__ */ jsx39(
5621
5652
  "td",
5622
5653
  {
5654
+ "data-density": resolvedDensity,
5623
5655
  "data-slot": "table-cell",
5624
5656
  ref,
5625
5657
  className: cn(
5626
- tableCellVariants({ variant }),
5658
+ tableCellVariants({ density: resolvedDensity, variant }),
5627
5659
  truncate && "max-w-0",
5628
5660
  className
5629
5661
  ),
@@ -5661,17 +5693,72 @@ var TableCaption = React37.forwardRef(function TableCaption2({ className, childr
5661
5693
  }
5662
5694
  );
5663
5695
  });
5696
+ var TableCellTitle = React37.forwardRef(
5697
+ function TableCellTitle2({ className, children, size, ...props }, ref) {
5698
+ const density = useTableDensity();
5699
+ const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
5700
+ const textSize = resolvedSize === "compact" ? "label-md" : "body";
5701
+ return /* @__PURE__ */ jsx39(
5702
+ "span",
5703
+ {
5704
+ "data-slot": "table-cell-title",
5705
+ ref,
5706
+ className: cn(
5707
+ "block font-medium text-[color:var(--sofya-text-default)]",
5708
+ className
5709
+ ),
5710
+ ...props,
5711
+ children: renderTextContent(children, {
5712
+ as: "span",
5713
+ className: "block text-inherit",
5714
+ size: textSize,
5715
+ style: inheritedTypographyStyle
5716
+ })
5717
+ }
5718
+ );
5719
+ }
5720
+ );
5721
+ var TableCellDescription = React37.forwardRef(function TableCellDescription2({ className, children, size, ...props }, ref) {
5722
+ const density = useTableDensity();
5723
+ const resolvedSize = size ?? (density === "compact" ? "compact" : "default");
5724
+ const textSize = resolvedSize === "compact" ? "body-sm" : "tiny";
5725
+ return /* @__PURE__ */ jsx39(
5726
+ "span",
5727
+ {
5728
+ "data-slot": "table-cell-description",
5729
+ ref,
5730
+ className: cn(
5731
+ "block text-[color:var(--sofya-text-subtle)]",
5732
+ resolvedSize === "compact" ? "mt-0" : "mt-1",
5733
+ className
5734
+ ),
5735
+ ...props,
5736
+ children: renderTextContent(children, {
5737
+ as: "span",
5738
+ className: "block text-inherit",
5739
+ size: textSize,
5740
+ style: inheritedTypographyStyle
5741
+ })
5742
+ }
5743
+ );
5744
+ });
5664
5745
  function TableStatusBadge({
5665
5746
  className,
5747
+ density,
5666
5748
  tone,
5667
5749
  children,
5668
5750
  ...props
5669
5751
  }) {
5752
+ const resolvedDensity = useTableDensity(density);
5670
5753
  return /* @__PURE__ */ jsx39(
5671
5754
  Badge,
5672
5755
  {
5756
+ "data-density": resolvedDensity,
5673
5757
  variant: "pill",
5674
- className: cn(tableStatusBadgeVariants({ tone }), className),
5758
+ className: cn(
5759
+ tableStatusBadgeVariants({ density: resolvedDensity, tone }),
5760
+ className
5761
+ ),
5675
5762
  ...props,
5676
5763
  children: renderTextContent(children, {
5677
5764
  as: "span",
@@ -5719,6 +5806,8 @@ TableRow.displayName = "TableRow";
5719
5806
  TableHead.displayName = "TableHead";
5720
5807
  TableCell.displayName = "TableCell";
5721
5808
  TableCaption.displayName = "TableCaption";
5809
+ TableCellTitle.displayName = "TableCellTitle";
5810
+ TableCellDescription.displayName = "TableCellDescription";
5722
5811
  TableActionButton.displayName = "TableActionButton";
5723
5812
  TableActions.displayName = "TableActions";
5724
5813
 
@@ -6218,6 +6307,8 @@ export {
6218
6307
  TableBody,
6219
6308
  TableCaption,
6220
6309
  TableCell,
6310
+ TableCellDescription,
6311
+ TableCellTitle,
6221
6312
  TableFooter,
6222
6313
  TableHead,
6223
6314
  TableHeader,
@@ -6292,6 +6383,7 @@ export {
6292
6383
  switchSizeOptions,
6293
6384
  tableActionToneOptions,
6294
6385
  tableCellVariantOptions,
6386
+ tableDensityOptions,
6295
6387
  tableStatusToneOptions,
6296
6388
  textSizeOptions,
6297
6389
  textSplitTypeOptions,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofya-ds/react",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Sofya React design system with official brand tokens, provider and UI components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -59,7 +59,7 @@
59
59
  "motion": "^12.38.0",
60
60
  "sonner": "^2.0.7",
61
61
  "tailwind-merge": "^3.5.0",
62
- "@sofya-ds/tokens": "1.8.0"
62
+ "@sofya-ds/tokens": "1.10.0"
63
63
  },
64
64
  "devDependencies": {
65
65
  "@testing-library/jest-dom": "^6.9.1",