rift-ds 1.30.0 → 1.31.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 (89) hide show
  1. package/README.md +6 -4
  2. package/behaviors/locale.d.ts +7 -0
  3. package/behaviors/locale.js +5 -0
  4. package/behaviors/shell.css +33 -0
  5. package/bin/rift-ds.mjs +35 -9
  6. package/bin/templates/blocks/app/planner/PlannerGrid.tsx +58 -0
  7. package/bin/templates/blocks/app/planner/Requests.tsx +42 -0
  8. package/bin/templates/blocks/app/planner/page.module.css +17 -0
  9. package/bin/templates/blocks/app/planner/page.tsx +32 -0
  10. package/bin/templates/blocks/registry.json +14 -0
  11. package/bin/templates/chat/app/api/chat/route.actions.ts +108 -0
  12. package/bin/templates/chat/components/chat/ChatMount.actions.tsx +55 -0
  13. package/bin/templates/chat/components/chat/ChatMount.tsx +14 -1
  14. package/bin/templates/chat/components/chat/proposals/ProposalCard.tsx +81 -0
  15. package/bin/templates/chat/components/chat/proposals/actions.ts +60 -0
  16. package/bin/templates/chat/components/chat/proposals/confirmation.ts +9 -0
  17. package/bin/templates/chat/components/chat/proposals/renderers.tsx +9 -0
  18. package/chat/ChatLauncher.d.ts +4 -1
  19. package/chat/ChatLauncher.js +6 -1
  20. package/chat/ChatProvider.d.ts +19 -2
  21. package/chat/ChatProvider.js +26 -3
  22. package/chat/ChatWidget.css +10 -0
  23. package/chat/ChatWidget.d.ts +2 -1
  24. package/chat/ChatWidget.js +8 -6
  25. package/chat/actions.d.ts +52 -6
  26. package/chat/actions.js +53 -5
  27. package/chat/contextSchema.d.ts +76 -0
  28. package/chat/contextSchema.js +58 -0
  29. package/chat/index.d.ts +2 -2
  30. package/chat/index.js +5 -1
  31. package/chat/registry.json.d.ts +2 -2
  32. package/chat/registry.json.js +1 -1
  33. package/chat/server.d.ts +18 -2
  34. package/chat/server.js +10 -1
  35. package/chat/suggestions.d.ts +7 -0
  36. package/chat/suggestions.js +13 -1
  37. package/chat/types.d.ts +23 -0
  38. package/chat/useChat.d.ts +2 -2
  39. package/chat/useChat.js +15 -1
  40. package/components/AppSidebar/AppSidebar.css +12 -0
  41. package/components/ButtonGroup/ButtonGroup.css +10 -1
  42. package/components/Chart/RadarChart.js +24 -10
  43. package/components/DataTable/DataTable.css +17 -2
  44. package/components/DataTable/DataTable.d.ts +14 -2
  45. package/components/DataTable/DataTable.js +13 -2
  46. package/components/DataTable/periodColumns.d.ts +37 -0
  47. package/components/DataTable/periodColumns.js +48 -0
  48. package/components/DatePicker/DatePicker.css +22 -6
  49. package/components/DatePicker/DatePicker.d.ts +2 -1
  50. package/components/DatePicker/DatePicker.js +2 -2
  51. package/components/DateRangePicker/DateRangePicker.js +2 -2
  52. package/components/DecisionRow/DecisionRow.css +46 -0
  53. package/components/DecisionRow/DecisionRow.d.ts +62 -0
  54. package/components/DecisionRow/DecisionRow.js +93 -0
  55. package/components/EventCalendar/EventCalendar.css +54 -0
  56. package/components/EventCalendar/EventCalendar.d.ts +27 -5
  57. package/components/EventCalendar/EventCalendar.js +50 -15
  58. package/components/FunnelChart/FunnelChart.js +33 -22
  59. package/components/Globe/Globe.css +7 -0
  60. package/components/Globe/Globe.js +1 -1
  61. package/components/Table/Table.css +7 -0
  62. package/components/Table/Table.js +1 -1
  63. package/components/Tabs/Tabs.css +21 -3
  64. package/components/Timeline/Timeline.css +8 -0
  65. package/components/Widget/Widget.css +2 -0
  66. package/components/WorldMap/WorldMap.css +15 -0
  67. package/components/WorldMap/WorldMap.js +56 -1
  68. package/components/registry.json +20 -3
  69. package/components/registry.json.d.ts +20 -3
  70. package/components/registry.json.js +1 -1
  71. package/index.d.ts +1 -0
  72. package/index.js +6 -0
  73. package/package.json +1 -1
  74. package/tokens/presets/blueprint.css +9 -0
  75. package/tokens/presets/bubblegum.css +9 -0
  76. package/tokens/presets/contrast.css +3 -3
  77. package/tokens/presets/coral.css +3 -3
  78. package/tokens/presets/ember.css +9 -0
  79. package/tokens/presets/getaway.css +9 -0
  80. package/tokens/presets/gold.css +3 -3
  81. package/tokens/presets/mono.css +3 -3
  82. package/tokens/presets/pink.css +3 -3
  83. package/tokens/presets/plum.css +3 -3
  84. package/tokens/presets/signal.css +9 -0
  85. package/tokens/presets/smoke.css +9 -0
  86. package/tokens/presets/velvet.css +9 -0
  87. package/tokens/presets/violet.css +3 -3
  88. package/tokens/presets/volt.css +9 -0
  89. package/tokens/presets/warm.css +3 -3
@@ -73,31 +73,42 @@ const FunnelChart = React.forwardRef(
73
73
  title && /* @__PURE__ */ jsx("h3", { className: `${chartClass}__title`, children: title }),
74
74
  subtitle && /* @__PURE__ */ jsx("p", { className: `${chartClass}__subtitle`, children: subtitle })
75
75
  ] }) }),
76
- /* @__PURE__ */ jsx("div", { className: `${chartClass}__body`, role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(FunnelChart$1, { margin: { top: 4, right: 4, bottom: 4, left: 4 }, children: [
77
- /* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
78
- /* @__PURE__ */ jsx(
79
- Funnel,
80
- {
81
- ...animation,
82
- dataKey: "value",
83
- nameKey: "name",
84
- data: stages,
85
- lastShapeType: "rectangle",
86
- stroke: surfaceColor,
87
- strokeWidth: 2,
88
- children: showLabels && /* @__PURE__ */ jsx(
89
- LabelList,
76
+ /* @__PURE__ */ jsx("div", { className: `${chartClass}__body`, role: "img", "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(ResponsiveContainer, { width: "100%", height, children: /* @__PURE__ */ jsxs(
77
+ FunnelChart$1,
78
+ {
79
+ margin: {
80
+ top: 4,
81
+ right: showLabels ? Math.ceil(Math.max(0, ...stages.map((s) => s.name.length)) * 12 * 0.6) + 12 : 4,
82
+ bottom: 4,
83
+ left: 4
84
+ },
85
+ children: [
86
+ /* @__PURE__ */ jsx(Tooltip, { content: renderTooltip }),
87
+ /* @__PURE__ */ jsx(
88
+ Funnel,
90
89
  {
91
- position: "right",
92
- dataKey: "name",
93
- fill: textSecondary,
94
- stroke: "none",
95
- fontSize: 12
90
+ ...animation,
91
+ dataKey: "value",
92
+ nameKey: "name",
93
+ data: stages,
94
+ lastShapeType: "rectangle",
95
+ stroke: surfaceColor,
96
+ strokeWidth: 2,
97
+ children: showLabels && /* @__PURE__ */ jsx(
98
+ LabelList,
99
+ {
100
+ position: "right",
101
+ dataKey: "name",
102
+ fill: textSecondary,
103
+ stroke: "none",
104
+ fontSize: 12
105
+ }
106
+ )
96
107
  }
97
108
  )
98
- }
99
- )
100
- ] }) }) })
109
+ ]
110
+ }
111
+ ) }) })
101
112
  ] });
102
113
  }
103
114
  );
@@ -124,6 +124,13 @@
124
124
  /* The ring sits on the hit circle itself, with no offset: the callout opens
125
125
  beside the marker with its text one padding step from the centre, and an
126
126
  offset ring reached into that text. */
127
+ /* A marker on the far hemisphere is drawn faint behind the sphere, so its
128
+ button never takes the pointer from a front marker it shares a spot
129
+ with. It stays in the tab order: the keyboard reaches every point. */
130
+ .ds-globe__marker--back {
131
+ pointer-events: none;
132
+ }
133
+
127
134
  .ds-globe__marker:focus-visible {
128
135
  outline: var(--border-050) solid var(--color-action-primary-bg);
129
136
  outline-offset: 0;
@@ -437,7 +437,7 @@ const Globe = React.forwardRef(
437
437
  "button",
438
438
  {
439
439
  type: "button",
440
- className: `${baseClass}__marker`,
440
+ className: `${baseClass}__marker${at.visible ? "" : ` ${baseClass}__marker--back`}`,
441
441
  style: {
442
442
  left: pct(at.x / VIEW * 100),
443
443
  top: pct(at.y / VIEW * 100),
@@ -154,7 +154,14 @@
154
154
  (design.md's responsive contract). Natural column widths below the
155
155
  mobile breakpoint force the overflow the wrapper exists to catch —
156
156
  without this the table crushes to the viewport and cells clip. */
157
+ /* The plain table's scroll container: no surface of its own. */
158
+ .ds-table__scroll {
159
+ overflow-x: auto;
160
+ max-width: 100%;
161
+ }
162
+
157
163
  @media (max-width: 768px) {
164
+ .ds-table__scroll .ds-table,
158
165
  .ds-table__wrapper .ds-table {
159
166
  min-width: max-content;
160
167
  }
@@ -83,7 +83,7 @@ const Table = React.forwardRef(
83
83
  region
84
84
  ] });
85
85
  }
86
- return table;
86
+ return /* @__PURE__ */ jsx(ScrollRegion, { className: `${baseClass}__scroll`, children: table });
87
87
  }
88
88
  );
89
89
  Table.displayName = "Table";
@@ -3,11 +3,25 @@
3
3
  Horizontal tab navigation with underline
4
4
  ============================================ */
5
5
 
6
+ /* A row that does not fit its container scrolls inline rather than running
7
+ off the page: the tabs never wrap or shrink, the scrollbar is hidden (a
8
+ swipe, a trackpad or the arrow keys, whose focus scrolls the tab into
9
+ view, all move it), and the baseline is drawn as a background so the
10
+ scroll container's clipping cannot cut the active underline that sits
11
+ on it. */
6
12
  .ds-tabs {
7
13
  display: inline-flex;
8
14
  align-items: stretch;
9
15
  gap: 0;
10
- border-bottom: var(--border-025) solid var(--color-bg-container-border);
16
+ max-width: 100%;
17
+ overflow-x: auto;
18
+ overflow-y: hidden;
19
+ scrollbar-width: none;
20
+ background: linear-gradient(var(--color-bg-container-border), var(--color-bg-container-border)) bottom / 100% var(--border-025) no-repeat;
21
+ }
22
+
23
+ .ds-tabs::-webkit-scrollbar {
24
+ display: none;
11
25
  }
12
26
 
13
27
  /* ============================================
@@ -19,8 +33,11 @@
19
33
  width: 100%;
20
34
  }
21
35
 
36
+ /* Equal shares of the row, but never narrower than a label: past that the
37
+ row scrolls like any other. */
22
38
  .ds-tabs--full-width .ds-tabs__tab {
23
- flex: 1;
39
+ flex: 1 1 0;
40
+ min-width: max-content;
24
41
  }
25
42
 
26
43
  /* ============================================
@@ -34,8 +51,9 @@
34
51
  gap: var(--gap-200); /* 8px */
35
52
  padding: var(--padding-200) var(--padding-400); /* 8px 16px */
36
53
  border: none;
54
+ flex: none;
55
+ white-space: nowrap;
37
56
  border-bottom: var(--border-050) solid transparent;
38
- margin-bottom: calc(var(--border-025) * -1); /* Overlap the container border */
39
57
  background: none;
40
58
  cursor: pointer;
41
59
  position: relative;
@@ -369,3 +369,11 @@
369
369
  var(--color-bg-container-primary-transparent)
370
370
  );
371
371
  }
372
+
373
+ /* A horizontal stepper's steps share the row equally, so a long word in a
374
+ title or description wraps inside its step rather than drawing over the
375
+ next one. */
376
+ .ds-timeline--horizontal .ds-timeline__title,
377
+ .ds-timeline--horizontal .ds-timeline__description {
378
+ overflow-wrap: break-word;
379
+ }
@@ -83,6 +83,8 @@
83
83
  line-height: var(--font-paragraph-sm-line-height);
84
84
  letter-spacing: var(--font-paragraph-sm-letter-spacing);
85
85
  color: var(--color-text-secondary);
86
+ /* An unbroken name (a file, an id) wraps rather than running out of the tile. */
87
+ overflow-wrap: anywhere;
86
88
  }
87
89
 
88
90
  /* Footer — behind the family's divider, a step below the body */
@@ -167,6 +167,21 @@ button.ds-world-map__marker:hover .ds-world-map__dot {
167
167
  pointer-events: none;
168
168
  }
169
169
 
170
+ /* A label that would run past the map's edge (or under the zoom pill) sits
171
+ on the dot's other side; the component measures and writes data-side. */
172
+ .ds-world-map__label[data-side='start'] {
173
+ left: auto;
174
+ right: 100%;
175
+ padding-left: 0;
176
+ padding-right: var(--padding-100);
177
+ }
178
+
179
+ /* A marker the crop or the zoom pill hides, or a label with room on
180
+ neither side, is hidden outright rather than shown cut. */
181
+ .ds-world-map [data-offstage] {
182
+ visibility: hidden;
183
+ }
184
+
170
185
  .ds-world-map__marker--active .ds-world-map__label {
171
186
  color: var(--color-text-primary);
172
187
  }
@@ -230,6 +230,61 @@ const WorldMap = React.forwardRef(
230
230
  setHoveredId((id) => id === point.id ? null : id);
231
231
  onPointHover?.(null);
232
232
  };
233
+ const zoomPillRef = useRef(null);
234
+ const fitMarkers = () => {
235
+ const root = rootRef.current;
236
+ const frameEl = frameElRef.current;
237
+ if (!root || !frameEl) return;
238
+ const box = root.getBoundingClientRect();
239
+ const pill = zoomPillRef.current?.getBoundingClientRect();
240
+ const underPill = (l, t, r, b) => !!pill && r > pill.left && l < pill.right && b > pill.top && t < pill.bottom;
241
+ const points2 = frameEl.querySelectorAll(
242
+ `:scope > .${baseClass}__marker, :scope > .${baseClass}__marker-slot`
243
+ );
244
+ points2.forEach((el) => {
245
+ const dot = el.querySelector(`.${baseClass}__dot`);
246
+ if (!dot) return;
247
+ const d = dot.getBoundingClientRect();
248
+ const cx2 = d.left + d.width / 2;
249
+ const cy2 = d.top + d.height / 2;
250
+ const shown = cx2 >= box.left && cx2 <= box.right && cy2 >= box.top && cy2 <= box.bottom && !underPill(d.left, d.top, d.right, d.bottom);
251
+ el.toggleAttribute("data-offstage", !shown);
252
+ const label2 = el.querySelector(`.${baseClass}__label`);
253
+ if (!label2 || !shown || !label2.parentElement) return;
254
+ const m = label2.parentElement.getBoundingClientRect();
255
+ const w = label2.offsetWidth;
256
+ const h = label2.offsetHeight;
257
+ const t = cy2 - h / 2;
258
+ const fitsEnd = m.right + w <= box.right && !underPill(m.right, t, m.right + w, t + h);
259
+ const fitsStart = m.left - w >= box.left && !underPill(m.left - w, t, m.left, t + h);
260
+ label2.dataset.side = fitsEnd || !fitsStart ? "end" : "start";
261
+ label2.toggleAttribute("data-offstage", !fitsEnd && !fitsStart);
262
+ });
263
+ };
264
+ const fitMarkersRef = useRef(fitMarkers);
265
+ fitMarkersRef.current = fitMarkers;
266
+ useIsomorphicLayoutEffect(() => fitMarkersRef.current());
267
+ useEffect(() => {
268
+ const root = rootRef.current;
269
+ if (!root) return;
270
+ const refit = () => fitMarkersRef.current();
271
+ const observer = new ResizeObserver(refit);
272
+ observer.observe(root);
273
+ if (frameElRef.current) observer.observe(frameElRef.current);
274
+ const raf = requestAnimationFrame(refit);
275
+ const fonts = typeof document !== "undefined" ? document.fonts : void 0;
276
+ let live = true;
277
+ fonts?.ready.then(() => {
278
+ if (live) refit();
279
+ });
280
+ fonts?.addEventListener("loadingdone", refit);
281
+ return () => {
282
+ live = false;
283
+ cancelAnimationFrame(raf);
284
+ observer.disconnect();
285
+ fonts?.removeEventListener("loadingdone", refit);
286
+ };
287
+ }, []);
233
288
  let graticule = "";
234
289
  if (graticuleStep > 0) {
235
290
  const x1 = x0 + viewW;
@@ -385,7 +440,7 @@ const WorldMap = React.forwardRef(
385
440
  ]
386
441
  }
387
442
  ),
388
- zoomEnabled && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__zoom`, role: "group", "aria-label": zoomControlsLabel, children: [
443
+ zoomEnabled && /* @__PURE__ */ jsxs("div", { ref: zoomPillRef, className: `${baseClass}__zoom`, role: "group", "aria-label": zoomControlsLabel, children: [
389
444
  /* @__PURE__ */ jsx(
390
445
  CircularButton,
391
446
  {
@@ -84,7 +84,10 @@
84
84
  "description": "A change an assistant proposes and the reader confirms, then the record of what happened, with Undo while it can be reversed.",
85
85
  "category": "ai",
86
86
  "client": false,
87
- "partPatterns": [{ "pattern": "button", "part": "buttons" }]
87
+ "partPatterns": [{ "pattern": "button", "part": "buttons" }],
88
+ "alternatives": [
89
+ { "name": "DecisionRow", "when": "the item sits in a list on the page, waiting on the reader’s yes or no" }
90
+ ]
88
91
  },
89
92
  {
90
93
  "name": "ActionReadout",
@@ -636,6 +639,19 @@
636
639
  "client": true,
637
640
  "keys": { "by": "none" }
638
641
  },
642
+ {
643
+ "name": "DecisionRow",
644
+ "label": "Decision row",
645
+ "slug": "decision-row",
646
+ "description": "One item waiting on a yes or a no, as a list row that settles to the decision taken, with Undo while it can be reversed.",
647
+ "category": "data-display",
648
+ "client": true,
649
+ "partPatterns": [{ "pattern": "button", "part": "buttons" }],
650
+ "alternatives": [
651
+ { "name": "ActionCard", "when": "an assistant proposes the change in a chat reply" },
652
+ { "name": "Widget", "when": "the rows only report or link, with no decision to take" }
653
+ ]
654
+ },
639
655
  {
640
656
  "name": "DescriptionList",
641
657
  "label": "Description list",
@@ -761,7 +777,7 @@
761
777
  "name": "EventCalendar",
762
778
  "label": "Event calendar",
763
779
  "slug": "event-calendar",
764
- "description": "A month or a week of events: pills on their days, overflow counts in the month, a legend, and navigation by month or week.",
780
+ "description": "A month, a week or a day of events: pills on their days, overflow counts in the month, a legend that can filter, and a panel for the chosen day.",
765
781
  "category": "data-display",
766
782
  "client": true,
767
783
  "partPatterns": [{ "pattern": "button", "part": "navigation buttons" }]
@@ -1881,7 +1897,8 @@
1881
1897
  "keys": { "by": "none" },
1882
1898
  "alternatives": [
1883
1899
  { "name": "Grid", "when": "cells of any kind should sit in equal columns and share a row’s height" },
1884
- { "name": "FormSection", "when": "the section holds a form’s fields and its own save" }
1900
+ { "name": "FormSection", "when": "the section holds a form’s fields and its own save" },
1901
+ { "name": "DecisionRow", "when": "each row waits on a yes or a no and settles to the answer" }
1885
1902
  ]
1886
1903
  },
1887
1904
  {
@@ -84,7 +84,10 @@ declare const _default: {
84
84
  "description": "A change an assistant proposes and the reader confirms, then the record of what happened, with Undo while it can be reversed.",
85
85
  "category": "ai",
86
86
  "client": false,
87
- "partPatterns": [{ "pattern": "button", "part": "buttons" }]
87
+ "partPatterns": [{ "pattern": "button", "part": "buttons" }],
88
+ "alternatives": [
89
+ { "name": "DecisionRow", "when": "the item sits in a list on the page, waiting on the reader’s yes or no" }
90
+ ]
88
91
  },
89
92
  {
90
93
  "name": "ActionReadout",
@@ -636,6 +639,19 @@ declare const _default: {
636
639
  "client": true,
637
640
  "keys": { "by": "none" }
638
641
  },
642
+ {
643
+ "name": "DecisionRow",
644
+ "label": "Decision row",
645
+ "slug": "decision-row",
646
+ "description": "One item waiting on a yes or a no, as a list row that settles to the decision taken, with Undo while it can be reversed.",
647
+ "category": "data-display",
648
+ "client": true,
649
+ "partPatterns": [{ "pattern": "button", "part": "buttons" }],
650
+ "alternatives": [
651
+ { "name": "ActionCard", "when": "an assistant proposes the change in a chat reply" },
652
+ { "name": "Widget", "when": "the rows only report or link, with no decision to take" }
653
+ ]
654
+ },
639
655
  {
640
656
  "name": "DescriptionList",
641
657
  "label": "Description list",
@@ -761,7 +777,7 @@ declare const _default: {
761
777
  "name": "EventCalendar",
762
778
  "label": "Event calendar",
763
779
  "slug": "event-calendar",
764
- "description": "A month or a week of events: pills on their days, overflow counts in the month, a legend, and navigation by month or week.",
780
+ "description": "A month, a week or a day of events: pills on their days, overflow counts in the month, a legend that can filter, and a panel for the chosen day.",
765
781
  "category": "data-display",
766
782
  "client": true,
767
783
  "partPatterns": [{ "pattern": "button", "part": "navigation buttons" }]
@@ -1881,7 +1897,8 @@ declare const _default: {
1881
1897
  "keys": { "by": "none" },
1882
1898
  "alternatives": [
1883
1899
  { "name": "Grid", "when": "cells of any kind should sit in equal columns and share a row’s height" },
1884
- { "name": "FormSection", "when": "the section holds a form’s fields and its own save" }
1900
+ { "name": "FormSection", "when": "the section holds a form’s fields and its own save" },
1901
+ { "name": "DecisionRow", "when": "each row waits on a yes or a no and settles to the answer" }
1885
1902
  ]
1886
1903
  },
1887
1904
  {