@krak-stack/registry 0.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.
Files changed (84) hide show
  1. package/README.md +29 -0
  2. package/dist/components/ui/alert-dialog.d.ts +18 -0
  3. package/dist/components/ui/app-brand.d.ts +26 -0
  4. package/dist/components/ui/app-brand.js +78 -0
  5. package/dist/components/ui/attachment.d.ts +23 -0
  6. package/dist/components/ui/badge.d.ts +7 -0
  7. package/dist/components/ui/button.d.ts +8 -0
  8. package/dist/components/ui/card.d.ts +11 -0
  9. package/dist/components/ui/checkbox.d.ts +3 -0
  10. package/dist/components/ui/code-block.d.ts +14 -0
  11. package/dist/components/ui/code-block.js +224 -0
  12. package/dist/components/ui/command.d.ts +18 -0
  13. package/dist/components/ui/copy-button.d.ts +18 -0
  14. package/dist/components/ui/copy-button.js +133 -0
  15. package/dist/components/ui/data-table.d.ts +264 -0
  16. package/dist/components/ui/data-table.js +3594 -0
  17. package/dist/components/ui/dialog.d.ts +13 -0
  18. package/dist/components/ui/dropdown-menu.d.ts +29 -0
  19. package/dist/components/ui/editing-locale-switcher.d.ts +7 -0
  20. package/dist/components/ui/editing-locale-switcher.js +626 -0
  21. package/dist/components/ui/effect-form.d.ts +137 -0
  22. package/dist/components/ui/effect-form.js +2330 -0
  23. package/dist/components/ui/field.d.ts +24 -0
  24. package/dist/components/ui/file-picker.d.ts +30 -0
  25. package/dist/components/ui/file-picker.js +811 -0
  26. package/dist/components/ui/form.d.ts +402 -0
  27. package/dist/components/ui/form.js +2245 -0
  28. package/dist/components/ui/google-map.d.ts +103 -0
  29. package/dist/components/ui/google-map.js +754 -0
  30. package/dist/components/ui/icon-input.d.ts +9 -0
  31. package/dist/components/ui/icon-input.js +971 -0
  32. package/dist/components/ui/input-group.d.ts +17 -0
  33. package/dist/components/ui/input.d.ts +3 -0
  34. package/dist/components/ui/label.d.ts +3 -0
  35. package/dist/components/ui/loading.d.ts +7 -0
  36. package/dist/components/ui/loading.js +467 -0
  37. package/dist/components/ui/locale-switcher.d.ts +7 -0
  38. package/dist/components/ui/locale-switcher.js +632 -0
  39. package/dist/components/ui/pagination.d.ts +43 -0
  40. package/dist/components/ui/pagination.js +787 -0
  41. package/dist/components/ui/popover.d.ts +9 -0
  42. package/dist/components/ui/scroll-area.d.ts +4 -0
  43. package/dist/components/ui/search-menu.d.ts +34 -0
  44. package/dist/components/ui/search-menu.js +839 -0
  45. package/dist/components/ui/select.d.ts +15 -0
  46. package/dist/components/ui/separator.d.ts +3 -0
  47. package/dist/components/ui/sheet.d.ts +14 -0
  48. package/dist/components/ui/sidebar-layout.d.ts +29 -0
  49. package/dist/components/ui/sidebar-layout.js +755 -0
  50. package/dist/components/ui/sidebar.d.ts +63 -0
  51. package/dist/components/ui/skeleton.d.ts +2 -0
  52. package/dist/components/ui/stats-card.d.ts +12 -0
  53. package/dist/components/ui/stats-card.js +125 -0
  54. package/dist/components/ui/table.d.ts +10 -0
  55. package/dist/components/ui/textarea.d.ts +3 -0
  56. package/dist/components/ui/theme-switcher.d.ts +29 -0
  57. package/dist/components/ui/theme-switcher.js +775 -0
  58. package/dist/components/ui/tooltip.d.ts +6 -0
  59. package/dist/components/ui/virtualized-combobox.d.ts +54 -0
  60. package/dist/components/ui/virtualized-combobox.js +821 -0
  61. package/dist/hooks/use-mobile.d.ts +1 -0
  62. package/dist/lib/query.d.ts +49 -0
  63. package/dist/lib/utils.d.ts +2 -0
  64. package/dist/paraglide/runtime.d.ts +978 -0
  65. package/dist/services/embedding.d.ts +2 -0
  66. package/dist/services/embedding.js +23 -0
  67. package/dist/services/notification/channels/index.d.ts +22 -0
  68. package/dist/services/notification/channels/index.js +11 -0
  69. package/dist/services/notification/channels/ses/index.d.ts +51 -0
  70. package/dist/services/notification/channels/ses/index.js +145 -0
  71. package/dist/services/notification/channels/ses/schema.d.ts +13 -0
  72. package/dist/services/notification/channels/ses/schema.js +35 -0
  73. package/dist/services/notification/index.d.ts +15 -0
  74. package/dist/services/notification/index.js +67 -0
  75. package/dist/services/notification/schema.d.ts +10 -0
  76. package/dist/services/notification/schema.js +30 -0
  77. package/dist/services/opentelemetry.d.ts +8 -0
  78. package/dist/services/opentelemetry.js +23 -0
  79. package/dist/services/s3/index.d.ts +62 -0
  80. package/dist/services/s3/index.js +208 -0
  81. package/dist/services/s3/schema.d.ts +18 -0
  82. package/dist/services/s3/schema.js +37 -0
  83. package/package.json +218 -0
  84. package/tailwind.css +1 -0
@@ -0,0 +1,632 @@
1
+ // ../../src/paraglide/runtime.js
2
+ import"@inlang/paraglide-js/urlpattern-polyfill";
3
+ var baseLocale = "en";
4
+ var locales = ["en", "fr"];
5
+ var cookieName = "locale";
6
+ var cookieMaxAge = 34560000;
7
+ var cookieDomain = "";
8
+ var localStorageKey = "PARAGLIDE_LOCALE";
9
+ var strategy = [
10
+ "url",
11
+ "cookie",
12
+ "preferredLanguage",
13
+ "baseLocale"
14
+ ];
15
+ var routeStrategies = [
16
+ {
17
+ match: "/api/:path(.*)?",
18
+ exclude: true
19
+ }
20
+ ];
21
+ var urlPatterns = [
22
+ {
23
+ pattern: "/:path(.*)?",
24
+ localized: [
25
+ [
26
+ "en",
27
+ "/en/:path(.*)?"
28
+ ],
29
+ [
30
+ "fr",
31
+ "/fr/:path(.*)?"
32
+ ]
33
+ ]
34
+ }
35
+ ];
36
+ var cachedRouteStrategyUrl;
37
+ var cachedRouteStrategy;
38
+ function findMatchingRouteStrategy(url) {
39
+ if (routeStrategies.length === 0) {
40
+ return;
41
+ }
42
+ const urlString = typeof url === "string" ? url : url.href;
43
+ if (cachedRouteStrategyUrl === urlString) {
44
+ return cachedRouteStrategy;
45
+ }
46
+ const urlObject = new URL(urlString, "http://dummy.com");
47
+ let match;
48
+ for (const routeStrategy of routeStrategies) {
49
+ const pattern = new URLPattern(routeStrategy.match, urlObject.href);
50
+ if (pattern.exec(urlObject.href)) {
51
+ match = routeStrategy;
52
+ break;
53
+ }
54
+ }
55
+ cachedRouteStrategyUrl = urlString;
56
+ cachedRouteStrategy = match;
57
+ return match;
58
+ }
59
+ function getStrategyForUrl(url) {
60
+ const routeStrategy = findMatchingRouteStrategy(url);
61
+ if (routeStrategy && routeStrategy.exclude !== true && Array.isArray(routeStrategy.strategy)) {
62
+ return routeStrategy.strategy;
63
+ }
64
+ return strategy;
65
+ }
66
+ var serverAsyncLocalStorage = undefined;
67
+ var isServer = import.meta.env?.SSR ?? typeof window === "undefined";
68
+ var experimentalStaticLocale = undefined;
69
+ var TREE_SHAKE_COOKIE_STRATEGY_USED = true;
70
+ var TREE_SHAKE_URL_STRATEGY_USED = true;
71
+ var TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED = false;
72
+ var TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED = true;
73
+ var TREE_SHAKE_DEFAULT_URL_PATTERN_USED = false;
74
+ var TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED = false;
75
+ globalThis.__paraglide = globalThis.__paraglide ?? {};
76
+ globalThis.__paraglide.ssr = globalThis.__paraglide.ssr ?? {};
77
+ var _locale;
78
+ var localeInitiallySet = false;
79
+ var getLocale = () => {
80
+ if (experimentalStaticLocale !== undefined) {
81
+ return experimentalStaticLocale;
82
+ }
83
+ if (serverAsyncLocalStorage) {
84
+ const locale = serverAsyncLocalStorage?.getStore()?.locale;
85
+ if (locale) {
86
+ return locale;
87
+ }
88
+ }
89
+ let strategyToUse = strategy;
90
+ if (!isServer && typeof window !== "undefined" && window.location?.href) {
91
+ strategyToUse = getStrategyForUrl(window.location.href);
92
+ }
93
+ const resolved = resolveLocaleWithStrategies(strategyToUse, typeof window !== "undefined" ? window.location?.href : undefined);
94
+ if (resolved) {
95
+ if (!localeInitiallySet) {
96
+ _locale = resolved;
97
+ localeInitiallySet = true;
98
+ setLocale(resolved, { reload: false });
99
+ }
100
+ return resolved;
101
+ }
102
+ throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
103
+ };
104
+ function resolveLocaleWithStrategies(strategyToUse, urlForUrlStrategy) {
105
+ let locale;
106
+ for (const strat of strategyToUse) {
107
+ if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
108
+ locale = extractLocaleFromCookie();
109
+ } else if (strat === "baseLocale") {
110
+ locale = baseLocale;
111
+ } else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && !isServer && typeof urlForUrlStrategy === "string") {
112
+ locale = extractLocaleFromUrl(urlForUrlStrategy);
113
+ } else if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable" && _locale !== undefined) {
114
+ locale = _locale;
115
+ } else if (TREE_SHAKE_PREFERRED_LANGUAGE_STRATEGY_USED && strat === "preferredLanguage" && !isServer) {
116
+ locale = extractLocaleFromNavigator();
117
+ } else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && !isServer) {
118
+ locale = localStorage.getItem(localStorageKey) ?? undefined;
119
+ } else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
120
+ const handler = customClientStrategies.get(strat);
121
+ if (handler) {
122
+ const result = handler.getLocale();
123
+ if (result instanceof Promise) {
124
+ continue;
125
+ }
126
+ if (result !== undefined) {
127
+ return assertIsLocale(result);
128
+ }
129
+ }
130
+ }
131
+ const matchedLocale = toLocale(locale);
132
+ if (matchedLocale) {
133
+ return matchedLocale;
134
+ }
135
+ }
136
+ return;
137
+ }
138
+ var rtlLanguages = new Set([
139
+ "ar",
140
+ "dv",
141
+ "fa",
142
+ "he",
143
+ "ks",
144
+ "ku",
145
+ "ps",
146
+ "sd",
147
+ "ug",
148
+ "ur",
149
+ "yi"
150
+ ]);
151
+ var navigateOrReload = (newLocation) => {
152
+ if (newLocation) {
153
+ window.location.href = newLocation;
154
+ } else {
155
+ window.location.reload();
156
+ }
157
+ };
158
+ var setLocale = (newLocale, options) => {
159
+ const optionsWithDefaults = {
160
+ reload: true,
161
+ ...options
162
+ };
163
+ let currentLocale;
164
+ try {
165
+ currentLocale = getLocale();
166
+ } catch {}
167
+ const customSetLocalePromises = [];
168
+ let newLocation = undefined;
169
+ let strategyToUse = strategy;
170
+ if (!isServer && typeof window !== "undefined" && window.location?.href) {
171
+ strategyToUse = getStrategyForUrl(window.location.href);
172
+ }
173
+ for (const strat of strategyToUse) {
174
+ if (TREE_SHAKE_GLOBAL_VARIABLE_STRATEGY_USED && strat === "globalVariable") {
175
+ _locale = newLocale;
176
+ } else if (TREE_SHAKE_COOKIE_STRATEGY_USED && strat === "cookie") {
177
+ if (isServer || typeof document === "undefined" || typeof window === "undefined") {
178
+ continue;
179
+ }
180
+ const cookieString = `${cookieName}=${newLocale}; path=/; max-age=${cookieMaxAge}`;
181
+ document.cookie = cookieDomain ? `${cookieString}; domain=${cookieDomain}` : cookieString;
182
+ } else if (strat === "baseLocale") {
183
+ continue;
184
+ } else if (TREE_SHAKE_URL_STRATEGY_USED && strat === "url" && typeof window !== "undefined") {
185
+ newLocation = localizeUrl(window.location.href, {
186
+ locale: newLocale
187
+ }).href;
188
+ } else if (TREE_SHAKE_LOCAL_STORAGE_STRATEGY_USED && strat === "localStorage" && typeof window !== "undefined") {
189
+ localStorage.setItem(localStorageKey, newLocale);
190
+ } else if (isCustomStrategy(strat) && customClientStrategies.has(strat)) {
191
+ const handler = customClientStrategies.get(strat);
192
+ if (handler) {
193
+ let result = handler.setLocale(newLocale);
194
+ if (result instanceof Promise) {
195
+ result = result.catch((error) => {
196
+ throw new Error(`Custom strategy "${strat}" setLocale failed.`, {
197
+ cause: error
198
+ });
199
+ });
200
+ customSetLocalePromises.push(result);
201
+ }
202
+ }
203
+ }
204
+ }
205
+ const runReload = () => {
206
+ if (!isServer && optionsWithDefaults.reload && window.location && newLocale !== currentLocale) {
207
+ navigateOrReload(newLocation);
208
+ }
209
+ };
210
+ if (customSetLocalePromises.length) {
211
+ return Promise.all(customSetLocalePromises).then(() => {
212
+ runReload();
213
+ });
214
+ }
215
+ runReload();
216
+ return;
217
+ };
218
+ var getUrlOrigin = () => {
219
+ if (serverAsyncLocalStorage) {
220
+ return serverAsyncLocalStorage.getStore()?.origin ?? "http://fallback.com";
221
+ } else if (typeof window !== "undefined") {
222
+ return window.location.origin;
223
+ }
224
+ return "http://fallback.com";
225
+ };
226
+ function toLocale(value) {
227
+ if (typeof value !== "string") {
228
+ return;
229
+ }
230
+ const lowerValue = value.toLowerCase();
231
+ for (const locale of locales) {
232
+ if (locale.toLowerCase() === lowerValue) {
233
+ return locale;
234
+ }
235
+ }
236
+ return;
237
+ }
238
+ function assertIsLocale(input) {
239
+ const locale = toLocale(input);
240
+ if (locale)
241
+ return locale;
242
+ throw new Error(`Invalid locale: ${input}. Expected one of: ${locales.join(", ")}`);
243
+ }
244
+ function extractLocaleFromCookie() {
245
+ if (typeof document === "undefined" || !document.cookie) {
246
+ return;
247
+ }
248
+ const match = document.cookie.match(new RegExp(`(^| )${cookieName}=([^;]+)`));
249
+ const locale = match?.[2];
250
+ return toLocale(locale);
251
+ }
252
+ function extractLocaleFromNavigator() {
253
+ if (!navigator?.languages?.length) {
254
+ return;
255
+ }
256
+ const languages = navigator.languages.map((lang) => ({
257
+ fullTag: lang,
258
+ baseTag: lang.split("-")[0]
259
+ }));
260
+ for (const lang of languages) {
261
+ const fullLocale = toLocale(lang.fullTag);
262
+ if (fullLocale) {
263
+ return fullLocale;
264
+ }
265
+ const baseLocale2 = toLocale(lang.baseTag);
266
+ if (baseLocale2) {
267
+ return baseLocale2;
268
+ }
269
+ }
270
+ return;
271
+ }
272
+ var cachedUrl;
273
+ var cachedLocale;
274
+ function extractLocaleFromUrl(url) {
275
+ const urlString = typeof url === "string" ? url : url.href;
276
+ if (cachedUrl === urlString) {
277
+ return cachedLocale;
278
+ }
279
+ let result;
280
+ if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
281
+ result = defaultUrlPatternExtractLocale(url);
282
+ } else {
283
+ const urlObj = typeof url === "string" ? new URL(url) : url;
284
+ for (const element of urlPatterns) {
285
+ for (const [locale, localizedPattern] of element.localized) {
286
+ const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
287
+ if (match) {
288
+ result = locale;
289
+ break;
290
+ }
291
+ }
292
+ if (result)
293
+ break;
294
+ }
295
+ }
296
+ cachedUrl = urlString;
297
+ cachedLocale = result;
298
+ return result;
299
+ }
300
+ function defaultUrlPatternExtractLocale(url) {
301
+ const urlObj = new URL(url, "http://dummy.com");
302
+ const pathSegments = urlObj.pathname.split("/").filter(Boolean);
303
+ return toLocale(pathSegments[0]) || baseLocale;
304
+ }
305
+ function localizeUrl(url, options) {
306
+ const targetLocale = options?.locale ? assertIsLocale(options?.locale) : getLocale();
307
+ if (TREE_SHAKE_DEFAULT_URL_PATTERN_USED) {
308
+ return localizeUrlDefaultPattern(url, targetLocale);
309
+ }
310
+ const urlObj = typeof url === "string" ? new URL(url) : url;
311
+ for (const element of urlPatterns) {
312
+ for (const [, localizedPattern] of element.localized) {
313
+ const match = new URLPattern(localizedPattern, urlObj.href).exec(urlObj.href);
314
+ if (!match) {
315
+ continue;
316
+ }
317
+ const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
318
+ if (!targetPattern) {
319
+ continue;
320
+ }
321
+ const localizedUrl = fillPattern(targetPattern, aggregateGroups(match), urlObj.origin);
322
+ return fillMissingUrlParts(localizedUrl, match);
323
+ }
324
+ const unlocalizedMatch = new URLPattern(element.pattern, urlObj.href).exec(urlObj.href);
325
+ if (unlocalizedMatch) {
326
+ const targetPattern = element.localized.find(([locale]) => locale === targetLocale)?.[1];
327
+ if (targetPattern) {
328
+ const localizedUrl = fillPattern(targetPattern, aggregateGroups(unlocalizedMatch), urlObj.origin);
329
+ return fillMissingUrlParts(localizedUrl, unlocalizedMatch);
330
+ }
331
+ }
332
+ }
333
+ return urlObj;
334
+ }
335
+ function localizeUrlDefaultPattern(url, locale) {
336
+ const urlObj = typeof url === "string" ? new URL(url, getUrlOrigin()) : new URL(url);
337
+ const currentLocale = extractLocaleFromUrl(urlObj);
338
+ if (currentLocale === locale) {
339
+ return urlObj;
340
+ }
341
+ const pathSegments = urlObj.pathname.split("/").filter(Boolean);
342
+ if (pathSegments.length > 0 && toLocale(pathSegments[0])) {
343
+ pathSegments.shift();
344
+ }
345
+ if (locale === baseLocale) {
346
+ urlObj.pathname = "/" + pathSegments.join("/");
347
+ } else {
348
+ urlObj.pathname = "/" + locale + "/" + pathSegments.join("/");
349
+ }
350
+ return urlObj;
351
+ }
352
+ function fillMissingUrlParts(url, match) {
353
+ if (match.protocol.groups["0"]) {
354
+ url.protocol = match.protocol.groups["0"] ?? "";
355
+ }
356
+ if (match.hostname.groups["0"]) {
357
+ url.hostname = match.hostname.groups["0"] ?? "";
358
+ }
359
+ if (match.username.groups["0"]) {
360
+ url.username = match.username.groups["0"] ?? "";
361
+ }
362
+ if (match.password.groups["0"]) {
363
+ url.password = match.password.groups["0"] ?? "";
364
+ }
365
+ if (match.port.groups["0"]) {
366
+ url.port = match.port.groups["0"] ?? "";
367
+ }
368
+ if (match.pathname.groups["0"]) {
369
+ url.pathname = match.pathname.groups["0"] ?? "";
370
+ }
371
+ if (match.search.groups["0"]) {
372
+ url.search = match.search.groups["0"] ?? "";
373
+ }
374
+ if (match.hash.groups["0"]) {
375
+ url.hash = match.hash.groups["0"] ?? "";
376
+ }
377
+ return url;
378
+ }
379
+ function fillPattern(pattern, values, origin) {
380
+ let processedPattern = pattern.replace(/(https?:\/\/[^:/]+):(\d+)(\/|$)/g, (_, protocol, port, slash) => {
381
+ return `${protocol}#PORT-${port}#${slash}`;
382
+ });
383
+ let processedGroupDelimiters = processedPattern.replace(/\{([^{}]*)\}([?+*]?)/g, (_, content, modifier) => {
384
+ if (modifier === "?") {
385
+ return content;
386
+ }
387
+ return content;
388
+ });
389
+ let filled = processedGroupDelimiters.replace(/(\/?):([a-zA-Z0-9_]+)(\([^)]*\))?([?+*]?)/g, (_, slash, name, __, modifier) => {
390
+ const value = values[name];
391
+ if (value === null) {
392
+ return "";
393
+ }
394
+ if (modifier === "?") {
395
+ return value !== undefined ? `${slash}${value}` : "";
396
+ }
397
+ if (modifier === "+" || modifier === "*") {
398
+ if (value === undefined && modifier === "+") {
399
+ throw new Error(`Missing value for "${name}" (one or more required)`);
400
+ }
401
+ return value ? `${slash}${value}` : "";
402
+ }
403
+ if (value === undefined) {
404
+ throw new Error(`Missing value for "${name}"`);
405
+ }
406
+ return `${slash}${value}`;
407
+ });
408
+ filled = filled.replace(/#PORT-(\d+)#/g, ":$1");
409
+ return new URL(filled, origin);
410
+ }
411
+ function aggregateGroups(match) {
412
+ return {
413
+ ...match.hash.groups,
414
+ ...match.hostname.groups,
415
+ ...match.password.groups,
416
+ ...match.pathname.groups,
417
+ ...match.port.groups,
418
+ ...match.protocol.groups,
419
+ ...match.search.groups,
420
+ ...match.username.groups
421
+ };
422
+ }
423
+ var customServerStrategies = new Map;
424
+ var customClientStrategies = new Map;
425
+ function isCustomStrategy(strategy2) {
426
+ return typeof strategy2 === "string" && /^custom-[A-Za-z0-9_-]+$/.test(strategy2);
427
+ }
428
+
429
+ // ../../src/components/ui/button.tsx
430
+ import { Button as ButtonPrimitive } from "@base-ui/react/button";
431
+ import { cva } from "class-variance-authority";
432
+
433
+ // ../../src/lib/utils.ts
434
+ import { clsx } from "clsx";
435
+ import { twMerge } from "tailwind-merge";
436
+ function cn(...inputs) {
437
+ return twMerge(clsx(inputs));
438
+ }
439
+
440
+ // ../../src/components/ui/button.tsx
441
+ import { jsxDEV } from "react/jsx-dev-runtime";
442
+ var buttonVariants = cva("group/button inline-flex shrink-0 items-center justify-center rounded-md border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", {
443
+ variants: {
444
+ variant: {
445
+ default: "bg-primary text-primary-foreground hover:bg-primary/80",
446
+ outline: "border-border bg-background shadow-xs hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
447
+ secondary: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
448
+ ghost: "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",
449
+ destructive: "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",
450
+ link: "text-primary underline-offset-4 hover:underline"
451
+ },
452
+ size: {
453
+ default: "h-9 gap-1.5 px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
454
+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),8px)] px-2 text-xs in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
455
+ sm: "h-8 gap-1 rounded-[min(var(--radius-md),10px)] px-2.5 in-data-[slot=button-group]:rounded-md has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5",
456
+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",
457
+ icon: "size-9",
458
+ "icon-xs": "size-6 rounded-[min(var(--radius-md),8px)] in-data-[slot=button-group]:rounded-md [&_svg:not([class*='size-'])]:size-3",
459
+ "icon-sm": "size-8 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-md",
460
+ "icon-lg": "size-10"
461
+ }
462
+ },
463
+ defaultVariants: {
464
+ variant: "default",
465
+ size: "default"
466
+ }
467
+ });
468
+ function Button({
469
+ className,
470
+ variant = "default",
471
+ size = "default",
472
+ ...props
473
+ }) {
474
+ return /* @__PURE__ */ jsxDEV(ButtonPrimitive, {
475
+ "data-slot": "button",
476
+ className: cn(buttonVariants({ variant, size, className })),
477
+ ...props
478
+ }, undefined, false, undefined, this);
479
+ }
480
+
481
+ // ../../src/components/ui/dropdown-menu.tsx
482
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
483
+ import { ChevronRightIcon, CheckIcon } from "lucide-react";
484
+ import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
485
+ function DropdownMenu({ ...props }) {
486
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.Root, {
487
+ "data-slot": "dropdown-menu",
488
+ ...props
489
+ }, undefined, false, undefined, this);
490
+ }
491
+ function DropdownMenuTrigger({ ...props }) {
492
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.Trigger, {
493
+ "data-slot": "dropdown-menu-trigger",
494
+ ...props
495
+ }, undefined, false, undefined, this);
496
+ }
497
+ function DropdownMenuContent({
498
+ align = "start",
499
+ alignOffset = 0,
500
+ side = "bottom",
501
+ sideOffset = 4,
502
+ className,
503
+ ...props
504
+ }) {
505
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.Portal, {
506
+ children: /* @__PURE__ */ jsxDEV2(MenuPrimitive.Positioner, {
507
+ className: "isolate z-50 outline-none",
508
+ align,
509
+ alignOffset,
510
+ side,
511
+ sideOffset,
512
+ children: /* @__PURE__ */ jsxDEV2(MenuPrimitive.Popup, {
513
+ "data-slot": "dropdown-menu-content",
514
+ className: cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className),
515
+ ...props
516
+ }, undefined, false, undefined, this)
517
+ }, undefined, false, undefined, this)
518
+ }, undefined, false, undefined, this);
519
+ }
520
+ function DropdownMenuGroup({ ...props }) {
521
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.Group, {
522
+ "data-slot": "dropdown-menu-group",
523
+ ...props
524
+ }, undefined, false, undefined, this);
525
+ }
526
+ function DropdownMenuLabel({
527
+ className,
528
+ inset,
529
+ ...props
530
+ }) {
531
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.GroupLabel, {
532
+ "data-slot": "dropdown-menu-label",
533
+ "data-inset": inset,
534
+ className: cn("px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8", className),
535
+ ...props
536
+ }, undefined, false, undefined, this);
537
+ }
538
+ function DropdownMenuRadioGroup({ ...props }) {
539
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.RadioGroup, {
540
+ "data-slot": "dropdown-menu-radio-group",
541
+ ...props
542
+ }, undefined, false, undefined, this);
543
+ }
544
+ function DropdownMenuRadioItem({
545
+ className,
546
+ children,
547
+ inset,
548
+ ...props
549
+ }) {
550
+ return /* @__PURE__ */ jsxDEV2(MenuPrimitive.RadioItem, {
551
+ "data-slot": "dropdown-menu-radio-item",
552
+ "data-inset": inset,
553
+ className: cn("relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className),
554
+ ...props,
555
+ children: [
556
+ /* @__PURE__ */ jsxDEV2("span", {
557
+ className: "pointer-events-none absolute right-2 flex items-center justify-center",
558
+ "data-slot": "dropdown-menu-radio-item-indicator",
559
+ children: /* @__PURE__ */ jsxDEV2(MenuPrimitive.RadioItemIndicator, {
560
+ children: /* @__PURE__ */ jsxDEV2(CheckIcon, {}, undefined, false, undefined, this)
561
+ }, undefined, false, undefined, this)
562
+ }, undefined, false, undefined, this),
563
+ children
564
+ ]
565
+ }, undefined, true, undefined, this);
566
+ }
567
+
568
+ // ../../src/components/ui/locale-switcher.tsx
569
+ import { Languages } from "lucide-react";
570
+ import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
571
+ var messages = {
572
+ en: {
573
+ title: "Switch language",
574
+ en: "English",
575
+ fr: "Français"
576
+ },
577
+ fr: {
578
+ title: "Changer de langue",
579
+ en: "English",
580
+ fr: "Français"
581
+ }
582
+ };
583
+ var localeMessages = (overrides) => ({
584
+ ...getLocale().startsWith("fr") ? messages.fr : messages.en,
585
+ ...overrides
586
+ });
587
+ var LocaleSwitcher = ({ messages: messages2 }) => {
588
+ const locale = getLocale();
589
+ const labels = localeMessages(messages2);
590
+ return /* @__PURE__ */ jsxDEV3(DropdownMenu, {
591
+ children: [
592
+ /* @__PURE__ */ jsxDEV3(DropdownMenuTrigger, {
593
+ render: /* @__PURE__ */ jsxDEV3(Button, {
594
+ variant: "outline",
595
+ size: "icon",
596
+ "aria-label": labels.title,
597
+ children: [
598
+ /* @__PURE__ */ jsxDEV3(Languages, {
599
+ className: "size-4"
600
+ }, undefined, false, undefined, this),
601
+ /* @__PURE__ */ jsxDEV3("span", {
602
+ className: "sr-only",
603
+ children: labels.title
604
+ }, undefined, false, undefined, this)
605
+ ]
606
+ }, undefined, true, undefined, this)
607
+ }, undefined, false, undefined, this),
608
+ /* @__PURE__ */ jsxDEV3(DropdownMenuContent, {
609
+ className: "w-32",
610
+ children: /* @__PURE__ */ jsxDEV3(DropdownMenuGroup, {
611
+ children: [
612
+ /* @__PURE__ */ jsxDEV3(DropdownMenuLabel, {
613
+ children: labels.title
614
+ }, undefined, false, undefined, this),
615
+ /* @__PURE__ */ jsxDEV3(DropdownMenuRadioGroup, {
616
+ "aria-label": labels.title,
617
+ value: locale,
618
+ onValueChange: (v) => setLocale(v),
619
+ children: locales.map((l) => /* @__PURE__ */ jsxDEV3(DropdownMenuRadioItem, {
620
+ value: l,
621
+ children: labels[l]
622
+ }, l, false, undefined, this))
623
+ }, undefined, false, undefined, this)
624
+ ]
625
+ }, undefined, true, undefined, this)
626
+ }, undefined, false, undefined, this)
627
+ ]
628
+ }, undefined, true, undefined, this);
629
+ };
630
+ export {
631
+ LocaleSwitcher
632
+ };
@@ -0,0 +1,43 @@
1
+ export type PaginationMessages = {
2
+ pageSize: string;
3
+ results: (count: number) => string;
4
+ selectedOf: (selected: number, total: number) => string;
5
+ pageOf: (page: number, total: number) => string;
6
+ goToFirstPage: string;
7
+ goToPreviousPage: string;
8
+ goToNextPage: string;
9
+ goToLastPage: string;
10
+ };
11
+ export declare const paginationMessages: (locale?: "en" | "fr", overrides?: Partial<PaginationMessages>) => {
12
+ pageSize: string;
13
+ results: (count: number) => string;
14
+ selectedOf: (selected: number, total: number) => string;
15
+ pageOf: (page: number, total: number) => string;
16
+ goToFirstPage: string;
17
+ goToPreviousPage: string;
18
+ goToNextPage: string;
19
+ goToLastPage: string;
20
+ } | {
21
+ pageSize: string;
22
+ results: (count: number) => string;
23
+ selectedOf: (selected: number, total: number) => string;
24
+ pageOf: (page: number, total: number) => string;
25
+ goToFirstPage: string;
26
+ goToPreviousPage: string;
27
+ goToNextPage: string;
28
+ goToLastPage: string;
29
+ };
30
+ export type PaginationProps = {
31
+ compact?: boolean | undefined;
32
+ messages?: Partial<PaginationMessages> | undefined;
33
+ onPageChange: (page: number) => void;
34
+ onPageSizeChange: (pageSize: number) => void;
35
+ page: number;
36
+ pageCount: number;
37
+ pageSize: number;
38
+ pageSizes?: readonly number[] | undefined;
39
+ selectedRows?: number | undefined;
40
+ showResults?: boolean | undefined;
41
+ totalRows: number;
42
+ };
43
+ export declare function Pagination({ compact, messages: messageOverrides, onPageChange, onPageSizeChange, page, pageCount, pageSize, pageSizes, selectedRows, showResults, totalRows, }: PaginationProps): import("react").JSX.Element;