@sdxc/ui 2026.11.1 → 2026.11.3
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/README.md +1 -1
- package/dist/app/app-shell-toggle.d.ts +31 -0
- package/dist/app/app-shell-toggle.js +43 -0
- package/dist/app/app-shell.d.ts +131 -0
- package/dist/app/app-shell.js +542 -0
- package/dist/app/auto-refresh.d.ts +104 -0
- package/dist/app/auto-refresh.js +126 -0
- package/dist/app/behaviors/refresh-schedule.d.ts +53 -0
- package/dist/app/behaviors/refresh-schedule.js +95 -0
- package/dist/app/behaviors/shortcuts.d.ts +175 -0
- package/dist/app/behaviors/shortcuts.js +401 -0
- package/dist/app/behaviors/toaster.d.ts +31 -2
- package/dist/app/behaviors/toaster.js +62 -5
- package/dist/app/chart.d.ts +62 -8
- package/dist/app/chart.js +207 -9
- package/dist/app/command-palette.d.ts +132 -0
- package/dist/app/command-palette.js +181 -0
- package/dist/app/danger-zone.d.ts +66 -0
- package/dist/app/danger-zone.js +66 -0
- package/dist/app/detail-sheet.d.ts +119 -0
- package/dist/app/detail-sheet.js +173 -0
- package/dist/app/drop-zone.d.ts +2 -1
- package/dist/app/drop-zone.js +6 -3
- package/dist/app/editor-layout.d.ts +69 -0
- package/dist/app/editor-layout.js +143 -0
- package/dist/app/empty.d.ts +56 -19
- package/dist/app/empty.js +129 -22
- package/dist/app/filter-bar.d.ts +169 -0
- package/dist/app/filter-bar.js +346 -0
- package/dist/app/index.d.ts +51 -0
- package/dist/app/index.js +51 -0
- package/dist/app/keyboard-help.d.ts +66 -0
- package/dist/app/keyboard-help.js +56 -0
- package/dist/app/mixins/app-shell-controls.d.ts +46 -0
- package/dist/app/mixins/app-shell-controls.js +131 -0
- package/dist/app/mixins/auto-refresh.d.ts +29 -0
- package/dist/app/mixins/auto-refresh.js +66 -0
- package/dist/app/mixins/command-palette.d.ts +56 -0
- package/dist/app/mixins/command-palette.js +297 -0
- package/dist/app/mixins/copy-permalink.d.ts +26 -0
- package/dist/app/mixins/copy-permalink.js +54 -0
- package/dist/app/mixins/detail-sheet-keys.d.ts +28 -0
- package/dist/app/mixins/detail-sheet-keys.js +88 -0
- package/dist/app/mixins/escape-link.d.ts +17 -0
- package/dist/app/mixins/escape-link.js +35 -0
- package/dist/app/mixins/keyboard-help.d.ts +38 -0
- package/dist/app/mixins/keyboard-help.js +51 -0
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +80 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +153 -0
- package/dist/app/mixins/range-picker-keys.d.ts +18 -0
- package/dist/app/mixins/range-picker-keys.js +94 -0
- package/dist/app/mixins/row-navigation.d.ts +85 -0
- package/dist/app/mixins/row-navigation.js +208 -0
- package/dist/app/mixins/save-bar-sync.d.ts +27 -0
- package/dist/app/mixins/save-bar-sync.js +106 -0
- package/dist/app/mixins/save-shortcut.d.ts +47 -0
- package/dist/app/mixins/save-shortcut.js +101 -0
- package/dist/app/mixins/save-status-sync.d.ts +77 -0
- package/dist/app/mixins/save-status-sync.js +159 -0
- package/dist/app/mixins/selection-bar-sync.d.ts +32 -0
- package/dist/app/mixins/selection-bar-sync.js +151 -0
- package/dist/app/mixins/split-view.d.ts +66 -0
- package/dist/app/mixins/split-view.js +319 -0
- package/dist/app/mixins/status-strip-keys.d.ts +17 -0
- package/dist/app/mixins/status-strip-keys.js +79 -0
- package/dist/app/mixins/submit-on-change.d.ts +16 -0
- package/dist/app/mixins/submit-on-change.js +28 -0
- package/dist/app/mixins/table-selection.d.ts +39 -0
- package/dist/app/mixins/table-selection.js +272 -0
- package/dist/app/mixins/toast-queue.d.ts +36 -0
- package/dist/app/mixins/toast-queue.js +77 -0
- package/dist/app/mixins/toast-stack.d.ts +20 -0
- package/dist/app/mixins/toast-stack.js +55 -0
- package/dist/app/optimistic-toggle.d.ts +48 -0
- package/dist/app/optimistic-toggle.js +38 -0
- package/dist/app/page-header.d.ts +71 -0
- package/dist/app/page-header.js +249 -0
- package/dist/app/range-picker.d.ts +102 -0
- package/dist/app/range-picker.js +118 -0
- package/dist/app/save-bar.d.ts +54 -0
- package/dist/app/save-bar.js +64 -0
- package/dist/app/save-status.d.ts +50 -0
- package/dist/app/save-status.js +54 -0
- package/dist/app/selection-bar.d.ts +101 -0
- package/dist/app/selection-bar.js +157 -0
- package/dist/app/settings-layout.d.ts +70 -0
- package/dist/app/settings-layout.js +112 -0
- package/dist/app/settings-section.d.ts +140 -0
- package/dist/app/settings-section.js +182 -0
- package/dist/app/skeleton.d.ts +47 -4
- package/dist/app/skeleton.js +149 -2
- package/dist/app/sparkline.d.ts +61 -0
- package/dist/app/sparkline.js +145 -0
- package/dist/app/split-view.d.ts +154 -0
- package/dist/app/split-view.js +272 -0
- package/dist/app/stat-card.d.ts +109 -0
- package/dist/app/stat-card.js +379 -0
- package/dist/app/status-strip.d.ts +70 -0
- package/dist/app/status-strip.js +155 -0
- package/dist/app/styles/action-row.d.ts +41 -0
- package/dist/app/styles/action-row.js +59 -0
- package/dist/app/styles/stat-delta.d.ts +29 -0
- package/dist/app/styles/stat-delta.js +36 -0
- package/dist/app/styles/toast-stack.d.ts +21 -0
- package/dist/app/styles/toast-stack.js +54 -0
- package/dist/app/table.d.ts +199 -24
- package/dist/app/table.js +640 -36
- package/dist/app/toast.d.ts +105 -5
- package/dist/app/toast.js +89 -17
- package/dist/app/toasts.d.ts +49 -0
- package/dist/app/toasts.js +103 -0
- package/dist/app/utils/app-shell-cookie.d.ts +21 -0
- package/dist/app/utils/app-shell-cookie.js +33 -0
- package/dist/app/utils/chart-marker-indices.d.ts +9 -5
- package/dist/app/utils/chart-marker-indices.js +9 -8
- package/dist/app/utils/chart-path.d.ts +14 -10
- package/dist/app/utils/chart-path.js +46 -18
- package/dist/app/utils/edited-time.d.ts +19 -0
- package/dist/app/utils/edited-time.js +35 -0
- package/dist/app/utils/key-target.d.ts +23 -0
- package/dist/app/utils/key-target.js +48 -0
- package/dist/app/utils/search-params.d.ts +69 -0
- package/dist/app/utils/search-params.js +132 -0
- package/dist/app/utils/shortcut-groups.d.ts +21 -0
- package/dist/app/utils/shortcut-groups.js +53 -0
- package/dist/app/utils/split-view-layout.d.ts +48 -0
- package/dist/app/utils/split-view-layout.js +71 -0
- package/dist/app/view-options.d.ts +99 -0
- package/dist/app/view-options.js +182 -0
- package/dist/components/banner.d.ts +61 -0
- package/dist/components/banner.js +101 -0
- package/dist/components/confirm.d.ts +54 -5
- package/dist/components/confirm.js +44 -5
- package/dist/components/group.d.ts +14 -0
- package/dist/components/group.js +66 -11
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +5 -0
- package/dist/components/input.js +9 -3
- package/dist/components/link-button.js +8 -2
- package/dist/components/property-list.d.ts +76 -0
- package/dist/components/property-list.js +175 -0
- package/dist/components/relative-time.d.ts +72 -0
- package/dist/components/relative-time.js +45 -0
- package/dist/components/status-dot.d.ts +62 -0
- package/dist/components/status-dot.js +99 -0
- package/dist/components/text-field.d.ts +17 -2
- package/dist/components/text-field.js +13 -4
- package/dist/components/timeline.d.ts +67 -0
- package/dist/components/timeline.js +159 -0
- package/dist/components/typeset.d.ts +2 -1
- package/dist/components/typeset.js +4 -1
- package/dist/docs/code-tabs-sync.d.ts +1 -1
- package/dist/docs/code-tabs-sync.js +2 -2
- package/dist/docs/copy-button.d.ts +1 -1
- package/dist/docs/copy-button.js +2 -2
- package/dist/docs/docs-feedback.d.ts +12 -0
- package/dist/docs/docs-feedback.js +4 -2
- package/dist/docs/docs-hub.js +4 -4
- package/dist/docs/docs-layout.d.ts +1 -1
- package/dist/docs/docs-layout.js +1 -1
- package/dist/docs/docs-nav-tools.d.ts +1 -1
- package/dist/docs/docs-nav-tools.js +2 -2
- package/dist/docs/docs-nav.d.ts +6 -2
- package/dist/docs/docs-nav.js +2 -2
- package/dist/docs/docs-pager.d.ts +5 -1
- package/dist/docs/docs-pager.js +7 -6
- package/dist/docs/mixins/docs-nav-tools.d.ts +2 -2
- package/dist/docs/mixins/docs-nav-tools.js +32 -5
- package/dist/docs/next-steps.js +3 -2
- package/dist/docs/page-actions.d.ts +1 -1
- package/dist/docs/page-actions.js +2 -2
- package/dist/docs/table-of-contents.d.ts +1 -1
- package/dist/docs/table-of-contents.js +2 -2
- package/dist/mixins/confirm-phrase.d.ts +19 -0
- package/dist/mixins/confirm-phrase.js +56 -0
- package/dist/mixins/index.d.ts +2 -0
- package/dist/mixins/index.js +2 -0
- package/dist/mixins/viewer-time.d.ts +20 -0
- package/dist/mixins/viewer-time.js +40 -0
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.js +1 -0
- package/dist/styles/segmented-control.d.ts +49 -0
- package/dist/styles/segmented-control.js +71 -0
- package/dist/test/table.d.ts +65 -0
- package/dist/test/table.js +108 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/relative-time.d.ts +44 -0
- package/dist/utils/relative-time.js +69 -0
- package/package.json +6 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/component/jsx-runtime";
|
|
2
|
+
import { mergeMix } from "@sdxc/u/general";
|
|
3
|
+
import { tabularNums } from "@sdxc/u/typography";
|
|
4
|
+
import { clientEntry } from "remix/component";
|
|
5
|
+
import { viewerTime } from "../mixins/viewer-time.js";
|
|
6
|
+
import { formatRelativeTime } from "../utils/relative-time.js";
|
|
7
|
+
export { formatRelativeTime } from "../utils/relative-time.js";
|
|
8
|
+
/**
|
|
9
|
+
* Renders the moment as `<time datetime>` with its text and absolute title. With `local` it
|
|
10
|
+
* hands the same props to {@link RelativeTimeLocal}, so the server HTML is identical and the
|
|
11
|
+
* viewer's zone replaces the server's once the island hydrates.
|
|
12
|
+
*
|
|
13
|
+
* @param handle Runtime handle carrying the `<time>`'s props.
|
|
14
|
+
* @returns The render function producing the element.
|
|
15
|
+
* @example <RelativeTime date={check.at} now={ctx.requestTime} locale={locale} />
|
|
16
|
+
* @example <RelativeTime date={deploy.createdAt} now={now} locale={locale} local />
|
|
17
|
+
*/
|
|
18
|
+
export function RelativeTime(handle) {
|
|
19
|
+
return () => {
|
|
20
|
+
let { date, now, locale, timeZone, local, mix, ...rest } = handle.props;
|
|
21
|
+
if (local) {
|
|
22
|
+
return (_jsx(RelativeTimeLocal, { date: serializable(date), now: now === undefined ? undefined : serializable(now), locale: locale, timeZone: timeZone, "aria-label": rest["aria-label"], id: rest.id }));
|
|
23
|
+
}
|
|
24
|
+
let formatted = formatRelativeTime(date, { now, locale, timeZone });
|
|
25
|
+
return (_jsx("time", { title: formatted.title || undefined, ...rest, dateTime: formatted.dateTime || undefined, "data-slot": "relative-time", mix: mergeMix(tabularNums(), mix), children: formatted.text }));
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/** Turns a `Date` into its ISO string so an island prop survives serialization. */
|
|
29
|
+
function serializable(value) {
|
|
30
|
+
return value instanceof Date ? value.toISOString() : value;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Client island behind {@link RelativeTime}'s `local` prop: the same `<time>` the server renders,
|
|
34
|
+
* rewritten in the viewer's zone on hydration, still counting from `now` when one is given.
|
|
35
|
+
* Until the island loads the server's text stands, so the moment is always readable.
|
|
36
|
+
*
|
|
37
|
+
* @example <RelativeTimeLocal date="2026-10-30T14:00:00Z" locale="en" />
|
|
38
|
+
*/
|
|
39
|
+
export const RelativeTimeLocal = clientEntry("@sdxc/ui/relative-time#RelativeTimeLocal", function RelativeTimeLocal(handle) {
|
|
40
|
+
return () => {
|
|
41
|
+
let { date, now, locale, timeZone, ...rest } = handle.props;
|
|
42
|
+
let formatted = formatRelativeTime(date, { now, locale, timeZone });
|
|
43
|
+
return (_jsx("time", { ...rest, title: formatted.title || undefined, dateTime: formatted.dateTime || undefined, "data-slot": "relative-time", mix: [tabularNums(), viewerTime(locale, now)], children: formatted.text }));
|
|
44
|
+
};
|
|
45
|
+
});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small coloured dot that names a record's state beside its label, plus a dot cluster that
|
|
3
|
+
* summarises a set of states as `n/N`. The tone comes from a semantic role, and only an
|
|
4
|
+
* in-progress state pulses, so a list polled every few seconds stays still between changes.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
import type { SemanticColor } from "../utils/semantic-color.js";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link StatusDot} and its compound parts.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace StatusDot {
|
|
15
|
+
/**
|
|
16
|
+
* The role a state reads in: up or ok is `success`, degraded or pending is `warning`, down
|
|
17
|
+
* or failed is `danger`, paused or unknown is `neutral`, in progress is `brand`.
|
|
18
|
+
*/
|
|
19
|
+
type Color = SemanticColor;
|
|
20
|
+
/**
|
|
21
|
+
* Every native `<span>` attribute plus the dot's tone. Children are the visible label; a dot
|
|
22
|
+
* without one needs `aria-label` naming the state.
|
|
23
|
+
*/
|
|
24
|
+
interface Props extends TagProps<"span"> {
|
|
25
|
+
/** Semantic role of the state. Defaults to {@link DEFAULT_COLOR}. */
|
|
26
|
+
color?: Color;
|
|
27
|
+
/**
|
|
28
|
+
* Marks a state still in progress (queued, deploying, checking): the dot pulses until the
|
|
29
|
+
* state settles, and holds still for visitors who prefer reduced motion.
|
|
30
|
+
*/
|
|
31
|
+
pulse?: boolean;
|
|
32
|
+
/** The state's name, such as "Up" or "Deploying". */
|
|
33
|
+
children?: RemixNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Every native `<span>` attribute plus the states to draw and the count they summarise.
|
|
37
|
+
*/
|
|
38
|
+
interface SummaryProps extends TagProps<"span"> {
|
|
39
|
+
/** One dot per chosen state, drawn overlapping in this order; an empty list shows `n/N` alone. */
|
|
40
|
+
colors?: Color[];
|
|
41
|
+
/** How many states are chosen, the `n` of `n/N`. */
|
|
42
|
+
count: number;
|
|
43
|
+
/** How many states exist, the `N` of `n/N`. */
|
|
44
|
+
total: number;
|
|
45
|
+
/** What the summary announces in full, such as "4 of 5 statuses shown". */
|
|
46
|
+
label: string;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Renders a dot and its label. With a label the dot is `aria-hidden`, since the text already
|
|
51
|
+
* names the state; without one the host becomes `role="img"` and its `aria-label` is the name.
|
|
52
|
+
*
|
|
53
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
54
|
+
* @returns The render function producing the dot's markup.
|
|
55
|
+
* @example <StatusDot color="success">{t("monitor.up")}</StatusDot>
|
|
56
|
+
* @example <StatusDot color="brand" pulse>{t("deploy.building")}</StatusDot>
|
|
57
|
+
* @example <StatusDot color="danger" aria-label={t("monitor.down")} />
|
|
58
|
+
*/
|
|
59
|
+
export declare function StatusDot(handle: Handle<StatusDot.Props>): () => import("remix/component").RemixElement;
|
|
60
|
+
export declare namespace StatusDot {
|
|
61
|
+
var Summary: (handle: Handle<StatusDot.SummaryProps>) => () => import("remix/component").RemixElement;
|
|
62
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { visuallyHidden } from "@sdxc/u/a11y";
|
|
3
|
+
import { animationHost, keyframes } from "@sdxc/u/animation";
|
|
4
|
+
import { bg, fg } from "@sdxc/u/color";
|
|
5
|
+
import { rounded } from "@sdxc/u/effects";
|
|
6
|
+
import { mergeMix, raw } from "@sdxc/u/general";
|
|
7
|
+
import { inlineFlex, items, relative, shrink } from "@sdxc/u/layout";
|
|
8
|
+
import { motionSafe } from "@sdxc/u/responsive";
|
|
9
|
+
import { bs, is } from "@sdxc/u/size";
|
|
10
|
+
import { when } from "@sdxc/u/state";
|
|
11
|
+
import { fontSize, nowrap, tabularNums } from "@sdxc/u/typography";
|
|
12
|
+
/** Semantic role a dot takes when `color` is omitted: a state the page cannot name yet. */
|
|
13
|
+
const DEFAULT_COLOR = "neutral";
|
|
14
|
+
/** Dot diameter, overridable through `--ui-status-dot-size`. */
|
|
15
|
+
const DOT_SIZE = "var(--ui-status-dot-size, 0.5rem)";
|
|
16
|
+
/**
|
|
17
|
+
* Renders a dot and its label. With a label the dot is `aria-hidden`, since the text already
|
|
18
|
+
* names the state; without one the host becomes `role="img"` and its `aria-label` is the name.
|
|
19
|
+
*
|
|
20
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
21
|
+
* @returns The render function producing the dot's markup.
|
|
22
|
+
* @example <StatusDot color="success">{t("monitor.up")}</StatusDot>
|
|
23
|
+
* @example <StatusDot color="brand" pulse>{t("deploy.building")}</StatusDot>
|
|
24
|
+
* @example <StatusDot color="danger" aria-label={t("monitor.down")} />
|
|
25
|
+
*/
|
|
26
|
+
export function StatusDot(handle) {
|
|
27
|
+
return () => {
|
|
28
|
+
let { color, pulse, children, mix, ...rest } = handle.props;
|
|
29
|
+
let labelled = children !== undefined && children !== null && children !== false;
|
|
30
|
+
return (_jsxs("span", { role: labelled ? undefined : "img", ...rest, "data-slot": "status-dot", "data-color": color ?? DEFAULT_COLOR, "data-pulse": pulse ? "" : undefined, mix: mergeMix([inlineFlex(), items("center"), raw({ gap: "0.5em" }), fontSize("sm"), nowrap()], mix), children: [_jsx(Dot, { pulse: pulse }), labelled ? _jsx("span", { "data-slot": "status-dot-label", children: children }) : null] }));
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Draws one `aria-hidden` circle coloured by the nearest `data-color`, its own or its host's.
|
|
35
|
+
* The pulse is a ring that grows and fades from the dot, so the dot itself keeps its colour
|
|
36
|
+
* steady for anyone reading it.
|
|
37
|
+
*
|
|
38
|
+
* @param handle Runtime handle carrying the dot's tone and motion.
|
|
39
|
+
* @returns The render function producing the circle.
|
|
40
|
+
*/
|
|
41
|
+
function Dot(handle) {
|
|
42
|
+
return () => {
|
|
43
|
+
let { pulse, overlap, color } = handle.props;
|
|
44
|
+
return (_jsx("span", { "aria-hidden": "true", "data-slot": "status-dot-dot", "data-color": color, mix: [
|
|
45
|
+
relative(),
|
|
46
|
+
shrink(0),
|
|
47
|
+
is(DOT_SIZE),
|
|
48
|
+
bs(DOT_SIZE),
|
|
49
|
+
rounded("full"),
|
|
50
|
+
bg("neutral.strong"),
|
|
51
|
+
when(':is([data-color="success"] > &, &[data-color="success"])', bg("success.solid")),
|
|
52
|
+
when(':is([data-color="warning"] > &, &[data-color="warning"])', bg("warning.solid")),
|
|
53
|
+
when(':is([data-color="danger"] > &, &[data-color="danger"])', bg("danger.solid")),
|
|
54
|
+
when(':is([data-color="brand"] > &, &[data-color="brand"])', bg("brand.solid")),
|
|
55
|
+
overlap
|
|
56
|
+
? raw({
|
|
57
|
+
boxShadow: "0 0 0 2px var(--ui-bg, Canvas)",
|
|
58
|
+
"&:not(:first-child)": { marginInlineStart: "-0.1875rem" },
|
|
59
|
+
})
|
|
60
|
+
: undefined,
|
|
61
|
+
pulse
|
|
62
|
+
? [
|
|
63
|
+
keyframes("ui-status-dot-pulse", {
|
|
64
|
+
from: { opacity: 0.6, transform: "scale(1)" },
|
|
65
|
+
to: { opacity: 0, transform: "scale(2.5)" },
|
|
66
|
+
}),
|
|
67
|
+
when("&::after", raw({
|
|
68
|
+
content: '""',
|
|
69
|
+
position: "absolute",
|
|
70
|
+
inset: 0,
|
|
71
|
+
borderRadius: "inherit",
|
|
72
|
+
backgroundColor: "inherit",
|
|
73
|
+
opacity: 0,
|
|
74
|
+
})),
|
|
75
|
+
motionSafe(when("&::after", animationHost("ui-status-dot-pulse", {
|
|
76
|
+
duration: "1.6s",
|
|
77
|
+
easing: "cubic-bezier(0, 0, 0.2, 1)",
|
|
78
|
+
iterationCount: "infinite",
|
|
79
|
+
}))),
|
|
80
|
+
]
|
|
81
|
+
: undefined,
|
|
82
|
+
] }));
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Renders a compact summary of several states, overlapping dots followed by `n/N`, for a
|
|
87
|
+
* filter trigger that shows which statuses are on. The figures are visual; `label` is what
|
|
88
|
+
* assistive technology reads.
|
|
89
|
+
*
|
|
90
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
91
|
+
* @returns The render function producing the summary's markup.
|
|
92
|
+
* @example <StatusDot.Summary colors={["success", "warning"]} count={2} total={5} label={t("filters.statusCount", { count: 2, total: 5 })} />
|
|
93
|
+
*/
|
|
94
|
+
StatusDot.Summary = function StatusDotSummary(handle) {
|
|
95
|
+
return () => {
|
|
96
|
+
let { colors, count, total, label, mix, ...rest } = handle.props;
|
|
97
|
+
return (_jsxs("span", { ...rest, "data-slot": "status-dot-summary", mix: mergeMix([inlineFlex(), items("center"), raw({ gap: "0.375em" }), fontSize("sm"), nowrap()], mix), children: [_jsx("span", { "aria-hidden": "true", mix: [inlineFlex(), items("center")], children: (colors ?? []).map((color, index) => (_jsx(Dot, { color: color, overlap: true }, index))) }), _jsxs("span", { "aria-hidden": "true", mix: [tabularNums(), fg("neutral.muted")], children: [count, "/", total] }), _jsx("span", { mix: [visuallyHidden()], children: label })] }));
|
|
98
|
+
};
|
|
99
|
+
};
|
|
@@ -31,13 +31,18 @@ export declare namespace TextField {
|
|
|
31
31
|
* Per-part styling for the elements this convenience wrapper composes in
|
|
32
32
|
* one call, layered after each part's own built-in styling.
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
interface PartsProps extends FieldPartsProps {
|
|
35
|
+
/** Styling for the row joining the control to its addons, rendered only with a `prefix` or `suffix`. */
|
|
36
|
+
group?: TagProps<"div">["mix"];
|
|
37
|
+
prefix?: TagProps<"label">["mix"];
|
|
38
|
+
suffix?: TagProps<"label">["mix"];
|
|
39
|
+
}
|
|
35
40
|
/**
|
|
36
41
|
* Props accepted by {@link TextField}. `mix` styles the root element
|
|
37
42
|
* grouping the field's parts; style the composed label, control,
|
|
38
43
|
* description, and error individually through `parts` instead.
|
|
39
44
|
*/
|
|
40
|
-
interface Props extends Omit<TagProps<"div">, "children"> {
|
|
45
|
+
interface Props extends Omit<TagProps<"div">, "children" | "prefix"> {
|
|
41
46
|
/** Semantic color role for the control's focus ring. Defaults to `"neutral"` when omitted. */
|
|
42
47
|
color?: Color;
|
|
43
48
|
/**
|
|
@@ -52,6 +57,14 @@ export declare namespace TextField {
|
|
|
52
57
|
* render no description.
|
|
53
58
|
*/
|
|
54
59
|
description?: RemixNode;
|
|
60
|
+
/**
|
|
61
|
+
* Static text joined to the control's leading edge as one field — a currency, a
|
|
62
|
+
* domain. It describes the control through `aria-describedby`, stays out of its
|
|
63
|
+
* name, and focuses the control when clicked.
|
|
64
|
+
*/
|
|
65
|
+
prefix?: RemixNode;
|
|
66
|
+
/** Static text joined to the control's trailing edge as one field — a unit, a domain suffix. */
|
|
67
|
+
suffix?: RemixNode;
|
|
55
68
|
/**
|
|
56
69
|
* Validation message rendered through {@link FieldError} beneath the
|
|
57
70
|
* control, marking `aria-invalid` unless set explicitly. Falls back to
|
|
@@ -109,6 +122,8 @@ export declare namespace TextField {
|
|
|
109
122
|
* description={t("form.password.hint")}
|
|
110
123
|
* />
|
|
111
124
|
* @example
|
|
125
|
+
* <TextField label={t("settings.slug.label")} name="slug" prefix="pulse.dev/" />
|
|
126
|
+
* @example
|
|
112
127
|
* <TextField
|
|
113
128
|
* label={t("form.username.label")}
|
|
114
129
|
* name="username"
|
|
@@ -5,6 +5,7 @@ import { resolveFieldWiring } from "../utils/resolve-field-wiring.js";
|
|
|
5
5
|
import { Description } from "./description.js";
|
|
6
6
|
import { FieldError } from "./field-error.js";
|
|
7
7
|
import { resolveFieldIssue } from "./form.js";
|
|
8
|
+
import { Group } from "./group.js";
|
|
8
9
|
import { Input } from "./input.js";
|
|
9
10
|
import { Label } from "./label.js";
|
|
10
11
|
/** Native `<input>` `type` {@link TextField} falls back to when `type` is omitted. */
|
|
@@ -26,6 +27,8 @@ const DEFAULT_TYPE = "text";
|
|
|
26
27
|
* description={t("form.password.hint")}
|
|
27
28
|
* />
|
|
28
29
|
* @example
|
|
30
|
+
* <TextField label={t("settings.slug.label")} name="slug" prefix="pulse.dev/" />
|
|
31
|
+
* @example
|
|
29
32
|
* <TextField
|
|
30
33
|
* label={t("form.username.label")}
|
|
31
34
|
* name="username"
|
|
@@ -35,7 +38,7 @@ const DEFAULT_TYPE = "text";
|
|
|
35
38
|
*/
|
|
36
39
|
export function TextField(handle) {
|
|
37
40
|
return () => {
|
|
38
|
-
let { color, label, description, errorMessage: errorMessageProp, autoFocus, type, name, value, defaultValue, placeholder, required, disabled, readOnly, autoComplete, pattern, minLength, maxLength, "aria-invalid": ariaInvalidProp, parts, mix, ...rest } = handle.props;
|
|
41
|
+
let { color, label, description, prefix, suffix, errorMessage: errorMessageProp, autoFocus, type, name, value, defaultValue, placeholder, required, disabled, readOnly, autoComplete, pattern, minLength, maxLength, "aria-invalid": ariaInvalidProp, parts, mix, ...rest } = handle.props;
|
|
39
42
|
let resolvedType = type ?? DEFAULT_TYPE;
|
|
40
43
|
let { errorMessage, isFirstInvalid } = resolveFieldIssue(handle, name, errorMessageProp);
|
|
41
44
|
let resolvedAutoFocus = autoFocus ?? (isFirstInvalid || undefined);
|
|
@@ -45,8 +48,14 @@ export function TextField(handle) {
|
|
|
45
48
|
description,
|
|
46
49
|
ariaInvalid: ariaInvalidProp,
|
|
47
50
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
let hasAddon = Boolean(prefix || suffix);
|
|
52
|
+
let labelId = hasAddon ? `${handle.id}-label` : undefined;
|
|
53
|
+
let prefixId = prefix ? `${handle.id}-prefix` : undefined;
|
|
54
|
+
let suffixId = suffix ? `${handle.id}-suffix` : undefined;
|
|
55
|
+
let controlDescribedBy = [prefixId, suffixId, describedBy].filter(Boolean).join(" ") || undefined;
|
|
56
|
+
let control = (_jsx(Input, { id: handle.id, type: resolvedType, name: name, value: value, defaultValue: defaultValue, placeholder: placeholder, required: required, disabled: disabled, readOnly: readOnly, autoComplete: autoComplete, pattern: pattern, minLength: minLength, maxLength: maxLength,
|
|
57
|
+
// oxlint-disable-next-line jsx-a11y/no-autofocus -- Not a focus grab on page load: this only ever resolves true for the first field an enclosing Form reports as invalid, so a failed submit lands the user on the problem instead of leaving them to hunt for it.
|
|
58
|
+
autoFocus: resolvedAutoFocus, "aria-invalid": resolvedInvalid, "aria-labelledby": labelId, "aria-describedby": controlDescribedBy, color: resolvedColor, mix: parts?.input }));
|
|
59
|
+
return (_jsxs("div", { ...rest, "data-slot": "text-field", mix: mergeMix(fieldStackLayout(), mix), children: [_jsx(Label, { id: labelId, htmlFor: handle.id, mix: parts?.label, children: label }), hasAddon ? (_jsxs(Group, { role: "presentation", mix: parts?.group, children: [prefix ? (_jsx(Group.Text, { id: prefixId, htmlFor: handle.id, mix: parts?.prefix, children: prefix })) : null, control, suffix ? (_jsx(Group.Text, { id: suffixId, htmlFor: handle.id, mix: parts?.suffix, children: suffix })) : null] })) : (control), description ? (_jsx(Description, { id: descriptionId, mix: parts?.description, children: description })) : null, errorMessage ? (_jsx(FieldError, { id: errorId, mix: parts?.error, children: errorMessage })) : null] }));
|
|
51
60
|
};
|
|
52
61
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A record's activity as an ordered list: a 2px rail threading 16px event icons toned by
|
|
3
|
+
* what happened, one line per event (avatar, bold actor, muted verb, time), an optional
|
|
4
|
+
* comment card, and a native `<details>` folding a run of quiet events into "N more".
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
/**
|
|
11
|
+
* Prop types for {@link Timeline} and its compound parts.
|
|
12
|
+
*/
|
|
13
|
+
export declare namespace Timeline {
|
|
14
|
+
/** The semantic role an event's icon is drawn in. */
|
|
15
|
+
type Tone = "neutral" | "brand" | "success" | "warning" | "danger";
|
|
16
|
+
/** Every native `<ol>` attribute. */
|
|
17
|
+
interface Props extends TagProps<"ol"> {
|
|
18
|
+
}
|
|
19
|
+
/** Every native `<li>` attribute, plus the event's parts. */
|
|
20
|
+
interface EventProps extends Omit<TagProps<"li">, "children"> {
|
|
21
|
+
/** A 16px glyph naming the kind of event, decorative beside the line's words. */
|
|
22
|
+
icon: RemixNode;
|
|
23
|
+
/** @default {@link DEFAULT_TONE} */
|
|
24
|
+
tone?: Tone;
|
|
25
|
+
/** A small avatar of the actor, shown before the name. */
|
|
26
|
+
avatar?: RemixNode;
|
|
27
|
+
/** Who did it, set in bold. */
|
|
28
|
+
actor?: RemixNode;
|
|
29
|
+
/** When it happened: a `RelativeTime` or plain text. */
|
|
30
|
+
time?: RemixNode;
|
|
31
|
+
/** A comment or other body, set as a card under the line. */
|
|
32
|
+
body?: RemixNode;
|
|
33
|
+
/** What happened, in muted text after the actor: "resolved the incident". */
|
|
34
|
+
children?: RemixNode;
|
|
35
|
+
}
|
|
36
|
+
/** Every native `<li>` attribute, plus the folded events. */
|
|
37
|
+
interface MoreProps extends Omit<TagProps<"li">, "children"> {
|
|
38
|
+
/** The disclosure's label, such as "4 more events". */
|
|
39
|
+
summary: RemixNode;
|
|
40
|
+
/** Starts unfolded. */
|
|
41
|
+
open?: boolean;
|
|
42
|
+
/** The folded {@link Timeline.Event} items. */
|
|
43
|
+
children: RemixNode;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Renders the `<ol>` and its rail. The rail is drawn once, behind every icon from the
|
|
48
|
+
* first to the last, so a folded run keeps the line continuous when it opens; icons sit on
|
|
49
|
+
* the page's background, `--ui-timeline-surface`, which masks the rail where they meet it.
|
|
50
|
+
*
|
|
51
|
+
* @param handle Runtime handle carrying the `<ol>`'s props.
|
|
52
|
+
* @returns The render function producing the list's markup.
|
|
53
|
+
* @example
|
|
54
|
+
* <Timeline>
|
|
55
|
+
* <Timeline.Event icon={<CircleDotIcon />} tone="danger" actor="Uptime" time={<RelativeTime date={opened} />}>
|
|
56
|
+
* opened the incident
|
|
57
|
+
* </Timeline.Event>
|
|
58
|
+
* <Timeline.Event icon={<MessageSquareIcon />} avatar={<Avatar size="xs" />} actor="Ana" body={<p>Rolling back.</p>}>
|
|
59
|
+
* commented
|
|
60
|
+
* </Timeline.Event>
|
|
61
|
+
* </Timeline>
|
|
62
|
+
*/
|
|
63
|
+
export declare function Timeline(handle: Handle<Timeline.Props>): () => import("remix/component").RemixElement;
|
|
64
|
+
export declare namespace Timeline {
|
|
65
|
+
var Event: (handle: Handle<Timeline.EventProps>) => () => import("remix/component").RemixElement;
|
|
66
|
+
var More: (handle: Handle<Timeline.MoreProps>) => () => import("remix/component").RemixElement;
|
|
67
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/component/jsx-runtime";
|
|
2
|
+
import { EllipsisIcon } from "@sdxc/icons";
|
|
3
|
+
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
4
|
+
import { rounded } from "@sdxc/u/effects";
|
|
5
|
+
import { cursor, listStyle, pseudoContent, raw, mergeMix } from "@sdxc/u/general";
|
|
6
|
+
import { flex, gap, grid, inlineFlex, items, justify, relative, vstack } from "@sdxc/u/layout";
|
|
7
|
+
import { bs, is, m, minIs, p } from "@sdxc/u/size";
|
|
8
|
+
import { before, data, focusVisible, hover, when } from "@sdxc/u/state";
|
|
9
|
+
import { leading, text, weight } from "@sdxc/u/typography";
|
|
10
|
+
/** The side of the square each event's icon sits centred in; the rail runs through its middle. */
|
|
11
|
+
const ICON_BOX = "var(--ui-timeline-icon-box, 1.5rem)";
|
|
12
|
+
/** Tone an event's icon takes when `tone` is left unset. */
|
|
13
|
+
const DEFAULT_TONE = "neutral";
|
|
14
|
+
/**
|
|
15
|
+
* The two-column track every row shares: the icon box, then the line. Folded events use
|
|
16
|
+
* it too, so their icons stay on the one rail the list draws.
|
|
17
|
+
*/
|
|
18
|
+
function rowTrack() {
|
|
19
|
+
return [
|
|
20
|
+
grid(),
|
|
21
|
+
raw({ gridTemplateColumns: `${ICON_BOX} minmax(0, 1fr)` }),
|
|
22
|
+
gap(3),
|
|
23
|
+
raw({ rowGap: "0.5rem" }),
|
|
24
|
+
items("start"),
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Renders the `<ol>` and its rail. The rail is drawn once, behind every icon from the
|
|
29
|
+
* first to the last, so a folded run keeps the line continuous when it opens; icons sit on
|
|
30
|
+
* the page's background, `--ui-timeline-surface`, which masks the rail where they meet it.
|
|
31
|
+
*
|
|
32
|
+
* @param handle Runtime handle carrying the `<ol>`'s props.
|
|
33
|
+
* @returns The render function producing the list's markup.
|
|
34
|
+
* @example
|
|
35
|
+
* <Timeline>
|
|
36
|
+
* <Timeline.Event icon={<CircleDotIcon />} tone="danger" actor="Uptime" time={<RelativeTime date={opened} />}>
|
|
37
|
+
* opened the incident
|
|
38
|
+
* </Timeline.Event>
|
|
39
|
+
* <Timeline.Event icon={<MessageSquareIcon />} avatar={<Avatar size="xs" />} actor="Ana" body={<p>Rolling back.</p>}>
|
|
40
|
+
* commented
|
|
41
|
+
* </Timeline.Event>
|
|
42
|
+
* </Timeline>
|
|
43
|
+
*/
|
|
44
|
+
export function Timeline(handle) {
|
|
45
|
+
return () => {
|
|
46
|
+
let { mix, ...rest } = handle.props;
|
|
47
|
+
return (_jsx("ol", { "data-slot": "timeline", ...rest, mix: mergeMix([
|
|
48
|
+
relative(),
|
|
49
|
+
m(0),
|
|
50
|
+
p(0),
|
|
51
|
+
listStyle("none"),
|
|
52
|
+
vstack({ gap: 3 }),
|
|
53
|
+
text("sm"),
|
|
54
|
+
before([
|
|
55
|
+
pseudoContent('""'),
|
|
56
|
+
raw({
|
|
57
|
+
position: "absolute",
|
|
58
|
+
insetBlock: `calc(${ICON_BOX} / 2)`,
|
|
59
|
+
insetInlineStart: `calc(${ICON_BOX} / 2 - 1px)`,
|
|
60
|
+
inlineSize: "2px",
|
|
61
|
+
}),
|
|
62
|
+
bg("neutral.border"),
|
|
63
|
+
]),
|
|
64
|
+
], mix) }));
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Renders one event: its toned icon on the rail, then a single wrapping line of avatar,
|
|
69
|
+
* actor, description and time, then the body card when one is given.
|
|
70
|
+
*
|
|
71
|
+
* @param handle Runtime handle carrying the `<li>`'s props.
|
|
72
|
+
* @returns The render function producing the event's markup.
|
|
73
|
+
* @example
|
|
74
|
+
* <Timeline.Event icon={<RocketIcon />} tone="brand" actor="deploy-bot" time="2m ago">
|
|
75
|
+
* deployed v4.2.1
|
|
76
|
+
* </Timeline.Event>
|
|
77
|
+
*/
|
|
78
|
+
Timeline.Event = function TimelineEvent(handle) {
|
|
79
|
+
return () => {
|
|
80
|
+
let { icon, tone, avatar, actor, time, body, children, mix, ...rest } = handle.props;
|
|
81
|
+
let resolvedTone = tone ?? DEFAULT_TONE;
|
|
82
|
+
return (_jsxs("li", { "data-slot": "timeline-event", "data-tone": resolvedTone, ...rest, mix: mergeMix(rowTrack(), mix), children: [_jsx(TimelineIcon, { tone: resolvedTone, children: icon }), _jsxs("div", { mix: [vstack({ gap: 2 }), minIs(0)], children: [_jsxs("p", { "data-slot": "timeline-line", mix: [
|
|
83
|
+
m(0),
|
|
84
|
+
flex(),
|
|
85
|
+
items("center"),
|
|
86
|
+
raw({ flexWrap: "wrap", minBlockSize: ICON_BOX }),
|
|
87
|
+
gap(1.5),
|
|
88
|
+
leading("1.25rem"),
|
|
89
|
+
], children: [avatar ? _jsx("span", { mix: [inlineFlex()], children: avatar }) : null, actor ? (_jsx("span", { "data-slot": "timeline-actor", mix: [weight("semibold")], children: actor })) : null, children ? (_jsx("span", { "data-slot": "timeline-description", mix: [fg("neutral.muted")], children: children })) : null, time ? (_jsx("span", { "data-slot": "timeline-time", mix: [fg("neutral.muted"), text("xs")], children: time })) : null] }), body ? (_jsx("div", { "data-slot": "timeline-body", mix: [
|
|
90
|
+
p(3),
|
|
91
|
+
rounded("md"),
|
|
92
|
+
border({ color: "neutral.border", width: 1 }),
|
|
93
|
+
bg("neutral.tint"),
|
|
94
|
+
raw({
|
|
95
|
+
"& > :first-child": { marginBlockStart: 0 },
|
|
96
|
+
"& > :last-child": { marginBlockEnd: 0 },
|
|
97
|
+
}),
|
|
98
|
+
], children: body })) : null] })] }));
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Renders a run of events folded behind a `<details>`: its summary sits on the rail with
|
|
103
|
+
* an ellipsis glyph, and its events open in place, in the same list and on the same rail.
|
|
104
|
+
*
|
|
105
|
+
* @param handle Runtime handle carrying the `<li>`'s props.
|
|
106
|
+
* @returns The render function producing the folded run's markup.
|
|
107
|
+
* @example
|
|
108
|
+
* <Timeline.More summary="4 more events">
|
|
109
|
+
* {checks.map((check) => <Timeline.Event icon={<CheckIcon />} actor="Uptime">{check.text}</Timeline.Event>)}
|
|
110
|
+
* </Timeline.More>
|
|
111
|
+
*/
|
|
112
|
+
Timeline.More = function TimelineMore(handle) {
|
|
113
|
+
return () => {
|
|
114
|
+
let { summary, open, children, mix, ...rest } = handle.props;
|
|
115
|
+
return (_jsx("li", { "data-slot": "timeline-more", ...rest, mix: mergeMix([], mix), children: _jsxs("details", { open: open, mix: [raw({ "&[open] > summary": { display: "none" } })], children: [_jsxs("summary", { mix: [
|
|
116
|
+
...rowTrack(),
|
|
117
|
+
listStyle("none"),
|
|
118
|
+
raw({ "&::-webkit-details-marker": { display: "none" } }),
|
|
119
|
+
cursor("pointer"),
|
|
120
|
+
rounded("md"),
|
|
121
|
+
focusVisible(outline({ color: "brand.ring", width: 2, offset: 2 })),
|
|
122
|
+
], children: [_jsx(TimelineIcon, { tone: "neutral", children: _jsx(EllipsisIcon, { size: 16, "aria-hidden": "true" }) }), _jsx("span", { mix: [
|
|
123
|
+
flex(),
|
|
124
|
+
items("center"),
|
|
125
|
+
bs(ICON_BOX),
|
|
126
|
+
fg("neutral.muted"),
|
|
127
|
+
weight("medium"),
|
|
128
|
+
hover(fg("neutral.emphasis")),
|
|
129
|
+
], children: summary })] }), _jsx("ol", { mix: [m(0), p(0), listStyle("none"), vstack({ gap: 3 })], children: children })] }) }));
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* The icon box on the rail: the glyph in its tone, on the surface colour so the rail
|
|
134
|
+
* reads as passing behind it.
|
|
135
|
+
*
|
|
136
|
+
* @param handle Runtime handle carrying the tone and glyph.
|
|
137
|
+
* @returns The render function producing the icon box.
|
|
138
|
+
*/
|
|
139
|
+
function TimelineIcon(handle) {
|
|
140
|
+
return () => {
|
|
141
|
+
let { tone, children } = handle.props;
|
|
142
|
+
return (_jsx("span", { "data-slot": "timeline-icon", "data-tone": tone, "aria-hidden": "true", mix: [
|
|
143
|
+
relative(),
|
|
144
|
+
inlineFlex(),
|
|
145
|
+
items("center"),
|
|
146
|
+
justify("center"),
|
|
147
|
+
is(ICON_BOX),
|
|
148
|
+
bs(ICON_BOX),
|
|
149
|
+
rounded("full"),
|
|
150
|
+
bg("var(--ui-timeline-surface, var(--ui-bg, Canvas))"),
|
|
151
|
+
fg("neutral.muted"),
|
|
152
|
+
data("tone", "brand", fg("brand")),
|
|
153
|
+
data("tone", "success", fg("success")),
|
|
154
|
+
data("tone", "warning", fg("warning")),
|
|
155
|
+
data("tone", "danger", fg("danger")),
|
|
156
|
+
when("& > svg", raw({ inlineSize: "1rem", blockSize: "1rem" })),
|
|
157
|
+
], children: children }));
|
|
158
|
+
};
|
|
159
|
+
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* supplying every size, weight, spacing, and color decision through three
|
|
4
4
|
* custom properties: `--ui-typeset-size`, `--ui-typeset-leading`, and
|
|
5
5
|
* `--ui-typeset-flow`. `data-preset` swaps all three for a different rhythm
|
|
6
|
-
* context; `data-not-typeset` opts a subtree out of the whole layer.
|
|
6
|
+
* context; `data-not-typeset` opts a subtree out of the whole layer. Flow spacing reaches
|
|
7
|
+
* through a `HeadingScope` wrapper and leaves a component's `data-slot` list items to it.
|
|
7
8
|
*
|
|
8
9
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
9
10
|
* @copyright Sergio Xalambrí 2026
|
|
@@ -136,7 +136,10 @@ export function Typeset(handle) {
|
|
|
136
136
|
when(prose("& > * + *"), raw({
|
|
137
137
|
marginBlockStart: "var(--ui-typeset-flow, 1.25em)",
|
|
138
138
|
})),
|
|
139
|
-
when(prose("&
|
|
139
|
+
when(prose("& > * + div[data-heading-level] > :first-child"), raw({
|
|
140
|
+
marginBlockStart: "var(--ui-typeset-flow, 1.25em)",
|
|
141
|
+
})),
|
|
142
|
+
when(prose("& :where(blockquote, li:not([data-slot])) > * + *"), raw({
|
|
140
143
|
marginBlockStart: "var(--ui-typeset-flow, 1.25em)",
|
|
141
144
|
})),
|
|
142
145
|
when(prose("& :where(h1)"), raw({
|
|
@@ -20,7 +20,7 @@ export type CodeTabsSyncProps = {
|
|
|
20
20
|
};
|
|
21
21
|
/**
|
|
22
22
|
* Renders a hidden marker carrying {@link codeTabsSync}. `CodeTabs` renders it whenever it
|
|
23
|
-
* has a `syncKey`; the island loads from the bare `@sdxc/ui/code-tabs-sync` specifier,
|
|
23
|
+
* has a `syncKey`; the island loads from the bare `@sdxc/ui/docs/code-tabs-sync` specifier,
|
|
24
24
|
* which the app's browser entry maps to a dynamic import.
|
|
25
25
|
*/
|
|
26
26
|
export declare const CodeTabsSync: EntryComponent<CodeTabsSyncProps>;
|
|
@@ -4,9 +4,9 @@ import { clientEntry } from "remix/component";
|
|
|
4
4
|
import { codeTabsSync } from "./mixins/code-tabs-sync.js";
|
|
5
5
|
/**
|
|
6
6
|
* Renders a hidden marker carrying {@link codeTabsSync}. `CodeTabs` renders it whenever it
|
|
7
|
-
* has a `syncKey`; the island loads from the bare `@sdxc/ui/code-tabs-sync` specifier,
|
|
7
|
+
* has a `syncKey`; the island loads from the bare `@sdxc/ui/docs/code-tabs-sync` specifier,
|
|
8
8
|
* which the app's browser entry maps to a dynamic import.
|
|
9
9
|
*/
|
|
10
|
-
export const CodeTabsSync = clientEntry("@sdxc/ui/code-tabs-sync#CodeTabsSync", function CodeTabsSync(handle) {
|
|
10
|
+
export const CodeTabsSync = clientEntry("@sdxc/ui/docs/code-tabs-sync#CodeTabsSync", function CodeTabsSync(handle) {
|
|
11
11
|
return () => (_jsx("span", { mix: [hidden(), codeTabsSync(handle.props.syncKey, handle.props.persist)] }));
|
|
12
12
|
});
|
|
@@ -20,7 +20,7 @@ export type CopyButtonProps = {
|
|
|
20
20
|
copiedLabel: string;
|
|
21
21
|
};
|
|
22
22
|
/**
|
|
23
|
-
* Renders the button. The island loads from the bare `@sdxc/ui/copy-button` specifier,
|
|
23
|
+
* Renders the button. The island loads from the bare `@sdxc/ui/docs/copy-button` specifier,
|
|
24
24
|
* which the app's browser entry maps to a dynamic import; until then the button is inert
|
|
25
25
|
* and the code beside it stays selectable.
|
|
26
26
|
*
|
package/dist/docs/copy-button.js
CHANGED
|
@@ -11,7 +11,7 @@ import { clientEntry } from "remix/component";
|
|
|
11
11
|
import { COPY_COMMAND, copyToClipboard } from "../mixins/copy-to-clipboard.js";
|
|
12
12
|
import { copyFeedback } from "./mixins/copy-feedback.js";
|
|
13
13
|
/**
|
|
14
|
-
* Renders the button. The island loads from the bare `@sdxc/ui/copy-button` specifier,
|
|
14
|
+
* Renders the button. The island loads from the bare `@sdxc/ui/docs/copy-button` specifier,
|
|
15
15
|
* which the app's browser entry maps to a dynamic import; until then the button is inert
|
|
16
16
|
* and the code beside it stays selectable.
|
|
17
17
|
*
|
|
@@ -19,7 +19,7 @@ import { copyFeedback } from "./mixins/copy-feedback.js";
|
|
|
19
19
|
* <pre><code id="install">npm add @sdxc/ui</code></pre>
|
|
20
20
|
* <CopyButton target="install" label={t("code.copy")} copiedLabel={t("code.copied")} />
|
|
21
21
|
*/
|
|
22
|
-
export const CopyButton = clientEntry("@sdxc/ui/copy-button#CopyButton", function CopyButton(handle) {
|
|
22
|
+
export const CopyButton = clientEntry("@sdxc/ui/docs/copy-button#CopyButton", function CopyButton(handle) {
|
|
23
23
|
return () => {
|
|
24
24
|
let { copiedLabel, label, target } = handle.props;
|
|
25
25
|
return (_jsxs("button", { type: "button", "data-slot": "copy-button", "aria-label": label, title: label, commandfor: target, command: COPY_COMMAND, mix: [
|
|
@@ -40,6 +40,16 @@ export declare namespace DocsFeedback {
|
|
|
40
40
|
labels: Labels;
|
|
41
41
|
/** @default "idle" */
|
|
42
42
|
state?: State;
|
|
43
|
+
/**
|
|
44
|
+
* The named frame the vote reloads (`data-rmx-target`), so a page that renders this
|
|
45
|
+
* block inside `<Frame name>` swaps in the thank-you without reloading the page.
|
|
46
|
+
*/
|
|
47
|
+
frame?: string;
|
|
48
|
+
/**
|
|
49
|
+
* `"manual"` keeps the reader where they are when the vote's response renders, instead
|
|
50
|
+
* of the scroll reset a navigation does by default (`data-rmx-reset-scroll`).
|
|
51
|
+
*/
|
|
52
|
+
resetScroll?: "manual" | "after-transition";
|
|
43
53
|
}
|
|
44
54
|
}
|
|
45
55
|
/**
|
|
@@ -51,5 +61,7 @@ export declare namespace DocsFeedback {
|
|
|
51
61
|
* @returns The render function producing the block's markup.
|
|
52
62
|
* @example
|
|
53
63
|
* <DocsFeedback action="/docs/feedback" page="/docs/alerts" state={sent ? "sent" : "idle"} labels={labels} />
|
|
64
|
+
* @example
|
|
65
|
+
* <DocsFeedback frame="feedback" resetScroll="manual" action="/docs/feedback" page="/docs/alerts" labels={labels} />
|
|
54
66
|
*/
|
|
55
67
|
export declare function DocsFeedback(handle: Handle<DocsFeedback.Props>): () => import("remix/component").RemixElement;
|