@nearform/quantum 1.6.1 → 1.6.3

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.mjs CHANGED
@@ -109,6 +109,7 @@ __export(index_exports, {
109
109
  TableBody: () => TableBody,
110
110
  TableCaption: () => TableCaption,
111
111
  TableCell: () => TableCell,
112
+ TableEmpty: () => TableEmpty,
112
113
  TableFooter: () => TableFooter,
113
114
  TableHead: () => TableHead,
114
115
  TableHeader: () => TableHeader,
@@ -4802,17 +4803,36 @@ SubnavLink.displayName = "SubnavLink";
4802
4803
  // src/components/Table/index.tsx
4803
4804
  import * as React37 from "react";
4804
4805
  import { cva as cva30 } from "class-variance-authority";
4805
- import { jsx as jsx40 } from "react/jsx-runtime";
4806
- var tableBodyVariants = cva30("bg-background dark:bg-grey-900", {
4806
+ import { jsx as jsx40, jsxs as jsxs27 } from "react/jsx-runtime";
4807
+ var tableBodyVariants = cva30("bg-background dark:bg-background-dark", {
4807
4808
  variants: {
4808
4809
  variant: {
4809
4810
  zebra: [
4810
- "[&>*:nth-child(even)]:bg-background-subtle",
4811
- "dark:[&>*:nth-child(even)]:bg-background-subtle-dark"
4811
+ "[:where(&>*:nth-child(even))]:bg-background-subtle",
4812
+ "dark:[:where(&>*:nth-child(even))]:bg-background-subtle-dark"
4812
4813
  ]
4813
4814
  }
4814
4815
  }
4815
4816
  });
4817
+ var alignVariants2 = cva30("", {
4818
+ variants: {
4819
+ align: {
4820
+ left: "text-left",
4821
+ center: "text-center",
4822
+ right: "text-right"
4823
+ }
4824
+ }
4825
+ });
4826
+ var ariaSortFor = (direction) => {
4827
+ if (direction === "asc") return "ascending";
4828
+ if (direction === "desc") return "descending";
4829
+ return void 0;
4830
+ };
4831
+ var SortIcon = ({ direction }) => {
4832
+ if (direction === "asc") return /* @__PURE__ */ jsx40(assets_exports.BsArrowUp, { "aria-hidden": "true" });
4833
+ if (direction === "desc") return /* @__PURE__ */ jsx40(assets_exports.BsArrowDown, { "aria-hidden": "true" });
4834
+ return /* @__PURE__ */ jsx40(assets_exports.BsArrowDownUp, { "aria-hidden": "true" });
4835
+ };
4816
4836
  var Table = React37.forwardRef(
4817
4837
  (_a, ref) => {
4818
4838
  var _b = _a, { className, containerClassName } = _b, props = __objRest(_b, ["className", "containerClassName"]);
@@ -4829,7 +4849,10 @@ var Table = React37.forwardRef(
4829
4849
  "table",
4830
4850
  __spreadValues({
4831
4851
  ref,
4832
- className: cn("caption-bottom text-sm dark:text-white", className)
4852
+ className: cn(
4853
+ "caption-bottom text-sm text-foreground dark:text-foreground-dark",
4854
+ className
4855
+ )
4833
4856
  }, props)
4834
4857
  )
4835
4858
  }
@@ -4844,23 +4867,48 @@ var TableHeader = React37.forwardRef((_a, ref) => {
4844
4867
  __spreadValues({
4845
4868
  ref,
4846
4869
  className: cn(
4847
- "bg-background-subtle dark:bg-background-subtle-dark text-left",
4870
+ "bg-background-subtle dark:bg-background-subtle-dark text-left",
4848
4871
  className
4849
4872
  )
4850
4873
  }, props)
4851
4874
  );
4852
4875
  });
4853
4876
  TableHeader.displayName = "TableHeader";
4854
- var TableHead = React37.forwardRef((_a, ref) => {
4855
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
4856
- return /* @__PURE__ */ jsx40(
4857
- "th",
4858
- __spreadValues({
4859
- ref,
4860
- className: cn("px-4 py-5 leading-[21px] font-bold", className)
4861
- }, props)
4862
- );
4863
- });
4877
+ var TableHead = React37.forwardRef(
4878
+ (_a, ref) => {
4879
+ var _b = _a, { className, align, sortDirection, onSort, children } = _b, props = __objRest(_b, ["className", "align", "sortDirection", "onSort", "children"]);
4880
+ return /* @__PURE__ */ jsx40(
4881
+ "th",
4882
+ __spreadProps(__spreadValues({
4883
+ ref,
4884
+ "aria-sort": onSort ? ariaSortFor(sortDirection) : void 0,
4885
+ className: cn(
4886
+ "px-4 py-5 leading-[21px] font-bold",
4887
+ alignVariants2({ align }),
4888
+ className
4889
+ )
4890
+ }, props), {
4891
+ children: onSort ? /* @__PURE__ */ jsxs27(
4892
+ "button",
4893
+ {
4894
+ type: "button",
4895
+ onClick: onSort,
4896
+ className: cn(
4897
+ "inline-flex min-h-6 items-center gap-2 rounded-xs font-bold",
4898
+ "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current",
4899
+ "[&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0",
4900
+ align === "right" && "flex-row-reverse"
4901
+ ),
4902
+ children: [
4903
+ children,
4904
+ /* @__PURE__ */ jsx40(SortIcon, { direction: sortDirection })
4905
+ ]
4906
+ }
4907
+ ) : children
4908
+ })
4909
+ );
4910
+ }
4911
+ );
4864
4912
  TableHead.displayName = "TableHead";
4865
4913
  var TableBody = React37.forwardRef(
4866
4914
  (_a, ref) => {
@@ -4875,25 +4923,57 @@ var TableBody = React37.forwardRef(
4875
4923
  }
4876
4924
  );
4877
4925
  TableBody.displayName = "TableBody";
4878
- var TableRow = React37.forwardRef((_a, ref) => {
4879
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
4880
- return /* @__PURE__ */ jsx40(
4881
- "tr",
4882
- __spreadValues({
4883
- ref,
4884
- className: cn(
4885
- "h-[50px] self-stretch items-center gap-2 font-normal text-left",
4886
- className
4887
- )
4888
- }, props)
4889
- );
4890
- });
4926
+ var TableRow = React37.forwardRef(
4927
+ (_a, ref) => {
4928
+ var _b = _a, { className, selected } = _b, props = __objRest(_b, ["className", "selected"]);
4929
+ return /* @__PURE__ */ jsx40(
4930
+ "tr",
4931
+ __spreadValues({
4932
+ ref,
4933
+ "data-state": selected ? "selected" : void 0,
4934
+ className: cn(
4935
+ "h-[50px] self-stretch items-center gap-2 font-normal text-left",
4936
+ "data-[state=selected]:bg-background-alt",
4937
+ "dark:data-[state=selected]:bg-background-alt-dark",
4938
+ className
4939
+ )
4940
+ }, props)
4941
+ );
4942
+ }
4943
+ );
4891
4944
  TableRow.displayName = "TableRow";
4892
- var TableCell = React37.forwardRef((_a, ref) => {
4893
- var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
4894
- return /* @__PURE__ */ jsx40("td", __spreadValues({ ref, className: cn("p-4", className) }, props));
4895
- });
4945
+ var TableCell = React37.forwardRef(
4946
+ (_a, ref) => {
4947
+ var _b = _a, { className, align } = _b, props = __objRest(_b, ["className", "align"]);
4948
+ return /* @__PURE__ */ jsx40(
4949
+ "td",
4950
+ __spreadValues({
4951
+ ref,
4952
+ className: cn("p-4", alignVariants2({ align }), className)
4953
+ }, props)
4954
+ );
4955
+ }
4956
+ );
4896
4957
  TableCell.displayName = "TableCell";
4958
+ var TableEmpty = React37.forwardRef(
4959
+ (_a, ref) => {
4960
+ var _b = _a, { className, children = "No results." } = _b, props = __objRest(_b, ["className", "children"]);
4961
+ return /* @__PURE__ */ jsx40(TableRow, { children: /* @__PURE__ */ jsx40(
4962
+ TableCell,
4963
+ __spreadProps(__spreadValues({
4964
+ ref,
4965
+ align: "center",
4966
+ className: cn(
4967
+ "h-24 text-foreground-muted dark:text-foreground-muted-dark",
4968
+ className
4969
+ )
4970
+ }, props), {
4971
+ children
4972
+ })
4973
+ ) });
4974
+ }
4975
+ );
4976
+ TableEmpty.displayName = "TableEmpty";
4897
4977
  var TableCaption = React37.forwardRef((_a, ref) => {
4898
4978
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
4899
4979
  return /* @__PURE__ */ jsx40("caption", __spreadValues({ ref, className: cn("mt-4", className) }, props));
@@ -4905,7 +4985,10 @@ var TableFooter = React37.forwardRef((_a, ref) => {
4905
4985
  "tfoot",
4906
4986
  __spreadValues({
4907
4987
  ref,
4908
- className: cn("bg-primary text-primary-foreground", className)
4988
+ className: cn(
4989
+ "bg-background-subtle dark:bg-background-subtle-dark font-bold",
4990
+ className
4991
+ )
4909
4992
  }, props)
4910
4993
  );
4911
4994
  });
@@ -4916,7 +4999,7 @@ import * as React38 from "react";
4916
4999
  import * as TabsPrimitive from "@radix-ui/react-tabs";
4917
5000
  import { Slottable as Slottable3 } from "@radix-ui/react-slot";
4918
5001
  import { cva as cva31 } from "class-variance-authority";
4919
- import { jsx as jsx41, jsxs as jsxs27 } from "react/jsx-runtime";
5002
+ import { jsx as jsx41, jsxs as jsxs28 } from "react/jsx-runtime";
4920
5003
  var tabsVariants = cva31([
4921
5004
  "flex",
4922
5005
  "gap-4",
@@ -5033,7 +5116,7 @@ var TabsList = React38.forwardRef((_a, ref) => {
5033
5116
  TabsList.displayName = "TabsList";
5034
5117
  var TabsTrigger = React38.forwardRef((_a, ref) => {
5035
5118
  var _b = _a, { className, size, count, children } = _b, props = __objRest(_b, ["className", "size", "count", "children"]);
5036
- return /* @__PURE__ */ jsxs27(
5119
+ return /* @__PURE__ */ jsxs28(
5037
5120
  TabsPrimitive.Trigger,
5038
5121
  __spreadProps(__spreadValues({
5039
5122
  ref,
@@ -5062,7 +5145,7 @@ TabsContent.displayName = "TabsContent";
5062
5145
  // src/components/Textarea/index.tsx
5063
5146
  import React39 from "react";
5064
5147
  import { cva as cva32 } from "class-variance-authority";
5065
- import { jsx as jsx42, jsxs as jsxs28 } from "react/jsx-runtime";
5148
+ import { jsx as jsx42, jsxs as jsxs29 } from "react/jsx-runtime";
5066
5149
  var textareaVariants = cva32(
5067
5150
  [
5068
5151
  "flex",
@@ -5148,7 +5231,7 @@ var Textarea = React39.forwardRef(
5148
5231
  const textareaId = id != null ? id : generatedId;
5149
5232
  const helpTextId = `${textareaId}-helptext`;
5150
5233
  const describedBy = [ariaDescribedby, helpText ? helpTextId : void 0].filter(Boolean).join(" ") || void 0;
5151
- return /* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-3", children: [
5234
+ return /* @__PURE__ */ jsxs29("div", { className: "flex flex-col gap-3", children: [
5152
5235
  labelText && /* @__PURE__ */ jsx42(
5153
5236
  "label",
5154
5237
  {
@@ -5184,7 +5267,7 @@ Textarea.displayName = "Textarea";
5184
5267
  import * as React40 from "react";
5185
5268
  import * as ToastPrimitive from "@radix-ui/react-toast";
5186
5269
  import { cva as cva33 } from "class-variance-authority";
5187
- import { jsx as jsx43, jsxs as jsxs29 } from "react/jsx-runtime";
5270
+ import { jsx as jsx43, jsxs as jsxs30 } from "react/jsx-runtime";
5188
5271
  var focusClasses = [
5189
5272
  "outline-hidden",
5190
5273
  "focus-visible:shadow-brandGreen",
@@ -5263,7 +5346,7 @@ var Toast = React40.forwardRef((_a, ref) => {
5263
5346
  var _b = _a, { className, variant, icon, type, children } = _b, props = __objRest(_b, ["className", "variant", "icon", "type", "children"]);
5264
5347
  const resolved = variant != null ? variant : "info";
5265
5348
  const { icon: Icon3, className: iconClassName } = toastIcons[resolved];
5266
- return /* @__PURE__ */ jsxs29(
5349
+ return /* @__PURE__ */ jsxs30(
5267
5350
  ToastPrimitive.Root,
5268
5351
  __spreadProps(__spreadValues({
5269
5352
  ref,
@@ -5380,7 +5463,7 @@ ToastClose.displayName = ToastPrimitive.Close.displayName;
5380
5463
 
5381
5464
  // src/components/ToggleList/index.tsx
5382
5465
  import * as React41 from "react";
5383
- import { jsx as jsx44, jsxs as jsxs30 } from "react/jsx-runtime";
5466
+ import { jsx as jsx44, jsxs as jsxs31 } from "react/jsx-runtime";
5384
5467
  var ToggleList = React41.forwardRef((_a, ref) => {
5385
5468
  var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
5386
5469
  return /* @__PURE__ */ jsx44(
@@ -5398,7 +5481,7 @@ var ToggleListItem = React41.forwardRef(
5398
5481
  var _b = _a, { className, label, onRemove, removeLabel, id, disabled } = _b, props = __objRest(_b, ["className", "label", "onRemove", "removeLabel", "id", "disabled"]);
5399
5482
  const generatedId = React41.useId();
5400
5483
  const switchId = id != null ? id : generatedId;
5401
- return /* @__PURE__ */ jsxs30(
5484
+ return /* @__PURE__ */ jsxs31(
5402
5485
  "li",
5403
5486
  {
5404
5487
  className: cn(
@@ -5444,7 +5527,7 @@ ToggleListItem.displayName = "ToggleListItem";
5444
5527
  import * as React42 from "react";
5445
5528
  import * as TooltipPrimitive from "@radix-ui/react-tooltip";
5446
5529
  import { cva as cva34 } from "class-variance-authority";
5447
- import { jsx as jsx45, jsxs as jsxs31 } from "react/jsx-runtime";
5530
+ import { jsx as jsx45, jsxs as jsxs32 } from "react/jsx-runtime";
5448
5531
  var tooltipVariants = cva34([
5449
5532
  [
5450
5533
  "fill-accent",
@@ -5465,9 +5548,9 @@ var tooltipVariants = cva34([
5465
5548
  ]
5466
5549
  ]);
5467
5550
  var Tooltip = React42.forwardRef(({ children, side, content, sideOffset }, ref) => {
5468
- return /* @__PURE__ */ jsx45(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsxs31(TooltipPrimitive.Root, { delayDuration: 100, children: [
5551
+ return /* @__PURE__ */ jsx45(TooltipPrimitive.Provider, { children: /* @__PURE__ */ jsxs32(TooltipPrimitive.Root, { delayDuration: 100, children: [
5469
5552
  /* @__PURE__ */ jsx45(TooltipPrimitive.Trigger, { asChild: React42.isValidElement(children), children }),
5470
- /* @__PURE__ */ jsxs31(
5553
+ /* @__PURE__ */ jsxs32(
5471
5554
  TooltipPrimitive.Content,
5472
5555
  {
5473
5556
  side: side != null ? side : "top",
@@ -5487,7 +5570,7 @@ Tooltip.displayName = "Tooltip";
5487
5570
  // src/components/WebsiteFooter/index.tsx
5488
5571
  import { cva as cva35 } from "class-variance-authority";
5489
5572
  import React43 from "react";
5490
- import { jsx as jsx46, jsxs as jsxs32 } from "react/jsx-runtime";
5573
+ import { jsx as jsx46, jsxs as jsxs33 } from "react/jsx-runtime";
5491
5574
  var websiteFooterVariants = cva35(
5492
5575
  ["flex", "flex-col", "w-full", "items-center", "px-16", "py-4"],
5493
5576
  {
@@ -5610,7 +5693,7 @@ var LinkRow = React43.forwardRef(
5610
5693
  var LinkColumn = React43.forwardRef(
5611
5694
  (_a, ref) => {
5612
5695
  var _b = _a, { className, size, title, children } = _b, props = __objRest(_b, ["className", "size", "title", "children"]);
5613
- return /* @__PURE__ */ jsxs32(
5696
+ return /* @__PURE__ */ jsxs33(
5614
5697
  "div",
5615
5698
  __spreadProps(__spreadValues({
5616
5699
  className: cn(linkColumnVariants({ size }), className)
@@ -5725,6 +5808,7 @@ export {
5725
5808
  TableBody,
5726
5809
  TableCaption,
5727
5810
  TableCell,
5811
+ TableEmpty,
5728
5812
  TableFooter,
5729
5813
  TableHead,
5730
5814
  TableHeader,