@hezhijie0327/zjdesign 0.1.3 → 0.1.4-45fea8a
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/AGENTS.md +1 -1
- package/DESIGN.md +24 -1
- package/dist/brand/index.d.mts +2 -2
- package/dist/brand/index.mjs +1 -1
- package/dist/hooks/index.d.mts +2 -2
- package/dist/hooks/index.mjs +2 -2
- package/dist/{hooks-_Gk75q-U.mjs → hooks-vpLVB3bc.mjs} +18 -4
- package/dist/{index-B-bZqvO6.d.mts → index-BVN0e41g.d.mts} +7 -3
- package/dist/index.d.mts +186 -18
- package/dist/index.mjs +325 -11
- package/dist/markdown/index.d.mts +121 -0
- package/dist/markdown/index.mjs +334 -0
- package/dist/paper/index.mjs +1 -1
- package/dist/styles/index.mjs +1 -1
- package/dist/tokens/index.css +1 -0
- package/dist/tokens/paper.css +53 -36
- package/dist/tokens/prose.css +182 -0
- package/package.json +46 -12
- /package/dist/{styles-DhIa1Tm9.mjs → styles-DsVothIU.mjs} +0 -0
package/AGENTS.md
CHANGED
|
@@ -150,7 +150,7 @@ pnpm test # vitest run (jsdom)
|
|
|
150
150
|
pnpm dev # vite playground (visual verification, :5199 in docs)
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
Release (OIDC trusted publishing — no NPM_TOKEN secret):
|
|
153
|
+
Release (OIDC trusted publishing — no NPM_TOKEN secret): every push to main that touches the package stamps `X.Y.Z-<sha7>` and publishes; `latest` lands on the newest commit (consumers depend on `latest`). The semver baseline moves via `scripts/bump_version.sh` (Windows: `scripts/bump_version.ps1`), which also prints the release commands. The workflow (release.yml) gates on lint + typecheck + tests + build; the one-time "Trusted Publisher" binding on npmjs.com is repo `hezhijie0327/ZJDesign` + workflow `release.yml` (npm CLI ≥ 11.5.1 via Node 24; provenance automatic). Playground changes do NOT trigger a publish (paths filter).
|
|
154
154
|
|
|
155
155
|
## Conventions
|
|
156
156
|
|
package/DESIGN.md
CHANGED
|
@@ -90,7 +90,30 @@ Class strategy: `html.dark` (+ `html.black` OLED tier). `data-theme-mode` drives
|
|
|
90
90
|
- Unmount windows are plain timers sized to the animation (`useExitPresence`), doubling as the timeout fallback (animation contract).
|
|
91
91
|
- Global reduced-motion gate collapses everything to 0.01ms.
|
|
92
92
|
|
|
93
|
-
## 7.
|
|
93
|
+
## 7. Component roadmap
|
|
94
|
+
|
|
95
|
+
Phase 1 — components the family already uses (extract next):
|
|
96
|
+
|
|
97
|
+
| Component family | Entry | Source provenance | Notes |
|
|
98
|
+
| ----------------- | ------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
99
|
+
| Markdown renderer | `zjdesign/markdown` | ZJBlog markdown.tsx + ZJSearch prose + ZJStudio markdown | unified react-markdown preset: GFM, callouts, katex, mermaid, the code-card; streaming-friendly `content` prop (Streamdown API shape) |
|
|
100
|
+
| Layout | `zjdesign/layout` | ZJBlog Shell / ZJStudio AppShell / ZJKVM Navigation | NavBar (glass blur + Wordmark + icon buttons + ThemeToggle), AppShell (ProgressBar + NavBar + main + Footer + BackToTop), page sections |
|
|
101
|
+
| ThemeToggle | main entry | ZJBlog/ZJKVM/ZJSearch | the tri/tetra-state icon button over the package theme hooks |
|
|
102
|
+
| Table | main entry | ZJStudio JobsPage | the family table fragment set (hairline rows, LIST_ROW rhythm) |
|
|
103
|
+
| Camera / media | `zjdesign/media` | ZJKVM media/camera + ZJBlog Lightbox | CameraPreview (getUserMedia + permission flow), Lightbox (dialog + scrim) |
|
|
104
|
+
|
|
105
|
+
Phase 2 — lobe-ecosystem counterparts, adopted when a family app needs them:
|
|
106
|
+
|
|
107
|
+
| lobe package | ZJ counterpart | Trigger |
|
|
108
|
+
| --------------------- | --------------------------------------------------------------------------------------- | ---------------------------- |
|
|
109
|
+
| `@lobehub/streamdown` | streaming Markdown over the Phase-1 renderer | ZJSearch AI-answer streaming |
|
|
110
|
+
| `@lobehub/charts` | lightweight SVG charts (Sparkline, BarList first) | first dashboard need |
|
|
111
|
+
| `@lobehub/editor` | CodeMirror wrapper | first code-editing need |
|
|
112
|
+
| `@lobehub/icons` | `FamilyMark` brand glyphs (blog/kvm/search/studio), lucide-react stays the UI icon peer | brand icon consolidation |
|
|
113
|
+
|
|
114
|
+
Governance per addition: playground demo + three-tier visual check + one consumer migrated before the fragment/component is declared stable.
|
|
115
|
+
|
|
116
|
+
## 8. Governance
|
|
94
117
|
|
|
95
118
|
1. Spec change → DESIGN.md (family) → tokens.css → release.
|
|
96
119
|
2. New fragment → fragments.ts + this doc §3 → release.
|
package/dist/brand/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react1 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/brand/Wordmark.d.ts
|
|
@@ -14,6 +14,6 @@ declare function Wordmark({
|
|
|
14
14
|
* navigation-bar scale — pass e.g. "text-xl" for compact bars */
|
|
15
15
|
className?: string;
|
|
16
16
|
dotClassName?: string;
|
|
17
|
-
}):
|
|
17
|
+
}): react1.JSX.Element;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { Wordmark };
|
package/dist/brand/index.mjs
CHANGED
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { THEME_BOOTSTRAP, THEME_COLOR_BLACK, THEME_COLOR_DARK, THEME_COLOR_LIGHT, ThemeStorage, ThemeStyle, UseThemeOptions, UseThemeResult, applyThemeStyle, cookieThemeStorage, createThemeController, localStorageThemeStorage, readThemeStyle, reducedMotion, setThemeStyle, useExitPresence, useTheme, watchSystemTheme, watchThemeDark };
|
|
1
|
+
import { _ as setThemeStyle, a as THEME_BOOTSTRAP, b as reducedMotion, c as THEME_COLOR_LIGHT, d as applyThemeStyle, f as cookieThemeStorage, g as readThemeStyle, h as nextThemeStyle, i as useExitPresence, l as ThemeStorage, m as localStorageThemeStorage, n as UseThemeResult, o as THEME_COLOR_BLACK, p as createThemeController, r as useTheme, s as THEME_COLOR_DARK, t as UseThemeOptions, u as ThemeStyle, v as watchSystemTheme, y as watchThemeDark } from "../index-BVN0e41g.mjs";
|
|
2
|
+
export { THEME_BOOTSTRAP, THEME_COLOR_BLACK, THEME_COLOR_DARK, THEME_COLOR_LIGHT, ThemeStorage, ThemeStyle, UseThemeOptions, UseThemeResult, applyThemeStyle, cookieThemeStorage, createThemeController, localStorageThemeStorage, nextThemeStyle, readThemeStyle, reducedMotion, setThemeStyle, useExitPresence, useTheme, watchSystemTheme, watchThemeDark };
|
package/dist/hooks/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as THEME_COLOR_DARK, c as cookieThemeStorage, d as
|
|
1
|
+
import { a as THEME_COLOR_DARK, c as cookieThemeStorage, d as nextThemeStyle, f as readThemeStyle, g as reducedMotion, h as watchThemeDark, i as THEME_COLOR_BLACK, l as createThemeController, m as watchSystemTheme, n as useExitPresence, o as THEME_COLOR_LIGHT, p as setThemeStyle, r as THEME_BOOTSTRAP, s as applyThemeStyle, t as useTheme, u as localStorageThemeStorage } from "../hooks-vpLVB3bc.mjs";
|
|
2
2
|
|
|
3
|
-
export { THEME_BOOTSTRAP, THEME_COLOR_BLACK, THEME_COLOR_DARK, THEME_COLOR_LIGHT, applyThemeStyle, cookieThemeStorage, createThemeController, localStorageThemeStorage, readThemeStyle, reducedMotion, setThemeStyle, useExitPresence, useTheme, watchSystemTheme, watchThemeDark };
|
|
3
|
+
export { THEME_BOOTSTRAP, THEME_COLOR_BLACK, THEME_COLOR_DARK, THEME_COLOR_LIGHT, applyThemeStyle, cookieThemeStorage, createThemeController, localStorageThemeStorage, nextThemeStyle, readThemeStyle, reducedMotion, setThemeStyle, useExitPresence, useTheme, watchSystemTheme, watchThemeDark };
|
|
@@ -97,12 +97,26 @@ const defaultController = /* @__PURE__ */ createThemeController();
|
|
|
97
97
|
const readThemeStyle = defaultController.readThemeStyle;
|
|
98
98
|
const applyThemeStyle = defaultController.applyThemeStyle;
|
|
99
99
|
const setThemeStyle = defaultController.setThemeStyle;
|
|
100
|
-
/**
|
|
100
|
+
/** Advance a preference along a cycle order (default: the four-state loop
|
|
101
|
+
* including the OLED tier; pass a three-step order for black-less UIs). */
|
|
102
|
+
function nextThemeStyle(style, order = [
|
|
103
|
+
"auto",
|
|
104
|
+
"light",
|
|
105
|
+
"dark",
|
|
106
|
+
"black"
|
|
107
|
+
]) {
|
|
108
|
+
return order[(order.indexOf(style) + 1) % order.length] ?? "auto";
|
|
109
|
+
}
|
|
110
|
+
/** In auto mode, follow the system light/dark switch in real time.
|
|
111
|
+
* Returns an unsubscribe function (call it on teardown). */
|
|
101
112
|
function watchSystemTheme(storage = localStorageThemeStorage()) {
|
|
102
|
-
window.matchMedia("(prefers-color-scheme: dark)")
|
|
113
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
114
|
+
const onChange = () => {
|
|
103
115
|
const controller = createThemeController(storage);
|
|
104
116
|
if (controller.readThemeStyle() === "auto") controller.applyThemeStyle("auto");
|
|
105
|
-
}
|
|
117
|
+
};
|
|
118
|
+
mq.addEventListener("change", onChange);
|
|
119
|
+
return () => mq.removeEventListener("change", onChange);
|
|
106
120
|
}
|
|
107
121
|
/** Subscribe to the dark state (html.dark is the single source of truth; both in-site
|
|
108
122
|
* toggles and system-follow flip it). Returns an unsubscribe function. Heavy theme
|
|
@@ -217,4 +231,4 @@ function useTheme({ storage = localStorageThemeStorage(), order = [
|
|
|
217
231
|
}
|
|
218
232
|
|
|
219
233
|
//#endregion
|
|
220
|
-
export { THEME_COLOR_DARK as a, cookieThemeStorage as c,
|
|
234
|
+
export { THEME_COLOR_DARK as a, cookieThemeStorage as c, nextThemeStyle as d, readThemeStyle as f, reducedMotion as g, watchThemeDark as h, THEME_COLOR_BLACK as i, createThemeController as l, watchSystemTheme as m, useExitPresence as n, THEME_COLOR_LIGHT as o, setThemeStyle as p, THEME_BOOTSTRAP as r, applyThemeStyle as s, useTheme as t, localStorageThemeStorage as u };
|
|
@@ -40,8 +40,12 @@ declare function createThemeController(storage?: ThemeStorage): {
|
|
|
40
40
|
declare const readThemeStyle: () => ThemeStyle;
|
|
41
41
|
declare const applyThemeStyle: (style: ThemeStyle) => void;
|
|
42
42
|
declare const setThemeStyle: (style: ThemeStyle) => void;
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/** Advance a preference along a cycle order (default: the four-state loop
|
|
44
|
+
* including the OLED tier; pass a three-step order for black-less UIs). */
|
|
45
|
+
declare function nextThemeStyle(style: ThemeStyle, order?: ThemeStyle[]): ThemeStyle;
|
|
46
|
+
/** In auto mode, follow the system light/dark switch in real time.
|
|
47
|
+
* Returns an unsubscribe function (call it on teardown). */
|
|
48
|
+
declare function watchSystemTheme(storage?: ThemeStorage): () => void;
|
|
45
49
|
/** Subscribe to the dark state (html.dark is the single source of truth; both in-site
|
|
46
50
|
* toggles and system-follow flip it). Returns an unsubscribe function. Heavy theme
|
|
47
51
|
* dependencies (giscus iframe / mermaid re-render) hook in here — do not attach your own
|
|
@@ -98,4 +102,4 @@ declare function useTheme({
|
|
|
98
102
|
order
|
|
99
103
|
}?: UseThemeOptions): UseThemeResult;
|
|
100
104
|
//#endregion
|
|
101
|
-
export {
|
|
105
|
+
export { setThemeStyle as _, THEME_BOOTSTRAP as a, reducedMotion as b, THEME_COLOR_LIGHT as c, applyThemeStyle as d, cookieThemeStorage as f, readThemeStyle as g, nextThemeStyle as h, useExitPresence as i, ThemeStorage as l, localStorageThemeStorage as m, UseThemeResult as n, THEME_COLOR_BLACK as o, createThemeController as p, useTheme as r, THEME_COLOR_DARK as s, UseThemeOptions as t, ThemeStyle as u, watchSystemTheme as v, watchThemeDark as y };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import * as
|
|
1
|
+
import { _ as setThemeStyle, a as THEME_BOOTSTRAP, b as reducedMotion, c as THEME_COLOR_LIGHT, d as applyThemeStyle, f as cookieThemeStorage, g as readThemeStyle, h as nextThemeStyle, i as useExitPresence, l as ThemeStorage, m as localStorageThemeStorage, n as UseThemeResult, o as THEME_COLOR_BLACK, p as createThemeController, r as useTheme, s as THEME_COLOR_DARK, t as UseThemeOptions, u as ThemeStyle, v as watchSystemTheme, y as watchThemeDark } from "./index-BVN0e41g.mjs";
|
|
2
|
+
import * as react13 from "react";
|
|
3
3
|
import { ButtonHTMLAttributes, ReactNode, RefObject } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/Button/Button.d.ts
|
|
@@ -9,7 +9,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
9
9
|
}
|
|
10
10
|
/** Pill button in the family language (BTN_PRIMARY / BTN_OUTLINE / BTN_GHOST
|
|
11
11
|
* fragments + the danger state). */
|
|
12
|
-
declare const Button:
|
|
12
|
+
declare const Button: react13.ForwardRefExoticComponent<ButtonProps & react13.RefAttributes<HTMLButtonElement>>;
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/components/Collapse/Collapse.d.ts
|
|
15
15
|
/**
|
|
@@ -42,16 +42,18 @@ declare function Collapse({
|
|
|
42
42
|
className?: string;
|
|
43
43
|
id?: string;
|
|
44
44
|
children: ReactNode;
|
|
45
|
-
}):
|
|
45
|
+
}): react13.JSX.Element | null;
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/components/IconButton/IconButton.d.ts
|
|
48
48
|
interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
49
49
|
/** accessibility label (aria-label + title) */
|
|
50
50
|
label: string;
|
|
51
51
|
active?: boolean;
|
|
52
|
+
/** aria-expanded passthrough for triggers (popovers / drawers) */
|
|
53
|
+
expanded?: boolean;
|
|
52
54
|
}
|
|
53
55
|
/** Round icon button (ICON_BTN fragment); `active` lights the accent. */
|
|
54
|
-
declare const IconButton:
|
|
56
|
+
declare const IconButton: react13.ForwardRefExoticComponent<IconButtonProps & react13.RefAttributes<HTMLButtonElement>>;
|
|
55
57
|
//#endregion
|
|
56
58
|
//#region src/components/CopyButton/CopyButton.d.ts
|
|
57
59
|
interface CopyButtonProps extends Omit<IconButtonProps, "label" | "children" | "onClick"> {
|
|
@@ -69,7 +71,7 @@ declare function CopyButton({
|
|
|
69
71
|
label,
|
|
70
72
|
feedbackMs,
|
|
71
73
|
...props
|
|
72
|
-
}: CopyButtonProps):
|
|
74
|
+
}: CopyButtonProps): react13.JSX.Element;
|
|
73
75
|
//#endregion
|
|
74
76
|
//#region src/components/Dropdown/Dropdown.d.ts
|
|
75
77
|
interface DropdownOption {
|
|
@@ -90,7 +92,9 @@ interface DropdownProps {
|
|
|
90
92
|
}
|
|
91
93
|
/** Custom select wearing the family skin: hairline trigger button + CARD
|
|
92
94
|
* popover list (LIST_ROW rows, accent check on the selected option).
|
|
93
|
-
* Replaces every native <select> — the OS dropdown sheet breaks the style.
|
|
95
|
+
* Replaces every native <select> — the OS dropdown sheet breaks the style.
|
|
96
|
+
* Keyboard: ArrowDown/Up opens and moves through options, Home/End jump,
|
|
97
|
+
* Enter picks, Esc closes back to the trigger (APG listbox pattern). */
|
|
94
98
|
declare function Dropdown({
|
|
95
99
|
label,
|
|
96
100
|
value,
|
|
@@ -101,7 +105,7 @@ declare function Dropdown({
|
|
|
101
105
|
menuClassName,
|
|
102
106
|
disabled,
|
|
103
107
|
id
|
|
104
|
-
}: DropdownProps):
|
|
108
|
+
}: DropdownProps): react13.JSX.Element;
|
|
105
109
|
//#endregion
|
|
106
110
|
//#region src/components/Kbd/Kbd.d.ts
|
|
107
111
|
/** Mono chip for keys / states (MONO_CHIP fragment with tighter padding). */
|
|
@@ -111,7 +115,7 @@ declare function Kbd({
|
|
|
111
115
|
}: {
|
|
112
116
|
children: ReactNode;
|
|
113
117
|
className?: string;
|
|
114
|
-
}):
|
|
118
|
+
}): react13.JSX.Element;
|
|
115
119
|
/** Single-line panel row label (text-sm) — the standard row label inside
|
|
116
120
|
* toolbar panels. Never wraps: narrow rows scale via column layout instead. */
|
|
117
121
|
declare const ROW_LABEL = "shrink-0 whitespace-nowrap text-sm text-ink";
|
|
@@ -136,7 +140,7 @@ declare function Modal({
|
|
|
136
140
|
label,
|
|
137
141
|
className,
|
|
138
142
|
children
|
|
139
|
-
}: ModalProps):
|
|
143
|
+
}: ModalProps): react13.ReactPortal | null;
|
|
140
144
|
//#endregion
|
|
141
145
|
//#region src/components/Popover/Popover.d.ts
|
|
142
146
|
interface PopoverProps {
|
|
@@ -160,7 +164,7 @@ declare function Popover({
|
|
|
160
164
|
className,
|
|
161
165
|
children,
|
|
162
166
|
anchorRef
|
|
163
|
-
}: PopoverProps):
|
|
167
|
+
}: PopoverProps): react13.JSX.Element | null;
|
|
164
168
|
//#endregion
|
|
165
169
|
//#region src/components/ProgressBar/ProgressBar.d.ts
|
|
166
170
|
/** Top-of-page loading bar: 2px accent strip riding the `progress` keyframes
|
|
@@ -170,7 +174,7 @@ declare function ProgressBar({
|
|
|
170
174
|
className
|
|
171
175
|
}: {
|
|
172
176
|
className?: string;
|
|
173
|
-
}):
|
|
177
|
+
}): react13.JSX.Element;
|
|
174
178
|
//#endregion
|
|
175
179
|
//#region src/components/Segmented/Segmented.d.ts
|
|
176
180
|
interface SegmentedProps<T extends string | number> {
|
|
@@ -190,7 +194,7 @@ declare function Segmented<T extends string | number>({
|
|
|
190
194
|
onChange,
|
|
191
195
|
label,
|
|
192
196
|
className
|
|
193
|
-
}: SegmentedProps<T>):
|
|
197
|
+
}: SegmentedProps<T>): react13.JSX.Element;
|
|
194
198
|
//#endregion
|
|
195
199
|
//#region src/components/Slider/Slider.d.ts
|
|
196
200
|
interface SliderProps {
|
|
@@ -215,7 +219,7 @@ declare function Slider({
|
|
|
215
219
|
label,
|
|
216
220
|
display,
|
|
217
221
|
className
|
|
218
|
-
}: SliderProps):
|
|
222
|
+
}: SliderProps): react13.JSX.Element;
|
|
219
223
|
//#endregion
|
|
220
224
|
//#region src/components/Switch/Switch.d.ts
|
|
221
225
|
interface SwitchProps {
|
|
@@ -232,12 +236,80 @@ declare function Switch({
|
|
|
232
236
|
label,
|
|
233
237
|
className,
|
|
234
238
|
disabled
|
|
235
|
-
}: SwitchProps):
|
|
239
|
+
}: SwitchProps): react13.JSX.Element;
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/components/Table/Table.d.ts
|
|
242
|
+
interface TableColumn<R> {
|
|
243
|
+
key: string;
|
|
244
|
+
/** Column header label */
|
|
245
|
+
label: ReactNode;
|
|
246
|
+
/** Cell renderer; defaults to the raw field value */
|
|
247
|
+
render?: (row: R) => ReactNode;
|
|
248
|
+
/** Cell class (width/alignment); the row rhythm comes from the shell */
|
|
249
|
+
className?: string;
|
|
250
|
+
}
|
|
251
|
+
interface TableProps<R> {
|
|
252
|
+
columns: TableColumn<R>[];
|
|
253
|
+
rows: R[];
|
|
254
|
+
/** Stable row key */
|
|
255
|
+
rowKey: (row: R) => string;
|
|
256
|
+
/** Accessible caption describing the table */
|
|
257
|
+
caption: string;
|
|
258
|
+
/** Row click handler (hover/selected affordances follow) */
|
|
259
|
+
onRowClick?: (row: R) => void;
|
|
260
|
+
className?: string;
|
|
261
|
+
}
|
|
262
|
+
/** The family table: hairline shell, mono header on the muted tier, rows in
|
|
263
|
+
* the LIST_ROW rhythm. A semantic <table> — sort/filter state stays with
|
|
264
|
+
* the caller. */
|
|
265
|
+
declare function Table<R>({
|
|
266
|
+
columns,
|
|
267
|
+
rows,
|
|
268
|
+
rowKey,
|
|
269
|
+
caption,
|
|
270
|
+
onRowClick,
|
|
271
|
+
className
|
|
272
|
+
}: TableProps<R>): react13.JSX.Element;
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/components/ThemeToggle/ThemeToggle.d.ts
|
|
275
|
+
interface ThemeToggleProps {
|
|
276
|
+
/** Accessible labels per preference (order: auto / light / dark / black) */
|
|
277
|
+
labels: Partial<Record<ThemeStyle, string>> & {
|
|
278
|
+
auto: string;
|
|
279
|
+
};
|
|
280
|
+
/** Cycle order; default follows the useTheme hook (auto → light → dark) */
|
|
281
|
+
order?: ThemeStyle[];
|
|
282
|
+
/** Icon set: "tri" shows auto/light/dark glyphs swapped by CSS
|
|
283
|
+
* (behaviors.css, correct from pre-paint); "dynamic" renders the active
|
|
284
|
+
* glyph from state (supports the black tier with the monitor glyph). */
|
|
285
|
+
variant?: "tri" | "dynamic";
|
|
286
|
+
className?: string;
|
|
287
|
+
}
|
|
288
|
+
/** The family theme toggle (ZJBlog design): an ICON_BTN cycling the theme
|
|
289
|
+
* preference. The tri variant relies on behaviors.css's
|
|
290
|
+
* [data-theme-mode] .theme-icon rules; the dynamic variant reads state. */
|
|
291
|
+
declare function ThemeToggle({
|
|
292
|
+
labels,
|
|
293
|
+
order,
|
|
294
|
+
variant,
|
|
295
|
+
className
|
|
296
|
+
}: ThemeToggleProps): react13.JSX.Element;
|
|
297
|
+
/** The family language toggle (ZJBlog design): one Languages icon cycling
|
|
298
|
+
* system → en → zh (or any pref order); the label announces the target. */
|
|
299
|
+
declare function LanguageToggle({
|
|
300
|
+
label,
|
|
301
|
+
onClick,
|
|
302
|
+
className
|
|
303
|
+
}: {
|
|
304
|
+
label: string;
|
|
305
|
+
onClick: () => void;
|
|
306
|
+
className?: string;
|
|
307
|
+
}): react13.JSX.Element;
|
|
236
308
|
//#endregion
|
|
237
309
|
//#region src/components/Toast/Toaster.d.ts
|
|
238
310
|
/** Toast stack: bottom-center paper cards, fade-up in, auto-removed after 3 s.
|
|
239
311
|
* Mount once near the app root. */
|
|
240
|
-
declare function Toaster():
|
|
312
|
+
declare function Toaster(): react13.JSX.Element | null;
|
|
241
313
|
//#endregion
|
|
242
314
|
//#region src/components/Toast/types.d.ts
|
|
243
315
|
interface ToastItem {
|
|
@@ -248,9 +320,105 @@ interface ToastItem {
|
|
|
248
320
|
//#endregion
|
|
249
321
|
//#region src/components/Toast/toast.d.ts
|
|
250
322
|
type Listener = (toasts: ToastItem[]) => void;
|
|
251
|
-
/** Push a toast; `tone` picks the border/text treatment ("ok" default). */
|
|
252
323
|
declare function toast(text: string, tone?: ToastItem["tone"]): void;
|
|
253
324
|
declare function subscribeToasts(listener: Listener): () => void;
|
|
254
325
|
declare function getToasts(): ToastItem[];
|
|
255
326
|
//#endregion
|
|
256
|
-
|
|
327
|
+
//#region src/layout/AppShell.d.ts
|
|
328
|
+
interface AppShellProps {
|
|
329
|
+
/** NavBar brand zone (wordmark) */
|
|
330
|
+
brand?: ReactNode;
|
|
331
|
+
/** NavBar right action area */
|
|
332
|
+
actions?: ReactNode;
|
|
333
|
+
/** Page content */
|
|
334
|
+
children: ReactNode;
|
|
335
|
+
/** Optional single-line footer (copyright etc.) */
|
|
336
|
+
footer?: ReactNode;
|
|
337
|
+
className?: string;
|
|
338
|
+
}
|
|
339
|
+
/** The family app shell: glass NavBar, a scrollable main region, and an
|
|
340
|
+
* optional one-line footer. Content pages keep the document flow; the
|
|
341
|
+
* viewport-fixed app layout (ZJStudio/ZJKVM style) composes NavBar with its
|
|
342
|
+
* own overflow region instead. */
|
|
343
|
+
declare function AppShell({
|
|
344
|
+
brand,
|
|
345
|
+
actions,
|
|
346
|
+
children,
|
|
347
|
+
footer,
|
|
348
|
+
className
|
|
349
|
+
}: AppShellProps): react13.JSX.Element;
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/layout/BackToTop.d.ts
|
|
352
|
+
/** Back-to-top: a floating icon button that appears after scrolling past the
|
|
353
|
+
* fold (the ZJBlog threshold is 400px), with the reduced-motion guard
|
|
354
|
+
* collapsing the transition. */
|
|
355
|
+
declare function BackToTop({
|
|
356
|
+
label,
|
|
357
|
+
threshold
|
|
358
|
+
}: {
|
|
359
|
+
label?: string;
|
|
360
|
+
threshold?: number;
|
|
361
|
+
}): react13.JSX.Element;
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/layout/NavBar.d.ts
|
|
364
|
+
interface NavBarProps {
|
|
365
|
+
/** Left zone: the wordmark / brand (rendered before the actions) */
|
|
366
|
+
children?: ReactNode;
|
|
367
|
+
/** Right action area: icon buttons, toggles, menus */
|
|
368
|
+
actions?: ReactNode;
|
|
369
|
+
/** Center zone (optional; absolutely centered on md+ like the family bar) */
|
|
370
|
+
center?: ReactNode;
|
|
371
|
+
className?: string;
|
|
372
|
+
}
|
|
373
|
+
/** The family top bar: sticky glass (safe-area aware via .app-bar from
|
|
374
|
+
* base.css), hairline bottom edge, serif wordmark zone on the left and the
|
|
375
|
+
* icon-button action area on the right. */
|
|
376
|
+
declare function NavBar({
|
|
377
|
+
children,
|
|
378
|
+
actions,
|
|
379
|
+
center,
|
|
380
|
+
className
|
|
381
|
+
}: NavBarProps): react13.JSX.Element;
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/media/CameraPreview.d.ts
|
|
384
|
+
interface CameraPreviewProps {
|
|
385
|
+
/** getUserMedia video constraints; defaults to the user-facing camera */
|
|
386
|
+
constraints?: MediaStreamConstraints;
|
|
387
|
+
/** Called when the stream is ready (the preview never owns the stream —
|
|
388
|
+
* pass it on if the caller needs frames) */
|
|
389
|
+
onStream?: (stream: MediaStream) => void;
|
|
390
|
+
/** Called when access fails (denied / no device / insecure context) */
|
|
391
|
+
onError?: (error: unknown) => void;
|
|
392
|
+
className?: string;
|
|
393
|
+
}
|
|
394
|
+
/** Family camera preview: mounts a muted, playsInline <video> fed by
|
|
395
|
+
* getUserMedia; tracks are released on unmount. Permission handling and
|
|
396
|
+
* device enumeration stay with the caller (see onError + onStream). */
|
|
397
|
+
declare function CameraPreview({
|
|
398
|
+
constraints,
|
|
399
|
+
onStream,
|
|
400
|
+
onError,
|
|
401
|
+
className
|
|
402
|
+
}: CameraPreviewProps): react13.JSX.Element;
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/media/Lightbox.d.ts
|
|
405
|
+
interface LightboxProps {
|
|
406
|
+
open: boolean;
|
|
407
|
+
onClose: () => void;
|
|
408
|
+
/** Accessible label for the dialog */
|
|
409
|
+
label: string;
|
|
410
|
+
children: ReactNode;
|
|
411
|
+
className?: string;
|
|
412
|
+
}
|
|
413
|
+
/** The family lightbox: a native <dialog> over the --scrim backdrop (the
|
|
414
|
+
* .lightbox[open] enter animation lives in behaviors.css). Esc and backdrop
|
|
415
|
+
* clicks close it; content is free-form (an <img>, a video, a gallery). */
|
|
416
|
+
declare function Lightbox({
|
|
417
|
+
open,
|
|
418
|
+
onClose,
|
|
419
|
+
label,
|
|
420
|
+
children,
|
|
421
|
+
className
|
|
422
|
+
}: LightboxProps): react13.JSX.Element;
|
|
423
|
+
//#endregion
|
|
424
|
+
export { AppShell, type AppShellProps, BackToTop, Button, type ButtonProps, CameraPreview, type CameraPreviewProps, Collapse, CopyButton, type CopyButtonProps, Dropdown, type DropdownOption, type DropdownProps, IconButton, type IconButtonProps, Kbd, LanguageToggle, Lightbox, type LightboxProps, Modal, type ModalProps, NavBar, type NavBarProps, Popover, type PopoverProps, ProgressBar, ROW_LABEL, Segmented, type SegmentedProps, Slider, type SliderProps, Switch, type SwitchProps, THEME_BOOTSTRAP, THEME_COLOR_BLACK, THEME_COLOR_DARK, THEME_COLOR_LIGHT, Table, type TableColumn, type TableProps, ThemeStorage, ThemeStyle, ThemeToggle, type ToastItem, Toaster, UseThemeOptions, UseThemeResult, applyThemeStyle, cookieThemeStorage, createThemeController, getToasts, localStorageThemeStorage, nextThemeStyle, readThemeStyle, reducedMotion, setThemeStyle, subscribeToasts, toast, useExitPresence, useTheme, watchSystemTheme, watchThemeDark };
|