@sdxc/ui 2026.11.10 → 2026.11.14
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 +92 -45
- package/dist/app/app-shell-toggle.d.ts +2 -0
- package/dist/app/app-shell-toggle.js +5 -2
- package/dist/app/app-shell.d.ts +25 -1
- package/dist/app/app-shell.js +73 -38
- package/dist/app/auto-refresh.d.ts +2 -0
- package/dist/app/auto-refresh.js +3 -3
- package/dist/app/behaviors/refresh-schedule.d.ts +8 -3
- package/dist/app/behaviors/refresh-schedule.js +4 -3
- package/dist/app/board.d.ts +123 -0
- package/dist/app/board.js +224 -0
- package/dist/app/chart.d.ts +2 -2
- package/dist/app/chart.js +7 -3
- package/dist/app/check-runs.d.ts +116 -0
- package/dist/app/check-runs.js +201 -0
- package/dist/app/code-view.d.ts +172 -0
- package/dist/app/code-view.js +414 -0
- package/dist/app/command-palette.d.ts +38 -3
- package/dist/app/command-palette.js +53 -5
- package/dist/app/contribution-graph.d.ts +106 -0
- package/dist/app/contribution-graph.js +289 -0
- package/dist/app/detail-sheet.d.ts +7 -0
- package/dist/app/detail-sheet.js +7 -7
- package/dist/app/diff.d.ts +200 -0
- package/dist/app/diff.js +702 -0
- package/dist/app/filter-bar.d.ts +20 -0
- package/dist/app/filter-bar.js +35 -15
- package/dist/app/filter-menu.d.ts +144 -0
- package/dist/app/filter-menu.js +480 -0
- package/dist/app/gantt.d.ts +108 -0
- package/dist/app/gantt.js +420 -0
- package/dist/app/index.d.ts +19 -0
- package/dist/app/index.js +19 -0
- package/dist/app/log-viewer.d.ts +120 -0
- package/dist/app/log-viewer.js +384 -0
- package/dist/app/merge-box.d.ts +97 -0
- package/dist/app/merge-box.js +227 -0
- package/dist/app/mixins/app-shell-controls.d.ts +4 -1
- package/dist/app/mixins/app-shell-controls.js +64 -4
- package/dist/app/mixins/auto-refresh.d.ts +5 -2
- package/dist/app/mixins/auto-refresh.js +9 -3
- package/dist/app/mixins/close-popover-on-submit.d.ts +16 -0
- package/dist/app/mixins/close-popover-on-submit.js +32 -0
- package/dist/app/mixins/code-view-selection.d.ts +60 -0
- package/dist/app/mixins/code-view-selection.js +276 -0
- package/dist/app/mixins/command-palette.d.ts +15 -4
- package/dist/app/mixins/command-palette.js +94 -6
- package/dist/app/mixins/contribution-graph-keys.d.ts +19 -0
- package/dist/app/mixins/contribution-graph-keys.js +155 -0
- package/dist/app/mixins/diff-interactions.d.ts +72 -0
- package/dist/app/mixins/diff-interactions.js +269 -0
- package/dist/app/mixins/filter-menu-keys.d.ts +41 -0
- package/dist/app/mixins/filter-menu-keys.js +91 -0
- package/dist/app/mixins/gantt-today.d.ts +17 -0
- package/dist/app/mixins/gantt-today.js +50 -0
- package/dist/app/mixins/log-viewer.d.ts +29 -0
- package/dist/app/mixins/log-viewer.js +333 -0
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +5 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +25 -1
- package/dist/app/mixins/save-bar-sync.d.ts +7 -1
- package/dist/app/mixins/save-bar-sync.js +23 -4
- package/dist/app/mixins/save-status-sync.js +23 -1
- package/dist/app/mixins/split-view.js +1 -1
- package/dist/app/mixins/submit-on-close.d.ts +17 -0
- package/dist/app/mixins/submit-on-close.js +52 -0
- package/dist/app/mixins/tree-filter.d.ts +44 -0
- package/dist/app/mixins/tree-filter.js +111 -0
- package/dist/app/mixins/tree-navigation.d.ts +50 -0
- package/dist/app/mixins/tree-navigation.js +216 -0
- package/dist/app/optimistic-toggle.d.ts +8 -0
- package/dist/app/optimistic-toggle.js +3 -2
- package/dist/app/page-header.d.ts +18 -3
- package/dist/app/page-header.js +105 -50
- package/dist/app/review-thread.d.ts +115 -0
- package/dist/app/review-thread.js +116 -0
- package/dist/app/save-bar.d.ts +5 -0
- package/dist/app/save-bar.js +1 -1
- package/dist/app/settings-layout.d.ts +5 -0
- package/dist/app/settings-layout.js +5 -5
- package/dist/app/skeleton.d.ts +9 -0
- package/dist/app/skeleton.js +28 -0
- package/dist/app/split-view.d.ts +4 -0
- package/dist/app/split-view.js +3 -3
- package/dist/app/styles/code-tokens.d.ts +24 -0
- package/dist/app/styles/code-tokens.js +47 -0
- package/dist/app/tab-bar.d.ts +59 -0
- package/dist/app/tab-bar.js +111 -0
- package/dist/app/tree.d.ts +111 -14
- package/dist/app/tree.js +202 -15
- package/dist/app/utils/ansi.d.ts +55 -0
- package/dist/app/utils/ansi.js +157 -0
- package/dist/app/utils/diff-rows.d.ts +82 -0
- package/dist/app/utils/diff-rows.js +209 -0
- package/dist/app/utils/fuzzy-path.d.ts +58 -0
- package/dist/app/utils/fuzzy-path.js +202 -0
- package/dist/app/utils/line-range.d.ts +48 -0
- package/dist/app/utils/line-range.js +61 -0
- package/dist/app/utils/log-lines.d.ts +107 -0
- package/dist/app/utils/log-lines.js +170 -0
- package/dist/app/utils/tree-filter.d.ts +19 -0
- package/dist/app/utils/tree-filter.js +26 -0
- package/dist/app/view-options.d.ts +2 -0
- package/dist/app/view-options.js +2 -2
- package/dist/chat/activity.d.ts +72 -0
- package/dist/chat/activity.js +184 -0
- package/dist/chat/composer-submit.d.ts +38 -0
- package/dist/chat/composer-submit.js +44 -0
- package/dist/chat/composer.d.ts +47 -0
- package/dist/chat/composer.js +100 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mixins/composer-send.d.ts +32 -0
- package/dist/chat/mixins/composer-send.js +121 -0
- package/dist/chat/mixins/reveal-stream.d.ts +68 -0
- package/dist/chat/mixins/reveal-stream.js +184 -0
- package/dist/chat/mixins/stream-target.d.ts +18 -0
- package/dist/chat/mixins/stream-target.js +38 -0
- package/dist/components/button.js +7 -1
- package/dist/components/character-count.d.ts +44 -0
- package/dist/components/character-count.js +68 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/label-chip.d.ts +42 -0
- package/dist/components/label-chip.js +86 -0
- package/dist/components/property-list.d.ts +9 -2
- package/dist/components/property-list.js +11 -6
- package/dist/components/textarea.js +6 -1
- package/dist/components/timeline.d.ts +62 -5
- package/dist/components/timeline.js +124 -5
- package/dist/docs/code-block.js +8 -31
- package/dist/docs/file-tree.js +3 -48
- package/dist/landing/case-study.d.ts +79 -0
- package/dist/landing/case-study.js +162 -0
- package/dist/landing/contributor-wall.d.ts +72 -0
- package/dist/landing/contributor-wall.js +129 -0
- package/dist/landing/countdown.d.ts +88 -0
- package/dist/landing/countdown.js +91 -0
- package/dist/landing/episode-player.d.ts +87 -0
- package/dist/landing/episode-player.js +113 -0
- package/dist/landing/faq-band.d.ts +3 -2
- package/dist/landing/faq-band.js +4 -3
- package/dist/landing/feature-band.d.ts +8 -0
- package/dist/landing/feature-band.js +9 -3
- package/dist/landing/index.d.ts +9 -0
- package/dist/landing/index.js +9 -0
- package/dist/landing/landing-header.js +15 -4
- package/dist/landing/mixins/countdown-tick.d.ts +29 -0
- package/dist/landing/mixins/countdown-tick.js +65 -0
- package/dist/landing/mixins/usage-estimate-live.d.ts +32 -0
- package/dist/landing/mixins/usage-estimate-live.js +120 -0
- package/dist/landing/phone-fan.d.ts +38 -0
- package/dist/landing/phone-fan.js +89 -0
- package/dist/landing/phone-frame.d.ts +48 -0
- package/dist/landing/phone-frame.js +41 -0
- package/dist/landing/price-list.d.ts +68 -0
- package/dist/landing/price-list.js +125 -0
- package/dist/landing/scroll-scene.d.ts +59 -0
- package/dist/landing/scroll-scene.js +70 -0
- package/dist/landing/sponsor-wall.d.ts +30 -6
- package/dist/landing/sponsor-wall.js +70 -14
- package/dist/landing/typed-terminal.d.ts +24 -6
- package/dist/landing/typed-terminal.js +22 -14
- package/dist/landing/usage-estimate.d.ts +127 -0
- package/dist/landing/usage-estimate.js +164 -0
- package/dist/landing/utils/countdown.d.ts +33 -0
- package/dist/landing/utils/countdown.js +42 -0
- package/dist/landing/utils/pause-toggle.d.ts +2 -1
- package/dist/mixins/character-count.d.ts +62 -0
- package/dist/mixins/character-count.js +139 -0
- package/dist/mixins/index.d.ts +6 -2
- package/dist/mixins/index.js +6 -2
- package/dist/mixins/invoker-fields.d.ts +18 -0
- package/dist/mixins/invoker-fields.js +60 -0
- package/dist/mixins/media-sync.d.ts +58 -0
- package/dist/mixins/media-sync.js +102 -0
- package/dist/mixins/menu-keys.d.ts +11 -0
- package/dist/mixins/menu-keys.js +79 -70
- package/dist/mixins/sortable.d.ts +96 -0
- package/dist/mixins/sortable.js +433 -0
- package/dist/utils/code-lines.d.ts +26 -0
- package/dist/utils/code-lines.js +29 -0
- package/dist/utils/file-icon.d.ts +31 -0
- package/dist/utils/file-icon.js +60 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/write-cookie.d.ts +15 -15
- package/dist/utils/write-cookie.js +10 -16
- package/dist/video/index.d.ts +11 -0
- package/dist/video/index.js +11 -0
- package/dist/video/mixins/video-player-sync.d.ts +27 -0
- package/dist/video/mixins/video-player-sync.js +413 -0
- package/dist/video/utils/timeline.d.ts +55 -0
- package/dist/video/utils/timeline.js +90 -0
- package/dist/video/video-player.d.ts +261 -0
- package/dist/video/video-player.js +927 -0
- package/package.json +6 -3
package/dist/app/filter-bar.d.ts
CHANGED
|
@@ -97,6 +97,11 @@ export declare namespace FilterBar {
|
|
|
97
97
|
id: string;
|
|
98
98
|
/** Prefetches the page behind each tab, sort, chip-remove and clear link; unset prefetches none. */
|
|
99
99
|
prefetch?: Prefetch;
|
|
100
|
+
/**
|
|
101
|
+
* The named `<Frame>` the bar's form and links load into, so applying a filter reloads only
|
|
102
|
+
* that frame while the address still moves; unset loads the whole page.
|
|
103
|
+
*/
|
|
104
|
+
target?: string;
|
|
100
105
|
/**
|
|
101
106
|
* The page's current URL, where every applied value is read from.
|
|
102
107
|
*
|
|
@@ -129,11 +134,19 @@ export declare namespace FilterBar {
|
|
|
129
134
|
locale?: string;
|
|
130
135
|
labels: Labels;
|
|
131
136
|
}
|
|
137
|
+
/** Props {@link FilterBarApply} serializes for hydration, which is why they are a `type`. */
|
|
138
|
+
type ApplyProps = {
|
|
139
|
+
/** The bar's form, which the button submits. */
|
|
140
|
+
formId: string;
|
|
141
|
+
label: string;
|
|
142
|
+
};
|
|
132
143
|
/** Props {@link FilterBarClear} serializes for hydration, which is why they are a `type`. */
|
|
133
144
|
type ClearProps = {
|
|
134
145
|
href: string;
|
|
135
146
|
label: string;
|
|
136
147
|
prefetch?: Prefetch;
|
|
148
|
+
/** The frame the link loads into. */
|
|
149
|
+
target?: string;
|
|
137
150
|
/** The key cap printed after the label. */
|
|
138
151
|
keyHint: string;
|
|
139
152
|
};
|
|
@@ -167,3 +180,10 @@ export declare function FilterBar(handle: Handle<FilterBar.Props>): () => import
|
|
|
167
180
|
* @example <FilterBarClear href={clearFiltersHref(url, ["status", "q"])} label="Clear filters" keyHint="Esc" />
|
|
168
181
|
*/
|
|
169
182
|
export declare const FilterBarClear: EntryComponent<FilterBar.ClearProps>;
|
|
183
|
+
/**
|
|
184
|
+
* Renders a facet's Apply button, submitting the bar's form. Once hydrated, the submit also
|
|
185
|
+
* closes the popover holding it, so the visitor lands on the filtered page with nothing open.
|
|
186
|
+
*
|
|
187
|
+
* @example <FilterBarApply formId="monitors-filters" label="Apply" />
|
|
188
|
+
*/
|
|
189
|
+
export declare const FilterBarApply: EntryComponent<FilterBar.ApplyProps>;
|
package/dist/app/filter-bar.js
CHANGED
|
@@ -17,6 +17,7 @@ import { Popover } from "../components/popover.js";
|
|
|
17
17
|
import { SearchField } from "../components/search-field.js";
|
|
18
18
|
import { floatingSurface, surfaceInset } from "../styles/floating-surface.js";
|
|
19
19
|
import { interactiveTransition } from "../styles/interactive-transition.js";
|
|
20
|
+
import { closePopoverOnSubmit } from "./mixins/close-popover-on-submit.js";
|
|
20
21
|
import { escapeLink } from "./mixins/escape-link.js";
|
|
21
22
|
import { carriedParams, clearFiltersHref, paramValues, removeFilterHref, setParamHref, } from "./utils/search-params.js";
|
|
22
23
|
/** The URL read when `url` is unset: a page with nothing applied. */
|
|
@@ -56,7 +57,7 @@ const OPTIONS_LABEL_WIDTH = "28rem";
|
|
|
56
57
|
*/
|
|
57
58
|
export function FilterBar(handle) {
|
|
58
59
|
return () => {
|
|
59
|
-
let { id, url = DEFAULT_URL, prefetch, action, tabs, facets = [], search, sort, options, status, collapse, locale, labels, mix, ...rest } = handle.props;
|
|
60
|
+
let { id, url = DEFAULT_URL, prefetch, target, action, tabs, facets = [], search, sort, options, status, collapse, locale, labels, mix, ...rest } = handle.props;
|
|
60
61
|
let formId = `${id}-form`;
|
|
61
62
|
let facetsId = `${id}-facets`;
|
|
62
63
|
let numbers = new Intl.NumberFormat(locale);
|
|
@@ -67,7 +68,7 @@ export function FilterBar(handle) {
|
|
|
67
68
|
.filter((entry) => entry.values.length > 0);
|
|
68
69
|
let query = searchName ? (paramValues(url, searchName)[0] ?? "") : "";
|
|
69
70
|
let appliedCount = applied.length + (query ? 1 : 0);
|
|
70
|
-
return (_jsxs("div", { ...rest, "data-slot": "filter-bar", mix: mergeMix([container(CONTAINER), is("100%"), vstack({ gap: 2 }), minIs(0), text("sm")], mix), children: [_jsxs("form", { id: formId, method: "get", action: action, hidden: true, children: [carriedParams(url, filterNames).map(([name, value]) => (_jsx("input", { type: "hidden", name: name, value: value }))), _jsx("button", { type: "submit", tabIndex: -1, "aria-hidden": "true", children: labels.apply })] }), _jsxs("div", { role: "toolbar", "aria-label": labels.toolbar, "data-slot": "filter-bar-row", mix: [flex(), flexWrap(), items("center"), raw({ gap: "0.5rem 0.75rem" }), minIs(0)], children: [tabs?.length ? (_jsx(FilterTabs, { tabs: tabs, label: labels.tabs, numbers: numbers, prefetch: prefetch })) : null, search ? (_jsx(SearchField, { "aria-label": search.label, mix: [grow(), basis("14rem"), minIs("10rem"), maxIs("20rem")], children: _jsx(SearchField.Input, { id: search.id ?? `${id}-search`, name: searchName, form: formId, defaultValue: query, placeholder: search.placeholder, autocomplete: "off", mix: [bs(8)] }) })) : null, facets.length ? (_jsxs("div", { "data-slot": "filter-bar-facets", mix: [flex(), flexWrap(), items("center"), gap(1), minIs(0)], children: [collapse ? (_jsx(FacetTrigger, { popoverId: facetsId, label: labels.filters, icon: _jsx(ListFilterIcon, { size: 16 }), applied: applied.length, collapsed: true })) : null, _jsx("div", { id: facetsId, popover: collapse ? "auto" : undefined, "data-slot": "filter-bar-facet-list", mix: [
|
|
71
|
+
return (_jsxs("div", { ...rest, "data-slot": "filter-bar", mix: mergeMix([container(CONTAINER), is("100%"), vstack({ gap: 2 }), minIs(0), text("sm")], mix), children: [_jsxs("form", { id: formId, method: "get", action: action, "data-rmx-target": target, hidden: true, children: [carriedParams(url, filterNames).map(([name, value]) => (_jsx("input", { type: "hidden", name: name, value: value }))), _jsx("button", { type: "submit", tabIndex: -1, "aria-hidden": "true", children: labels.apply })] }), _jsxs("div", { role: "toolbar", "aria-label": labels.toolbar, "data-slot": "filter-bar-row", mix: [flex(), flexWrap(), items("center"), raw({ gap: "0.5rem 0.75rem" }), minIs(0)], children: [tabs?.length ? (_jsx(FilterTabs, { tabs: tabs, label: labels.tabs, numbers: numbers, prefetch: prefetch, target: target })) : null, search ? (_jsx(SearchField, { "aria-label": search.label, mix: [grow(), basis("14rem"), minIs("10rem"), maxIs("20rem")], children: _jsx(SearchField.Input, { id: search.id ?? `${id}-search`, name: searchName, form: formId, defaultValue: query, placeholder: search.placeholder, autocomplete: "off", mix: [bs(8)] }) })) : null, facets.length ? (_jsxs("div", { "data-slot": "filter-bar-facets", mix: [flex(), flexWrap(), items("center"), gap(1), minIs(0)], children: [collapse ? (_jsx(FacetTrigger, { popoverId: facetsId, label: labels.filters, icon: _jsx(ListFilterIcon, { size: 16 }), applied: applied.length, collapsed: true })) : null, _jsx("div", { id: facetsId, popover: collapse ? "auto" : undefined, "data-slot": "filter-bar-facet-list", mix: [
|
|
71
72
|
collapse ? collapsibleFacets() : [flex(), flexWrap(), items("center"), gap(1)],
|
|
72
73
|
], children: facets.map((facet) => (_jsx(FacetTrigger, { popoverId: `${id}-facet-${facet.name}`, label: facet.label, icon: facet.icon, applied: paramValues(url, facet.name).length }))) }), facets.map((facet) => (_jsx(FacetPopover, { id: `${id}-facet-${facet.name}`, formId: formId, facet: facet, selected: paramValues(url, facet.name), numbers: numbers, apply: labels.apply })))] })) : null, sort || options || status ? (_jsxs("div", { "data-slot": "filter-bar-end", mix: [flex(), items("center"), gap(3), mis("auto"), minIs(0), shrink(0)], children: [status ? (_jsx("div", { "data-slot": "filter-bar-status", mix: [
|
|
73
74
|
hidden(),
|
|
@@ -76,7 +77,7 @@ export function FilterBar(handle) {
|
|
|
76
77
|
text("xs"),
|
|
77
78
|
fg("neutral.muted"),
|
|
78
79
|
truncate(),
|
|
79
|
-
], children: status })) : null, sort || options ? (_jsx(OptionsMenu, { id: `${id}-options`, sortId: `${id}-sort`, url: url, prefetch: prefetch, sort: sort, label: labels.options, children: options })) : null] })) : null] }), appliedCount > 0 ? (_jsxs("div", { "data-slot": "filter-bar-chips", mix: [flex(), flexWrap(), items("center"), gap(2), minIs(0)], children: [applied.map(({ facet, values }) => (_jsx(FilterChip, { url: url, prefetch: prefetch, facet: facet, values: values, popoverId: `${id}-facet-${facet.name}`, labels: labels }))), query && search && searchName ? (_jsx(FilterChip, { url: url, prefetch: prefetch, facet: { name: searchName, label: search.label, options: [] }, values: [query], labels: labels })) : null, _jsx(FilterBarClear, { href: clearFiltersHref(url, filterNames), prefetch: prefetch, label: labels.clear, keyHint: labels.clearKey ?? "Esc" })] })) : null] }));
|
|
80
|
+
], children: status })) : null, sort || options ? (_jsx(OptionsMenu, { id: `${id}-options`, sortId: `${id}-sort`, url: url, prefetch: prefetch, target: target, sort: sort, label: labels.options, children: options })) : null] })) : null] }), appliedCount > 0 ? (_jsxs("div", { "data-slot": "filter-bar-chips", mix: [flex(), flexWrap(), items("center"), gap(2), minIs(0)], children: [applied.map(({ facet, values }) => (_jsx(FilterChip, { url: url, prefetch: prefetch, target: target, facet: facet, values: values, popoverId: `${id}-facet-${facet.name}`, labels: labels }))), query && search && searchName ? (_jsx(FilterChip, { url: url, prefetch: prefetch, target: target, facet: { name: searchName, label: search.label, options: [] }, values: [query], labels: labels })) : null, _jsx(FilterBarClear, { href: clearFiltersHref(url, filterNames), prefetch: prefetch, target: target, label: labels.clear, keyHint: labels.clearKey ?? "Esc" })] })) : null] }));
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
@@ -127,8 +128,8 @@ function collapsibleFacets() {
|
|
|
127
128
|
*/
|
|
128
129
|
function FilterTabs(handle) {
|
|
129
130
|
return () => {
|
|
130
|
-
let { tabs, label, numbers, prefetch } = handle.props;
|
|
131
|
-
return (_jsx("nav", { "aria-label": label, "data-slot": "filter-bar-tabs", mix: [hstack({ gap: 1 }), flexWrap(), minIs(0), maxIs("100%")], children: tabs.map((tab) => (_jsxs("a", { href: tab.href, "data-rmx-prefetch": prefetch, "aria-current": tab.current ? "page" : undefined, mix: [
|
|
131
|
+
let { tabs, label, numbers, prefetch, target } = handle.props;
|
|
132
|
+
return (_jsx("nav", { "aria-label": label, "data-slot": "filter-bar-tabs", mix: [hstack({ gap: 1 }), flexWrap(), minIs(0), maxIs("100%")], children: tabs.map((tab) => (_jsxs("a", { href: tab.href, "data-rmx-prefetch": prefetch, "data-rmx-target": target, "aria-current": tab.current ? "page" : undefined, mix: [
|
|
132
133
|
interactiveTransition(),
|
|
133
134
|
inlineFlex(),
|
|
134
135
|
items("center"),
|
|
@@ -179,6 +180,16 @@ function FacetTrigger(handle) {
|
|
|
179
180
|
nowrap(),
|
|
180
181
|
cursor("pointer"),
|
|
181
182
|
when("& > svg", [fg("neutral.muted"), shrink(0)]),
|
|
183
|
+
raw({
|
|
184
|
+
"& > svg:not([data-slot='filter-bar-chevron'])": {
|
|
185
|
+
inlineSize: "1rem",
|
|
186
|
+
blockSize: "1rem",
|
|
187
|
+
},
|
|
188
|
+
"@media (prefers-reduced-motion: no-preference)": {
|
|
189
|
+
"& > [data-slot='filter-bar-chevron']": { transition: "rotate 150ms ease" },
|
|
190
|
+
},
|
|
191
|
+
}),
|
|
192
|
+
when(`[data-slot='filter-bar']:has([id='${popoverId}']:popover-open) & > [data-slot='filter-bar-chevron']`, raw({ rotate: "180deg" })),
|
|
182
193
|
hover([bg("neutral.bg-tint-hover"), border("neutral.border"), fg("neutral.emphasis")]),
|
|
183
194
|
when("&[data-applied]", [
|
|
184
195
|
border({ width: 1, style: "solid", color: "neutral.border" }),
|
|
@@ -194,7 +205,7 @@ function FacetTrigger(handle) {
|
|
|
194
205
|
text("xs"),
|
|
195
206
|
weight(600),
|
|
196
207
|
tabularNums(),
|
|
197
|
-
], children: applied })) : null, _jsx(ChevronDownIcon, { size: 14 })] }));
|
|
208
|
+
], children: applied })) : null, _jsx(ChevronDownIcon, { size: 14, "data-slot": "filter-bar-chevron" })] }));
|
|
198
209
|
};
|
|
199
210
|
}
|
|
200
211
|
/**
|
|
@@ -215,7 +226,7 @@ function FacetPopover(handle) {
|
|
|
215
226
|
rounded("md"),
|
|
216
227
|
hover(bg("neutral.bg-tint-hover")),
|
|
217
228
|
when("& label", [is("full"), cursor("pointer")]),
|
|
218
|
-
], children: _jsxs(Checkbox, { name: facet.name, value: option.value, form: formId, defaultChecked: selected.includes(option.value), color: "brand", children: [option.icon, _jsx("span", { mix: [grow(), truncate()], children: option.label }), option.count === undefined ? null : (_jsx("span", { "data-slot": "count", mix: [mis("auto"), pis(3), fg("neutral.muted"), tabularNums()], children: numbers.format(option.count) }))] }) }))) })] }), _jsx("div", { mix: [flex(), justify("end"), pi(1), raw({ paddingBlockStart: "0.5rem" })], children: _jsx(
|
|
229
|
+
], children: _jsxs(Checkbox, { name: facet.name, value: option.value, form: formId, defaultChecked: selected.includes(option.value), color: "brand", children: [option.icon, _jsx("span", { mix: [grow(), truncate()], children: option.label }), option.count === undefined ? null : (_jsx("span", { "data-slot": "count", mix: [mis("auto"), pis(3), fg("neutral.muted"), tabularNums()], children: numbers.format(option.count) }))] }) }))) })] }), _jsx("div", { mix: [flex(), justify("end"), pi(1), raw({ paddingBlockStart: "0.5rem" })], children: _jsx(FilterBarApply, { formId: formId, label: apply }) })] }));
|
|
219
230
|
};
|
|
220
231
|
}
|
|
221
232
|
/**
|
|
@@ -228,7 +239,7 @@ function FacetPopover(handle) {
|
|
|
228
239
|
*/
|
|
229
240
|
function OptionsMenu(handle) {
|
|
230
241
|
return () => {
|
|
231
|
-
let { id, sortId, url, sort, label, prefetch, children } = handle.props;
|
|
242
|
+
let { id, sortId, url, sort, label, prefetch, target, children } = handle.props;
|
|
232
243
|
return (_jsxs(_Fragment, { children: [_jsxs(Button, { variant: "ghost", size: "sm", commandfor: id, command: "toggle-popover", "aria-label": label, "data-slot": "filter-bar-options", mix: [shrink(0), fg("neutral"), weight(400), when("& > svg", fg("neutral.muted"))], children: [_jsx(SlidersHorizontalIcon, { size: 16, "aria-hidden": "true" }), _jsx("span", { "data-slot": "label", mix: [hidden(), at(OPTIONS_LABEL_WIDTH, CONTAINER, inline())], children: label })] }), _jsxs(Popover, { id: id, placement: "bottom-end", role: "dialog", "aria-label": label, "data-slot": "filter-bar-options-menu", mix: [
|
|
233
244
|
p(3),
|
|
234
245
|
is("20rem"),
|
|
@@ -236,7 +247,7 @@ function OptionsMenu(handle) {
|
|
|
236
247
|
vstack({ gap: 3 }),
|
|
237
248
|
divide("block", "neutral.border"),
|
|
238
249
|
when("& > *:not(:last-child)", pbe(3)),
|
|
239
|
-
], children: [sort ? _jsx(SortGroup, { id: sortId, url: url, sort: sort, prefetch: prefetch }) : null, children] })] }));
|
|
250
|
+
], children: [sort ? (_jsx(SortGroup, { id: sortId, url: url, sort: sort, prefetch: prefetch, target: target })) : null, children] })] }));
|
|
240
251
|
};
|
|
241
252
|
}
|
|
242
253
|
/**
|
|
@@ -248,10 +259,10 @@ function OptionsMenu(handle) {
|
|
|
248
259
|
*/
|
|
249
260
|
function SortGroup(handle) {
|
|
250
261
|
return () => {
|
|
251
|
-
let { id, url, sort, prefetch } = handle.props;
|
|
262
|
+
let { id, url, sort, prefetch, target } = handle.props;
|
|
252
263
|
let name = sort.name ?? DEFAULT_SORT_PARAM;
|
|
253
264
|
let current = paramValues(url, name)[0] ?? sort.defaultValue;
|
|
254
|
-
return (_jsxs("div", { id: id, role: "group", "aria-label": sort.label, "data-slot": "filter-bar-sort", mix: [vstack({ gap: 0.5, align: "stretch" }), minIs(0)], children: [_jsx("span", { "aria-hidden": "true", mix: [pi(2), pb(1), text("xs"), weight(600), fg("neutral.muted")], children: sort.label }), sort.options.map((option) => (_jsxs("a", { href: setParamHref(url, name, option.value === sort.defaultValue ? null : option.value), "data-rmx-prefetch": prefetch, "aria-current": option.value === current ? "true" : undefined, mix: [
|
|
265
|
+
return (_jsxs("div", { id: id, role: "group", "aria-label": sort.label, "data-slot": "filter-bar-sort", mix: [vstack({ gap: 0.5, align: "stretch" }), minIs(0)], children: [_jsx("span", { "aria-hidden": "true", mix: [pi(2), pb(1), text("xs"), weight(600), fg("neutral.muted")], children: sort.label }), sort.options.map((option) => (_jsxs("a", { href: setParamHref(url, name, option.value === sort.defaultValue ? null : option.value), "data-rmx-prefetch": prefetch, "data-rmx-target": target, "aria-current": option.value === current ? "true" : undefined, mix: [
|
|
255
266
|
interactiveTransition(),
|
|
256
267
|
flex(),
|
|
257
268
|
items("center"),
|
|
@@ -278,7 +289,7 @@ function SortGroup(handle) {
|
|
|
278
289
|
*/
|
|
279
290
|
function FilterChip(handle) {
|
|
280
291
|
return () => {
|
|
281
|
-
let { url, facet, values, popoverId, labels, prefetch } = handle.props;
|
|
292
|
+
let { url, facet, values, popoverId, labels, prefetch, target } = handle.props;
|
|
282
293
|
let summary = values
|
|
283
294
|
.map((value) => facet.options.find((option) => option.value === value)?.label ?? value)
|
|
284
295
|
.join(", ");
|
|
@@ -309,7 +320,7 @@ function FilterChip(handle) {
|
|
|
309
320
|
cursor("pointer"),
|
|
310
321
|
hover(bg("neutral.bg-tint-hover")),
|
|
311
322
|
focusVisible(outline({ color: "brand.ring", offset: -2 })),
|
|
312
|
-
], children: _jsx("span", { mix: [truncate(), maxIs("16rem")], children: summary }) })) : (_jsx("span", { "data-slot": "values", mix: [...segment, minIs(0), fg("neutral.emphasis")], children: _jsx("span", { mix: [truncate(), maxIs("16rem")], children: summary }) })), _jsx("a", { href: removeFilterHref(url, facet.name), "data-rmx-prefetch": prefetch, "aria-label": labels.remove(facet.label, summary), "data-slot": "remove", mix: [
|
|
323
|
+
], children: _jsx("span", { mix: [truncate(), maxIs("16rem")], children: summary }) })) : (_jsx("span", { "data-slot": "values", mix: [...segment, minIs(0), fg("neutral.emphasis")], children: _jsx("span", { mix: [truncate(), maxIs("16rem")], children: summary }) })), _jsx("a", { href: removeFilterHref(url, facet.name), "data-rmx-prefetch": prefetch, "data-rmx-target": target, "aria-label": labels.remove(facet.label, summary), "data-slot": "remove", mix: [
|
|
313
324
|
...segment,
|
|
314
325
|
pi(1.5),
|
|
315
326
|
fg("neutral.muted"),
|
|
@@ -326,8 +337,8 @@ function FilterChip(handle) {
|
|
|
326
337
|
*/
|
|
327
338
|
export const FilterBarClear = clientEntry("@sdxc/ui/app/filter-bar#FilterBarClear", function FilterBarClear(handle) {
|
|
328
339
|
return () => {
|
|
329
|
-
let { href, label, keyHint, prefetch } = handle.props;
|
|
330
|
-
return (_jsxs("a", { href: href, "data-rmx-prefetch": prefetch, "data-slot": "filter-bar-clear", "aria-keyshortcuts": "Escape", mix: [
|
|
340
|
+
let { href, label, keyHint, prefetch, target } = handle.props;
|
|
341
|
+
return (_jsxs("a", { href: href, "data-rmx-prefetch": prefetch, "data-rmx-target": target, "data-slot": "filter-bar-clear", "aria-keyshortcuts": "Escape", mix: [
|
|
331
342
|
escapeLink(),
|
|
332
343
|
interactiveTransition(),
|
|
333
344
|
inlineFlex(),
|
|
@@ -344,3 +355,12 @@ export const FilterBarClear = clientEntry("@sdxc/ui/app/filter-bar#FilterBarClea
|
|
|
344
355
|
], children: [label, _jsx(Keyboard, { "aria-hidden": "true", mix: [raw({ marginInlineStart: 0 })], children: keyHint })] }));
|
|
345
356
|
};
|
|
346
357
|
});
|
|
358
|
+
/**
|
|
359
|
+
* Renders a facet's Apply button, submitting the bar's form. Once hydrated, the submit also
|
|
360
|
+
* closes the popover holding it, so the visitor lands on the filtered page with nothing open.
|
|
361
|
+
*
|
|
362
|
+
* @example <FilterBarApply formId="monitors-filters" label="Apply" />
|
|
363
|
+
*/
|
|
364
|
+
export const FilterBarApply = clientEntry("@sdxc/ui/app/filter-bar#FilterBarApply", function FilterBarApply(handle) {
|
|
365
|
+
return () => (_jsx(Button, { type: "submit", form: handle.props.formId, size: "sm", color: "brand", mix: [closePopoverOnSubmit()], children: handle.props.label }));
|
|
366
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One filterable popover list for every "pick from many" trigger: a branch or tag picker whose
|
|
3
|
+
* items are links, and label, assignee or milestone pickers whose radios or checkboxes post as
|
|
4
|
+
* a form when the popover closes. Without script the links and a Save button still work.
|
|
5
|
+
*
|
|
6
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
|
+
* @copyright Sergio Xalambrí 2026
|
|
8
|
+
*/
|
|
9
|
+
import type { EntryComponent, Handle, Props as TagProps, RemixNode } from "remix/component";
|
|
10
|
+
import { Popover } from "../components/popover.js";
|
|
11
|
+
/**
|
|
12
|
+
* Prop types for {@link FilterMenu} and its parts. Items, groups and labels are `type`s
|
|
13
|
+
* because they cross into the browser with the {@link FilterMenuList} island.
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace FilterMenu {
|
|
16
|
+
/**
|
|
17
|
+
* `"navigate"` makes every item a link (a branch picker); `"single"` and `"multiple"` make
|
|
18
|
+
* them radios or checkboxes named `name`, posted to `action` when the popover closes.
|
|
19
|
+
*/
|
|
20
|
+
type Mode = "navigate" | "single" | "multiple";
|
|
21
|
+
/** One choice. */
|
|
22
|
+
type Item = {
|
|
23
|
+
/** What the form posts for the item, and its identity in the list. */
|
|
24
|
+
value: string;
|
|
25
|
+
/** The row's text, which the filter field matches against. */
|
|
26
|
+
label: string;
|
|
27
|
+
/** Where a `navigate` item goes. */
|
|
28
|
+
href?: string;
|
|
29
|
+
/** A second, muted line under the label. */
|
|
30
|
+
description?: string;
|
|
31
|
+
/** Any CSS colour; the label is drawn as a `LabelChip` with this colour's dot. */
|
|
32
|
+
color?: string;
|
|
33
|
+
/** A short tag after the label, such as "default". */
|
|
34
|
+
badge?: string;
|
|
35
|
+
/** Checked, or the current page for a link; selected items sort first. */
|
|
36
|
+
selected?: boolean;
|
|
37
|
+
};
|
|
38
|
+
/** A titled run of items: stacked sections, or one tab each with `tabs`. */
|
|
39
|
+
type Group = {
|
|
40
|
+
/** The section heading, or the tab's name with `tabs`. */
|
|
41
|
+
label: string;
|
|
42
|
+
/** The group's choices, drawn in this order after the selected ones. */
|
|
43
|
+
items: Item[];
|
|
44
|
+
};
|
|
45
|
+
/** Every string the menu shows. */
|
|
46
|
+
type Labels = {
|
|
47
|
+
/** The popover's heading and accessible name, such as "Switch branches/tags". */
|
|
48
|
+
title?: string;
|
|
49
|
+
/** The filter field's name and placeholder, such as "Filter branches". */
|
|
50
|
+
filter: string;
|
|
51
|
+
/** Said when nothing matches the filter, such as "Nothing to show". */
|
|
52
|
+
empty: string;
|
|
53
|
+
/** The closing row past the limit, with `{count}` where the number goes. */
|
|
54
|
+
more: string;
|
|
55
|
+
/** The submit button a picker shows without script, such as "Save". */
|
|
56
|
+
save: string;
|
|
57
|
+
/** The accessible name of the tab strip, such as "Ref type". */
|
|
58
|
+
tabs?: string;
|
|
59
|
+
};
|
|
60
|
+
/** Props the {@link FilterMenuList} island receives, all plain data. */
|
|
61
|
+
type ListProps = {
|
|
62
|
+
/** Prefix for every id the list renders. */
|
|
63
|
+
id: string;
|
|
64
|
+
/** Whether rows are links, radios or checkboxes. */
|
|
65
|
+
mode: Mode;
|
|
66
|
+
/** The field name radios and checkboxes post under. */
|
|
67
|
+
name?: string;
|
|
68
|
+
/** Every choice; the island filters them in the browser. */
|
|
69
|
+
groups: Group[];
|
|
70
|
+
/** Draws one tab per group instead of stacked sections. */
|
|
71
|
+
tabs?: boolean;
|
|
72
|
+
/** How many matches the list draws before one closing "more" row. @default 100 */
|
|
73
|
+
limit?: number;
|
|
74
|
+
/** The filter the server already applied, such as the `q` a no-script filter sent. */
|
|
75
|
+
query?: string;
|
|
76
|
+
/** The id of the GET form the filter field and tabs belong to. */
|
|
77
|
+
filterForm: string;
|
|
78
|
+
/** Whether that form has an address to filter on, which shows the field without script. */
|
|
79
|
+
searchable?: boolean;
|
|
80
|
+
/** Every string the list shows. */
|
|
81
|
+
labels: Labels;
|
|
82
|
+
};
|
|
83
|
+
/** Props {@link FilterMenu.Popover} accepts: everything but the trigger. */
|
|
84
|
+
interface PopoverProps extends Omit<TagProps<"div">, "id" | "children" | "popover"> {
|
|
85
|
+
/** The popover's id, which the trigger, or any `popovertarget`, opens. */
|
|
86
|
+
id: string;
|
|
87
|
+
/** Whether rows are links, radios or checkboxes. */
|
|
88
|
+
mode: Mode;
|
|
89
|
+
/** Every choice, sent whole to the island so filtering never waits on the server. */
|
|
90
|
+
groups: Group[];
|
|
91
|
+
/** Draws the groups as tabs (Branches | Tags) instead of stacked sections. */
|
|
92
|
+
tabs?: boolean;
|
|
93
|
+
/** The field name radios and checkboxes post under; required for `single` and `multiple`. */
|
|
94
|
+
name?: string;
|
|
95
|
+
/** Where `single` and `multiple` post. Defaults to the current address. */
|
|
96
|
+
action?: string;
|
|
97
|
+
/** The named `<Frame>` the post loads into, so only that frame reloads. */
|
|
98
|
+
target?: string;
|
|
99
|
+
/** A page that filters with `?q=`, which the filter field submits to without script. */
|
|
100
|
+
filterAction?: string;
|
|
101
|
+
/** The filter already applied, as the `filterAction` page read it. */
|
|
102
|
+
query?: string;
|
|
103
|
+
/** How many matches the list draws before one closing "more" row. @default 100 */
|
|
104
|
+
limit?: number;
|
|
105
|
+
/** A closing link or action, such as "View all branches". */
|
|
106
|
+
footer?: RemixNode;
|
|
107
|
+
/** The trigger's side the popover opens on above phone widths. @default "bottom-start" */
|
|
108
|
+
placement?: Popover.Placement;
|
|
109
|
+
/** Every string the menu shows, so it reads in any language. */
|
|
110
|
+
labels: Labels;
|
|
111
|
+
}
|
|
112
|
+
/** Props {@link FilterMenu} accepts: the popover's, plus what its trigger shows. */
|
|
113
|
+
interface Props extends PopoverProps {
|
|
114
|
+
/** The trigger's content, such as a branch icon and the current branch's name. */
|
|
115
|
+
trigger: RemixNode;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Renders a trigger and its native popover: links in `navigate` mode, a form posted to `action` by
|
|
120
|
+
* its Save button in `single` and `multiple`. Mapping `@sdxc/ui/app/filter-menu` in the browser
|
|
121
|
+
* entry runs {@link FilterMenuList}: typing filters, arrows walk, and closing a changed picker posts.
|
|
122
|
+
*
|
|
123
|
+
* @param handle Runtime handle carrying the menu's props.
|
|
124
|
+
* @returns The render function producing the trigger and popover.
|
|
125
|
+
* @example
|
|
126
|
+
* <FilterMenu id="ref-picker" mode="navigate" tabs trigger={<><GitBranchIcon /> main</>}
|
|
127
|
+
* groups={[{ label: "Branches", items: branches }, { label: "Tags", items: tags }]}
|
|
128
|
+
* filterAction="/delta/branches" footer={<a href="/delta/branches">View all branches</a>} labels={labels} />
|
|
129
|
+
* @example
|
|
130
|
+
* <FilterMenu id="labels" mode="multiple" name="label" action={`/issues/${id}/labels`}
|
|
131
|
+
* trigger="Labels" groups={[{ label: "Labels", items: labels }]} labels={copy} />
|
|
132
|
+
*/
|
|
133
|
+
export declare function FilterMenu(handle: Handle<FilterMenu.Props>): () => import("remix/component").RemixElement;
|
|
134
|
+
export declare namespace FilterMenu {
|
|
135
|
+
var Popover: (handle: Handle<FilterMenu.PopoverProps>) => () => import("remix/component").RemixElement;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Client island: the filter field, the tabs and the rows of a {@link FilterMenu}. It draws at
|
|
139
|
+
* most `limit` matches, so a list of thousands keeps a small page; typing filters, ↑↓ move the
|
|
140
|
+
* highlighted row, Enter follows or picks it, Escape closes, and a changed picker then submits.
|
|
141
|
+
*
|
|
142
|
+
* @example <FilterMenuList id="labels" mode="multiple" name="label" groups={groups} filterForm="labels-filter-form" labels={labels} />
|
|
143
|
+
*/
|
|
144
|
+
export declare const FilterMenuList: EntryComponent<FilterMenu.ListProps>;
|