@40rty/ams-ui 0.5.6 → 0.5.8

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 (56) hide show
  1. package/dist/agent.js +3 -2
  2. package/dist/{chunk-2HM6EVDV.js → chunk-4ZX4IRC6.js} +241 -389
  3. package/dist/chunk-FSY7MEP5.js +843 -0
  4. package/dist/{chunk-WVD2Y2N2.js → chunk-G3IXNKXL.js} +15 -8
  5. package/dist/{chunk-H6MSAD5M.js → chunk-KNIUL72S.js} +10 -5
  6. package/dist/{chunk-CKNELL6G.js → chunk-M5T3ZTBB.js} +109 -79
  7. package/dist/{chunk-432XYPDT.js → chunk-ZP27BQQE.js} +1 -1
  8. package/dist/conversation.js +24 -21
  9. package/dist/css/preset/motion.css +4 -1
  10. package/dist/css/shell/spacefront-island.css +8 -6
  11. package/dist/css/shell/spacefront-presence.css +9 -4
  12. package/dist/css/shell/spacefront-thread-panel.css +12 -5
  13. package/dist/index.js +473 -403
  14. package/dist/island.js +18 -11
  15. package/dist/motion.js +1 -1
  16. package/dist/presence.js +20 -11
  17. package/dist/shell.js +6 -5
  18. package/dist/thread-panel.js +19 -9
  19. package/dist/types/catalog-data/ecommerce.d.ts +42 -0
  20. package/dist/types/catalog-data/social.d.ts +14 -0
  21. package/dist/types/components/content/article/BlogPosts.d.ts +1 -1
  22. package/dist/types/components/ecommerce/cart/cart-format.d.ts +3 -2
  23. package/dist/types/components/ecommerce/collection/CollectionList.d.ts +1 -1
  24. package/dist/types/components/ecommerce/product/AddToRegistry.d.ts +1 -1
  25. package/dist/types/components/ecommerce/product/ProductPrice.d.ts +1 -0
  26. package/dist/types/components/feedback/HydrationNotice.d.ts +9 -0
  27. package/dist/types/components/layout/Drawer.d.ts +2 -0
  28. package/dist/types/conversation/blocks/schemas.d.ts +40 -0
  29. package/dist/types/index.d.ts +3 -2
  30. package/dist/types/labels/en/agent.d.ts +2 -0
  31. package/dist/types/labels/en/commerce.d.ts +2 -0
  32. package/dist/types/labels/en/content.d.ts +2 -0
  33. package/dist/types/labels/en/notices.d.ts +2 -0
  34. package/dist/types/labels/en/shell.d.ts +2 -0
  35. package/dist/types/labels/he/agent.d.ts +2 -0
  36. package/dist/types/labels/he/commerce.d.ts +2 -0
  37. package/dist/types/labels/he/content.d.ts +2 -0
  38. package/dist/types/labels/he/count.d.ts +17 -0
  39. package/dist/types/labels/he/notices.d.ts +2 -0
  40. package/dist/types/labels/he/shell.d.ts +2 -0
  41. package/dist/types/labels/index.d.ts +34 -0
  42. package/dist/types/{labels.d.ts → labels/types-agent.d.ts} +4 -120
  43. package/dist/types/labels/types-commerce.d.ts +252 -0
  44. package/dist/types/labels/types-content.d.ts +28 -0
  45. package/dist/types/labels/types-notices.d.ts +9 -0
  46. package/dist/types/labels/types-shell.d.ts +137 -0
  47. package/dist/types/labels-context.d.ts +19 -5
  48. package/dist/types/primitives/Money/index.d.ts +1 -1
  49. package/dist/types/shell/Composer.d.ts +1 -1
  50. package/dist/types/shell/SideDock.d.ts +1 -1
  51. package/dist/types/shell/SpacefrontIsland.d.ts +1 -1
  52. package/dist/types/shell/SpacefrontPresence.d.ts +1 -1
  53. package/dist/types/shell/VoiceIsland.d.ts +1 -1
  54. package/dist/types/utils/format-money.d.ts +3 -1
  55. package/dist/types/utils/mirror-x.d.ts +8 -0
  56. package/package.json +2 -2
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  SideDock,
4
4
  useSideDockSpacing
5
- } from "./chunk-H6MSAD5M.js";
5
+ } from "./chunk-KNIUL72S.js";
6
6
  import {
7
7
  useMediaQuery,
8
8
  useScrollLock
@@ -10,8 +10,8 @@ import {
10
10
  import {
11
11
  AgentPresenceWidget,
12
12
  PresenceBriefRail,
13
- useLabels
14
- } from "./chunk-2HM6EVDV.js";
13
+ mirrorX
14
+ } from "./chunk-4ZX4IRC6.js";
15
15
  import {
16
16
  submitOnEnter,
17
17
  useScrollThreshold
@@ -21,11 +21,16 @@ import {
21
21
  AttachmentStrip,
22
22
  DictationButton,
23
23
  ListeningWaveform
24
- } from "./chunk-WVD2Y2N2.js";
24
+ } from "./chunk-G3IXNKXL.js";
25
25
  import {
26
26
  Spinner,
27
27
  cn
28
28
  } from "./chunk-WDL5PHO2.js";
29
+ import {
30
+ useLabels,
31
+ useLocale,
32
+ useTextDirection
33
+ } from "./chunk-FSY7MEP5.js";
29
34
  import {
30
35
  AgentCaret,
31
36
  AnimatePresence,
@@ -39,7 +44,7 @@ import {
39
44
  useReducedMotion,
40
45
  useScrollDirection,
41
46
  useTransform
42
- } from "./chunk-432XYPDT.js";
47
+ } from "./chunk-ZP27BQQE.js";
43
48
 
44
49
  // src/shell/Composer.tsx
45
50
  import * as React9 from "react";
@@ -68,8 +73,9 @@ function useScrollEdges() {
68
73
  React2.useEffect(() => {
69
74
  if (el === null) return;
70
75
  const update = () => {
71
- const start = el.scrollLeft > 1;
72
- const end = el.scrollLeft + el.clientWidth < el.scrollWidth - 1;
76
+ const offset = Math.abs(el.scrollLeft);
77
+ const start = offset > 1;
78
+ const end = offset + el.clientWidth < el.scrollWidth - 1;
73
79
  setFade(start && end ? "both" : start ? "start" : end ? "end" : "none");
74
80
  };
75
81
  update();
@@ -132,7 +138,7 @@ function ComposerChipStrip({
132
138
  letterSpacing: "var(--fourty-chip-tracking, 0.22em)",
133
139
  lineHeight: 1.6,
134
140
  textTransform: "var(--fourty-chip-transform, uppercase)",
135
- textAlign: "left",
141
+ textAlign: "start",
136
142
  cursor: "pointer",
137
143
  borderRadius: "var(--fourty-chip-radius, 0px)",
138
144
  maxWidth: "100%",
@@ -493,9 +499,9 @@ function InlineCompletion({
493
499
  {
494
500
  style: {
495
501
  position: "absolute",
496
- right: 0,
502
+ insetInlineEnd: 0,
497
503
  bottom: 0,
498
- paddingLeft: 8,
504
+ paddingInlineStart: 8,
499
505
  color: "var(--color-text-muted)",
500
506
  background: "var(--color-input-bg)"
501
507
  },
@@ -526,13 +532,14 @@ function ClearSessionButton({
526
532
  style
527
533
  }) {
528
534
  const { isMobile } = useFormFactor();
535
+ const newLabel = useLabels().composer.newConversation;
529
536
  return /* @__PURE__ */ jsx4(
530
537
  motion.button,
531
538
  {
532
539
  type: "button",
533
540
  onClick: onClear,
534
- "aria-label": "Start a new conversation",
535
- title: "Start a new conversation",
541
+ "aria-label": newLabel,
542
+ title: newLabel,
536
543
  className: cn(CLEAR_CLASS, className),
537
544
  initial: { opacity: 0 },
538
545
  animate: { opacity: isMobile ? 1 : 0.55 },
@@ -578,6 +585,8 @@ function ConversationHistoryButton({
578
585
  className,
579
586
  style
580
587
  }) {
588
+ const copy = useLabels().composer;
589
+ const locale = useLocale();
581
590
  const [open, setOpen] = React5.useState(false);
582
591
  const rootRef = React5.useRef(null);
583
592
  const { isMobile } = useFormFactor2();
@@ -599,10 +608,10 @@ function ConversationHistoryButton({
599
608
  type: "button",
600
609
  className: `${ROOT_CLASS}__trigger`,
601
610
  onClick: () => setOpen((o) => !o),
602
- "aria-label": "Older conversations",
611
+ "aria-label": copy.olderConversations,
603
612
  "aria-haspopup": "listbox",
604
613
  "aria-expanded": open,
605
- title: "Older conversations",
614
+ title: copy.olderConversations,
606
615
  initial: { opacity: 0 },
607
616
  animate: { opacity: open || isMobile ? 1 : 0.55 },
608
617
  exit: { opacity: 0 },
@@ -636,7 +645,7 @@ function ConversationHistoryButton({
636
645
  style: {
637
646
  position: "absolute",
638
647
  top: 34,
639
- right: 0,
648
+ insetInlineEnd: 0,
640
649
  width: 248,
641
650
  maxHeight: 320,
642
651
  overflowY: "auto",
@@ -666,7 +675,7 @@ function ConversationHistoryButton({
666
675
  alignItems: "center",
667
676
  gap: 8,
668
677
  width: "100%",
669
- textAlign: "left",
678
+ textAlign: "start",
670
679
  border: 0,
671
680
  background: "transparent",
672
681
  cursor: isCurrent ? "default" : "pointer",
@@ -691,7 +700,7 @@ function ConversationHistoryButton({
691
700
  }
692
701
  ),
693
702
  /* @__PURE__ */ jsxs2("span", { style: { flex: "0 0 auto", display: "inline-flex", alignItems: "center", gap: 6 }, children: [
694
- /* @__PURE__ */ jsx5("span", { style: { fontSize: 11, color: "var(--color-text-muted)", letterSpacing: 0.2 }, children: formatRelative(c.updatedAt) }),
703
+ /* @__PURE__ */ jsx5("span", { style: { fontSize: 11, color: "var(--color-text-muted)", letterSpacing: 0.2 }, children: formatRelative(c.updatedAt, copy.since, locale) }),
695
704
  isCurrent && /* @__PURE__ */ jsx5(Check, { size: 13, strokeWidth: 2, "aria-hidden": "true" })
696
705
  ] })
697
706
  ]
@@ -703,16 +712,16 @@ function ConversationHistoryButton({
703
712
  ) })
704
713
  ] });
705
714
  }
706
- function formatRelative(ts) {
715
+ function formatRelative(ts, since, locale) {
707
716
  const diffMs = Date.now() - ts;
708
717
  const min = Math.floor(diffMs / 6e4);
709
- if (min < 1) return "now";
710
- if (min < 60) return `${min}m`;
718
+ if (min < 1) return since.now;
719
+ if (min < 60) return since.minutes(min);
711
720
  const hr = Math.floor(min / 60);
712
- if (hr < 24) return `${hr}h`;
721
+ if (hr < 24) return since.hours(hr);
713
722
  const day = Math.floor(hr / 24);
714
- if (day < 7) return `${day}d`;
715
- return new Date(ts).toLocaleDateString(void 0, { month: "short", day: "numeric" });
723
+ if (day < 7) return since.days(day);
724
+ return new Date(ts).toLocaleDateString(locale, { month: "short", day: "numeric" });
716
725
  }
717
726
 
718
727
  // src/shell/composer/ShareCanvasButton.tsx
@@ -903,6 +912,8 @@ var TICK_OPACITY = 0.35;
903
912
  var TICK_CURRENT_OPACITY = 0.9;
904
913
  function ThreadJumpRail({ marks, className }) {
905
914
  const { isMobile } = useFormFactor4();
915
+ const jumpLabel = useLabels().composer.jumpToEarlier;
916
+ const rtl = useTextDirection() === "rtl";
906
917
  const [open, setOpen] = React7.useState(false);
907
918
  const [rowHoverKey, setRowHoverKey] = React7.useState(null);
908
919
  const rootRef = React7.useRef(null);
@@ -1036,8 +1047,8 @@ function ThreadJumpRail({ marks, className }) {
1036
1047
  // rail is far shorter than the desktop stack, and a fixed 160 here would
1037
1048
  // strand the popover mid-panel.
1038
1049
  bottom: chipAreaPx(isMobile) + 8,
1039
- left: 0,
1040
- right: 6,
1050
+ insetInlineStart: 0,
1051
+ insetInlineEnd: 6,
1041
1052
  zIndex: 40,
1042
1053
  pointerEvents: open ? "auto" : "none"
1043
1054
  },
@@ -1049,7 +1060,7 @@ function ThreadJumpRail({ marks, className }) {
1049
1060
  className: `${ROOT_CLASS2}__track`,
1050
1061
  role: "button",
1051
1062
  tabIndex: 0,
1052
- "aria-label": "Jump to an earlier message",
1063
+ "aria-label": jumpLabel,
1053
1064
  "aria-expanded": open,
1054
1065
  "data-scrubbing": scrubbing ? "true" : void 0,
1055
1066
  onClick: () => setOpen((o) => isMobile ? !o : true),
@@ -1066,7 +1077,7 @@ function ThreadJumpRail({ marks, className }) {
1066
1077
  style: {
1067
1078
  position: "absolute",
1068
1079
  top: "50%",
1069
- right: 0,
1080
+ insetInlineEnd: 0,
1070
1081
  transform: "translateY(-50%)",
1071
1082
  display: "flex",
1072
1083
  flexDirection: "column",
@@ -1125,11 +1136,11 @@ function ThreadJumpRail({ marks, className }) {
1125
1136
  // the text column to the band's right edge (`right: 0`), and the
1126
1137
  // cluster hides underneath it. Rows therefore span the full width,
1127
1138
  // which is what puts the cursor on a row the instant it opens.
1128
- // `transformOrigin: right center` grows the panel leftward out of
1129
- // where the cluster was.
1130
- left: 12,
1131
- right: 0,
1132
- transformOrigin: "right center",
1139
+ // Origin at the inline end grows the panel toward the start, out
1140
+ // of where the cluster was.
1141
+ insetInlineStart: 12,
1142
+ insetInlineEnd: 0,
1143
+ transformOrigin: rtl ? "left center" : "right center",
1133
1144
  // Under the cluster in the same stacking context, so the cluster's
1134
1145
  // fade-out reads over the panel rather than beneath it.
1135
1146
  zIndex: 1,
@@ -1163,7 +1174,7 @@ function ThreadJumpRail({ marks, className }) {
1163
1174
  style: {
1164
1175
  display: "block",
1165
1176
  width: "100%",
1166
- textAlign: "left",
1177
+ textAlign: "start",
1167
1178
  // Hairline separator between rows — inline (a brand CSS
1168
1179
  // rule can't fight an inline `border: 0`), themeable via
1169
1180
  // the separator token.
@@ -1236,8 +1247,9 @@ function Composer({
1236
1247
  // Brand-neutral default — @fourty/ui is shared infra and must not carry
1237
1248
  // any brand's catalog vocabulary. Brands pass their own voice via the
1238
1249
  // `placeholder` prop; the agent's `composer.placeholder.examples`
1239
- // rotation overrides either once a turn lands.
1240
- placeholder = "Ask for anything\u2026",
1250
+ // rotation overrides either once a turn lands. Absent, the space's
1251
+ // language supplies it (`composer.placeholder`).
1252
+ placeholder: placeholderProp,
1241
1253
  starterSuggestions,
1242
1254
  threadHistory,
1243
1255
  onChipSelect,
@@ -1245,6 +1257,9 @@ function Composer({
1245
1257
  shareCanvas = false,
1246
1258
  attachments: attachmentsController
1247
1259
  }) {
1260
+ const composerCopy = useLabels().composer;
1261
+ const rtl = useTextDirection() === "rtl";
1262
+ const placeholder = placeholderProp === void 0 ? composerCopy.placeholder : placeholderProp;
1248
1263
  const session = useFourtySession2();
1249
1264
  const { isStreaming, hasCommittedTurns } = useConversationState();
1250
1265
  const hydrated = useHydrated();
@@ -1328,7 +1343,7 @@ function Composer({
1328
1343
  // The panel reads as a stencilled slab against the canvas, not a
1329
1344
  // floating card. (CB overrides via `.ams-side-panel` in its
1330
1345
  // layout.css.)
1331
- borderLeft: "1.5px solid var(--color-text)",
1346
+ borderInlineStart: "1.5px solid var(--color-text)",
1332
1347
  boxShadow: "none",
1333
1348
  display: "flex",
1334
1349
  flexDirection: "column"
@@ -1346,7 +1361,7 @@ function Composer({
1346
1361
  // breathing room (not just clearance) between the secondary
1347
1362
  // history/new-conversation glyphs and the one bordered primary
1348
1363
  // action beside them.
1349
- right: isMobile ? 60 : 12,
1364
+ insetInlineEnd: isMobile ? 60 : 12,
1350
1365
  zIndex: 60,
1351
1366
  display: "inline-flex",
1352
1367
  alignItems: "center",
@@ -1505,7 +1520,7 @@ function Composer({
1505
1520
  // via `--fourty-chat-underline: transparent` and relies on the
1506
1521
  // border-color ring instead. Default preserves the base look.
1507
1522
  background: "var(--fourty-chat-underline, var(--color-primary))",
1508
- transformOrigin: "left center",
1523
+ transformOrigin: rtl ? "right center" : "left center",
1509
1524
  pointerEvents: "none"
1510
1525
  }
1511
1526
  }
@@ -1610,7 +1625,7 @@ function Composer({
1610
1625
  {
1611
1626
  type: "button",
1612
1627
  onClick: showStop ? onAbort : submit,
1613
- "aria-label": showStop ? "Stop" : "Send",
1628
+ "aria-label": showStop ? composerCopy.stop : composerCopy.send,
1614
1629
  initial: { scale: 0.92, opacity: 0 },
1615
1630
  animate: { scale: 1, opacity: 1 },
1616
1631
  exit: { scale: 0.92, opacity: 0 },
@@ -1759,7 +1774,9 @@ var CANCEL_CLASS = "fourty-voice-island__cancel";
1759
1774
  var ISLAND_BG = "var(--fourty-voice-island-bg, var(--color-primary))";
1760
1775
  var ISLAND_FG = "var(--fourty-voice-island-fg, var(--color-surface))";
1761
1776
  var WAVE_COLOR = "var(--fourty-voice-wave, var(--fourty-voice-island-fg, var(--color-surface)))";
1762
- function VoiceIsland({ transcript, onStop, onCancel, idleHint = "Listening\u2026" }) {
1777
+ function VoiceIsland({ transcript, onStop, onCancel, idleHint: idleHintProp }) {
1778
+ const copy = useLabels().composer;
1779
+ const idleHint = idleHintProp === void 0 ? copy.listening : idleHintProp;
1763
1780
  const hasText = transcript.trim().length > 0;
1764
1781
  const captionRef = React12.useRef(null);
1765
1782
  React12.useEffect(() => {
@@ -1833,7 +1850,7 @@ function VoiceIsland({ transcript, onStop, onCancel, idleHint = "Listening\u2026
1833
1850
  type: "button",
1834
1851
  className: CANCEL_CLASS,
1835
1852
  onClick: onCancel,
1836
- "aria-label": "Cancel",
1853
+ "aria-label": copy.cancel,
1837
1854
  style: {
1838
1855
  flexShrink: 0,
1839
1856
  display: "inline-flex",
@@ -1857,7 +1874,7 @@ function VoiceIsland({ transcript, onStop, onCancel, idleHint = "Listening\u2026
1857
1874
  type: "button",
1858
1875
  className: STOP_CLASS,
1859
1876
  onClick: onStop,
1860
- "aria-label": "Send now",
1877
+ "aria-label": copy.sendNow,
1861
1878
  style: {
1862
1879
  flexShrink: 0,
1863
1880
  display: "inline-flex",
@@ -2343,6 +2360,7 @@ function IslandComposeGroup({
2343
2360
  attachments,
2344
2361
  taRef
2345
2362
  }) {
2363
+ const writeMessage = useLabels().composer.writeMessage;
2346
2364
  return /* @__PURE__ */ jsxs11(Fragment4, { children: [
2347
2365
  /* @__PURE__ */ jsx17(
2348
2366
  AttachButton,
@@ -2370,7 +2388,7 @@ function IslandComposeGroup({
2370
2388
  "data-form-type": "other",
2371
2389
  placeholder: placeholderAnimated === true ? "" : placeholder,
2372
2390
  rows: 1,
2373
- "aria-label": placeholder.length > 0 ? placeholder : "Write a message",
2391
+ "aria-label": placeholder.length > 0 ? placeholder : writeMessage,
2374
2392
  style: {
2375
2393
  width: "100%",
2376
2394
  // NO `alignSelf`. The row's own `alignItems` (centred at one line,
@@ -2469,6 +2487,7 @@ var STEP_BUTTON_STYLE = {
2469
2487
  function IslandNavButtons() {
2470
2488
  const { canGoBack, goBack } = useCanvasBack();
2471
2489
  const { canGoForward, goForward } = useCanvasForward();
2490
+ const copy = useLabels().composer;
2472
2491
  if (!canGoBack && !canGoForward) return null;
2473
2492
  return /* @__PURE__ */ jsxs12(Fragment5, { children: [
2474
2493
  canGoBack && /* @__PURE__ */ jsx18(
@@ -2477,9 +2496,9 @@ function IslandNavButtons() {
2477
2496
  type: "button",
2478
2497
  className: "fourty-island-back",
2479
2498
  onClick: goBack,
2480
- "aria-label": "Back",
2499
+ "aria-label": copy.back,
2481
2500
  style: STEP_BUTTON_STYLE,
2482
- children: /* @__PURE__ */ jsx18(ChevronLeft, { size: 19, strokeWidth: 1.8 })
2501
+ children: /* @__PURE__ */ jsx18(ChevronLeft, { className: "rtl:-scale-x-100", size: 19, strokeWidth: 1.8 })
2483
2502
  }
2484
2503
  ),
2485
2504
  canGoForward && /* @__PURE__ */ jsx18(
@@ -2488,9 +2507,9 @@ function IslandNavButtons() {
2488
2507
  type: "button",
2489
2508
  className: "fourty-island-forward",
2490
2509
  onClick: goForward,
2491
- "aria-label": "Forward",
2510
+ "aria-label": copy.forward,
2492
2511
  style: STEP_BUTTON_STYLE,
2493
- children: /* @__PURE__ */ jsx18(ChevronRight, { size: 19, strokeWidth: 1.8 })
2512
+ children: /* @__PURE__ */ jsx18(ChevronRight, { className: "rtl:-scale-x-100", size: 19, strokeWidth: 1.8 })
2494
2513
  }
2495
2514
  )
2496
2515
  ] });
@@ -2501,7 +2520,7 @@ import { AudioLines, ArrowUp as ArrowUp3, Square as Square2 } from "lucide-react
2501
2520
  import { jsx as jsx19 } from "react/jsx-runtime";
2502
2521
  var STAMP_BUTTON_STYLE = {
2503
2522
  flexShrink: 0,
2504
- marginLeft: 2,
2523
+ marginInlineStart: 2,
2505
2524
  height: 34,
2506
2525
  width: 34,
2507
2526
  border: 0,
@@ -2513,11 +2532,12 @@ var STAMP_BUTTON_STYLE = {
2513
2532
  color: "var(--fourty-island-surface, var(--color-primary, var(--fourty-color-primary, #000000)))"
2514
2533
  };
2515
2534
  function IslandTrailingAction({ state }) {
2535
+ const copy = useLabels().composer;
2516
2536
  if (state.kind === "send") {
2517
- return /* @__PURE__ */ jsx19("button", { type: "button", className: "fourty-island-send", onClick: state.onSend, "aria-label": "Send", style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx19(ArrowUp3, { size: 18, strokeWidth: 2.2 }) });
2537
+ return /* @__PURE__ */ jsx19("button", { type: "button", className: "fourty-island-send", onClick: state.onSend, "aria-label": copy.send, style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx19(ArrowUp3, { size: 18, strokeWidth: 2.2 }) });
2518
2538
  }
2519
2539
  if (state.kind === "stop") {
2520
- return /* @__PURE__ */ jsx19("button", { type: "button", className: "fourty-island-stop", onClick: state.onStop, "aria-label": "Stop", style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx19(Square2, { size: 13, strokeWidth: 1.5, fill: "currentColor" }) });
2540
+ return /* @__PURE__ */ jsx19("button", { type: "button", className: "fourty-island-stop", onClick: state.onStop, "aria-label": copy.stop, style: STAMP_BUTTON_STYLE, children: /* @__PURE__ */ jsx19(Square2, { size: 13, strokeWidth: 1.5, fill: "currentColor" }) });
2521
2541
  }
2522
2542
  return /* @__PURE__ */ jsx19(
2523
2543
  "button",
@@ -2601,7 +2621,7 @@ function IslandInputBar({
2601
2621
  onNotchClick();
2602
2622
  }
2603
2623
  },
2604
- "aria-label": notchExpanded ? "Show less detail" : "Show more detail",
2624
+ "aria-label": notchExpanded ? labels.composer.showLessDetail : labels.composer.showMoreDetail,
2605
2625
  "aria-expanded": notchExpanded,
2606
2626
  className: "fourty-island-notch",
2607
2627
  "data-expanded": notchExpanded ? "true" : "false",
@@ -2996,6 +3016,7 @@ var GRIP_H = ISLAND_GRIP_H;
2996
3016
  var MorphIsland = React20.forwardRef(
2997
3017
  function MorphIsland2({ placeholder, placeholderExamples, attachments, onSpeak, folded, restGapPx, onSummon, historySheet, bottomOffset, enterFromFloor = false, sheetFlush, onOpenChange, onIslandHeightChange, onComposeFocusChange, collapsedMark }, ref) {
2998
3018
  const onChipSelect = useComposerChipSelect();
3019
+ const threadCopy = useLabels().thread;
2999
3020
  const reducedMotion = usePrefersReducedMotion();
3000
3021
  const progress = useMotionValue(0);
3001
3022
  const dockRef = React20.useRef(null);
@@ -3320,7 +3341,7 @@ var MorphIsland = React20.forwardRef(
3320
3341
  "data-folded": folded ? "true" : "false",
3321
3342
  onTap: folded ? () => onSummon?.() : void 0,
3322
3343
  role: folded ? "button" : void 0,
3323
- "aria-label": folded ? "Show the assistant" : void 0,
3344
+ "aria-label": folded ? threadCopy.showAssistant : void 0,
3324
3345
  layout: !active && !folded && !folding,
3325
3346
  style: {
3326
3347
  position: "absolute",
@@ -3423,7 +3444,7 @@ var MorphIsland = React20.forwardRef(
3423
3444
  snapTo(atSheet ? 0 : ladder[ladder.length - 1]);
3424
3445
  }
3425
3446
  },
3426
- "aria-label": atSheet ? "Close the conversation" : "Open the conversation",
3447
+ "aria-label": atSheet ? threadCopy.close : threadCopy.open,
3427
3448
  style: {
3428
3449
  position: "relative",
3429
3450
  zIndex: 3,
@@ -3685,6 +3706,7 @@ function useKeyboardInset(ref) {
3685
3706
  import { jsx as jsx24, jsxs as jsxs16 } from "react/jsx-runtime";
3686
3707
  function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, onIslandHeightChange, enterFromFloor, collapsedMark }) {
3687
3708
  const session = useFourtySession6();
3709
+ const micDeniedText = useLabels().composer.micDenied;
3688
3710
  const layout = useDisplayedLayout();
3689
3711
  const [mode, setMode] = React24.useState("rest");
3690
3712
  const attach = useComposerAttachments();
@@ -3814,7 +3836,7 @@ function MobileVoiceConsole({ placeholder, placeholderExamples, historySheet, on
3814
3836
  MorphIsland,
3815
3837
  {
3816
3838
  ref: morphRef,
3817
- placeholder: micDeniedNotice ? "Microphone access was denied \u2014 tap to type instead" : placeholder,
3839
+ placeholder: micDeniedNotice ? micDeniedText : placeholder,
3818
3840
  placeholderExamples: micDeniedNotice ? void 0 : placeholderExamples,
3819
3841
  attachments: attach,
3820
3842
  onSpeak: startVoice,
@@ -3903,16 +3925,16 @@ function scrollToTop() {
3903
3925
  const target = document.scrollingElement;
3904
3926
  if (target !== null) target.scrollTop = 0;
3905
3927
  }
3906
- var DEFAULT_PLACEHOLDER = "Ask for anything\u2026";
3907
3928
  function DefaultMobileShell(props) {
3908
3929
  const { messages } = useSessionState();
3909
3930
  const { isSubmitting, isRunning } = useFourtySession7();
3931
+ const defaultPlaceholder = useLabels().composer.placeholder;
3910
3932
  const working = isSubmitting || isRunning;
3911
3933
  const [open, setOpen] = React26.useState(false);
3912
3934
  const toggle = React26.useCallback(() => setOpen((v) => !v), []);
3913
3935
  const dock = React26.useMemo(() => ({ open, toggle }), [open, toggle]);
3914
3936
  const gutter = Math.min(props.gutter === void 0 ? MOBILE_GUTTER_MAX : props.gutter, MOBILE_GUTTER_MAX);
3915
- const placeholder = props.placeholder === void 0 ? DEFAULT_PLACEHOLDER : props.placeholder;
3937
+ const placeholder = props.placeholder === void 0 ? defaultPlaceholder : props.placeholder;
3916
3938
  const canvasGutterStyle = { paddingLeft: gutter, paddingRight: gutter, "--fourty-canvas-gutter": `${gutter}px` };
3917
3939
  const [islandFaceHeight, setIslandFaceHeight] = React26.useState(null);
3918
3940
  const [entryPointClaims, setEntryPointClaims] = React26.useState(0);
@@ -4180,6 +4202,7 @@ function MenuColumn({
4180
4202
  column,
4181
4203
  onPick
4182
4204
  }) {
4205
+ const dir = useTextDirection();
4183
4206
  return /* @__PURE__ */ jsxs19("div", { style: { minWidth: 132, display: "flex", flexDirection: "column" }, children: [
4184
4207
  /* @__PURE__ */ jsx29(
4185
4208
  "div",
@@ -4200,13 +4223,13 @@ function MenuColumn({
4200
4223
  {
4201
4224
  type: "button",
4202
4225
  onClick: () => onPick(l),
4203
- whileHover: { x: 3, opacity: 1 },
4226
+ whileHover: { x: mirrorX(dir, 3), opacity: 1 },
4204
4227
  transition: { duration: 0.14, ease: [0.22, 1, 0.36, 1] },
4205
4228
  style: {
4206
4229
  border: 0,
4207
4230
  background: "transparent",
4208
4231
  cursor: "pointer",
4209
- textAlign: "left",
4232
+ textAlign: "start",
4210
4233
  padding: "7px 0",
4211
4234
  fontFamily: "var(--font-display)",
4212
4235
  fontSize: 13,
@@ -4228,21 +4251,23 @@ function MenuFlyout({
4228
4251
  item,
4229
4252
  onPick
4230
4253
  }) {
4254
+ const categoriesLabel = useLabels().menu.categories;
4255
+ const from = mirrorX(useTextDirection(), -10);
4231
4256
  const columns = item.megaMenu?.columns;
4232
4257
  if (columns === void 0 || columns.length === 0) return null;
4233
4258
  return /* @__PURE__ */ jsx30(
4234
4259
  motion.div,
4235
4260
  {
4236
- initial: { opacity: 0, x: -10 },
4261
+ initial: { opacity: 0, x: from },
4237
4262
  animate: { opacity: 1, x: 0 },
4238
- exit: { opacity: 0, x: -10 },
4263
+ exit: { opacity: 0, x: from },
4239
4264
  transition: { duration: 0.18, ease: [0.22, 1, 0.36, 1] },
4240
4265
  role: "menu",
4241
- "aria-label": `${item.label} categories`,
4266
+ "aria-label": categoriesLabel(item.label),
4242
4267
  style: {
4243
4268
  width: "min(440px, 52vw)",
4244
4269
  background: "var(--color-surface)",
4245
- borderRight: "1.5px solid var(--color-text)",
4270
+ borderInlineEnd: "1.5px solid var(--color-text)",
4246
4271
  padding: "64px 28px 28px",
4247
4272
  overflowY: "auto",
4248
4273
  display: "flex",
@@ -4272,7 +4297,7 @@ function MenuAccordionPanel({
4272
4297
  motion.div,
4273
4298
  {
4274
4299
  role: "menu",
4275
- "aria-label": `${item.label} categories`,
4300
+ "aria-label": labels.menu.categories(item.label),
4276
4301
  initial: { height: 0, opacity: 0 },
4277
4302
  animate: { height: "auto", opacity: 1 },
4278
4303
  exit: { height: 0, opacity: 0 },
@@ -4314,12 +4339,12 @@ function MenuAccordionPanel({
4314
4339
  fontWeight: 600,
4315
4340
  letterSpacing: "0.06em",
4316
4341
  textTransform: "uppercase",
4317
- textAlign: "left",
4342
+ textAlign: "start",
4318
4343
  color: "var(--color-text)"
4319
4344
  },
4320
4345
  children: [
4321
4346
  /* @__PURE__ */ jsx31("span", { children: labels.menu.shopAll(item.label) }),
4322
- /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", style: { opacity: 0.5 }, children: "\u2192" })
4347
+ /* @__PURE__ */ jsx31("span", { "aria-hidden": "true", className: "rtl:inline-block rtl:-scale-x-100", style: { opacity: 0.5 }, children: "\u2192" })
4323
4348
  ]
4324
4349
  }
4325
4350
  ),
@@ -4340,6 +4365,7 @@ function MenuNav({
4340
4365
  onOpenChange,
4341
4366
  onPick
4342
4367
  }) {
4368
+ const rest = useTextDirection() === "rtl" ? "scaleX(-1)" : "none";
4343
4369
  return /* @__PURE__ */ jsx32("nav", { style: { display: "flex", flexDirection: "column", paddingBottom: 24 }, children: items.map((item, i) => {
4344
4370
  const hasMega = item.megaMenu !== void 0 && item.megaMenu.columns.length > 0;
4345
4371
  const isOpen = openIndex === i;
@@ -4379,7 +4405,7 @@ function MenuNav({
4379
4405
  fontWeight: 600,
4380
4406
  letterSpacing: "0.04em",
4381
4407
  textTransform: "uppercase",
4382
- textAlign: "left"
4408
+ textAlign: "start"
4383
4409
  },
4384
4410
  children: [
4385
4411
  /* @__PURE__ */ jsx32("span", { children: item.label }),
@@ -4392,7 +4418,7 @@ function MenuNav({
4392
4418
  opacity: inverted ? 0.9 : 0.5,
4393
4419
  // Accordion: rotate the › chevron down to ⌄ when the row is
4394
4420
  // open, so the glyph itself carries the expand/collapse state.
4395
- transform: mode === "accordion" && hasMega && isOpen ? "rotate(90deg)" : "none",
4421
+ transform: mode === "accordion" && hasMega && isOpen ? "rotate(90deg)" : rest,
4396
4422
  transition: "transform 0.2s ease"
4397
4423
  },
4398
4424
  children: hasMega ? "\u203A" : "\u2192"
@@ -4413,11 +4439,12 @@ function MenuTrigger({
4413
4439
  icon,
4414
4440
  label
4415
4441
  }) {
4442
+ const openLabel = useLabels().menu.open;
4416
4443
  return /* @__PURE__ */ jsxs22(
4417
4444
  motion.button,
4418
4445
  {
4419
4446
  type: "button",
4420
- "aria-label": "Open menu",
4447
+ "aria-label": openLabel,
4421
4448
  onClick,
4422
4449
  ...pressPresets.icon,
4423
4450
  style: {
@@ -4452,6 +4479,8 @@ function MenuDrawer({
4452
4479
  onSelectItem,
4453
4480
  panelWidth = DEFAULT_PANEL_WIDTH
4454
4481
  }) {
4482
+ const copy = useLabels().menu;
4483
+ const offscreen = mirrorX(useTextDirection(), "-100%");
4455
4484
  const pick = React30.useCallback(
4456
4485
  (item) => {
4457
4486
  onClose();
@@ -4493,12 +4522,12 @@ function MenuDrawer({
4493
4522
  style: {
4494
4523
  position: "fixed",
4495
4524
  top: 0,
4496
- left: 0,
4525
+ insetInlineStart: 0,
4497
4526
  bottom: 0,
4498
4527
  // The panel's `width: 100%` on mobile resolves against THIS box,
4499
4528
  // so it has to span the viewport too — auto width (desktop, where
4500
4529
  // the flyout sizes it) would collapse it to nothing.
4501
- right: isMobile ? 0 : void 0,
4530
+ insetInlineEnd: isMobile ? 0 : void 0,
4502
4531
  zIndex: 61,
4503
4532
  display: "flex",
4504
4533
  alignItems: "stretch"
@@ -4507,13 +4536,13 @@ function MenuDrawer({
4507
4536
  /* @__PURE__ */ jsxs22(
4508
4537
  motion.aside,
4509
4538
  {
4510
- initial: { x: "-100%" },
4539
+ initial: { x: offscreen },
4511
4540
  animate: { x: 0 },
4512
- exit: { x: "-100%" },
4541
+ exit: { x: offscreen },
4513
4542
  transition: { type: "spring", damping: 36, stiffness: 320 },
4514
4543
  role: "dialog",
4515
4544
  "aria-modal": "true",
4516
- "aria-label": "Site menu",
4545
+ "aria-label": copy.site,
4517
4546
  onKeyDown: (e) => {
4518
4547
  if (e.key === "Escape") onClose();
4519
4548
  },
@@ -4527,7 +4556,7 @@ function MenuDrawer({
4527
4556
  width: isMobile ? "100%" : panelWidth,
4528
4557
  maxWidth: isMobile ? "100%" : "86%",
4529
4558
  background: "var(--color-surface)",
4530
- borderRight: "1.5px solid var(--color-text)",
4559
+ borderInlineEnd: "1.5px solid var(--color-text)",
4531
4560
  display: "flex",
4532
4561
  flexDirection: "column",
4533
4562
  overflowY: "auto"
@@ -4548,7 +4577,7 @@ function MenuDrawer({
4548
4577
  motion.button,
4549
4578
  {
4550
4579
  type: "button",
4551
- "aria-label": "Close menu",
4580
+ "aria-label": copy.close,
4552
4581
  onClick: onClose,
4553
4582
  whileHover: { background: "var(--color-text)", color: "var(--color-surface)" },
4554
4583
  whileTap: { scale: 0.94 },
@@ -4608,6 +4637,7 @@ function MenuNavBar({
4608
4637
  onSelectItem,
4609
4638
  gap = 26
4610
4639
  }) {
4640
+ const copy = useLabels().menu;
4611
4641
  const [openIndex, setOpenIndex] = React31.useState(null);
4612
4642
  const pick = React31.useCallback(
4613
4643
  (item) => {
@@ -4619,7 +4649,7 @@ function MenuNavBar({
4619
4649
  return /* @__PURE__ */ jsx34(
4620
4650
  "nav",
4621
4651
  {
4622
- "aria-label": "Site menu",
4652
+ "aria-label": copy.site,
4623
4653
  onMouseLeave: () => setOpenIndex(null),
4624
4654
  style: {
4625
4655
  pointerEvents: "auto",
@@ -4674,11 +4704,11 @@ function MenuNavBar({
4674
4704
  exit: { opacity: 0, y: -6 },
4675
4705
  transition: { duration: 0.16, ease: [0.22, 1, 0.36, 1] },
4676
4706
  role: "menu",
4677
- "aria-label": `${item.label} categories`,
4707
+ "aria-label": copy.categories(item.label),
4678
4708
  style: {
4679
4709
  position: "absolute",
4680
4710
  top: "100%",
4681
- left: 0,
4711
+ insetInlineStart: 0,
4682
4712
  paddingTop: 14,
4683
4713
  zIndex: 55
4684
4714
  },
@@ -4828,7 +4858,7 @@ function LauncherDock({
4828
4858
  style: {
4829
4859
  position: "absolute",
4830
4860
  top,
4831
- right,
4861
+ insetInlineEnd: right,
4832
4862
  zIndex,
4833
4863
  display: "inline-flex",
4834
4864
  alignItems: "center",
@@ -507,7 +507,7 @@ function AgentCaret({
507
507
  display: "inline-block",
508
508
  width: 2,
509
509
  height: height !== void 0 ? height : "1em",
510
- marginLeft: inline ? 2 : 0,
510
+ marginInlineStart: inline ? 2 : 0,
511
511
  verticalAlign: "text-bottom",
512
512
  background: color !== void 0 ? color : "currentColor"
513
513
  };