@stll/ui 0.79.0 → 0.81.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/dist/calendar/day-calendar.d.ts +6 -1
- package/dist/calendar/day-calendar.js +77 -20
- package/dist/components/animated-count.js +5 -5
- package/dist/components/button.d.ts +7 -3
- package/dist/components/button.js +58 -9
- package/dist/components/destructive-confirm-dialog.js +1 -0
- package/dist/components/document-mark.shared.d.ts +14 -125
- package/dist/components/document-mark.shared.js +222 -37
- package/dist/components/file-input.d.ts +2 -1
- package/dist/components/file-input.js +2 -1
- package/dist/components/hex-color-picker.js +10 -11
- package/dist/components/search-field.d.ts +2 -1
- package/dist/components/search-field.js +2 -1
- package/dist/components/secret-input.d.ts +2 -1
- package/dist/components/secret-input.js +2 -1
- package/dist/components/split-button.d.ts +1 -1
- package/dist/components/split-button.js +6 -2
- package/dist/components/swap-text.js +9 -7
- package/dist/components/tooltip-trigger-helper.d.ts +3 -1
- package/dist/components/tooltip-trigger-helper.js +10 -3
- package/dist/components/tooltip.d.ts +3 -1
- package/dist/components/tooltip.js +25 -20
- package/dist/hooks/use-inline-overflow.d.ts +47 -0
- package/dist/hooks/use-inline-overflow.js +93 -0
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +2 -2
- package/dist/inspector/facet-bar.d.ts +1 -1
- package/dist/inspector/facet-bar.js +18 -53
- package/dist/lib/inline-overflow.d.ts +62 -0
- package/dist/lib/inline-overflow.js +79 -0
- package/dist/lib/matter-colors.d.ts +2 -2
- package/dist/lib/matter-colors.js +0 -1
- package/dist/review/review-decision-actions.d.ts +9 -4
- package/dist/review/review-decision-actions.js +24 -23
- package/dist/review/review-out-of-date-notice.d.ts +2 -4
- package/dist/review/review-out-of-date-notice.js +3 -3
- package/package.json +9 -1
- package/dist/inspector/facet-bar.logic.d.ts +0 -48
- package/dist/inspector/facet-bar.logic.js +0 -52
|
@@ -71,7 +71,9 @@ type DayCalendarColumnHeader = {
|
|
|
71
71
|
};
|
|
72
72
|
/**
|
|
73
73
|
* A `locked` column has no blocks field, so caller data cannot reach it: it
|
|
74
|
-
* paints synthetic placeholder bars behind the caller's `action`.
|
|
74
|
+
* paints synthetic placeholder bars behind the caller's `action`. A `pending`
|
|
75
|
+
* column's blocks are not known yet: it shimmers where the caller already
|
|
76
|
+
* knows something was recorded, and takes no selection meanwhile.
|
|
75
77
|
*/
|
|
76
78
|
export type DayCalendarColumn = (DayCalendarColumnHeader & {
|
|
77
79
|
blocks: readonly DayCalendarBlock[];
|
|
@@ -80,6 +82,9 @@ export type DayCalendarColumn = (DayCalendarColumnHeader & {
|
|
|
80
82
|
}) | (DayCalendarColumnHeader & {
|
|
81
83
|
action: ReactNode;
|
|
82
84
|
type: "locked";
|
|
85
|
+
}) | (DayCalendarColumnHeader & {
|
|
86
|
+
placeholders: readonly DayCalendarRange[];
|
|
87
|
+
type: "pending";
|
|
83
88
|
});
|
|
84
89
|
/**
|
|
85
90
|
* The committed range the caller is acting on. `panel` anchors caller content
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Popover, PopoverContent as PopoverPopup, PopoverTrigger } from "../components/popover.js";
|
|
2
|
+
import { Skeleton } from "../components/skeleton.js";
|
|
2
3
|
import { Tooltip, TooltipContent as TooltipPopup, TooltipTrigger } from "../components/tooltip.js";
|
|
3
4
|
import { TruncatedText } from "../components/truncated-text.js";
|
|
4
5
|
import { resolveMatterColor } from "../lib/matter-colors.js";
|
|
@@ -16,10 +17,14 @@ const isSameDraftView = (left, right) => left.date === right.date && left.endHou
|
|
|
16
17
|
* change, committing it would select a stale range, so it is discarded.
|
|
17
18
|
*/
|
|
18
19
|
const useDraftSelection = (view) => {
|
|
20
|
+
const viewKey = `${view.date}:${view.startHour}:${view.endHour}:${view.granularity}:${view.timeZone}`;
|
|
21
|
+
const [prevViewKey, setPrevViewKey] = useState(viewKey);
|
|
19
22
|
const [stored, setDraft] = useState(null);
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
if (prevViewKey !== viewKey) {
|
|
24
|
+
setPrevViewKey(viewKey);
|
|
25
|
+
setDraft(null);
|
|
26
|
+
}
|
|
27
|
+
return [stored !== null && isSameDraftView(stored.view, view) ? stored : null, setDraft];
|
|
23
28
|
};
|
|
24
29
|
const GUTTER_WIDTH = "4rem";
|
|
25
30
|
/**
|
|
@@ -187,16 +192,9 @@ const DayCalendar = ({ ariaLabel, columns, date, granularity, hours, locale, now
|
|
|
187
192
|
"aria-hidden": "true",
|
|
188
193
|
className: "bg-card border-border sticky top-0 z-30 rounded-ss-xl border-b"
|
|
189
194
|
}),
|
|
190
|
-
columns.map((column, index) => /* @__PURE__ */
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
children: [/* @__PURE__ */ jsx(TruncatedText, {
|
|
194
|
-
className: "shrink-0",
|
|
195
|
-
children: column.label
|
|
196
|
-
}), column.badge === void 0 ? null : /* @__PURE__ */ jsx(TruncatedText, {
|
|
197
|
-
className: "bg-muted text-muted-foreground text-2xs rounded-full px-2 py-0.5",
|
|
198
|
-
children: column.badge
|
|
199
|
-
})]
|
|
195
|
+
columns.map((column, index) => /* @__PURE__ */ jsx(ColumnHeader, {
|
|
196
|
+
column,
|
|
197
|
+
last: index === columns.length - 1
|
|
200
198
|
}, column.id)),
|
|
201
199
|
/* @__PURE__ */ jsx("div", {
|
|
202
200
|
"aria-hidden": "true",
|
|
@@ -224,6 +222,11 @@ const DayCalendar = ({ ariaLabel, columns, date, granularity, hours, locale, now
|
|
|
224
222
|
style: bodyStyle,
|
|
225
223
|
children: [
|
|
226
224
|
column.type === "locked" ? /* @__PURE__ */ jsx(LockedColumnBody, { action: column.action }) : null,
|
|
225
|
+
column.type === "pending" ? /* @__PURE__ */ jsx(PendingColumnBody, {
|
|
226
|
+
grid,
|
|
227
|
+
placeholders: column.placeholders,
|
|
228
|
+
slotLinesStyle
|
|
229
|
+
}) : null,
|
|
227
230
|
column.type === "blocks" && column.rangeSelection.type === "enabled" ? /* @__PURE__ */ jsxs("div", {
|
|
228
231
|
"aria-keyshortcuts": "ArrowUp ArrowDown Shift+ArrowUp Shift+ArrowDown Enter Escape",
|
|
229
232
|
"aria-label": column.rangeSelection.label,
|
|
@@ -266,7 +269,7 @@ const DayCalendar = ({ ariaLabel, columns, date, granularity, hours, locale, now
|
|
|
266
269
|
timeFormatFor
|
|
267
270
|
})]
|
|
268
271
|
}) : null,
|
|
269
|
-
nowVisible && column.type
|
|
272
|
+
nowVisible && column.type !== "locked" ? /* @__PURE__ */ jsx("div", {
|
|
270
273
|
"aria-hidden": "true",
|
|
271
274
|
className: "bg-destructive pointer-events-none absolute inset-x-0 z-20 h-0.5",
|
|
272
275
|
"data-slot": "day-calendar-now",
|
|
@@ -284,6 +287,17 @@ const DayCalendar = ({ ariaLabel, columns, date, granularity, hours, locale, now
|
|
|
284
287
|
]
|
|
285
288
|
});
|
|
286
289
|
};
|
|
290
|
+
const ColumnHeader = ({ column, last }) => /* @__PURE__ */ jsxs("header", {
|
|
291
|
+
className: cn("bg-card border-border text-muted-foreground sticky top-0 z-30 flex min-w-0 items-center gap-2 border-s border-b px-3 py-2.5 text-xs font-medium", last && "rounded-se-xl"),
|
|
292
|
+
"data-slot": "day-calendar-column-header",
|
|
293
|
+
children: [/* @__PURE__ */ jsx(TruncatedText, {
|
|
294
|
+
className: "shrink-0",
|
|
295
|
+
children: column.label
|
|
296
|
+
}), column.badge === void 0 ? null : /* @__PURE__ */ jsx(TruncatedText, {
|
|
297
|
+
className: "bg-muted text-muted-foreground text-2xs rounded-full px-2 py-0.5",
|
|
298
|
+
children: column.badge
|
|
299
|
+
})]
|
|
300
|
+
});
|
|
287
301
|
const ColumnBlocks = ({ blocks, grid }) => {
|
|
288
302
|
const visible = blocks.flatMap((block) => {
|
|
289
303
|
const startMs = Math.max(block.startMs, grid.bounds.startMs);
|
|
@@ -329,9 +343,17 @@ const ENTRY_STATE_CLASSES = {
|
|
|
329
343
|
final: "",
|
|
330
344
|
suggestion: "border border-dashed border-current/45 outline-none hover:ring-1 hover:ring-ring/50 focus-visible:ring-2 focus-visible:ring-ring"
|
|
331
345
|
};
|
|
332
|
-
|
|
346
|
+
/** Where a block of `range` is drawn: at least {@link BLOCK_MIN_PX} tall,
|
|
347
|
+
* unless the grid ends sooner. */
|
|
348
|
+
const blockExtent = (range, grid) => {
|
|
333
349
|
const top = timeToOffset(range.startMs, grid);
|
|
334
|
-
|
|
350
|
+
return {
|
|
351
|
+
blockSize: Math.min(Math.max(timeToOffset(range.endMs, grid) - top, BLOCK_MIN_PX), boundsHeight(grid) - top),
|
|
352
|
+
top
|
|
353
|
+
};
|
|
354
|
+
};
|
|
355
|
+
const DayCalendarBlockView = ({ block, grid, lane, range }) => {
|
|
356
|
+
const { blockSize, top } = blockExtent(range, grid);
|
|
335
357
|
const placement = {
|
|
336
358
|
blockSize,
|
|
337
359
|
inlineSize: `${String(100 / lane.laneCount)}%`,
|
|
@@ -340,15 +362,22 @@ const DayCalendarBlockView = ({ block, grid, lane, range }) => {
|
|
|
340
362
|
};
|
|
341
363
|
const oneLine = blockSize < TWO_LINE_BLOCK_MIN_PX;
|
|
342
364
|
const className = cn("text-foreground @container flex h-full w-full min-w-0 overflow-hidden rounded-md px-2.5 text-start text-xs", oneLine ? "flex-row items-center gap-2" : "flex-col gap-0.5 py-1", BLOCK_KIND_CLASSES[block.kind], block.kind === "entry" && ENTRY_STATE_CLASSES[block.state], block.tone.type === "matter" && "border-s-[3px]", block.tone.type === "neutral" && "bg-muted");
|
|
343
|
-
const
|
|
365
|
+
const title = /* @__PURE__ */ jsx(TruncatedText, {
|
|
344
366
|
className: cn("font-medium", oneLine ? "shrink" : "shrink-0"),
|
|
345
367
|
hint: false,
|
|
346
368
|
children: block.title
|
|
347
|
-
})
|
|
348
|
-
|
|
369
|
+
});
|
|
370
|
+
const caption = block.caption === void 0 ? null : /* @__PURE__ */ jsx(TruncatedText, {
|
|
371
|
+
className: "text-muted-foreground tabular-nums",
|
|
349
372
|
hint: false,
|
|
350
373
|
children: block.caption
|
|
351
|
-
})
|
|
374
|
+
});
|
|
375
|
+
let content = null;
|
|
376
|
+
if (blockSize >= 16) content = oneLine ? /* @__PURE__ */ jsxs("div", {
|
|
377
|
+
className: "flex h-[1lh] min-w-0 flex-1 flex-wrap items-center gap-x-2 overflow-hidden",
|
|
378
|
+
"data-slot": "day-calendar-block-line",
|
|
379
|
+
children: [title, caption]
|
|
380
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [title, caption] });
|
|
352
381
|
const shared = {
|
|
353
382
|
"aria-label": block.accessibleLabel,
|
|
354
383
|
className,
|
|
@@ -538,6 +567,34 @@ const LOCKED_BAR_TONES = {
|
|
|
538
567
|
neutral: "bg-muted-foreground/15",
|
|
539
568
|
tinted: "bg-muted-foreground/25"
|
|
540
569
|
};
|
|
570
|
+
/** Shimmers at each range the caller knows something was recorded in, placed
|
|
571
|
+
* as a block there would be, until the column's blocks are known. */
|
|
572
|
+
const PendingColumnBody = ({ grid, placeholders, slotLinesStyle }) => /* @__PURE__ */ jsx("div", {
|
|
573
|
+
"aria-busy": "true",
|
|
574
|
+
className: "absolute inset-0",
|
|
575
|
+
"data-slot": "day-calendar-surface",
|
|
576
|
+
style: slotLinesStyle,
|
|
577
|
+
children: placeholders.flatMap((placeholder) => {
|
|
578
|
+
const startMs = Math.max(placeholder.startMs, grid.bounds.startMs);
|
|
579
|
+
const endMs = Math.min(placeholder.endMs, grid.bounds.endMs);
|
|
580
|
+
if (endMs <= startMs) return [];
|
|
581
|
+
const { blockSize, top } = blockExtent({
|
|
582
|
+
endMs,
|
|
583
|
+
startMs
|
|
584
|
+
}, grid);
|
|
585
|
+
return [/* @__PURE__ */ jsx("div", {
|
|
586
|
+
className: "absolute inset-x-0 px-1.5 py-px",
|
|
587
|
+
style: {
|
|
588
|
+
blockSize,
|
|
589
|
+
insetBlockStart: top
|
|
590
|
+
},
|
|
591
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
592
|
+
className: "h-full rounded-md",
|
|
593
|
+
"data-slot": "day-calendar-pending-block"
|
|
594
|
+
})
|
|
595
|
+
}, startMs)];
|
|
596
|
+
})
|
|
597
|
+
});
|
|
541
598
|
const LockedColumnBody = ({ action }) => /* @__PURE__ */ jsxs("div", {
|
|
542
599
|
className: "absolute inset-0 overflow-hidden",
|
|
543
600
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -29,19 +29,19 @@ const toGlyphs = (value, previous, generation) => {
|
|
|
29
29
|
* still: a count that loads does not announce itself.
|
|
30
30
|
*/
|
|
31
31
|
const AnimatedCount = ({ className, value }) => {
|
|
32
|
+
const [prevValue, setPrevValue] = useState(value);
|
|
32
33
|
const [state, setState] = useState(() => ({
|
|
33
34
|
generation: 0,
|
|
34
|
-
glyphs: toGlyphs(value, null, 0)
|
|
35
|
-
value
|
|
35
|
+
glyphs: toGlyphs(value, null, 0)
|
|
36
36
|
}));
|
|
37
37
|
let { glyphs } = state;
|
|
38
|
-
if (
|
|
38
|
+
if (prevValue !== value) {
|
|
39
39
|
const generation = state.generation + 1;
|
|
40
40
|
glyphs = toGlyphs(value, state.glyphs, generation);
|
|
41
|
+
setPrevValue(value);
|
|
41
42
|
setState({
|
|
42
43
|
generation,
|
|
43
|
-
glyphs
|
|
44
|
-
value
|
|
44
|
+
glyphs
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
return /* @__PURE__ */ jsxs("span", {
|
|
@@ -92,7 +92,7 @@ type ButtonProps = Omit<ButtonContract, "children" | "disabled"> & {
|
|
|
92
92
|
shape?: ButtonPlainShape | undefined;
|
|
93
93
|
"data-accessible-disabled"?: "";
|
|
94
94
|
} & useRender.ComponentProps<"button">;
|
|
95
|
-
declare
|
|
95
|
+
declare const Button: (buttonProps: ButtonProps) => import("react").JSX.Element;
|
|
96
96
|
/**
|
|
97
97
|
* How a run shows it can be pressed: underlined like a link, or `plain`, by
|
|
98
98
|
* what it holds (a claim's text mark, which draws its own line), as a plain
|
|
@@ -112,7 +112,11 @@ type ButtonTextRunProps = Omit<ButtonProps, "children" | "className" | "focusRin
|
|
|
112
112
|
className?: string | undefined;
|
|
113
113
|
/** `link` unless the run holds a text mark that draws its own line. */
|
|
114
114
|
variant?: ButtonTextRunVariant | undefined;
|
|
115
|
-
}
|
|
115
|
+
} & ({
|
|
116
|
+
disabled?: false | undefined;
|
|
117
|
+
} | {
|
|
118
|
+
disabledReason: NonNullable<ReactNode>;
|
|
119
|
+
});
|
|
116
120
|
/**
|
|
117
121
|
* A long run of prose that acts as one button: a citation or a
|
|
118
122
|
* cross-reference in reader text. A <button> is an atomic box even at
|
|
@@ -122,5 +126,5 @@ type ButtonTextRunProps = Omit<ButtonProps, "children" | "className" | "focusRin
|
|
|
122
126
|
* <button> it holds, which takes its accessible name from the label. Use
|
|
123
127
|
* `Button size="inline"` for a short action.
|
|
124
128
|
*/
|
|
125
|
-
declare const ButtonTextRun: ({ children, className,
|
|
129
|
+
declare const ButtonTextRun: ({ children, className, variant, ...props }: ButtonTextRunProps) => import("react").JSX.Element;
|
|
126
130
|
export { BUTTON_CONTENT, BUTTON_SIZE_CONTENT, Button, type ButtonFocusRing, type ButtonPlainShape, type ButtonProps, type ButtonSize, ButtonTextRun, type ButtonVariant, buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { BUTTON_DISPOSITION, blockDisabledActivation, blockDisabledKeyActivation, resolveButtonDisposition } from "../lib/button-disposition.js";
|
|
3
3
|
import { rendersNothing } from "../lib/renders-nothing.js";
|
|
4
|
+
import { hasTooltipContent } from "../lib/tooltip-content.js";
|
|
4
5
|
import { cn } from "../lib/utils.js";
|
|
5
6
|
import { BUTTON_BASE_CLASS, BUTTON_DEFAULT_SIZE, BUTTON_LAYOUT_CLASS_NAMES, BUTTON_SIZE_CLASS_NAMES, BUTTON_VARIANT_CLASS_NAMES } from "./button-classes.js";
|
|
6
7
|
import { BUTTON_PLAIN_VARIANT } from "./button.shared.js";
|
|
@@ -8,7 +9,7 @@ import { Loader } from "./loader.js";
|
|
|
8
9
|
import { renderTooltipTrigger } from "./tooltip-trigger-helper.js";
|
|
9
10
|
import { TruncatedText } from "./truncated-text.js";
|
|
10
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import { Fragment as Fragment$1, isValidElement } from "react";
|
|
12
|
+
import { Fragment as Fragment$1, isValidElement, useCallback, useId } from "react";
|
|
12
13
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
13
14
|
import { useRender } from "@base-ui/react/use-render";
|
|
14
15
|
import { panic } from "better-result";
|
|
@@ -174,10 +175,47 @@ const implicitTooltip = (size, accessibleName) => {
|
|
|
174
175
|
default: return panic(`Unhandled button content: ${String(content)}`);
|
|
175
176
|
}
|
|
176
177
|
};
|
|
177
|
-
|
|
178
|
+
const useButtonDescription = ({ disabled, disabledReason, describedBy, render }) => {
|
|
179
|
+
const id = useId();
|
|
180
|
+
const hasReason = disabled === true && hasTooltipContent(disabledReason);
|
|
181
|
+
const plainReason = typeof disabledReason === "string" || typeof disabledReason === "number";
|
|
182
|
+
const ref = useCallback((button) => {
|
|
183
|
+
if (!button || !hasReason || render === void 0) return;
|
|
184
|
+
const previous = button.getAttribute("aria-describedby");
|
|
185
|
+
const merged = [...new Set(`${describedBy ?? ""} ${previous ?? ""} ${id}`.trim().split(/\s+/u))].join(" ");
|
|
186
|
+
button.setAttribute("aria-describedby", merged);
|
|
187
|
+
return () => {
|
|
188
|
+
if (button.getAttribute("aria-describedby") !== merged) return;
|
|
189
|
+
if (previous === null) button.removeAttribute("aria-describedby");
|
|
190
|
+
else button.setAttribute("aria-describedby", previous);
|
|
191
|
+
};
|
|
192
|
+
}, [
|
|
193
|
+
describedBy,
|
|
194
|
+
hasReason,
|
|
195
|
+
id,
|
|
196
|
+
render
|
|
197
|
+
]);
|
|
198
|
+
return {
|
|
199
|
+
ref: hasReason && render !== void 0 ? ref : null,
|
|
200
|
+
describedBy: hasReason && render === void 0 ? [describedBy, id].filter(Boolean).join(" ") : describedBy,
|
|
201
|
+
popupId: hasReason && !plainReason ? id : void 0,
|
|
202
|
+
text: hasReason && plainReason ? {
|
|
203
|
+
id,
|
|
204
|
+
value: disabledReason
|
|
205
|
+
} : void 0
|
|
206
|
+
};
|
|
207
|
+
};
|
|
208
|
+
const Button = (buttonProps) => {
|
|
209
|
+
const { className, variant: variantProp, size, render, layout, loading, icon, children, disabled, disabledReason, tooltip, selected, focusRing = "outside", shape = "box", "data-accessible-disabled": accessibleDisabled, ...props } = buttonProps;
|
|
178
210
|
const variant = variantProp ?? (size === "inline" ? "link" : void 0);
|
|
179
211
|
const typeValue = render ? void 0 : "button";
|
|
180
212
|
const tooltipContent = disabled === true && disabledReason !== void 0 ? disabledReason : tooltip ?? implicitTooltip(size, props["aria-label"] ?? props.title);
|
|
213
|
+
const description = useButtonDescription({
|
|
214
|
+
disabled,
|
|
215
|
+
disabledReason,
|
|
216
|
+
describedBy: props["aria-describedby"],
|
|
217
|
+
render
|
|
218
|
+
});
|
|
181
219
|
const disposition = resolveButtonDisposition({
|
|
182
220
|
disabled,
|
|
183
221
|
loading,
|
|
@@ -185,6 +223,10 @@ function Button({ className, variant: variantProp, size, render, layout, loading
|
|
|
185
223
|
});
|
|
186
224
|
const isAccessibleDisabled = disposition === BUTTON_DISPOSITION.accessibleDisabled;
|
|
187
225
|
const isActivationPreservingDisabled = accessibleDisabled !== void 0;
|
|
226
|
+
const buttonPropsWithDescription = {
|
|
227
|
+
...props,
|
|
228
|
+
"aria-describedby": description.describedBy
|
|
229
|
+
};
|
|
188
230
|
const defaultProps = {
|
|
189
231
|
children: buttonContent({
|
|
190
232
|
icon,
|
|
@@ -214,20 +256,28 @@ function Button({ className, variant: variantProp, size, render, layout, loading
|
|
|
214
256
|
};
|
|
215
257
|
const button = useRender({
|
|
216
258
|
defaultTagName: "button",
|
|
217
|
-
|
|
259
|
+
ref: description.ref,
|
|
260
|
+
props: isAccessibleDisabled ? mergeProps(defaultProps, buttonPropsWithDescription, {
|
|
218
261
|
onClick: blockDisabledActivation,
|
|
219
262
|
onKeyDown: blockDisabledKeyActivation,
|
|
220
263
|
onKeyUp: blockDisabledKeyActivation,
|
|
221
264
|
onMouseDown: blockDisabledActivation,
|
|
222
265
|
onPointerDown: blockDisabledActivation
|
|
223
|
-
}) : mergeProps(defaultProps,
|
|
266
|
+
}) : mergeProps(defaultProps, buttonPropsWithDescription),
|
|
224
267
|
render
|
|
225
268
|
});
|
|
226
|
-
|
|
269
|
+
const trigger = renderTooltipTrigger({
|
|
227
270
|
tooltip: tooltipContent,
|
|
228
|
-
trigger: button
|
|
271
|
+
trigger: button,
|
|
272
|
+
keepTriggerMounted: Object.hasOwn(buttonProps, "disabledReason"),
|
|
273
|
+
popupDescriptionId: description.popupId
|
|
229
274
|
});
|
|
230
|
-
|
|
275
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [trigger, description.text && /* @__PURE__ */ jsx("span", {
|
|
276
|
+
hidden: true,
|
|
277
|
+
id: description.text.id,
|
|
278
|
+
children: description.text.value
|
|
279
|
+
})] });
|
|
280
|
+
};
|
|
231
281
|
/**
|
|
232
282
|
* What the button shows. Loading never changes its width: with an `icon`,
|
|
233
283
|
* the loader takes the icon's place; without one, the label (already cut to
|
|
@@ -276,13 +326,12 @@ const BUTTON_TEXT_RUN_TARGET_CLASS = "absolute size-px overflow-hidden whitespac
|
|
|
276
326
|
* <button> it holds, which takes its accessible name from the label. Use
|
|
277
327
|
* `Button size="inline"` for a short action.
|
|
278
328
|
*/
|
|
279
|
-
const ButtonTextRun = ({ children, className,
|
|
329
|
+
const ButtonTextRun = ({ children, className, variant = "link", ...props }) => /* @__PURE__ */ jsxs("label", {
|
|
280
330
|
className: cn(BUTTON_TEXT_RUN_CLASS, BUTTON_TEXT_RUN_VARIANT_CLASS[variant], className),
|
|
281
331
|
"data-slot": "button-text-run",
|
|
282
332
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
283
333
|
...props,
|
|
284
334
|
className: BUTTON_TEXT_RUN_TARGET_CLASS,
|
|
285
|
-
disabled,
|
|
286
335
|
focusRing: "outside",
|
|
287
336
|
icon: void 0,
|
|
288
337
|
loading: false,
|
|
@@ -36,6 +36,7 @@ const DestructiveConfirmDialog = ({ cancelLabel, confirmLabel, confirmation, des
|
|
|
36
36
|
children: cancelLabel
|
|
37
37
|
}), /* @__PURE__ */ jsx(Button, {
|
|
38
38
|
disabled: !typedConfirmation.confirmed,
|
|
39
|
+
disabledReason: inputLabel,
|
|
39
40
|
loading,
|
|
40
41
|
onClick: handleConfirmClick,
|
|
41
42
|
variant: "destructive",
|
|
@@ -18,131 +18,20 @@ export type DocumentMarkArtwork = {
|
|
|
18
18
|
/** A paint reference to one of the mark's gradients. */
|
|
19
19
|
export declare const GRADIENT_REFERENCE: RegExp;
|
|
20
20
|
export declare const DOCUMENT_MARKS: {
|
|
21
|
-
readonly ofd:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
tag: "path";
|
|
36
|
-
attrs: {
|
|
37
|
-
d: string;
|
|
38
|
-
fill: string;
|
|
39
|
-
stroke: string;
|
|
40
|
-
strokeWidth: string;
|
|
41
|
-
strokeLinecap: string;
|
|
42
|
-
strokeLinejoin: string;
|
|
43
|
-
};
|
|
44
|
-
})[];
|
|
45
|
-
};
|
|
46
|
-
readonly uyap: {
|
|
47
|
-
viewBox: string;
|
|
48
|
-
gradients: never[];
|
|
49
|
-
shapes: ({
|
|
50
|
-
tag: "path";
|
|
51
|
-
attrs: {
|
|
52
|
-
d: string;
|
|
53
|
-
fill: string;
|
|
54
|
-
stroke?: never;
|
|
55
|
-
strokeWidth?: never;
|
|
56
|
-
strokeLinecap?: never;
|
|
57
|
-
strokeLinejoin?: never;
|
|
58
|
-
};
|
|
59
|
-
} | {
|
|
60
|
-
tag: "path";
|
|
61
|
-
attrs: {
|
|
62
|
-
d: string;
|
|
63
|
-
fill: string;
|
|
64
|
-
stroke: string;
|
|
65
|
-
strokeWidth: string;
|
|
66
|
-
strokeLinecap: string;
|
|
67
|
-
strokeLinejoin: string;
|
|
68
|
-
};
|
|
69
|
-
})[];
|
|
70
|
-
};
|
|
71
|
-
readonly asicE: {
|
|
72
|
-
viewBox: string;
|
|
73
|
-
gradients: never[];
|
|
74
|
-
shapes: ({
|
|
75
|
-
tag: "path";
|
|
76
|
-
attrs: {
|
|
77
|
-
d: string;
|
|
78
|
-
fill: string;
|
|
79
|
-
stroke?: never;
|
|
80
|
-
strokeWidth?: never;
|
|
81
|
-
strokeLinecap?: never;
|
|
82
|
-
strokeLinejoin?: never;
|
|
83
|
-
};
|
|
84
|
-
} | {
|
|
85
|
-
tag: "path";
|
|
86
|
-
attrs: {
|
|
87
|
-
d: string;
|
|
88
|
-
fill: string;
|
|
89
|
-
stroke: string;
|
|
90
|
-
strokeWidth: string;
|
|
91
|
-
strokeLinecap: string;
|
|
92
|
-
strokeLinejoin: string;
|
|
93
|
-
};
|
|
94
|
-
})[];
|
|
95
|
-
};
|
|
96
|
-
readonly asicS: {
|
|
97
|
-
viewBox: string;
|
|
98
|
-
gradients: never[];
|
|
99
|
-
shapes: ({
|
|
100
|
-
tag: "path";
|
|
101
|
-
attrs: {
|
|
102
|
-
d: string;
|
|
103
|
-
fill: string;
|
|
104
|
-
stroke?: never;
|
|
105
|
-
strokeWidth?: never;
|
|
106
|
-
strokeLinecap?: never;
|
|
107
|
-
strokeLinejoin?: never;
|
|
108
|
-
};
|
|
109
|
-
} | {
|
|
110
|
-
tag: "path";
|
|
111
|
-
attrs: {
|
|
112
|
-
d: string;
|
|
113
|
-
fill: string;
|
|
114
|
-
stroke: string;
|
|
115
|
-
strokeWidth: string;
|
|
116
|
-
strokeLinecap: string;
|
|
117
|
-
strokeLinejoin: string;
|
|
118
|
-
};
|
|
119
|
-
})[];
|
|
120
|
-
};
|
|
121
|
-
readonly cades: {
|
|
122
|
-
viewBox: string;
|
|
123
|
-
gradients: never[];
|
|
124
|
-
shapes: ({
|
|
125
|
-
tag: "path";
|
|
126
|
-
attrs: {
|
|
127
|
-
d: string;
|
|
128
|
-
fill: string;
|
|
129
|
-
stroke?: never;
|
|
130
|
-
strokeWidth?: never;
|
|
131
|
-
strokeLinecap?: never;
|
|
132
|
-
strokeLinejoin?: never;
|
|
133
|
-
};
|
|
134
|
-
} | {
|
|
135
|
-
tag: "path";
|
|
136
|
-
attrs: {
|
|
137
|
-
d: string;
|
|
138
|
-
fill: string;
|
|
139
|
-
stroke: string;
|
|
140
|
-
strokeWidth: string;
|
|
141
|
-
strokeLinecap: string;
|
|
142
|
-
strokeLinejoin: string;
|
|
143
|
-
};
|
|
144
|
-
})[];
|
|
145
|
-
};
|
|
21
|
+
readonly ofd: DocumentMarkArtwork;
|
|
22
|
+
readonly uyap: DocumentMarkArtwork;
|
|
23
|
+
readonly asicE: DocumentMarkArtwork;
|
|
24
|
+
readonly asicS: DocumentMarkArtwork;
|
|
25
|
+
readonly bdoc: DocumentMarkArtwork;
|
|
26
|
+
readonly cades: DocumentMarkArtwork;
|
|
27
|
+
readonly fatturaPA: DocumentMarkArtwork;
|
|
28
|
+
readonly isdoc: DocumentMarkArtwork;
|
|
29
|
+
readonly isdocx: DocumentMarkArtwork;
|
|
30
|
+
readonly xml: DocumentMarkArtwork;
|
|
31
|
+
readonly eAkta: DocumentMarkArtwork;
|
|
32
|
+
readonly et3: DocumentMarkArtwork;
|
|
33
|
+
readonly zep: DocumentMarkArtwork;
|
|
34
|
+
readonly xadesZep: DocumentMarkArtwork;
|
|
146
35
|
readonly dataBox: {
|
|
147
36
|
readonly viewBox: "0 0 24 24";
|
|
148
37
|
readonly gradients: readonly [];
|