@gntik-ai/ui 0.9.0 → 0.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/{Field-DPYsdteY.js → Field-knzMlyzO.js} +151 -3
- package/dist/Field-knzMlyzO.js.map +1 -0
- package/dist/forms.js +1 -1
- package/dist/index.d.ts +175 -53
- package/dist/index.js +121 -68
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/Field-DPYsdteY.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { extendTailwindMerge } from "tailwind-merge";
|
|
4
4
|
import { createTV } from "tailwind-variants";
|
|
5
|
-
import { DirectionProvider } from "@base-ui/react/direction-provider";
|
|
6
5
|
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
6
|
+
import { DirectionProvider } from "@base-ui/react/direction-provider";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { CircleAlert } from "lucide-react";
|
|
9
9
|
import { Button } from "@base-ui/react/button";
|
|
@@ -59,6 +59,60 @@ function cn(...inputs) {
|
|
|
59
59
|
const tv = createTV({ twMergeConfig: densityMergeConfig });
|
|
60
60
|
//#endregion
|
|
61
61
|
//#region src/i18n/format.ts
|
|
62
|
+
/**
|
|
63
|
+
* Formats a size with localized Intl unit labels, rounding into the next unit when needed.
|
|
64
|
+
* Bytes scale through petabytes, bits through terabits; non-finite values return `—`.
|
|
65
|
+
* A string second argument remains shorthand for the locale.
|
|
66
|
+
* @example formatBytes(1536, 'es') // '1,5 kB'
|
|
67
|
+
* @example formatBytes(26_214_400, { base: 1024 }) // '25 MiB'
|
|
68
|
+
*/
|
|
69
|
+
function formatBytes(value, options = {}) {
|
|
70
|
+
if (!Number.isFinite(value)) return "—";
|
|
71
|
+
const { locale = "en", base = 1e3, unit = "byte", unitDisplay = "short", maximumFractionDigits = 1 } = typeof options === "string" ? { locale: options } : options;
|
|
72
|
+
const scale = unit === "bit" ? 1e3 : base;
|
|
73
|
+
const prefixes = [
|
|
74
|
+
"",
|
|
75
|
+
"kilo",
|
|
76
|
+
"mega",
|
|
77
|
+
"giga",
|
|
78
|
+
"tera",
|
|
79
|
+
"peta"
|
|
80
|
+
];
|
|
81
|
+
const last = unit === "bit" ? 4 : 5;
|
|
82
|
+
let magnitude = Math.abs(value);
|
|
83
|
+
let index = 0;
|
|
84
|
+
while (magnitude >= scale && index < last) {
|
|
85
|
+
magnitude /= scale;
|
|
86
|
+
index++;
|
|
87
|
+
}
|
|
88
|
+
const rounded = new Intl.NumberFormat("en", {
|
|
89
|
+
maximumFractionDigits: index === 0 ? 0 : maximumFractionDigits,
|
|
90
|
+
useGrouping: false
|
|
91
|
+
}).format(magnitude);
|
|
92
|
+
if (Number(rounded) >= scale && index < last) {
|
|
93
|
+
magnitude /= scale;
|
|
94
|
+
index++;
|
|
95
|
+
}
|
|
96
|
+
const signed = value < 0 ? -magnitude : magnitude;
|
|
97
|
+
const numberOptions = { maximumFractionDigits: index === 0 ? 0 : maximumFractionDigits };
|
|
98
|
+
if (unit === "byte" && index === 0 && unitDisplay === "short" || scale === 1024 && index > 0) {
|
|
99
|
+
const symbol = [
|
|
100
|
+
"B",
|
|
101
|
+
"KiB",
|
|
102
|
+
"MiB",
|
|
103
|
+
"GiB",
|
|
104
|
+
"TiB",
|
|
105
|
+
"PiB"
|
|
106
|
+
][index];
|
|
107
|
+
return `${new Intl.NumberFormat(locale, numberOptions).format(signed)} ${symbol}`;
|
|
108
|
+
}
|
|
109
|
+
return new Intl.NumberFormat(locale, {
|
|
110
|
+
...numberOptions,
|
|
111
|
+
style: "unit",
|
|
112
|
+
unit: `${prefixes[index]}${unit}`,
|
|
113
|
+
unitDisplay
|
|
114
|
+
}).format(signed);
|
|
115
|
+
}
|
|
62
116
|
/** Scripts written right to left (language subtag). */
|
|
63
117
|
const RTL_LANGUAGES = /* @__PURE__ */ new Set([
|
|
64
118
|
"ar",
|
|
@@ -165,6 +219,10 @@ function createFormatters(locale, messages) {
|
|
|
165
219
|
return {
|
|
166
220
|
t: (key, vars) => interpolate(messages[key] ?? key, vars, locale),
|
|
167
221
|
formatNumber: (value, options) => new Intl.NumberFormat(locale, options).format(value),
|
|
222
|
+
formatBytes: (value, options) => formatBytes(value, {
|
|
223
|
+
locale,
|
|
224
|
+
...options
|
|
225
|
+
}),
|
|
168
226
|
formatCurrency: (value, currency, options) => new Intl.NumberFormat(locale, {
|
|
169
227
|
style: "currency",
|
|
170
228
|
currency,
|
|
@@ -189,6 +247,49 @@ function createFormatters(locale, messages) {
|
|
|
189
247
|
* Month and weekday names, numbers and dates come from Intl, not from this catalog.
|
|
190
248
|
*/
|
|
191
249
|
const en = {
|
|
250
|
+
"resourceDetail.overview": "Overview",
|
|
251
|
+
"resourceDetail.activity": "Activity",
|
|
252
|
+
"resourceDetail.settings": "Settings",
|
|
253
|
+
"resourceDetail.sections": "Resource sections",
|
|
254
|
+
"error.title": "We couldn’t load deployments",
|
|
255
|
+
"error.message": "The service didn’t respond in time. Your data is safe; try again in a moment.",
|
|
256
|
+
"error.support": "Contact support",
|
|
257
|
+
"emptyState.noAccess.title": "You don’t have access to {resource}",
|
|
258
|
+
"emptyState.noAccess.description": "Ask {owner} to grant you a role that includes {resource} permissions.",
|
|
259
|
+
"emptyState.noAccess.request": "Request access",
|
|
260
|
+
"emptyState.noAccess.requested": "Access requested",
|
|
261
|
+
"emptyState.noAccess.sent": "Access request sent",
|
|
262
|
+
"emptyState.noResults.queryTitleBefore": "No {entity} match “",
|
|
263
|
+
"emptyState.noResults.queryTitleAfter": "”",
|
|
264
|
+
"emptyState.noResults.title": "No {entity} found",
|
|
265
|
+
"emptyState.noResults.description": "Check the spelling or try a broader search{count, plural, =0 {} one { with {count} filter applied} other { with {count} filters applied}}.",
|
|
266
|
+
"emptyState.noResults.clearFilters": "Clear filters",
|
|
267
|
+
"emptyState.noResults.clearSearch": "Clear search",
|
|
268
|
+
"emptyState.firstRun.title": "Create your first project",
|
|
269
|
+
"emptyState.firstRun.description": "Projects group your services, environments and deployments. Start one from a repository in a couple of minutes.",
|
|
270
|
+
"emptyState.firstRun.action": "New project",
|
|
271
|
+
"emptyState.firstRun.guide": "Read the guide",
|
|
272
|
+
"callout.title": "You have used 92% of your build minutes",
|
|
273
|
+
"callout.description": "Builds will queue once the monthly limit is reached. Upgrade the plan or reduce concurrent builds.",
|
|
274
|
+
"callout.upgrade": "Upgrade plan",
|
|
275
|
+
"callout.viewUsage": "View usage",
|
|
276
|
+
"descriptionList.title": "Configuration",
|
|
277
|
+
"descriptionList.description": "Settings of this deployment.",
|
|
278
|
+
"descriptionList.edit": "Edit",
|
|
279
|
+
"descriptionList.copy": "Copy {label}",
|
|
280
|
+
"descriptionList.copied": "{label} copied",
|
|
281
|
+
"pageHeader.title": "Deployments",
|
|
282
|
+
"pageHeader.description": "Every build and release of this project across its environments.",
|
|
283
|
+
"pageHeader.moreActions": "More actions",
|
|
284
|
+
"logViewer.title": "Logs",
|
|
285
|
+
"logViewer.levelFilter": "Log levels",
|
|
286
|
+
"logViewer.searchLabel": "Search logs",
|
|
287
|
+
"logViewer.searchPlaceholder": "Search…",
|
|
288
|
+
"logViewer.follow": "Follow",
|
|
289
|
+
"logViewer.count": "{visible} of {total}",
|
|
290
|
+
"logViewer.empty": "No lines match the current filters.",
|
|
291
|
+
"logViewer.inspect": "Inspect event {timestamp}",
|
|
292
|
+
"logViewer.copy": "Copy line {timestamp}",
|
|
192
293
|
"pageHeader.sections": "Page sections",
|
|
193
294
|
"thumbnail.uploading": "Uploading {label}",
|
|
194
295
|
"thumbnail.error": "Upload failed",
|
|
@@ -388,6 +489,7 @@ const en = {
|
|
|
388
489
|
"calendar.month": "Month",
|
|
389
490
|
"calendar.year": "Year",
|
|
390
491
|
"calendar.label": "Calendar",
|
|
492
|
+
"calendar.localeDefaults": "Locale defaults",
|
|
391
493
|
"calendar.previousMonth": "Previous month",
|
|
392
494
|
"calendar.nextMonth": "Next month",
|
|
393
495
|
"calendar.today": "Today",
|
|
@@ -872,6 +974,7 @@ const en = {
|
|
|
872
974
|
"queryBuilder.value": "Value",
|
|
873
975
|
"queryBuilder.valueFrom": "From",
|
|
874
976
|
"queryBuilder.valueTo": "To",
|
|
977
|
+
"queryBuilder.rangeInverted": "'From' must not be after 'To'.",
|
|
875
978
|
"queryBuilder.addCondition": "Add condition",
|
|
876
979
|
"queryBuilder.addGroup": "Add group",
|
|
877
980
|
"queryBuilder.removeCondition": "Remove condition {index}",
|
|
@@ -951,6 +1054,49 @@ const en = {
|
|
|
951
1054
|
//#region src/i18n/messages/es.ts
|
|
952
1055
|
/** Built-in Spanish catalog. */
|
|
953
1056
|
const es = {
|
|
1057
|
+
"resourceDetail.overview": "Resumen",
|
|
1058
|
+
"resourceDetail.activity": "Actividad",
|
|
1059
|
+
"resourceDetail.settings": "Configuración",
|
|
1060
|
+
"resourceDetail.sections": "Secciones del recurso",
|
|
1061
|
+
"error.title": "No se pudieron cargar los despliegues",
|
|
1062
|
+
"error.message": "El servicio no respondió a tiempo. Tus datos están a salvo; vuelve a intentarlo en un momento.",
|
|
1063
|
+
"error.support": "Contactar con soporte",
|
|
1064
|
+
"emptyState.noAccess.title": "No tienes acceso a {resource}",
|
|
1065
|
+
"emptyState.noAccess.description": "Pide a {owner} que te asigne un rol con permisos de {resource}.",
|
|
1066
|
+
"emptyState.noAccess.request": "Solicitar acceso",
|
|
1067
|
+
"emptyState.noAccess.requested": "Acceso solicitado",
|
|
1068
|
+
"emptyState.noAccess.sent": "Solicitud de acceso enviada",
|
|
1069
|
+
"emptyState.noResults.queryTitleBefore": "No hay {entity} que coincidan con “",
|
|
1070
|
+
"emptyState.noResults.queryTitleAfter": "”",
|
|
1071
|
+
"emptyState.noResults.title": "No se encontraron {entity}",
|
|
1072
|
+
"emptyState.noResults.description": "Revisa la ortografía o prueba una búsqueda más amplia{count, plural, =0 {} one { con {count} filtro aplicado} other { con {count} filtros aplicados}}.",
|
|
1073
|
+
"emptyState.noResults.clearFilters": "Borrar filtros",
|
|
1074
|
+
"emptyState.noResults.clearSearch": "Borrar búsqueda",
|
|
1075
|
+
"emptyState.firstRun.title": "Crea tu primer proyecto",
|
|
1076
|
+
"emptyState.firstRun.description": "Los proyectos agrupan tus servicios, entornos y despliegues. Crea uno desde un repositorio en un par de minutos.",
|
|
1077
|
+
"emptyState.firstRun.action": "Nuevo proyecto",
|
|
1078
|
+
"emptyState.firstRun.guide": "Leer la guía",
|
|
1079
|
+
"callout.title": "Has usado el 92% de tus minutos de compilación",
|
|
1080
|
+
"callout.description": "Las compilaciones se pondrán en cola al alcanzar el límite mensual. Mejora el plan o reduce las compilaciones simultáneas.",
|
|
1081
|
+
"callout.upgrade": "Mejorar el plan",
|
|
1082
|
+
"callout.viewUsage": "Ver uso",
|
|
1083
|
+
"descriptionList.title": "Configuración",
|
|
1084
|
+
"descriptionList.description": "Configuración de este despliegue.",
|
|
1085
|
+
"descriptionList.edit": "Editar",
|
|
1086
|
+
"descriptionList.copy": "Copiar {label}",
|
|
1087
|
+
"descriptionList.copied": "{label} copiado",
|
|
1088
|
+
"pageHeader.title": "Despliegues",
|
|
1089
|
+
"pageHeader.description": "Todas las compilaciones y versiones de este proyecto en sus entornos.",
|
|
1090
|
+
"pageHeader.moreActions": "Más acciones",
|
|
1091
|
+
"logViewer.title": "Registros",
|
|
1092
|
+
"logViewer.levelFilter": "Niveles de registro",
|
|
1093
|
+
"logViewer.searchLabel": "Buscar en los registros",
|
|
1094
|
+
"logViewer.searchPlaceholder": "Buscar…",
|
|
1095
|
+
"logViewer.follow": "Seguir",
|
|
1096
|
+
"logViewer.count": "{visible} de {total}",
|
|
1097
|
+
"logViewer.empty": "Ninguna línea coincide con los filtros actuales.",
|
|
1098
|
+
"logViewer.inspect": "Inspeccionar evento {timestamp}",
|
|
1099
|
+
"logViewer.copy": "Copiar línea {timestamp}",
|
|
954
1100
|
"pageHeader.sections": "Secciones de la página",
|
|
955
1101
|
"thumbnail.uploading": "Subiendo {label}",
|
|
956
1102
|
"thumbnail.error": "Error al subir",
|
|
@@ -1178,6 +1324,7 @@ const es = {
|
|
|
1178
1324
|
"calendar.month": "Mes",
|
|
1179
1325
|
"calendar.year": "Año",
|
|
1180
1326
|
"calendar.label": "Calendario",
|
|
1327
|
+
"calendar.localeDefaults": "Valores predeterminados regionales",
|
|
1181
1328
|
"calendar.previousMonth": "Mes anterior",
|
|
1182
1329
|
"calendar.nextMonth": "Mes siguiente",
|
|
1183
1330
|
"calendar.today": "Hoy",
|
|
@@ -1634,6 +1781,7 @@ const es = {
|
|
|
1634
1781
|
"queryBuilder.value": "Valor",
|
|
1635
1782
|
"queryBuilder.valueFrom": "Desde",
|
|
1636
1783
|
"queryBuilder.valueTo": "Hasta",
|
|
1784
|
+
"queryBuilder.rangeInverted": "«Desde» no puede ser posterior a «Hasta».",
|
|
1637
1785
|
"queryBuilder.addCondition": "Añadir condición",
|
|
1638
1786
|
"queryBuilder.addGroup": "Añadir grupo",
|
|
1639
1787
|
"queryBuilder.removeCondition": "Quitar condición {index}",
|
|
@@ -2108,6 +2256,6 @@ function FieldsetDescription({ className, ...props }) {
|
|
|
2108
2256
|
});
|
|
2109
2257
|
}
|
|
2110
2258
|
//#endregion
|
|
2111
|
-
export { createFormatters as A, builtInMessages as C, catalogs as D, usePortalDir as E,
|
|
2259
|
+
export { createFormatters as A, builtInMessages as C, catalogs as D, usePortalDir as E, cn as F, interpolate as M, localeDirection as N, es as O, tv as P, I18nProvider as S, useOptionalI18n as T, buttonVariants as _, FieldLabel as a, DensityContext as b, FieldsetLegend as c, useAnnounce as d, useHasLiveAnnouncer as f, BUTTON_ICON_SIZE as g, IconButton as h, FieldItem as i, formatBytes as j, en as k, fieldVariants as l, Button$1 as m, FieldDescription as n, Fieldset$1 as o, liveAnnouncerVariants as p, FieldError as r, FieldsetDescription as s, Field$1 as t, LiveAnnouncer as u, Spinner as v, useI18n as w, useDensity as x, RTL_FLIP as y };
|
|
2112
2260
|
|
|
2113
|
-
//# sourceMappingURL=Field-
|
|
2261
|
+
//# sourceMappingURL=Field-knzMlyzO.js.map
|