@nexub/react 2.0.0 → 2.1.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/{chunk-4MEV2WHD.js → chunk-2BAXCPQF.js} +1 -1
- package/dist/{chunk-7BAIEYUW.js → chunk-3FX3FBHE.js} +1 -1
- package/dist/{chunk-ZTI4MK3L.js → chunk-5JOKHG4L.js} +1 -1
- package/dist/{chunk-HSM7RXUF.js → chunk-5QZVFW4H.js} +1 -1
- package/dist/{chunk-V6CMWCJH.js → chunk-6FRG6NMM.js} +2 -2
- package/dist/{chunk-ENB7X3W4.js → chunk-7JXJOYM6.js} +1 -1
- package/dist/{chunk-JVOSMXD5.js → chunk-AKV4GMIY.js} +1 -1
- package/dist/{chunk-FT2S7N64.js → chunk-BSS7QNC5.js} +1 -1
- package/dist/{chunk-OS4NOWEI.js → chunk-D6HHYT2S.js} +1 -1
- package/dist/{chunk-ESMIBOF5.js → chunk-D7HMUIA5.js} +1 -1
- package/dist/{chunk-ETWFHIAE.js → chunk-EA4JBLWK.js} +1 -1
- package/dist/{chunk-UAQRQNOB.js → chunk-EILMNNTT.js} +1 -1
- package/dist/{chunk-IDIS7Z6H.js → chunk-F3DRJSZL.js} +1 -1
- package/dist/{chunk-GSA7NBEG.js → chunk-I6ELDWZE.js} +1 -1
- package/dist/{chunk-OTZBGMYH.js → chunk-IPCB5HU7.js} +1 -1
- package/dist/{chunk-6U5WQERX.js → chunk-KFU2ENV6.js} +2 -2
- package/dist/{chunk-ZRBLASQE.js → chunk-MX6NYEOW.js} +1 -1
- package/dist/{chunk-GG5HDX7J.js → chunk-NITVUZ4L.js} +1 -1
- package/dist/{chunk-XHLSYHAV.js → chunk-NN7SNECM.js} +1 -1
- package/dist/{chunk-BIAYWCDE.js → chunk-O2DSTHXA.js} +1 -1
- package/dist/{chunk-L4BSKMLK.js → chunk-P37ABUFD.js} +1 -1
- package/dist/{chunk-5GN2GFW3.js → chunk-Q4CEJZY6.js} +1 -1
- package/dist/chunk-R3SUPKKI.js +12 -0
- package/dist/{chunk-UV5O2BMW.js → chunk-TSBBWYDO.js} +1 -1
- package/dist/{chunk-RVWQROFK.js → chunk-TXIJMUD5.js} +1 -1
- package/dist/{chunk-O6J6HXVT.js → chunk-VMMZHSZL.js} +1 -1
- package/dist/chunk-VMSWIC3O.js +40 -0
- package/dist/{chunk-WECNLNIA.js → chunk-WASCNEIQ.js} +1 -1
- package/dist/{chunk-RSBJBQPG.js → chunk-WXE6QRHB.js} +1 -1
- package/dist/{chunk-KRHD7VI6.js → chunk-ZVQYAIOA.js} +1 -1
- package/dist/{chunk-PC7YGDNL.js → chunk-ZYR3R36N.js} +3 -3
- package/dist/components/Alert/index.js +2 -2
- package/dist/components/Amount/index.js +4 -4
- package/dist/components/Autocomplete/index.js +2 -2
- package/dist/components/AvatarGroup/index.js +2 -2
- package/dist/components/Banner/index.js +2 -2
- package/dist/components/Breadcrumb/index.js +2 -2
- package/dist/components/Chip/index.js +2 -2
- package/dist/components/Citation/index.js +2 -2
- package/dist/components/CommandPalette/index.js +2 -2
- package/dist/components/DataTable/index.js +2 -2
- package/dist/components/DatePicker/index.js +2 -2
- package/dist/components/DateRangePicker/index.js +3 -3
- package/dist/components/FileUpload/index.js +2 -2
- package/dist/components/FilterChip/index.js +2 -2
- package/dist/components/FormField/index.js +3 -3
- package/dist/components/MessageBubble/index.js +2 -2
- package/dist/components/MoneyInput/index.js +3 -3
- package/dist/components/NavigationRail/index.js +2 -2
- package/dist/components/NexubProvider/index.js +1 -1
- package/dist/components/NumberInput/index.js +2 -2
- package/dist/components/NumberTicker/index.js +2 -2
- package/dist/components/Pagination/index.js +2 -2
- package/dist/components/PasswordInput/index.js +2 -2
- package/dist/components/PromptInput/index.js +2 -2
- package/dist/components/Rating/index.js +2 -2
- package/dist/components/SearchInput/index.js +2 -2
- package/dist/components/Sidebar/index.js +2 -2
- package/dist/components/Spinner/index.js +2 -2
- package/dist/components/ThinkingIndicator/index.js +2 -2
- package/dist/components/Toast/index.js +2 -2
- package/dist/components/TopNav/index.js +2 -2
- package/dist/index.d.ts +4 -98
- package/dist/index.js +62 -62
- package/package.json +6 -5
- package/dist/chunk-3MSIO7KM.js +0 -129
- package/dist/chunk-CIQHFMF6.js +0 -44
- package/dist/{chunk-GLQOEW57.js → chunk-G4RLUGE3.js} +4 -4
package/dist/chunk-3MSIO7KM.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
// src/components/NexubProvider/NexubProvider.tsx
|
|
4
|
-
import * as React from "react";
|
|
5
|
-
import { DirectionProvider } from "@radix-ui/react-direction";
|
|
6
|
-
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
var defaultMessages = {
|
|
8
|
-
close: "Close",
|
|
9
|
-
dismissAlert: "Dismiss alert",
|
|
10
|
-
dismissBanner: "Dismiss banner",
|
|
11
|
-
remove: "Remove",
|
|
12
|
-
removeFilter: "Remove filter",
|
|
13
|
-
removeFile: (fileName) => `Remove ${fileName}`,
|
|
14
|
-
uploadFiles: "Upload files",
|
|
15
|
-
clickToUpload: "Click to upload",
|
|
16
|
-
orDragAndDrop: "or drag and drop",
|
|
17
|
-
clearSearch: "Clear search",
|
|
18
|
-
showPassword: "Show password",
|
|
19
|
-
hidePassword: "Hide password",
|
|
20
|
-
increment: "Increment",
|
|
21
|
-
decrement: "Decrement",
|
|
22
|
-
loading: "Loading\u2026",
|
|
23
|
-
pagination: "Pagination",
|
|
24
|
-
previousPage: "Go to previous page",
|
|
25
|
-
nextPage: "Go to next page",
|
|
26
|
-
goToPage: (page) => `Go to page ${page}`,
|
|
27
|
-
breadcrumb: "breadcrumb",
|
|
28
|
-
breadcrumbMore: "More",
|
|
29
|
-
moreCount: (count) => `${count} more`,
|
|
30
|
-
rating: "Rating",
|
|
31
|
-
ratingStars: (stars) => `${stars} star${stars !== 1 ? "s" : ""}`,
|
|
32
|
-
mainNavigation: "Main",
|
|
33
|
-
sidebar: "Sidebar",
|
|
34
|
-
searchPlaceholder: "Search\u2026",
|
|
35
|
-
noResults: "No results found.",
|
|
36
|
-
pickDate: "Pick a date",
|
|
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`,
|
|
43
|
-
commandPalette: "Command palette",
|
|
44
|
-
notifications: "Notifications ({hotkey})",
|
|
45
|
-
undo: "Undo",
|
|
46
|
-
promptLabel: "Message",
|
|
47
|
-
sendMessage: "Send message",
|
|
48
|
-
stopGenerating: "Stop generating",
|
|
49
|
-
promptHint: "Press Enter to send, Shift+Enter for a new line",
|
|
50
|
-
thinking: "Thinking",
|
|
51
|
-
youSaid: "You said",
|
|
52
|
-
assistantSaid: "Assistant said",
|
|
53
|
-
failedToSend: "Failed to send",
|
|
54
|
-
retry: "Retry",
|
|
55
|
-
copy: "Copy",
|
|
56
|
-
copied: "Copied",
|
|
57
|
-
goodResponse: "Good response",
|
|
58
|
-
badResponse: "Bad response",
|
|
59
|
-
regenerate: "Regenerate",
|
|
60
|
-
sources: "Sources",
|
|
61
|
-
source: (n) => `Source ${n}`,
|
|
62
|
-
jumpToLatest: "Jump to latest",
|
|
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"
|
|
92
|
-
};
|
|
93
|
-
var NexubContext = React.createContext({
|
|
94
|
-
locale: void 0,
|
|
95
|
-
dir: "ltr",
|
|
96
|
-
dateLocale: void 0,
|
|
97
|
-
messages: defaultMessages
|
|
98
|
-
});
|
|
99
|
-
var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "fa", "ur"]);
|
|
100
|
-
function directionOf(locale) {
|
|
101
|
-
return RTL_LANGUAGES.has(locale.toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr";
|
|
102
|
-
}
|
|
103
|
-
function NexubProvider({ locale = "en", dir, dateLocale, messages, children }) {
|
|
104
|
-
const resolvedDir = dir ?? directionOf(locale);
|
|
105
|
-
const value = React.useMemo(
|
|
106
|
-
() => ({ locale, dir: resolvedDir, dateLocale, messages: { ...defaultMessages, ...messages } }),
|
|
107
|
-
[locale, resolvedDir, dateLocale, messages]
|
|
108
|
-
);
|
|
109
|
-
return /* @__PURE__ */ jsx(NexubContext.Provider, { value, children: /* @__PURE__ */ jsx(DirectionProvider, { dir: resolvedDir, children }) });
|
|
110
|
-
}
|
|
111
|
-
function useNexubMessages() {
|
|
112
|
-
return React.useContext(NexubContext).messages;
|
|
113
|
-
}
|
|
114
|
-
function useLocale() {
|
|
115
|
-
const { locale = "en", dir, dateLocale } = React.useContext(NexubContext);
|
|
116
|
-
return { locale, dir, dateLocale };
|
|
117
|
-
}
|
|
118
|
-
function useIntlLocale(explicit) {
|
|
119
|
-
const ctx = React.useContext(NexubContext).locale;
|
|
120
|
-
return explicit ?? ctx;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export {
|
|
124
|
-
defaultMessages,
|
|
125
|
-
NexubProvider,
|
|
126
|
-
useNexubMessages,
|
|
127
|
-
useLocale,
|
|
128
|
-
useIntlLocale
|
|
129
|
-
};
|
package/dist/chunk-CIQHFMF6.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
// src/utils/money.ts
|
|
4
|
-
function moneyFormatter(currency, locale, options = {}) {
|
|
5
|
-
return new Intl.NumberFormat(locale, { style: "currency", currency, currencyDisplay: "narrowSymbol", ...options });
|
|
6
|
-
}
|
|
7
|
-
function fractionDigits(currency, locale) {
|
|
8
|
-
return moneyFormatter(currency, locale).resolvedOptions().maximumFractionDigits ?? 2;
|
|
9
|
-
}
|
|
10
|
-
function currencySymbol(currency, locale) {
|
|
11
|
-
return moneyFormatter(currency, locale).formatToParts(0).find((p) => p.type === "currency")?.value ?? currency;
|
|
12
|
-
}
|
|
13
|
-
function formatForEditing(value, currency, locale) {
|
|
14
|
-
return new Intl.NumberFormat(locale, {
|
|
15
|
-
useGrouping: false,
|
|
16
|
-
maximumFractionDigits: fractionDigits(currency, locale)
|
|
17
|
-
}).format(value);
|
|
18
|
-
}
|
|
19
|
-
function formatForDisplay(value, currency, locale) {
|
|
20
|
-
const digits = fractionDigits(currency, locale);
|
|
21
|
-
return new Intl.NumberFormat(locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }).format(value);
|
|
22
|
-
}
|
|
23
|
-
function parseMoney(text, currency, locale) {
|
|
24
|
-
const decimal = new Intl.NumberFormat(locale).formatToParts(1.1).find((p) => p.type === "decimal")?.value ?? ".";
|
|
25
|
-
const group = new Intl.NumberFormat(locale).formatToParts(1e4).find((p) => p.type === "group")?.value;
|
|
26
|
-
let s = text.trim().replace(/[\s\u00a0\u202f]/g, "");
|
|
27
|
-
if (group && group !== decimal) s = s.split(group).join("");
|
|
28
|
-
s = s.replace(decimal, ".").replace(/[−–]/g, "-").replace(/[^0-9.-]/g, "");
|
|
29
|
-
const negative = s.startsWith("-");
|
|
30
|
-
s = s.replace(/-/g, "");
|
|
31
|
-
if (!/\d/.test(s) || (s.match(/\./g) ?? []).length > 1) return null;
|
|
32
|
-
const n = Number(s);
|
|
33
|
-
if (!Number.isFinite(n)) return null;
|
|
34
|
-
const f = 10 ** fractionDigits(currency, locale);
|
|
35
|
-
return (negative ? -1 : 1) * (Math.round(n * f) / f);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export {
|
|
39
|
-
moneyFormatter,
|
|
40
|
-
currencySymbol,
|
|
41
|
-
formatForEditing,
|
|
42
|
-
formatForDisplay,
|
|
43
|
-
parseMoney
|
|
44
|
-
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
HelperText
|
|
4
|
+
} from "./chunk-ZLW7IBXK.js";
|
|
5
5
|
import {
|
|
6
6
|
Label
|
|
7
7
|
} from "./chunk-PGD246WD.js";
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
} from "./chunk-
|
|
9
|
+
FormError
|
|
10
|
+
} from "./chunk-QVTVDL6Y.js";
|
|
11
11
|
import {
|
|
12
12
|
cn
|
|
13
13
|
} from "./chunk-Q7G5WGYV.js";
|