@keboola/design 16.0.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @keboola/design
2
2
 
3
+ ## 17.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - `MarkdownTable` takes no `surface` prop: its right-edge fade masks the table itself, so it reads on any background in both themes.
8
+ - The fade shows while columns remain to the right, as before.
9
+ - `MessageBubble`'s Show more fold fades the clipped text the same way.
10
+
11
+ ### Patch Changes
12
+
13
+ - `MultiCombobox` keeps its clear and open buttons on the right, outside the chip row, and wraps the input below the chips only when less than 4rem is left beside them.
14
+
15
+ - `EmptyState` wraps its centred text evenly:
16
+ - `EmptyState.Title` balances its lines (`text-wrap: balance`).
17
+ - `EmptyState.Description` avoids a lone word on its last line (`text-wrap: pretty`).
18
+
19
+ - Text keeps its place when Inter swaps in.
20
+ - `Inter Fallback` is Arial (or Liberation Sans) scaled to Inter's width, ascent and descent, one face per Inter weight.
21
+ - Every Inter stack — `html`, `--font-display`, `font-sans`, `font-display` — lists it right after `Inter`.
22
+
23
+ - `MarkdownTable` re-renders only when its overflow state changes.
24
+ - A scroll or resize that leaves the fade and the expand action as they were renders nothing.
25
+
26
+ - `scroll-fade`, `scroll-fade-y` and `scroll-fade-x` (`@keboola/design/theme` and the `@keboola/tailwind-config/scrollFade` plugin) show no fade in browsers without scroll-driven animations (Firefox), so a `Modal.Body` that does not scroll keeps its first line solid there
27
+ - Where `animation-timeline: scroll()` is unsupported, the reveal animations are off and both edges stay solid.
28
+ - `PageLayout`'s nav column applies `scroll-fade-y` without its own `@supports` guard.
29
+
30
+ - Updated dependencies:
31
+ - @keboola/tailwind-config@1.2.1
32
+
33
+ ## 16.1.0
34
+
35
+ ### Minor Changes
36
+
37
+ - `AnswerActions` takes `voteStyle="quiet"`: the recorded vote takes the accent ink with no fill instead of green or red. Off by default.
38
+
39
+ - `SourceChip` and `AnswerSources` take `verifiedStyle="quiet"`: a verified chip wears the plain neutral chip, and the verdict stays in its accessible name. Off by default.
40
+
41
+ - `AnswerSources` takes `trailing`, drawn at the end of the chip row after the "N unverified" flag. Off by default.
42
+
43
+ - `InlineStepLabel` takes `icon`: the step's kind in place of the status mark, the status moved to the accessible name, and a failed step read muted rather than red. `InlineStepGroup` takes `statusMark={false}` to drop the header's mark. Both off by default.
44
+
45
+ - `MessageBubble` takes `footer`, drawn after the `collapseAfterPx` fold and above the time-and-actions row. Off by default. Passing `Number.POSITIVE_INFINITY` as `collapseAfterPx` while an answer streams keeps the body mounted when the real limit arrives.
46
+
47
+ - `Markdown` and `Markdown.Block` take `caret`: `writing` draws a blinking caret at the end of the last block, `finishing` stills it and adds `finishingLabel` ("Finishing…"). Still under reduced motion. Off by default.
48
+
3
49
  ## 16.0.0
4
50
 
5
51
  ### Major Changes
@@ -2120,40 +2120,37 @@ Markdown.Block = MarkdownBlock;
2120
2120
  /** How much wider than its column a table has to be before the column is the wrong surface. */
2121
2121
  const EXPAND_RATIO = 1.5;
2122
2122
  /**
2123
- * The fade's end colour — must match the host's surface, or it draws a strip over the data.
2124
- *
2125
- * - Full class strings: Tailwind reads literals.
2126
- */
2127
- const FADE_SURFACE = {
2128
- card: "tw:from-card",
2129
- background: "tw:from-background"
2130
- };
2131
- /**
2132
2123
  * A table in an answer that shows when it is cut off on the right.
2133
2124
  *
2134
2125
  * - Controls sit in a fixed-height rail above the grid, so they never cover rows or shift them.
2135
2126
  * - The fade shows only while content remains to the right.
2136
- * - A painted gradient, not `tw:scroll-fade-x`: that needs scroll-driven animations, which the
2127
+ * - A static mask, not `tw:scroll-fade-x`: that needs scroll-driven animations, which the
2137
2128
  * `baseline-widely-available` build floor lacks, and must sit on `Table`'s own container.
2138
2129
  * - Past `EXPAND_RATIO` the expand action shows without hover.
2139
2130
  */
2140
- const MarkdownTable = ({ children, actions, onExpand, surface = "card", sortable = false, className }) => {
2131
+ const MarkdownTable = ({ children, actions, onExpand, sortable = false, className }) => {
2141
2132
  const frameRef = useRef(null);
2142
2133
  const [overflow, setOverflow] = useState({
2143
2134
  scrollable: false,
2144
2135
  atEnd: true,
2145
- ratio: 1
2136
+ wide: false
2146
2137
  });
2138
+ /**
2139
+ * Reads `Table`'s own container (the frame's first child); the frame stays visible for the fade.
2140
+ *
2141
+ * - Keeps the previous state while no flag flips, so a scroll or resize that crosses no edge renders nothing.
2142
+ */
2147
2143
  const measure = useCallback(() => {
2148
2144
  const box = frameRef.current?.firstElementChild;
2149
2145
  if (!box) return;
2150
2146
  const { scrollLeft, scrollWidth, clientWidth } = box;
2151
2147
  const hidden = scrollWidth - clientWidth;
2152
- setOverflow({
2148
+ const next = {
2153
2149
  scrollable: hidden > 1,
2154
2150
  atEnd: scrollLeft >= hidden - 1,
2155
- ratio: clientWidth > 0 ? scrollWidth / clientWidth : 1
2156
- });
2151
+ wide: clientWidth > 0 && scrollWidth / clientWidth >= EXPAND_RATIO
2152
+ };
2153
+ setOverflow((prev) => prev.scrollable === next.scrollable && prev.atEnd === next.atEnd && prev.wide === next.wide ? prev : next);
2157
2154
  }, []);
2158
2155
  useEffect(() => {
2159
2156
  const box = frameRef.current?.firstElementChild;
@@ -2168,7 +2165,7 @@ const MarkdownTable = ({ children, actions, onExpand, surface = "card", sortable
2168
2165
  observer.disconnect();
2169
2166
  };
2170
2167
  }, [measure]);
2171
- const showExpand = !!onExpand && overflow.scrollable && overflow.ratio >= EXPAND_RATIO;
2168
+ const showExpand = !!onExpand && overflow.scrollable && overflow.wide;
2172
2169
  return /* @__PURE__ */ jsxs("div", {
2173
2170
  className,
2174
2171
  children: [(actions || onExpand) && /* @__PURE__ */ jsxs("div", {
@@ -2184,14 +2181,10 @@ const MarkdownTable = ({ children, actions, onExpand, surface = "card", sortable
2184
2181
  children: [/* @__PURE__ */ jsx(Maximize2, { className: "tw:size-3.5" }), "Open wider"]
2185
2182
  })
2186
2183
  })]
2187
- }), /* @__PURE__ */ jsxs("div", {
2184
+ }), /* @__PURE__ */ jsx("div", {
2188
2185
  ref: frameRef,
2189
- className: "tw:relative",
2190
- children: [sortable ? /* @__PURE__ */ jsx(TableSortProvider, { children }) : children, overflow.scrollable && !overflow.atEnd && /* @__PURE__ */ jsx("span", {
2191
- "aria-hidden": true,
2192
- "data-testid": "markdown-table-fade",
2193
- className: cn("tw:pointer-events-none tw:absolute tw:inset-y-px tw:right-px tw:w-12 tw:rounded-r-[10px] tw:bg-gradient-to-l tw:to-transparent", FADE_SURFACE[surface])
2194
- })]
2186
+ className: overflow.atEnd ? void 0 : "tw:mask-r-from-[calc(100%-3rem)]",
2187
+ children: sortable ? /* @__PURE__ */ jsx(TableSortProvider, { children }) : children
2195
2188
  })]
2196
2189
  });
2197
2190
  };
@@ -2200,9 +2193,10 @@ const MarkdownTable = ({ children, actions, onExpand, surface = "card", sortable
2200
2193
  * Clips tall content at `maxHeight` behind a fade, with a Show more / Show less toggle.
2201
2194
  *
2202
2195
  * - The toggle and fade appear only while the content is taller than `maxHeight`.
2196
+ * - The fade masks the content itself, so it reads on any surface.
2203
2197
  * - Height is measured with a `ResizeObserver`; without one (jsdom) nothing is clipped.
2204
2198
  */
2205
- const CollapsedMessageBody = ({ maxHeight, fadeClassName, children }) => {
2199
+ const CollapsedMessageBody = ({ maxHeight, children }) => {
2206
2200
  const contentRef = useRef(null);
2207
2201
  const [isOverflowing, setIsOverflowing] = useState(false);
2208
2202
  const [isExpanded, setIsExpanded] = useState(false);
@@ -2216,16 +2210,13 @@ const CollapsedMessageBody = ({ maxHeight, fadeClassName, children }) => {
2216
2210
  const isClipped = isOverflowing && !isExpanded;
2217
2211
  return /* @__PURE__ */ jsxs("div", {
2218
2212
  className: "tw:flex tw:flex-col tw:items-start tw:gap-1",
2219
- children: [/* @__PURE__ */ jsxs("div", {
2220
- className: "tw:relative tw:w-full tw:overflow-hidden",
2213
+ children: [/* @__PURE__ */ jsx("div", {
2214
+ className: cn("tw:w-full tw:overflow-hidden", isClipped && "tw:mask-b-from-[calc(100%-3rem)]"),
2221
2215
  style: isClipped ? { maxHeight } : void 0,
2222
- children: [/* @__PURE__ */ jsx("div", {
2216
+ children: /* @__PURE__ */ jsx("div", {
2223
2217
  ref: contentRef,
2224
2218
  children
2225
- }), isClipped && /* @__PURE__ */ jsx("div", {
2226
- "aria-hidden": true,
2227
- className: cn("tw:pointer-events-none tw:absolute tw:inset-x-0 tw:bottom-0 tw:h-12 tw:bg-gradient-to-t tw:to-transparent", fadeClassName)
2228
- })]
2219
+ })
2229
2220
  }), isOverflowing && /* @__PURE__ */ jsx(Button, {
2230
2221
  variant: "inline",
2231
2222
  size: "small",
@@ -2344,7 +2335,6 @@ const MessageBubble = ({ variant, children, actions, createdAt, timestamp = "too
2344
2335
  }) : null;
2345
2336
  const body = collapseAfterPx === void 0 ? children : /* @__PURE__ */ jsx(CollapsedMessageBody, {
2346
2337
  maxHeight: collapseAfterPx,
2347
- fadeClassName: variant === "user" ? "tw:from-muted" : "tw:from-background",
2348
2338
  children
2349
2339
  });
2350
2340
  const hasActionsRow = isTimestampVisible || deliveryStatus !== null;
@@ -4595,4 +4585,4 @@ const UsageStats = ({ value, alert = false, children, className, ariaLabel, alig
4595
4585
  };
4596
4586
  export { ANSWER_SOURCES_VISIBLE, AnswerActions, AnswerSources, AnswerSummary, AttachmentChip, CONTEXT_CHIP_EXPANDABLE_LENGTH, ChatInlineIcon, ChatNotice, CollapsibleStepHeader, ContextChip, FileDownloadChip, FileGallery, InlineStepDetail, InlineStepGroup, InlineStepLabel, JumpToLatest, Markdown, MarkdownTable, MessageBubble, ModeChip, PROMPT_INPUT_CONTAINER, PlanApproval, PlanRewritingIndicator, PromptInput, Question, QuestionBlock, SourceChip, SuggestedPrompt, ThinkingIndicator, ToolCallApproval, ToolCallChip, ToolCallStatusHeader, UsageBar, UsageStats, clampPercentage, findMentionToken, findSlashToken, formatPercentage, getChatInlineIconName, splitSealedBlocks, withholdOpenTail };
4597
4587
 
4598
- //# sourceMappingURL=AIKit-Cf5plya2.js.map
4588
+ //# sourceMappingURL=AIKit-CxKkvN0q.js.map