basalt-ui 2.13.3 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +66 -0
- package/MIGRATING.md +42 -12
- package/agent/agents/basalt-design-reviewer.md +83 -0
- package/agent/rules/basalt-batteries.md +1 -2
- package/agent/rules/basalt-charts.md +1 -1
- package/agent/rules/basalt-controls.md +3 -3
- package/agent/rules/basalt-mantine.md +1 -2
- package/agent/rules/basalt-state.md +1 -2
- package/agent/rules/basalt-tokens.md +1 -3
- package/agent/skills/basalt-design/SKILL.md +26 -8
- package/agent/templates/AGENTS-block.md.tpl +7 -0
- package/configs/oxlint-plugin.js +39 -2
- package/configs/oxlint-plugin.test.ts +48 -0
- package/dist/agent/chat/thread-feed-row.d.ts.map +1 -1
- package/dist/agent/chat/thread-feed-row.js +2 -2
- package/dist/agent/chat/thread-message.d.ts.map +1 -1
- package/dist/agent/chat/thread-message.js +2 -2
- package/dist/agent/chat/thread-outcome-card.js +2 -2
- package/dist/charts/DualPanel.d.ts.map +1 -1
- package/dist/charts/DualPanel.js +1 -0
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +3 -2
- package/dist/charts/cursor.d.ts +10 -6
- package/dist/charts/cursor.d.ts.map +1 -1
- package/dist/charts/cursor.js +20 -13
- package/dist/charts/legend.d.ts +7 -6
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +3 -3
- package/dist/charts/panel.d.ts +2 -0
- package/dist/charts/panel.d.ts.map +1 -1
- package/dist/charts/panel.js +1 -0
- package/dist/cli/board-freshness.d.ts +25 -0
- package/dist/cli/board-freshness.d.ts.map +1 -0
- package/dist/cli/board-freshness.js +88 -0
- package/dist/cli/doctor.d.ts +2 -1
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +3 -1
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +9 -3
- package/dist/cli/index.d.ts +15 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +57 -7
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +6 -1
- package/dist/cli/shot/board.d.ts +5 -0
- package/dist/cli/shot/board.d.ts.map +1 -0
- package/dist/cli/shot/board.js +96 -0
- package/dist/cli/shot/capture.d.ts +59 -0
- package/dist/cli/shot/capture.d.ts.map +1 -0
- package/dist/cli/shot/capture.js +473 -0
- package/dist/cli/shot/index.d.ts +45 -0
- package/dist/cli/shot/index.d.ts.map +1 -0
- package/dist/cli/shot/index.js +289 -0
- package/dist/cli/shot/measure.d.ts +28 -0
- package/dist/cli/shot/measure.d.ts.map +1 -0
- package/dist/cli/shot/measure.js +176 -0
- package/dist/cli/shot/playwright.d.ts +101 -0
- package/dist/cli/shot/playwright.d.ts.map +1 -0
- package/dist/cli/shot/playwright.js +60 -0
- package/dist/cli/shot/serve.d.ts +6 -0
- package/dist/cli/shot/serve.d.ts.map +1 -0
- package/dist/cli/shot/serve.js +33 -0
- package/dist/cli/shot/types.d.ts +97 -0
- package/dist/cli/shot/types.d.ts.map +1 -0
- package/dist/cli/shot/types.js +17 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +2 -1
- package/dist/commands/notifications/center.d.ts.map +1 -1
- package/dist/commands/notifications/center.js +2 -11
- package/dist/controls/control-name.d.ts +27 -0
- package/dist/controls/control-name.d.ts.map +1 -0
- package/dist/controls/control-name.js +11 -0
- package/dist/controls/enum-filter.d.ts +3 -6
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +8 -4
- package/dist/controls/filter-base.d.ts +30 -0
- package/dist/controls/filter-base.d.ts.map +1 -0
- package/dist/controls/filter-base.js +0 -0
- package/dist/controls/filter-pill.d.ts +3 -1
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +2 -0
- package/dist/controls/filter-sheet.d.ts +0 -32
- package/dist/controls/filter-sheet.d.ts.map +1 -1
- package/dist/controls/filter-sheet.js +1 -28
- package/dist/controls/glyphs.d.ts +12 -0
- package/dist/controls/glyphs.d.ts.map +1 -1
- package/dist/controls/glyphs.js +23 -2
- package/dist/controls/index.d.ts +2 -1
- package/dist/controls/index.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.d.ts +8 -3
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +27 -10
- package/dist/controls/number-filter.d.ts +3 -12
- package/dist/controls/number-filter.d.ts.map +1 -1
- package/dist/controls/number-filter.js +17 -6
- package/dist/controls/panel-row.d.ts +5 -8
- package/dist/controls/panel-row.d.ts.map +1 -1
- package/dist/controls/panel-row.js +3 -0
- package/dist/controls/range-filter.d.ts +14 -14
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +18 -41
- package/dist/controls/search-filter.d.ts +5 -2
- package/dist/controls/search-filter.d.ts.map +1 -1
- package/dist/controls/search-filter.js +74 -40
- package/dist/controls/select-filter.d.ts +2 -15
- package/dist/controls/select-filter.d.ts.map +1 -1
- package/dist/controls/sync-button.d.ts +0 -6
- package/dist/controls/sync-button.d.ts.map +1 -1
- package/dist/controls/sync-button.js +6 -36
- package/dist/controls/toggle-filter.d.ts +2 -2
- package/dist/controls/toggle-filter.d.ts.map +1 -1
- package/dist/controls/toggle-filter.js +3 -2
- package/dist/controls/view-tabs.d.ts +3 -4
- package/dist/controls/view-tabs.d.ts.map +1 -1
- package/dist/controls/view-tabs.js +24 -5
- package/dist/format/date.d.ts +43 -10
- package/dist/format/date.d.ts.map +1 -1
- package/dist/format/date.js +109 -18
- package/dist/format/index.d.ts +12 -11
- package/dist/format/index.d.ts.map +1 -1
- package/dist/format/index.js +11 -2
- package/dist/format/measure.d.ts +9 -9
- package/dist/format/measure.d.ts.map +1 -1
- package/dist/format/measure.js +19 -8
- package/dist/format/number.d.ts +35 -27
- package/dist/format/number.d.ts.map +1 -1
- package/dist/format/number.js +41 -20
- package/dist/format/shared.d.ts +38 -7
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +61 -13
- package/dist/provider/index.d.ts +13 -1
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +8 -0
- package/dist/surfaces.d.ts +2 -0
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +2 -0
- package/llms.txt +35 -14
- package/package.json +1 -1
- package/src/agent/chat/thread-feed-row.tsx +2 -2
- package/src/agent/chat/thread-message.tsx +2 -2
- package/src/agent/chat/thread-outcome-card.tsx +2 -2
- package/src/charts/DualPanel.tsx +1 -0
- package/src/charts/compile.ts +3 -2
- package/src/charts/cursor.ts +44 -27
- package/src/charts/legend.tsx +11 -8
- package/src/charts/panel.tsx +3 -0
- package/src/cli/board-freshness.ts +132 -0
- package/src/cli/doctor.ts +10 -1
- package/src/cli/help.ts +14 -2
- package/src/cli/index.ts +80 -10
- package/src/cli/init.ts +8 -1
- package/src/cli/shot/board.ts +154 -0
- package/src/cli/shot/capture.ts +650 -0
- package/src/cli/shot/index.ts +362 -0
- package/src/cli/shot/measure.ts +225 -0
- package/src/cli/shot/playwright.ts +152 -0
- package/src/cli/shot/serve.ts +35 -0
- package/src/cli/shot/types.ts +91 -0
- package/src/cli/sync.ts +2 -1
- package/src/commands/notifications/center.tsx +2 -14
- package/src/controls/control-name.ts +33 -0
- package/src/controls/enum-filter.tsx +29 -27
- package/src/controls/filter-base.ts +31 -0
- package/src/controls/filter-pill.tsx +4 -0
- package/src/controls/filter-sheet.tsx +0 -56
- package/src/controls/glyphs.tsx +45 -2
- package/src/controls/index.ts +2 -1
- package/src/controls/multi-select-filter.tsx +67 -43
- package/src/controls/number-filter.tsx +47 -47
- package/src/controls/panel-row.tsx +7 -8
- package/src/controls/range-filter.tsx +54 -78
- package/src/controls/search-filter.tsx +107 -54
- package/src/controls/select-filter.tsx +2 -18
- package/src/controls/sync-button.tsx +7 -40
- package/src/controls/toggle-filter.tsx +9 -7
- package/src/controls/view-tabs.tsx +41 -21
- package/src/format/date.ts +189 -36
- package/src/format/index.ts +12 -11
- package/src/format/measure.ts +29 -18
- package/src/format/number.ts +76 -37
- package/src/format/shared.ts +116 -25
- package/src/provider/index.tsx +23 -0
- package/src/surfaces.ts +5 -0
- package/dist/agent/chat/relative-time.d.ts +0 -27
- package/dist/agent/chat/relative-time.d.ts.map +0 -1
- package/dist/agent/chat/relative-time.js +0 -27
- package/src/agent/chat/relative-time.ts +0 -55
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { existsSync, statSync } from "node:fs";
|
|
2
|
+
import { join, normalize, resolve, sep } from "node:path";
|
|
3
|
+
import { ShotError } from "./playwright.js";
|
|
4
|
+
function serveDist(distDir) {
|
|
5
|
+
const root = resolve(distDir);
|
|
6
|
+
if (!existsSync(root) || !statSync(root).isDirectory()) {
|
|
7
|
+
throw new ShotError(`--dist ${distDir} is not a directory`);
|
|
8
|
+
}
|
|
9
|
+
const fileFor = (pathname) => {
|
|
10
|
+
const file = normalize(join(root, decodeURIComponent(pathname)));
|
|
11
|
+
if (file !== root && !file.startsWith(root + sep)) return null;
|
|
12
|
+
if (existsSync(file) && statSync(file).isFile()) return file;
|
|
13
|
+
if (/\.[a-z0-9]+$/i.test(pathname)) return null;
|
|
14
|
+
const index = join(root, "index.html");
|
|
15
|
+
return existsSync(index) ? index : null;
|
|
16
|
+
};
|
|
17
|
+
const server = Bun.serve({
|
|
18
|
+
port: 0,
|
|
19
|
+
hostname: "127.0.0.1",
|
|
20
|
+
fetch(req) {
|
|
21
|
+
try {
|
|
22
|
+
const file = fileFor(new URL(req.url).pathname);
|
|
23
|
+
return file ? new Response(Bun.file(file), { headers: { "cache-control": "no-store" } }) : new Response("not found", { status: 404 });
|
|
24
|
+
} catch {
|
|
25
|
+
return new Response("bad request", { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return { origin: `http://127.0.0.1:${server.port}`, stop: () => void server.stop(true) };
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
serveDist
|
|
33
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare const SCHEMES: readonly ["light", "dark"];
|
|
2
|
+
export declare const VIEWPORTS: readonly ["desktop", "mobile"];
|
|
3
|
+
export declare const STATES: readonly ["rest", "hover", "focus", "tooltip", "empty", "loading", "error"];
|
|
4
|
+
/** The states a page opts into with `data-shot-states`; reached through the `shot-state` URL param. */
|
|
5
|
+
export declare const URL_STATES: readonly ["empty", "loading", "error"];
|
|
6
|
+
/** The `name` of a route's full-page shot: not a valid `data-shot` value. */
|
|
7
|
+
export declare const PAGE_ANCHOR = "_page";
|
|
8
|
+
export type Scheme = (typeof SCHEMES)[number];
|
|
9
|
+
export type Viewport = (typeof VIEWPORTS)[number];
|
|
10
|
+
export type ShotState = (typeof STATES)[number];
|
|
11
|
+
export declare const VIEWPORT_SPECS: Record<Viewport, {
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
mobile: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
export type Sides = {
|
|
17
|
+
top: number;
|
|
18
|
+
right: number;
|
|
19
|
+
bottom: number;
|
|
20
|
+
left: number;
|
|
21
|
+
};
|
|
22
|
+
export type ContrastFailure = {
|
|
23
|
+
text: string;
|
|
24
|
+
ratio: number;
|
|
25
|
+
fg: string;
|
|
26
|
+
bg: string;
|
|
27
|
+
fontSize: number;
|
|
28
|
+
};
|
|
29
|
+
/** What the in-page measurer returns for one anchor. */
|
|
30
|
+
export type Measurement = {
|
|
31
|
+
box: {
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
};
|
|
35
|
+
padding: Sides;
|
|
36
|
+
gap: {
|
|
37
|
+
row: number;
|
|
38
|
+
column: number;
|
|
39
|
+
};
|
|
40
|
+
radius: number;
|
|
41
|
+
borderWidth: number;
|
|
42
|
+
fontSizes: number[];
|
|
43
|
+
nested: {
|
|
44
|
+
path: string;
|
|
45
|
+
radius: number;
|
|
46
|
+
padding: Sides;
|
|
47
|
+
}[];
|
|
48
|
+
emptyRatio: number;
|
|
49
|
+
/** `min` is null when the anchor holds no text. */
|
|
50
|
+
contrast: {
|
|
51
|
+
min: number | null;
|
|
52
|
+
failures: ContrastFailure[];
|
|
53
|
+
/** Set when some text sat on no opaque ancestor background and white was assumed. */
|
|
54
|
+
backdrop?: 'assumed-white';
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export type AnchorMetrics = Measurement & {
|
|
58
|
+
route: string;
|
|
59
|
+
name: string;
|
|
60
|
+
scheme: Scheme;
|
|
61
|
+
viewport: Viewport;
|
|
62
|
+
/** The anchor's contact sheet (`png/…__sheet.png`): every state × scheme × viewport on one image. Absent when it could not be written. */
|
|
63
|
+
sheet?: string;
|
|
64
|
+
};
|
|
65
|
+
export type ShotRecord = {
|
|
66
|
+
route: string;
|
|
67
|
+
name: string;
|
|
68
|
+
scheme: Scheme;
|
|
69
|
+
viewport: Viewport;
|
|
70
|
+
state: ShotState;
|
|
71
|
+
file: string | null;
|
|
72
|
+
status: 'ok' | 'not-declared' | 'skipped' | 'error';
|
|
73
|
+
note?: string;
|
|
74
|
+
};
|
|
75
|
+
/** The theme's resolved steps (px) for one scheme × viewport; a missing custom property is omitted. */
|
|
76
|
+
export type Scale = {
|
|
77
|
+
scheme: Scheme;
|
|
78
|
+
viewport: Viewport;
|
|
79
|
+
spacing: Record<string, number>;
|
|
80
|
+
radius: Record<string, number>;
|
|
81
|
+
fontSizes: Record<string, number>;
|
|
82
|
+
};
|
|
83
|
+
export type ShotMetrics = {
|
|
84
|
+
version: 1;
|
|
85
|
+
generatedAt: string;
|
|
86
|
+
base: string;
|
|
87
|
+
routes: string[];
|
|
88
|
+
viewports: Viewport[];
|
|
89
|
+
schemes: Scheme[];
|
|
90
|
+
states: ShotState[];
|
|
91
|
+
scale: Scale[];
|
|
92
|
+
/** Why `scale` is empty or partial; absent when it was read. */
|
|
93
|
+
scaleError?: string;
|
|
94
|
+
anchors: AnchorMetrics[];
|
|
95
|
+
shots: ShotRecord[];
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cli/shot/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const SCHEMES = ["light", "dark"];
|
|
2
|
+
const VIEWPORTS = ["desktop", "mobile"];
|
|
3
|
+
const STATES = ["rest", "hover", "focus", "tooltip", "empty", "loading", "error"];
|
|
4
|
+
const URL_STATES = ["empty", "loading", "error"];
|
|
5
|
+
const PAGE_ANCHOR = "_page";
|
|
6
|
+
const VIEWPORT_SPECS = {
|
|
7
|
+
desktop: { width: 1440, height: 900, mobile: false },
|
|
8
|
+
mobile: { width: 390, height: 844, mobile: true }
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
PAGE_ANCHOR,
|
|
12
|
+
SCHEMES,
|
|
13
|
+
STATES,
|
|
14
|
+
URL_STATES,
|
|
15
|
+
VIEWPORTS,
|
|
16
|
+
VIEWPORT_SPECS
|
|
17
|
+
};
|
package/dist/cli/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/cli/sync.ts"],"names":[],"mappings":"AAgDA,gGAAgG;AAChG,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAGjE;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,mGAAmG;IACnG,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrF;AAQD;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,WAAgB,EAAE,aAAa,GAAE,MAAsB,GAAG,MAAM,CAiP1F"}
|
package/dist/cli/sync.js
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
readManifest,
|
|
25
25
|
readSource,
|
|
26
26
|
reconcileRoots,
|
|
27
|
+
ruleRootsFor,
|
|
27
28
|
relativePosix,
|
|
28
29
|
renderContext,
|
|
29
30
|
reportPrune,
|
|
@@ -92,7 +93,7 @@ function sync(opts = {}, invocationCwd = process.cwd()) {
|
|
|
92
93
|
return 1;
|
|
93
94
|
}
|
|
94
95
|
const rootsState = reconcileRoots(cwd, { write: opts.check !== true });
|
|
95
|
-
const ctx = renderContext(cwd);
|
|
96
|
+
const ctx = renderContext(cwd, ruleRootsFor(rootsState));
|
|
96
97
|
const manifest = readManifest(cwd);
|
|
97
98
|
const placement = resolvePlacement(cwd);
|
|
98
99
|
const { skip: seedSkip, skipped } = routerSeedPlan(cwd, placement.appRel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"center.d.ts","sourceRoot":"","sources":["../../../src/commands/notifications/center.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"center.d.ts","sourceRoot":"","sources":["../../../src/commands/notifications/center.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AA6BrD;;4CAE4C;AAC5C,eAAO,MAAM,0BAA0B,MAAM,CAAA;AAwF7C,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC5B,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,SAAe,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,uBAAuB,+BA4EhG"}
|
|
@@ -11,19 +11,10 @@ import {
|
|
|
11
11
|
Text
|
|
12
12
|
} from "@mantine/core";
|
|
13
13
|
import { cx } from "../../common/props.js";
|
|
14
|
+
import { relativeTime } from "../../format/index.js";
|
|
14
15
|
import { VX } from "../../tokens/index.js";
|
|
15
16
|
import { resolveAction } from "./define-notifications.js";
|
|
16
17
|
import { useNotificationHistory } from "./store.js";
|
|
17
|
-
function relativeTime(createdAt) {
|
|
18
|
-
const seconds = Math.floor((Date.now() - createdAt) / 1e3);
|
|
19
|
-
if (seconds < 60) return "just now";
|
|
20
|
-
const minutes = Math.floor(seconds / 60);
|
|
21
|
-
if (minutes < 60) return `${minutes}m ago`;
|
|
22
|
-
const hours = Math.floor(minutes / 60);
|
|
23
|
-
if (hours < 24) return `${hours}h ago`;
|
|
24
|
-
const days = Math.floor(hours / 24);
|
|
25
|
-
return `${days}d ago`;
|
|
26
|
-
}
|
|
27
18
|
const INTENT_COLOR = {
|
|
28
19
|
success: "green",
|
|
29
20
|
error: "red",
|
|
@@ -85,7 +76,7 @@ function NotificationItem({
|
|
|
85
76
|
}
|
|
86
77
|
),
|
|
87
78
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", align: "center", mt: 2, wrap: "nowrap", children: [
|
|
88
|
-
/* @__PURE__ */ jsx(Text, { ff: "monospace", c: "var(--vx-faint)", style: { fontSize: VX.text.micro }, children: relativeTime(item.createdAt) }),
|
|
79
|
+
/* @__PURE__ */ jsx(Text, { ff: "monospace", c: "var(--vx-faint)", style: { fontSize: VX.text.micro }, children: relativeTime(item.createdAt, { style: "short" }) }),
|
|
89
80
|
resolved !== void 0 && /* @__PURE__ */ jsx(Button, { variant: "light", color, size: "compact-xs", onClick: handleAction, children: resolved.label })
|
|
90
81
|
] })
|
|
91
82
|
] }),
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Names a control that has no VISIBLE Mantine `label`, and does it differently per surface — which
|
|
3
|
+
* is the whole reason this is one helper instead of an `aria-label` sprinkled per call site.
|
|
4
|
+
*
|
|
5
|
+
* In the SHEET and the PANEL the visible `PanelRow` heading is right there, so the control points
|
|
6
|
+
* at it (`aria-labelledby`) and the heading stops being decoration. In the PILL surface there is no
|
|
7
|
+
* visible name to point at — the pill text is the VALUE (`EUR`, `30d`, `3 channels`) — so the
|
|
8
|
+
* control carries the filter's own name instead. Either way the announced name is what is being
|
|
9
|
+
* filtered, not what it currently holds.
|
|
10
|
+
*
|
|
11
|
+
* The id is generated by the CONTROL, not by `PanelRow`, because the control renders its own
|
|
12
|
+
* `PanelRow`: an id published downward through context could never reach the sibling that needs it.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { labelId, nameProps } = useControlName(label, inSheet || inPanel)
|
|
16
|
+
* <Radio.Group {...nameProps} …/>
|
|
17
|
+
* // and, in the sheet/panel branch: <PanelRow label={label} labelId={labelId}>…</PanelRow>
|
|
18
|
+
*/
|
|
19
|
+
export declare function useControlName(label: string, named: boolean): {
|
|
20
|
+
labelId: string;
|
|
21
|
+
nameProps: {
|
|
22
|
+
'aria-labelledby': string;
|
|
23
|
+
} | {
|
|
24
|
+
'aria-label': string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=control-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-name.d.ts","sourceRoot":"","sources":["../../src/controls/control-name.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GACb;IACD,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAA;CACpE,CAMA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { BasaltProps } from '../common/props.js';
|
|
3
3
|
import type { FieldOption } from '../state/fields.js';
|
|
4
|
-
import type { FilterOption } from './
|
|
4
|
+
import type { FilterBase, FilterOption } from './filter-base.js';
|
|
5
5
|
/**
|
|
6
6
|
* The slice of a `FieldHandle` this body actually binds to, generic over the VALUE rather than over
|
|
7
7
|
* the field kind. `FieldHandle<EnumField<T>>` satisfies it at `T` and `FieldHandle<StringField>` at
|
|
@@ -17,12 +17,9 @@ export type ChoiceHandle<T extends string> = {
|
|
|
17
17
|
* of the fallback back over it. See `useFilterRegistration`'s doc for why. */
|
|
18
18
|
clear(): void;
|
|
19
19
|
};
|
|
20
|
-
export type EnumFilterProps<T extends string> = BasaltProps & {
|
|
20
|
+
export type EnumFilterProps<T extends string> = BasaltProps & FilterBase & {
|
|
21
21
|
readonly field: ChoiceHandle<T>;
|
|
22
22
|
readonly label: string;
|
|
23
|
-
readonly icon?: ReactNode;
|
|
24
|
-
/** Adds a `Clear` action that clears the field — the same `field.clear()` `Reset all` calls. */
|
|
25
|
-
readonly clearable?: boolean;
|
|
26
23
|
/**
|
|
27
24
|
* Overrides `field.options` at render — a runtime catalogue whose labels carry live data, or the
|
|
28
25
|
* only row source a `StringField` has. `| undefined` explicitly: an internal component is spread
|
|
@@ -39,5 +36,5 @@ export type EnumFilterProps<T extends string> = BasaltProps & {
|
|
|
39
36
|
*/
|
|
40
37
|
readonly numeric?: boolean | undefined;
|
|
41
38
|
};
|
|
42
|
-
export declare function EnumFilter<T extends string>({ field, label, icon, clearable, numeric, options: optionsProp, unmatchedLabel, className, style, }: EnumFilterProps<T>): ReactNode;
|
|
39
|
+
export declare function EnumFilter<T extends string>({ field, label, icon, clearable, disabled, numeric, options: optionsProp, unmatchedLabel, className, style, }: EnumFilterProps<T>): ReactNode;
|
|
43
40
|
//# sourceMappingURL=enum-filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enum-filter.d.ts","sourceRoot":"","sources":["../../src/controls/enum-filter.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"enum-filter.d.ts","sourceRoot":"","sources":["../../src/controls/enum-filter.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAK7D;;;;;GAKG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,IAAI;IAC3C,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAA;IACxC,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC,CAAA;IACtC,SAAS,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAA;IACxB;kFAC8E;IAC9E,KAAK,IAAI,IAAI,CAAA;CACd,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,MAAM,IAAI,WAAW,GACzD,UAAU,GAAG;IACX,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAA;IACtD;wFACoF;IACpF,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACvC,CAAA;AAEH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,EAC3C,KAAK,EACL,KAAK,EACL,IAAI,EACJ,SAAS,EACT,QAAQ,EACR,OAAO,EACP,OAAO,EAAE,WAAW,EACpB,cAAc,EACd,SAAS,EACT,KAAK,GACN,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CA8FhC"}
|
|
@@ -3,13 +3,14 @@ import { Radio, Stack } from "@mantine/core";
|
|
|
3
3
|
import classes from "./controls.module.css";
|
|
4
4
|
import { POPOVER_ROW_HIT_GAP, useFilterRegistration, useFilterSurface } from "./filter-context.js";
|
|
5
5
|
import { FilterClearButton, FilterPill } from "./filter-pill.js";
|
|
6
|
-
import { useControlName } from "./
|
|
6
|
+
import { useControlName } from "./control-name.js";
|
|
7
7
|
import { PanelChoice, PanelRow } from "./panel-row.js";
|
|
8
8
|
function EnumFilter({
|
|
9
9
|
field,
|
|
10
10
|
label,
|
|
11
11
|
icon,
|
|
12
12
|
clearable,
|
|
13
|
+
disabled,
|
|
13
14
|
numeric,
|
|
14
15
|
options: optionsProp,
|
|
15
16
|
unmatchedLabel,
|
|
@@ -19,9 +20,10 @@ function EnumFilter({
|
|
|
19
20
|
const [value, setValue] = field.use();
|
|
20
21
|
const surface = useFilterSurface();
|
|
21
22
|
const isDefault = field.isDefault(value);
|
|
22
|
-
|
|
23
|
+
const clearFilter = () => {
|
|
23
24
|
field.clear();
|
|
24
|
-
}
|
|
25
|
+
};
|
|
26
|
+
useFilterRegistration(!isDefault, clearFilter);
|
|
25
27
|
const options = optionsProp ?? field.options;
|
|
26
28
|
const selected = options.find((option) => option.value === value);
|
|
27
29
|
const inSheet = surface === "sheet";
|
|
@@ -42,6 +44,7 @@ function EnumFilter({
|
|
|
42
44
|
value,
|
|
43
45
|
options,
|
|
44
46
|
...numeric === true && { numeric: true },
|
|
47
|
+
...disabled === true && { disabled: true },
|
|
45
48
|
onChange: (next) => {
|
|
46
49
|
setValue(next);
|
|
47
50
|
}
|
|
@@ -76,7 +79,7 @@ function EnumFilter({
|
|
|
76
79
|
},
|
|
77
80
|
option.value
|
|
78
81
|
)) }),
|
|
79
|
-
clearable === true && !isDefault && /* @__PURE__ */ jsx(FilterClearButton, { onClear:
|
|
82
|
+
clearable === true && !isDefault && /* @__PURE__ */ jsx(FilterClearButton, { onClear: clearFilter })
|
|
80
83
|
]
|
|
81
84
|
}
|
|
82
85
|
)
|
|
@@ -87,6 +90,7 @@ function EnumFilter({
|
|
|
87
90
|
label: selected?.label ?? unmatchedLabel ?? label,
|
|
88
91
|
active: !isDefault,
|
|
89
92
|
...numeric === true && { numeric: true },
|
|
93
|
+
...disabled === true && { disabled: true },
|
|
90
94
|
...icon !== void 0 && { icon },
|
|
91
95
|
...className !== void 0 && { className },
|
|
92
96
|
...style !== void 0 && { style },
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prop and option shapes every filter shares (`docs/CONTROLS-SPEC.md` §3). INTERNAL — the
|
|
3
|
+
* filters re-state their own props from these, so a new member lands on the whole family at once.
|
|
4
|
+
*/
|
|
5
|
+
import type { ReactNode } from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* What every filter takes besides its `field`. A filter picks the members that mean something to it
|
|
8
|
+
* (`Omit<FilterBase, 'clearable'>` for a toggle) and tightens `label` to required where no sensible
|
|
9
|
+
* default exists — a store field declares no name of its own, only its VALUES' labels.
|
|
10
|
+
*/
|
|
11
|
+
export type FilterBase = {
|
|
12
|
+
/** The popover/sheet heading and the accessible name — never the pill text, which reads the VALUE. */
|
|
13
|
+
readonly label?: string;
|
|
14
|
+
/** Leading pill icon. */
|
|
15
|
+
readonly icon?: ReactNode;
|
|
16
|
+
/** Adds a `Clear` action that clears the field — the same `field.clear()` `Reset all` calls. */
|
|
17
|
+
readonly clearable?: boolean;
|
|
18
|
+
/** Renders the control inert: a pill that will not open, a row that will not edit. */
|
|
19
|
+
readonly disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* One row of any option list. `disabled` renders the row and refuses the selection — a live
|
|
23
|
+
* catalogue cannot leave an archived value out, because rows already pointing at it still label it.
|
|
24
|
+
*/
|
|
25
|
+
export type FilterOption<V extends string | number = string> = {
|
|
26
|
+
readonly value: V;
|
|
27
|
+
readonly label: string;
|
|
28
|
+
readonly disabled?: boolean;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=filter-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-base.d.ts","sourceRoot":"","sources":["../../src/controls/filter-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,sGAAsG;IACtG,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,yBAAyB;IACzB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,gGAAgG;IAChG,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI;IAC7D,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;IACjB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA"}
|
|
File without changes
|
|
@@ -19,12 +19,14 @@ export type FilterPillProps = BasaltProps & {
|
|
|
19
19
|
* where `aria-expanded` (which Mantine's `Popover.Target` supplies) is the correct state.
|
|
20
20
|
*/
|
|
21
21
|
readonly pressed?: boolean;
|
|
22
|
+
/** Inert: the pill cannot be pressed, so its popover never opens. */
|
|
23
|
+
readonly disabled?: boolean;
|
|
22
24
|
/** Set by `FilterSet` on its own fold/sheet pills; a filter never passes either of these. */
|
|
23
25
|
readonly hideGlyph?: boolean;
|
|
24
26
|
/** `data-shown` — the CSS hook that reveals the `+N` fold pill once folding is needed. */
|
|
25
27
|
readonly shown?: boolean;
|
|
26
28
|
};
|
|
27
|
-
export declare function FilterPill({ label, icon, active, numeric, children, onClick, ariaLabel, pressed, className, style, hideGlyph, shown, }: FilterPillProps): ReactNode;
|
|
29
|
+
export declare function FilterPill({ label, icon, active, numeric, children, onClick, ariaLabel, pressed, disabled, className, style, hideGlyph, shown, }: FilterPillProps): ReactNode;
|
|
28
30
|
/**
|
|
29
31
|
* The popover's `Clear` — one button for `EnumFilter`, `NumberFilter` and `MultiSelectFilter`. Its
|
|
30
32
|
* mousedown keeps focus where it is: a stepper commits its draft on blur, so a press that blurred
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-pill.d.ts","sourceRoot":"","sources":["../../src/controls/filter-pill.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,iGAAiG;IACjG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;sFACkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,SAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,
|
|
1
|
+
{"version":3,"file":"filter-pill.d.ts","sourceRoot":"","sources":["../../src/controls/filter-pill.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAKlD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAA;IACzB,iGAAiG;IACjG,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;sFACkF;IAClF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAC3B,6FAA6F;IAC7F,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,0FAA0F;IAC1F,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,IAAI,EACJ,MAAM,EACN,OAAO,EACP,QAAQ,EACR,OAAO,EACP,SAAS,EACT,OAAO,EACP,QAAQ,EACR,SAAS,EACT,KAAK,EACL,SAAS,EACT,KAAK,GACN,EAAE,eAAe,GAAG,SAAS,CA8D7B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,GAAG,SAAS,CAa1F"}
|
|
@@ -14,6 +14,7 @@ function FilterPill({
|
|
|
14
14
|
onClick,
|
|
15
15
|
ariaLabel,
|
|
16
16
|
pressed,
|
|
17
|
+
disabled,
|
|
17
18
|
className,
|
|
18
19
|
style,
|
|
19
20
|
hideGlyph,
|
|
@@ -34,6 +35,7 @@ function FilterPill({
|
|
|
34
35
|
...ariaLabel !== void 0 && { "aria-label": ariaLabel },
|
|
35
36
|
...pressed !== void 0 && children === void 0 && { "aria-pressed": pressed },
|
|
36
37
|
...shown === true && { "data-shown": true },
|
|
38
|
+
...disabled === true && { disabled: true },
|
|
37
39
|
...icon !== void 0 && {
|
|
38
40
|
// `IconSlot` owns the 16px box and the optical centring; `.pillIcon` adds only the pill's
|
|
39
41
|
// muted-then-ink colour law. A consumer's glyph can no longer set this row's height.
|
|
@@ -22,36 +22,4 @@ export type FilterSheetProps = BasaltProps & {
|
|
|
22
22
|
* it, a header does not (`docs/CONTROLS-SPEC.md` §2.1: hairlines between OPTION rows only).
|
|
23
23
|
*/
|
|
24
24
|
export declare function FilterSheet({ opened, onClose, onResetAll, title, children, className, style, }: FilterSheetProps): ReactNode;
|
|
25
|
-
/**
|
|
26
|
-
* The selected-row mark — 16px, drawn at the row's trailing edge (`docs/CONTROLS-SPEC.md` §2.1).
|
|
27
|
-
* Exported from the MODULE, not from `./index.ts`: the panel surface's facet list draws the same
|
|
28
|
-
* mark at the same edge, and two hand-drawn checks would drift.
|
|
29
|
-
*/
|
|
30
|
-
export declare function CheckGlyph(): ReactNode;
|
|
31
|
-
/**
|
|
32
|
-
* Names a control that has no VISIBLE Mantine `label`, and does it differently per surface — which
|
|
33
|
-
* is the whole reason this is one helper instead of an `aria-label` sprinkled per call site.
|
|
34
|
-
*
|
|
35
|
-
* In the SHEET and the PANEL the visible `PanelRow` heading is right there, so the control points
|
|
36
|
-
* at it (`aria-labelledby`) and the heading stops being decoration. In the PILL surface there is no
|
|
37
|
-
* visible name to point at — the pill text is the VALUE (`EUR`, `30d`, `3 channels`) — so the
|
|
38
|
-
* control carries the filter's own name instead. Either way the announced name is what is being
|
|
39
|
-
* filtered, not what it currently holds.
|
|
40
|
-
*
|
|
41
|
-
* The id is generated by the CONTROL, not by `PanelRow`, because the control renders its own
|
|
42
|
-
* `PanelRow`: an id published downward through context could never reach the sibling that needs it.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* const { labelId, nameProps } = useControlName(label, inSheet || inPanel)
|
|
46
|
-
* <Radio.Group {...nameProps} …/>
|
|
47
|
-
* // and, in the sheet/panel branch: <PanelRow label={label} labelId={labelId}>…</PanelRow>
|
|
48
|
-
*/
|
|
49
|
-
export declare function useControlName(label: string, named: boolean): {
|
|
50
|
-
labelId: string;
|
|
51
|
-
nameProps: {
|
|
52
|
-
'aria-labelledby': string;
|
|
53
|
-
} | {
|
|
54
|
-
'aria-label': string;
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
25
|
//# sourceMappingURL=filter-sheet.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-sheet.d.ts","sourceRoot":"","sources":["../../src/controls/filter-sheet.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"filter-sheet.d.ts","sourceRoot":"","sources":["../../src/controls/filter-sheet.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAGlD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC7B,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,OAAO,EACP,UAAU,EACV,KAAiB,EACjB,QAAQ,EACR,SAAS,EACT,KAAK,GACN,EAAE,gBAAgB,GAAG,SAAS,CAwB9B"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Button, Drawer } from "@mantine/core";
|
|
3
|
-
import { useId } from "react";
|
|
4
3
|
import classes from "./controls.module.css";
|
|
5
4
|
function FilterSheet({
|
|
6
5
|
opened,
|
|
@@ -29,32 +28,6 @@ function FilterSheet({
|
|
|
29
28
|
}
|
|
30
29
|
);
|
|
31
30
|
}
|
|
32
|
-
function CheckGlyph() {
|
|
33
|
-
return /* @__PURE__ */ jsx(
|
|
34
|
-
"svg",
|
|
35
|
-
{
|
|
36
|
-
width: 16,
|
|
37
|
-
height: 16,
|
|
38
|
-
viewBox: "0 0 24 24",
|
|
39
|
-
fill: "none",
|
|
40
|
-
stroke: "currentColor",
|
|
41
|
-
strokeWidth: 2.25,
|
|
42
|
-
strokeLinecap: "round",
|
|
43
|
-
strokeLinejoin: "round",
|
|
44
|
-
"aria-hidden": true,
|
|
45
|
-
children: /* @__PURE__ */ jsx("path", { d: "M5 12.5l5 5l9 -11" })
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
function useControlName(label, named) {
|
|
50
|
-
const labelId = useId();
|
|
51
|
-
return {
|
|
52
|
-
labelId,
|
|
53
|
-
nameProps: named ? { "aria-labelledby": labelId } : { "aria-label": label }
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
31
|
export {
|
|
57
|
-
|
|
58
|
-
FilterSheet,
|
|
59
|
-
useControlName
|
|
32
|
+
FilterSheet
|
|
60
33
|
};
|
|
@@ -22,4 +22,16 @@ export declare function FunnelGlyph(): ReactNode;
|
|
|
22
22
|
* and shifted with the font stack; the path is centred in its own box.
|
|
23
23
|
*/
|
|
24
24
|
export declare function UpDownGlyph(): ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* The selected-row mark — 16px, drawn at the row's trailing edge (`docs/CONTROLS-SPEC.md` §2.1).
|
|
27
|
+
* Shared by the facet list and any other row that marks a selection at its trailing edge, so two
|
|
28
|
+
* hand-drawn checks cannot drift.
|
|
29
|
+
*/
|
|
30
|
+
export declare function CheckGlyph(): ReactNode;
|
|
31
|
+
/** `SearchFilter`'s leading icon. */
|
|
32
|
+
export declare function SearchGlyph(): ReactNode;
|
|
33
|
+
/** `SyncButton`'s icon; the caller owns the spin class, which lives in its own stylesheet. */
|
|
34
|
+
export declare function RefreshGlyph({ className }: {
|
|
35
|
+
className?: string | undefined;
|
|
36
|
+
}): ReactNode;
|
|
25
37
|
//# sourceMappingURL=glyphs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../../src/controls/glyphs.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"glyphs.d.ts","sourceRoot":"","sources":["../../src/controls/glyphs.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAmCtC,4CAA4C;AAC5C,wBAAgB,aAAa,IAAI,SAAS,CASzC;AAED,oDAAoD;AACpD,wBAAgB,WAAW,IAAI,SAAS,CAMvC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAOvC;AAED;;;;GAIG;AACH,wBAAgB,UAAU,IAAI,SAAS,CAMtC;AAED,qCAAqC;AACrC,wBAAgB,WAAW,IAAI,SAAS,CAOvC;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,GAAG,SAAS,CAMzF"}
|
package/dist/controls/glyphs.js
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
const ICON_SIZE = 16;
|
|
3
3
|
const AFFORDANCE_SIZE = 14;
|
|
4
|
-
function Stroke({
|
|
4
|
+
function Stroke({
|
|
5
|
+
size = ICON_SIZE,
|
|
6
|
+
strokeWidth = 1.75,
|
|
7
|
+
className,
|
|
8
|
+
children
|
|
9
|
+
}) {
|
|
5
10
|
return /* @__PURE__ */ jsx(
|
|
6
11
|
"svg",
|
|
7
12
|
{
|
|
@@ -10,7 +15,8 @@ function Stroke({ size = ICON_SIZE, children }) {
|
|
|
10
15
|
viewBox: "0 0 24 24",
|
|
11
16
|
fill: "none",
|
|
12
17
|
stroke: "currentColor",
|
|
13
|
-
strokeWidth
|
|
18
|
+
strokeWidth,
|
|
19
|
+
...className !== void 0 && { className },
|
|
14
20
|
strokeLinecap: "round",
|
|
15
21
|
strokeLinejoin: "round",
|
|
16
22
|
"aria-hidden": true,
|
|
@@ -35,8 +41,23 @@ function UpDownGlyph() {
|
|
|
35
41
|
/* @__PURE__ */ jsx("path", { d: "M8 15l4 4l4 -4" })
|
|
36
42
|
] });
|
|
37
43
|
}
|
|
44
|
+
function CheckGlyph() {
|
|
45
|
+
return /* @__PURE__ */ jsx(Stroke, { strokeWidth: 2.25, children: /* @__PURE__ */ jsx("path", { d: "M5 12.5l5 5l9 -11" }) });
|
|
46
|
+
}
|
|
47
|
+
function SearchGlyph() {
|
|
48
|
+
return /* @__PURE__ */ jsxs(Stroke, { strokeWidth: 2, children: [
|
|
49
|
+
/* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "7" }),
|
|
50
|
+
/* @__PURE__ */ jsx("path", { d: "M21 21l-4.35 -4.35" })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
function RefreshGlyph({ className }) {
|
|
54
|
+
return /* @__PURE__ */ jsx(Stroke, { strokeWidth: 2, className, children: /* @__PURE__ */ jsx("path", { d: "M20 11a8 8 0 1 0-2.34 5.66M20 5v6h-6" }) });
|
|
55
|
+
}
|
|
38
56
|
export {
|
|
39
57
|
CalendarGlyph,
|
|
58
|
+
CheckGlyph,
|
|
40
59
|
FunnelGlyph,
|
|
60
|
+
RefreshGlyph,
|
|
61
|
+
SearchGlyph,
|
|
41
62
|
UpDownGlyph
|
|
42
63
|
};
|
package/dist/controls/index.d.ts
CHANGED
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
export { type BarAction, type GlobalAction } from './actions.js';
|
|
8
8
|
export { SyncButton } from './sync-button.js';
|
|
9
9
|
export { FilterSet } from './filter-set.js';
|
|
10
|
-
export { RangeFilter } from './range-filter.js';
|
|
10
|
+
export { RangeFilter, type RangeCustomPickerProps } from './range-filter.js';
|
|
11
11
|
export { SelectFilter } from './select-filter.js';
|
|
12
12
|
export { MultiSelectFilter } from './multi-select-filter.js';
|
|
13
13
|
export { NumberFilter } from './number-filter.js';
|
|
14
14
|
export { SearchFilter } from './search-filter.js';
|
|
15
15
|
export { ToggleFilter } from './toggle-filter.js';
|
|
16
16
|
export { ViewTabs } from './view-tabs.js';
|
|
17
|
+
export type { FilterOption } from './filter-base.js';
|
|
17
18
|
export { FormRow, FormGroup } from './form-layout.js';
|
|
18
19
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controls/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/controls/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAI1C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,KAAK,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { FieldHandle } from '../state.js';
|
|
3
3
|
import type { MultiField } from '../state/fields.js';
|
|
4
|
-
import type { FilterOption } from './
|
|
4
|
+
import type { FilterBase, FilterOption } from './filter-base.js';
|
|
5
5
|
import type { UncontrolledProps } from './uncontrolled.js';
|
|
6
|
-
export type MultiSelectFilterProps<T extends string> = UncontrolledProps & {
|
|
6
|
+
export type MultiSelectFilterProps<T extends string> = UncontrolledProps & FilterBase & {
|
|
7
7
|
readonly field: FieldHandle<MultiField<T>>;
|
|
8
8
|
readonly label: string;
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Adds a `Clear` action to the popover. Multi has always shown one.
|
|
11
|
+
*
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
readonly clearable?: boolean;
|
|
10
15
|
/**
|
|
11
16
|
* The plural noun in the `3 channels` count.
|
|
12
17
|
*
|