@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,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The toolbar above a list: count tabs, search and facet filters at the start, a quiet status
|
|
3
|
+
* and one View menu (sort, display, auto-refresh) at the end, and applied filters as chips
|
|
4
|
+
* below. Every control writes a URL search parameter through one GET form, so it works unscripted.
|
|
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
|
+
/** Prop types for {@link FilterBar} and {@link FilterBarClear}. */
|
|
11
|
+
export declare namespace FilterBar {
|
|
12
|
+
/** A count tab: a saved slice of the list, such as "Open 26", linked rather than filtered. */
|
|
13
|
+
interface Tab {
|
|
14
|
+
label: string;
|
|
15
|
+
/** Records in the slice; omitted hides the count, and 0 draws it muted. */
|
|
16
|
+
count?: number;
|
|
17
|
+
/** Where the tab leads, carrying whatever other parameters the slice keeps. */
|
|
18
|
+
href: string;
|
|
19
|
+
/** Marks the slice the page shows with `aria-current="page"`. */
|
|
20
|
+
current?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** One value a facet filters by. */
|
|
23
|
+
interface Option {
|
|
24
|
+
/** What the facet's parameter holds when this value is applied. */
|
|
25
|
+
value: string;
|
|
26
|
+
label: string;
|
|
27
|
+
/** Records holding this value in the current results; omitted shows no count. */
|
|
28
|
+
count?: number;
|
|
29
|
+
/** A glyph or status dot drawn before the label, decorative. */
|
|
30
|
+
icon?: RemixNode;
|
|
31
|
+
}
|
|
32
|
+
/** A filterable field, written to the URL as one repeated parameter (`?status=up&status=down`). */
|
|
33
|
+
interface Facet {
|
|
34
|
+
/** The search parameter this facet owns. */
|
|
35
|
+
name: string;
|
|
36
|
+
label: string;
|
|
37
|
+
options: Option[];
|
|
38
|
+
/** A glyph drawn before the label on the trigger and chip, decorative. */
|
|
39
|
+
icon?: RemixNode;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The search field. Its input's id is `search.id`, or `<bar id>-search` when unset, so a
|
|
43
|
+
* list's `/` key can focus it (`<Table.Keys search="monitors-search" />`).
|
|
44
|
+
*/
|
|
45
|
+
interface Search {
|
|
46
|
+
/** The input's id, for `rowNavigation({ search })` or a label. @default `${id}-search` */
|
|
47
|
+
id?: string;
|
|
48
|
+
/** Search parameter it writes. @default "q" */
|
|
49
|
+
name?: string;
|
|
50
|
+
/** Accessible name; the field shows no visible label. */
|
|
51
|
+
label: string;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
}
|
|
54
|
+
/** A sort order the menu offers. */
|
|
55
|
+
interface SortOption {
|
|
56
|
+
value: string;
|
|
57
|
+
label: string;
|
|
58
|
+
}
|
|
59
|
+
/** The sort orders, listed first in the View menu as one link each, so a choice keeps every filter. */
|
|
60
|
+
interface Sort {
|
|
61
|
+
/** Search parameter it writes. @default "sort" */
|
|
62
|
+
name?: string;
|
|
63
|
+
/** The group's heading and accessible name, such as "Sort by". */
|
|
64
|
+
label: string;
|
|
65
|
+
options: SortOption[];
|
|
66
|
+
/** The order the list uses while the URL names none. */
|
|
67
|
+
defaultValue: string;
|
|
68
|
+
}
|
|
69
|
+
/** Every string the bar shows or announces. */
|
|
70
|
+
interface Labels {
|
|
71
|
+
/** Accessible name of the toolbar, such as "Filter monitors". */
|
|
72
|
+
toolbar: string;
|
|
73
|
+
/** Accessible name of the tab navigation, such as "Monitor states". */
|
|
74
|
+
tabs: string;
|
|
75
|
+
/** The collapsed trigger's text, such as "Filters". */
|
|
76
|
+
filters: string;
|
|
77
|
+
/** The View menu's trigger text and accessible name, such as "View" or "Display". */
|
|
78
|
+
options: string;
|
|
79
|
+
/** The submit button in each facet's popover, such as "Apply". */
|
|
80
|
+
apply: string;
|
|
81
|
+
/** A chip's operator for one value, such as "is". */
|
|
82
|
+
is: string;
|
|
83
|
+
/** A chip's operator for several values, such as "is any of". */
|
|
84
|
+
isAnyOf: string;
|
|
85
|
+
/** The link that removes every filter, such as "Clear filters". */
|
|
86
|
+
clear: string;
|
|
87
|
+
/** The key cap beside it. @default "Esc" */
|
|
88
|
+
clearKey?: string;
|
|
89
|
+
/** A chip remove link's accessible name, such as `Remove Status: Down, Paused`. */
|
|
90
|
+
remove: (field: string, values: string) => string;
|
|
91
|
+
}
|
|
92
|
+
/** When the bar's tab, sort, chip and clear links prefetch their page, as `LinkButton` does. */
|
|
93
|
+
type Prefetch = "intent" | "viewport";
|
|
94
|
+
/** Props accepted by {@link FilterBar}; the host is a `<div>`. */
|
|
95
|
+
interface Props extends Omit<TagProps<"div">, "children" | "id"> {
|
|
96
|
+
/** Prefix for the form and popover ids; unique on the page. */
|
|
97
|
+
id: string;
|
|
98
|
+
/** Prefetches the page behind each tab, sort, chip-remove and clear link; unset prefetches none. */
|
|
99
|
+
prefetch?: Prefetch;
|
|
100
|
+
/**
|
|
101
|
+
* The page's current URL, where every applied value is read from.
|
|
102
|
+
*
|
|
103
|
+
* @default "/", a page with no parameters
|
|
104
|
+
*/
|
|
105
|
+
url?: URL | string;
|
|
106
|
+
/** Where the form submits. Defaults to the current path. */
|
|
107
|
+
action?: string;
|
|
108
|
+
/** Count tabs at the start of the row. */
|
|
109
|
+
tabs?: Tab[];
|
|
110
|
+
/** The search field, after the tabs, between 14rem and 20rem wide. */
|
|
111
|
+
search?: Search;
|
|
112
|
+
/** Facet buttons after the search. */
|
|
113
|
+
facets?: Facet[];
|
|
114
|
+
/** Sort orders, the first group in the View menu. */
|
|
115
|
+
sort?: Sort;
|
|
116
|
+
/**
|
|
117
|
+
* The rest of the View menu, after sort: an inline `ViewOptions` and an `AutoRefresh`
|
|
118
|
+
* with `show="choices"`, each its own group.
|
|
119
|
+
*/
|
|
120
|
+
options?: RemixNode;
|
|
121
|
+
/**
|
|
122
|
+
* Quiet text before the View menu, such as an `AutoRefresh` with `show="status"`: small,
|
|
123
|
+
* muted, and hidden while the bar is narrower than 56rem.
|
|
124
|
+
*/
|
|
125
|
+
status?: RemixNode;
|
|
126
|
+
/** Moves the facets behind one "Filters (n)" popover while the bar is narrower than 32rem. */
|
|
127
|
+
collapse?: boolean;
|
|
128
|
+
/** Locale for the counts. Defaults to the runtime's. */
|
|
129
|
+
locale?: string;
|
|
130
|
+
labels: Labels;
|
|
131
|
+
}
|
|
132
|
+
/** Props {@link FilterBarClear} serializes for hydration, which is why they are a `type`. */
|
|
133
|
+
type ClearProps = {
|
|
134
|
+
href: string;
|
|
135
|
+
label: string;
|
|
136
|
+
prefetch?: Prefetch;
|
|
137
|
+
/** The key cap printed after the label. */
|
|
138
|
+
keyHint: string;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Renders the toolbar. Facet checkboxes, the search field and the hidden carried parameters
|
|
143
|
+
* all belong to one GET form, so Apply or Enter submits the whole view and the URL holds one
|
|
144
|
+
* parameter per filter; tabs, sort orders and chip removal are plain links.
|
|
145
|
+
*
|
|
146
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
147
|
+
* @returns The render function producing the toolbar's markup.
|
|
148
|
+
* @example
|
|
149
|
+
* <FilterBar
|
|
150
|
+
* id="monitors"
|
|
151
|
+
* url={request.url}
|
|
152
|
+
* tabs={[{ label: "Active", count: 26, href: "?state=active", current: true }]}
|
|
153
|
+
* search={{ label: "Search monitors", placeholder: "Search…" }}
|
|
154
|
+
* facets={[{ name: "status", label: "Status", options: [{ value: "down", label: "Down", count: 2 }] }]}
|
|
155
|
+
* sort={{ label: "Sort by", defaultValue: "name", options: [{ value: "name", label: "Name" }] }}
|
|
156
|
+
* options={<ViewOptions id="monitors-view" url={request.url} inline density={density} labels={viewLabels} />}
|
|
157
|
+
* status={<AutoRefresh {...refresh} show="status" />}
|
|
158
|
+
* labels={labels}
|
|
159
|
+
* prefetch="intent"
|
|
160
|
+
* />
|
|
161
|
+
*/
|
|
162
|
+
export declare function FilterBar(handle: Handle<FilterBar.Props>): () => import("remix/component").RemixElement;
|
|
163
|
+
/**
|
|
164
|
+
* Renders "Clear filters" with its key cap. It is a link to the URL without any filter, and
|
|
165
|
+
* once hydrated Escape follows it whenever nothing on the page claims the key first.
|
|
166
|
+
*
|
|
167
|
+
* @example <FilterBarClear href={clearFiltersHref(url, ["status", "q"])} label="Clear filters" keyHint="Esc" />
|
|
168
|
+
*/
|
|
169
|
+
export declare const FilterBarClear: EntryComponent<FilterBar.ClearProps>;
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "remix/component/jsx-runtime";
|
|
2
|
+
import { CheckIcon, ChevronDownIcon, ListFilterIcon, SlidersHorizontalIcon, XIcon, } from "@sdxc/icons";
|
|
3
|
+
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
4
|
+
import { rounded } from "@sdxc/u/effects";
|
|
5
|
+
import { cursor, mergeMix, raw } from "@sdxc/u/general";
|
|
6
|
+
import { basis, block, container, flex, flexWrap, gap, grow, hidden, hstack, inline, inlineFlex, items, justify, shrink, vstack, } from "@sdxc/u/layout";
|
|
7
|
+
import { divide, overflowY } from "@sdxc/u/overflow";
|
|
8
|
+
import { at } from "@sdxc/u/responsive";
|
|
9
|
+
import { bs, is, m, maxBs, maxIs, minIs, mis, p, pb, pbe, pi, pis } from "@sdxc/u/size";
|
|
10
|
+
import { focusVisible, hover, when } from "@sdxc/u/state";
|
|
11
|
+
import { nowrap, tabularNums, text, textDecoration, truncate, weight } from "@sdxc/u/typography";
|
|
12
|
+
import { clientEntry } from "remix/component";
|
|
13
|
+
import { Button } from "../components/button.js";
|
|
14
|
+
import { Checkbox } from "../components/checkbox.js";
|
|
15
|
+
import { Keyboard } from "../components/keyboard.js";
|
|
16
|
+
import { Popover } from "../components/popover.js";
|
|
17
|
+
import { SearchField } from "../components/search-field.js";
|
|
18
|
+
import { floatingSurface, surfaceInset } from "../styles/floating-surface.js";
|
|
19
|
+
import { interactiveTransition } from "../styles/interactive-transition.js";
|
|
20
|
+
import { escapeLink } from "./mixins/escape-link.js";
|
|
21
|
+
import { carriedParams, clearFiltersHref, paramValues, removeFilterHref, setParamHref, } from "./utils/search-params.js";
|
|
22
|
+
/** The URL read when `url` is unset: a page with nothing applied. */
|
|
23
|
+
const DEFAULT_URL = "/";
|
|
24
|
+
/** Search parameter the search field writes when `search.name` is unset. */
|
|
25
|
+
const DEFAULT_SEARCH_PARAM = "q";
|
|
26
|
+
/** Search parameter the sort menu writes when `sort.name` is unset. */
|
|
27
|
+
const DEFAULT_SORT_PARAM = "sort";
|
|
28
|
+
/** Container name the bar declares, which its zones query to wrap or collapse. */
|
|
29
|
+
const CONTAINER = "filter-bar";
|
|
30
|
+
/** Container width from which a collapsing bar shows each facet inline rather than behind "Filters". */
|
|
31
|
+
const COLLAPSE_WIDTH = "32rem";
|
|
32
|
+
/** Container width from which the status shows; a narrower bar gives its space to the controls. */
|
|
33
|
+
const STATUS_WIDTH = "56rem";
|
|
34
|
+
/** Container width from which the View trigger shows its text beside the icon. */
|
|
35
|
+
const OPTIONS_LABEL_WIDTH = "28rem";
|
|
36
|
+
/**
|
|
37
|
+
* Renders the toolbar. Facet checkboxes, the search field and the hidden carried parameters
|
|
38
|
+
* all belong to one GET form, so Apply or Enter submits the whole view and the URL holds one
|
|
39
|
+
* parameter per filter; tabs, sort orders and chip removal are plain links.
|
|
40
|
+
*
|
|
41
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
42
|
+
* @returns The render function producing the toolbar's markup.
|
|
43
|
+
* @example
|
|
44
|
+
* <FilterBar
|
|
45
|
+
* id="monitors"
|
|
46
|
+
* url={request.url}
|
|
47
|
+
* tabs={[{ label: "Active", count: 26, href: "?state=active", current: true }]}
|
|
48
|
+
* search={{ label: "Search monitors", placeholder: "Search…" }}
|
|
49
|
+
* facets={[{ name: "status", label: "Status", options: [{ value: "down", label: "Down", count: 2 }] }]}
|
|
50
|
+
* sort={{ label: "Sort by", defaultValue: "name", options: [{ value: "name", label: "Name" }] }}
|
|
51
|
+
* options={<ViewOptions id="monitors-view" url={request.url} inline density={density} labels={viewLabels} />}
|
|
52
|
+
* status={<AutoRefresh {...refresh} show="status" />}
|
|
53
|
+
* labels={labels}
|
|
54
|
+
* prefetch="intent"
|
|
55
|
+
* />
|
|
56
|
+
*/
|
|
57
|
+
export function FilterBar(handle) {
|
|
58
|
+
return () => {
|
|
59
|
+
let { id, url = DEFAULT_URL, prefetch, action, tabs, facets = [], search, sort, options, status, collapse, locale, labels, mix, ...rest } = handle.props;
|
|
60
|
+
let formId = `${id}-form`;
|
|
61
|
+
let facetsId = `${id}-facets`;
|
|
62
|
+
let numbers = new Intl.NumberFormat(locale);
|
|
63
|
+
let searchName = search ? (search.name ?? DEFAULT_SEARCH_PARAM) : undefined;
|
|
64
|
+
let filterNames = [...facets.map((facet) => facet.name), ...(searchName ? [searchName] : [])];
|
|
65
|
+
let applied = facets
|
|
66
|
+
.map((facet) => ({ facet, values: paramValues(url, facet.name) }))
|
|
67
|
+
.filter((entry) => entry.values.length > 0);
|
|
68
|
+
let query = searchName ? (paramValues(url, searchName)[0] ?? "") : "";
|
|
69
|
+
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
|
+
collapse ? collapsibleFacets() : [flex(), flexWrap(), items("center"), gap(1)],
|
|
72
|
+
], 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
|
+
hidden(),
|
|
74
|
+
at(STATUS_WIDTH, CONTAINER, block()),
|
|
75
|
+
minIs(0),
|
|
76
|
+
text("xs"),
|
|
77
|
+
fg("neutral.muted"),
|
|
78
|
+
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
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Styles a collapsing facet list: inline in a wide bar, where its closed `popover` attribute
|
|
84
|
+
* is overridden into the flow, and a floating panel anchored to "Filters" in a narrow one.
|
|
85
|
+
*
|
|
86
|
+
* @returns The mixins for the facet list host.
|
|
87
|
+
*/
|
|
88
|
+
function collapsibleFacets() {
|
|
89
|
+
return [
|
|
90
|
+
floatingSurface(),
|
|
91
|
+
surfaceInset(),
|
|
92
|
+
raw({
|
|
93
|
+
inset: "auto",
|
|
94
|
+
margin: 0,
|
|
95
|
+
marginBlockStart: "0.25rem",
|
|
96
|
+
positionArea: "bottom span-right",
|
|
97
|
+
flexDirection: "column",
|
|
98
|
+
alignItems: "stretch",
|
|
99
|
+
gap: "0.25rem",
|
|
100
|
+
minInlineSize: "12rem",
|
|
101
|
+
"&:popover-open": { display: "flex" },
|
|
102
|
+
[`@container ${CONTAINER} (min-width: ${COLLAPSE_WIDTH})`]: {
|
|
103
|
+
position: "static",
|
|
104
|
+
display: "flex",
|
|
105
|
+
flexDirection: "row",
|
|
106
|
+
flexWrap: "wrap",
|
|
107
|
+
alignItems: "center",
|
|
108
|
+
minInlineSize: 0,
|
|
109
|
+
margin: 0,
|
|
110
|
+
padding: 0,
|
|
111
|
+
border: 0,
|
|
112
|
+
boxShadow: "none",
|
|
113
|
+
background: "transparent",
|
|
114
|
+
color: "inherit",
|
|
115
|
+
overflow: "visible",
|
|
116
|
+
},
|
|
117
|
+
}),
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Renders the count tabs as links, the current one marked for assistive technology and drawn
|
|
122
|
+
* in the emphasis ink, each count tabular so the row holds still as numbers change. An empty
|
|
123
|
+
* slice keeps its tab with a muted, unfilled count. Tabs that outgrow the bar wrap, each whole.
|
|
124
|
+
*
|
|
125
|
+
* @param handle Runtime handle carrying the tabs.
|
|
126
|
+
* @returns The render function producing the navigation.
|
|
127
|
+
*/
|
|
128
|
+
function FilterTabs(handle) {
|
|
129
|
+
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: [
|
|
132
|
+
interactiveTransition(),
|
|
133
|
+
inlineFlex(),
|
|
134
|
+
items("center"),
|
|
135
|
+
gap(1.5),
|
|
136
|
+
bs(8),
|
|
137
|
+
pi(2),
|
|
138
|
+
rounded("md"),
|
|
139
|
+
fg("neutral.muted"),
|
|
140
|
+
textDecoration("none"),
|
|
141
|
+
nowrap(),
|
|
142
|
+
hover([fg("neutral.emphasis"), bg("neutral.bg-tint-hover")]),
|
|
143
|
+
focusVisible(outline({ color: "brand.ring", offset: 2 })),
|
|
144
|
+
when('&[aria-current="page"]', [fg("neutral.emphasis"), weight(600)]),
|
|
145
|
+
], children: [tab.label, tab.count === undefined ? null : (_jsx("span", { "data-slot": "count", "data-empty": tab.count === 0 ? "" : undefined, mix: [
|
|
146
|
+
pi(1.5),
|
|
147
|
+
rounded("full"),
|
|
148
|
+
bg("neutral.tint"),
|
|
149
|
+
fg("neutral"),
|
|
150
|
+
text("xs"),
|
|
151
|
+
weight(500),
|
|
152
|
+
tabularNums(),
|
|
153
|
+
when("&[data-empty]", [bg("transparent"), fg("neutral.muted"), weight(400)]),
|
|
154
|
+
], children: numbers.format(tab.count) }))] }))) }));
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Renders a facet's trigger: no chrome until hovered, a dashed outline then while nothing is
|
|
159
|
+
* applied, and a solid outline with the applied count once something is.
|
|
160
|
+
*
|
|
161
|
+
* @param handle Runtime handle carrying the trigger's props.
|
|
162
|
+
* @returns The render function producing the button.
|
|
163
|
+
*/
|
|
164
|
+
function FacetTrigger(handle) {
|
|
165
|
+
return () => {
|
|
166
|
+
let { popoverId, label, icon, applied, collapsed } = handle.props;
|
|
167
|
+
return (_jsxs("button", { type: "button", commandfor: popoverId, command: "toggle-popover", "data-slot": collapsed ? "filter-bar-collapse" : "filter-bar-facet", "data-applied": applied > 0 ? "" : undefined, mix: [
|
|
168
|
+
interactiveTransition(),
|
|
169
|
+
inlineFlex(),
|
|
170
|
+
items("center"),
|
|
171
|
+
gap(1.5),
|
|
172
|
+
bs(8),
|
|
173
|
+
pi(2.5),
|
|
174
|
+
rounded("md"),
|
|
175
|
+
border({ width: 1, style: "dashed", color: "transparent" }),
|
|
176
|
+
bg("transparent"),
|
|
177
|
+
fg("neutral"),
|
|
178
|
+
text("sm"),
|
|
179
|
+
nowrap(),
|
|
180
|
+
cursor("pointer"),
|
|
181
|
+
when("& > svg", [fg("neutral.muted"), shrink(0)]),
|
|
182
|
+
hover([bg("neutral.bg-tint-hover"), border("neutral.border"), fg("neutral.emphasis")]),
|
|
183
|
+
when("&[data-applied]", [
|
|
184
|
+
border({ width: 1, style: "solid", color: "neutral.border" }),
|
|
185
|
+
fg("neutral.emphasis"),
|
|
186
|
+
]),
|
|
187
|
+
focusVisible(outline({ color: "brand.ring", offset: 2 })),
|
|
188
|
+
collapsed ? at(COLLAPSE_WIDTH, CONTAINER, hidden()) : [],
|
|
189
|
+
], children: [icon, label, applied > 0 ? (_jsx("span", { "data-slot": "count", mix: [
|
|
190
|
+
pi(1.5),
|
|
191
|
+
rounded("full"),
|
|
192
|
+
bg("brand.tint"),
|
|
193
|
+
fg("brand"),
|
|
194
|
+
text("xs"),
|
|
195
|
+
weight(600),
|
|
196
|
+
tabularNums(),
|
|
197
|
+
], children: applied })) : null, _jsx(ChevronDownIcon, { size: 14 })] }));
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Renders a facet's value picker: a native popover holding one checkbox per value with its
|
|
202
|
+
* count, and an Apply button submitting the bar's form. Tab moves from the trigger into the
|
|
203
|
+
* list, Space toggles a value, and Escape closes it unchanged.
|
|
204
|
+
*
|
|
205
|
+
* @param handle Runtime handle carrying the facet and its applied values.
|
|
206
|
+
* @returns The render function producing the popover.
|
|
207
|
+
*/
|
|
208
|
+
function FacetPopover(handle) {
|
|
209
|
+
return () => {
|
|
210
|
+
let { id, formId, facet, selected, numbers, apply } = handle.props;
|
|
211
|
+
let legendId = `${id}-legend`;
|
|
212
|
+
return (_jsxs(Popover, { id: id, placement: "bottom-start", role: "dialog", "aria-labelledby": legendId, "data-slot": "filter-bar-facet-popover", mix: [surfaceInset(), minIs("14rem"), maxIs("min(20rem, calc(100vw - 2rem))")], children: [_jsxs("fieldset", { mix: [m(0), p(0), raw({ border: 0 }), vstack({ gap: 0.5 }), minIs(0)], children: [_jsx("legend", { id: legendId, mix: [pi(2), pb(1), text("xs"), weight(600), fg("neutral.muted")], children: facet.label }), _jsx("div", { mix: [vstack({ gap: 0.5 }), maxBs("16rem"), overflowY("auto")], children: facet.options.map((option) => (_jsx("div", { "data-slot": "filter-bar-option", mix: [
|
|
213
|
+
pi(2),
|
|
214
|
+
pb(1.5),
|
|
215
|
+
rounded("md"),
|
|
216
|
+
hover(bg("neutral.bg-tint-hover")),
|
|
217
|
+
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(Button, { type: "submit", form: formId, size: "sm", color: "brand", children: apply }) })] }));
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Renders the View trigger and its popover: the sort orders first, then each node of the bar's
|
|
223
|
+
* `options` as its own group under a divider, so every control that changes how the list is
|
|
224
|
+
* shown, rather than what it holds, sits behind one button.
|
|
225
|
+
*
|
|
226
|
+
* @param handle Runtime handle carrying the sort and the other groups.
|
|
227
|
+
* @returns The render function producing the trigger and popover.
|
|
228
|
+
*/
|
|
229
|
+
function OptionsMenu(handle) {
|
|
230
|
+
return () => {
|
|
231
|
+
let { id, sortId, url, sort, label, prefetch, children } = handle.props;
|
|
232
|
+
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
|
+
p(3),
|
|
234
|
+
is("20rem"),
|
|
235
|
+
maxIs("calc(100vw - 2rem)"),
|
|
236
|
+
vstack({ gap: 3 }),
|
|
237
|
+
divide("block", "neutral.border"),
|
|
238
|
+
when("& > *:not(:last-child)", pbe(3)),
|
|
239
|
+
], children: [sort ? _jsx(SortGroup, { id: sortId, url: url, sort: sort, prefetch: prefetch }) : null, children] })] }));
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Renders the sort orders as links with the current one checked, so choosing an order keeps
|
|
244
|
+
* every filter and works as a plain navigation; the default order drops the parameter.
|
|
245
|
+
*
|
|
246
|
+
* @param handle Runtime handle carrying the sort options.
|
|
247
|
+
* @returns The render function producing the group.
|
|
248
|
+
*/
|
|
249
|
+
function SortGroup(handle) {
|
|
250
|
+
return () => {
|
|
251
|
+
let { id, url, sort, prefetch } = handle.props;
|
|
252
|
+
let name = sort.name ?? DEFAULT_SORT_PARAM;
|
|
253
|
+
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: [
|
|
255
|
+
interactiveTransition(),
|
|
256
|
+
flex(),
|
|
257
|
+
items("center"),
|
|
258
|
+
justify("between"),
|
|
259
|
+
gap(2),
|
|
260
|
+
bs(8),
|
|
261
|
+
pi(2),
|
|
262
|
+
rounded("md"),
|
|
263
|
+
fg("neutral"),
|
|
264
|
+
textDecoration("none"),
|
|
265
|
+
hover([fg("neutral.emphasis"), bg("neutral.bg-tint-hover")]),
|
|
266
|
+
focusVisible(outline({ color: "brand.ring", offset: -2 })),
|
|
267
|
+
when('&[aria-current="true"]', [fg("neutral.emphasis"), weight(600)]),
|
|
268
|
+
when("& > svg", [fg("brand"), shrink(0)]),
|
|
269
|
+
], children: [_jsx("span", { mix: [truncate()], children: option.label }), option.value === current ? _jsx(CheckIcon, { size: 16, "aria-hidden": "true" }) : null] })))] }));
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Renders an applied filter as a segmented chip, field · operator · values · remove, where the
|
|
274
|
+
* values reopen the facet's picker and remove is a link to the URL without that parameter.
|
|
275
|
+
*
|
|
276
|
+
* @param handle Runtime handle carrying the facet and its applied values.
|
|
277
|
+
* @returns The render function producing the chip.
|
|
278
|
+
*/
|
|
279
|
+
function FilterChip(handle) {
|
|
280
|
+
return () => {
|
|
281
|
+
let { url, facet, values, popoverId, labels, prefetch } = handle.props;
|
|
282
|
+
let summary = values
|
|
283
|
+
.map((value) => facet.options.find((option) => option.value === value)?.label ?? value)
|
|
284
|
+
.join(", ");
|
|
285
|
+
let operator = values.length > 1 ? labels.isAnyOf : labels.is;
|
|
286
|
+
let segment = [inlineFlex(), items("center"), gap(1.5), pi(2), bs("100%"), nowrap()];
|
|
287
|
+
return (_jsxs("span", { role: "group", "aria-label": `${facet.label} ${operator} ${summary}`, "data-slot": "filter-bar-chip", "data-name": facet.name, mix: [
|
|
288
|
+
inlineFlex(),
|
|
289
|
+
items("stretch"),
|
|
290
|
+
bs(7),
|
|
291
|
+
maxIs("100%"),
|
|
292
|
+
minIs(0),
|
|
293
|
+
rounded("md"),
|
|
294
|
+
border({ width: 1, color: "neutral.border" }),
|
|
295
|
+
bg("neutral.tint"),
|
|
296
|
+
divide("inline", "neutral.border"),
|
|
297
|
+
raw({ overflow: "hidden" }),
|
|
298
|
+
], children: [_jsxs("span", { "data-slot": "field", mix: [
|
|
299
|
+
...segment,
|
|
300
|
+
fg("neutral.emphasis"),
|
|
301
|
+
weight(500),
|
|
302
|
+
when("& > svg", fg("neutral.muted")),
|
|
303
|
+
], children: [facet.icon, facet.label] }), _jsx("span", { "data-slot": "operator", mix: [...segment, fg("neutral.muted")], children: operator }), popoverId ? (_jsx("button", { type: "button", commandfor: popoverId, command: "toggle-popover", "data-slot": "values", mix: [
|
|
304
|
+
...segment,
|
|
305
|
+
minIs(0),
|
|
306
|
+
raw({ border: 0, font: "inherit" }),
|
|
307
|
+
bg("transparent"),
|
|
308
|
+
fg("neutral.emphasis"),
|
|
309
|
+
cursor("pointer"),
|
|
310
|
+
hover(bg("neutral.bg-tint-hover")),
|
|
311
|
+
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: [
|
|
313
|
+
...segment,
|
|
314
|
+
pi(1.5),
|
|
315
|
+
fg("neutral.muted"),
|
|
316
|
+
hover([fg("neutral.emphasis"), bg("neutral.bg-tint-hover")]),
|
|
317
|
+
focusVisible(outline({ color: "brand.ring", offset: -2 })),
|
|
318
|
+
], children: _jsx(XIcon, { size: 14, "aria-hidden": "true" }) })] }));
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Renders "Clear filters" with its key cap. It is a link to the URL without any filter, and
|
|
323
|
+
* once hydrated Escape follows it whenever nothing on the page claims the key first.
|
|
324
|
+
*
|
|
325
|
+
* @example <FilterBarClear href={clearFiltersHref(url, ["status", "q"])} label="Clear filters" keyHint="Esc" />
|
|
326
|
+
*/
|
|
327
|
+
export const FilterBarClear = clientEntry("@sdxc/ui/app/filter-bar#FilterBarClear", function FilterBarClear(handle) {
|
|
328
|
+
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: [
|
|
331
|
+
escapeLink(),
|
|
332
|
+
interactiveTransition(),
|
|
333
|
+
inlineFlex(),
|
|
334
|
+
items("center"),
|
|
335
|
+
gap(2),
|
|
336
|
+
bs(7),
|
|
337
|
+
pi(2),
|
|
338
|
+
rounded("md"),
|
|
339
|
+
fg("neutral"),
|
|
340
|
+
textDecoration("none"),
|
|
341
|
+
nowrap(),
|
|
342
|
+
hover([fg("neutral.emphasis"), bg("neutral.bg-tint-hover")]),
|
|
343
|
+
focusVisible(outline({ color: "brand.ring", offset: 2 })),
|
|
344
|
+
], children: [label, _jsx(Keyboard, { "aria-hidden": "true", mix: [raw({ marginInlineStart: 0 })], children: keyHint })] }));
|
|
345
|
+
};
|
|
346
|
+
});
|
package/dist/app/index.d.ts
CHANGED
|
@@ -6,36 +6,87 @@
|
|
|
6
6
|
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
7
7
|
* @copyright Sergio Xalambrí 2026
|
|
8
8
|
*/
|
|
9
|
+
export * from "./app-shell-toggle.js";
|
|
10
|
+
export * from "./app-shell.js";
|
|
11
|
+
export * from "./auto-refresh.js";
|
|
9
12
|
export * from "./behaviors/drag-session.js";
|
|
13
|
+
export * from "./behaviors/refresh-schedule.js";
|
|
10
14
|
export * from "./behaviors/resize-session.js";
|
|
11
15
|
export * from "./behaviors/selection-model.js";
|
|
16
|
+
export * from "./behaviors/shortcuts.js";
|
|
12
17
|
export * from "./behaviors/toaster.js";
|
|
13
18
|
export * from "./chart.js";
|
|
19
|
+
export * from "./command-palette.js";
|
|
14
20
|
export * from "./context-menu.js";
|
|
21
|
+
export * from "./danger-zone.js";
|
|
22
|
+
export * from "./detail-sheet.js";
|
|
15
23
|
export * from "./drop-indicator.js";
|
|
16
24
|
export * from "./drop-zone.js";
|
|
25
|
+
export * from "./editor-layout.js";
|
|
17
26
|
export * from "./empty.js";
|
|
18
27
|
export * from "./file-trigger.js";
|
|
28
|
+
export * from "./filter-bar.js";
|
|
19
29
|
export * from "./grid-list.js";
|
|
30
|
+
export * from "./keyboard-help.js";
|
|
20
31
|
export * from "./menubar.js";
|
|
32
|
+
export * from "./mixins/app-shell-controls.js";
|
|
33
|
+
export * from "./mixins/auto-refresh.js";
|
|
21
34
|
export * from "./mixins/chart-tooltip.js";
|
|
35
|
+
export * from "./mixins/command-palette.js";
|
|
22
36
|
export * from "./mixins/context-menu.js";
|
|
37
|
+
export * from "./mixins/copy-permalink.js";
|
|
38
|
+
export * from "./mixins/detail-sheet-keys.js";
|
|
23
39
|
export * from "./mixins/drag-reorder.js";
|
|
24
40
|
export * from "./mixins/drop-zone.js";
|
|
41
|
+
export * from "./mixins/escape-link.js";
|
|
25
42
|
export * from "./mixins/grid-list-keys.js";
|
|
43
|
+
export * from "./mixins/keyboard-help.js";
|
|
26
44
|
export * from "./mixins/menubar-keys.js";
|
|
45
|
+
export * from "./mixins/optimistic-toggle-sync.js";
|
|
46
|
+
export * from "./mixins/range-picker-keys.js";
|
|
27
47
|
export * from "./mixins/resize-handle.js";
|
|
48
|
+
export * from "./mixins/row-navigation.js";
|
|
49
|
+
export * from "./mixins/save-bar-sync.js";
|
|
50
|
+
export * from "./mixins/save-shortcut.js";
|
|
51
|
+
export * from "./mixins/save-status-sync.js";
|
|
52
|
+
export * from "./mixins/selection-bar-sync.js";
|
|
53
|
+
export * from "./mixins/split-view.js";
|
|
54
|
+
export * from "./mixins/status-strip-keys.js";
|
|
55
|
+
export * from "./mixins/submit-on-change.js";
|
|
56
|
+
export * from "./mixins/table-selection.js";
|
|
57
|
+
export * from "./mixins/toast-queue.js";
|
|
58
|
+
export * from "./mixins/toast-stack.js";
|
|
28
59
|
export * from "./mixins/tree-keys.js";
|
|
60
|
+
export * from "./optimistic-toggle.js";
|
|
61
|
+
export * from "./page-header.js";
|
|
62
|
+
export * from "./range-picker.js";
|
|
29
63
|
export * from "./resizable.js";
|
|
64
|
+
export * from "./save-bar.js";
|
|
65
|
+
export * from "./save-status.js";
|
|
66
|
+
export * from "./selection-bar.js";
|
|
67
|
+
export * from "./settings-layout.js";
|
|
68
|
+
export * from "./settings-section.js";
|
|
30
69
|
export * from "./shortcut-list.js";
|
|
31
70
|
export * from "./skeleton.js";
|
|
71
|
+
export * from "./sparkline.js";
|
|
72
|
+
export * from "./split-view.js";
|
|
73
|
+
export * from "./stat-card.js";
|
|
74
|
+
export * from "./status-strip.js";
|
|
32
75
|
export * from "./styles/chart-palette.js";
|
|
33
76
|
export * from "./styles/graphic-host.js";
|
|
34
77
|
export * from "./styles/legend-toggle.js";
|
|
78
|
+
export * from "./styles/toast-stack.js";
|
|
35
79
|
export * from "./table.js";
|
|
36
80
|
export * from "./toast.js";
|
|
81
|
+
export * from "./toasts.js";
|
|
37
82
|
export * from "./toolbar.js";
|
|
38
83
|
export * from "./tree.js";
|
|
39
84
|
export * from "./utils/chart-marker-indices.js";
|
|
40
85
|
export * from "./utils/chart-path.js";
|
|
41
86
|
export * from "./utils/chart-scale.js";
|
|
87
|
+
export * from "./utils/edited-time.js";
|
|
88
|
+
export * from "./utils/key-target.js";
|
|
89
|
+
export * from "./utils/search-params.js";
|
|
90
|
+
export * from "./utils/shortcut-groups.js";
|
|
91
|
+
export * from "./utils/split-view-layout.js";
|
|
92
|
+
export * from "./view-options.js";
|