@datalayer/primer-addons 1.0.57 → 1.0.59

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 (81) hide show
  1. package/README.md +66 -0
  2. package/lib/components/appearance/AppearanceControls.d.ts +3 -3
  3. package/lib/components/appearance/AppearanceControls.js +8 -4
  4. package/lib/components/appearance/AppearanceControls.stories.d.ts +1 -1
  5. package/lib/components/appearance/AppearanceControls.stories.js +1 -1
  6. package/lib/components/appearance/AppearanceMenu.d.ts +1 -1
  7. package/lib/components/buttons/Buttons.stories.d.ts +1 -0
  8. package/lib/components/buttons/Buttons.stories.js +10 -1
  9. package/lib/components/buttons/SplitButton.d.ts +82 -0
  10. package/lib/components/buttons/SplitButton.js +63 -0
  11. package/lib/components/buttons/index.d.ts +1 -0
  12. package/lib/components/buttons/index.js +1 -0
  13. package/lib/components/dialog/Dialog.d.ts +62 -0
  14. package/lib/components/dialog/Dialog.js +117 -0
  15. package/lib/components/dialog/index.d.ts +1 -0
  16. package/lib/components/dialog/index.js +5 -0
  17. package/lib/components/emoji/faceEmojis.js +14 -0
  18. package/lib/components/emoji/fluent/loaders.js +13 -0
  19. package/lib/components/emoji/fluent/svg/1f39e.d.ts +2 -0
  20. package/lib/components/emoji/fluent/svg/1f39e.js +9 -0
  21. package/lib/components/emoji/fluent/svg/1f3c3.d.ts +2 -0
  22. package/lib/components/emoji/fluent/svg/1f3c3.js +9 -0
  23. package/lib/components/emoji/fluent/svg/1f3d3.d.ts +2 -0
  24. package/lib/components/emoji/fluent/svg/1f3d3.js +9 -0
  25. package/lib/components/emoji/fluent/svg/1f3e8.d.ts +2 -0
  26. package/lib/components/emoji/fluent/svg/1f3e8.js +9 -0
  27. package/lib/components/emoji/fluent/svg/1f3ea.d.ts +2 -0
  28. package/lib/components/emoji/fluent/svg/1f3ea.js +9 -0
  29. package/lib/components/emoji/fluent/svg/1f50f.d.ts +2 -0
  30. package/lib/components/emoji/fluent/svg/1f50f.js +9 -0
  31. package/lib/components/emoji/fluent/svg/1f510.d.ts +2 -0
  32. package/lib/components/emoji/fluent/svg/1f510.js +9 -0
  33. package/lib/components/emoji/fluent/svg/1f516.d.ts +2 -0
  34. package/lib/components/emoji/fluent/svg/1f516.js +9 -0
  35. package/lib/components/emoji/fluent/svg/1f526.d.ts +2 -0
  36. package/lib/components/emoji/fluent/svg/1f526.js +9 -0
  37. package/lib/components/emoji/fluent/svg/1f6ce.d.ts +2 -0
  38. package/lib/components/emoji/fluent/svg/1f6ce.js +9 -0
  39. package/lib/components/emoji/fluent/svg/1f9fa.d.ts +2 -0
  40. package/lib/components/emoji/fluent/svg/1f9fa.js +9 -0
  41. package/lib/components/emoji/fluent/svg/21a9.d.ts +2 -0
  42. package/lib/components/emoji/fluent/svg/21a9.js +9 -0
  43. package/lib/components/emoji/fluent/svg/2708.d.ts +2 -0
  44. package/lib/components/emoji/fluent/svg/2708.js +9 -0
  45. package/lib/components/hover-card/HoverCardDetails.d.ts +7 -4
  46. package/lib/components/hover-card/HoverCardDetails.js +65 -41
  47. package/lib/components/hover-card/HoverCardLayer.d.ts +6 -5
  48. package/lib/components/hover-card/HoverCardLayer.js +21 -16
  49. package/lib/components/hover-card/useThemedPortalTarget.d.ts +20 -0
  50. package/lib/components/hover-card/useThemedPortalTarget.js +13 -0
  51. package/lib/components/index.d.ts +2 -0
  52. package/lib/components/index.js +2 -0
  53. package/lib/components/layout/Center.d.ts +32 -0
  54. package/lib/components/layout/Center.js +16 -0
  55. package/lib/components/layout/Cluster.d.ts +32 -0
  56. package/lib/components/layout/Cluster.js +14 -0
  57. package/lib/components/layout/Grid.d.ts +40 -0
  58. package/lib/components/layout/Grid.js +26 -0
  59. package/lib/components/layout/HolyGrail.d.ts +76 -0
  60. package/lib/components/layout/HolyGrail.js +51 -0
  61. package/lib/components/layout/Masonry.d.ts +92 -0
  62. package/lib/components/layout/Masonry.js +109 -0
  63. package/lib/components/layout/Sidebar.d.ts +51 -0
  64. package/lib/components/layout/Sidebar.js +18 -0
  65. package/lib/components/layout/Split.d.ts +42 -0
  66. package/lib/components/layout/Split.js +23 -0
  67. package/lib/components/layout/Stack.d.ts +41 -0
  68. package/lib/components/layout/Stack.js +16 -0
  69. package/lib/components/layout/Switcher.d.ts +31 -0
  70. package/lib/components/layout/Switcher.js +22 -0
  71. package/lib/components/layout/index.d.ts +18 -0
  72. package/lib/components/layout/index.js +22 -0
  73. package/lib/components/layout/layoutProps.d.ts +27 -0
  74. package/lib/components/layout/layoutProps.js +13 -0
  75. package/lib/components/layout/masonryEngine.d.ts +85 -0
  76. package/lib/components/layout/masonryEngine.js +240 -0
  77. package/lib/components/layout/masonryLayout.d.ts +45 -0
  78. package/lib/components/layout/masonryLayout.js +113 -0
  79. package/lib/components/sliding-panel/SlidingPanel.js +7 -2
  80. package/lib/theme/themes/metalThemeStyles.js +3 -0
  81. package/package.json +1 -1
@@ -0,0 +1,240 @@
1
+ /*
2
+ * Copyright (c) 2021-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * What lays a masonry out in the page: it reads the widths and heights,
7
+ * asks {@link masonryPlacement} where each item goes and writes that on the
8
+ * items. React renders the items and never their place — no state, no
9
+ * re-render per layout.
10
+ *
11
+ * ## How it stays fast
12
+ *
13
+ * - **One observer.** A single `ResizeObserver` watches the masonry (its
14
+ * width) and every item (its height): a picture that loads late, a font
15
+ * that arrives, a card that opens. It hands over the new sizes, so a
16
+ * change of height costs no read of the page at all.
17
+ * - **One layout per frame.** Whatever changed, and however many items, the
18
+ * observer and the window's `resize` ask for one `requestAnimationFrame`;
19
+ * the layout runs once in it. (Not in the observer's own callback: writing
20
+ * the masonry's height there is a size change of an observed element, the
21
+ * "ResizeObserver loop" error.)
22
+ * - **Reads, then writes — never mixed.** When the column width changes:
23
+ * write every item's width, read every height (the one reflow), write the
24
+ * places. When only heights changed: no read, the places only.
25
+ * - **Only what moved is written.** Each item's last width and place are
26
+ * kept; an item that stays where it was is not touched.
27
+ * - **O(items × columns)** arithmetic on plain numbers.
28
+ *
29
+ * The first layout, and the one after React changed the items, is done by
30
+ * {@link MasonryEngine.sync} in a layout effect: before the browser paints,
31
+ * so no item is ever seen out of place.
32
+ *
33
+ * Sizes are read as `clientWidth` and `offsetHeight`, which an ancestor's
34
+ * transform (a dialog scaling in) does not distort.
35
+ */
36
+ import { masonryColumnCount, masonryColumnWidth, masonryGapPx, masonryPlacement, resolveMasonryResponsive, } from './masonryLayout';
37
+ /** The attribute of a masonry's items. */
38
+ export const MASONRY_ITEM_ATTRIBUTE = 'data-masonry-item';
39
+ /** The attribute of an item that takes the whole width: `full`. */
40
+ export const MASONRY_SPAN_ATTRIBUTE = 'data-masonry-span';
41
+ const px = (value) => `${Math.round(value * 100) / 100}px`;
42
+ const differs = (a, b) => Math.abs(a - b) > 0.01;
43
+ export class MasonryEngine {
44
+ root;
45
+ options;
46
+ records = new WeakMap();
47
+ observed = new Set();
48
+ observer;
49
+ frame = 0;
50
+ active = false;
51
+ width = -1;
52
+ height = -1;
53
+ constructor(root, options) {
54
+ this.root = root;
55
+ this.options = options;
56
+ this.observer = new ResizeObserver(entries => this.observe(entries));
57
+ this.observer.observe(root);
58
+ root.ownerDocument.defaultView?.addEventListener('resize', this.schedule, { passive: true });
59
+ }
60
+ /** The items, in the order of the page. */
61
+ items() {
62
+ const items = [];
63
+ for (let child = this.root.firstElementChild; child; child = child.nextElementSibling) {
64
+ if (child.hasAttribute(MASONRY_ITEM_ATTRIBUTE)) {
65
+ items.push(child);
66
+ }
67
+ }
68
+ return items;
69
+ }
70
+ /** The observer's sizes: kept, and a layout asked for if any is new. */
71
+ observe(entries) {
72
+ let dirty = false;
73
+ for (const entry of entries) {
74
+ if (entry.target === this.root) {
75
+ // Its height is ours; only a new width matters.
76
+ dirty ||= this.root.clientWidth !== this.width;
77
+ continue;
78
+ }
79
+ const record = this.records.get(entry.target);
80
+ const height = entry.borderBoxSize?.[0]?.blockSize ?? entry.contentRect.height;
81
+ // `offsetHeight` (what `sync` reads) is this, rounded: half a pixel apart is the same height.
82
+ if (!record || Math.abs(record.height - height) > 0.5) {
83
+ if (record)
84
+ record.height = height;
85
+ dirty = true;
86
+ }
87
+ }
88
+ if (dirty) {
89
+ this.schedule();
90
+ }
91
+ }
92
+ /** One layout in the next frame, however many times it is asked. */
93
+ schedule = () => {
94
+ if (!this.frame) {
95
+ this.frame = requestAnimationFrame(() => {
96
+ this.frame = 0;
97
+ this.layout(this.items(), false);
98
+ });
99
+ }
100
+ };
101
+ /** After React rendered: watch the items that are there now, and lay out at once (before the paint). */
102
+ sync() {
103
+ const items = this.items();
104
+ const present = new Set(items);
105
+ for (const item of this.observed) {
106
+ if (!present.has(item)) {
107
+ this.observer.unobserve(item);
108
+ this.observed.delete(item);
109
+ }
110
+ }
111
+ for (const item of items) {
112
+ if (!this.observed.has(item)) {
113
+ this.observer.observe(item);
114
+ this.observed.add(item);
115
+ }
116
+ }
117
+ this.layout(items, true);
118
+ }
119
+ layout(items, measure) {
120
+ const start = performance.now();
121
+ const root = this.root;
122
+ const width = root.clientWidth;
123
+ // Not in the page, hidden, or nothing to place: the grid of the first paint stands.
124
+ if (!(width > 0) || items.length === 0) {
125
+ this.release(items);
126
+ return;
127
+ }
128
+ const options = this.options();
129
+ const viewport = root.ownerDocument.defaultView?.innerWidth ?? width;
130
+ const gap = masonryGapPx(options.gap);
131
+ const columns = masonryColumnCount({
132
+ width,
133
+ gap,
134
+ columns: resolveMasonryResponsive(options.columns, viewport),
135
+ minColumnWidth: options.minColumnWidth,
136
+ maxColumns: options.maxColumns,
137
+ });
138
+ const columnWidth = masonryColumnWidth(width, columns, gap);
139
+ const full = items.map(item => item.getAttribute(MASONRY_SPAN_ATTRIBUTE) === 'full');
140
+ // Writes: the widths.
141
+ if (!this.active) {
142
+ root.style.display = 'block';
143
+ this.active = true;
144
+ }
145
+ const records = new Array(items.length);
146
+ let moved = 0;
147
+ for (let index = 0; index < items.length; index++) {
148
+ const item = items[index];
149
+ let record = this.records.get(item);
150
+ if (!record) {
151
+ record = { width: -1, height: -1, left: -1, top: -1 };
152
+ this.records.set(item, record);
153
+ item.style.position = 'absolute';
154
+ measure = true;
155
+ }
156
+ const itemWidth = full[index] ? width : columnWidth;
157
+ if (differs(record.width, itemWidth)) {
158
+ item.style.width = px(itemWidth);
159
+ record.width = itemWidth;
160
+ measure = true;
161
+ moved++;
162
+ }
163
+ records[index] = record;
164
+ }
165
+ this.width = width;
166
+ // Reads: the heights, all at once (one reflow), and only if a width or the items changed.
167
+ if (measure) {
168
+ for (let index = 0; index < items.length; index++) {
169
+ records[index].height = items[index].offsetHeight;
170
+ }
171
+ }
172
+ const heights = new Float64Array(items.length);
173
+ for (let index = 0; index < items.length; index++) {
174
+ heights[index] = records[index].height;
175
+ }
176
+ const placement = masonryPlacement(heights, { columns, columnWidth, gap, isFullSpan: index => full[index] });
177
+ // Writes: the places that changed.
178
+ for (let index = 0; index < items.length; index++) {
179
+ const record = records[index];
180
+ const left = placement.left[index];
181
+ const top = placement.top[index];
182
+ const leftMoved = differs(record.left, left);
183
+ const topMoved = differs(record.top, top);
184
+ if (leftMoved) {
185
+ // The start edge: the right one in a right-to-left page.
186
+ items[index].style.insetInlineStart = px(left);
187
+ record.left = left;
188
+ }
189
+ if (topMoved) {
190
+ items[index].style.top = px(top);
191
+ record.top = top;
192
+ }
193
+ if (leftMoved || topMoved)
194
+ moved++;
195
+ }
196
+ if (differs(this.height, placement.height)) {
197
+ root.style.height = px(placement.height);
198
+ this.height = placement.height;
199
+ }
200
+ if (moved > 0) {
201
+ options.onLayout?.({
202
+ columns,
203
+ columnWidth,
204
+ height: placement.height,
205
+ items: items.length,
206
+ moved,
207
+ duration: performance.now() - start,
208
+ });
209
+ }
210
+ }
211
+ /** Back to the grid of the first paint: every style this engine wrote is taken off. */
212
+ release(items) {
213
+ if (!this.active) {
214
+ return;
215
+ }
216
+ this.active = false;
217
+ this.width = -1;
218
+ this.height = -1;
219
+ this.root.style.display = '';
220
+ this.root.style.height = '';
221
+ for (const one of items) {
222
+ one.style.position = '';
223
+ one.style.width = '';
224
+ one.style.top = '';
225
+ one.style.insetInlineStart = '';
226
+ }
227
+ this.records = new WeakMap();
228
+ }
229
+ /** Stop watching, and leave the page as the first paint had it. */
230
+ destroy() {
231
+ if (this.frame) {
232
+ cancelAnimationFrame(this.frame);
233
+ this.frame = 0;
234
+ }
235
+ this.observer.disconnect();
236
+ this.observed.clear();
237
+ this.root.ownerDocument.defaultView?.removeEventListener('resize', this.schedule);
238
+ this.release(this.items());
239
+ }
240
+ }
@@ -0,0 +1,45 @@
1
+ /** Columns closer than this in height (in pixels) are level: the leftmost takes the item. */
2
+ export declare const MASONRY_TIE = 1;
3
+ /** A value, or one per breakpoint (Primer's: 544, 768, 1012, 1280px), `null` to keep the one before. */
4
+ export type MasonryResponsive<T> = T | ReadonlyArray<T | null | undefined>;
5
+ /** The value for a screen this wide: the last one given at or under it. */
6
+ export declare function resolveMasonryResponsive<T>(value: MasonryResponsive<T> | undefined, viewportWidth: number): T | undefined;
7
+ /** A gap in pixels: an index of Primer's space scale (`3` is 16), pixels past its end. */
8
+ export declare function masonryGapPx(gap: number): number;
9
+ export interface MasonryColumnsOptions {
10
+ /** The width the columns share, in pixels. */
11
+ width: number;
12
+ /** The space between two columns, in pixels. */
13
+ gap: number;
14
+ /** A fixed number of columns; wins over `minColumnWidth`. */
15
+ columns?: number;
16
+ /** As many columns as fit, each at least this wide (pixels). */
17
+ minColumnWidth?: number;
18
+ /** With `minColumnWidth`: never more columns than this. */
19
+ maxColumns?: number;
20
+ }
21
+ /** How many columns: the fixed number, or as many of `minColumnWidth` as the width takes; one at least. */
22
+ export declare function masonryColumnCount({ width, gap, columns, minColumnWidth, maxColumns }: MasonryColumnsOptions): number;
23
+ /** The width of one of `count` columns sharing `width` with `gap` between them. */
24
+ export declare function masonryColumnWidth(width: number, count: number, gap: number): number;
25
+ export interface MasonryPlacementOptions {
26
+ columns: number;
27
+ columnWidth: number;
28
+ /** The space between two columns, and between two items of a column unless `rowGap` says otherwise. */
29
+ gap: number;
30
+ rowGap?: number;
31
+ /** Whether the item at an index takes the whole width. */
32
+ isFullSpan?: (index: number) => boolean;
33
+ }
34
+ export interface MasonryPlacement {
35
+ /** Each item's distance from the start edge. */
36
+ left: number[];
37
+ /** Each item's distance from the top. */
38
+ top: number[];
39
+ /** Each item's column, `-1` for a full-span one. */
40
+ column: number[];
41
+ /** The height of the whole, without a gap after the last items. */
42
+ height: number;
43
+ }
44
+ /** Where each item goes, given its height: see the module's note. One pass, O(items × columns). */
45
+ export declare function masonryPlacement(heights: ArrayLike<number>, options: MasonryPlacementOptions): MasonryPlacement;
@@ -0,0 +1,113 @@
1
+ /*
2
+ * Copyright (c) 2021-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+ /**
6
+ * The arithmetic of a masonry: how many columns a width takes, how wide
7
+ * each is, and where each item goes. No DOM here, so it is tested as is.
8
+ *
9
+ * ## Placement
10
+ *
11
+ * Items are placed in their order, each at the top of the shortest column —
12
+ * the leftmost of those within {@link MASONRY_TIE} of the shortest, so two
13
+ * columns a fraction of a pixel apart read as level and the item goes to the
14
+ * left one. The shortest column only ever grows, so an item is never above
15
+ * the one before it: reading the items by their order is reading down the
16
+ * page, left to right where they are level — which is also the order of the
17
+ * elements, and so of the Tab key.
18
+ *
19
+ * A full-span item (a heading, an empty state) starts under the longest
20
+ * column and takes the whole width; every column goes on under it.
21
+ */
22
+ import { BOX_BREAKPOINTS, BOX_SPACE } from '../box/boxTokens';
23
+ /** Columns closer than this in height (in pixels) are level: the leftmost takes the item. */
24
+ export const MASONRY_TIE = 1;
25
+ const BREAKPOINTS = BOX_BREAKPOINTS.map(value => Number.parseFloat(value));
26
+ /** The value for a screen this wide: the last one given at or under it. */
27
+ export function resolveMasonryResponsive(value, viewportWidth) {
28
+ if (!Array.isArray(value)) {
29
+ return value;
30
+ }
31
+ let resolved;
32
+ for (let index = 0; index < value.length && index <= BREAKPOINTS.length; index++) {
33
+ if (index > 0 && viewportWidth < BREAKPOINTS[index - 1]) {
34
+ break;
35
+ }
36
+ const one = value[index];
37
+ if (one !== null && one !== undefined) {
38
+ resolved = one;
39
+ }
40
+ }
41
+ return resolved;
42
+ }
43
+ /** A gap in pixels: an index of Primer's space scale (`3` is 16), pixels past its end. */
44
+ export function masonryGapPx(gap) {
45
+ if (!Number.isFinite(gap) || gap <= 0) {
46
+ return 0;
47
+ }
48
+ return Number.isInteger(gap) && gap < BOX_SPACE.length ? Number.parseFloat(BOX_SPACE[gap]) : gap;
49
+ }
50
+ /** How many columns: the fixed number, or as many of `minColumnWidth` as the width takes; one at least. */
51
+ export function masonryColumnCount({ width, gap, columns, minColumnWidth = 260, maxColumns }) {
52
+ if (columns !== undefined && Number.isFinite(columns)) {
53
+ return Math.max(1, Math.floor(columns));
54
+ }
55
+ if (!(width > 0)) {
56
+ return 1;
57
+ }
58
+ const min = Math.max(1, minColumnWidth);
59
+ let count = Math.max(1, Math.floor((width + gap) / (min + gap)));
60
+ if (maxColumns !== undefined && Number.isFinite(maxColumns)) {
61
+ count = Math.min(count, Math.max(1, Math.floor(maxColumns)));
62
+ }
63
+ return count;
64
+ }
65
+ /** The width of one of `count` columns sharing `width` with `gap` between them. */
66
+ export function masonryColumnWidth(width, count, gap) {
67
+ return Math.max(0, (width - gap * (count - 1)) / count);
68
+ }
69
+ /** Where each item goes, given its height: see the module's note. One pass, O(items × columns). */
70
+ export function masonryPlacement(heights, options) {
71
+ const columns = Math.max(1, Math.floor(options.columns));
72
+ const { columnWidth, gap, isFullSpan } = options;
73
+ const rowGap = options.rowGap ?? gap;
74
+ const count = heights.length;
75
+ const left = new Array(count);
76
+ const top = new Array(count);
77
+ const column = new Array(count);
78
+ // The next free top of each column.
79
+ const free = new Float64Array(columns);
80
+ let height = 0;
81
+ for (let index = 0; index < count; index++) {
82
+ const itemHeight = heights[index] > 0 ? heights[index] : 0;
83
+ if (isFullSpan?.(index)) {
84
+ let longest = 0;
85
+ for (let c = 0; c < columns; c++) {
86
+ if (free[c] > longest)
87
+ longest = free[c];
88
+ }
89
+ left[index] = 0;
90
+ top[index] = longest;
91
+ column[index] = -1;
92
+ free.fill(longest + itemHeight + rowGap);
93
+ height = longest + itemHeight;
94
+ continue;
95
+ }
96
+ let shortest = free[0];
97
+ for (let c = 1; c < columns; c++) {
98
+ if (free[c] < shortest)
99
+ shortest = free[c];
100
+ }
101
+ let target = 0;
102
+ while (free[target] > shortest + MASONRY_TIE)
103
+ target++;
104
+ left[index] = target * (columnWidth + gap);
105
+ top[index] = free[target];
106
+ column[index] = target;
107
+ const bottom = free[target] + itemHeight;
108
+ free[target] = bottom + rowGap;
109
+ if (bottom > height)
110
+ height = bottom;
111
+ }
112
+ return { left, top, column, height };
113
+ }
@@ -4,9 +4,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  * Distributed under the terms of the Modified BSD License.
5
5
  */
6
6
  import { useEffect, useMemo, useState } from 'react';
7
- import { IconButton } from '@primer/react';
7
+ import { IconButton, useTheme } from '@primer/react';
8
8
  import { XIcon } from '@primer/octicons-react';
9
9
  import { Box } from '../box/Box';
10
+ import { panelBackground } from '../hover-card/HoverCardDetails';
10
11
  const variantStyles = {
11
12
  default: {
12
13
  bg: 'var(--bgColor-default, #ffffff)',
@@ -164,6 +165,7 @@ export const SlidingPanel = ({ isOpen, message, details, onDismiss, position = '
164
165
  return null;
165
166
  }
166
167
  const style = variantStyles[variant];
168
+ const { theme } = useTheme();
167
169
  const alerting = variant === 'error' || variant === 'danger';
168
170
  // Over the viewport, or over its own region of the page.
169
171
  const across = contained ? '100%' : '100vw';
@@ -216,7 +218,10 @@ export const SlidingPanel = ({ isOpen, message, details, onDismiss, position = '
216
218
  borderRight: edgeBorder.borderRight,
217
219
  borderBottom: edgeBorder.borderBottom,
218
220
  borderLeft: edgeBorder.borderLeft,
219
- backgroundColor: style.bg,
221
+ // Opaque in every theme: the variant's tint over the panel background the hover card uses
222
+ // (the canvas over its overlay colour), since a theme's muted tints and even its default
223
+ // canvas (metal's, in dark mode) are translucent.
224
+ background: `linear-gradient(${style.bg}, ${style.bg}), ${panelBackground(theme)}`,
220
225
  color: style.fg,
221
226
  textAlign: 'left',
222
227
  px: 4,
@@ -225,6 +225,9 @@ const metalPainted = {
225
225
  '--bgColor-accent-muted': 'rgba(255, 255, 255, 0.09)',
226
226
  '--borderColor-accent-muted': 'rgba(255, 255, 255, 0.22)',
227
227
  '--overlay-bgColor': '#25343F',
228
+ // A field's border reads on the glass: the hairline (18% white) all but vanished around a prompt.
229
+ '--control-borderColor-rest': 'rgba(255, 255, 255, 0.34)',
230
+ '--control-borderColor-emphasis': 'rgba(255, 255, 255, 0.5)',
228
231
  '--metal-primary-image': 'none',
229
232
  '--metal-primary-shadow': 'none',
230
233
  '--fgColor-default': '#FFFFFF',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/primer-addons",
3
- "version": "1.0.57",
3
+ "version": "1.0.59",
4
4
  "license": "BSD-3-Clause",
5
5
  "scripts": {
6
6
  "build": "npm run build:lib",