@stll/ui 0.69.0 → 0.71.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/components/button.d.ts +13 -1
- package/dist/components/button.js +14 -5
- package/dist/components/date-picker-popover.js +8 -2
- package/dist/components/document-identity-badge.js +6 -0
- package/dist/components/horizontal-scroller.d.ts +6 -0
- package/dist/components/horizontal-scroller.js +59 -33
- package/dist/components/identity-text.js +1 -0
- package/dist/components/split-button.d.ts +6 -1
- package/dist/components/split-button.js +8 -3
- package/dist/components/view-toolbar.d.ts +11 -3
- package/dist/components/view-toolbar.js +16 -5
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -1
- package/dist/lib/file-size.d.ts +16 -0
- package/dist/lib/file-size.js +30 -0
- package/dist/review/review-out-of-date-notice.d.ts +7 -1
- package/dist/review/review-out-of-date-notice.js +4 -1
- package/dist/styles/inline-rename.css +9 -0
- package/package.json +5 -1
|
@@ -84,6 +84,16 @@ type ButtonProps = Omit<ButtonContract, "children" | "disabled"> & {
|
|
|
84
84
|
"data-accessible-disabled"?: "";
|
|
85
85
|
} & useRender.ComponentProps<"button">;
|
|
86
86
|
declare function Button({ className, variant: variantProp, size, render, layout, loading, icon, children, disabled, tooltip, selected, focusRing, shape, "data-accessible-disabled": accessibleDisabled, ...props }: ButtonProps): import("react").JSX.Element;
|
|
87
|
+
/**
|
|
88
|
+
* How a run shows it can be pressed: underlined like a link, or `plain`, by
|
|
89
|
+
* what it holds (a claim's text mark, which draws its own line), as a plain
|
|
90
|
+
* Button's look is its content.
|
|
91
|
+
*/
|
|
92
|
+
declare const BUTTON_TEXT_RUN_VARIANT_CLASS: {
|
|
93
|
+
readonly link: "underline underline-offset-2 hover:decoration-2";
|
|
94
|
+
readonly plain: "";
|
|
95
|
+
};
|
|
96
|
+
type ButtonTextRunVariant = keyof typeof BUTTON_TEXT_RUN_VARIANT_CLASS;
|
|
87
97
|
/**
|
|
88
98
|
* A run with no box can anchor no tooltip or popup, and carries no variant,
|
|
89
99
|
* size or icon: its text is its look.
|
|
@@ -91,6 +101,8 @@ declare function Button({ className, variant: variantProp, size, render, layout,
|
|
|
91
101
|
type ButtonTextRunProps = Omit<ButtonProps, "children" | "className" | "focusRing" | "icon" | "loading" | "render" | "selected" | "shape" | "size" | "tooltip" | "variant"> & {
|
|
92
102
|
children: ReactNode;
|
|
93
103
|
className?: string | undefined;
|
|
104
|
+
/** `link` unless the run holds a text mark that draws its own line. */
|
|
105
|
+
variant?: ButtonTextRunVariant | undefined;
|
|
94
106
|
};
|
|
95
107
|
/**
|
|
96
108
|
* A long run of prose that acts as one button: a citation or a
|
|
@@ -101,5 +113,5 @@ type ButtonTextRunProps = Omit<ButtonProps, "children" | "className" | "focusRin
|
|
|
101
113
|
* <button> it holds, which takes its accessible name from the label. Use
|
|
102
114
|
* `Button size="inline"` for a short action.
|
|
103
115
|
*/
|
|
104
|
-
declare const ButtonTextRun: ({ children, className, disabled, ...props }: ButtonTextRunProps) => import("react").JSX.Element;
|
|
116
|
+
declare const ButtonTextRun: ({ children, className, disabled, variant, ...props }: ButtonTextRunProps) => import("react").JSX.Element;
|
|
105
117
|
export { BUTTON_CONTENT, BUTTON_SIZE_CONTENT, Button, type ButtonFocusRing, type ButtonPlainShape, type ButtonProps, type ButtonSize, ButtonTextRun, type ButtonVariant, buttonAccessibleDisabledClass, buttonVariants };
|
|
@@ -286,10 +286,19 @@ function buttonContent({ icon, label, loading }) {
|
|
|
286
286
|
}), loader] });
|
|
287
287
|
}
|
|
288
288
|
/**
|
|
289
|
-
* The run is the visible target
|
|
290
|
-
*
|
|
289
|
+
* The run is the visible target, ringed while its button has keyboard focus
|
|
290
|
+
* (per line, so a wrapped run rings each line).
|
|
291
291
|
*/
|
|
292
|
-
const BUTTON_TEXT_RUN_CLASS = "has-focus-visible:ring-ring cursor-pointer rounded-xs
|
|
292
|
+
const BUTTON_TEXT_RUN_CLASS = "has-focus-visible:ring-ring cursor-pointer rounded-xs box-decoration-clone select-text has-focus-visible:ring-2 has-disabled:cursor-not-allowed has-disabled:opacity-64";
|
|
293
|
+
/**
|
|
294
|
+
* How a run shows it can be pressed: underlined like a link, or `plain`, by
|
|
295
|
+
* what it holds (a claim's text mark, which draws its own line), as a plain
|
|
296
|
+
* Button's look is its content.
|
|
297
|
+
*/
|
|
298
|
+
const BUTTON_TEXT_RUN_VARIANT_CLASS = {
|
|
299
|
+
link: "underline underline-offset-2 hover:decoration-2",
|
|
300
|
+
plain: ""
|
|
301
|
+
};
|
|
293
302
|
const BUTTON_TEXT_RUN_TARGET_CLASS = "absolute size-px overflow-hidden whitespace-nowrap [clip-path:inset(50%)]";
|
|
294
303
|
/**
|
|
295
304
|
* A long run of prose that acts as one button: a citation or a
|
|
@@ -300,8 +309,8 @@ const BUTTON_TEXT_RUN_TARGET_CLASS = "absolute size-px overflow-hidden whitespac
|
|
|
300
309
|
* <button> it holds, which takes its accessible name from the label. Use
|
|
301
310
|
* `Button size="inline"` for a short action.
|
|
302
311
|
*/
|
|
303
|
-
const ButtonTextRun = ({ children, className, disabled, ...props }) => /* @__PURE__ */ jsxs("label", {
|
|
304
|
-
className: cn(BUTTON_TEXT_RUN_CLASS, className),
|
|
312
|
+
const ButtonTextRun = ({ children, className, disabled, variant = "link", ...props }) => /* @__PURE__ */ jsxs("label", {
|
|
313
|
+
className: cn(BUTTON_TEXT_RUN_CLASS, BUTTON_TEXT_RUN_VARIANT_CLASS[variant], className),
|
|
305
314
|
"data-slot": "button-text-run",
|
|
306
315
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
307
316
|
...props,
|
|
@@ -66,7 +66,7 @@ const getFirstDayOfWeek = (locale) => {
|
|
|
66
66
|
if (!info) return 0;
|
|
67
67
|
return info.firstDay === 7 ? 6 : info.firstDay - 1;
|
|
68
68
|
};
|
|
69
|
-
const getMonthDays = (year, month, firstDow, weekendDays, today) => {
|
|
69
|
+
const getMonthDays = ({ year, month, firstDow, weekendDays, today }) => {
|
|
70
70
|
const days = [];
|
|
71
71
|
const first = Temporal.PlainDate.from({
|
|
72
72
|
year,
|
|
@@ -274,7 +274,13 @@ const DatePickerPopoverContent = (props) => {
|
|
|
274
274
|
const [view, setView] = useState("days");
|
|
275
275
|
const [decadeBaseOverride, setDecadeBaseOverride] = useState(null);
|
|
276
276
|
const decadeBase = decadeBaseOverride ?? decadeStart(viewYear);
|
|
277
|
-
const days = useMemo(() => getMonthDays(
|
|
277
|
+
const days = useMemo(() => getMonthDays({
|
|
278
|
+
year: viewYear,
|
|
279
|
+
month: viewMonth,
|
|
280
|
+
firstDow,
|
|
281
|
+
weekendDays,
|
|
282
|
+
today
|
|
283
|
+
}), [
|
|
278
284
|
viewYear,
|
|
279
285
|
viewMonth,
|
|
280
286
|
firstDow,
|
|
@@ -50,15 +50,21 @@ function documentIdentityMark(identity, size) {
|
|
|
50
50
|
* in the same monospace units, so no observer or per-row state is needed; a
|
|
51
51
|
* label longer than its slot even in the short form truncates rather than
|
|
52
52
|
* spilling over its neighbour.
|
|
53
|
+
*
|
|
54
|
+
* The visible form depends on the slot, but the accessible name is always the
|
|
55
|
+
* full label: a narrow slot shows `262/06`, and a row whose title lacks the
|
|
56
|
+
* citation still exposes `262/2006`.
|
|
53
57
|
*/
|
|
54
58
|
function referenceLabelMark(labels, kind) {
|
|
55
59
|
const classes = statuteLabelClasses(labels.long.length);
|
|
56
60
|
return /* @__PURE__ */ jsxs("span", {
|
|
57
61
|
className: cn("@container/document-identity inline-flex max-w-full shrink-0 items-center justify-center font-mono leading-4 font-semibold tabular-nums", labels.short.length > 7 ? "text-[9px]" : "text-[10px]"),
|
|
58
62
|
style: { width: `${labels.long.length + .25}ch` },
|
|
63
|
+
"aria-label": labels.long,
|
|
59
64
|
"data-slot": "document-identity-badge",
|
|
60
65
|
"data-kind": kind,
|
|
61
66
|
dir: "ltr",
|
|
67
|
+
role: "img",
|
|
62
68
|
children: [/* @__PURE__ */ jsx(TruncatedText, {
|
|
63
69
|
className: classes.short,
|
|
64
70
|
hint: false,
|
|
@@ -13,6 +13,12 @@ type ScrollState = {
|
|
|
13
13
|
};
|
|
14
14
|
export declare const HorizontalScroller: ({ children, className, nextLabel, previousLabel, contentClassName, viewportClassName, ...props }: HorizontalScrollerProps) => import("react").JSX.Element;
|
|
15
15
|
export declare const scrollState: (scrollLeft: number, scrollWidth: number, clientWidth: number, direction: ScrollDirection) => ScrollState;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the content needs the controls at all, decided from `rowWidth`, the
|
|
18
|
+
* whole width the scroller has: the controls take room from the viewport once
|
|
19
|
+
* they show, and content that fits the row without them needs none.
|
|
20
|
+
*/
|
|
21
|
+
export declare const fitsRow: (scrollWidth: number, rowWidth: number) => boolean;
|
|
16
22
|
/** Wheel deltas arrive in pixels, lines or pages; scrollBy takes pixels. */
|
|
17
23
|
export declare const wheelDeltaPixels: (event: Pick<WheelEvent, "deltaMode" | "deltaY">, node: Pick<HTMLElement, "clientWidth">) => number;
|
|
18
24
|
export {};
|
|
@@ -3,10 +3,11 @@ import { containedEventHandler } from "../hooks/use-contained-handler.js";
|
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon } from "../icons.js";
|
|
4
4
|
import { SCROLL_EDGE_FADE_CLASS, writeScrollEdgeFade } from "../lib/scroll-edge-fade.js";
|
|
5
5
|
import { cn } from "../lib/utils.js";
|
|
6
|
-
import {
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { useCallback, useState } from "react";
|
|
8
8
|
// src/components/horizontal-scroller.tsx
|
|
9
|
-
const CONTROL_CLASS = "bg-background
|
|
9
|
+
const CONTROL_CLASS = "bg-background text-foreground shrink-0 rounded-full border p-1 shadow-sm";
|
|
10
|
+
const INERT_CONTROL_CLASS = "pointer-events-none w-0 overflow-hidden border-0 p-0 opacity-0 focus-visible:w-auto focus-visible:border focus-visible:p-1 focus-visible:opacity-100";
|
|
10
11
|
const HorizontalScroller = ({ children, className, nextLabel, previousLabel, contentClassName, viewportClassName, ...props }) => {
|
|
11
12
|
const [viewport, setViewport] = useState(null);
|
|
12
13
|
const [state, setState] = useState({
|
|
@@ -15,7 +16,11 @@ const HorizontalScroller = ({ children, className, nextLabel, previousLabel, con
|
|
|
15
16
|
});
|
|
16
17
|
const measure = useCallback((node) => {
|
|
17
18
|
writeScrollEdgeFade(node);
|
|
18
|
-
|
|
19
|
+
const rowWidth = rowContentWidth(node.parentElement) ?? node.clientWidth;
|
|
20
|
+
setState(fitsRow(node.scrollWidth, rowWidth) ? {
|
|
21
|
+
canScrollEnd: false,
|
|
22
|
+
canScrollStart: false
|
|
23
|
+
} : scrollState(node.scrollLeft, node.scrollWidth, node.clientWidth, getComputedStyle(node).direction === "rtl" ? "rtl" : "ltr"));
|
|
19
24
|
}, []);
|
|
20
25
|
const viewportRef = useCallback((node) => {
|
|
21
26
|
setViewport(node);
|
|
@@ -48,8 +53,9 @@ const HorizontalScroller = ({ children, className, nextLabel, previousLabel, con
|
|
|
48
53
|
});
|
|
49
54
|
};
|
|
50
55
|
const onScroll = (event) => measure(event.currentTarget);
|
|
56
|
+
const overflows = state.canScrollStart || state.canScrollEnd;
|
|
51
57
|
return /* @__PURE__ */ jsxs("div", {
|
|
52
|
-
className: cn("
|
|
58
|
+
className: cn("flex min-w-0 items-center", className),
|
|
53
59
|
onFocus: containedEventHandler(({ target }) => {
|
|
54
60
|
if (target instanceof HTMLElement && target !== viewport) target.scrollIntoView({
|
|
55
61
|
block: "nearest",
|
|
@@ -57,35 +63,39 @@ const HorizontalScroller = ({ children, className, nextLabel, previousLabel, con
|
|
|
57
63
|
});
|
|
58
64
|
}),
|
|
59
65
|
...props,
|
|
60
|
-
children: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className: cn("
|
|
66
|
-
|
|
66
|
+
children: [
|
|
67
|
+
overflows && /* @__PURE__ */ jsx("button", {
|
|
68
|
+
"aria-disabled": !state.canScrollStart,
|
|
69
|
+
tabIndex: state.canScrollStart ? void 0 : -1,
|
|
70
|
+
"aria-label": previousLabel,
|
|
71
|
+
className: cn(CONTROL_CLASS, state.canScrollStart ? "me-1" : INERT_CONTROL_CLASS),
|
|
72
|
+
onClick: () => {
|
|
73
|
+
if (state.canScrollStart) scroll(-1);
|
|
74
|
+
},
|
|
75
|
+
type: "button",
|
|
76
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-4 rtl:rotate-180" })
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsx("div", {
|
|
79
|
+
className: cn("scrollbar-subtle min-w-0 flex-1 overflow-x-auto overscroll-x-contain [--fade-size:2.5rem]", SCROLL_EDGE_FADE_CLASS, viewportClassName),
|
|
80
|
+
onScroll,
|
|
81
|
+
ref: viewportRef,
|
|
82
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
83
|
+
className: cn("w-max min-w-full", contentClassName),
|
|
84
|
+
children
|
|
85
|
+
})
|
|
86
|
+
}),
|
|
87
|
+
overflows && /* @__PURE__ */ jsx("button", {
|
|
88
|
+
"aria-disabled": !state.canScrollEnd,
|
|
89
|
+
tabIndex: state.canScrollEnd ? void 0 : -1,
|
|
90
|
+
"aria-label": nextLabel,
|
|
91
|
+
className: cn(CONTROL_CLASS, state.canScrollEnd ? "ms-1" : INERT_CONTROL_CLASS),
|
|
92
|
+
onClick: () => {
|
|
93
|
+
if (state.canScrollEnd) scroll(1);
|
|
94
|
+
},
|
|
95
|
+
type: "button",
|
|
96
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-4 rtl:rotate-180" })
|
|
67
97
|
})
|
|
68
|
-
|
|
69
|
-
"aria-disabled": !state.canScrollStart,
|
|
70
|
-
tabIndex: state.canScrollStart ? void 0 : -1,
|
|
71
|
-
"aria-label": previousLabel,
|
|
72
|
-
className: cn(CONTROL_CLASS, "start-1", !state.canScrollStart && "pointer-events-none opacity-0 focus-visible:opacity-100"),
|
|
73
|
-
onClick: () => {
|
|
74
|
-
if (state.canScrollStart) scroll(-1);
|
|
75
|
-
},
|
|
76
|
-
type: "button",
|
|
77
|
-
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "size-4 rtl:rotate-180" })
|
|
78
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
79
|
-
"aria-disabled": !state.canScrollEnd,
|
|
80
|
-
tabIndex: state.canScrollEnd ? void 0 : -1,
|
|
81
|
-
"aria-label": nextLabel,
|
|
82
|
-
className: cn(CONTROL_CLASS, "end-1", !state.canScrollEnd && "pointer-events-none opacity-0 focus-visible:opacity-100"),
|
|
83
|
-
onClick: () => {
|
|
84
|
-
if (state.canScrollEnd) scroll(1);
|
|
85
|
-
},
|
|
86
|
-
type: "button",
|
|
87
|
-
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "size-4 rtl:rotate-180" })
|
|
88
|
-
})] })]
|
|
98
|
+
]
|
|
89
99
|
});
|
|
90
100
|
};
|
|
91
101
|
const scrollState = (scrollLeft, scrollWidth, clientWidth, direction) => {
|
|
@@ -96,6 +106,22 @@ const scrollState = (scrollLeft, scrollWidth, clientWidth, direction) => {
|
|
|
96
106
|
canScrollEnd: maximum > 1 && position < maximum - 1
|
|
97
107
|
};
|
|
98
108
|
};
|
|
109
|
+
/**
|
|
110
|
+
* The width the row's children span: the room the controls and the viewport
|
|
111
|
+
* share, without the row's own padding, in either direction.
|
|
112
|
+
*/
|
|
113
|
+
const rowContentWidth = (row) => {
|
|
114
|
+
const first = row?.firstElementChild?.getBoundingClientRect();
|
|
115
|
+
const last = row?.lastElementChild?.getBoundingClientRect();
|
|
116
|
+
if (first === void 0 || last === void 0) return;
|
|
117
|
+
return Math.max(first.right, last.right) - Math.min(first.left, last.left);
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Whether the content needs the controls at all, decided from `rowWidth`, the
|
|
121
|
+
* whole width the scroller has: the controls take room from the viewport once
|
|
122
|
+
* they show, and content that fits the row without them needs none.
|
|
123
|
+
*/
|
|
124
|
+
const fitsRow = (scrollWidth, rowWidth) => scrollWidth - rowWidth <= 1;
|
|
99
125
|
const LINE_HEIGHT_PX = 16;
|
|
100
126
|
/** Wheel deltas arrive in pixels, lines or pages; scrollBy takes pixels. */
|
|
101
127
|
const wheelDeltaPixels = (event, node) => {
|
|
@@ -105,4 +131,4 @@ const wheelDeltaPixels = (event, node) => {
|
|
|
105
131
|
default: return event.deltaY;
|
|
106
132
|
}
|
|
107
133
|
};
|
|
108
|
-
export { HorizontalScroller, scrollState, wheelDeltaPixels };
|
|
134
|
+
export { HorizontalScroller, fitsRow, scrollState, wheelDeltaPixels };
|
|
@@ -64,6 +64,7 @@ const IdentityText = ({ children, className }) => {
|
|
|
64
64
|
}), /* @__PURE__ */ jsx(TooltipPopup, {
|
|
65
65
|
className: "max-w-sm",
|
|
66
66
|
role: "tooltip",
|
|
67
|
+
side: "inline-end",
|
|
67
68
|
children: /* @__PURE__ */ jsx("span", {
|
|
68
69
|
className: "block max-w-sm wrap-break-word",
|
|
69
70
|
dir: "auto",
|
|
@@ -31,6 +31,11 @@ type SplitButtonProps = SplitButtonSharedProps & SplitButtonPrimary & ({
|
|
|
31
31
|
open?: ComponentProps<typeof Popover>["open"];
|
|
32
32
|
onOpenChange?: ComponentProps<typeof Popover>["onOpenChange"];
|
|
33
33
|
});
|
|
34
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Two independent actions share quiet chrome; only the chevron opens the
|
|
36
|
+
* secondary surface. The chrome is quiet, not the glyphs: both halves keep the
|
|
37
|
+
* foreground colour of every other ghost button, so an enabled split button
|
|
38
|
+
* never reads as disabled beside its neighbours.
|
|
39
|
+
*/
|
|
35
40
|
export declare const SplitButton: (props: SplitButtonProps) => import("react").JSX.Element;
|
|
36
41
|
export {};
|
|
@@ -6,11 +6,16 @@ import { DropdownMenu as Menu, DropdownMenuTrigger as MenuTrigger } from "./menu
|
|
|
6
6
|
import { Popover, PopoverTrigger } from "./popover.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
// src/components/split-button.tsx
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Two independent actions share quiet chrome; only the chevron opens the
|
|
11
|
+
* secondary surface. The chrome is quiet, not the glyphs: both halves keep the
|
|
12
|
+
* foreground colour of every other ghost button, so an enabled split button
|
|
13
|
+
* never reads as disabled beside its neighbours.
|
|
14
|
+
*/
|
|
10
15
|
const SplitButton = (props) => {
|
|
11
16
|
const { primaryLabel, menuLabel, primaryDescriptionId, menuDescriptionId, onPrimaryClick, children, menu, primaryDisabled, menuDisabled, size = "md", className } = props;
|
|
12
17
|
const triggerButton = /* @__PURE__ */ jsx(Button, {
|
|
13
|
-
className: cn("
|
|
18
|
+
className: cn("group-hover/split:bg-muted group-focus-within/split:bg-muted hover:bg-accent active:bg-accent/80 data-popup-open:bg-accent rounded-md [&_svg]:mx-0", size === "sm" ? "h-7 w-3.5 px-0 sm:h-7" : "h-8 w-4 px-0 sm:h-8", "pointer-coarse:min-h-11 pointer-coarse:min-w-11"),
|
|
14
19
|
size: "sm",
|
|
15
20
|
tooltip: menuLabel,
|
|
16
21
|
variant: "ghost"
|
|
@@ -22,7 +27,7 @@ const SplitButton = (props) => {
|
|
|
22
27
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
23
28
|
"aria-describedby": primaryDescriptionId,
|
|
24
29
|
"aria-label": primaryLabel,
|
|
25
|
-
className: cn("
|
|
30
|
+
className: cn("active:bg-accent/80 rounded-md [&_svg]:mx-0 [&_svg]:size-3.5 [&_svg:not([class*='size-'])]:size-3.5 sm:[&_svg:not([class*='size-'])]:size-3.5", size === "sm" ? "h-7 ps-1.5 pe-0.5 sm:h-7" : "h-8 ps-2 pe-0.5 sm:h-8", "pointer-coarse:min-h-11 pointer-coarse:min-w-11"),
|
|
26
31
|
disabled: primaryDisabled,
|
|
27
32
|
onClick: onPrimaryClick,
|
|
28
33
|
size: "sm",
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { Button } from "./button.js";
|
|
2
2
|
import { ComponentProps } from "react";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* The one row that holds a view switcher and its toolbar. It never wraps: at
|
|
5
|
+
* any width the tabs and the controls share a single line, the tabs taking the
|
|
6
|
+
* free space and scrolling, the toolbar keeping its place at the end.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ViewChromeBar: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
9
|
+
/**
|
|
10
|
+
* Shared view controls, placed at the end of a `ViewChromeBar`. They stay on
|
|
11
|
+
* one line and scroll horizontally once they outgrow half the row on a phone,
|
|
12
|
+
* or two thirds of it from `md` up, so the tabs beside them always keep room
|
|
13
|
+
* for a whole tab and scroll, and a control past the edge is scrolled to rather
|
|
14
|
+
* than clipped.
|
|
7
15
|
*/
|
|
8
16
|
export declare const ViewToolbarChrome: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
9
17
|
type ViewFilterButtonProps = Omit<ComponentProps<typeof Button>, "children" | "size" | "variant" | "aria-label" | "title"> & {
|
|
@@ -4,12 +4,23 @@ import { Button } from "./button.js";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
// src/components/view-toolbar.tsx
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The one row that holds a view switcher and its toolbar. It never wraps: at
|
|
8
|
+
* any width the tabs and the controls share a single line, the tabs taking the
|
|
9
|
+
* free space and scrolling, the toolbar keeping its place at the end.
|
|
10
|
+
*/
|
|
11
|
+
const ViewChromeBar = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
12
|
+
className: cn("flex min-w-0 flex-nowrap items-center border-b", className),
|
|
13
|
+
...props
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Shared view controls, placed at the end of a `ViewChromeBar`. They stay on
|
|
17
|
+
* one line and scroll horizontally once they outgrow half the row on a phone,
|
|
18
|
+
* or two thirds of it from `md` up, so the tabs beside them always keep room
|
|
19
|
+
* for a whole tab and scroll, and a control past the edge is scrolled to rather
|
|
20
|
+
* than clipped.
|
|
10
21
|
*/
|
|
11
22
|
const ViewToolbarChrome = ({ className, ...props }) => /* @__PURE__ */ jsx("div", {
|
|
12
|
-
className: cn("flex max-w-
|
|
23
|
+
className: cn("ms-auto flex max-w-1/2 min-w-0 shrink-0 [scrollbar-width:none] flex-nowrap items-center gap-1 overflow-x-auto px-2 py-1 [-ms-overflow-style:none] md:max-w-2/3 [&::-webkit-scrollbar]:hidden", className),
|
|
13
24
|
...props
|
|
14
25
|
});
|
|
15
26
|
const ViewFilterButton = ({ label, ...props }) => /* @__PURE__ */ jsx(Button, {
|
|
@@ -26,4 +37,4 @@ const ViewFilterChip = ({ className, ...props }) => /* @__PURE__ */ jsx(Button,
|
|
|
26
37
|
size: "xs",
|
|
27
38
|
variant: "secondary"
|
|
28
39
|
});
|
|
29
|
-
export { ViewFilterButton, ViewFilterChip, ViewToolbarChrome };
|
|
40
|
+
export { ViewChromeBar, ViewFilterButton, ViewFilterChip, ViewToolbarChrome };
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CogIcon, Columns2Icon, Columns3Icon,
|
|
2
|
-
export { ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CogIcon, Columns2Icon, Columns3Icon,
|
|
1
|
+
import { ActivityIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, AppWindowMacIcon as BrowserControlIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookOpenIcon as CaseLawIcon, BookOpenIcon as SkillIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyIcon as CopyToClipboardIcon, CopyIcon as DuplicateIcon, CopyPlusIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DollarSignIcon, DownloadIcon, EditIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileStackIcon as EditPagesIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, LucideIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquarePlusIcon as NewChatIcon, MessageSquareQuoteIcon as AddCommentIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, MicIcon as DictateIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WandSparklesIcon as AiActionIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon } from "lucide-react";
|
|
2
|
+
export { ActivityIcon, AddCommentIcon, AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, CaseLawIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyFromMenuIcon, CopyPlusIcon, CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, DictateIcon, DollarSignIcon, DownloadIcon, DuplicateIcon, EditIcon, EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, type LucideIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, SkillIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon };
|
package/dist/icons.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ActivityIcon, MessageSquareQuoteIcon as AddCommentIcon, WandSparklesIcon as AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, AppWindowMacIcon as BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, BookOpenIcon as CaseLawIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CogIcon, Columns2Icon, Columns3Icon,
|
|
1
|
+
export { ActivityIcon, MessageSquareQuoteIcon as AddCommentIcon, WandSparklesIcon as AiActionIcon, AlarmClockIcon, AlertCircleIcon, AlertTriangleIcon, AlignJustifyIcon, AlignLeftIcon, ArchiveIcon, ArchiveRestoreIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpDownIcon, ArrowUpIcon, AtSignIcon, BanIcon, BanknoteIcon, BellIcon, BlocksIcon, BoldIcon, BookOpenCheckIcon, BookTextIcon, BookmarkIcon, BookmarkPlusIcon, BracesIcon, BrainIcon, AppWindowMacIcon as BrowserControlIcon, Building2Icon, BuildingIcon, CableIcon, CalendarClockIcon, CalendarIcon, BookOpenIcon as CaseLawIcon, CheckCheckIcon, CheckCircle2Icon, CheckIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, ChevronsUpDownIcon, CircleAlertIcon, CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CircleHelpIcon, CircleIcon, CircleOffIcon, CircleUserRoundIcon, ClipboardCheckIcon, ClipboardCopyIcon, ClipboardIcon, ClipboardListIcon, Clock3Icon, ClockIcon, CloudIcon, CogIcon, Columns2Icon, Columns3Icon, CommandIcon, CompassIcon, CopyIcon as CopyFromMenuIcon, CopyPlusIcon, CopyIcon as CopyToClipboardIcon, CornerDownLeftIcon, CpuIcon, CropIcon, DatabaseIcon, MicIcon as DictateIcon, DollarSignIcon, DownloadIcon, CopyIcon as DuplicateIcon, EditIcon, FileStackIcon as EditPagesIcon, EllipsisIcon, EllipsisVerticalIcon, EqualIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileBadgeIcon, FileCheckIcon, FileCodeIcon, FileDiffIcon, FileDigitIcon, FileDownIcon, FileIcon, FileImageIcon, FileOutputIcon, FilePlus2Icon, FilePlusIcon, FileQuestionIcon, FileSearchIcon, FileSpreadsheetIcon, FileTextIcon, FileUpIcon, FilterIcon, FilterXIcon, FlagIcon, FlaskConicalIcon, FoldHorizontalIcon, FolderIcon, FolderInputIcon, FolderOpenIcon, FolderPlusIcon, FolderSyncIcon, FolderTreeIcon, FunctionSquareIcon, GanttChartIcon, GaugeIcon, GitBranchIcon, GitCommitHorizontalIcon, GitPullRequestIcon, GlobeIcon, GraduationCapIcon, GripVerticalIcon, HashIcon, Heading1Icon, Heading2Icon, Heading3Icon, HelpCircleIcon, HighlighterIcon, HistoryIcon, ImageIcon, ImageOffIcon, InboxIcon, InfoIcon, ItalicIcon, KanbanIcon, KeyRoundIcon, KeyboardIcon, LandmarkIcon, LanguagesIcon, LaptopIcon, LayersIcon, LayoutDashboardIcon, LayoutGridIcon, LayoutTemplateIcon, LibraryBigIcon, LibraryIcon, Link2Icon, LinkIcon, ListChecksIcon, ListFilterIcon, ListIcon, ListMinusIcon, ListOrderedIcon, ListTodoIcon, ListTreeIcon, ListXIcon, LoaderCircleIcon, LockIcon, LockKeyholeIcon, LockOpenIcon, LogOutIcon, MailIcon, Maximize2Icon, MegaphoneIcon, MessageCircleQuestionIcon, MessageSquareIcon, MessageSquareTextIcon, MessageSquareWarningIcon, MessagesSquareIcon, Minimize2Icon, MinusIcon, MonitorIcon, MoonIcon, MoreHorizontalIcon, MessageSquarePlusIcon as NewChatIcon, PackageIcon, PaletteIcon, PanelLeftIcon, PanelRightIcon, PaperclipIcon, PauseIcon, PenIcon, PenLineIcon, PencilIcon, PencilLineIcon, PhoneIcon, PinIcon, PinOffIcon, PlayIcon, PlugIcon, PlusIcon, PowerIcon, PrinterIcon, QuoteIcon, Redo2Icon, RefreshCcwIcon, RefreshCwIcon, RepeatIcon, RotateCcwIcon, RotateCwIcon, RouteIcon, Rows2Icon, Rows3Icon, SaveIcon, ScanSearchIcon, ScanTextIcon, ScissorsIcon, ScrollTextIcon, SearchIcon, SearchXIcon, SendIcon, ServerIcon, Settings2Icon, ShapesIcon, ShieldAlertIcon, ShieldCheckIcon, ShieldIcon, SigmaIcon, SignatureIcon, BookOpenIcon as SkillIcon, SlashIcon, SlidersHorizontalIcon, SparklesIcon, SplitIcon, SquareCheckIcon, SquareIcon, SquareMinusIcon, SquarePenIcon, StarIcon, StarOffIcon, StickyNoteIcon, StrikethroughIcon, SunIcon, TableIcon, TagIcon, TagsIcon, TerminalIcon, TextIcon, TextQuoteIcon, ToggleLeftIcon, Trash2Icon, TrashIcon, TriangleAlertIcon, UnderlineIcon, Undo2Icon, UndoIcon, UnfoldHorizontalIcon, UngroupIcon, UploadIcon, UserCheckIcon, UserIcon, UserPlusIcon, UserRoundIcon, UsersIcon, VideoIcon, WavesIcon, WindIcon, WorkflowIcon, WrapTextIcon, WrenchIcon, XCircleIcon, XIcon, XSquareIcon, ZapIcon } from "lucide-react";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const getFileSizeDisplay: (sizeBytes: number) => {
|
|
2
|
+
unit: string;
|
|
3
|
+
value: number;
|
|
4
|
+
};
|
|
5
|
+
/** Formats a number in the reader's locale, as `use-intl`'s formatter does. */
|
|
6
|
+
type NumberFormatter = {
|
|
7
|
+
readonly number: (value: number, options: {
|
|
8
|
+
maximumFractionDigits: number;
|
|
9
|
+
style: "unit";
|
|
10
|
+
unit: string;
|
|
11
|
+
unitDisplay: "short";
|
|
12
|
+
}) => string;
|
|
13
|
+
};
|
|
14
|
+
/** A file size in the reader's locale, at most one decimal ("1.2 MB"). */
|
|
15
|
+
export declare const formatFileSize: (sizeBytes: number, format: NumberFormatter) => string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/lib/file-size.ts
|
|
2
|
+
const getFileSizeDisplay = (sizeBytes) => {
|
|
3
|
+
if (sizeBytes < 1e3) return {
|
|
4
|
+
unit: "byte",
|
|
5
|
+
value: sizeBytes
|
|
6
|
+
};
|
|
7
|
+
if (sizeBytes < 1e6) return {
|
|
8
|
+
unit: "kilobyte",
|
|
9
|
+
value: sizeBytes / 1e3
|
|
10
|
+
};
|
|
11
|
+
if (sizeBytes < 1e9) return {
|
|
12
|
+
unit: "megabyte",
|
|
13
|
+
value: sizeBytes / 1e6
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
unit: "gigabyte",
|
|
17
|
+
value: sizeBytes / 1e9
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** A file size in the reader's locale, at most one decimal ("1.2 MB"). */
|
|
21
|
+
const formatFileSize = (sizeBytes, format) => {
|
|
22
|
+
const size = getFileSizeDisplay(sizeBytes);
|
|
23
|
+
return format.number(size.value, {
|
|
24
|
+
maximumFractionDigits: 1,
|
|
25
|
+
style: "unit",
|
|
26
|
+
unit: size.unit,
|
|
27
|
+
unitDisplay: "short"
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export { formatFileSize, getFileSizeDisplay };
|
|
@@ -14,6 +14,12 @@ type ReviewOutOfDateNoticeProps = {
|
|
|
14
14
|
reasons: readonly ReviewOutOfDateReason[];
|
|
15
15
|
actionLabel?: ReactNode;
|
|
16
16
|
onAction?: (() => void) | undefined;
|
|
17
|
+
/** The action is running: its button shows it and takes no second press. */
|
|
18
|
+
actionPending?: boolean;
|
|
19
|
+
/** The action is not available now. */
|
|
20
|
+
actionDisabled?: boolean;
|
|
21
|
+
/** Why the action is not available now, shown on hover over it. */
|
|
22
|
+
actionDisabledReason?: ReactNode;
|
|
17
23
|
tone?: ReviewOutOfDateTone;
|
|
18
24
|
className?: string;
|
|
19
25
|
};
|
|
@@ -22,5 +28,5 @@ type ReviewOutOfDateNoticeProps = {
|
|
|
22
28
|
* together: they are different reasons to run again, and a reviewer working
|
|
23
29
|
* through findings should see each one rather than the first.
|
|
24
30
|
*/
|
|
25
|
-
export declare const ReviewOutOfDateNotice: ({ reasons, actionLabel, onAction, tone, className }: ReviewOutOfDateNoticeProps) => import("react").JSX.Element | null;
|
|
31
|
+
export declare const ReviewOutOfDateNotice: ({ reasons, actionLabel, onAction, actionPending, actionDisabled, actionDisabledReason, tone, className }: ReviewOutOfDateNoticeProps) => import("react").JSX.Element | null;
|
|
26
32
|
export {};
|
|
@@ -7,7 +7,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
7
7
|
* together: they are different reasons to run again, and a reviewer working
|
|
8
8
|
* through findings should see each one rather than the first.
|
|
9
9
|
*/
|
|
10
|
-
const ReviewOutOfDateNotice = ({ reasons, actionLabel, onAction, tone = "warning", className }) => {
|
|
10
|
+
const ReviewOutOfDateNotice = ({ reasons, actionLabel, onAction, actionPending = false, actionDisabled = false, actionDisabledReason, tone = "warning", className }) => {
|
|
11
11
|
if (reasons.length === 0) return null;
|
|
12
12
|
return /* @__PURE__ */ jsxs("div", {
|
|
13
13
|
className: cn("mb-2 rounded-lg border px-3 py-2", TONE_CLASS[tone], className),
|
|
@@ -17,8 +17,11 @@ const ReviewOutOfDateNotice = ({ reasons, actionLabel, onAction, tone = "warning
|
|
|
17
17
|
children: reasons.map((reason) => /* @__PURE__ */ jsx("li", { children: reason.label }, reason.id))
|
|
18
18
|
}), onAction === void 0 ? null : /* @__PURE__ */ jsx(Button, {
|
|
19
19
|
className: "mt-2",
|
|
20
|
+
disabled: actionDisabled,
|
|
21
|
+
loading: actionPending,
|
|
20
22
|
onClick: onAction,
|
|
21
23
|
size: "xs",
|
|
24
|
+
tooltip: actionDisabled ? actionDisabledReason : void 0,
|
|
22
25
|
variant: "outline",
|
|
23
26
|
children: actionLabel
|
|
24
27
|
})]
|
|
@@ -20,7 +20,12 @@
|
|
|
20
20
|
line-height: inherit;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/* The field's 10ch floor lives here as a fixed length: a parent sizing its
|
|
24
|
+
row from its content ignores a percentage floor and lays the field out
|
|
25
|
+
wider than it measured, so the overflow came out of the siblings (a
|
|
26
|
+
breadcrumb's matter name shrank to nothing beside its number). */
|
|
23
27
|
[data-slot="inline-rename-mirror"] {
|
|
28
|
+
min-inline-size: 10ch;
|
|
24
29
|
visibility: hidden;
|
|
25
30
|
white-space: pre;
|
|
26
31
|
overflow: hidden;
|
|
@@ -49,6 +54,10 @@
|
|
|
49
54
|
position: static;
|
|
50
55
|
field-sizing: content;
|
|
51
56
|
inline-size: auto;
|
|
57
|
+
/* The mirror reserves the floor; the input hugs its text so opening a
|
|
58
|
+
short title does not widen or move it. */
|
|
59
|
+
min-inline-size: 0;
|
|
60
|
+
justify-self: start;
|
|
52
61
|
}
|
|
53
62
|
}
|
|
54
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"description": "Stella's design system: bidi-aware React primitives built on Base UI, the dockable inspector pane, and the Tailwind v4 theme they are styled with.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"base-ui",
|
|
@@ -230,6 +230,10 @@
|
|
|
230
230
|
"types": "./dist/components/frame.d.ts",
|
|
231
231
|
"import": "./dist/components/frame.js"
|
|
232
232
|
},
|
|
233
|
+
"./file-size": {
|
|
234
|
+
"types": "./dist/lib/file-size.d.ts",
|
|
235
|
+
"import": "./dist/lib/file-size.js"
|
|
236
|
+
},
|
|
233
237
|
"./hex-color-picker": {
|
|
234
238
|
"types": "./dist/components/hex-color-picker.d.ts",
|
|
235
239
|
"import": "./dist/components/hex-color-picker.js"
|