@bysages/react 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-response-jZy-0Tvv.mjs +127 -0
- package/dist/chevron-BeHvt46K.mjs +17 -0
- package/dist/components/accordion/index.d.mts +7 -0
- package/dist/components/accordion/index.mjs +10 -0
- package/dist/components/affix/index.d.mts +20 -0
- package/dist/components/affix/index.mjs +18 -0
- package/dist/components/ai/index.d.mts +2 -0
- package/dist/components/ai/index.mjs +65 -0
- package/dist/components/ai-action/index.d.mts +14 -0
- package/dist/components/ai-action/index.mjs +18 -0
- package/dist/components/ai-attachments/index.d.mts +19 -0
- package/dist/components/ai-attachments/index.mjs +106 -0
- package/dist/components/ai-message/index.d.mts +11 -0
- package/dist/components/ai-message/index.mjs +15 -0
- package/dist/components/ai-prompt-input/index.d.mts +47 -0
- package/dist/components/ai-prompt-input/index.mjs +135 -0
- package/dist/components/ai-reasoning/index.d.mts +13 -0
- package/dist/components/ai-reasoning/index.mjs +19 -0
- package/dist/components/ai-response/index.d.mts +22 -0
- package/dist/components/ai-response/index.mjs +2 -0
- package/dist/components/ai-source/index.d.mts +17 -0
- package/dist/components/ai-source/index.mjs +27 -0
- package/dist/components/ai-suggestion/index.d.mts +13 -0
- package/dist/components/ai-suggestion/index.mjs +16 -0
- package/dist/components/ai-tool/index.d.mts +21 -0
- package/dist/components/ai-tool/index.mjs +36 -0
- package/dist/components/alert/index.d.mts +23 -0
- package/dist/components/alert/index.mjs +80 -0
- package/dist/components/angle-slider/index.d.mts +16 -0
- package/dist/components/angle-slider/index.mjs +21 -0
- package/dist/components/aspect-ratio/index.d.mts +10 -0
- package/dist/components/aspect-ratio/index.mjs +17 -0
- package/dist/components/autocomplete/index.d.mts +21 -0
- package/dist/components/autocomplete/index.mjs +35 -0
- package/dist/components/avatar/index.d.mts +20 -0
- package/dist/components/avatar/index.mjs +14 -0
- package/dist/components/avatar-group/index.d.mts +11 -0
- package/dist/components/avatar-group/index.mjs +15 -0
- package/dist/components/back-top/index.d.mts +29 -0
- package/dist/components/back-top/index.mjs +82 -0
- package/dist/components/badge/index.d.mts +10 -0
- package/dist/components/badge/index.mjs +15 -0
- package/dist/components/banner/index.d.mts +31 -0
- package/dist/components/banner/index.mjs +63 -0
- package/dist/components/breadcrumb/index.d.mts +32 -0
- package/dist/components/breadcrumb/index.mjs +35 -0
- package/dist/components/button/index.d.mts +19 -0
- package/dist/components/button/index.mjs +29 -0
- package/dist/components/button-group/index.d.mts +24 -0
- package/dist/components/button-group/index.mjs +25 -0
- package/dist/components/calendar/index.d.mts +17 -0
- package/dist/components/calendar/index.mjs +96 -0
- package/dist/components/card/index.d.mts +46 -0
- package/dist/components/card/index.mjs +44 -0
- package/dist/components/carousel/index.d.mts +9 -0
- package/dist/components/carousel/index.mjs +12 -0
- package/dist/components/cascade-select/index.d.mts +31 -0
- package/dist/components/cascade-select/index.mjs +223 -0
- package/dist/components/checkbox/index.d.mts +16 -0
- package/dist/components/checkbox/index.mjs +21 -0
- package/dist/components/checkbox-group/index.d.mts +28 -0
- package/dist/components/checkbox-group/index.mjs +65 -0
- package/dist/components/chip/index.d.mts +12 -0
- package/dist/components/chip/index.mjs +17 -0
- package/dist/components/client-only/index.d.mts +2 -0
- package/dist/components/client-only/index.mjs +2 -0
- package/dist/components/clipboard/index.d.mts +17 -0
- package/dist/components/clipboard/index.mjs +17 -0
- package/dist/components/collapsible/index.d.mts +7 -0
- package/dist/components/collapsible/index.mjs +10 -0
- package/dist/components/collection/index.d.mts +2 -0
- package/dist/components/collection/index.mjs +2 -0
- package/dist/components/color-picker/index.d.mts +20 -0
- package/dist/components/color-picker/index.mjs +25 -0
- package/dist/components/combobox/index.d.mts +17 -0
- package/dist/components/combobox/index.mjs +18 -0
- package/dist/components/command/index.d.mts +43 -0
- package/dist/components/command/index.mjs +137 -0
- package/dist/components/comment/index.d.mts +17 -0
- package/dist/components/comment/index.mjs +47 -0
- package/dist/components/config-provider/index.d.mts +46 -0
- package/dist/components/config-provider/index.mjs +41 -0
- package/dist/components/container/index.d.mts +13 -0
- package/dist/components/container/index.mjs +15 -0
- package/dist/components/date-input/index.d.mts +17 -0
- package/dist/components/date-input/index.mjs +21 -0
- package/dist/components/date-picker/index.d.mts +19 -0
- package/dist/components/date-picker/index.mjs +23 -0
- package/dist/components/descriptions/index.d.mts +25 -0
- package/dist/components/descriptions/index.mjs +32 -0
- package/dist/components/dialog/index.d.mts +9 -0
- package/dist/components/dialog/index.mjs +11 -0
- package/dist/components/download-trigger/index.d.mts +2 -0
- package/dist/components/download-trigger/index.mjs +2 -0
- package/dist/components/drawer/index.d.mts +9 -0
- package/dist/components/drawer/index.mjs +12 -0
- package/dist/components/dynamic-input/index.d.mts +28 -0
- package/dist/components/dynamic-input/index.mjs +83 -0
- package/dist/components/editable/index.d.mts +16 -0
- package/dist/components/editable/index.mjs +17 -0
- package/dist/components/ellipsis/index.d.mts +10 -0
- package/dist/components/ellipsis/index.mjs +19 -0
- package/dist/components/empty/index.d.mts +28 -0
- package/dist/components/empty/index.mjs +32 -0
- package/dist/components/field/index.d.mts +8 -0
- package/dist/components/field/index.mjs +11 -0
- package/dist/components/fieldset/index.d.mts +7 -0
- package/dist/components/fieldset/index.mjs +10 -0
- package/dist/components/file-upload/index.d.mts +18 -0
- package/dist/components/file-upload/index.mjs +23 -0
- package/dist/components/float-button/index.d.mts +59 -0
- package/dist/components/float-button/index.mjs +90 -0
- package/dist/components/floating-panel/index.d.mts +9 -0
- package/dist/components/floating-panel/index.mjs +12 -0
- package/dist/components/focus-trap/index.d.mts +2 -0
- package/dist/components/focus-trap/index.mjs +2 -0
- package/dist/components/form/index.d.mts +2 -0
- package/dist/components/form/index.mjs +67 -0
- package/dist/components/format/index.d.mts +9 -0
- package/dist/components/format/index.mjs +10 -0
- package/dist/components/frame/index.d.mts +10 -0
- package/dist/components/frame/index.mjs +12 -0
- package/dist/components/grid/index.d.mts +13 -0
- package/dist/components/grid/index.mjs +31 -0
- package/dist/components/highlight/index.d.mts +7 -0
- package/dist/components/highlight/index.mjs +11 -0
- package/dist/components/hover-card/index.d.mts +7 -0
- package/dist/components/hover-card/index.mjs +10 -0
- package/dist/components/icon/index.d.mts +19 -0
- package/dist/components/icon/index.mjs +26 -0
- package/dist/components/image/index.d.mts +17 -0
- package/dist/components/image/index.mjs +57 -0
- package/dist/components/image-cropper/index.d.mts +8 -0
- package/dist/components/image-cropper/index.mjs +11 -0
- package/dist/components/image-viewer/index.d.mts +18 -0
- package/dist/components/image-viewer/index.mjs +110 -0
- package/dist/components/input/index.d.mts +16 -0
- package/dist/components/input/index.mjs +21 -0
- package/dist/components/input-group/index.d.mts +17 -0
- package/dist/components/input-group/index.mjs +31 -0
- package/dist/components/json-tree-view/index.d.mts +7 -0
- package/dist/components/json-tree-view/index.mjs +10 -0
- package/dist/components/kbd/index.d.mts +6 -0
- package/dist/components/kbd/index.mjs +14 -0
- package/dist/components/layout/index.d.mts +63 -0
- package/dist/components/layout/index.mjs +133 -0
- package/dist/components/link/index.d.mts +10 -0
- package/dist/components/link/index.mjs +18 -0
- package/dist/components/list/index.d.mts +39 -0
- package/dist/components/list/index.mjs +66 -0
- package/dist/components/listbox/index.d.mts +18 -0
- package/dist/components/listbox/index.mjs +18 -0
- package/dist/components/marquee/index.d.mts +7 -0
- package/dist/components/marquee/index.mjs +10 -0
- package/dist/components/masonry/index.d.mts +11 -0
- package/dist/components/masonry/index.mjs +29 -0
- package/dist/components/mentions/index.d.mts +2 -0
- package/dist/components/mentions/index.mjs +2 -0
- package/dist/components/menu/index.d.mts +20 -0
- package/dist/components/menu/index.mjs +37 -0
- package/dist/components/menubar/index.d.mts +32 -0
- package/dist/components/menubar/index.mjs +35 -0
- package/dist/components/meter/index.d.mts +26 -0
- package/dist/components/meter/index.mjs +59 -0
- package/dist/components/navigation-menu/index.d.mts +8 -0
- package/dist/components/navigation-menu/index.mjs +11 -0
- package/dist/components/number-input/index.d.mts +16 -0
- package/dist/components/number-input/index.mjs +21 -0
- package/dist/components/page-header/index.d.mts +32 -0
- package/dist/components/page-header/index.mjs +34 -0
- package/dist/components/pagination/index.d.mts +18 -0
- package/dist/components/pagination/index.mjs +23 -0
- package/dist/components/password-input/index.d.mts +16 -0
- package/dist/components/password-input/index.mjs +21 -0
- package/dist/components/pin-input/index.d.mts +15 -0
- package/dist/components/pin-input/index.mjs +20 -0
- package/dist/components/popconfirm/index.d.mts +20 -0
- package/dist/components/popconfirm/index.mjs +44 -0
- package/dist/components/popover/index.d.mts +8 -0
- package/dist/components/popover/index.mjs +11 -0
- package/dist/components/presence/index.d.mts +2 -0
- package/dist/components/presence/index.mjs +2 -0
- package/dist/components/progress/index.d.mts +16 -0
- package/dist/components/progress/index.mjs +21 -0
- package/dist/components/progress-group/index.d.mts +22 -0
- package/dist/components/progress-group/index.mjs +56 -0
- package/dist/components/qr-code/index.d.mts +8 -0
- package/dist/components/qr-code/index.mjs +11 -0
- package/dist/components/radio-group/index.d.mts +16 -0
- package/dist/components/radio-group/index.mjs +21 -0
- package/dist/components/rating-group/index.d.mts +16 -0
- package/dist/components/rating-group/index.mjs +21 -0
- package/dist/components/scroll-area/index.d.mts +7 -0
- package/dist/components/scroll-area/index.mjs +10 -0
- package/dist/components/segment-group/index.d.mts +18 -0
- package/dist/components/segment-group/index.mjs +20 -0
- package/dist/components/select/index.d.mts +17 -0
- package/dist/components/select/index.mjs +18 -0
- package/dist/components/separator/index.d.mts +11 -0
- package/dist/components/separator/index.mjs +16 -0
- package/dist/components/signature-pad/index.d.mts +8 -0
- package/dist/components/signature-pad/index.mjs +11 -0
- package/dist/components/skeleton/index.d.mts +7 -0
- package/dist/components/skeleton/index.mjs +13 -0
- package/dist/components/slider/index.d.mts +16 -0
- package/dist/components/slider/index.mjs +21 -0
- package/dist/components/spinner/index.d.mts +9 -0
- package/dist/components/spinner/index.mjs +36 -0
- package/dist/components/split-button/index.d.mts +36 -0
- package/dist/components/split-button/index.mjs +71 -0
- package/dist/components/splitter/index.d.mts +7 -0
- package/dist/components/splitter/index.mjs +10 -0
- package/dist/components/stack/index.d.mts +11 -0
- package/dist/components/stack/index.mjs +32 -0
- package/dist/components/stat/index.d.mts +29 -0
- package/dist/components/stat/index.mjs +37 -0
- package/dist/components/steps/index.d.mts +19 -0
- package/dist/components/steps/index.mjs +24 -0
- package/dist/components/swap/index.d.mts +8 -0
- package/dist/components/swap/index.mjs +11 -0
- package/dist/components/switch/index.d.mts +16 -0
- package/dist/components/switch/index.mjs +21 -0
- package/dist/components/table/index.d.mts +79 -0
- package/dist/components/table/index.mjs +688 -0
- package/dist/components/tabs/index.d.mts +18 -0
- package/dist/components/tabs/index.mjs +23 -0
- package/dist/components/tags-input/index.d.mts +17 -0
- package/dist/components/tags-input/index.mjs +22 -0
- package/dist/components/textarea/index.d.mts +14 -0
- package/dist/components/textarea/index.mjs +20 -0
- package/dist/components/timeline/index.d.mts +24 -0
- package/dist/components/timeline/index.mjs +30 -0
- package/dist/components/timer/index.d.mts +8 -0
- package/dist/components/timer/index.mjs +11 -0
- package/dist/components/toast/index.d.mts +11 -0
- package/dist/components/toast/index.mjs +13 -0
- package/dist/components/toc/index.d.mts +7 -0
- package/dist/components/toc/index.mjs +10 -0
- package/dist/components/toggle/index.d.mts +7 -0
- package/dist/components/toggle/index.mjs +10 -0
- package/dist/components/toggle-group/index.d.mts +15 -0
- package/dist/components/toggle-group/index.mjs +20 -0
- package/dist/components/tooltip/index.d.mts +7 -0
- package/dist/components/tooltip/index.mjs +10 -0
- package/dist/components/tour/index.d.mts +11 -0
- package/dist/components/tour/index.mjs +13 -0
- package/dist/components/transfer/index.d.mts +23 -0
- package/dist/components/transfer/index.mjs +154 -0
- package/dist/components/tree-select/index.d.mts +28 -0
- package/dist/components/tree-select/index.mjs +157 -0
- package/dist/components/tree-view/index.d.mts +19 -0
- package/dist/components/tree-view/index.mjs +18 -0
- package/dist/components/typography/index.d.mts +32 -0
- package/dist/components/typography/index.mjs +34 -0
- package/dist/components/watermark/index.d.mts +16 -0
- package/dist/components/watermark/index.mjs +80 -0
- package/dist/index-DaAbbSz9.d.mts +13416 -0
- package/dist/index-Uefyw7Im.d.mts +108 -0
- package/dist/index-uPyYiWaL.d.mts +1813 -0
- package/dist/index.d.mts +128 -15218
- package/dist/index.mjs +128 -4556
- package/dist/mentions-DMIBCBOd.mjs +181 -0
- package/package.json +77 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/image/index.d.ts
|
|
3
|
+
/** A framed picture: while the source loads, the frame keeps the
|
|
4
|
+
* skeleton's breath; the picture dissolves in when it lands; a broken
|
|
5
|
+
* source leaves the `fallback` — or the placeholder glyph when the
|
|
6
|
+
* caller has nothing local to say. The frame's size is the consumer's
|
|
7
|
+
* to give. */
|
|
8
|
+
export interface ImageProps extends Omit<HTMLAttributes<HTMLElement>, "onError" | "onLoad"> {
|
|
9
|
+
src: string;
|
|
10
|
+
alt?: string;
|
|
11
|
+
fit?: "cover" | "contain" | "fill" | "none";
|
|
12
|
+
loading?: "lazy" | "eager";
|
|
13
|
+
/** Shown in place of the picture when the source breaks. */
|
|
14
|
+
fallback?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare function Image({ src, alt, fit, loading, fallback, ...rest }: ImageProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
//#region src/components/image/index.tsx
|
|
5
|
+
/** The mark for a source that never arrived: a quiet mountain-and-sun,
|
|
6
|
+
* drawn in the stylesheet's stroke and hidden from the reader. */
|
|
7
|
+
function placeholderGlyph() {
|
|
8
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx("rect", {
|
|
15
|
+
x: 3,
|
|
16
|
+
y: 4,
|
|
17
|
+
width: 18,
|
|
18
|
+
height: 16,
|
|
19
|
+
rx: 1.5
|
|
20
|
+
}),
|
|
21
|
+
/* @__PURE__ */ jsx("circle", {
|
|
22
|
+
cx: 9,
|
|
23
|
+
cy: 10,
|
|
24
|
+
r: 1.5
|
|
25
|
+
}),
|
|
26
|
+
/* @__PURE__ */ jsx("path", { d: "m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5" })
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function Image({ src, alt = "", fit = "cover", loading = "lazy", fallback, ...rest }) {
|
|
31
|
+
injectComponentStyle("image");
|
|
32
|
+
const [state, setState] = useState("loading");
|
|
33
|
+
useEffect(() => setState("loading"), [src]);
|
|
34
|
+
return /* @__PURE__ */ jsxs("figure", {
|
|
35
|
+
...rest,
|
|
36
|
+
"data-scope": "image",
|
|
37
|
+
"data-part": "root",
|
|
38
|
+
"data-state": state,
|
|
39
|
+
"data-fit": fit,
|
|
40
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
41
|
+
"data-scope": "image",
|
|
42
|
+
"data-part": "img",
|
|
43
|
+
src,
|
|
44
|
+
alt,
|
|
45
|
+
loading,
|
|
46
|
+
decoding: "async",
|
|
47
|
+
onLoad: () => setState("loaded"),
|
|
48
|
+
onError: () => setState("error")
|
|
49
|
+
}), state === "error" ? /* @__PURE__ */ jsx("div", {
|
|
50
|
+
"data-scope": "image",
|
|
51
|
+
"data-part": "fallback",
|
|
52
|
+
children: fallback ?? placeholderGlyph()
|
|
53
|
+
}) : null]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { Image };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ImageCropper as ImageCropper$1 } from "@ark-ui/react/image-cropper";
|
|
2
|
+
//#region src/components/image-cropper/index.d.ts
|
|
3
|
+
/** Ark's ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
4
|
+
* holding the photograph, one lit selection window framed by light hairlines.
|
|
5
|
+
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
6
|
+
* Context. */
|
|
7
|
+
export declare const ImageCropper: typeof ImageCropper$1;
|
|
8
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { ImageCropper as ImageCropper$1 } from "@ark-ui/react/image-cropper";
|
|
3
|
+
//#region src/components/image-cropper/index.tsx
|
|
4
|
+
/** Ark's ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
5
|
+
* holding the photograph, one lit selection window framed by light hairlines.
|
|
6
|
+
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
7
|
+
* Context. */
|
|
8
|
+
const ImageCropper = ImageCropper$1;
|
|
9
|
+
injectComponentStyle("image-cropper");
|
|
10
|
+
//#endregion
|
|
11
|
+
export { ImageCropper };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region src/components/image-viewer/index.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A lightbox: the picture over a dimmed page, with a small toolbar
|
|
4
|
+
* beneath it. Zoom is the reader's hand (half to three times, clamped),
|
|
5
|
+
* a quarter turn at a time rotates, Escape and the scrim close — the
|
|
6
|
+
* dialog machine carries the modal part. `open` may stay with the
|
|
7
|
+
* caller; left undefined the viewer keeps it to itself.
|
|
8
|
+
*/
|
|
9
|
+
export interface ImageViewerProps {
|
|
10
|
+
src: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
zoomable?: boolean;
|
|
14
|
+
/** Reports the viewer's next state. */
|
|
15
|
+
onOpenChange?: (open: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function ImageViewer({ src, alt, open, zoomable, onOpenChange }: ImageViewerProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { ButtonGroup } from "../button-group/index.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
7
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
8
|
+
//#region src/components/image-viewer/index.tsx
|
|
9
|
+
const MIN_SCALE = .5;
|
|
10
|
+
const MAX_SCALE = 3;
|
|
11
|
+
const SCALE_STEP = .25;
|
|
12
|
+
/** The toolbar's line-drawn glyphs, fresh per render. */
|
|
13
|
+
const TOOL_GLYPHS = {
|
|
14
|
+
zoomIn: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx("circle", {
|
|
16
|
+
cx: 11,
|
|
17
|
+
cy: 11,
|
|
18
|
+
r: 7
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ jsx("path", { d: "m16.2 16.2 4.8 4.8" }),
|
|
21
|
+
/* @__PURE__ */ jsx("path", { d: "M8 11h6" }),
|
|
22
|
+
/* @__PURE__ */ jsx("path", { d: "M11 8v6" })
|
|
23
|
+
] }),
|
|
24
|
+
zoomOut: () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("circle", {
|
|
26
|
+
cx: 11,
|
|
27
|
+
cy: 11,
|
|
28
|
+
r: 7
|
|
29
|
+
}),
|
|
30
|
+
/* @__PURE__ */ jsx("path", { d: "m16.2 16.2 4.8 4.8" }),
|
|
31
|
+
/* @__PURE__ */ jsx("path", { d: "M8 11h6" })
|
|
32
|
+
] }),
|
|
33
|
+
rotate: () => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "M20.49 12A8.5 8.5 0 1 1 18 6.06" }), /* @__PURE__ */ jsx("path", { d: "M20.5 3.5v4h-4" })] }),
|
|
34
|
+
close: () => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" }), /* @__PURE__ */ jsx("path", { d: "M18 6 6 18" })] })
|
|
35
|
+
};
|
|
36
|
+
function ImageViewer({ src, alt = "", open, zoomable = true, onOpenChange }) {
|
|
37
|
+
injectComponentStyle("image-viewer");
|
|
38
|
+
const [localOpen, setLocalOpen] = useState(false);
|
|
39
|
+
const [scale, setScale] = useState(1);
|
|
40
|
+
const [rotation, setRotation] = useState(0);
|
|
41
|
+
const isOpen = open ?? localOpen;
|
|
42
|
+
const setOpen = (value) => {
|
|
43
|
+
if (open === void 0) setLocalOpen(value);
|
|
44
|
+
onOpenChange?.(value);
|
|
45
|
+
};
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (isOpen) {
|
|
48
|
+
setScale(1);
|
|
49
|
+
setRotation(0);
|
|
50
|
+
}
|
|
51
|
+
}, [isOpen]);
|
|
52
|
+
function zoom(step) {
|
|
53
|
+
setScale((current) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, current + step)));
|
|
54
|
+
}
|
|
55
|
+
function rotate() {
|
|
56
|
+
setRotation((current) => (current + 90) % 360);
|
|
57
|
+
}
|
|
58
|
+
function toolButton(label, glyph, onClick) {
|
|
59
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
60
|
+
variant: "ghost",
|
|
61
|
+
square: true,
|
|
62
|
+
size: "lg",
|
|
63
|
+
"aria-label": label,
|
|
64
|
+
onClick,
|
|
65
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
66
|
+
viewBox: "0 0 24 24",
|
|
67
|
+
fill: "none",
|
|
68
|
+
stroke: "currentColor",
|
|
69
|
+
strokeWidth: 1.5,
|
|
70
|
+
strokeLinecap: "round",
|
|
71
|
+
strokeLinejoin: "round",
|
|
72
|
+
"aria-hidden": "true",
|
|
73
|
+
children: glyph()
|
|
74
|
+
})
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
78
|
+
open: isOpen,
|
|
79
|
+
onOpenChange: (details) => setOpen(details.open),
|
|
80
|
+
lazyMount: true,
|
|
81
|
+
unmountOnExit: true,
|
|
82
|
+
children: /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "bs-image-viewer-backdrop" }), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
83
|
+
className: "bs-image-viewer-positioner",
|
|
84
|
+
children: /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
85
|
+
className: "bs-image-viewer-content",
|
|
86
|
+
"aria-label": alt || "Image preview",
|
|
87
|
+
onClick: (event) => {
|
|
88
|
+
if (event.target === event.currentTarget) setOpen(false);
|
|
89
|
+
},
|
|
90
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
91
|
+
"data-scope": "image-viewer",
|
|
92
|
+
"data-part": "viewport",
|
|
93
|
+
src,
|
|
94
|
+
alt,
|
|
95
|
+
style: { transform: `scale(${scale}) rotate(${rotation}deg)` }
|
|
96
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
97
|
+
"data-scope": "image-viewer",
|
|
98
|
+
"data-part": "toolbar",
|
|
99
|
+
children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
100
|
+
zoomable ? [toolButton("Zoom in", TOOL_GLYPHS.zoomIn, () => zoom(SCALE_STEP)), toolButton("Zoom out", TOOL_GLYPHS.zoomOut, () => zoom(-.25))] : null,
|
|
101
|
+
toolButton("Rotate 90 degrees", TOOL_GLYPHS.rotate, rotate),
|
|
102
|
+
toolButton("Close", TOOL_GLYPHS.close, () => setOpen(false))
|
|
103
|
+
] })
|
|
104
|
+
})]
|
|
105
|
+
})
|
|
106
|
+
})] })
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { ImageViewer };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InputHTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/input/index.d.ts
|
|
3
|
+
/** The bare text input: the field recipe — border, surface, focus halo —
|
|
4
|
+
* on a native control. Standing alone it styles itself from the `invalid`
|
|
5
|
+
* prop; inside a `Field.Root` it consumes the field context, picking up
|
|
6
|
+
* the label id, the described-by wiring and the invalid state for free,
|
|
7
|
+
* which is also the seam the Form validation layer will drive. Disabled
|
|
8
|
+
* rides the native attribute. */
|
|
9
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
10
|
+
value?: string | number;
|
|
11
|
+
size?: "sm" | "md" | "lg";
|
|
12
|
+
invalid?: boolean;
|
|
13
|
+
onValueChange?: (value: string) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function Input({ value, size, invalid, onValueChange, ...rest }: InputProps): import("react").JSX.Element;
|
|
16
|
+
//#endregion
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useFieldContext } from "@ark-ui/react/field";
|
|
4
|
+
//#region src/components/input/index.tsx
|
|
5
|
+
function Input({ value, size = "md", invalid = false, onValueChange, ...rest }) {
|
|
6
|
+
injectComponentStyle("input");
|
|
7
|
+
const field = useFieldContext();
|
|
8
|
+
const fieldProps = field?.getInputProps() ?? {};
|
|
9
|
+
return /* @__PURE__ */ jsx("input", {
|
|
10
|
+
...fieldProps,
|
|
11
|
+
...rest,
|
|
12
|
+
...value !== void 0 ? { value } : {},
|
|
13
|
+
"data-scope": "input",
|
|
14
|
+
"data-part": "root",
|
|
15
|
+
"data-size": size,
|
|
16
|
+
"data-invalid": invalid || field?.invalid ? "" : void 0,
|
|
17
|
+
onChange: (event) => onValueChange?.(event.target.value)
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Input };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/input-group/index.d.ts
|
|
3
|
+
export type InputGroupPartProps = HTMLAttributes<HTMLDivElement>;
|
|
4
|
+
export declare const InputGroup: {
|
|
5
|
+
({ children, ...rest }: InputGroupPartProps): import("react").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
} & {
|
|
8
|
+
Root: {
|
|
9
|
+
({ children, ...rest }: InputGroupPartProps): import("react").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Addon: {
|
|
13
|
+
({ children, ...rest }: InputGroupPartProps): import("react").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/input-group/index.tsx
|
|
4
|
+
function part(name) {
|
|
5
|
+
const Component = ({ children, ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
6
|
+
...rest,
|
|
7
|
+
"data-scope": "input-group",
|
|
8
|
+
"data-part": name.toLowerCase(),
|
|
9
|
+
children
|
|
10
|
+
});
|
|
11
|
+
Component.displayName = "InputGroup" + name;
|
|
12
|
+
return Component;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Merged controls: attachments and the entry fused into one seal. The
|
|
16
|
+
* Root draws the single hairline and carries the group's focus halo;
|
|
17
|
+
* the Addon is a recessed cell for the reader's fixed words — a scheme,
|
|
18
|
+
* a unit, a quiet button — placed before or after the entry. Put our
|
|
19
|
+
* Input (or Textarea) inside and its own border and halo step aside in
|
|
20
|
+
* favor of the group's; the stylesheet does the merging, the wrapper
|
|
21
|
+
* adds no visuals of its own.
|
|
22
|
+
*/
|
|
23
|
+
const Root = part("Root");
|
|
24
|
+
const Addon = part("Addon");
|
|
25
|
+
const InputGroup = Object.assign(Root, {
|
|
26
|
+
Root,
|
|
27
|
+
Addon
|
|
28
|
+
});
|
|
29
|
+
injectComponentStyle("input-group");
|
|
30
|
+
//#endregion
|
|
31
|
+
export { InputGroup };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/react/json-tree-view";
|
|
2
|
+
//#region src/components/json-tree-view/index.d.ts
|
|
3
|
+
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
4
|
+
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
5
|
+
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
6
|
+
export declare const JsonTreeView: typeof JsonTreeView$1;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/react/json-tree-view";
|
|
3
|
+
//#region src/components/json-tree-view/index.tsx
|
|
4
|
+
/** Ark's JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
5
|
+
* recipes re-scoped, with value nodes reading as tabular data. The API is
|
|
6
|
+
* Ark's own — Root, Tree, plus createJsonTreeCollection. */
|
|
7
|
+
const JsonTreeView = JsonTreeView$1;
|
|
8
|
+
injectComponentStyle("json-tree-view");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { JsonTreeView };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/kbd/index.d.ts
|
|
3
|
+
/** A keycap in miniature, riding the type it annotates. */
|
|
4
|
+
export type KbdProps = HTMLAttributes<HTMLElement>;
|
|
5
|
+
export declare function Kbd({ children, ...rest }: KbdProps): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/kbd/index.tsx
|
|
4
|
+
function Kbd({ children, ...rest }) {
|
|
5
|
+
injectComponentStyle("kbd");
|
|
6
|
+
return /* @__PURE__ */ jsx("kbd", {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-scope": "kbd",
|
|
9
|
+
"data-part": "root",
|
|
10
|
+
children
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { Kbd };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/layout/index.d.ts
|
|
3
|
+
/** Declare which edge the skeleton reserves for its sider — without
|
|
4
|
+
* it the root is a single column. */
|
|
5
|
+
export interface LayoutRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
sider?: "start" | "end";
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/** Which edge the enclosing root reserves for its rail — shared so the
|
|
10
|
+
* sider's resize handle knows which way the hand pulls. */
|
|
11
|
+
export interface LayoutContextValue {
|
|
12
|
+
siderPlacement: () => "start" | "end" | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The application skeleton: Root, Header, Sider, Content, Footer —
|
|
16
|
+
* the admin arrangement dressed in the paper-and-ink surfaces. The
|
|
17
|
+
* root is a full-height grid; a declared `sider` turns the columns
|
|
18
|
+
* around to meet whichever edge the rail stands on.
|
|
19
|
+
*/
|
|
20
|
+
declare function Root({ sider, children, ...rest }: LayoutRootProps): import("react").JSX.Element;
|
|
21
|
+
export interface LayoutSiderProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
22
|
+
/** The caller drives the fold; the sider mirrors it and echoes every
|
|
23
|
+
* change back through `onCollapsedChange`. */
|
|
24
|
+
collapsed?: boolean;
|
|
25
|
+
/** The rail's resting inline size — a layout parameter, not a visual
|
|
26
|
+
* token, so it rides an inline variable. */
|
|
27
|
+
width?: string;
|
|
28
|
+
/** The inline size when folded. */
|
|
29
|
+
collapsedWidth?: string;
|
|
30
|
+
/** Offer the hairline at the flow edge: the rail's width follows the
|
|
31
|
+
* hand (and the arrow keys), clamped by `minWidth`/`maxWidth`, and
|
|
32
|
+
* every change rides `onWidthChange`. */
|
|
33
|
+
resizable?: boolean;
|
|
34
|
+
/** The rail's narrowest inline size while resizing. */
|
|
35
|
+
minWidth?: string;
|
|
36
|
+
/** The rail's widest inline size while resizing. */
|
|
37
|
+
maxWidth?: string;
|
|
38
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
39
|
+
onWidthChange?: (width: string) => void;
|
|
40
|
+
/** The rail's contents; a function receives `{ collapsed }` so a
|
|
41
|
+
* caller can swap label content while the edge moves. */
|
|
42
|
+
children?: ReactNode | ((state: {
|
|
43
|
+
collapsed: boolean;
|
|
44
|
+
}) => ReactNode);
|
|
45
|
+
}
|
|
46
|
+
declare function Sider({ collapsed, width: widthProp, collapsedWidth, resizable, minWidth, maxWidth, style, onCollapsedChange, onWidthChange, children, ...rest }: LayoutSiderProps): import("react").JSX.Element;
|
|
47
|
+
export declare const Layout: typeof Root & {
|
|
48
|
+
Root: typeof Root;
|
|
49
|
+
Header: {
|
|
50
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
Sider: typeof Sider;
|
|
54
|
+
Content: {
|
|
55
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
56
|
+
displayName: string;
|
|
57
|
+
};
|
|
58
|
+
Footer: {
|
|
59
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
60
|
+
displayName: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//#endregion
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext, useEffect, useRef, useState } from "react";
|
|
4
|
+
//#region src/components/layout/index.tsx
|
|
5
|
+
const LAYOUT_CONTEXT = createContext(null);
|
|
6
|
+
/**
|
|
7
|
+
* The application skeleton: Root, Header, Sider, Content, Footer —
|
|
8
|
+
* the admin arrangement dressed in the paper-and-ink surfaces. The
|
|
9
|
+
* root is a full-height grid; a declared `sider` turns the columns
|
|
10
|
+
* around to meet whichever edge the rail stands on.
|
|
11
|
+
*/
|
|
12
|
+
function Root({ sider, children, ...rest }) {
|
|
13
|
+
return /* @__PURE__ */ jsx(LAYOUT_CONTEXT.Provider, {
|
|
14
|
+
value: { siderPlacement: () => sider },
|
|
15
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
16
|
+
...rest,
|
|
17
|
+
"data-scope": "layout",
|
|
18
|
+
"data-part": "root",
|
|
19
|
+
"data-sider": sider,
|
|
20
|
+
children
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** A semantic block of the skeleton — header, footer, and the flow's
|
|
25
|
+
* main content each land on their native element and their grid area. */
|
|
26
|
+
function region(name, tag) {
|
|
27
|
+
const Tag = tag;
|
|
28
|
+
const Component = ({ children, ...rest }) => /* @__PURE__ */ jsx(Tag, {
|
|
29
|
+
...rest,
|
|
30
|
+
"data-scope": "layout",
|
|
31
|
+
"data-part": name.toLowerCase(),
|
|
32
|
+
children
|
|
33
|
+
});
|
|
34
|
+
Component.displayName = "Layout" + name;
|
|
35
|
+
return Component;
|
|
36
|
+
}
|
|
37
|
+
const Header = region("Header", "header");
|
|
38
|
+
const Content = region("Content", "main");
|
|
39
|
+
const Footer = region("Footer", "footer");
|
|
40
|
+
/** One step of the arrow-key resize, in px. */
|
|
41
|
+
const RESIZE_STEP = 16;
|
|
42
|
+
function Sider({ collapsed = false, width: widthProp, collapsedWidth = "3.5rem", resizable = false, minWidth = "12rem", maxWidth = "24rem", style, onCollapsedChange, onWidthChange, children, ...rest }) {
|
|
43
|
+
const layout = useContext(LAYOUT_CONTEXT);
|
|
44
|
+
const rail = useRef(null);
|
|
45
|
+
const [dragging, setDragging] = useState(false);
|
|
46
|
+
const [innerWidth, setInnerWidth] = useState(widthProp ?? "16rem");
|
|
47
|
+
const width = widthProp !== void 0 ? widthProp : innerWidth;
|
|
48
|
+
const prevCollapsed = useRef(collapsed);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (prevCollapsed.current === collapsed) return;
|
|
51
|
+
prevCollapsed.current = collapsed;
|
|
52
|
+
onCollapsedChange?.(collapsed);
|
|
53
|
+
}, [collapsed, onCollapsedChange]);
|
|
54
|
+
const innerWidthRef = useRef(innerWidth);
|
|
55
|
+
innerWidthRef.current = innerWidth;
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (widthProp === void 0 || widthProp === innerWidthRef.current) return;
|
|
58
|
+
setInnerWidth(widthProp);
|
|
59
|
+
onWidthChange?.(widthProp);
|
|
60
|
+
}, [widthProp, onWidthChange]);
|
|
61
|
+
const applyWidth = (next) => {
|
|
62
|
+
setInnerWidth(next);
|
|
63
|
+
onWidthChange?.(next);
|
|
64
|
+
};
|
|
65
|
+
const dragStart = useRef({
|
|
66
|
+
x: 0,
|
|
67
|
+
width: 0
|
|
68
|
+
});
|
|
69
|
+
const onPointerDown = (event) => {
|
|
70
|
+
setDragging(true);
|
|
71
|
+
dragStart.current = {
|
|
72
|
+
x: event.clientX,
|
|
73
|
+
width: rail.current ? rail.current.getBoundingClientRect().width : 0
|
|
74
|
+
};
|
|
75
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
76
|
+
};
|
|
77
|
+
const onPointerMove = (event) => {
|
|
78
|
+
if (!dragging) return;
|
|
79
|
+
const towardFlow = (layout?.siderPlacement() ?? "start") === "end" ? -1 : 1;
|
|
80
|
+
applyWidth(`${Math.round(dragStart.current.width + towardFlow * (event.clientX - dragStart.current.x))}px`);
|
|
81
|
+
};
|
|
82
|
+
const onPointerUp = (event) => {
|
|
83
|
+
setDragging(false);
|
|
84
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
85
|
+
};
|
|
86
|
+
const onKeyDown = (event) => {
|
|
87
|
+
if (event.key !== "ArrowLeft" && event.key !== "ArrowRight") return;
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
const widen = (layout?.siderPlacement() ?? "start") === "end" ? event.key === "ArrowLeft" : event.key === "ArrowRight";
|
|
90
|
+
const current = rail.current ? rail.current.getBoundingClientRect().width : 0;
|
|
91
|
+
applyWidth(`${Math.round(current + (widen ? RESIZE_STEP : -16))}px`);
|
|
92
|
+
};
|
|
93
|
+
const handle = resizable && !collapsed ? /* @__PURE__ */ jsx("div", {
|
|
94
|
+
"data-scope": "layout",
|
|
95
|
+
"data-part": "sider-resize",
|
|
96
|
+
"data-dragging": dragging ? "" : void 0,
|
|
97
|
+
role: "separator",
|
|
98
|
+
"aria-orientation": "vertical",
|
|
99
|
+
tabIndex: 0,
|
|
100
|
+
"aria-label": "Resize sidebar",
|
|
101
|
+
"aria-valuenow": Math.round(rail.current ? rail.current.getBoundingClientRect().width : 0),
|
|
102
|
+
onPointerDown,
|
|
103
|
+
onPointerMove,
|
|
104
|
+
onPointerUp,
|
|
105
|
+
onKeyDown
|
|
106
|
+
}) : null;
|
|
107
|
+
return /* @__PURE__ */ jsxs("aside", {
|
|
108
|
+
...rest,
|
|
109
|
+
ref: rail,
|
|
110
|
+
style: {
|
|
111
|
+
...style,
|
|
112
|
+
"--bs-layout-sider-width": collapsed ? collapsedWidth : width,
|
|
113
|
+
"--bs-layout-sider-min": collapsed ? collapsedWidth : minWidth,
|
|
114
|
+
"--bs-layout-sider-max": collapsed ? collapsedWidth : maxWidth
|
|
115
|
+
},
|
|
116
|
+
"data-scope": "layout",
|
|
117
|
+
"data-part": "sider",
|
|
118
|
+
"data-collapsed": collapsed ? "" : void 0,
|
|
119
|
+
"data-dragging": dragging ? "" : void 0,
|
|
120
|
+
"data-resizable": resizable ? "" : void 0,
|
|
121
|
+
children: [typeof children === "function" ? children({ collapsed }) : children, handle]
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const Layout = Object.assign(Root, {
|
|
125
|
+
Root,
|
|
126
|
+
Header,
|
|
127
|
+
Sider,
|
|
128
|
+
Content,
|
|
129
|
+
Footer
|
|
130
|
+
});
|
|
131
|
+
injectComponentStyle("layout");
|
|
132
|
+
//#endregion
|
|
133
|
+
export { Layout };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/link/index.d.ts
|
|
3
|
+
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
4
|
+
underline?: "always" | "hover" | "none";
|
|
5
|
+
}
|
|
6
|
+
/** A link is ink in the accent's voice: quiet at rest, deepening under
|
|
7
|
+
* the hand, the halo at focus. The underline follows the prose —
|
|
8
|
+
* always, on hover, or never. */
|
|
9
|
+
export declare function Link({ underline, children, ...rest }: LinkProps): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/link/index.tsx
|
|
4
|
+
/** A link is ink in the accent's voice: quiet at rest, deepening under
|
|
5
|
+
* the hand, the halo at focus. The underline follows the prose —
|
|
6
|
+
* always, on hover, or never. */
|
|
7
|
+
function Link({ underline = "hover", children, ...rest }) {
|
|
8
|
+
injectComponentStyle("link");
|
|
9
|
+
return /* @__PURE__ */ jsx("a", {
|
|
10
|
+
...rest,
|
|
11
|
+
"data-scope": "link",
|
|
12
|
+
"data-part": "root",
|
|
13
|
+
"data-underline": underline,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Link };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/list/index.d.ts
|
|
3
|
+
export interface ListRootProps extends HTMLAttributes<HTMLUListElement> {
|
|
4
|
+
/** One hairline between rows. */
|
|
5
|
+
bordered?: boolean;
|
|
6
|
+
/** Every row answers the pointer with a wash. */
|
|
7
|
+
hoverable?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare function Root({ bordered, hoverable, children, ...rest }: ListRootProps): import("react").JSX.Element;
|
|
10
|
+
declare namespace Root {
|
|
11
|
+
var displayName: string;
|
|
12
|
+
}
|
|
13
|
+
/** The row's words: `title` and `description` ride their own slots, the
|
|
14
|
+
* children follow them for anything else. */
|
|
15
|
+
export interface ListContentProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
16
|
+
title?: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
declare function Content({ title, description, children, ...rest }: ListContentProps): import("react").JSX.Element;
|
|
20
|
+
declare namespace Content {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const List: typeof Root & {
|
|
24
|
+
Root: typeof Root;
|
|
25
|
+
Item: {
|
|
26
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
Leading: {
|
|
30
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Content: typeof Content;
|
|
34
|
+
Actions: {
|
|
35
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
36
|
+
displayName: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|