@gntik-ai/blocks 0.8.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.
Files changed (77) hide show
  1. package/dist/index.d.ts +138 -21
  2. package/dist/index.js +897 -376
  3. package/dist/index.js.map +1 -1
  4. package/package.json +3 -3
  5. package/src/billing/CostBreakdown/CostBreakdown.test.tsx +10 -0
  6. package/src/billing/CostBreakdown/CostBreakdown.tsx +50 -43
  7. package/src/billing/SpendVsBudget/SpendVsBudget.test.tsx +10 -0
  8. package/src/billing/SpendVsBudget/SpendVsBudget.tsx +35 -31
  9. package/src/builders/FlowBuilder/FlowBuilder.test.tsx +237 -2
  10. package/src/builders/FlowBuilder/FlowBuilder.tsx +101 -29
  11. package/src/builders/FlowBuilder/block.meta.ts +1 -1
  12. package/src/builders/FlowBuilder/connections.ts +30 -12
  13. package/src/builders/FlowBuilder/examples/ControlledGraph.tsx +8 -0
  14. package/src/builders/FlowBuilder/graph-state.ts +78 -0
  15. package/src/builders/LogViewer/LogViewer.labels.test.tsx +90 -0
  16. package/src/builders/LogViewer/LogViewer.test.tsx +11 -0
  17. package/src/builders/LogViewer/LogViewer.tsx +70 -31
  18. package/src/builders/LogViewer/block.meta.ts +14 -1
  19. package/src/builders/LogViewer/examples/Spanish.tsx +30 -0
  20. package/src/data-display/ChartCard/ChartCard.locale.test.tsx +15 -0
  21. package/src/data-display/ChartCard/ChartCard.test.tsx +9 -0
  22. package/src/data-display/ChartCard/ChartCard.tsx +81 -67
  23. package/src/data-display/ChartCard/block.meta.ts +1 -1
  24. package/src/data-display/DescriptionListCard/DescriptionListCard.labels.test.tsx +73 -0
  25. package/src/data-display/DescriptionListCard/DescriptionListCard.tsx +37 -7
  26. package/src/data-display/DescriptionListCard/block.meta.ts +11 -1
  27. package/src/data-display/DescriptionListCard/examples/Spanish.tsx +22 -0
  28. package/src/feedback/EmptyStates/EmptyStates.labels.test.tsx +185 -0
  29. package/src/feedback/EmptyStates/EmptyStates.tsx +73 -20
  30. package/src/feedback/EmptyStates/block.meta.ts +73 -1
  31. package/src/feedback/EmptyStates/examples/Spanish.tsx +41 -0
  32. package/src/feedback/ErrorPanel/ErrorPanel.labels.test.tsx +99 -0
  33. package/src/feedback/ErrorPanel/ErrorPanel.tsx +38 -9
  34. package/src/feedback/ErrorPanel/block.meta.ts +19 -1
  35. package/src/feedback/ErrorPanel/examples/Spanish.tsx +30 -0
  36. package/src/feedback/InlineCallout/InlineCallout.labels.test.tsx +62 -0
  37. package/src/feedback/InlineCallout/InlineCallout.tsx +22 -9
  38. package/src/feedback/InlineCallout/block.meta.ts +9 -1
  39. package/src/feedback/InlineCallout/examples/Spanish.tsx +19 -0
  40. package/src/feedback/Skeletons/Skeletons.labels.test.tsx +24 -0
  41. package/src/forms/FileUploadPanel/FileUploadPanel.test.tsx +22 -1
  42. package/src/forms/FileUploadPanel/FileUploadPanel.tsx +4 -4
  43. package/src/forms/FileUploadPanel/fixtures.ts +0 -12
  44. package/src/forms/FileUploadPanel/format-bytes.test.ts +8 -0
  45. package/src/page-chrome/PageHeader/PageHeader.labels.test.tsx +56 -0
  46. package/src/page-chrome/PageHeader/PageHeader.test.tsx +18 -0
  47. package/src/page-chrome/PageHeader/PageHeader.tsx +21 -4
  48. package/src/page-chrome/PageHeader/block.meta.ts +8 -1
  49. package/src/page-chrome/PageHeader/examples/Labels.tsx +16 -0
  50. package/src/page-chrome/PageHeader/examples/Spanish.tsx +11 -0
  51. package/src/scheduling/AgendaList/AgendaList.test.tsx +25 -0
  52. package/src/scheduling/AgendaList/AgendaList.tsx +7 -2
  53. package/src/scheduling/AgendaList/AgendaListLocale.test.tsx +11 -0
  54. package/src/scheduling/AgendaList/block.meta.ts +1 -1
  55. package/src/scheduling/AgendaList/examples/Locale.tsx +29 -0
  56. package/src/scheduling/MonthCalendar/MonthCalendar.test.tsx +111 -1
  57. package/src/scheduling/MonthCalendar/MonthCalendar.tsx +19 -9
  58. package/src/scheduling/MonthCalendar/block.meta.ts +1 -1
  59. package/src/scheduling/MonthCalendar/examples/Locale.tsx +19 -0
  60. package/src/scheduling/WeekCalendar/WeekCalendar.test.tsx +73 -2
  61. package/src/scheduling/WeekCalendar/WeekCalendar.tsx +26 -12
  62. package/src/scheduling/WeekCalendar/block.meta.ts +1 -1
  63. package/src/scheduling/WeekCalendar/examples/Locale.tsx +19 -0
  64. package/src/scheduling/shared/dates.test.ts +75 -0
  65. package/src/scheduling/shared/dates.ts +46 -22
  66. package/src/scheduling/shared/useSchedulingClock.ts +13 -0
  67. package/src/shell/GlobalSearch/GlobalSearch.test.tsx +12 -0
  68. package/src/shell/GlobalSearch/fixtures.ts +2 -2
  69. package/src/tables/DataTable/DataTable.labels.test.tsx +2 -0
  70. package/src/tables/DataTable/DataTable.locale.test.tsx +153 -0
  71. package/src/tables/DataTable/DataTable.server-pagination.test.tsx +1 -1
  72. package/src/tables/DataTable/DataTable.test.tsx +16 -0
  73. package/src/tables/DataTable/block.meta.ts +2 -0
  74. package/src/tables/DataTable/data-table-row.tsx +18 -2
  75. package/src/tables/DataTable/data-table-utils.ts +18 -4
  76. package/src/tables/DataTable/labels.ts +2 -0
  77. package/src/tables/PaginationFooter/PaginationFooter.i18n.test.tsx +26 -0
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { Fragment, createElement, useCallback, useEffect, useEffectEvent, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
3
3
  import { Activity, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, BarChart3, Bookmark, Bot, Boxes, Braces, Building2, CalendarCheck, CalendarDays, Camera, Check, ChevronDown, ChevronLeft, ChevronRight, ChevronsUpDown, CircleAlert, CircleCheck, CircleHelp, CircleX, Clock, Cog, Columns3, Copy, CreditCard, Database, Download, ExternalLink, Eye, FileCode, FileText, FolderKanban, FolderPlus, Gauge, GitBranch, Globe, HardDrive, Home, Inbox, Info, KeyRound, Layers, LayoutGrid, List, ListFilter, Lock, LogOut, Mail, MailCheck, MapPin, Minus, Monitor, MousePointerClick, Pencil, Play, PlugZap, Plus, RefreshCw, Rocket, RotateCcw, RotateCw, Rows2, Rows3, Search, SearchX, Server, ServerCrash, Settings, ShieldCheck, SlidersHorizontal, Smartphone, Sparkles, Table2, Tablet, Trash2, TriangleAlert, Upload, User, UserMinus, UserPlus, Users, Workflow, Wrench, X, Zap } from "@gntik-ai/icons";
4
- import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Breadcrumbs, Button, Card, CardAction, CardBody, CardDescription, CardHeader, CardTitle, Checkbox, CheckboxGroup, ClickableCard, CodeBlock, Collapsible, CollapsiblePanel, CollapsibleTrigger, CommandPalette, CommandPaletteTrigger, CopyButton, CursorPagination, DEFAULT_DATE_RANGE_PRESETS, DateRangePicker, DensityProvider, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, EmptyState, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, IconButton, Input, Link, LiveAnnouncer, Logo, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MoreMenu, NavList, NotificationsPopover, OtpInput, Pagination, PasswordInput, Progress, Radio, RadioGroup, ResizablePanel, ResizablePanelGroup, ResizeHandle, SecretField, Select, SelectContent, SelectItem, SelectTrigger, SimpleSelect, Skeleton, Slider, Sparkline, Spinner, StatusDot, StatusTag, Switch, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Textarea, ThemeCycleButton, ThemeSwitcher, Timestamp, Toggle, ToggleGroup, Token, TokenInput, Toolbar, ToolbarButton, ToolbarEnd, ToolbarInput, ToolbarSeparator, ToolbarStart, UserMenu, WizardLayout, WorkspaceSwitcher, buttonVariants, cn, nextSortDirection, tableVariants, toDate, useAnnounce, useDensity, useHasLiveAnnouncer, useI18n } from "@gntik-ai/ui";
4
+ import { Accordion, AccordionItem, AccordionPanel, AccordionTrigger, Alert, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, Avatar, Badge, Breadcrumbs, Button, Card, CardAction, CardBody, CardDescription, CardHeader, CardTitle, Checkbox, CheckboxGroup, ClickableCard, CodeBlock, Collapsible, CollapsiblePanel, CollapsibleTrigger, CommandPalette, CommandPaletteTrigger, CopyButton, CursorPagination, DEFAULT_DATE_RANGE_PRESETS, DateRangePicker, DensityProvider, Dialog, DialogBody, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, EmptyState, Field, FieldDescription, FieldError, FieldLabel, Fieldset, FieldsetLegend, IconButton, Input, Link, LiveAnnouncer, Logo, Menu, MenuCheckboxItem, MenuContent, MenuGroup, MenuGroupLabel, MenuItem, MenuRadioGroup, MenuRadioItem, MenuSeparator, MenuSub, MenuSubContent, MenuSubTrigger, MenuTrigger, Meter, MoreMenu, NavList, NotificationsPopover, OtpInput, Pagination, PasswordInput, Progress, Radio, RadioGroup, ResizablePanel, ResizablePanelGroup, ResizeHandle, SecretField, Select, SelectContent, SelectItem, SelectTrigger, SimpleSelect, Skeleton, Slider, Sparkline, Spinner, StatusDot, StatusTag, Switch, Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow, Tabs, TabsList, TabsPanel, TabsTab, Textarea, ThemeCycleButton, ThemeSwitcher, Timestamp, Toggle, ToggleGroup, Token, TokenInput, Toolbar, ToolbarButton, ToolbarEnd, ToolbarInput, ToolbarSeparator, ToolbarStart, UserMenu, WizardLayout, WorkspaceSwitcher, buttonVariants, cn, foldText, localeHourCycle, localeWeekStart, matchRanges, nextSortDirection, tableVariants, toDate, useAnnounce, useDensity, useHasLiveAnnouncer, useI18n, useOptionalI18n } from "@gntik-ai/ui";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
- import { AreaChart, BarChart, CHART_COLORS, DonutChart, Heatmap, LineChart, chartFmt } from "@gntik-ai/charts";
6
+ import { AreaChart, BarChart, CHART_COLORS, ChartLocaleProvider, DonutChart, Heatmap, LineChart, chartFmt } from "@gntik-ai/charts";
7
7
  import { FLOW_TONES, FlowCanvas, KIND_CHIP, KindGlyph, useFlowState } from "@gntik-ai/flow";
8
8
  import { CodeEditor, DiffEditor } from "@gntik-ai/editor";
9
9
  //#region src/ai/AssistantCardGrid/fixtures.ts
@@ -3333,55 +3333,59 @@ function SpendVsBudget({ data = sampleSpend, budget = sampleBudget, currency = "
3333
3333
  value: formatMoney(budget, currency)
3334
3334
  }
3335
3335
  ];
3336
- return /* @__PURE__ */ jsxs(Card, {
3337
- className: cn("p-6", className),
3338
- children: [
3339
- /* @__PURE__ */ jsxs("div", {
3340
- className: "flex flex-wrap items-start justify-between gap-3",
3341
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(TitleTag, {
3342
- className: "text-[15px] font-semibold tracking-tight text-foreground",
3343
- children: title
3344
- }), period && /* @__PURE__ */ jsx("p", {
3345
- className: "mt-0.5 text-[12.5px] text-muted-foreground",
3346
- children: period
3347
- })] }), /* @__PURE__ */ jsx(Badge, {
3348
- tone: over ? "warning" : "success",
3349
- dot: true,
3350
- children: over ? "Forecast over budget" : "Within budget"
3351
- })]
3352
- }),
3353
- /* @__PURE__ */ jsx("dl", {
3354
- className: "mt-4 grid grid-cols-3 gap-4",
3355
- children: stats.map((s) => /* @__PURE__ */ jsxs("div", {
3356
- className: "min-w-0",
3357
- children: [/* @__PURE__ */ jsx("dt", {
3358
- className: "text-[11.5px] text-muted-foreground",
3359
- children: s.label
3360
- }), /* @__PURE__ */ jsx("dd", {
3361
- className: "mt-1 truncate font-mono text-[14px] font-semibold text-foreground tabular-nums",
3362
- children: s.value
3336
+ const { locale } = useI18n();
3337
+ return /* @__PURE__ */ jsx(ChartLocaleProvider, {
3338
+ locale,
3339
+ children: /* @__PURE__ */ jsxs(Card, {
3340
+ className: cn("p-6", className),
3341
+ children: [
3342
+ /* @__PURE__ */ jsxs("div", {
3343
+ className: "flex flex-wrap items-start justify-between gap-3",
3344
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx(TitleTag, {
3345
+ className: "text-[15px] font-semibold tracking-tight text-foreground",
3346
+ children: title
3347
+ }), period && /* @__PURE__ */ jsx("p", {
3348
+ className: "mt-0.5 text-[12.5px] text-muted-foreground",
3349
+ children: period
3350
+ })] }), /* @__PURE__ */ jsx(Badge, {
3351
+ tone: over ? "warning" : "success",
3352
+ dot: true,
3353
+ children: over ? "Forecast over budget" : "Within budget"
3363
3354
  })]
3364
- }, s.label))
3365
- }),
3366
- /* @__PURE__ */ jsx(LineChart, {
3367
- className: "mt-5",
3368
- data: rows,
3369
- index: "day",
3370
- categories: [
3371
- "Spend",
3372
- "Forecast",
3373
- "Budget"
3374
- ],
3375
- colors: [
3376
- "primary",
3377
- "cyan",
3378
- "amber"
3379
- ],
3380
- valueFormatter: money,
3381
- height,
3382
- "aria-label": `${title}: ${formatMoney(toDate, currency)} spent, ${formatMoney(forecast, currency)} forecast against a ${formatMoney(budget, currency)} budget`
3383
- })
3384
- ]
3355
+ }),
3356
+ /* @__PURE__ */ jsx("dl", {
3357
+ className: "mt-4 grid grid-cols-3 gap-4",
3358
+ children: stats.map((s) => /* @__PURE__ */ jsxs("div", {
3359
+ className: "min-w-0",
3360
+ children: [/* @__PURE__ */ jsx("dt", {
3361
+ className: "text-[11.5px] text-muted-foreground",
3362
+ children: s.label
3363
+ }), /* @__PURE__ */ jsx("dd", {
3364
+ className: "mt-1 truncate font-mono text-[14px] font-semibold text-foreground tabular-nums",
3365
+ children: s.value
3366
+ })]
3367
+ }, s.label))
3368
+ }),
3369
+ /* @__PURE__ */ jsx(LineChart, {
3370
+ className: "mt-5",
3371
+ data: rows,
3372
+ index: "day",
3373
+ categories: [
3374
+ "Spend",
3375
+ "Forecast",
3376
+ "Budget"
3377
+ ],
3378
+ colors: [
3379
+ "primary",
3380
+ "cyan",
3381
+ "amber"
3382
+ ],
3383
+ valueFormatter: money,
3384
+ height,
3385
+ "aria-label": `${title}: ${formatMoney(toDate, currency)} spent, ${formatMoney(forecast, currency)} forecast against a ${formatMoney(budget, currency)} budget`
3386
+ })
3387
+ ]
3388
+ })
3385
3389
  });
3386
3390
  }
3387
3391
  //#endregion
@@ -3712,79 +3716,83 @@ function CostBreakdown({ items = sampleCosts, currency = "USD", title = "Cost br
3712
3716
  const total = ranked.reduce((sum, i) => sum + i.amount, 0);
3713
3717
  const money = (n) => formatMoney(n, currency);
3714
3718
  const colorAt = (i) => CHART_COLORS[i % CHART_COLORS.length] ?? "primary";
3715
- return /* @__PURE__ */ jsxs(Card, {
3716
- className: cn("p-6", className),
3717
- children: [/* @__PURE__ */ jsxs("div", {
3718
- className: "flex items-baseline justify-between gap-3",
3719
- children: [/* @__PURE__ */ jsx(TitleTag, {
3720
- className: "text-[15px] font-semibold tracking-tight text-foreground",
3721
- children: title
3722
- }), /* @__PURE__ */ jsx("span", {
3723
- className: "font-mono text-[13px] font-semibold text-foreground tabular-nums",
3724
- children: money(total)
3725
- })]
3726
- }), /* @__PURE__ */ jsxs("div", {
3727
- className: "mt-5 flex flex-col items-center gap-6 sm:flex-row sm:items-center",
3728
- children: [/* @__PURE__ */ jsx(DonutChart, {
3729
- data: ranked,
3730
- index: "label",
3731
- category: "amount",
3732
- showLegend: false,
3733
- centerLabel,
3734
- valueFormatter: (n) => formatMoney(n, currency, true),
3735
- height: size,
3736
- "aria-label": `${title}: ${ranked.map((i) => `${i.label} ${money(i.amount)}`).join(", ")}`,
3737
- className: "shrink-0"
3738
- }), /* @__PURE__ */ jsx("ol", {
3739
- "aria-label": "Categories by cost",
3740
- className: "grid w-full min-w-0 flex-1 gap-3",
3741
- children: ranked.map((item, i) => {
3742
- const pct = total > 0 ? item.amount / total * 100 : 0;
3743
- return /* @__PURE__ */ jsxs("li", {
3744
- className: "grid gap-1.5",
3745
- children: [/* @__PURE__ */ jsxs("div", {
3746
- className: "flex items-center justify-between gap-3",
3747
- children: [/* @__PURE__ */ jsxs("span", {
3748
- className: "flex min-w-0 items-center gap-2 text-[13px] text-foreground",
3749
- children: [
3750
- /* @__PURE__ */ jsx("span", {
3751
- "aria-hidden": true,
3752
- className: "w-4 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",
3753
- children: i + 1
3754
- }),
3755
- /* @__PURE__ */ jsx("span", {
3756
- "aria-hidden": true,
3757
- className: cn("size-2.5 shrink-0 rounded-[3px]", SWATCH[colorAt(i)])
3758
- }),
3759
- /* @__PURE__ */ jsx("span", {
3760
- className: "truncate",
3761
- children: item.label
3762
- })
3763
- ]
3764
- }), /* @__PURE__ */ jsxs("span", {
3765
- className: "shrink-0 font-mono text-[12.5px] whitespace-nowrap text-muted-foreground tabular-nums",
3766
- children: [
3767
- /* @__PURE__ */ jsx("span", {
3768
- className: "font-semibold text-foreground",
3769
- children: money(item.amount)
3770
- }),
3771
- " · ",
3772
- pct.toFixed(1),
3773
- "%"
3774
- ]
3719
+ const { locale } = useI18n();
3720
+ return /* @__PURE__ */ jsx(ChartLocaleProvider, {
3721
+ locale,
3722
+ children: /* @__PURE__ */ jsxs(Card, {
3723
+ className: cn("p-6", className),
3724
+ children: [/* @__PURE__ */ jsxs("div", {
3725
+ className: "flex items-baseline justify-between gap-3",
3726
+ children: [/* @__PURE__ */ jsx(TitleTag, {
3727
+ className: "text-[15px] font-semibold tracking-tight text-foreground",
3728
+ children: title
3729
+ }), /* @__PURE__ */ jsx("span", {
3730
+ className: "font-mono text-[13px] font-semibold text-foreground tabular-nums",
3731
+ children: money(total)
3732
+ })]
3733
+ }), /* @__PURE__ */ jsxs("div", {
3734
+ className: "mt-5 flex flex-col items-center gap-6 sm:flex-row sm:items-center",
3735
+ children: [/* @__PURE__ */ jsx(DonutChart, {
3736
+ data: ranked,
3737
+ index: "label",
3738
+ category: "amount",
3739
+ showLegend: false,
3740
+ centerLabel,
3741
+ valueFormatter: (n) => formatMoney(n, currency, true),
3742
+ height: size,
3743
+ "aria-label": `${title}: ${ranked.map((i) => `${i.label} ${money(i.amount)}`).join(", ")}`,
3744
+ className: "shrink-0"
3745
+ }), /* @__PURE__ */ jsx("ol", {
3746
+ "aria-label": "Categories by cost",
3747
+ className: "grid w-full min-w-0 flex-1 gap-3",
3748
+ children: ranked.map((item, i) => {
3749
+ const pct = total > 0 ? item.amount / total * 100 : 0;
3750
+ return /* @__PURE__ */ jsxs("li", {
3751
+ className: "grid gap-1.5",
3752
+ children: [/* @__PURE__ */ jsxs("div", {
3753
+ className: "flex items-center justify-between gap-3",
3754
+ children: [/* @__PURE__ */ jsxs("span", {
3755
+ className: "flex min-w-0 items-center gap-2 text-[13px] text-foreground",
3756
+ children: [
3757
+ /* @__PURE__ */ jsx("span", {
3758
+ "aria-hidden": true,
3759
+ className: "w-4 shrink-0 font-mono text-[11px] text-muted-foreground tabular-nums",
3760
+ children: i + 1
3761
+ }),
3762
+ /* @__PURE__ */ jsx("span", {
3763
+ "aria-hidden": true,
3764
+ className: cn("size-2.5 shrink-0 rounded-[3px]", SWATCH[colorAt(i)])
3765
+ }),
3766
+ /* @__PURE__ */ jsx("span", {
3767
+ className: "truncate",
3768
+ children: item.label
3769
+ })
3770
+ ]
3771
+ }), /* @__PURE__ */ jsxs("span", {
3772
+ className: "shrink-0 font-mono text-[12.5px] whitespace-nowrap text-muted-foreground tabular-nums",
3773
+ children: [
3774
+ /* @__PURE__ */ jsx("span", {
3775
+ className: "font-semibold text-foreground",
3776
+ children: money(item.amount)
3777
+ }),
3778
+ " · ",
3779
+ pct.toFixed(1),
3780
+ "%"
3781
+ ]
3782
+ })]
3783
+ }), /* @__PURE__ */ jsx("div", {
3784
+ "aria-hidden": true,
3785
+ className: "h-1.5 overflow-hidden rounded-full bg-secondary",
3786
+ children: /* @__PURE__ */ jsx("div", {
3787
+ className: cn("h-full rounded-full", SWATCH[colorAt(i)]),
3788
+ style: { width: `${pct}%` }
3789
+ })
3775
3790
  })]
3776
- }), /* @__PURE__ */ jsx("div", {
3777
- "aria-hidden": true,
3778
- className: "h-1.5 overflow-hidden rounded-full bg-secondary",
3779
- children: /* @__PURE__ */ jsx("div", {
3780
- className: cn("h-full rounded-full", SWATCH[colorAt(i)]),
3781
- style: { width: `${pct}%` }
3782
- })
3783
- })]
3784
- }, item.label);
3785
- })
3791
+ }, item.label);
3792
+ })
3793
+ })]
3786
3794
  })]
3787
- })]
3795
+ })
3788
3796
  });
3789
3797
  }
3790
3798
  //#endregion
@@ -3995,7 +4003,7 @@ function useDecoratedNodes(nodes, issues, statuses, runMode) {
3995
4003
  }
3996
4004
  //#endregion
3997
4005
  //#region src/builders/FlowBuilder/connections.ts
3998
- function useConnections(nodes, setEdges, defaultConnect, props) {
4006
+ function useConnections(nodes, edges, commit, props) {
3999
4007
  const pending = useRef(null);
4000
4008
  const seq = useRef(0);
4001
4009
  const describe = (c) => ({
@@ -4034,12 +4042,26 @@ function useConnections(nodes, setEdges, defaultConnect, props) {
4034
4042
  }
4035
4043
  if (props.onConnectEdge) {
4036
4044
  const mapped = props.onConnectEdge(describe(c));
4037
- setEdges((es) => [...es, {
4045
+ let id;
4046
+ do
4047
+ id = `edge-${++seq.current}-${c.source}-${c.target}`;
4048
+ while (edges.some((edge) => edge.id === id));
4049
+ commit({
4038
4050
  ...c,
4039
4051
  ...mapped,
4040
- id: `edge-${++seq.current}-${c.source}-${c.target}`
4041
- }]);
4042
- } else defaultConnect(c);
4052
+ id
4053
+ });
4054
+ } else if (c.source && c.target && !edges.some((edge) => edge.source === c.source && edge.target === c.target && (edge.sourceHandle || null) === (c.sourceHandle || null) && (edge.targetHandle || null) === (c.targetHandle || null))) {
4055
+ const edge = {
4056
+ ...c,
4057
+ id: `xy-edge__${c.source}${c.sourceHandle || ""}-${c.target}${c.targetHandle || ""}`,
4058
+ type: "smoothstep",
4059
+ animated: true
4060
+ };
4061
+ if (edge.sourceHandle === null) delete edge.sourceHandle;
4062
+ if (edge.targetHandle === null) delete edge.targetHandle;
4063
+ commit(edge);
4064
+ }
4043
4065
  props.onConnect?.(describe(c));
4044
4066
  };
4045
4067
  return {
@@ -4050,6 +4072,87 @@ function useConnections(nodes, setEdges, defaultConnect, props) {
4050
4072
  };
4051
4073
  }
4052
4074
  //#endregion
4075
+ //#region src/builders/FlowBuilder/graph-state.ts
4076
+ /** Parent graph content with a local overlay for canvas-only state. */
4077
+ function useBuilderGraph(initial, graph) {
4078
+ const local = useFlowState(initial.nodes, initial.edges);
4079
+ const [overlay, setOverlay] = useState({});
4080
+ const [edgeSelection, setEdgeSelection] = useState({});
4081
+ const nodes = useMemo(() => graph ? graph.nodes.map((node) => overlay[node.id] ? {
4082
+ ...node,
4083
+ ...overlay[node.id]
4084
+ } : node) : local.nodes, [
4085
+ graph,
4086
+ overlay,
4087
+ local.nodes
4088
+ ]);
4089
+ const edges = useMemo(() => graph ? graph.edges.map((edge) => edge.id in edgeSelection ? {
4090
+ ...edge,
4091
+ selected: edgeSelection[edge.id]
4092
+ } : edge) : local.edges, [
4093
+ graph,
4094
+ edgeSelection,
4095
+ local.edges
4096
+ ]);
4097
+ const setNodes = (action) => {
4098
+ if (!graph) return local.setNodes(action);
4099
+ const next = typeof action === "function" ? action(nodes) : action;
4100
+ setOverlay(Object.fromEntries(next.map((node) => [node.id, {
4101
+ selected: node.selected,
4102
+ measured: node.measured,
4103
+ dragging: node.dragging,
4104
+ ...node.dragging ? { position: node.position } : {}
4105
+ }])));
4106
+ };
4107
+ const setEdges = (action) => {
4108
+ if (!graph) return local.setEdges(action);
4109
+ const next = typeof action === "function" ? action(edges) : action;
4110
+ setEdgeSelection(Object.fromEntries(next.map((edge) => [edge.id, edge.selected ?? false])));
4111
+ };
4112
+ const onNodesChange = (changes) => {
4113
+ if (!graph) return local.onNodesChange(changes);
4114
+ setOverlay((previous) => {
4115
+ const next = { ...previous };
4116
+ for (const change of changes) {
4117
+ if (change.type === "select") next[change.id] = {
4118
+ ...next[change.id],
4119
+ selected: change.selected
4120
+ };
4121
+ if (change.type === "dimensions" && change.dimensions) next[change.id] = {
4122
+ ...next[change.id],
4123
+ measured: change.dimensions
4124
+ };
4125
+ if (change.type === "position") {
4126
+ const rest = { ...next[change.id] };
4127
+ delete rest.position;
4128
+ next[change.id] = {
4129
+ ...rest,
4130
+ dragging: change.dragging,
4131
+ ...change.dragging && change.position ? { position: change.position } : {}
4132
+ };
4133
+ }
4134
+ }
4135
+ return next;
4136
+ });
4137
+ };
4138
+ const onEdgesChange = (changes) => {
4139
+ if (!graph) return local.onEdgesChange(changes);
4140
+ setEdgeSelection((previous) => {
4141
+ const next = { ...previous };
4142
+ for (const change of changes) if (change.type === "select") next[change.id] = change.selected;
4143
+ return next;
4144
+ });
4145
+ };
4146
+ return {
4147
+ nodes,
4148
+ edges,
4149
+ setNodes,
4150
+ setEdges,
4151
+ onNodesChange,
4152
+ onEdgesChange
4153
+ };
4154
+ }
4155
+ //#endregion
4053
4156
  //#region src/builders/FlowBuilder/problems.tsx
4054
4157
  function FlowProblems({ issues, onSelect, titleAs: Title = "h3" }) {
4055
4158
  if (!issues.length) return null;
@@ -4278,6 +4381,19 @@ function RunConsole({ entries, onClear, titleAs: TitleTag = "h3" }) {
4278
4381
  }
4279
4382
  //#endregion
4280
4383
  //#region src/builders/FlowBuilder/FlowBuilder.tsx
4384
+ /** Persist graph content without canvas selection, drag or measurement state. */
4385
+ function cleanFlowGraph(graph) {
4386
+ return {
4387
+ ...graph,
4388
+ nodes: graph.nodes.map((original) => {
4389
+ const node = { ...original };
4390
+ delete node.selected;
4391
+ delete node.dragging;
4392
+ delete node.measured;
4393
+ return node;
4394
+ })
4395
+ };
4396
+ }
4281
4397
  const NO_ISSUES = [];
4282
4398
  const WIDE_QUERY = "(min-width: 768px)";
4283
4399
  function subscribeWide(onChange) {
@@ -4297,12 +4413,16 @@ function clock() {
4297
4413
  * inspector for the selected node and a run console, in resizable panels. On small screens
4298
4414
  * the panels stack.
4299
4415
  */
4300
- function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNodes, edges: initialEdges = builderEdges, palette = builderPalette, consoleEntries, defaultConsoleEntries = builderConsole, onConsoleChange, onConsoleClear, titleAs: TitleTag = "h2", height = 600, onRun, nodeTypes, onConnectEdge, onConnect: onConnected, isValidConnection, onConnectionRejected, validationIssues, mode = "edit", nodeStatus, onNodeSelect, className }) {
4416
+ function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNodes, edges: initialEdges = builderEdges, graph, onGraphChange, palette = builderPalette, consoleEntries, defaultConsoleEntries = builderConsole, onConsoleChange, onConsoleClear, titleAs: TitleTag = "h2", height = 600, onRun, nodeTypes, onConnectEdge, onConnect: onConnected, isValidConnection, onConnectionRejected, validationIssues, mode = "edit", nodeStatus, onNodeSelect, className }) {
4301
4417
  const runMode = mode === "run";
4302
4418
  const root = useRef(null);
4419
+ const flow = useRef(null);
4303
4420
  const wide = useIsWide();
4304
4421
  const panelAs = TitleTag === "h2" ? "h3" : TitleTag === "h3" ? "h4" : "h5";
4305
- const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange, onConnect: defaultConnect } = useFlowState(initialNodes, initialEdges);
4422
+ const { nodes, edges, setNodes, setEdges, onNodesChange, onEdgesChange } = useBuilderGraph({
4423
+ nodes: initialNodes,
4424
+ edges: initialEdges
4425
+ }, graph);
4306
4426
  const [innerLog, setInnerLog] = useState(defaultConsoleEntries);
4307
4427
  const log = consoleEntries ?? innerLog;
4308
4428
  const latestLog = useRef(log);
@@ -4315,7 +4435,9 @@ function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNod
4315
4435
  const selected = nodes.find((n) => n.selected);
4316
4436
  const addNode = (item) => {
4317
4437
  seq.current += 1;
4318
- const id = `${item.kind}-${seq.current}`;
4438
+ let suffix = 1;
4439
+ while (nodes.some((node) => node.id === `${item.kind}-${suffix}`)) suffix += 1;
4440
+ const id = `${item.kind}-${suffix}`;
4319
4441
  const right = nodes.reduce((max, n) => Math.max(max, n.position.x), -256);
4320
4442
  const slim = item.kind === "trigger" || item.kind === "router";
4321
4443
  const node = {
@@ -4333,21 +4455,40 @@ function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNod
4333
4455
  subtitle: item.description
4334
4456
  }
4335
4457
  };
4336
- setNodes((ns) => [...ns.map((n) => n.selected ? {
4458
+ const next = [...nodes.map((n) => n.selected ? {
4337
4459
  ...n,
4338
4460
  selected: false
4339
- } : n), node]);
4461
+ } : n), node];
4462
+ setNodes(next);
4463
+ onGraphChange?.(cleanFlowGraph({
4464
+ nodes: next,
4465
+ edges
4466
+ }), {
4467
+ type: "add",
4468
+ nodeIds: [id],
4469
+ edgeIds: []
4470
+ });
4471
+ };
4472
+ const updateNode = (id, patch) => {
4473
+ const next = nodes.map((n) => n.id === id ? {
4474
+ ...n,
4475
+ data: {
4476
+ ...n.data,
4477
+ ...patch
4478
+ }
4479
+ } : n);
4480
+ setNodes(next);
4481
+ onGraphChange?.(cleanFlowGraph({
4482
+ nodes: next,
4483
+ edges
4484
+ }), {
4485
+ type: "update",
4486
+ nodeIds: [id],
4487
+ edgeIds: []
4488
+ });
4340
4489
  };
4341
- const updateNode = (id, patch) => setNodes((ns) => ns.map((n) => n.id === id ? {
4342
- ...n,
4343
- data: {
4344
- ...n.data,
4345
- ...patch
4346
- }
4347
- } : n));
4348
4490
  const deleteNode = (id) => {
4349
- setNodes((ns) => ns.filter((n) => n.id !== id));
4350
- setEdges((es) => es.filter((e) => e.source !== id && e.target !== id));
4491
+ flow.current?.deleteElements({ nodes: [{ id }] });
4351
4492
  };
4352
4493
  const commitLog = (next) => {
4353
4494
  latestLog.current = next;
@@ -4408,7 +4549,18 @@ function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNod
4408
4549
  onConsoleClear?.();
4409
4550
  commitLog([]);
4410
4551
  };
4411
- const connections = useConnections(nodes, setEdges, defaultConnect, {
4552
+ const connections = useConnections(nodes, edges, (edge) => {
4553
+ const next = [...edges, edge];
4554
+ setEdges(next);
4555
+ onGraphChange?.(cleanFlowGraph({
4556
+ nodes,
4557
+ edges: next
4558
+ }), {
4559
+ type: "connect",
4560
+ nodeIds: [],
4561
+ edgeIds: [edge.id]
4562
+ });
4563
+ }, {
4412
4564
  onConnect: onConnected,
4413
4565
  onConnectEdge,
4414
4566
  isValidConnection,
@@ -4429,7 +4581,46 @@ function FlowBuilder({ title = "Untitled flow", nodes: initialNodes = builderNod
4429
4581
  height: h,
4430
4582
  nodes: displayedNodes,
4431
4583
  edges,
4432
- onNodesChange: (changes) => onNodesChange(runMode ? changes.filter((change) => change.type === "select" || change.type === "dimensions") : changes),
4584
+ onInit: (instance) => {
4585
+ flow.current = instance;
4586
+ },
4587
+ onDelete: ({ nodes: deletedNodes, edges: deletedEdges }) => {
4588
+ if (runMode) return;
4589
+ const nodeIds = deletedNodes.map((node) => node.id);
4590
+ const edgeIds = deletedEdges.map((edge) => edge.id);
4591
+ const next = {
4592
+ nodes: nodes.filter((node) => !nodeIds.includes(node.id)),
4593
+ edges: edges.filter((edge) => !edgeIds.includes(edge.id))
4594
+ };
4595
+ setNodes(next.nodes);
4596
+ setEdges(next.edges);
4597
+ onGraphChange?.(cleanFlowGraph(next), {
4598
+ type: "delete",
4599
+ nodeIds,
4600
+ edgeIds
4601
+ });
4602
+ },
4603
+ onNodesChange: (changes) => {
4604
+ onNodesChange(runMode ? changes.filter((change) => change.type === "select" || change.type === "dimensions") : changes);
4605
+ if (runMode) return;
4606
+ const moves = changes.filter((change) => change.type === "position").filter((change) => change.dragging === false);
4607
+ if (!moves.length) return;
4608
+ const next = nodes.map((node) => {
4609
+ const move = moves.find((change) => change.id === node.id);
4610
+ return move?.type === "position" && move.position ? {
4611
+ ...node,
4612
+ position: move.position
4613
+ } : node;
4614
+ });
4615
+ onGraphChange?.(cleanFlowGraph({
4616
+ nodes: next,
4617
+ edges
4618
+ }), {
4619
+ type: "move",
4620
+ nodeIds: moves.map((move) => move.id),
4621
+ edgeIds: []
4622
+ });
4623
+ },
4433
4624
  onEdgesChange: (changes) => onEdgesChange(runMode ? changes.filter((change) => change.type === "select") : changes),
4434
4625
  nodeRenderers: nodeTypes,
4435
4626
  showInteractiveControls: !runMode,
@@ -4578,7 +4769,7 @@ const meta$28 = {
4578
4769
  name: "Flow builder",
4579
4770
  family: "builders",
4580
4771
  status: "beta",
4581
- description: "Visual flow editor with optional nodeTypes for named handles (branch-arm, parallel and sequence examples), onConnectEdge for edge type/data mapping, isValidConnection and onConnectionRejected for rules, onConnect for accepted connections, validationIssues for node/flow problems, mode=\"run\" for a read-only canvas, nodeStatus for live badges, and onNodeSelect for pointer/keyboard selection. Optional nodeTypes registers kit-owned {type, handles:[{id,kind,position?,label?}], render, decorations?} definitions (no React Flow NodeProps). Keep nodeTypes and its renderer definitions stable (module scope or useMemo) across nodeStatus updates: recreating the array rebuilds custom node components and remounts them, defeating per-node memoization. onConnectEdge({source,target,sourceType,targetType,sourceHandle,targetHandle}) returns {type,data}; examples/extensions.tsx maps branch arm-0 to {kind: \"branch-arm\", armIndex: 0}, parallel branch to {kind: \"parallel\"}, and sequence next to {kind: \"sequence\"}. isValidConnection returns true, false, or {code,nodeId?,message}; onConnectionRejected reports {code,nodeId,message} once (nodeId defaults to the source) so consumers can forward it into validationIssues and control its lifetime, while onConnect reports accepted connections only. validationIssues decorates nodes with an icon and accessible text; node issues select and focus their node, and flow issues have no node link. mode=\"run\" removes the Run action, palette, inspector and graph mutation while keeping labelled keyboard-selectable nodes, pan/zoom, fit controls and the wide-screen minimap. nodeStatus maps node IDs to FlowTone badges (running, degraded, failed, paused, done, handoff, review); onNodeSelect(id) handles pointer and keyboard selection. RunFlowExample shows live updates with per-node memoization. FlowNode defaults to the built-in FlowNodeKind union; use FlowNode<string> (or a custom kind union) for custom graphs, inferred by FlowBuilder and WorkflowBuilderPage. Custom renderers use kit status overlays and issue decorations by default; set decorations:\"consumer\" when render owns them, using data.decoration with accessible text and icons (for example, render:({data}) => <NodeCard title={data.title} tone={data.decoration?.status} />). FlowCanvas showInteractiveControls=false retains zoom/fit without the editing toggle. Named handles are keyboard controls: Enter or Space starts or completes a connection in edit mode; handles are disabled in run mode.",
4772
+ description: "FlowGraph<Kind> is {nodes,edges}; FlowGraphChange names the edit type and affected nodeIds/edgeIds. Optional onGraphChange(graph, change) reports each committed add, delete, move, connect or inspector update once, omitting selected, dragging and measured from nodes. Inspector updates report every value change: hosts persisting every call should debounce. Selection, measurement, panel resizing, rejected connections and run mode report nothing. Optional graph controls content: render the parent graph without applying edits locally, while selection, measured sizes and active drag positions stay internal by stable node id. nodes/edges remain initial values when uncontrolled. onRun keeps the canvas node objects. builderNodes and builderEdges expose the shared starter graph; cleanFlowGraph(graph) returns a graph without transient node fields for persistence. examples/ControlledGraph.tsx shows graph={graph} onGraphChange={setGraph}. Palette ids skip existing kind-n ids. Visual flow editor with optional nodeTypes for named handles (branch-arm, parallel and sequence examples), onConnectEdge for edge type/data mapping, isValidConnection and onConnectionRejected for rules, onConnect for accepted connections, validationIssues for node/flow problems, mode=\"run\" for a read-only canvas, nodeStatus for live badges, and onNodeSelect for pointer/keyboard selection. Optional nodeTypes registers kit-owned {type, handles:[{id,kind,position?,label?}], render, decorations?} definitions (no React Flow NodeProps). Keep nodeTypes and its renderer definitions stable (module scope or useMemo) across nodeStatus updates: recreating the array rebuilds custom node components and remounts them, defeating per-node memoization. onConnectEdge({source,target,sourceType,targetType,sourceHandle,targetHandle}) returns {type,data}; examples/extensions.tsx maps branch arm-0 to {kind: \"branch-arm\", armIndex: 0}, parallel branch to {kind: \"parallel\"}, and sequence next to {kind: \"sequence\"}. isValidConnection returns true, false, or {code,nodeId?,message}; onConnectionRejected reports {code,nodeId,message} once (nodeId defaults to the source) so consumers can forward it into validationIssues and control its lifetime, while onConnect reports accepted connections only. validationIssues decorates nodes with an icon and accessible text; node issues select and focus their node, and flow issues have no node link. mode=\"run\" removes the Run action, palette, inspector and graph mutation while keeping labelled keyboard-selectable nodes, pan/zoom, fit controls and the wide-screen minimap. nodeStatus maps node IDs to FlowTone badges (running, degraded, failed, paused, done, handoff, review); onNodeSelect(id) handles pointer and keyboard selection. RunFlowExample shows live updates with per-node memoization. FlowNode defaults to the built-in FlowNodeKind union; use FlowNode<string> (or a custom kind union) for custom graphs, inferred by FlowBuilder and WorkflowBuilderPage. Custom renderers use kit status overlays and issue decorations by default; set decorations:\"consumer\" when render owns them, using data.decoration with accessible text and icons (for example, render:({data}) => <NodeCard title={data.title} tone={data.decoration?.status} />). FlowCanvas showInteractiveControls=false retains zoom/fit without the editing toggle. Named handles are keyboard controls: Enter or Space starts or completes a connection in edit mode; handles are disabled in run mode.",
4582
4773
  uses: [
4583
4774
  "FlowCanvas",
4584
4775
  "useFlowState",
@@ -5081,7 +5272,7 @@ const MESSAGES = [
5081
5272
  "job 91ab completed in 3.4s"
5082
5273
  ]
5083
5274
  ];
5084
- function pad$2(n, width = 2) {
5275
+ function pad$1(n, width = 2) {
5085
5276
  return String(n).padStart(width, "0");
5086
5277
  }
5087
5278
  /** Deterministic sample stream of `count` lines (neutral service logs). */
@@ -5095,7 +5286,7 @@ function makeLogLines(count = 480, startSecond = 43200) {
5095
5286
  const ms = Math.floor(t % 1 * 1e3);
5096
5287
  return {
5097
5288
  id: `log-${i}`,
5098
- timestamp: `${pad$2(h)}:${pad$2(m)}:${pad$2(s)}.${pad$2(ms, 3)}`,
5289
+ timestamp: `${pad$1(h)}:${pad$1(m)}:${pad$1(s)}.${pad$1(ms, 3)}`,
5099
5290
  level: entry[0],
5100
5291
  source: entry[1],
5101
5292
  message: entry[2]
@@ -5130,23 +5321,18 @@ const LEVEL_STYLE = {
5130
5321
  }
5131
5322
  };
5132
5323
  /** Wraps case-insensitive matches of `query` in <mark>. */
5133
- function highlight(text, query) {
5134
- if (!query) return text;
5135
- const lower = text.toLowerCase();
5136
- const q = query.toLowerCase();
5324
+ function highlight(text, query, locale) {
5137
5325
  const parts = [];
5138
5326
  let from = 0;
5139
- let at = lower.indexOf(q, from);
5140
- while (at !== -1) {
5141
- if (at > from) parts.push(text.slice(from, at));
5327
+ for (const [start, end] of matchRanges(text, query, { locale })) {
5328
+ parts.push(text.slice(from, start));
5142
5329
  parts.push(/* @__PURE__ */ jsx("mark", {
5143
5330
  className: "rounded-sm bg-warning/30 text-foreground",
5144
- children: text.slice(at, at + q.length)
5145
- }, at));
5146
- from = at + q.length;
5147
- at = lower.indexOf(q, from);
5331
+ children: text.slice(start, end)
5332
+ }, start));
5333
+ from = end;
5148
5334
  }
5149
- if (from < text.length) parts.push(text.slice(from));
5335
+ parts.push(text.slice(from));
5150
5336
  return parts;
5151
5337
  }
5152
5338
  function lineText(line) {
@@ -5157,7 +5343,9 @@ function lineText(line) {
5157
5343
  * so it stays fast with thousands of lines. Level filter, search with highlighted matches,
5158
5344
  * follow-tail and per-line copy.
5159
5345
  */
5160
- function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight = 24, overscan = 8, defaultLevels = LOG_LEVELS, defaultFollow = true, onCopyLine, onSelectLine, selectedLineId, announceLines = true, titleAs: TitleTag = "h3", className }) {
5346
+ function LogViewer({ lines = logLines, title: titleProp, labels, height = 360, rowHeight = 24, overscan = 8, defaultLevels = LOG_LEVELS, defaultFollow = true, onCopyLine, onSelectLine, selectedLineId, announceLines = true, titleAs: TitleTag = "h3", className }) {
5347
+ const { locale, t } = useI18n();
5348
+ const title = titleProp ?? labels?.title ?? t("logViewer.title");
5161
5349
  const titleId = useId();
5162
5350
  const viewport = useRef(null);
5163
5351
  const copyTimer = useRef(void 0);
@@ -5176,13 +5364,19 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5176
5364
  for (const l of lines) c[l.level] += 1;
5177
5365
  return c;
5178
5366
  }, [lines]);
5367
+ const foldedLines = useMemo(() => lines.map((line) => ({
5368
+ line,
5369
+ message: foldText(line.message, locale),
5370
+ source: foldText(line.source ?? "", locale)
5371
+ })), [lines, locale]);
5179
5372
  const visible = useMemo(() => {
5180
- const q = query.trim().toLowerCase();
5181
- return lines.filter((l) => levels.includes(l.level) && (!q || l.message.toLowerCase().includes(q) || (l.source ?? "").toLowerCase().includes(q)));
5373
+ const q = foldText(query.trim(), locale);
5374
+ return foldedLines.filter(({ line, message, source }) => levels.includes(line.level) && (!q || message.indexOf(q) !== -1 || source.indexOf(q) !== -1)).map(({ line }) => line);
5182
5375
  }, [
5183
- lines,
5376
+ foldedLines,
5184
5377
  levels,
5185
- query
5378
+ query,
5379
+ locale
5186
5380
  ]);
5187
5381
  const total = visible.length * rowHeight;
5188
5382
  const maxScroll = Math.max(0, total - height);
@@ -5217,19 +5411,18 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5217
5411
  id: titleId,
5218
5412
  className: "text-[13px] font-semibold text-foreground",
5219
5413
  children: title
5220
- }), /* @__PURE__ */ jsxs("span", {
5414
+ }), /* @__PURE__ */ jsx("span", {
5221
5415
  className: "font-mono text-[11px] text-muted-foreground",
5222
- children: [
5223
- visible.length,
5224
- " of ",
5225
- lines.length
5226
- ]
5416
+ children: labels?.count?.(visible.length, lines.length) ?? t("logViewer.count", {
5417
+ visible: visible.length,
5418
+ total: lines.length
5419
+ })
5227
5420
  })]
5228
5421
  }), /* @__PURE__ */ jsxs("div", {
5229
5422
  className: "flex flex-wrap items-center gap-2 lg:ms-auto",
5230
5423
  children: [
5231
5424
  /* @__PURE__ */ jsx(ToggleGroup, {
5232
- "aria-label": "Log levels",
5425
+ "aria-label": labels?.levelFilter ?? t("logViewer.levelFilter"),
5233
5426
  size: "sm",
5234
5427
  multiple: true,
5235
5428
  value: levels,
@@ -5245,8 +5438,8 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5245
5438
  /* @__PURE__ */ jsx(Input, {
5246
5439
  size: "sm",
5247
5440
  type: "search",
5248
- "aria-label": "Search logs",
5249
- placeholder: "Search…",
5441
+ "aria-label": labels?.searchLabel ?? t("logViewer.searchLabel"),
5442
+ placeholder: labels?.searchPlaceholder ?? t("logViewer.searchPlaceholder"),
5250
5443
  leadingIcon: Search,
5251
5444
  value: query,
5252
5445
  onValueChange: (v) => setQuery(String(v)),
@@ -5254,7 +5447,7 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5254
5447
  }),
5255
5448
  /* @__PURE__ */ jsx(Switch, {
5256
5449
  size: "sm",
5257
- label: "Follow",
5450
+ label: labels?.follow ?? t("logViewer.follow"),
5258
5451
  checked: follow,
5259
5452
  onCheckedChange: setFollow
5260
5453
  })
@@ -5271,7 +5464,7 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5271
5464
  style: { height },
5272
5465
  children: visible.length === 0 ? /* @__PURE__ */ jsx("p", {
5273
5466
  className: "px-4 py-6 text-center font-sans text-[13px] text-muted-foreground",
5274
- children: "No lines match the current filters."
5467
+ children: labels?.empty ?? t("logViewer.empty")
5275
5468
  }) : /* @__PURE__ */ jsx("div", {
5276
5469
  className: "relative w-full",
5277
5470
  style: { height: total },
@@ -5298,18 +5491,18 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5298
5491
  className: "hidden shrink-0 text-muted-foreground sm:inline",
5299
5492
  children: [
5300
5493
  "[",
5301
- highlight(line.source, query.trim()),
5494
+ highlight(line.source, query, locale),
5302
5495
  "]"
5303
5496
  ]
5304
5497
  }),
5305
5498
  /* @__PURE__ */ jsx("span", {
5306
5499
  className: "min-w-0 flex-1 truncate text-foreground",
5307
- children: highlight(line.message, query.trim())
5500
+ children: highlight(line.message, query, locale)
5308
5501
  }),
5309
5502
  onSelectLine && /* @__PURE__ */ jsx(IconButton, {
5310
5503
  size: "sm",
5311
5504
  icon: Eye,
5312
- label: `Inspect event ${line.timestamp}`,
5505
+ label: labels?.inspect?.(line.timestamp) ?? t("logViewer.inspect", { timestamp: line.timestamp }),
5313
5506
  "aria-pressed": line.id === selectedLineId,
5314
5507
  onClick: (event) => {
5315
5508
  event.stopPropagation();
@@ -5320,7 +5513,7 @@ function LogViewer({ lines = logLines, title = "Logs", height = 360, rowHeight =
5320
5513
  /* @__PURE__ */ jsx(IconButton, {
5321
5514
  size: "sm",
5322
5515
  icon: copied === line.id ? Check : Copy,
5323
- label: copied === line.id ? "Copied" : `Copy line ${line.timestamp}`,
5516
+ label: copied === line.id ? labels?.copied ?? t("common.copied") : labels?.copy?.(line.timestamp) ?? t("logViewer.copy", { timestamp: line.timestamp }),
5324
5517
  onClick: (event) => {
5325
5518
  if (onSelectLine) event.stopPropagation();
5326
5519
  copy(line);
@@ -5340,7 +5533,59 @@ const meta$39 = {
5340
5533
  name: "Log viewer",
5341
5534
  family: "builders",
5342
5535
  status: "beta",
5343
- description: "Windowed log stream (role=\"log\"): level filter, search with highlighted matches, follow-tail and per-line copy. Renders only the visible rows.",
5536
+ description: "Windowed log stream (role=\"log\"): level filter, search with highlighted matches, follow-tail and per-line copy. Renders only the visible rows. Optional labels?: Partial<LogViewerLabels> overrides each built-in label. Explicit content props win over labels, then I18nProvider (en/es); no provider keeps English. Imported fixtures and machine data stay unchanged. See the Catalog labels live preview.",
5537
+ labels: [
5538
+ {
5539
+ key: "title",
5540
+ type: "string",
5541
+ state: "Visible heading and log region name; title prop wins"
5542
+ },
5543
+ {
5544
+ key: "levelFilter",
5545
+ type: "string",
5546
+ state: "Level filter group name"
5547
+ },
5548
+ {
5549
+ key: "searchLabel",
5550
+ type: "string",
5551
+ state: "Searchbox name"
5552
+ },
5553
+ {
5554
+ key: "searchPlaceholder",
5555
+ type: "string",
5556
+ state: "Searchbox placeholder"
5557
+ },
5558
+ {
5559
+ key: "follow",
5560
+ type: "string",
5561
+ state: "Follow switch name"
5562
+ },
5563
+ {
5564
+ key: "count",
5565
+ type: "(visible: number, total: number) => string",
5566
+ state: "Filtered line count"
5567
+ },
5568
+ {
5569
+ key: "empty",
5570
+ type: "string",
5571
+ state: "No matching lines"
5572
+ },
5573
+ {
5574
+ key: "inspect",
5575
+ type: "(timestamp: string) => string",
5576
+ state: "Inspect button name when onSelectLine exists"
5577
+ },
5578
+ {
5579
+ key: "copy",
5580
+ type: "(timestamp: string) => string",
5581
+ state: "Copy button before copying"
5582
+ },
5583
+ {
5584
+ key: "copied",
5585
+ type: "string",
5586
+ state: "Copy button after copying"
5587
+ }
5588
+ ],
5344
5589
  uses: [
5345
5590
  "ToggleGroup",
5346
5591
  "Toggle",
@@ -5936,78 +6181,82 @@ function ChartCard({ title = "Infrastructure cost", description = "Spend by reso
5936
6181
  "aria-label": chartLabel,
5937
6182
  ...states
5938
6183
  };
5939
- return /* @__PURE__ */ jsxs(Card, {
5940
- className,
5941
- children: [
5942
- /* @__PURE__ */ jsxs(CardHeader, {
5943
- className: "pb-2",
5944
- children: [
5945
- /* @__PURE__ */ jsx(CardTitle, {
5946
- as: titleAs,
5947
- children: title
5948
- }),
5949
- description && /* @__PURE__ */ jsx(CardDescription, { children: description }),
5950
- /* @__PURE__ */ jsxs(CardAction, {
5951
- className: "flex items-center gap-2",
5952
- children: [showRangeToggle && ranges.length > 1 && /* @__PURE__ */ jsx(ToggleGroup, {
5953
- "aria-label": `${title} range`,
5954
- size: "sm",
5955
- value: active ? [active.value] : [],
5956
- onFocus: (event) => {
5957
- if (!tabEntry.current) return;
5958
- if (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) return;
5959
- event.currentTarget.querySelector("[aria-pressed=\"true\"]")?.focus();
5960
- },
5961
- onValueChange: (v) => {
5962
- const next = v[0];
5963
- if (!next) return;
5964
- if (rangeProp === void 0) setInner(next);
5965
- onRangeChange?.(next);
5966
- },
5967
- children: ranges.map((r) => /* @__PURE__ */ jsx(Toggle, {
5968
- value: r.value,
5969
- className: "font-mono",
5970
- children: r.label
5971
- }, r.value))
5972
- }), action]
6184
+ const { locale } = useI18n();
6185
+ return /* @__PURE__ */ jsx(ChartLocaleProvider, {
6186
+ locale,
6187
+ children: /* @__PURE__ */ jsxs(Card, {
6188
+ className,
6189
+ children: [
6190
+ /* @__PURE__ */ jsxs(CardHeader, {
6191
+ className: "pb-2",
6192
+ children: [
6193
+ /* @__PURE__ */ jsx(CardTitle, {
6194
+ as: titleAs,
6195
+ children: title
6196
+ }),
6197
+ description && /* @__PURE__ */ jsx(CardDescription, { children: description }),
6198
+ /* @__PURE__ */ jsxs(CardAction, {
6199
+ className: "flex items-center gap-2",
6200
+ children: [showRangeToggle && ranges.length > 1 && /* @__PURE__ */ jsx(ToggleGroup, {
6201
+ "aria-label": `${title} range`,
6202
+ size: "sm",
6203
+ value: active ? [active.value] : [],
6204
+ onFocus: (event) => {
6205
+ if (!tabEntry.current) return;
6206
+ if (event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget)) return;
6207
+ event.currentTarget.querySelector("[aria-pressed=\"true\"]")?.focus();
6208
+ },
6209
+ onValueChange: (v) => {
6210
+ const next = v[0];
6211
+ if (!next) return;
6212
+ if (rangeProp === void 0) setInner(next);
6213
+ onRangeChange?.(next);
6214
+ },
6215
+ children: ranges.map((r) => /* @__PURE__ */ jsx(Toggle, {
6216
+ value: r.value,
6217
+ className: "font-mono",
6218
+ children: r.label
6219
+ }, r.value))
6220
+ }), action]
6221
+ })
6222
+ ]
6223
+ }),
6224
+ active?.summary && /* @__PURE__ */ jsxs("p", {
6225
+ className: "flex flex-wrap items-baseline gap-x-2 px-5",
6226
+ "aria-live": "polite",
6227
+ children: [/* @__PURE__ */ jsx("span", {
6228
+ className: "text-[24px] font-semibold tracking-tight text-foreground tabular-nums",
6229
+ children: active.summary.value
6230
+ }), active.summary.delta && /* @__PURE__ */ jsx(TrendDelta, { ...active.summary.delta })]
6231
+ }),
6232
+ /* @__PURE__ */ jsx("div", {
6233
+ className: cn("px-3 pb-4 pt-3 sm:px-4", !footer && "pb-5"),
6234
+ children: kind === "heatmap" ? /* @__PURE__ */ jsx(Heatmap, {
6235
+ data,
6236
+ index,
6237
+ categories,
6238
+ color: colors[0] ?? "primary",
6239
+ valueFormatter,
6240
+ showScale: showLegend,
6241
+ height,
6242
+ "aria-label": chartLabel,
6243
+ ...heatmap,
6244
+ ...states,
6245
+ dataTable: dataTable ?? true
6246
+ }) : kind === "bar" ? /* @__PURE__ */ jsx(BarChart, {
6247
+ ...common,
6248
+ stacked
6249
+ }) : kind === "line" ? /* @__PURE__ */ jsx(LineChart, { ...common }) : /* @__PURE__ */ jsx(AreaChart, {
6250
+ ...common,
6251
+ stacked
5973
6252
  })
5974
- ]
5975
- }),
5976
- active?.summary && /* @__PURE__ */ jsxs("p", {
5977
- className: "flex flex-wrap items-baseline gap-x-2 px-5",
5978
- "aria-live": "polite",
5979
- children: [/* @__PURE__ */ jsx("span", {
5980
- className: "text-[24px] font-semibold tracking-tight text-foreground tabular-nums",
5981
- children: active.summary.value
5982
- }), active.summary.delta && /* @__PURE__ */ jsx(TrendDelta, { ...active.summary.delta })]
5983
- }),
5984
- /* @__PURE__ */ jsx("div", {
5985
- className: cn("px-3 pb-4 pt-3 sm:px-4", !footer && "pb-5"),
5986
- children: kind === "heatmap" ? /* @__PURE__ */ jsx(Heatmap, {
5987
- data,
5988
- index,
5989
- categories,
5990
- color: colors[0] ?? "primary",
5991
- valueFormatter,
5992
- showScale: showLegend,
5993
- height,
5994
- "aria-label": chartLabel,
5995
- ...heatmap,
5996
- ...states,
5997
- dataTable: dataTable ?? true
5998
- }) : kind === "bar" ? /* @__PURE__ */ jsx(BarChart, {
5999
- ...common,
6000
- stacked
6001
- }) : kind === "line" ? /* @__PURE__ */ jsx(LineChart, { ...common }) : /* @__PURE__ */ jsx(AreaChart, {
6002
- ...common,
6003
- stacked
6253
+ }),
6254
+ footer && /* @__PURE__ */ jsx("div", {
6255
+ className: "border-t border-border px-5 py-3 text-[12.5px] text-muted-foreground",
6256
+ children: footer
6004
6257
  })
6005
- }),
6006
- footer && /* @__PURE__ */ jsx("div", {
6007
- className: "border-t border-border px-5 py-3 text-[12.5px] text-muted-foreground",
6008
- children: footer
6009
- })
6010
- ]
6258
+ ]
6259
+ })
6011
6260
  });
6012
6261
  }
6013
6262
  //#endregion
@@ -6016,7 +6265,7 @@ const meta$6 = {
6016
6265
  name: "Chart card",
6017
6266
  family: "data-display",
6018
6267
  status: "beta",
6019
- description: "A Card with chart and legend: default 7d/30d/90d or custom ranges via ranges, controlled range/onRangeChange, and showRangeToggle={false} when a toolbar owns the range (pass its window as range). Supports title, optional headline and delta, area/line/bar/heatmap charts, and loading, empty and error states. Supply matching dataByRange keys and use defaultRange for initial uncontrolled selection; the toolbar is the only range control when the toggle is hidden. Unknown range/defaultRange keys fall back to the first option for selection, data and label, with a development-only warning.",
6268
+ description: "A Card with chart and legend: default 7d/30d/90d or custom ranges via ranges, controlled range/onRangeChange, and showRangeToggle={false} when a toolbar owns the range (pass its window as range). Supports title, optional headline and delta, area/line/bar/heatmap charts, and loading, empty and error states. Supply matching dataByRange keys and use defaultRange for initial uncontrolled selection; the toolbar is the only range control when the toggle is hidden. Unknown range/defaultRange keys fall back to the first option for selection, data and label, with a development-only warning. Chart states follow the kit I18nProvider locale automatically through ChartLocaleProvider; standalone charts need their own ChartLocaleProvider (en/es, per-key labels overrides). Number/date formatting stays caller-controlled.",
6020
6269
  uses: [
6021
6270
  "Card",
6022
6271
  "ToggleGroup",
@@ -6075,7 +6324,8 @@ const DEPLOYMENT_DETAILS = [
6075
6324
  ];
6076
6325
  //#endregion
6077
6326
  //#region src/data-display/DescriptionListCard/DescriptionListCard.tsx
6078
- function CopyButton$1({ item, onCopy }) {
6327
+ function CopyButton$1({ item, onCopy, labels }) {
6328
+ const { t } = useI18n();
6079
6329
  const [copied, setCopied] = useState(false);
6080
6330
  const timer = useRef(void 0);
6081
6331
  useEffect(() => () => window.clearTimeout(timer.current), []);
@@ -6091,7 +6341,7 @@ function CopyButton$1({ item, onCopy }) {
6091
6341
  };
6092
6342
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(IconButton, {
6093
6343
  icon: copied ? Check : Copy,
6094
- label: copied ? `${item.label} copied` : `Copy ${item.label}`,
6344
+ label: copied ? labels?.copied?.(item.label) ?? t("descriptionList.copied", { label: item.label }) : labels?.copy?.(item.label) ?? t("descriptionList.copy", { label: item.label }),
6095
6345
  size: "sm",
6096
6346
  variant: "ghost",
6097
6347
  className: cn("size-7 shrink-0", copied && "text-success-text"),
@@ -6099,11 +6349,15 @@ function CopyButton$1({ item, onCopy }) {
6099
6349
  }), /* @__PURE__ */ jsx("span", {
6100
6350
  className: "sr-only",
6101
6351
  "aria-live": "polite",
6102
- children: copied ? "Copied to clipboard" : ""
6352
+ children: copied ? labels?.copiedToClipboard ?? t("common.copiedToClipboard") : ""
6103
6353
  })] });
6104
6354
  }
6105
6355
  /** Key–value detail card: label column, values (mono, status or rich), copy buttons and an Edit action. */
6106
- function DescriptionListCard({ title = "Configuration", description = "Settings of this deployment.", items = DEPLOYMENT_DETAILS, onEdit, editLabel = "Edit", onCopy, titleAs = "h3", className }) {
6356
+ function DescriptionListCard({ title: titleProp, labels, description: descriptionProp, items = DEPLOYMENT_DETAILS, onEdit, editLabel: editLabelProp, onCopy, titleAs = "h3", className }) {
6357
+ const { t } = useI18n();
6358
+ const title = titleProp ?? labels?.title ?? t("descriptionList.title");
6359
+ const description = descriptionProp ?? labels?.description ?? t("descriptionList.description");
6360
+ const editLabel = editLabelProp ?? labels?.edit ?? t("descriptionList.edit");
6107
6361
  return /* @__PURE__ */ jsxs(Card, {
6108
6362
  className,
6109
6363
  children: [/* @__PURE__ */ jsxs(CardHeader, {
@@ -6136,7 +6390,8 @@ function DescriptionListCard({ title = "Configuration", description = "Settings
6136
6390
  children: item.render ?? item.value
6137
6391
  }), item.copyable && /* @__PURE__ */ jsx(CopyButton$1, {
6138
6392
  item,
6139
- onCopy
6393
+ onCopy,
6394
+ labels
6140
6395
  })]
6141
6396
  })]
6142
6397
  }, item.id))
@@ -6149,7 +6404,39 @@ const meta$18 = {
6149
6404
  name: "Description list card",
6150
6405
  family: "data-display",
6151
6406
  status: "beta",
6152
- description: "Key–value detail card with mono, status and rich values, copy-to-clipboard buttons and an Edit action.",
6407
+ description: "Key–value detail card with mono, status and rich values, copy-to-clipboard buttons and an Edit action. Optional labels?: Partial<DescriptionListCardLabels> overrides each built-in label. Explicit content props win over labels, then I18nProvider (en/es); no provider keeps English. Imported fixtures and machine data stay unchanged. See the Catalog labels live preview.",
6408
+ labels: [
6409
+ {
6410
+ key: "title",
6411
+ type: "string",
6412
+ state: "Card heading; title prop wins"
6413
+ },
6414
+ {
6415
+ key: "description",
6416
+ type: "string",
6417
+ state: "Card description; description prop wins"
6418
+ },
6419
+ {
6420
+ key: "edit",
6421
+ type: "string",
6422
+ state: "Edit button; editLabel prop wins"
6423
+ },
6424
+ {
6425
+ key: "copy",
6426
+ type: "(label: string) => string",
6427
+ state: "Copy button name; original item label"
6428
+ },
6429
+ {
6430
+ key: "copied",
6431
+ type: "(label: string) => string",
6432
+ state: "Copy button name after copying; original item label"
6433
+ },
6434
+ {
6435
+ key: "copiedToClipboard",
6436
+ type: "string",
6437
+ state: "Polite copy announcement"
6438
+ }
6439
+ ],
6153
6440
  uses: [
6154
6441
  "Card",
6155
6442
  "Button",
@@ -6913,15 +7200,18 @@ const meta$70 = {
6913
7200
  };
6914
7201
  //#endregion
6915
7202
  //#region src/feedback/InlineCallout/InlineCallout.tsx
6916
- const inlineCalloutDefaultActions = [{
6917
- label: "Upgrade plan",
6918
- variant: "secondary"
6919
- }, {
6920
- label: "View usage",
6921
- href: "#usage"
6922
- }];
6923
7203
  /** In-content callout built on Alert: tone, title, body and a row of actions. */
6924
- function InlineCallout({ tone = "warning", title = "You have used 92% of your build minutes", description = "Builds will queue once the monthly limit is reached. Upgrade the plan or reduce concurrent builds.", actions = inlineCalloutDefaultActions, icon, dismissible = false, open, onDismiss, className }) {
7204
+ function InlineCallout({ tone = "warning", title: titleProp, labels, description: descriptionProp, actions: actionsProp, icon, dismissible = false, open, onDismiss, className }) {
7205
+ const { t } = useI18n();
7206
+ const title = titleProp === void 0 ? labels?.title ?? t("callout.title") : titleProp;
7207
+ const description = descriptionProp === void 0 ? labels?.description ?? t("callout.description") : descriptionProp;
7208
+ const actions = actionsProp ?? [{
7209
+ label: labels?.upgrade ?? t("callout.upgrade"),
7210
+ variant: "secondary"
7211
+ }, {
7212
+ label: labels?.viewUsage ?? t("callout.viewUsage"),
7213
+ href: "#usage"
7214
+ }];
6925
7215
  const [dismissed, setDismissed] = useState(false);
6926
7216
  if (!(open ?? !dismissed)) return null;
6927
7217
  return /* @__PURE__ */ jsx(Alert, {
@@ -6954,7 +7244,29 @@ const meta$33 = {
6954
7244
  name: "Inline callout",
6955
7245
  family: "feedback",
6956
7246
  status: "beta",
6957
- description: "Alert-based in-content callout with a tone, title, body, action buttons or links and optional dismiss.",
7247
+ description: "Alert-based in-content callout with a tone, title, body, action buttons or links and optional dismiss. Optional labels?: Partial<InlineCalloutLabels> overrides each built-in label. Explicit content props win over labels, then I18nProvider (en/es); no provider keeps English. Imported fixtures and machine data stay unchanged. See the Catalog labels live preview.",
7248
+ labels: [
7249
+ {
7250
+ key: "title",
7251
+ type: "string",
7252
+ state: "Callout title; explicit title prop wins, including null"
7253
+ },
7254
+ {
7255
+ key: "description",
7256
+ type: "string",
7257
+ state: "Callout body; explicit description prop wins, including null"
7258
+ },
7259
+ {
7260
+ key: "upgrade",
7261
+ type: "string",
7262
+ state: "Default primary action; explicit actions win"
7263
+ },
7264
+ {
7265
+ key: "viewUsage",
7266
+ type: "string",
7267
+ state: "Default usage link; explicit actions win"
7268
+ }
7269
+ ],
6958
7270
  uses: [
6959
7271
  "Alert",
6960
7272
  "Button",
@@ -6997,10 +7309,15 @@ function NotFoundEmpty({ icon = SearchX, title = notFoundSample.title, descripti
6997
7309
  });
6998
7310
  }
6999
7311
  /** First-run state: nothing created yet; explains the value and offers the first action. */
7000
- function FirstRunEmpty({ icon = FolderPlus, title = "Create your first project", description = "Projects group your services, environments and deployments. Start one from a repository in a couple of minutes.", actionLabel = "New project", onAction, secondary = {
7001
- label: "Read the guide",
7002
- href: "#guide"
7003
- }, steps = firstRunSteps, titleAs, bordered = true, className }) {
7312
+ function FirstRunEmpty({ icon = FolderPlus, title: titleProp, labels, description: descriptionProp, actionLabel: actionLabelProp, onAction, secondary: secondaryProp, steps = firstRunSteps, titleAs, bordered = true, className }) {
7313
+ const { t } = useI18n();
7314
+ const title = titleProp === void 0 ? labels?.title ?? t("emptyState.firstRun.title") : titleProp;
7315
+ const description = descriptionProp === void 0 ? labels?.description ?? t("emptyState.firstRun.description") : descriptionProp;
7316
+ const actionLabel = actionLabelProp ?? labels?.action ?? t("emptyState.firstRun.action");
7317
+ const secondary = secondaryProp === void 0 ? {
7318
+ label: labels?.guide ?? t("emptyState.firstRun.guide"),
7319
+ href: "#guide"
7320
+ } : secondaryProp;
7004
7321
  return /* @__PURE__ */ jsx(EmptyState, {
7005
7322
  icon,
7006
7323
  title,
@@ -7031,41 +7348,40 @@ function FirstRunEmpty({ icon = FolderPlus, title = "Create your first project",
7031
7348
  });
7032
7349
  }
7033
7350
  /** No-results state for a filtered list or table: echoes the query and offers ways out. */
7034
- function NoResultsEmpty({ query = noResultsSample.query, filterCount = noResultsSample.filterCount, entity = noResultsSample.entity, onClearFilters, onClearSearch, titleAs, bordered = false, className }) {
7035
- const filters = filterCount > 0 ? ` with ${filterCount} ${filterCount === 1 ? "filter" : "filters"} applied` : "";
7351
+ function NoResultsEmpty({ query = noResultsSample.query, labels, filterCount = noResultsSample.filterCount, entity = noResultsSample.entity, onClearFilters, onClearSearch, titleAs, bordered = false, className }) {
7352
+ const { t } = useI18n();
7036
7353
  return /* @__PURE__ */ jsx(EmptyState, {
7037
7354
  icon: SearchX,
7038
7355
  size: "sm",
7039
7356
  titleAs,
7040
7357
  bordered,
7041
7358
  className: cn("mx-auto", className),
7042
- title: query ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
7043
- "No ",
7044
- entity,
7045
- " match “",
7359
+ title: query ? labels?.queryTitle?.(entity, query) ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
7360
+ t("emptyState.noResults.queryTitleBefore", { entity }),
7046
7361
  /* @__PURE__ */ jsx("span", {
7047
7362
  className: "font-mono",
7048
7363
  children: query
7049
7364
  }),
7050
- "”"
7051
- ] }) : `No ${entity} found`,
7052
- description: `Check the spelling or try a broader search${filters}.`,
7365
+ t("emptyState.noResults.queryTitleAfter")
7366
+ ] }) : labels?.title?.(entity) ?? t("emptyState.noResults.title", { entity }),
7367
+ description: labels?.description?.(filterCount) ?? t("emptyState.noResults.description", { count: filterCount > 0 ? filterCount : 0 }),
7053
7368
  primaryAction: filterCount > 0 ? /* @__PURE__ */ jsx(Button, {
7054
7369
  variant: "secondary",
7055
7370
  size: "sm",
7056
7371
  onClick: onClearFilters,
7057
- children: "Clear filters"
7372
+ children: labels?.clearFilters ?? t("emptyState.noResults.clearFilters")
7058
7373
  }) : void 0,
7059
7374
  secondaryAction: query ? /* @__PURE__ */ jsx(Button, {
7060
7375
  variant: "ghost",
7061
7376
  size: "sm",
7062
7377
  onClick: onClearSearch,
7063
- children: "Clear search"
7378
+ children: labels?.clearSearch ?? t("emptyState.noResults.clearSearch")
7064
7379
  }) : void 0
7065
7380
  });
7066
7381
  }
7067
7382
  /** Permission state: the viewer lacks access; explains who can grant it and lets them ask. */
7068
- function NoAccessEmpty({ resource = noAccessSample.resource, owner = noAccessSample.owner, onRequestAccess, defaultRequested = false, titleAs, bordered = true, className }) {
7383
+ function NoAccessEmpty({ resource = noAccessSample.resource, labels, owner = noAccessSample.owner, onRequestAccess, defaultRequested = false, titleAs, bordered = true, className }) {
7384
+ const { t } = useI18n();
7069
7385
  const [state, setState] = useState(defaultRequested ? "requested" : "idle");
7070
7386
  const request = async () => {
7071
7387
  setState("pending");
@@ -7081,20 +7397,23 @@ function NoAccessEmpty({ resource = noAccessSample.resource, owner = noAccessSam
7081
7397
  titleAs,
7082
7398
  bordered,
7083
7399
  className: cn("mx-auto", className),
7084
- title: `You don’t have access to ${resource}`,
7085
- description: `Ask ${owner} to grant you a role that includes ${resource.toLowerCase()} permissions.`,
7400
+ title: labels?.title?.(resource) ?? t("emptyState.noAccess.title", { resource }),
7401
+ description: labels?.description?.(resource, owner) ?? t("emptyState.noAccess.description", {
7402
+ resource: resource.toLowerCase(),
7403
+ owner
7404
+ }),
7086
7405
  primaryAction: /* @__PURE__ */ jsx(Button, {
7087
7406
  variant: state === "requested" ? "secondary" : "primary",
7088
7407
  icon: state === "requested" ? Check : void 0,
7089
7408
  loading: state === "pending",
7090
7409
  disabled: state === "requested",
7091
7410
  onClick: () => void request(),
7092
- children: state === "requested" ? "Access requested" : "Request access"
7411
+ children: state === "requested" ? labels?.requested ?? t("emptyState.noAccess.requested") : labels?.request ?? t("emptyState.noAccess.request")
7093
7412
  }),
7094
7413
  children: /* @__PURE__ */ jsx("p", {
7095
7414
  role: "status",
7096
7415
  className: "sr-only",
7097
- children: state === "requested" ? "Access request sent" : ""
7416
+ children: state === "requested" ? labels?.sent ?? t("emptyState.noAccess.sent") : ""
7098
7417
  })
7099
7418
  });
7100
7419
  }
@@ -7104,7 +7423,79 @@ const meta$20 = {
7104
7423
  name: "Empty states",
7105
7424
  family: "feedback",
7106
7425
  status: "beta",
7107
- description: "Four canonical empty states: first run (with checklist), no results (clear filters/search), no access (request access) and not found (optional action).",
7426
+ description: "Four canonical empty states: first run (with checklist), no results (clear filters/search), no access (request access) and not found (optional action). FirstRunEmpty, NoResultsEmpty and NoAccessEmpty accept labels?: Partial<FirstRunEmptyLabels>, Partial<NoResultsEmptyLabels> and Partial<NoAccessEmptyLabels> respectively. Each type has its own keys below; explicit title, description, actionLabel and secondary props win. Defaults follow I18nProvider (en/es). NoResultsEmpty keeps the query in a mono span unless queryTitle replaces the heading. NotFoundEmpty and all imported fixtures stay English. See the Catalog labels live preview.",
7427
+ labels: [
7428
+ {
7429
+ key: "FirstRunEmpty.labels.title",
7430
+ type: "string",
7431
+ state: "FirstRunEmpty: per-key override; formatters receive original data. Explicit props win."
7432
+ },
7433
+ {
7434
+ key: "FirstRunEmpty.labels.description",
7435
+ type: "string",
7436
+ state: "FirstRunEmpty: per-key override; formatters receive original data. Explicit props win."
7437
+ },
7438
+ {
7439
+ key: "FirstRunEmpty.labels.action",
7440
+ type: "string",
7441
+ state: "FirstRunEmpty: per-key override; formatters receive original data. Explicit props win."
7442
+ },
7443
+ {
7444
+ key: "FirstRunEmpty.labels.guide",
7445
+ type: "string",
7446
+ state: "FirstRunEmpty: per-key override; formatters receive original data. Explicit props win."
7447
+ },
7448
+ {
7449
+ key: "NoResultsEmpty.labels.queryTitle",
7450
+ type: "(entity: string, query: string) => string",
7451
+ state: "NoResultsEmpty: per-key override; formatters receive original data. Explicit props win."
7452
+ },
7453
+ {
7454
+ key: "NoResultsEmpty.labels.title",
7455
+ type: "(entity: string) => string",
7456
+ state: "NoResultsEmpty: per-key override; formatters receive original data. Explicit props win."
7457
+ },
7458
+ {
7459
+ key: "NoResultsEmpty.labels.description",
7460
+ type: "(filterCount: number) => string",
7461
+ state: "NoResultsEmpty: per-key override; formatters receive original data. Explicit props win."
7462
+ },
7463
+ {
7464
+ key: "NoResultsEmpty.labels.clearFilters",
7465
+ type: "string",
7466
+ state: "NoResultsEmpty: per-key override; formatters receive original data. Explicit props win."
7467
+ },
7468
+ {
7469
+ key: "NoResultsEmpty.labels.clearSearch",
7470
+ type: "string",
7471
+ state: "NoResultsEmpty: per-key override; formatters receive original data. Explicit props win."
7472
+ },
7473
+ {
7474
+ key: "NoAccessEmpty.labels.title",
7475
+ type: "(resource: string) => string",
7476
+ state: "NoAccessEmpty: per-key override; formatters receive original data. Explicit props win."
7477
+ },
7478
+ {
7479
+ key: "NoAccessEmpty.labels.description",
7480
+ type: "(resource: string, owner: string) => string",
7481
+ state: "NoAccessEmpty: per-key override; formatters receive original data. Explicit props win."
7482
+ },
7483
+ {
7484
+ key: "NoAccessEmpty.labels.request",
7485
+ type: "string",
7486
+ state: "NoAccessEmpty: per-key override; formatters receive original data. Explicit props win."
7487
+ },
7488
+ {
7489
+ key: "NoAccessEmpty.labels.requested",
7490
+ type: "string",
7491
+ state: "NoAccessEmpty: per-key override; formatters receive original data. Explicit props win."
7492
+ },
7493
+ {
7494
+ key: "NoAccessEmpty.labels.sent",
7495
+ type: "string",
7496
+ state: "NoAccessEmpty: per-key override; formatters receive original data. Explicit props win."
7497
+ }
7498
+ ],
7108
7499
  uses: [
7109
7500
  "EmptyState",
7110
7501
  "Button",
@@ -7258,12 +7649,15 @@ const meta$63 = {
7258
7649
  //#endregion
7259
7650
  //#region src/feedback/ErrorPanel/ErrorPanel.tsx
7260
7651
  /** Error summary for a failed load or action: what happened, request id, retry and technical details. */
7261
- function ErrorPanel({ icon: Icon = ServerCrash, title = "We couldn’t load deployments", message = "The service didn’t respond in time. Your data is safe; try again in a moment.", code = 503, requestId = "req_8f2c41d07a9b", details = "GET /v1/projects/acme-web/deployments\n503 Service Unavailable\nupstream timed out after 30000 ms (pool: api-eu-west-1)", onRetry, retrying, retryLabel: retryLabelProp, secondaryAction = {
7262
- label: "Contact support",
7263
- variant: "ghost"
7264
- }, titleAs: Heading = "h3", className, announce = true }) {
7652
+ function ErrorPanel({ icon: Icon = ServerCrash, title: titleProp, labels, message: messageProp, code = 503, requestId = "req_8f2c41d07a9b", details = "GET /v1/projects/acme-web/deployments\n503 Service Unavailable\nupstream timed out after 30000 ms (pool: api-eu-west-1)", onRetry, retrying, retryLabel: retryLabelProp, secondaryAction: secondaryActionProp, titleAs: Heading = "h3", className, announce = true }) {
7265
7653
  const { t } = useI18n();
7266
- const retryLabel = retryLabelProp ?? t("error.retry");
7654
+ const title = titleProp === void 0 ? labels?.title ?? t("error.title") : titleProp;
7655
+ const message = messageProp === void 0 ? labels?.message ?? t("error.message") : messageProp;
7656
+ const secondaryAction = secondaryActionProp === void 0 ? {
7657
+ label: labels?.support ?? t("error.support"),
7658
+ variant: "ghost"
7659
+ } : secondaryActionProp;
7660
+ const retryLabel = retryLabelProp ?? labels?.retry ?? t("error.retry");
7267
7661
  const id = useId();
7268
7662
  const [innerRetrying, setInnerRetrying] = useState(false);
7269
7663
  const [copied, setCopied] = useState(false);
@@ -7321,14 +7715,14 @@ function ErrorPanel({ icon: Icon = ServerCrash, title = "We couldn’t load depl
7321
7715
  requestId && /* @__PURE__ */ jsxs("div", {
7322
7716
  className: "mt-3 flex items-center gap-1.5 text-[12px] text-muted-foreground",
7323
7717
  children: [
7324
- /* @__PURE__ */ jsx("span", { children: t("error.requestId") }),
7718
+ /* @__PURE__ */ jsx("span", { children: labels?.requestId ?? t("error.requestId") }),
7325
7719
  /* @__PURE__ */ jsx("code", {
7326
7720
  className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[11.5px] text-foreground",
7327
7721
  children: requestId
7328
7722
  }),
7329
7723
  /* @__PURE__ */ jsx(IconButton, {
7330
7724
  icon: copied ? Check : Copy,
7331
- label: copied ? t("common.copied") : t("error.copyRequestId"),
7725
+ label: copied ? labels?.copied ?? t("common.copied") : labels?.copyRequestId ?? t("error.copyRequestId"),
7332
7726
  size: "sm",
7333
7727
  variant: "ghost",
7334
7728
  className: "size-7",
@@ -7344,7 +7738,7 @@ function ErrorPanel({ icon: Icon = ServerCrash, title = "We couldn’t load depl
7344
7738
  icon: RotateCw,
7345
7739
  loading: busy,
7346
7740
  onClick: () => void retry(),
7347
- children: busy ? t("error.retrying") : retryLabel
7741
+ children: busy ? labels?.retrying ?? t("error.retrying") : retryLabel
7348
7742
  }), secondaryAction && /* @__PURE__ */ jsx(Button, {
7349
7743
  size: "sm",
7350
7744
  variant: secondaryAction.variant ?? "ghost",
@@ -7358,7 +7752,7 @@ function ErrorPanel({ icon: Icon = ServerCrash, title = "We couldn’t load depl
7358
7752
  className: "mt-4",
7359
7753
  children: [/* @__PURE__ */ jsx(CollapsibleTrigger, {
7360
7754
  className: "text-[12.5px]",
7361
- children: t("error.details")
7755
+ children: labels?.details ?? t("error.details")
7362
7756
  }), /* @__PURE__ */ jsx(CollapsiblePanel, { children: /* @__PURE__ */ jsx("pre", {
7363
7757
  className: "mt-2 max-h-60 overflow-auto rounded-md border border-border bg-muted/50 p-3 font-mono text-[11.5px] leading-5 whitespace-pre-wrap text-foreground",
7364
7758
  children: details
@@ -7367,7 +7761,7 @@ function ErrorPanel({ icon: Icon = ServerCrash, title = "We couldn’t load depl
7367
7761
  announce && /* @__PURE__ */ jsx("p", {
7368
7762
  role: "status",
7369
7763
  className: "sr-only",
7370
- children: busy ? t("error.retryingStatus") : copied ? t("error.requestIdCopied") : ""
7764
+ children: busy ? labels?.retryingStatus ?? t("error.retryingStatus") : copied ? labels?.requestIdCopied ?? t("error.requestIdCopied") : ""
7371
7765
  })
7372
7766
  ]
7373
7767
  })]
@@ -7643,7 +8037,64 @@ const meta$22 = {
7643
8037
  name: "Error panel",
7644
8038
  family: "feedback",
7645
8039
  status: "beta",
7646
- description: "Error summary with status code, copyable request id, retry with loading state and a technical-details disclosure.",
8040
+ description: "Error summary with status code, copyable request id, retry with loading state and a technical-details disclosure. Optional labels?: Partial<ErrorPanelLabels> overrides each built-in label. Explicit content props win over labels, then I18nProvider (en/es); no provider keeps English. Imported fixtures and machine data stay unchanged. See the Catalog labels live preview.",
8041
+ labels: [
8042
+ {
8043
+ key: "title",
8044
+ type: "string",
8045
+ state: "Panel heading; explicit title prop wins, including null"
8046
+ },
8047
+ {
8048
+ key: "message",
8049
+ type: "string",
8050
+ state: "Summary; explicit message prop wins, including null"
8051
+ },
8052
+ {
8053
+ key: "support",
8054
+ type: "string",
8055
+ state: "Default secondary action; explicit secondaryAction wins, including null"
8056
+ },
8057
+ {
8058
+ key: "retry",
8059
+ type: "string",
8060
+ state: "Retry button; retryLabel prop wins"
8061
+ },
8062
+ {
8063
+ key: "retrying",
8064
+ type: "string",
8065
+ state: "Busy retry button"
8066
+ },
8067
+ {
8068
+ key: "retryingStatus",
8069
+ type: "string",
8070
+ state: "Busy status announcement"
8071
+ },
8072
+ {
8073
+ key: "requestId",
8074
+ type: "string",
8075
+ state: "Request ID caption"
8076
+ },
8077
+ {
8078
+ key: "copyRequestId",
8079
+ type: "string",
8080
+ state: "Copy request ID button"
8081
+ },
8082
+ {
8083
+ key: "copied",
8084
+ type: "string",
8085
+ state: "Copy button after copying"
8086
+ },
8087
+ {
8088
+ key: "requestIdCopied",
8089
+ type: "string",
8090
+ state: "Copied status announcement"
8091
+ },
8092
+ {
8093
+ key: "details",
8094
+ type: "string",
8095
+ state: "Technical details disclosure"
8096
+ }
8097
+ ],
7647
8098
  uses: [
7648
8099
  "Button",
7649
8100
  "IconButton",
@@ -8431,22 +8882,6 @@ function simulateUpload(_file, onProgress) {
8431
8882
  setTimeout(step, 250);
8432
8883
  });
8433
8884
  }
8434
- function formatBytes(bytes) {
8435
- if (bytes < 1024) return `${bytes} B`;
8436
- const units = [
8437
- "KB",
8438
- "MB",
8439
- "GB",
8440
- "TB"
8441
- ];
8442
- let v = bytes / 1024;
8443
- let i = 0;
8444
- while (v >= 1024 && i < units.length - 1) {
8445
- v /= 1024;
8446
- i++;
8447
- }
8448
- return `${v >= 10 ? Math.round(v) : v.toFixed(1)} ${units[i]}`;
8449
- }
8450
8885
  /** Matches a file against an `accept` list (".csv", "image/*", "application/pdf"). */
8451
8886
  function acceptsFile(file, accept) {
8452
8887
  if (!accept) return true;
@@ -8462,8 +8897,8 @@ const nextId = () => `upload-${++uid}`;
8462
8897
  * Drop zone with a Browse button, accept and size validation, and a file list with progress,
8463
8898
  * retry and remove. Rejected files stay in the list with the reason.
8464
8899
  */
8465
- function FileUploadPanel({ accept = ".csv,.json,.jsonl,.yaml,.pdf", maxSize = 26214400, multiple = true, defaultFiles = uploadItems, onUpload = simulateUpload, onRemove, label: labelProp, hint, disabled = false, className }) {
8466
- const { t } = useI18n();
8900
+ function FileUploadPanel({ accept = ".csv,.json,.jsonl,.yaml,.pdf", maxSize = 25e6, multiple = true, defaultFiles = uploadItems, onUpload = simulateUpload, onRemove, label: labelProp, hint, disabled = false, className }) {
8901
+ const { t, formatBytes } = useI18n();
8467
8902
  const label = labelProp ?? t("upload.label");
8468
8903
  const id = useId();
8469
8904
  const inputRef = useRef(null);
@@ -8622,7 +9057,7 @@ function FileUploadPanel({ accept = ".csv,.json,.jsonl,.yaml,.pdf", maxSize = 26
8622
9057
  });
8623
9058
  }
8624
9059
  function FileRow({ item, onRemove, onRetry }) {
8625
- const { t } = useI18n();
9060
+ const { t, formatBytes } = useI18n();
8626
9061
  const err = item.status === "error";
8627
9062
  const done = item.status === "done";
8628
9063
  return /* @__PURE__ */ jsxs("li", {
@@ -10071,7 +10506,10 @@ const pageHeaderTabs = [
10071
10506
  //#endregion
10072
10507
  //#region src/page-chrome/PageHeader/PageHeader.tsx
10073
10508
  /** Screen header: breadcrumb, title + status, description, meta row, actions and optional tabs. */
10074
- function PageHeader({ as: Root = "header", breadcrumbs = pageHeaderBreadcrumbs, title = "Deployments", titleRef, description = "Every build and release of this project across its environments.", status = "active", statuses, meta = pageHeaderMeta, actions = pageHeaderActions, tabs = pageHeaderTabs, tab, defaultTab, onTabChange, className }) {
10509
+ function PageHeader({ as: Root = "header", breadcrumbs = pageHeaderBreadcrumbs, title: titleProp, labels, titleRef, description: descriptionProp, status = "active", statuses, meta = pageHeaderMeta, actions = pageHeaderActions, tabs = pageHeaderTabs, tab, defaultTab, onTabChange, className }) {
10510
+ const { t } = useI18n();
10511
+ const title = titleProp === void 0 ? labels?.title ?? t("pageHeader.title") : titleProp;
10512
+ const description = descriptionProp === void 0 ? labels?.description ?? t("pageHeader.description") : descriptionProp;
10075
10513
  const explicitPrimary = actions.findIndex((a) => a.variant === "primary");
10076
10514
  const primaryIndex = explicitPrimary >= 0 ? explicitPrimary : actions.length - 1;
10077
10515
  const primary = actions[primaryIndex];
@@ -10140,7 +10578,7 @@ function PageHeader({ as: Root = "header", breadcrumbs = pageHeaderBreadcrumbs,
10140
10578
  className: "flex shrink-0 items-center gap-2 sm:hidden",
10141
10579
  children: [folded.length > 0 && /* @__PURE__ */ jsx(MoreMenu, {
10142
10580
  items: folded.map(toMenuAction),
10143
- label: "More actions"
10581
+ label: labels?.moreActions ?? t("pageHeader.moreActions")
10144
10582
  }), primary && renderAction(primary, primaryIndex)]
10145
10583
  })] })]
10146
10584
  }),
@@ -10150,7 +10588,7 @@ function PageHeader({ as: Root = "header", breadcrumbs = pageHeaderBreadcrumbs,
10150
10588
  onValueChange: (value) => onTabChange?.(String(value)),
10151
10589
  className: "mt-5",
10152
10590
  children: /* @__PURE__ */ jsx(TabsList, {
10153
- "aria-label": "Page sections",
10591
+ "aria-label": labels?.sections ?? t("pageHeader.sections"),
10154
10592
  className: "overflow-x-auto",
10155
10593
  children: tabs.map((t) => /* @__PURE__ */ jsx(TabsTab, {
10156
10594
  value: t.value,
@@ -10168,7 +10606,29 @@ const meta$45 = {
10168
10606
  name: "Page header",
10169
10607
  family: "page-chrome",
10170
10608
  status: "beta",
10171
- description: "Screen header with breadcrumb, title and status, description, meta row, actions that fold into a MoreMenu on small screens, and optional navigation tabs. titleRef targets the h1 for titleRef.current.focus(), adding tabIndex=-1 only when supplied so the title stays outside the Tab order. In a StatusLayout heading slot use as=\"div\" and disable breadcrumb, meta, tabs, actions, status and description fixtures; the slot supplies the page’s only h1.",
10609
+ description: "Screen header with breadcrumb, title and status, description, meta row, actions that fold into a MoreMenu on small screens, and optional navigation tabs. titleRef targets the h1 for titleRef.current.focus(), adding tabIndex=-1 only when supplied so the title stays outside the Tab order. In a StatusLayout heading slot use as=\"div\" and disable breadcrumb, meta, tabs, actions, status and description fixtures; the slot supplies the page’s only h1. The tablist name follows I18nProvider (en/es); the Spanish preview keeps caller content unchanged. Optional labels?: Partial<PageHeaderLabels> overrides each built-in label. Explicit content props win over labels, then I18nProvider (en/es); no provider keeps English. Imported fixtures and machine data stay unchanged. See the Catalog labels live preview.",
10610
+ labels: [
10611
+ {
10612
+ key: "title",
10613
+ type: "string",
10614
+ state: "Heading; explicit title prop wins, including null"
10615
+ },
10616
+ {
10617
+ key: "description",
10618
+ type: "string",
10619
+ state: "Description; explicit description prop wins, including null"
10620
+ },
10621
+ {
10622
+ key: "moreActions",
10623
+ type: "string",
10624
+ state: "Compact actions menu name"
10625
+ },
10626
+ {
10627
+ key: "sections",
10628
+ type: "string",
10629
+ state: "Tablist name"
10630
+ }
10631
+ ],
10172
10632
  uses: [
10173
10633
  "Breadcrumbs",
10174
10634
  "Button",
@@ -10449,6 +10909,20 @@ const meta$5 = {
10449
10909
  uses: ["Toolbar", "ToolbarButton"]
10450
10910
  };
10451
10911
  //#endregion
10912
+ //#region src/scheduling/shared/useSchedulingClock.ts
10913
+ /** Map the existing public numeric clock API to scheduling's Intl options. */
10914
+ function resolveHourCycle(locale) {
10915
+ return localeHourCycle(locale) === 12 ? "h12" : "h23";
10916
+ }
10917
+ /** Undefined outside a provider lets Intl use the runtime locale, as ui Calendar does. */
10918
+ function useSchedulingClock(override) {
10919
+ const locale = useOptionalI18n()?.locale;
10920
+ return {
10921
+ locale,
10922
+ hourCycle: override ?? resolveHourCycle(locale)
10923
+ };
10924
+ }
10925
+ //#endregion
10452
10926
  //#region src/scheduling/shared/CalendarHeader.tsx
10453
10927
  /** Title + previous / today / next navigation + caller actions. */
10454
10928
  function CalendarHeader({ titleId, title, subtitle, prevLabel, nextLabel, onPrev, onNext, onToday, actions }) {
@@ -10498,11 +10972,10 @@ function CalendarHeader({ titleId, title, subtitle, prevLabel, nextLabel, onPrev
10498
10972
  }
10499
10973
  //#endregion
10500
10974
  //#region src/scheduling/shared/dates.ts
10501
- /** Native-Date helpers for the scheduling blocks. Weeks start on Monday. */
10502
- const pad$1 = (n) => String(n).padStart(2, "0");
10975
+ const pad = (n) => String(n).padStart(2, "0");
10503
10976
  /** Local calendar key "YYYY-MM-DD". */
10504
10977
  function dayKey(d) {
10505
- return `${d.getFullYear()}-${pad$1(d.getMonth() + 1)}-${pad$1(d.getDate())}`;
10978
+ return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;
10506
10979
  }
10507
10980
  function startOfDay(d) {
10508
10981
  return new Date(d.getFullYear(), d.getMonth(), d.getDate());
@@ -10522,17 +10995,17 @@ function sameDay(a, b) {
10522
10995
  function sameMonth(a, b) {
10523
10996
  return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
10524
10997
  }
10525
- /** Monday of the week containing `d`. */
10526
- function startOfWeek(d) {
10527
- return addDays(startOfDay(d), -((d.getDay() + 6) % 7));
10998
+ /** First day of the week containing `d`. */
10999
+ function startOfWeek(d, weekStartsOn) {
11000
+ return addDays(startOfDay(d), -((d.getDay() - weekStartsOn + 7) % 7));
10528
11001
  }
10529
- function weekDays(d) {
10530
- const mon = startOfWeek(d);
10531
- return Array.from({ length: 7 }, (_, i) => addDays(mon, i));
11002
+ function weekDays(d, weekStartsOn) {
11003
+ const first = startOfWeek(d, weekStartsOn);
11004
+ return Array.from({ length: 7 }, (_, i) => addDays(first, i));
10532
11005
  }
10533
- /** Six Monday-first weeks covering the month of `d`. */
10534
- function monthGrid(d) {
10535
- const start = startOfWeek(startOfMonth(d));
11006
+ /** Six weeks covering the month of `d`, starting on `weekStartsOn`. */
11007
+ function monthGrid(d, weekStartsOn) {
11008
+ const start = startOfWeek(startOfMonth(d), weekStartsOn);
10536
11009
  return Array.from({ length: 6 }, (_, w) => Array.from({ length: 7 }, (_, i) => addDays(start, w * 7 + i)));
10537
11010
  }
10538
11011
  /** Decimal hour of the day: 10:30 → 10.5. */
@@ -10540,24 +11013,30 @@ function hourOf(d) {
10540
11013
  return d.getHours() + d.getMinutes() / 60;
10541
11014
  }
10542
11015
  const cache = /* @__PURE__ */ new Map();
10543
- /** Cached Intl formatter; `locale` defaults to en-US (pass `useI18n().locale` to localise). */
11016
+ /** Cached Intl formatter; an omitted locale uses the runtime locale. */
10544
11017
  const fmt = (locale, opts) => {
10545
- const key = `${locale ?? "en-US"}|${JSON.stringify(opts)}`;
11018
+ const key = `${locale ?? new Intl.DateTimeFormat().resolvedOptions().locale}|${JSON.stringify(opts)}`;
10546
11019
  let f = cache.get(key);
10547
11020
  if (!f) {
10548
- f = new Intl.DateTimeFormat(locale ?? "en-US", opts);
11021
+ f = new Intl.DateTimeFormat(locale, opts);
10549
11022
  cache.set(key, f);
10550
11023
  }
10551
11024
  return f;
10552
11025
  };
10553
- /** "09:30". */
10554
- const formatTime = (d, locale) => fmt(locale, {
10555
- hour: "2-digit",
11026
+ /** "9:30 AM" or "09:30". */
11027
+ const formatTime = (d, locale, hourCycle) => fmt(locale, {
11028
+ hour: hourCycle === "h12" ? "numeric" : "2-digit",
10556
11029
  minute: "2-digit",
10557
- hourCycle: "h23"
11030
+ hourCycle
10558
11031
  }).format(d);
10559
- /** "09:30–10:00". */
10560
- const formatRange = (start, end, locale) => `${formatTime(start, locale)}–${formatTime(end, locale)}`;
11032
+ /** "9:30 AM–10:00 AM" or "09:30–10:00". */
11033
+ const formatRange = (start, end, locale, hourCycle) => `${formatTime(start, locale, hourCycle)}–${formatTime(end, locale, hourCycle)}`;
11034
+ /** Compact gutter label: "9 AM" or "09:00". */
11035
+ const formatHour = (hour, locale, hourCycle) => fmt(locale, {
11036
+ hour: hourCycle === "h12" ? "numeric" : "2-digit",
11037
+ ...hourCycle === "h23" ? { minute: "2-digit" } : {},
11038
+ hourCycle
11039
+ }).format(new Date(2026, 0, 1, hour));
10561
11040
  /** "Wednesday, April 15, 2026". */
10562
11041
  const formatFullDate = (d, locale) => fmt(locale, {
10563
11042
  weekday: "long",
@@ -10593,9 +11072,18 @@ function formatWeekRange(days, locale) {
10593
11072
  day: "numeric",
10594
11073
  year: "numeric"
10595
11074
  }).formatRange(first, last);
10596
- if (sameMonth(first, last)) return `${formatShort(first)} – ${last.getDate()}, ${last.getFullYear()}`;
10597
- if (first.getFullYear() === last.getFullYear()) return `${formatShort(first)} – ${formatShort(last)}, ${last.getFullYear()}`;
10598
- return `${formatShort(first)}, ${first.getFullYear()} – ${formatShort(last)}, ${last.getFullYear()}`;
11075
+ if (sameMonth(first, last)) return `${formatShort(first, "en-US")} – ${last.getDate()}, ${last.getFullYear()}`;
11076
+ if (first.getFullYear() === last.getFullYear()) return `${formatShort(first, "en-US")} – ${formatShort(last, "en-US")}, ${last.getFullYear()}`;
11077
+ return `${formatShort(first, "en-US")}, ${first.getFullYear()} – ${formatShort(last, "en-US")}, ${last.getFullYear()}`;
11078
+ }
11079
+ /** Internal to blocks: Intl weekdays 1–7 become JS weekdays 0–6. */
11080
+ function weekendDays(locale) {
11081
+ try {
11082
+ const loc = new Intl.Locale(locale ?? new Intl.DateTimeFormat().resolvedOptions().locale);
11083
+ const info = loc.getWeekInfo?.() ?? loc.weekInfo;
11084
+ if (info) return info.weekend.map((day) => day % 7);
11085
+ } catch {}
11086
+ return [6, 0];
10599
11087
  }
10600
11088
  //#endregion
10601
11089
  //#region src/scheduling/shared/events.ts
@@ -10944,15 +11432,15 @@ const sampleEvents = ROWS.map(([day, kind, title, start, hours, location], i) =>
10944
11432
  }));
10945
11433
  //#endregion
10946
11434
  //#region src/scheduling/MonthCalendar/MonthCalendar.tsx
10947
- /** Monday-first weekdays (2026-01-05 is a Monday). */
10948
- const WEEK = Array.from({ length: 7 }, (_, i) => new Date(2026, 0, 5 + i));
10949
11435
  /**
10950
- * Month view of scheduled work: a Monday-first grid with up to N events per day.
11436
+ * Month view of scheduled work: a locale-first grid with up to N events per day.
10951
11437
  * Keyboard: arrows move by day/week, Home/End to the week edges, PageUp/PageDown by month,
10952
11438
  * Enter/Space selects.
10953
11439
  */
10954
- function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMonth, onMonthChange, defaultSelected, onSelectDate, kinds = defaultEventKinds, maxEventsPerDay = 2, actions, className }) {
11440
+ function MonthCalendar({ events = sampleEvents, hourCycle: hourCycleProp, weekStartsOn: weekStartsOnProp, today = sampleToday, defaultMonth, onMonthChange, defaultSelected, onSelectDate, kinds = defaultEventKinds, maxEventsPerDay = 2, actions, className }) {
10955
11441
  const { t, locale, dir } = useI18n();
11442
+ const clock = useSchedulingClock(hourCycleProp);
11443
+ const weekStartsOn = weekStartsOnProp ?? localeWeekStart(clock.locale);
10956
11444
  const titleId = useId();
10957
11445
  const [selected, setSelected] = useState(() => startOfDay(defaultSelected ?? today));
10958
11446
  const [focused, setFocused] = useState(() => startOfDay(defaultSelected ?? defaultMonth ?? today));
@@ -10960,7 +11448,8 @@ function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMont
10960
11448
  const gridRef = useRef(null);
10961
11449
  const moveFocus = useRef(false);
10962
11450
  const byDay = useMemo(() => groupByDay(events), [events]);
10963
- const weeks = monthGrid(month);
11451
+ const weeks = monthGrid(month, weekStartsOn);
11452
+ const weekend = weekendDays(clock.locale);
10964
11453
  const tabStop = sameMonth(focused, month) ? focused : sameMonth(selected, month) ? selected : month;
10965
11454
  useEffect(() => {
10966
11455
  if (!moveFocus.current) return;
@@ -10983,7 +11472,7 @@ function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMont
10983
11472
  onSelectDate?.(date, byDay.get(dayKey(date)) ?? []);
10984
11473
  };
10985
11474
  const onKeyDown = (event, date) => {
10986
- const weekStart = startOfWeek(date);
11475
+ const weekStart = startOfWeek(date, weekStartsOn);
10987
11476
  const next = {
10988
11477
  ArrowLeft: () => addDays(date, dir === "rtl" ? 1 : -1),
10989
11478
  ArrowRight: () => addDays(date, dir === "rtl" ? -1 : 1),
@@ -11019,7 +11508,7 @@ function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMont
11019
11508
  children: [/* @__PURE__ */ jsx("div", {
11020
11509
  role: "row",
11021
11510
  className: "grid grid-cols-7 border-b border-border bg-secondary/30",
11022
- children: WEEK.map((day) => /* @__PURE__ */ jsx("div", {
11511
+ children: (weeks[0] ?? []).map((day) => /* @__PURE__ */ jsx("div", {
11023
11512
  role: "columnheader",
11024
11513
  "aria-label": formatWeekday(day, locale, "long"),
11025
11514
  className: "py-2 text-center text-[11px] font-medium tracking-wide text-muted-foreground uppercase",
@@ -11037,6 +11526,7 @@ function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMont
11037
11526
  const extra = list.length - maxEventsPerDay;
11038
11527
  return /* @__PURE__ */ jsx("div", {
11039
11528
  role: "gridcell",
11529
+ "data-weekend": weekend.includes(date.getDay()) ? "" : void 0,
11040
11530
  "aria-selected": isSelected,
11041
11531
  className: "min-w-0 border-e border-b border-border/70 [&:nth-child(7)]:border-e-0",
11042
11532
  children: /* @__PURE__ */ jsxs("button", {
@@ -11077,7 +11567,7 @@ function MonthCalendar({ events = sampleEvents, today = sampleToday, defaultMont
11077
11567
  }),
11078
11568
  /* @__PURE__ */ jsx("span", {
11079
11569
  className: "ms-auto hidden shrink-0 font-mono text-[10px] text-muted-foreground xl:block",
11080
- children: formatTime(e.start, locale)
11570
+ children: formatTime(e.start, clock.locale, clock.hourCycle)
11081
11571
  })
11082
11572
  ]
11083
11573
  }, e.id)), extra > 0 && /* @__PURE__ */ jsxs("span", {
@@ -11099,13 +11589,12 @@ const meta$43 = {
11099
11589
  name: "Month calendar",
11100
11590
  family: "scheduling",
11101
11591
  status: "beta",
11102
- description: "Monday-first month grid of scheduled work with per-day event lines, today/selected states, month navigation and full grid keyboard support.",
11592
+ description: "Locale-first month grid of scheduled work with per-day event lines, today/selected states, month navigation and full grid keyboard support. weekStartsOn and hourCycle override provider/runtime defaults; data-weekend marks locale weekends without styling. Locale examples show en-US, es-ES, then en-US with Monday-first and 24-hour overrides.",
11103
11593
  uses: ["Button", "IconButton"]
11104
11594
  };
11105
11595
  //#endregion
11106
11596
  //#region src/scheduling/WeekCalendar/WeekCalendar.tsx
11107
11597
  const HOURS = Array.from({ length: 24 }, (_, h) => h);
11108
- const pad = (n) => String(n).padStart(2, "0");
11109
11598
  /** Side-by-side lanes for overlapping events within one day. */
11110
11599
  function layoutDay(list, hourHeight) {
11111
11600
  const placed = [];
@@ -11141,13 +11630,17 @@ function layoutDay(list, hourHeight) {
11141
11630
  return placed;
11142
11631
  }
11143
11632
  /** Week view: seven day columns over a scrolling 24-hour time grid, with a "now" line. */
11144
- function WeekCalendar({ events = sampleEvents, today = sampleToday, now, defaultWeek, onWeekChange, onEventClick, kinds = defaultEventKinds, scrollToHour = 7, hourHeight = 52, height = 480, actions, className }) {
11633
+ function WeekCalendar({ events = sampleEvents, weekStartsOn: weekStartsOnProp, hourCycle: hourCycleProp, today = sampleToday, now, defaultWeek, onWeekChange, onEventClick, kinds = defaultEventKinds, scrollToHour = 7, hourHeight = 52, height = 480, actions, className }) {
11145
11634
  const { t, locale } = useI18n();
11635
+ const clock = useSchedulingClock(hourCycleProp);
11636
+ const weekStartsOn = weekStartsOnProp ?? localeWeekStart(clock.locale);
11146
11637
  const titleId = useId();
11147
- const [weekStart, setWeekStart] = useState(() => startOfWeek(defaultWeek ?? today));
11638
+ const [weekStart, setWeekStart] = useState(() => startOfWeek(defaultWeek ?? today, weekStartsOn));
11148
11639
  const scrollRef = useRef(null);
11149
11640
  const byDay = useMemo(() => groupByDay(events), [events]);
11150
- const days = weekDays(weekStart);
11641
+ const days = weekDays(weekStart, weekStartsOn);
11642
+ const visibleStart = days[0] ?? weekStart;
11643
+ const weekend = weekendDays(clock.locale);
11151
11644
  const nowAt = now ?? today;
11152
11645
  const nowVisible = days.some((d) => sameDay(d, nowAt));
11153
11646
  useEffect(() => {
@@ -11164,9 +11657,9 @@ function WeekCalendar({ events = sampleEvents, today = sampleToday, now, default
11164
11657
  title: formatWeekRange(days, locale),
11165
11658
  prevLabel: t("calendar.previousWeek"),
11166
11659
  nextLabel: t("calendar.nextWeek"),
11167
- onPrev: () => show(addDays(weekStart, -7)),
11168
- onNext: () => show(addDays(weekStart, 7)),
11169
- onToday: () => show(startOfWeek(today)),
11660
+ onPrev: () => show(addDays(visibleStart, -7)),
11661
+ onNext: () => show(addDays(visibleStart, 7)),
11662
+ onToday: () => show(startOfWeek(today, weekStartsOn)),
11170
11663
  actions
11171
11664
  }), /* @__PURE__ */ jsx("div", {
11172
11665
  className: "overflow-x-auto",
@@ -11204,10 +11697,10 @@ function WeekCalendar({ events = sampleEvents, today = sampleToday, now, default
11204
11697
  children: [/* @__PURE__ */ jsx("div", {
11205
11698
  "aria-hidden": true,
11206
11699
  className: "relative w-14 shrink-0 border-e border-border/70",
11207
- children: HOURS.slice(1).map((h) => /* @__PURE__ */ jsxs("span", {
11700
+ children: HOURS.slice(1).map((h) => /* @__PURE__ */ jsx("span", {
11208
11701
  className: "absolute end-2 font-mono text-[10px] text-muted-foreground",
11209
11702
  style: { top: h * hourHeight - 6 },
11210
- children: [pad(h), ":00"]
11703
+ children: formatHour(h, clock.locale, clock.hourCycle)
11211
11704
  }, h))
11212
11705
  }), /* @__PURE__ */ jsxs("div", {
11213
11706
  className: "relative flex-1",
@@ -11225,18 +11718,19 @@ function WeekCalendar({ events = sampleEvents, today = sampleToday, now, default
11225
11718
  children: days.map((d) => {
11226
11719
  const list = byDay.get(dayKey(d)) ?? [];
11227
11720
  return /* @__PURE__ */ jsx("ul", {
11721
+ "data-weekend": weekend.includes(d.getDay()) ? "" : void 0,
11228
11722
  "aria-label": formatDay(d, locale),
11229
11723
  className: "relative border-s border-border/70 first:border-s-0",
11230
11724
  children: layoutDay(list, hourHeight).map(({ event, top, height: h, lane, lanes }) => {
11231
11725
  const kind = kindOf(event, kinds);
11232
11726
  const tone = TONE[kind.tone];
11233
- const range = formatRange(event.start, event.end, locale);
11727
+ const range = formatRange(event.start, event.end, clock.locale, clock.hourCycle);
11234
11728
  const body = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
11235
11729
  className: "block truncate text-[11px] leading-tight font-semibold text-foreground",
11236
11730
  children: event.title
11237
11731
  }), /* @__PURE__ */ jsx("span", {
11238
- className: "block truncate font-mono text-[10px] text-muted-foreground",
11239
- children: formatTime(event.start, locale)
11732
+ className: "block truncate font-mono text-[10px] text-foreground",
11733
+ children: formatTime(event.start, clock.locale, clock.hourCycle)
11240
11734
  })] });
11241
11735
  const box = cn("block h-full w-full overflow-hidden rounded-md border-s-2 px-2 py-1 text-start", tone.soft, tone.bar);
11242
11736
  return /* @__PURE__ */ jsx("li", {
@@ -11293,7 +11787,7 @@ const meta$76 = {
11293
11787
  name: "Week calendar",
11294
11788
  family: "scheduling",
11295
11789
  status: "beta",
11296
- description: "Seven-day time grid with positioned events (overlaps side by side), a now line, week navigation and optional clickable events.",
11790
+ description: "Locale-first seven-day time grid with positioned events (overlaps side by side), a now line, week navigation and optional clickable events. weekStartsOn and hourCycle override provider/runtime defaults; data-weekend marks locale weekends without styling. Locale examples show en-US, es-ES, then en-US with Monday-first and 24-hour overrides.",
11297
11791
  uses: ["Button", "IconButton"]
11298
11792
  };
11299
11793
  //#endregion
@@ -11311,8 +11805,9 @@ function EventTile({ kind, className }) {
11311
11805
  //#endregion
11312
11806
  //#region src/scheduling/AgendaList/AgendaList.tsx
11313
11807
  /** Upcoming scheduled work grouped by day, each row with a kind tile, time range and location. */
11314
- function AgendaList({ events = sampleEvents, today = sampleToday, from, days = 7, onEventClick, kinds = defaultEventKinds, title: titleProp, maxHeight, emptyTitle: emptyTitleProp, emptyDescription: emptyDescriptionProp, titleAs: TitleTag = "h3", className }) {
11808
+ function AgendaList({ events = sampleEvents, hourCycle: hourCycleProp, today = sampleToday, from, days = 7, onEventClick, kinds = defaultEventKinds, title: titleProp, maxHeight, emptyTitle: emptyTitleProp, emptyDescription: emptyDescriptionProp, titleAs: TitleTag = "h3", className }) {
11315
11809
  const { t, locale } = useI18n();
11810
+ const clock = useSchedulingClock(hourCycleProp);
11316
11811
  const title = titleProp ?? t("calendar.agenda");
11317
11812
  const emptyTitle = emptyTitleProp ?? t("calendar.emptyTitle");
11318
11813
  const emptyDescription = emptyDescriptionProp ?? t("calendar.emptyDescription");
@@ -11370,7 +11865,7 @@ function AgendaList({ events = sampleEvents, today = sampleToday, from, days = 7
11370
11865
  className: "divide-y divide-border border-b border-border last:border-b-0",
11371
11866
  children: list.map((event) => {
11372
11867
  const kind = kindOf(event, kinds);
11373
- const range = formatRange(event.start, event.end, locale);
11868
+ const range = formatRange(event.start, event.end, clock.locale, clock.hourCycle);
11374
11869
  const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
11375
11870
  /* @__PURE__ */ jsx(EventTile, { kind }),
11376
11871
  /* @__PURE__ */ jsxs("span", {
@@ -11430,7 +11925,7 @@ const meta$1 = {
11430
11925
  name: "Agenda list",
11431
11926
  family: "scheduling",
11432
11927
  status: "beta",
11433
- description: "Upcoming scheduled work grouped by day (Today/Tomorrow labels), each row with a kind tile, time range, location and kind badge; empty state included.",
11928
+ description: "Upcoming scheduled work grouped by day (Today/Tomorrow labels), each row with a kind tile, locale-formatted time range, location and kind badge; empty state included. hourCycle overrides the provider/runtime clock. Locale examples show en-US, es-ES, then en-US with the 24-hour override.",
11434
11929
  uses: ["Badge", "EmptyState"]
11435
11930
  };
11436
11931
  //#endregion
@@ -11830,7 +12325,7 @@ const globalSearchPages = [
11830
12325
  id: "page-settings",
11831
12326
  label: "Settings",
11832
12327
  icon: Settings,
11833
- shortcut: ["⌘", ","]
12328
+ shortcut: ["mod", ","]
11834
12329
  }
11835
12330
  ];
11836
12331
  const globalSearchRecords = [
@@ -11868,7 +12363,7 @@ const globalSearchActions = [
11868
12363
  id: "action-new-project",
11869
12364
  label: "Create project",
11870
12365
  icon: FolderPlus,
11871
- shortcut: ["⌘", "N"],
12366
+ shortcut: ["mod", "N"],
11872
12367
  keywords: ["new"]
11873
12368
  },
11874
12369
  {
@@ -12420,11 +12915,23 @@ function toggleOne(id, selected) {
12420
12915
  else next.add(id);
12421
12916
  return next;
12422
12917
  }
12423
- /** Default cell text for a raw value. */
12424
- function formatCell(value) {
12918
+ /** Default cell text for a raw value. Omitting options preserves the legacy output. */
12919
+ function formatCell(value, options) {
12425
12920
  if (value == null) return "—";
12426
- if (value instanceof Date) return value.toLocaleDateString();
12427
- if (typeof value === "boolean") return value ? "Yes" : "No";
12921
+ if (value instanceof Date) {
12922
+ if (!options) return value.toLocaleDateString();
12923
+ if (Number.isNaN(value.getTime())) return "—";
12924
+ return new Intl.DateTimeFormat(options.locale, {
12925
+ year: "numeric",
12926
+ month: "numeric",
12927
+ day: "numeric"
12928
+ }).format(value);
12929
+ }
12930
+ if (typeof value === "boolean") return (options?.booleanLabels ?? ["Yes", "No"])[value ? 0 : 1];
12931
+ if (typeof value === "number" && Number.isFinite(value) && options?.locale !== void 0) {
12932
+ const decimal = new Intl.NumberFormat(options.locale).formatToParts(1.1).find((part) => part.type === "decimal");
12933
+ return String(value).replace(".", decimal?.value ?? ".");
12934
+ }
12428
12935
  return value;
12429
12936
  }
12430
12937
  /** Group key of a row (`''` when the value is null or undefined). */
@@ -12667,6 +13174,7 @@ function isCellEditable(column, row) {
12667
13174
  //#region src/tables/DataTable/data-table-row.tsx
12668
13175
  function DataTableRow({ labels, row, columns, getRowId, getRowLabel, selectable, selected, singleSelection, onToggleRow, rowActions, layout, onCellEdit, editHintId, ariaRowIndex, style }) {
12669
13176
  const { t } = useI18n();
13177
+ const locale = useOptionalI18n()?.locale;
12670
13178
  const id = getRowId(row);
12671
13179
  const selectionColumn = selectable || singleSelection != null;
12672
13180
  const isSelected = singleSelection ? singleSelection.selectedId === id : selected.has(id);
@@ -12696,7 +13204,10 @@ function DataTableRow({ labels, row, columns, getRowId, getRowLabel, selectable,
12696
13204
  }),
12697
13205
  columns.map((c) => {
12698
13206
  const cl = layout?.columns.get(c.id);
12699
- const content = c.cell ? c.cell(row) : formatCell(c.accessor?.(row));
13207
+ const content = c.cell ? c.cell(row) : formatCell(c.accessor?.(row), {
13208
+ locale,
13209
+ booleanLabels: [labels?.booleanTrue ?? t("common.yes"), labels?.booleanFalse ?? t("common.no")]
13210
+ });
12700
13211
  const editable = onCellEdit && editHintId && isCellEditable(c, row);
12701
13212
  return /* @__PURE__ */ jsx(TableCell, {
12702
13213
  align: columnAlign(c),
@@ -13922,6 +14433,16 @@ const meta$16 = {
13922
14433
  status: "beta",
13923
14434
  description: "Generic typed table: sortable headers with aria-sort, row selection with select-all and indeterminate by default (selectionMode=\"multiple\"), selectionMode=\"none\" to hide selection, column visibility menu, density toggle, row actions, loading and empty states, client-side sort and pagination, optional row groups (groupBy) with rowgroup header rows, counts, keyboard-accessible collapse buttons and group selection; column resize (pointer drag or a focusable role=\"separator\" handle with arrow keys, min/max widths, controlled columnWidths), column pinning to either edge with sticky cells (column menu or pinnedColumns), row virtualization for large datasets (aria-rowcount/aria-rowindex, works with selection and grouping), inline cell editing (text, number and select editors; Enter/F2 to edit, Enter/Tab to commit, Escape to cancel, onCellEdit can reject with an inline error) and saved views (filters, sort, visible columns, widths, pinning and grouping) with a view switcher to save as, rename, delete and reset. Opt-in selectionMode=\"single\" uses native radios in a labelled fieldset (never paginated or virtualized; paginated defaults to false and paginated=true is a type error). Single mode uses selectedId/onSelectedIdChange or defaultSelectedId; isRowDisabled skips unavailable rows and preserves a checked disabled choice without callbacks. Supply legend, aria-label or aria-labelledby for the group and getRowLabel for each radio (otherwise the first column labels it). selectionName is used verbatim and must be unique per page; omitted names use an instance-unique useId name, and duplicate supplied names or missing group labels warn in development. Tab enters once on the checked enabled row or first enabled row; arrows wrap and skip disabled rows, Space selects, Shift+Tab exits, and all-disabled groups have no tab stop. No select-all, group checkboxes, bulk actions or selection summary appear in single mode. Examples in examples/single-selection.tsx: an uncontrolled non-paginated list with legend=\"Available items\" and a controlled versions table with legend=\"Available versions\", selectedId=\"v2\" and a checked disabled version. Opt-in paginationMode=\"server\" accepts a controlled 1-based page, pageSize and required rowCount (known total), with onPageChange/onPageSizeChange requests. Supplied rows render in order without client sorting or slicing, and headers have no sort affordance. Single selection cannot use server mode. The footer stays visible for empty results, clamps stale pages for display without callbacks, and hides during loading. Page-size changes may also request a page to keep the first visible row on screen. The consumer owns fetching and reconciles stale pages. See examples/server-pagination.tsx for an items/total/page/pageSize envelope consumer that handles both callbacks.",
13924
14435
  labels: [
14436
+ {
14437
+ key: "booleanTrue",
14438
+ type: "string",
14439
+ state: "Default cell text for a true boolean value"
14440
+ },
14441
+ {
14442
+ key: "booleanFalse",
14443
+ type: "string",
14444
+ state: "Default cell text for a false boolean value"
14445
+ },
13925
14446
  {
13926
14447
  key: "scrollRegion",
13927
14448
  type: "string",
@@ -15978,6 +16499,6 @@ const meta$59 = {
15978
16499
  ]
15979
16500
  };
15980
16501
  //#endregion
15981
- export { ASSISTANT_STATUSES, ActivityFeed, AgendaList, AppSidebar, AppSidebarFooter, AppSidebarHeader, AppSidebarNav, AppTopbar, AssistantCardGrid, AuthDivider, AuthHeader, BulkActionBar, COLUMN_VARIANT_CLASSES, COMMENT_AUTHOR, COST_BY_RANGE, COST_RANGES, ChartCard, CodePanel, ColumnResizeHandle, ColumnVisibilityMenu, CommentThread, ComparisonTable, ConfirmDestructive, ConfirmDestructiveDialog, CostBreakdown, CreateApiKeyDialog, CredentialDisclosureDialog, CursorPagerFooter, DEFAULT_COLUMN_WIDTH, DEPLOYMENT_COLUMNS, DEPLOYMENT_DEFAULT_FILTERS, DEPLOYMENT_DETAILS, DEPLOYMENT_EVENTS, DEPLOYMENT_FILTER_FIELDS, DEPLOYMENT_ROWS, DEPLOYMENT_SAVED_VIEWS, DangerZone, DataTable, ViewSwitcher as DataTableViewSwitcher, DateRangeFilter, DensityToggle, DescriptionListCard, DialogWizard, EDITABLE_MEMBERS, EDITABLE_MEMBER_FIELDS, EditableCell, EnvironmentBadge, ErrorPanel, EvaluationScorecard, Faq, FeatureGrid, FileUploadPanel, FilterBar, FirstRunEmpty, FlowBuilder, ForgotPasswordForm, FormSection, GlobalSearch, Hero, HeroScreenshotPlaceholder, InlineCallout, InlineEditRow, InlineEditTable, InviteMembersDialog, InvoiceTable, KPI_ITEMS, KpiRow, LOG_LEVELS, ListSkeleton, LoadMoreFooter, LogViewer, MAX_COLUMN_WIDTH, MIN_COLUMN_WIDTH, MODEL_KEY_STATUSES, MembersTable, MfaChallenge, ModelKeysList, MonthCalendar, NoAccessEmpty, NoResultsEmpty, NodeInspector, NodePalette, NotFoundEmpty, NotificationMatrix, PROJECT_ACTIVITY, PageHeader, PageSkeleton, PageToolbar, PaginationFooter, PaymentMethodCard, PendingInvitations, PlanCard, PlanDefinitionCard, PricingTable, ProfileHeader, PromptEditor, QuotaMeters, RESOURCE_CARDS, REVIEW_COMMENTS, ResetPasswordForm, ResourceCardGrid, RunConsole, SPAN_STATUSES, STAT_RANGES, SectionHeader, SessionsDevices, SettingsRow, SignInForm, SignUpForm, SpanDetails, SpendVsBudget, SsoButtons, StatCard, StatusTimeline, StickyActionBar, SubordinateList, SystemBanner, TRAFFIC_BUCKETS, TRAFFIC_BY_RANGE, TRAFFIC_RANGES, TableSkeleton, TimeSlotPicker, TokenCostCard, TraceWaterfall, TrendDelta, TruncatedCollectionFooter, ValidationSummary, WeekCalendar, meta as activityFeedMeta, meta$1 as agendaListMeta, apiKeyExpiries, apiKeyScopes, meta$2 as appSidebarMeta, appSidebarNavGroups, appSidebarUsage, appSidebarUser, appSidebarWorkspaces, appTopbarBreadcrumbs, meta$3 as appTopbarMeta, appTopbarNotifications, meta$4 as assistantCardGridMeta, meta$5 as bulkActionBarMeta, meta$6 as chartCardMeta, clampColumnWidth, meta$7 as codePanelMeta, columnAlign, columnWidthOf, meta$8 as commentThreadMeta, compareValues, meta$9 as comparisonTableMeta, meta$10 as confirmDestructiveMeta, meta$11 as costBreakdownMeta, meta$12 as createApiKeyDialogMeta, meta$13 as credentialDisclosureDialogMeta, meta$14 as cursorPagerFooterMeta, dangerZoneActions, meta$15 as dangerZoneMeta, meta$16 as dataTableMeta, meta$17 as dateRangeFilterMeta, defaultEventKinds, meta$18 as descriptionListCardMeta, dialogWizardCopy, meta$19 as dialogWizardMeta, dialogWizardSteps, meta$20 as emptyStatesMeta, meta$21 as environmentBadgeMeta, environmentTones, meta$22 as errorPanelMeta, meta$23 as evaluationScorecardMeta, extractPromptVariables, meta$24 as faqMeta, meta$25 as featureGridMeta, meta$26 as fileUploadPanelMeta, meta$27 as filterBarMeta, firstRunSteps, meta$28 as flowBuilderMeta, meta$29 as forgotPasswordFormMeta, meta$30 as formSectionMeta, formatCell, formatSpanDuration, generateDemoSecret, generateDeployments, globalSearchActions, meta$31 as globalSearchMeta, globalSearchPages, globalSearchRecent, globalSearchRecords, groupActivityByDay, groupKeyOf, groupRows, meta$32 as heroMeta, meta$33 as inlineCalloutMeta, meta$34 as inlineEditRowMeta, meta$35 as inviteMembersDialogMeta, meta$36 as invoiceTableMeta, meta$37 as kpiRowMeta, meta$38 as loadMoreFooterMeta, meta$39 as logViewerMeta, memberRoles, meta$40 as membersTableMeta, meta$41 as mfaChallengeMeta, meta$42 as modelKeysListMeta, meta$43 as monthCalendarMeta, noAccessSample, noResultsSample, notFoundSample, notificationChannels, notificationDefaults, notificationEvents, meta$44 as notificationMatrixMeta, orderColumns, pageCountOf, pageHeaderActions, pageHeaderBreadcrumbs, meta$45 as pageHeaderMeta, pageHeaderTabs, meta$46 as pageToolbarMeta, pageToolbarViews, paginate, meta$47 as paginationFooterMeta, meta$48 as paymentMethodCardMeta, meta$49 as pendingInvitationsMeta, meta$50 as planCardMeta, meta$51 as planDefinitionCardMeta, meta$52 as pricingTableMeta, meta$53 as profileHeaderMeta, meta$54 as promptEditorMeta, meta$55 as quotaMetersMeta, meta$56 as resetPasswordFormMeta, meta$57 as resourceCardGridMeta, runningTraceSpans, sameViewState, sampleBudget, sampleComparisonPlans, sampleComparisonSections, sampleCosts, deviceSessions as sampleDeviceSessions, sampleFaqs, sampleFeatures, invitations as sampleInvitations, sampleInvoices, members as sampleMembers, samplePaymentMethod, samplePlan, samplePlanDefinition, samplePricingTiers, profile as sampleProfile, sampleQuotas, sampleEvents as sampleScheduleEvents, sampleToday as sampleScheduleToday, sampleSpend, sampleTimeSlots, meta$58 as sectionHeaderMeta, selectionState, meta$59 as sessionsDevicesMeta, setColumnPin, meta$60 as settingsRowMeta, meta$61 as signInFormMeta, meta$62 as signUpFormMeta, simulateUpload, meta$63 as skeletonsMeta, sortRows, meta$64 as spendVsBudgetMeta, meta$65 as ssoButtonsMeta, ssoProviders, meta$66 as statCardMeta, meta$67 as statusTimelineMeta, meta$68 as stickyActionBarMeta, meta$69 as subordinateListMeta, meta$70 as systemBannerMeta, meta$71 as timeSlotPickerMeta, toggleAll, toggleOne, meta$72 as tokenCostCardMeta, traceSpans, meta$73 as traceWaterfallMeta, meta$74 as truncatedCollectionFooterMeta, uploadItems, validationIssues, meta$75 as validationSummaryMeta, meta$76 as weekCalendarMeta };
16502
+ export { ASSISTANT_STATUSES, ActivityFeed, AgendaList, AppSidebar, AppSidebarFooter, AppSidebarHeader, AppSidebarNav, AppTopbar, AssistantCardGrid, AuthDivider, AuthHeader, BulkActionBar, COLUMN_VARIANT_CLASSES, COMMENT_AUTHOR, COST_BY_RANGE, COST_RANGES, ChartCard, CodePanel, ColumnResizeHandle, ColumnVisibilityMenu, CommentThread, ComparisonTable, ConfirmDestructive, ConfirmDestructiveDialog, CostBreakdown, CreateApiKeyDialog, CredentialDisclosureDialog, CursorPagerFooter, DEFAULT_COLUMN_WIDTH, DEPLOYMENT_COLUMNS, DEPLOYMENT_DEFAULT_FILTERS, DEPLOYMENT_DETAILS, DEPLOYMENT_EVENTS, DEPLOYMENT_FILTER_FIELDS, DEPLOYMENT_ROWS, DEPLOYMENT_SAVED_VIEWS, DangerZone, DataTable, ViewSwitcher as DataTableViewSwitcher, DateRangeFilter, DensityToggle, DescriptionListCard, DialogWizard, EDITABLE_MEMBERS, EDITABLE_MEMBER_FIELDS, EditableCell, EnvironmentBadge, ErrorPanel, EvaluationScorecard, Faq, FeatureGrid, FileUploadPanel, FilterBar, FirstRunEmpty, FlowBuilder, ForgotPasswordForm, FormSection, GlobalSearch, Hero, HeroScreenshotPlaceholder, InlineCallout, InlineEditRow, InlineEditTable, InviteMembersDialog, InvoiceTable, KPI_ITEMS, KpiRow, LOG_LEVELS, ListSkeleton, LoadMoreFooter, LogViewer, MAX_COLUMN_WIDTH, MIN_COLUMN_WIDTH, MODEL_KEY_STATUSES, MembersTable, MfaChallenge, ModelKeysList, MonthCalendar, NoAccessEmpty, NoResultsEmpty, NodeInspector, NodePalette, NotFoundEmpty, NotificationMatrix, PROJECT_ACTIVITY, PageHeader, PageSkeleton, PageToolbar, PaginationFooter, PaymentMethodCard, PendingInvitations, PlanCard, PlanDefinitionCard, PricingTable, ProfileHeader, PromptEditor, QuotaMeters, RESOURCE_CARDS, REVIEW_COMMENTS, ResetPasswordForm, ResourceCardGrid, RunConsole, SPAN_STATUSES, STAT_RANGES, SectionHeader, SessionsDevices, SettingsRow, SignInForm, SignUpForm, SpanDetails, SpendVsBudget, SsoButtons, StatCard, StatusTimeline, StickyActionBar, SubordinateList, SystemBanner, TRAFFIC_BUCKETS, TRAFFIC_BY_RANGE, TRAFFIC_RANGES, TableSkeleton, TimeSlotPicker, TokenCostCard, TraceWaterfall, TrendDelta, TruncatedCollectionFooter, ValidationSummary, WeekCalendar, meta as activityFeedMeta, meta$1 as agendaListMeta, apiKeyExpiries, apiKeyScopes, meta$2 as appSidebarMeta, appSidebarNavGroups, appSidebarUsage, appSidebarUser, appSidebarWorkspaces, appTopbarBreadcrumbs, meta$3 as appTopbarMeta, appTopbarNotifications, meta$4 as assistantCardGridMeta, builderEdges, builderNodes, meta$5 as bulkActionBarMeta, meta$6 as chartCardMeta, clampColumnWidth, cleanFlowGraph, meta$7 as codePanelMeta, columnAlign, columnWidthOf, meta$8 as commentThreadMeta, compareValues, meta$9 as comparisonTableMeta, meta$10 as confirmDestructiveMeta, meta$11 as costBreakdownMeta, meta$12 as createApiKeyDialogMeta, meta$13 as credentialDisclosureDialogMeta, meta$14 as cursorPagerFooterMeta, dangerZoneActions, meta$15 as dangerZoneMeta, meta$16 as dataTableMeta, meta$17 as dateRangeFilterMeta, defaultEventKinds, meta$18 as descriptionListCardMeta, dialogWizardCopy, meta$19 as dialogWizardMeta, dialogWizardSteps, meta$20 as emptyStatesMeta, meta$21 as environmentBadgeMeta, environmentTones, meta$22 as errorPanelMeta, meta$23 as evaluationScorecardMeta, extractPromptVariables, meta$24 as faqMeta, meta$25 as featureGridMeta, meta$26 as fileUploadPanelMeta, meta$27 as filterBarMeta, firstRunSteps, meta$28 as flowBuilderMeta, meta$29 as forgotPasswordFormMeta, meta$30 as formSectionMeta, formatCell, formatSpanDuration, generateDemoSecret, generateDeployments, globalSearchActions, meta$31 as globalSearchMeta, globalSearchPages, globalSearchRecent, globalSearchRecords, groupActivityByDay, groupKeyOf, groupRows, meta$32 as heroMeta, meta$33 as inlineCalloutMeta, meta$34 as inlineEditRowMeta, meta$35 as inviteMembersDialogMeta, meta$36 as invoiceTableMeta, meta$37 as kpiRowMeta, meta$38 as loadMoreFooterMeta, meta$39 as logViewerMeta, memberRoles, meta$40 as membersTableMeta, meta$41 as mfaChallengeMeta, meta$42 as modelKeysListMeta, meta$43 as monthCalendarMeta, noAccessSample, noResultsSample, notFoundSample, notificationChannels, notificationDefaults, notificationEvents, meta$44 as notificationMatrixMeta, orderColumns, pageCountOf, pageHeaderActions, pageHeaderBreadcrumbs, meta$45 as pageHeaderMeta, pageHeaderTabs, meta$46 as pageToolbarMeta, pageToolbarViews, paginate, meta$47 as paginationFooterMeta, meta$48 as paymentMethodCardMeta, meta$49 as pendingInvitationsMeta, meta$50 as planCardMeta, meta$51 as planDefinitionCardMeta, meta$52 as pricingTableMeta, meta$53 as profileHeaderMeta, meta$54 as promptEditorMeta, meta$55 as quotaMetersMeta, meta$56 as resetPasswordFormMeta, meta$57 as resourceCardGridMeta, runningTraceSpans, sameViewState, sampleBudget, sampleComparisonPlans, sampleComparisonSections, sampleCosts, deviceSessions as sampleDeviceSessions, sampleFaqs, sampleFeatures, invitations as sampleInvitations, sampleInvoices, members as sampleMembers, samplePaymentMethod, samplePlan, samplePlanDefinition, samplePricingTiers, profile as sampleProfile, sampleQuotas, sampleEvents as sampleScheduleEvents, sampleToday as sampleScheduleToday, sampleSpend, sampleTimeSlots, meta$58 as sectionHeaderMeta, selectionState, meta$59 as sessionsDevicesMeta, setColumnPin, meta$60 as settingsRowMeta, meta$61 as signInFormMeta, meta$62 as signUpFormMeta, simulateUpload, meta$63 as skeletonsMeta, sortRows, meta$64 as spendVsBudgetMeta, meta$65 as ssoButtonsMeta, ssoProviders, meta$66 as statCardMeta, meta$67 as statusTimelineMeta, meta$68 as stickyActionBarMeta, meta$69 as subordinateListMeta, meta$70 as systemBannerMeta, meta$71 as timeSlotPickerMeta, toggleAll, toggleOne, meta$72 as tokenCostCardMeta, traceSpans, meta$73 as traceWaterfallMeta, meta$74 as truncatedCollectionFooterMeta, uploadItems, validationIssues, meta$75 as validationSummaryMeta, meta$76 as weekCalendarMeta };
15982
16503
 
15983
16504
  //# sourceMappingURL=index.js.map