@nexub/react 1.6.0 → 1.8.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.
Files changed (122) hide show
  1. package/dist/{chunk-C6JRJ6JW.js → chunk-22BGPRJZ.js} +1 -1
  2. package/dist/{chunk-NGQKBDHA.js → chunk-322WR6EU.js} +1 -1
  3. package/dist/{chunk-GSG2W6DP.js → chunk-3LTB6TGN.js} +1 -1
  4. package/dist/{chunk-743Y5MY3.js → chunk-3MSIO7KM.js} +40 -6
  5. package/dist/chunk-4B4XWDAH.js +1 -0
  6. package/dist/{chunk-MEUJBGY5.js → chunk-4MEV2WHD.js} +27 -6
  7. package/dist/{chunk-FLZD7HQY.js → chunk-5FWJXSXT.js} +1 -1
  8. package/dist/{chunk-VAFBGFKY.js → chunk-5GN2GFW3.js} +1 -1
  9. package/dist/{chunk-LESI7J7B.js → chunk-5NKIGEDZ.js} +1 -0
  10. package/dist/{chunk-7SXR4PGO.js → chunk-5W3AOOYS.js} +1 -1
  11. package/dist/{chunk-5KI4YHA3.js → chunk-6U5WQERX.js} +17 -18
  12. package/dist/{chunk-NZT4TTNV.js → chunk-7BAIEYUW.js} +79 -58
  13. package/dist/{chunk-NQPGELMP.js → chunk-A4QLUIFN.js} +1 -1
  14. package/dist/{chunk-PGDXFBKT.js → chunk-BEOHZKPQ.js} +1 -1
  15. package/dist/{chunk-PPCGUIAB.js → chunk-BIAYWCDE.js} +1 -1
  16. package/dist/{chunk-YNU6VRD5.js → chunk-BSKEBC2Q.js} +1 -1
  17. package/dist/chunk-BU5QD2FS.js +148 -0
  18. package/dist/{chunk-GRKCUQG4.js → chunk-DFCHCYNT.js} +4 -3
  19. package/dist/{chunk-PMWYLYM3.js → chunk-ENB7X3W4.js} +3 -3
  20. package/dist/{chunk-NSVXGOR3.js → chunk-ESMIBOF5.js} +1 -1
  21. package/dist/{chunk-HXV5UA7K.js → chunk-ETWFHIAE.js} +1 -1
  22. package/dist/{chunk-JHVYI5GK.js → chunk-F7ZA2VA2.js} +1 -1
  23. package/dist/{chunk-WXRQ42DR.js → chunk-FT2S7N64.js} +2 -2
  24. package/dist/{chunk-BNFGVFZ3.js → chunk-G4RLUGE3.js} +2 -2
  25. package/dist/{chunk-SZ2WPWXJ.js → chunk-GG5HDX7J.js} +1 -1
  26. package/dist/{chunk-O74XEHLA.js → chunk-GSA7NBEG.js} +11 -3
  27. package/dist/{chunk-IGLOYOCH.js → chunk-HSM7RXUF.js} +46 -11
  28. package/dist/{chunk-FIDUY6SS.js → chunk-IDIS7Z6H.js} +2 -2
  29. package/dist/{chunk-TRA6A5C5.js → chunk-JVOSMXD5.js} +2 -2
  30. package/dist/{chunk-3FPJIXG7.js → chunk-KRHD7VI6.js} +1 -1
  31. package/dist/{chunk-DGQJRTO6.js → chunk-L4BSKMLK.js} +1 -1
  32. package/dist/{chunk-7VJABRKB.js → chunk-NORCPKRD.js} +1 -1
  33. package/dist/{chunk-CQWYZPPJ.js → chunk-NYORXEPS.js} +1 -1
  34. package/dist/{chunk-3MT23LNM.js → chunk-O6J6HXVT.js} +3 -3
  35. package/dist/{chunk-UTJJ5HFX.js → chunk-OS4NOWEI.js} +53 -51
  36. package/dist/{chunk-O626NJEM.js → chunk-OTZBGMYH.js} +2 -2
  37. package/dist/{chunk-RSU2UHN4.js → chunk-PC7YGDNL.js} +2 -2
  38. package/dist/{chunk-PREMZMLU.js → chunk-PGD246WD.js} +1 -1
  39. package/dist/{chunk-2Y4WLNEZ.js → chunk-QUYOV2ZJ.js} +3 -1
  40. package/dist/{chunk-VMT7Y3AT.js → chunk-R6VLSYXK.js} +2 -2
  41. package/dist/{chunk-7Q4T7CB6.js → chunk-RSBJBQPG.js} +1 -1
  42. package/dist/{chunk-CBDJRPMD.js → chunk-RVWQROFK.js} +1 -1
  43. package/dist/{chunk-2I7FIU6R.js → chunk-SKIJVVBU.js} +1 -1
  44. package/dist/{chunk-SYZADSLI.js → chunk-SZNSQR2B.js} +1 -1
  45. package/dist/{chunk-ZTLALVWA.js → chunk-TSN6HYVY.js} +2 -2
  46. package/dist/{chunk-SAUA52EJ.js → chunk-UAQRQNOB.js} +2 -2
  47. package/dist/chunk-UCNA2ICU.js +28 -0
  48. package/dist/{chunk-S7GH2BJP.js → chunk-UV5O2BMW.js} +2 -2
  49. package/dist/{chunk-XDU27NRX.js → chunk-UVWQPDOV.js} +1 -1
  50. package/dist/{chunk-7B4VF2ZU.js → chunk-V6CMWCJH.js} +2 -2
  51. package/dist/{chunk-VD4RFTNV.js → chunk-VF6RWEKX.js} +1 -1
  52. package/dist/{chunk-CV5ZKED7.js → chunk-W2P2WOAN.js} +1 -1
  53. package/dist/{chunk-5VW6RUKZ.js → chunk-WECNLNIA.js} +2 -2
  54. package/dist/{chunk-KE4YVG5Q.js → chunk-X3B2MTX6.js} +1 -1
  55. package/dist/{chunk-HSPGJSFJ.js → chunk-XHLSYHAV.js} +2 -2
  56. package/dist/{chunk-RUR57JZQ.js → chunk-ZGZQZG6S.js} +1 -1
  57. package/dist/{chunk-WVBGQCYC.js → chunk-ZLW7IBXK.js} +1 -1
  58. package/dist/{chunk-74RUJ5KZ.js → chunk-ZRBLASQE.js} +1 -1
  59. package/dist/{chunk-Q3ESHXKU.js → chunk-ZTI4MK3L.js} +1 -1
  60. package/dist/{chunk-7XWJCFWI.js → chunk-ZUGZRXME.js} +1 -1
  61. package/dist/components/Alert/index.js +2 -2
  62. package/dist/components/AlertDialog/index.js +4 -4
  63. package/dist/components/Amount/index.js +3 -3
  64. package/dist/components/Autocomplete/index.js +2 -2
  65. package/dist/components/Avatar/index.js +1 -1
  66. package/dist/components/AvatarGroup/index.js +3 -3
  67. package/dist/components/Banner/index.js +2 -2
  68. package/dist/components/Breadcrumb/index.js +2 -2
  69. package/dist/components/Button/index.js +2 -2
  70. package/dist/components/Chip/index.js +2 -2
  71. package/dist/components/Citation/index.js +4 -4
  72. package/dist/components/CommandPalette/index.js +3 -3
  73. package/dist/components/ContextMenu/index.js +2 -2
  74. package/dist/components/DataTable/index.js +4 -2
  75. package/dist/components/DatePicker/index.js +4 -4
  76. package/dist/components/DateRangePicker/index.js +5 -5
  77. package/dist/components/Dialog/index.js +2 -2
  78. package/dist/components/Drawer/index.js +2 -2
  79. package/dist/components/DropdownMenu/index.js +2 -2
  80. package/dist/components/ErrorState/index.js +2 -2
  81. package/dist/components/EyebrowChip/index.js +3 -3
  82. package/dist/components/FileUpload/index.js +2 -2
  83. package/dist/components/FilterChip/index.js +3 -3
  84. package/dist/components/FormField/index.js +5 -5
  85. package/dist/components/Heading/index.js +3 -3
  86. package/dist/components/HelperText/index.js +3 -3
  87. package/dist/components/HoverCard/index.js +2 -2
  88. package/dist/components/IconButton/index.js +2 -2
  89. package/dist/components/Input/index.js +2 -2
  90. package/dist/components/Kbd/index.js +1 -1
  91. package/dist/components/KeyboardShortcut/index.js +2 -2
  92. package/dist/components/Label/index.js +3 -3
  93. package/dist/components/Menubar/index.js +2 -2
  94. package/dist/components/MessageBubble/index.js +4 -4
  95. package/dist/components/MoneyInput/index.js +4 -4
  96. package/dist/components/NavigationMenu/index.js +2 -2
  97. package/dist/components/NavigationRail/index.js +2 -2
  98. package/dist/components/NexubProvider/index.js +1 -1
  99. package/dist/components/NumberInput/index.js +4 -4
  100. package/dist/components/NumberTicker/index.js +2 -2
  101. package/dist/components/PageHeader/index.js +1 -1
  102. package/dist/components/Pagination/index.js +3 -3
  103. package/dist/components/PasswordInput/index.js +4 -4
  104. package/dist/components/Popover/index.js +2 -2
  105. package/dist/components/PromptInput/index.js +4 -4
  106. package/dist/components/Rating/index.js +2 -2
  107. package/dist/components/ScrollArea/index.js +1 -1
  108. package/dist/components/SearchInput/index.js +4 -4
  109. package/dist/components/Select/index.js +3 -3
  110. package/dist/components/Sidebar/index.js +2 -2
  111. package/dist/components/Spinner/index.js +2 -2
  112. package/dist/components/SplitButton/index.js +5 -5
  113. package/dist/components/Table/index.js +2 -1
  114. package/dist/components/Textarea/index.js +2 -2
  115. package/dist/components/ThinkingIndicator/index.js +2 -2
  116. package/dist/components/Toast/index.js +2 -2
  117. package/dist/components/TopNav/index.js +2 -2
  118. package/dist/index.d.ts +90 -10
  119. package/dist/index.js +65 -64
  120. package/package.json +6 -6
  121. package/dist/chunk-MTK3GHDQ.js +0 -25
  122. package/dist/chunk-OYCK6BRG.js +0 -89
@@ -3,7 +3,7 @@ import {
3
3
  disabledContainer,
4
4
  disabledText,
5
5
  pressable
6
- } from "./chunk-7SXR4PGO.js";
6
+ } from "./chunk-5W3AOOYS.js";
7
7
  import {
8
8
  glassSurfaceClass
9
9
  } from "./chunk-DEIBF3P7.js";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  toneTextClasses
4
- } from "./chunk-C6JRJ6JW.js";
4
+ } from "./chunk-22BGPRJZ.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-Q7G5WGYV.js";
@@ -9,7 +9,7 @@ import * as RadixScrollArea from "@radix-ui/react-scroll-area";
9
9
  import { jsx, jsxs } from "react/jsx-runtime";
10
10
  var ScrollArea = React.forwardRef(
11
11
  ({ className, children, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxs(RadixScrollArea.Root, { ref, className: cn("relative overflow-hidden", className), ...props, children: [
12
- /* @__PURE__ */ jsx(RadixScrollArea.Viewport, { className: "h-full w-full rounded-[inherit]", children }),
12
+ /* @__PURE__ */ jsx(RadixScrollArea.Viewport, { tabIndex: 0, className: "h-full w-full rounded-[inherit]", children }),
13
13
  (orientation === "vertical" || orientation === "both") && /* @__PURE__ */ jsx(
14
14
  RadixScrollArea.Scrollbar,
15
15
  {
@@ -35,6 +35,11 @@ var defaultMessages = {
35
35
  noResults: "No results found.",
36
36
  pickDate: "Pick a date",
37
37
  pickDateRange: "Pick a date range",
38
+ previousMonth: "Go to previous month",
39
+ nextMonth: "Go to next month",
40
+ calendarNavigation: "Calendar navigation",
41
+ todayDate: (date) => `Today, ${date}`,
42
+ selectedDate: (label) => `${label}, selected`,
38
43
  commandPalette: "Command palette",
39
44
  notifications: "Notifications ({hotkey})",
40
45
  undo: "Undo",
@@ -55,22 +60,51 @@ var defaultMessages = {
55
60
  sources: "Sources",
56
61
  source: (n) => `Source ${n}`,
57
62
  jumpToLatest: "Jump to latest",
58
- conversation: "Conversation"
63
+ conversation: "Conversation",
64
+ pageOf: (page, total) => `Page ${page} of ${total}`,
65
+ previous: "Previous",
66
+ next: "Next",
67
+ search: "Search",
68
+ searchProduct: (productName) => `Search ${productName}`,
69
+ keyboardShortcut: (shortcut) => `Keyboard shortcut: ${shortcut}`,
70
+ commandKey: "Command",
71
+ controlKey: "Control",
72
+ searching: "Searching\u2026",
73
+ searchFailed: "Search failed. Try again.",
74
+ noResultsFor: (query) => `No results for \u201C${query}\u201D`,
75
+ typeToSearch: "Type to search",
76
+ switchOrganization: (name) => `${name}, switch organization`,
77
+ organizations: "Organizations",
78
+ switchToLightTheme: "Switch to light theme",
79
+ switchToDarkTheme: "Switch to dark theme",
80
+ glass: "Glass",
81
+ glassClear: "Clear",
82
+ glassBalanced: "Balanced",
83
+ glassTinted: "Tinted",
84
+ glassSolid: "Solid",
85
+ accountMenu: (name) => `Account: ${name}`,
86
+ manageAccount: "Manage your Nexub Account",
87
+ privacyPolicy: "Privacy policy",
88
+ termsOfService: "Terms of service",
89
+ signOut: "Sign out",
90
+ signingOut: "Signing out\u2026",
91
+ accountAndApps: "Account and apps"
59
92
  };
60
93
  var NexubContext = React.createContext({
61
94
  locale: void 0,
62
95
  dir: "ltr",
96
+ dateLocale: void 0,
63
97
  messages: defaultMessages
64
98
  });
65
99
  var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
66
100
  function directionOf(locale) {
67
101
  return RTL_LANGUAGES.has(locale.toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr";
68
102
  }
69
- function NexubProvider({ locale = "en", dir, messages, children }) {
103
+ function NexubProvider({ locale = "en", dir, dateLocale, messages, children }) {
70
104
  const resolvedDir = dir ?? directionOf(locale);
71
105
  const value = React.useMemo(
72
- () => ({ locale, dir: resolvedDir, messages: { ...defaultMessages, ...messages } }),
73
- [locale, resolvedDir, messages]
106
+ () => ({ locale, dir: resolvedDir, dateLocale, messages: { ...defaultMessages, ...messages } }),
107
+ [locale, resolvedDir, dateLocale, messages]
74
108
  );
75
109
  return /* @__PURE__ */ jsx(NexubContext.Provider, { value, children: /* @__PURE__ */ jsx(DirectionProvider, { dir: resolvedDir, children }) });
76
110
  }
@@ -78,8 +112,8 @@ function useNexubMessages() {
78
112
  return React.useContext(NexubContext).messages;
79
113
  }
80
114
  function useLocale() {
81
- const { locale = "en", dir } = React.useContext(NexubContext);
82
- return { locale, dir };
115
+ const { locale = "en", dir, dateLocale } = React.useContext(NexubContext);
116
+ return { locale, dir, dateLocale };
83
117
  }
84
118
  function useIntlLocale(explicit) {
85
119
  const ctx = React.useContext(NexubContext).locale;
@@ -0,0 +1 @@
1
+ 'use client';
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useIntlLocale
4
- } from "./chunk-743Y5MY3.js";
4
+ } from "./chunk-3MSIO7KM.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-Q7G5WGYV.js";
@@ -22,6 +22,26 @@ var SHIFT = [
22
22
  "-translate-y-[90%]"
23
23
  ];
24
24
  var DIGITS = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"];
25
+ var isDigit = (c) => c !== void 0 && /^[0-9]$/.test(c);
26
+ var RTL = /[\u0590-\u08FF\u200F\u061C\uFB1D-\uFDFF\uFE70-\uFEFF]/;
27
+ function digitRuns(items) {
28
+ const out = [];
29
+ let run = [];
30
+ const flush = () => {
31
+ if (run.length) out.push(/* @__PURE__ */ jsx("span", { dir: "ltr", children: run.map((r) => r.node) }, `run${run[run.length - 1].key}`));
32
+ run = [];
33
+ };
34
+ items.forEach((it, i) => {
35
+ const inRun = isDigit(it.char) || run.length > 0 && isDigit(items[i + 1]?.char) && /^[.,\u00A0\u202F' ]$/.test(it.char);
36
+ if (inRun) run.push(it);
37
+ else {
38
+ flush();
39
+ out.push(it.node);
40
+ }
41
+ });
42
+ flush();
43
+ return out;
44
+ }
25
45
  function Char({ char, className, enter }) {
26
46
  const [entering] = React.useState(enter);
27
47
  const motion = entering ? { "data-motion": "from-fade" } : {};
@@ -61,6 +81,11 @@ var NumberTicker = React.forwardRef(
61
81
  React.useEffect(() => {
62
82
  mounted.current = true;
63
83
  }, []);
84
+ const rendered = chars.map(({ char, className: cls }, i) => {
85
+ const key = `${chars.length - 1 - i}${isDigit(char) ? "d" : `s${char}`}`;
86
+ return { char, key, node: /* @__PURE__ */ jsx(Char, { char, className: cls, enter: mounted.current }, key) };
87
+ });
88
+ const rtlText = RTL.test(text);
64
89
  return /* @__PURE__ */ jsxs(
65
90
  "span",
66
91
  {
@@ -71,11 +96,7 @@ var NumberTicker = React.forwardRef(
71
96
  ...props,
72
97
  children: [
73
98
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: text }),
74
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: chars.map(({ char, className: cls }, i) => {
75
- const fromEnd = chars.length - 1 - i;
76
- const kind = /^[0-9]$/.test(char) ? "d" : `s${char}`;
77
- return /* @__PURE__ */ jsx(Char, { char, className: cls, enter: mounted.current }, `${fromEnd}${kind}`);
78
- }) })
99
+ /* @__PURE__ */ jsx("span", { "aria-hidden": "true", dir: rtlText ? "rtl" : "ltr", children: rtlText ? digitRuns(rendered) : rendered.map((r) => r.node) })
79
100
  ]
80
101
  }
81
102
  );
@@ -12,7 +12,7 @@ var menuItem = [
12
12
  ].join(" ");
13
13
  var menuSeparator = "-mx-1.5 my-1.5 h-px bg-[var(--color-outline-variant)]";
14
14
  var menuLabel = "px-2.5 py-1.5 text-label-sm text-[var(--color-on-surface-muted)]";
15
- var scrim = "bg-[color-mix(in_srgb,var(--color-scrim,#000)_40%,transparent)]";
15
+ var scrim = "bg-[color-mix(in_srgb,var(--color-scrim)_40%,transparent)]";
16
16
 
17
17
  export {
18
18
  overlaySurface,
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  useNexubMessages
4
- } from "./chunk-743Y5MY3.js";
4
+ } from "./chunk-3MSIO7KM.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-Q7G5WGYV.js";
@@ -12,6 +12,7 @@ var Kbd = React.forwardRef(
12
12
  "kbd",
13
13
  {
14
14
  ref,
15
+ dir: "ltr",
15
16
  className: cn(
16
17
  "inline-flex items-center justify-center font-mono text-xs",
17
18
  "px-1.5 py-0.5 min-w-[1.5rem]",
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/utils/control.ts
4
4
  var field = [
5
- "rounded-shape-field border border-[var(--color-border-input)]",
5
+ "rounded-shape-field border border-[var(--color-outline)]",
6
6
  "bg-[var(--color-surface-container-lowest)] text-[var(--color-on-surface)]",
7
7
  "transition-[border-color,box-shadow] duration-effects-fast ease-effects-fast",
8
8
  "hover:border-[var(--color-on-surface-variant)]"
@@ -1,18 +1,17 @@
1
1
  'use client';
2
2
  import {
3
- formatDate
4
- } from "./chunk-IGLOYOCH.js";
3
+ useCalendarLocale
4
+ } from "./chunk-HSM7RXUF.js";
5
5
  import {
6
6
  floatingSurface
7
- } from "./chunk-FLZD7HQY.js";
7
+ } from "./chunk-5FWJXSXT.js";
8
8
  import {
9
9
  field,
10
10
  fieldFocusVisible
11
- } from "./chunk-7SXR4PGO.js";
11
+ } from "./chunk-5W3AOOYS.js";
12
12
  import {
13
- useIntlLocale,
14
13
  useNexubMessages
15
- } from "./chunk-743Y5MY3.js";
14
+ } from "./chunk-3MSIO7KM.js";
16
15
  import {
17
16
  cn
18
17
  } from "./chunk-Q7G5WGYV.js";
@@ -21,14 +20,14 @@ import {
21
20
  import * as React from "react";
22
21
  import * as RadixPopover from "@radix-ui/react-popover";
23
22
  import { DayPicker } from "react-day-picker";
24
- import { CalendarDays, ChevronLeft, ChevronRight } from "@nexub/icons";
23
+ import { CalendarDays } from "@nexub/icons";
25
24
  import { jsx, jsxs } from "react/jsx-runtime";
26
- function formatRange(range, placeholder, locale) {
25
+ function formatRange(range, placeholder, formatDate) {
27
26
  if (!range) return placeholder;
28
27
  if (range.from && range.to) {
29
- return `${formatDate(range.from, locale)} \u2013 ${formatDate(range.to, locale)}`;
28
+ return `${formatDate(range.from)} \u2013 ${formatDate(range.to)}`;
30
29
  }
31
- if (range.from) return `${formatDate(range.from, locale)} \u2013 \u2026`;
30
+ if (range.from) return `${formatDate(range.from)} \u2013 \u2026`;
32
31
  return placeholder;
33
32
  }
34
33
  var calendarClassNames = {
@@ -56,8 +55,9 @@ var calendarClassNames = {
56
55
  // skips middle days without depending on CSS order.
57
56
  selected: "[&:not(.nx-range-middle)>button]:bg-[var(--color-primary)] [&:not(.nx-range-middle)>button]:text-[var(--color-on-primary)]",
58
57
  // Half bands join the end capsules to the middle band (not on a one-day range).
59
- range_start: "nx-range-start [&:not(.nx-range-end)]:bg-[linear-gradient(to_right,transparent_50%,var(--color-primary-container)_50%)]",
60
- range_end: "nx-range-end [&:not(.nx-range-start)]:bg-[linear-gradient(to_left,transparent_50%,var(--color-primary-container)_50%)]",
58
+ // RTL (DayPicker's dir): the bands run the other way.
59
+ range_start: "nx-range-start [&:not(.nx-range-end)]:bg-[linear-gradient(to_right,transparent_50%,var(--color-primary-container)_50%)] rtl:[&:not(.nx-range-end)]:bg-[linear-gradient(to_left,transparent_50%,var(--color-primary-container)_50%)]",
60
+ range_end: "nx-range-end [&:not(.nx-range-start)]:bg-[linear-gradient(to_left,transparent_50%,var(--color-primary-container)_50%)] rtl:[&:not(.nx-range-start)]:bg-[linear-gradient(to_right,transparent_50%,var(--color-primary-container)_50%)]",
61
61
  range_middle: "nx-range-middle bg-[var(--color-primary-container)] [&>button]:text-[var(--color-on-primary-container)]",
62
62
  today: "[&>button]:border-[var(--color-primary)]",
63
63
  outside: "[&:not([data-selected]):not([data-disabled])>button]:text-[var(--color-on-surface-muted)]",
@@ -73,13 +73,14 @@ var DateRangePicker = React.forwardRef(function DateRangePicker2({
73
73
  maxDate,
74
74
  className,
75
75
  id,
76
- "aria-label": ariaLabel
76
+ "aria-label": ariaLabel,
77
+ locale: localeProp
77
78
  }, ref) {
78
79
  const [open, setOpen] = React.useState(false);
79
80
  const messages = useNexubMessages();
80
- const locale = useIntlLocale();
81
+ const calendar = useCalendarLocale(localeProp);
81
82
  const placeholder = placeholderProp ?? messages.pickDateRange;
82
- const display = formatRange(value, placeholder, locale);
83
+ const display = formatRange(value, placeholder, calendar.format);
83
84
  const label = ariaLabel ? `${ariaLabel}: ${display}` : display;
84
85
  return /* @__PURE__ */ jsxs(RadixPopover.Root, { open, onOpenChange: setOpen, children: [
85
86
  /* @__PURE__ */ jsx(RadixPopover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
@@ -128,9 +129,7 @@ var DateRangePicker = React.forwardRef(function DateRangePicker2({
128
129
  showOutsideDays: false,
129
130
  className: "relative p-3",
130
131
  classNames: calendarClassNames,
131
- components: {
132
- Chevron: ({ orientation, ...rest }) => orientation === "left" ? /* @__PURE__ */ jsx(ChevronLeft, { size: "xs", "aria-hidden": "true" }) : orientation === "right" ? /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronRight, { size: "xs", "aria-hidden": "true", ...rest })
133
- }
132
+ ...calendar.dayPickerProps
134
133
  }
135
134
  )
136
135
  }
@@ -1,8 +1,14 @@
1
1
  'use client';
2
+ import {
3
+ Table
4
+ } from "./chunk-BU5QD2FS.js";
2
5
  import {
3
6
  disabledContainer,
4
7
  pressable
5
- } from "./chunk-7SXR4PGO.js";
8
+ } from "./chunk-5W3AOOYS.js";
9
+ import {
10
+ useNexubMessages
11
+ } from "./chunk-3MSIO7KM.js";
6
12
  import {
7
13
  cn
8
14
  } from "./chunk-Q7G5WGYV.js";
@@ -19,20 +25,22 @@ import {
19
25
  } from "@tanstack/react-table";
20
26
  import { ArrowUp, ArrowDown, ChevronsUpDown } from "@nexub/icons";
21
27
  import { jsx, jsxs } from "react/jsx-runtime";
28
+ var alignText = {
29
+ start: "text-start",
30
+ end: "text-end",
31
+ center: "text-center"
32
+ };
33
+ var alignJustify = {
34
+ start: "justify-start",
35
+ end: "justify-end",
36
+ center: "justify-center"
37
+ };
22
38
  var pagerButton = cn(
23
39
  pressable,
24
40
  "border border-[var(--color-outline-variant)] bg-transparent px-4 py-2 min-h-[44px] text-label-lg text-[var(--color-on-surface)]",
25
41
  disabledContainer
26
42
  );
27
- var TableRoot = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "w-full overflow-auto", children: /* @__PURE__ */ jsx(
28
- "table",
29
- {
30
- ref,
31
- className: cn("w-full caption-bottom text-sm", className),
32
- ...props
33
- }
34
- ) }));
35
- TableRoot.displayName = "DataTable.TableRoot";
43
+ var TableRoot = Table.Root;
36
44
  var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
37
45
  "thead",
38
46
  {
@@ -42,26 +50,21 @@ var TableHeader = React.forwardRef(({ className, ...props }, ref) => /* @__PURE_
42
50
  }
43
51
  ));
44
52
  TableHeader.displayName = "DataTable.TableHeader";
45
- var TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
46
- "tbody",
47
- {
48
- ref,
49
- className: cn("[&_tr:last-child]:border-0", className),
50
- ...props
51
- }
52
- ));
53
+ var TableBody = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
53
54
  TableBody.displayName = "DataTable.TableBody";
54
- var TableRow = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
55
- "tr",
56
- {
57
- ref,
58
- className: cn(
59
- "border-b border-[var(--color-outline-variant)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-on-surface)_8%,transparent)] data-[state=selected]:bg-[var(--color-surface-container-low)]",
60
- className
61
- ),
62
- ...props
63
- }
64
- ));
55
+ var TableRow = React.forwardRef(
56
+ ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
57
+ "tr",
58
+ {
59
+ ref,
60
+ className: cn(
61
+ "border-b border-[var(--color-outline-variant)] transition-colors hover:bg-[color-mix(in_srgb,var(--color-on-surface)_8%,transparent)] data-[state=selected]:bg-[var(--color-surface-container-low)]",
62
+ className
63
+ ),
64
+ ...props
65
+ }
66
+ )
67
+ );
65
68
  TableRow.displayName = "DataTable.TableRow";
66
69
  var TableHead = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
67
70
  "th",
@@ -93,9 +96,14 @@ function DataTable({
93
96
  enableSorting = false,
94
97
  enableRowSelection = false,
95
98
  pagination,
99
+ caption,
100
+ captionHidden = false,
96
101
  className,
102
+ "aria-label": ariaLabel,
103
+ "aria-labelledby": ariaLabelledBy,
97
104
  ...props
98
105
  }) {
106
+ const messages = useNexubMessages();
99
107
  const [sorting, setSorting] = React.useState([]);
100
108
  const [rowSelection, setRowSelection] = React.useState({});
101
109
  const [paginationState, setPaginationState] = React.useState({
@@ -125,30 +133,46 @@ function DataTable({
125
133
  manualPagination: false
126
134
  });
127
135
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-4", className), ...props, children: [
128
- /* @__PURE__ */ jsxs(TableRoot, { children: [
129
- /* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx(
130
- TableHead,
131
- {
132
- "aria-sort": enableSorting && header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
133
- children: header.isPlaceholder ? null : enableSorting && header.column.getCanSort() ? /* @__PURE__ */ jsxs(
134
- "button",
135
- {
136
- onClick: header.column.getToggleSortingHandler(),
137
- className: "inline-flex items-center gap-1 hover:text-[var(--color-on-surface)]",
138
- children: [
139
- flexRender(header.column.columnDef.header, header.getContext()),
140
- header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { size: "xs", "aria-hidden": "true" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { size: "xs", className: "opacity-40", "aria-hidden": "true" })
141
- ]
142
- }
143
- ) : flexRender(header.column.columnDef.header, header.getContext())
144
- },
145
- header.id
146
- )) }, headerGroup.id)) }),
136
+ /* @__PURE__ */ jsxs(TableRoot, { "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, children: [
137
+ caption != null && /* @__PURE__ */ jsx(Table.Caption, { className: cn(captionHidden && "sr-only"), children: caption }),
138
+ /* @__PURE__ */ jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "hover:bg-transparent", children: headerGroup.headers.map((header) => {
139
+ const align = header.column.columnDef.meta?.align ?? "start";
140
+ return /* @__PURE__ */ jsx(
141
+ TableHead,
142
+ {
143
+ className: alignText[align],
144
+ "aria-sort": enableSorting && header.column.getCanSort() ? header.column.getIsSorted() === "asc" ? "ascending" : header.column.getIsSorted() === "desc" ? "descending" : "none" : void 0,
145
+ children: header.isPlaceholder ? null : enableSorting && header.column.getCanSort() ? /* @__PURE__ */ jsxs(
146
+ "button",
147
+ {
148
+ type: "button",
149
+ onClick: header.column.getToggleSortingHandler(),
150
+ className: cn(
151
+ "flex w-full items-center gap-1 hover:text-[var(--color-on-surface)]",
152
+ alignJustify[align]
153
+ ),
154
+ children: [
155
+ flexRender(header.column.columnDef.header, header.getContext()),
156
+ header.column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ArrowUp, { size: "xs", "aria-hidden": "true" }) : header.column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ArrowDown, { size: "xs", "aria-hidden": "true" }) : /* @__PURE__ */ jsx(ChevronsUpDown, { size: "xs", className: "opacity-40", "aria-hidden": "true" })
157
+ ]
158
+ }
159
+ ) : flexRender(header.column.columnDef.header, header.getContext())
160
+ },
161
+ header.id
162
+ );
163
+ }) }, headerGroup.id)) }),
147
164
  /* @__PURE__ */ jsx(TableBody, { children: table.getRowModel().rows.length ? table.getRowModel().rows.map((row) => /* @__PURE__ */ jsx(
148
165
  TableRow,
149
166
  {
150
167
  "data-state": enableRowSelection && row.getIsSelected() ? "selected" : void 0,
151
- children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))
168
+ children: row.getVisibleCells().map((cell) => /* @__PURE__ */ jsx(
169
+ TableCell,
170
+ {
171
+ className: alignText[cell.column.columnDef.meta?.align ?? "start"],
172
+ children: flexRender(cell.column.columnDef.cell, cell.getContext())
173
+ },
174
+ cell.id
175
+ ))
152
176
  },
153
177
  row.id
154
178
  )) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
@@ -156,34 +180,31 @@ function DataTable({
156
180
  {
157
181
  colSpan: columns.length,
158
182
  className: "h-24 text-center text-[var(--color-on-surface-muted)]",
159
- children: "No results."
183
+ children: messages.noResults
160
184
  }
161
185
  ) }) })
162
186
  ] }),
163
187
  pagination && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2 text-sm text-[var(--color-on-surface-muted)]", children: [
164
- /* @__PURE__ */ jsxs("span", { children: [
165
- "Page ",
166
- table.getState().pagination.pageIndex + 1,
167
- " of ",
168
- table.getPageCount()
169
- ] }),
188
+ /* @__PURE__ */ jsx("span", { children: messages.pageOf(table.getState().pagination.pageIndex + 1, table.getPageCount()) }),
170
189
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
171
190
  /* @__PURE__ */ jsx(
172
191
  "button",
173
192
  {
193
+ type: "button",
174
194
  onClick: () => table.previousPage(),
175
195
  disabled: !table.getCanPreviousPage(),
176
196
  className: pagerButton,
177
- children: "Previous"
197
+ children: messages.previous
178
198
  }
179
199
  ),
180
200
  /* @__PURE__ */ jsx(
181
201
  "button",
182
202
  {
203
+ type: "button",
183
204
  onClick: () => table.nextPage(),
184
205
  disabled: !table.getCanNextPage(),
185
206
  className: pagerButton,
186
- children: "Next"
207
+ children: messages.next
187
208
  }
188
209
  )
189
210
  ] })
@@ -5,7 +5,7 @@ import {
5
5
  menuItem,
6
6
  menuLabel,
7
7
  menuSeparator
8
- } from "./chunk-FLZD7HQY.js";
8
+ } from "./chunk-5FWJXSXT.js";
9
9
  import {
10
10
  cn
11
11
  } from "./chunk-Q7G5WGYV.js";
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import {
3
3
  floatingSurface
4
- } from "./chunk-FLZD7HQY.js";
4
+ } from "./chunk-5FWJXSXT.js";
5
5
  import {
6
6
  cn
7
7
  } from "./chunk-Q7G5WGYV.js";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-JLUCMNVS.js";
5
5
  import {
6
6
  useNexubMessages
7
- } from "./chunk-743Y5MY3.js";
7
+ } from "./chunk-3MSIO7KM.js";
8
8
  import {
9
9
  cn
10
10
  } from "./chunk-Q7G5WGYV.js";
@@ -3,7 +3,7 @@ import {
3
3
  field,
4
4
  fieldFocusVisible,
5
5
  fieldInvalid
6
- } from "./chunk-7SXR4PGO.js";
6
+ } from "./chunk-5W3AOOYS.js";
7
7
  import {
8
8
  cn
9
9
  } from "./chunk-Q7G5WGYV.js";