@godxjp/ui 30.7.0 → 30.7.1
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 +16 -3
- package/agent/START-HERE.md +1 -1
- package/agent/components/RecordPicker.json +1 -1
- package/agent/components.json +1 -1
- package/agent/index.json +2 -2
- package/agent/llms.txt +3 -3
- package/agent/rules.json +1 -1
- package/dist/app/app-provider.js +1 -5
- package/dist/app/timezones.d.ts +15 -0
- package/dist/app/timezones.js +5 -0
- package/dist/components/data-entry/record-picker.d.ts +26 -0
- package/dist/components/data-entry/record-picker.js +16 -12
- package/dist/contracts/measurement.json +1 -1
- package/dist/lib/datetime/sync.d.ts +1 -1
- package/dist/lib/datetime/sync.js +8 -7
- package/dist/props/components/data-entry.prop.d.ts +9 -1
- package/dist/styles/navigation-layout.css +10 -0
- package/dist/styles/table-layout.css +47 -33
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -160,9 +160,22 @@ The framework ships colors, the type scale, the wa-iro palette, and (opt-in) bun
|
|
|
160
160
|
@source "../views";
|
|
161
161
|
```
|
|
162
162
|
|
|
163
|
-
###
|
|
164
|
-
|
|
165
|
-
`@godxjp/ui/styles` is the zero-config all-in-one
|
|
163
|
+
### Where the CSS weight actually is — the font faces, not the components
|
|
164
|
+
|
|
165
|
+
`@godxjp/ui/styles` is the zero-config all-in-one: every component's layers **plus 729 `@font-face`
|
|
166
|
+
declarations** for the bundled CJK faces. Those declarations are render-blocking CSS on every page,
|
|
167
|
+
separate from the font FILES (which load lazily, per glyph range). Measured on a fresh Vite 8 +
|
|
168
|
+
Tailwind v4 app using 15 components (gh#971):
|
|
169
|
+
|
|
170
|
+
| entry | CSS emitted | gzip |
|
|
171
|
+
| ------------------------ | ----------- | ---------- |
|
|
172
|
+
| `@godxjp/ui/styles` | 1,303,803 B | **367 KB** |
|
|
173
|
+
| `@godxjp/ui/styles/core` | 581,210 B | **86 KB** |
|
|
174
|
+
|
|
175
|
+
So if CSS weight matters, **the one change that moves it is the import line** — 77% of it is the face
|
|
176
|
+
declarations. `core` is not a per-component slice: it still carries every component's layers (about
|
|
177
|
+
64 KB gzip for all ~165), it only drops the faces. Load fonts another way (next/font, a system stack,
|
|
178
|
+
your own `@font-face`) and take the same layers without them:
|
|
166
179
|
|
|
167
180
|
```css
|
|
168
181
|
@import "@godxjp/ui/styles/core"; /* every component layer, no @font-face */
|
package/agent/START-HERE.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
You are about to write code against a design system you did not author. This file is the whole
|
|
4
4
|
contract. Read it before you write JSX.
|
|
5
5
|
|
|
6
|
-
**This catalog describes `@godxjp/ui` 30.7.
|
|
6
|
+
**This catalog describes `@godxjp/ui` 30.7.1.** If the project you are editing has a different
|
|
7
7
|
version in its `package.json`, read the pinned catalog for THAT version instead
|
|
8
8
|
(`…/v<their-version>/agent/…`). A catalog newer than the installed package describes props that do
|
|
9
9
|
not exist yet; older, and it hides props that do. Neither failure announces itself.
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"type": "(SearchSelectOptionProp | SelectOptionGroupProp)[]"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
"description": "Server fetcher, debounced, and it runs on BOTH branches — a picker whose `count` is small still fetches from the server rather than showing an empty dropdown (gh#942). `filters` carries YOUR OWN vocabulary back (the `name` of each declared filter), so the server reads the keys it already understands instead of a shape this component invented; the dropdown branch draws no filters, so it passes an empty object. Return `nextCursor` to page: the dialog shows a Load more button and APPENDS, so nothing the user already scrolled past is lost.",
|
|
36
|
+
"description": "Server fetcher, debounced, and it runs on BOTH branches — a picker whose `count` is small still fetches from the server rather than showing an empty dropdown (gh#942). `filters` carries YOUR OWN vocabulary back (the `name` of each declared filter), so the server reads the keys it already understands instead of a shape this component invented; the dropdown branch draws no filters, so it passes an empty object. Return `nextCursor` to page: the dialog shows a Load more button and APPENDS, so nothing the user already scrolled past is lost. `cursor` is EXACTLY the `nextCursor` your previous response returned for the same `query` (undefined on the first page) — the same in all three shapes, dropdown included; an offset or an opaque token both work. Before gh#964 the dropdown sent the page NUMBER instead, so an offset server read \"2\" as offset 2 and returned duplicate rows; if you worked around that, remove the workaround.",
|
|
37
37
|
"name": "loadOptions",
|
|
38
38
|
"type": "(params: { query: string; filters: Record<string, string>; cursor?: string }) => Promise<{ options: SearchSelectOptionProp[]; count?: number; nextCursor?: string }>"
|
|
39
39
|
},
|
package/agent/components.json
CHANGED
|
@@ -6019,7 +6019,7 @@
|
|
|
6019
6019
|
"type": "(SearchSelectOptionProp | SelectOptionGroupProp)[]"
|
|
6020
6020
|
},
|
|
6021
6021
|
{
|
|
6022
|
-
"description": "Server fetcher, debounced, and it runs on BOTH branches — a picker whose `count` is small still fetches from the server rather than showing an empty dropdown (gh#942). `filters` carries YOUR OWN vocabulary back (the `name` of each declared filter), so the server reads the keys it already understands instead of a shape this component invented; the dropdown branch draws no filters, so it passes an empty object. Return `nextCursor` to page: the dialog shows a Load more button and APPENDS, so nothing the user already scrolled past is lost.",
|
|
6022
|
+
"description": "Server fetcher, debounced, and it runs on BOTH branches — a picker whose `count` is small still fetches from the server rather than showing an empty dropdown (gh#942). `filters` carries YOUR OWN vocabulary back (the `name` of each declared filter), so the server reads the keys it already understands instead of a shape this component invented; the dropdown branch draws no filters, so it passes an empty object. Return `nextCursor` to page: the dialog shows a Load more button and APPENDS, so nothing the user already scrolled past is lost. `cursor` is EXACTLY the `nextCursor` your previous response returned for the same `query` (undefined on the first page) — the same in all three shapes, dropdown included; an offset or an opaque token both work. Before gh#964 the dropdown sent the page NUMBER instead, so an offset server read \"2\" as offset 2 and returned duplicate rows; if you worked around that, remove the workaround.",
|
|
6023
6023
|
"name": "loadOptions",
|
|
6024
6024
|
"type": "(params: { query: string; filters: Record<string, string>; cursor?: string }) => Promise<{ options: SearchSelectOptionProp[]; count?: number; nextCursor?: string }>"
|
|
6025
6025
|
},
|
package/agent/index.json
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"note": "Pin to the tag that matches the @godxjp/ui version you installed. A catalog newer than your package describes props you do not have; older, and it hides props you do.",
|
|
49
49
|
"read": {
|
|
50
50
|
"live": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/index.json",
|
|
51
|
-
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v30.7.
|
|
51
|
+
"pinned": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/v30.7.1/agent/index.json"
|
|
52
52
|
},
|
|
53
53
|
"source": "mcp/src/data — the same data @godxjp/ui-mcp serves — plus the foundation and semantic token tiers, read from src/tokens/*.css",
|
|
54
54
|
"start": "https://raw.githubusercontent.com/godx-jp/godxjp-ui/main/agent/START-HERE.md",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"foundation": "the seeds a consumer is invited to set — --primary, --background, --radius",
|
|
63
63
|
"semantic": "named roles that follow the seeds — --ring, --text-link, --overlay-background"
|
|
64
64
|
},
|
|
65
|
-
"version": "30.7.
|
|
65
|
+
"version": "30.7.1"
|
|
66
66
|
}
|
package/agent/llms.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @godxjp/ui
|
|
2
2
|
|
|
3
3
|
> A Japanese-enterprise React design system: 175 components, 2074 design tokens,
|
|
4
|
-
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.7.
|
|
4
|
+
> 50 cardinal rules. This file is the entry point for AI agents. Catalog version 30.7.1.
|
|
5
5
|
|
|
6
6
|
If your client can run a process, do not read these files — run the MCP server instead
|
|
7
|
-
(`npx @godxjp/ui-mcp@30.7.
|
|
7
|
+
(`npx @godxjp/ui-mcp@30.7.1`). It is searchable and version-locked. These files exist for agents
|
|
8
8
|
that can only fetch URLs.
|
|
9
9
|
|
|
10
10
|
## Start
|
|
@@ -26,7 +26,7 @@ that can only fetch URLs.
|
|
|
26
26
|
## Pinning
|
|
27
27
|
|
|
28
28
|
Every URL above tracks `main`. To pin to the release a project actually installed, swap `main` for
|
|
29
|
-
the tag: `.../godx-jp/godxjp-ui/v30.7.
|
|
29
|
+
the tag: `.../godx-jp/godxjp-ui/v30.7.1/agent/...`. A catalog that does not match the installed
|
|
30
30
|
package describes props that are absent, or hides props that are present, and says nothing either way.
|
|
31
31
|
|
|
32
32
|
Pinned catalogs only exist for releases whose tag actually contains `agent/`. If `…/v<version>/agent/index.json` returns 404, that release predates this catalog: read `…/main/…` instead and compare `index.json` → `version` against the package you have, so you at least know which way it drifted.
|
package/agent/rules.json
CHANGED
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
"title": "Long text columns get an explicit width"
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
|
-
"body": "Author and verify every page at 320–390px FIRST. Page sections are spaced by `PageContainer` itself (`--page-body-gap` between its direct children). Inside a section spacing comes only from `Flex` `gap` (vertical rhythm = `Flex direction=\"col\"`, control rows = the default `direction=\"row\"`) + `ResponsiveGrid columns={2|3|4}` (which collapse to a single column on narrow screens) — never raw `p-*` / `gap-*` / `space-*` utilities for page layout (the static audit rejects them). Styles are loaded whole: `@godxjp/ui/styles` or `styles/core`, never a hand-picked set of layers.",
|
|
198
|
+
"body": "Author and verify every page at 320–390px FIRST. Page sections are spaced by `PageContainer` itself (`--page-body-gap` between its direct children). Inside a section spacing comes only from `Flex` `gap` (vertical rhythm = `Flex direction=\"col\"`, control rows = the default `direction=\"row\"`) + `ResponsiveGrid columns={2|3|4}` (which collapse to a single column on narrow screens) — never raw `p-*` / `gap-*` / `space-*` utilities for page layout (the static audit rejects them). Styles are loaded whole: `@godxjp/ui/styles` or `styles/core`, never a hand-picked set of layers. They differ ONLY in the 729 bundled CJK `@font-face` declarations, and that difference is most of the CSS: 367 KB vs 86 KB gzip for a 15-component app (gh#971) — pick `styles/core` whenever the app loads fonts another way.",
|
|
199
199
|
"number": 40,
|
|
200
200
|
"title": "Pages are mobile-first"
|
|
201
201
|
},
|
package/dist/app/app-provider.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
PREFERS_DARK_SCHEME_QUERY
|
|
28
28
|
} from "./theme-axes.js";
|
|
29
29
|
import { resolveDefaultTimeFormat } from "./time-format-labels.js";
|
|
30
|
-
import { resolveDefaultTimezone } from "./timezones.js";
|
|
30
|
+
import { resolveDefaultTimezone, resolveHydrationSafeTimezone } from "./timezones.js";
|
|
31
31
|
import {
|
|
32
32
|
APP_REQUEST_HEADER_DATE_FORMAT,
|
|
33
33
|
APP_REQUEST_HEADER_LOCALE,
|
|
@@ -53,10 +53,6 @@ function buildRequestHeaders(locale, timezone, timeFormat, dateFormat) {
|
|
|
53
53
|
[APP_REQUEST_HEADER_DATE_FORMAT]: dateFormat
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function resolveHydrationSafeTimezone(defaultTimezone, systemTimezone) {
|
|
57
|
-
if (defaultTimezone === "browser") return systemTimezone ?? "UTC";
|
|
58
|
-
return resolveDefaultTimezone(defaultTimezone, systemTimezone);
|
|
59
|
-
}
|
|
60
56
|
function AppProvider({
|
|
61
57
|
children,
|
|
62
58
|
defaultLocale = "vi",
|
package/dist/app/timezones.d.ts
CHANGED
|
@@ -24,5 +24,20 @@ export declare function getTimezoneOffsetLabel(timezone: string, locale?: AppLoc
|
|
|
24
24
|
export declare function formatTimezoneDisplayLabel(timezone: string, locale?: AppLocale): string;
|
|
25
25
|
export declare function getTimezoneLabel(timezone: string, locale: AppLocale, fallbackLocale?: AppLocale): string;
|
|
26
26
|
export declare function resolveDefaultTimezone(defaultTimezone: "browser" | "system" | (string & {}), systemTimezone?: string): string;
|
|
27
|
+
/**
|
|
28
|
+
* The timezone to use BEFORE the browser's is known — the first render, and anything that formats
|
|
29
|
+
* before AppProvider has synced (gh#968).
|
|
30
|
+
*
|
|
31
|
+
* `"browser"` answers UTC here, not the browser's zone: a server cannot know the browser's zone, so
|
|
32
|
+
* resolving it on the first render would render one time on the server and another on the client.
|
|
33
|
+
* AppProvider settles to the real browser zone in an effect afterwards.
|
|
34
|
+
*
|
|
35
|
+
* It lives here, not inside AppProvider, so the module-level datetime fallback (`lib/datetime/sync`)
|
|
36
|
+
* can call the SAME function. Before gh#968 that fallback hard-coded `Asia/Ho_Chi_Minh` while this
|
|
37
|
+
* answered UTC — two different answers to "nothing is configured yet". The Vietnamese one was the
|
|
38
|
+
* worse of the two because it looks right: a JST attendance timestamp read 2 hours off, and nothing
|
|
39
|
+
* about `01/05/2026 14:30` says so. UTC is at least visibly not the user's local time.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveHydrationSafeTimezone(defaultTimezone: "browser" | "system" | (string & {}), systemTimezone?: string): string;
|
|
27
42
|
/** Vitest only — reset cached IANA list between cases. */
|
|
28
43
|
export declare function resetIanaTimezoneCacheForTests(): void;
|
package/dist/app/timezones.js
CHANGED
|
@@ -141,6 +141,10 @@ function resolveDefaultTimezone(defaultTimezone, systemTimezone) {
|
|
|
141
141
|
if (defaultTimezone === "system") return systemTimezone ?? "UTC";
|
|
142
142
|
return defaultTimezone;
|
|
143
143
|
}
|
|
144
|
+
function resolveHydrationSafeTimezone(defaultTimezone, systemTimezone) {
|
|
145
|
+
if (defaultTimezone === "browser") return systemTimezone ?? "UTC";
|
|
146
|
+
return resolveDefaultTimezone(defaultTimezone, systemTimezone);
|
|
147
|
+
}
|
|
144
148
|
function resetIanaTimezoneCacheForTests() {
|
|
145
149
|
cachedAllTimezones = null;
|
|
146
150
|
cachedTimezoneSet = null;
|
|
@@ -157,6 +161,7 @@ export {
|
|
|
157
161
|
isValidIanaTimezone,
|
|
158
162
|
resetIanaTimezoneCacheForTests,
|
|
159
163
|
resolveDefaultTimezone,
|
|
164
|
+
resolveHydrationSafeTimezone,
|
|
160
165
|
resolveTimezoneForIntl,
|
|
161
166
|
resolveTimezonePickerOptions
|
|
162
167
|
};
|
|
@@ -33,6 +33,32 @@ export type { RecordPickerProp, RecordPickerProp as RecordPickerProps };
|
|
|
33
33
|
* hands over the labels it already has, and it is merged ahead of whatever loads later, so a chip
|
|
34
34
|
* never renders as a raw id and never disappears when the query changes.
|
|
35
35
|
*/
|
|
36
|
+
/**
|
|
37
|
+
* Adapt RecordPicker's cursor contract to Select's page-numbered loader (gh#964).
|
|
38
|
+
*
|
|
39
|
+
* `loadOptions` is typed to receive the `nextCursor` the server returned last time — an offset, an
|
|
40
|
+
* opaque token, whatever the server minted. The inline and dialog shapes pass it straight back.
|
|
41
|
+
* This adapter used to pass `String(page)` instead, so page 2 reached the server as "2" and a
|
|
42
|
+
* consumer implementing the type as written read it as offset 2: duplicated and missing rows, with
|
|
43
|
+
* no error. The server's `nextCursor` was used only as a has-more flag.
|
|
44
|
+
*
|
|
45
|
+
* Select asks for pages by number, so the adapter remembers, per query, which cursor fetches which
|
|
46
|
+
* page: page 1 has none, and page N+1 is whatever page N's response said. A new query starts its
|
|
47
|
+
* own chain, so one query's cursor can never be sent with another's text — a user typing,
|
|
48
|
+
* deleting and retyping can make Select ask for page 2 of an earlier query after a later one began.
|
|
49
|
+
*
|
|
50
|
+
* The chains live in this closure, so they are discarded whenever `loadOptions` itself changes
|
|
51
|
+
* (the caller memoises on it): a cursor minted by one data source is meaningless to the next.
|
|
52
|
+
*
|
|
53
|
+
* @internal Exported for tests only; the package barrel re-exports RecordPicker by name, not this.
|
|
54
|
+
*/
|
|
55
|
+
export declare function selectLoadOptionsFor(loadOptions: RecordPickerProp["loadOptions"]): (({ query, page }: {
|
|
56
|
+
query: string;
|
|
57
|
+
page: number;
|
|
58
|
+
}) => Promise<{
|
|
59
|
+
options: SearchSelectOptionProp[];
|
|
60
|
+
hasMore: boolean;
|
|
61
|
+
}>) | undefined;
|
|
36
62
|
export declare const RecordPicker: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "defaultValue" | "onChange" | "value"> & {
|
|
37
63
|
mode?: "single" | "multiple";
|
|
38
64
|
shape?: "auto" | "inline";
|
|
@@ -21,6 +21,19 @@ import {
|
|
|
21
21
|
import { Command, CommandGroup } from "./command.js";
|
|
22
22
|
import { Input } from "./input.js";
|
|
23
23
|
import { Select } from "./select.js";
|
|
24
|
+
function selectLoadOptionsFor(loadOptions) {
|
|
25
|
+
if (!loadOptions) return void 0;
|
|
26
|
+
const chains = /* @__PURE__ */ new Map();
|
|
27
|
+
return async ({ query, page }) => {
|
|
28
|
+
if (page === 1) chains.set(query, /* @__PURE__ */ new Map());
|
|
29
|
+
const chain = chains.get(query);
|
|
30
|
+
const cursor = page === 1 ? void 0 : chain?.get(page);
|
|
31
|
+
if (page > 1 && cursor === void 0) return { options: [], hasMore: false };
|
|
32
|
+
const r = await loadOptions({ query, filters: {}, cursor });
|
|
33
|
+
if (r.nextCursor !== void 0) chains.get(query)?.set(page + 1, r.nextCursor);
|
|
34
|
+
return { options: r.options, hasMore: r.nextCursor !== void 0 };
|
|
35
|
+
};
|
|
36
|
+
}
|
|
24
37
|
const RecordPicker = React.forwardRef(
|
|
25
38
|
function RecordPicker2({
|
|
26
39
|
mode = "single",
|
|
@@ -57,17 +70,7 @@ const RecordPicker = React.forwardRef(
|
|
|
57
70
|
},
|
|
58
71
|
[controlled, isMultiple, onValueChange]
|
|
59
72
|
);
|
|
60
|
-
const selectLoadOptions = React.useMemo(
|
|
61
|
-
() => loadOptions ? async ({ query, page }) => {
|
|
62
|
-
const r = await loadOptions({
|
|
63
|
-
query,
|
|
64
|
-
filters: {},
|
|
65
|
-
cursor: page > 1 ? String(page) : void 0
|
|
66
|
-
});
|
|
67
|
-
return { options: r.options, hasMore: r.nextCursor !== void 0 };
|
|
68
|
-
} : void 0,
|
|
69
|
-
[loadOptions]
|
|
70
|
-
);
|
|
73
|
+
const selectLoadOptions = React.useMemo(() => selectLoadOptionsFor(loadOptions), [loadOptions]);
|
|
71
74
|
const staticOptions = React.useMemo(
|
|
72
75
|
() => options ? normalizeSelectOptions(options) : [],
|
|
73
76
|
[options]
|
|
@@ -542,5 +545,6 @@ const DialogPicker = React.forwardRef(function DialogPicker2({
|
|
|
542
545
|
] });
|
|
543
546
|
});
|
|
544
547
|
export {
|
|
545
|
-
RecordPicker
|
|
548
|
+
RecordPicker,
|
|
549
|
+
selectLoadOptionsFor
|
|
546
550
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "AUTO-GENERATED by scripts/gen-measurement-contract.mjs — do not edit. Read this instead of guessing: docs/MEASUREMENT-CONTRACT.md.",
|
|
3
|
-
"version": "30.7.
|
|
3
|
+
"version": "30.7.1",
|
|
4
4
|
"targetSize": {
|
|
5
5
|
"standard": "WCAG 2.2 SC 2.5.8 Target Size (Minimum), level AA — 24×24 CSS px",
|
|
6
6
|
"min": 24,
|
|
@@ -8,7 +8,7 @@ export type DatetimeContext = {
|
|
|
8
8
|
dateFormat: AppDateFormat;
|
|
9
9
|
};
|
|
10
10
|
/** Sync module-level datetime prefs from AppProvider (mirrors syncI18nLocale). */
|
|
11
|
-
export declare function syncDatetimeContext(
|
|
11
|
+
export declare function syncDatetimeContext(prefs: Pick<DatetimeContext, "locale" | "timezone" | "timeFormat" | "dateFormat"> & {
|
|
12
12
|
dateFnsLocale?: Locale;
|
|
13
13
|
}): void;
|
|
14
14
|
export declare function getDatetimeContext(): Readonly<DatetimeContext>;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { getDateFnsLocale } from "../../app/locales.js";
|
|
2
2
|
import { resolveDefaultDateFormat } from "../../app/date-format-labels.js";
|
|
3
|
+
import { resolveHydrationSafeTimezone } from "../../app/timezones.js";
|
|
3
4
|
const DEFAULT_LOCALE = "vi";
|
|
4
5
|
const defaultContext = () => ({
|
|
5
6
|
locale: DEFAULT_LOCALE,
|
|
6
7
|
dateFnsLocale: getDateFnsLocale(DEFAULT_LOCALE),
|
|
7
|
-
timezone: "
|
|
8
|
+
timezone: resolveHydrationSafeTimezone("browser"),
|
|
8
9
|
timeFormat: "24h",
|
|
9
10
|
dateFormat: resolveDefaultDateFormat(DEFAULT_LOCALE)
|
|
10
11
|
});
|
|
11
12
|
let syncedContext = defaultContext();
|
|
12
13
|
let liveRelativeFormattingEnabled = true;
|
|
13
|
-
function syncDatetimeContext(
|
|
14
|
+
function syncDatetimeContext(prefs) {
|
|
14
15
|
syncedContext = {
|
|
15
|
-
locale:
|
|
16
|
-
timezone:
|
|
17
|
-
timeFormat:
|
|
18
|
-
dateFormat:
|
|
19
|
-
dateFnsLocale:
|
|
16
|
+
locale: prefs.locale,
|
|
17
|
+
timezone: prefs.timezone,
|
|
18
|
+
timeFormat: prefs.timeFormat,
|
|
19
|
+
dateFormat: prefs.dateFormat,
|
|
20
|
+
dateFnsLocale: prefs.dateFnsLocale ?? getDateFnsLocale(prefs.locale)
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
function getDatetimeContext() {
|
|
@@ -1170,7 +1170,15 @@ export type RecordPickerProp = Omit<React.ButtonHTMLAttributes<HTMLButtonElement
|
|
|
1170
1170
|
onValueChange?: (value: string | string[] | null) => void;
|
|
1171
1171
|
/** Static rows, client-filtered. Provide this OR `loadOptions`. */
|
|
1172
1172
|
options?: (SearchSelectOptionProp | SelectOptionGroupProp)[];
|
|
1173
|
-
/**
|
|
1173
|
+
/**
|
|
1174
|
+
* Server fetcher. `filters` carries the consumer's own filter vocabulary.
|
|
1175
|
+
*
|
|
1176
|
+
* `cursor` is EXACTLY the `nextCursor` your previous response returned for the same `query` —
|
|
1177
|
+
* an offset, an opaque token, whatever your server minted — and `undefined` for the first page.
|
|
1178
|
+
* The same in every shape: under `threshold` (dropdown), `inline`, and the dialog. Return no
|
|
1179
|
+
* `nextCursor` when the list is finished; that is what ends paging. (Before gh#964 the dropdown
|
|
1180
|
+
* sent the page NUMBER here instead, so an offset-based server read "2" as offset 2.)
|
|
1181
|
+
*/
|
|
1174
1182
|
loadOptions?: (params: {
|
|
1175
1183
|
query: string;
|
|
1176
1184
|
filters: Record<string, string>;
|
|
@@ -52,6 +52,16 @@
|
|
|
52
52
|
border-width: var(--stroke-hairline);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
[data-slot="tabs-list"][data-variant="line"] {
|
|
56
|
+
position: relative;
|
|
57
|
+
z-index: 1;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
[data-slot="tabs"]:has([data-slot="tabs-list"][data-variant="line"])
|
|
61
|
+
> :is([data-slot="tabs-panel"], [data-slot="tabs-content"]) {
|
|
62
|
+
isolation: isolate;
|
|
63
|
+
}
|
|
64
|
+
|
|
55
65
|
[data-slot="tabs-list"][data-variant="line"] [data-slot="tabs-trigger"]::after {
|
|
56
66
|
content: "";
|
|
57
67
|
position: absolute;
|
|
@@ -60,7 +60,8 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
.ui-table-row[data-tone] {
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
--table-row-tone-layer: linear-gradient(
|
|
64
65
|
var(
|
|
65
66
|
--table-row-tone-surface,
|
|
66
67
|
hsl(var(--table-row-tone-color) / var(--table-row-tone-wash-alpha))
|
|
@@ -70,6 +71,7 @@
|
|
|
70
71
|
hsl(var(--table-row-tone-color) / var(--table-row-tone-wash-alpha))
|
|
71
72
|
)
|
|
72
73
|
);
|
|
74
|
+
background-image: var(--table-row-tone-layer);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
:where([data-slot="table"] > tbody > tr:nth-child(even of :not([data-expanded-row]))) {
|
|
@@ -440,48 +442,60 @@
|
|
|
440
442
|
box-shadow: 6px 0 6px -5px hsl(var(--foreground) / 0.12);
|
|
441
443
|
}
|
|
442
444
|
|
|
445
|
+
:where(.ui-table-row[data-tone]) > :is(.ui-data-table-pin-end, .ui-data-table-pin-start) {
|
|
446
|
+
background-image: var(--table-row-tone-layer);
|
|
447
|
+
}
|
|
448
|
+
|
|
443
449
|
:where([data-slot="table"] > tbody > tr:nth-child(even of :not([data-expanded-row])))
|
|
444
450
|
> :is(.ui-data-table-pin-end, .ui-data-table-pin-start) {
|
|
445
|
-
background-image:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
451
|
+
background-image:
|
|
452
|
+
var(--table-row-tone-layer, none),
|
|
453
|
+
linear-gradient(
|
|
454
|
+
color-mix(
|
|
455
|
+
in srgb,
|
|
456
|
+
var(--table-row-striped-background, hsl(var(--muted) / 0.8))
|
|
457
|
+
var(--table-row-striped-alpha),
|
|
458
|
+
transparent
|
|
459
|
+
),
|
|
460
|
+
color-mix(
|
|
461
|
+
in srgb,
|
|
462
|
+
var(--table-row-striped-background, hsl(var(--muted) / 0.8))
|
|
463
|
+
var(--table-row-striped-alpha),
|
|
464
|
+
transparent
|
|
465
|
+
)
|
|
466
|
+
);
|
|
457
467
|
}
|
|
458
468
|
|
|
459
469
|
.ui-data-table-surface tbody tr:hover > .ui-data-table-pin-end,
|
|
460
470
|
.ui-data-table-surface tbody tr:hover > .ui-data-table-pin-start {
|
|
461
|
-
background-image:
|
|
462
|
-
var(
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
+
background-image:
|
|
472
|
+
var(--table-row-tone-layer, none),
|
|
473
|
+
linear-gradient(
|
|
474
|
+
var(
|
|
475
|
+
--table-row-hover-background,
|
|
476
|
+
hsl(var(--accent) / var(--table-row-hover-background-alpha, 0.7))
|
|
477
|
+
),
|
|
478
|
+
var(
|
|
479
|
+
--table-row-hover-background,
|
|
480
|
+
hsl(var(--accent) / var(--table-row-hover-background-alpha, 0.7))
|
|
481
|
+
)
|
|
482
|
+
);
|
|
471
483
|
}
|
|
472
484
|
|
|
473
485
|
.ui-data-table-surface tbody tr[data-state="selected"] > .ui-data-table-pin-end,
|
|
474
486
|
.ui-data-table-surface tbody tr[data-state="selected"] > .ui-data-table-pin-start {
|
|
475
|
-
background-image:
|
|
476
|
-
var(
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
487
|
+
background-image:
|
|
488
|
+
var(--table-row-tone-layer, none),
|
|
489
|
+
linear-gradient(
|
|
490
|
+
var(
|
|
491
|
+
--table-row-selected-background,
|
|
492
|
+
hsl(var(--muted) / var(--table-row-selected-background-alpha, 0.3))
|
|
493
|
+
),
|
|
494
|
+
var(
|
|
495
|
+
--table-row-selected-background,
|
|
496
|
+
hsl(var(--muted) / var(--table-row-selected-background-alpha, 0.3))
|
|
497
|
+
)
|
|
498
|
+
);
|
|
485
499
|
}
|
|
486
500
|
|
|
487
501
|
.ui-data-table-ellipsis {
|