@bysages/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +29 -12
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +19 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +17 -17
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +8 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +9 -2
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +13 -18
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/breadcrumb/index.d.mts +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +18 -37
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +15 -3
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +8 -2
- package/dist/components/config-provider/index.mjs +5 -2
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +7 -3
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +13 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +36 -9
- package/dist/components/file-upload/index.mjs +66 -11
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +11 -2
- package/dist/components/image/index.mjs +16 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -18
- package/dist/components/image-viewer/index.mjs +3 -109
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +20 -4
- package/dist/components/json-tree-view/index.mjs +38 -4
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +159 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +34 -33
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +6 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +27 -3
- package/dist/components/steps/index.mjs +36 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +44 -70
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +8 -3
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +24 -4
- package/dist/components/toc/index.mjs +41 -3
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +20 -30
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +15 -24
- package/dist/components/tree-view/index.d.mts +30 -1
- package/dist/components/tree-view/index.mjs +69 -6
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
- package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +13 -12
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/select-D1xiT1oJ.mjs +0 -68
|
@@ -1,10 +1,41 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { HoverCard as HoverCard$1 } from "@ark-ui/react/hover-card";
|
|
3
5
|
//#region src/components/hover-card/index.tsx
|
|
4
6
|
/** Ark's HoverCard, dressed in the paper-and-ink system: a preview card
|
|
5
7
|
* that dissolves in over a quiet inline link, never stealing focus. The
|
|
6
8
|
* API is Ark's own — Root, Trigger, Positioner, Content, Arrow, ArrowTip. */
|
|
7
|
-
|
|
9
|
+
function HoverCardRoot(props) {
|
|
10
|
+
const id = useElementId("hover-card", props);
|
|
11
|
+
return /* @__PURE__ */ jsx(HoverCard$1.Root, {
|
|
12
|
+
...props,
|
|
13
|
+
id
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function HoverCardFacade({ open, defaultOpen, trigger, content, label, description, disabled = false, placement, children, onOpenChange }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(HoverCardRoot, {
|
|
18
|
+
...placement === void 0 ? {} : { positioning: { placement } },
|
|
19
|
+
...open === void 0 ? {} : { open },
|
|
20
|
+
...defaultOpen === void 0 ? {} : { defaultOpen },
|
|
21
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
22
|
+
children: [/* @__PURE__ */ jsx(HoverCard$1.Trigger, {
|
|
23
|
+
disabled,
|
|
24
|
+
children: trigger
|
|
25
|
+
}), /* @__PURE__ */ jsx(HoverCard$1.Positioner, { children: /* @__PURE__ */ jsxs(HoverCard$1.Content, { children: [
|
|
26
|
+
/* @__PURE__ */ jsx(HoverCard$1.Arrow, { children: /* @__PURE__ */ jsx(HoverCard$1.ArrowTip, {}) }),
|
|
27
|
+
/* @__PURE__ */ jsx("h3", { children: label }),
|
|
28
|
+
description ? /* @__PURE__ */ jsx("p", { children: description }) : null,
|
|
29
|
+
content ? /* @__PURE__ */ jsx("p", { children: content }) : null,
|
|
30
|
+
children
|
|
31
|
+
] }) })]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
HoverCardFacade.displayName = "SHoverCard";
|
|
35
|
+
const HoverCard = Object.assign(HoverCardFacade, {
|
|
36
|
+
...HoverCard$1,
|
|
37
|
+
Root: HoverCardRoot
|
|
38
|
+
});
|
|
8
39
|
injectComponentStyle("hover-card");
|
|
9
40
|
//#endregion
|
|
10
41
|
export { HoverCard };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes } from "react";
|
|
2
1
|
import { IconifyIcon } from "@bysages/core/icons";
|
|
2
|
+
import { HTMLAttributes } from "react";
|
|
3
3
|
//#region src/components/icon/index.d.ts
|
|
4
4
|
/** The inkwell: a standard box that keeps any inline svg at its optical
|
|
5
5
|
* measure and in the text's own ink — the icon carries no pigment and no
|
|
6
|
-
* size of its own. Bring
|
|
7
|
-
*
|
|
8
|
-
* own; the well renders either. */
|
|
6
|
+
* size of its own. Bring an `@bysages/icons` export or any other
|
|
7
|
+
* IconifyIcon through `glyph`, a built-in core-registry name through
|
|
8
|
+
* `name`, or your own svg; the well renders either. */
|
|
9
9
|
export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
|
|
10
10
|
/** Size steps follow the surrounding font size; `inherit` is the
|
|
11
11
|
* default — one em of the text the icon sits in. */
|
|
@@ -13,12 +13,14 @@ export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
13
13
|
/** The accessible name. Without it the icon is presentation-only and
|
|
14
14
|
* hidden from the accessibility tree. */
|
|
15
15
|
label?: string;
|
|
16
|
-
/**
|
|
16
|
+
/** An `@bysages/icons` export or any IconifyIcon. Ignored when children
|
|
17
17
|
* are given — an explicit glyph always wins. */
|
|
18
18
|
glyph?: IconifyIcon;
|
|
19
|
-
/** A
|
|
20
|
-
* themselves. Ignored when `glyph` or children are given. */
|
|
19
|
+
/** A built-in name from the curated core registry. Ignored when `glyph` or children are given. */
|
|
21
20
|
name?: string;
|
|
22
21
|
}
|
|
23
|
-
|
|
22
|
+
declare function IconImpl({ size, label, glyph, name, children, ...rest }: IconProps): import("react").JSX.Element;
|
|
23
|
+
export declare const Icon: typeof IconImpl & {
|
|
24
|
+
Root: typeof IconImpl;
|
|
25
|
+
};
|
|
24
26
|
//#endregion
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { getIcon } from "@bysages/core/icons";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/icon/index.tsx
|
|
5
|
-
function
|
|
6
|
+
function IconImpl({ size = "inherit", label, glyph, name, children, ...rest }) {
|
|
6
7
|
injectComponentStyle("icon");
|
|
7
8
|
const resolved = glyph ?? (name && children == null ? getIcon(name) : void 0);
|
|
8
|
-
if (name && children == null && glyph == null && !resolved) console.error(`[icons] unknown icon name "${name}" — not in the
|
|
9
|
+
if (name && children == null && glyph == null && !resolved) console.error(`[icons] unknown icon name "${name}" — not in the core default registry; pass it explicitly as glyph`);
|
|
9
10
|
return /* @__PURE__ */ jsx("span", {
|
|
10
11
|
...rest,
|
|
11
12
|
role: label != null ? "img" : void 0,
|
|
@@ -22,5 +23,6 @@ function Icon({ size = "inherit", label, glyph, name, children, ...rest }) {
|
|
|
22
23
|
}) : null)
|
|
23
24
|
});
|
|
24
25
|
}
|
|
26
|
+
const Icon = withSelfRoot(IconImpl);
|
|
25
27
|
//#endregion
|
|
26
28
|
export { Icon };
|
|
@@ -2,7 +2,7 @@ import { HTMLAttributes, ReactNode } from "react";
|
|
|
2
2
|
//#region src/components/image/index.d.ts
|
|
3
3
|
/** A framed picture: while the source loads, the frame keeps the
|
|
4
4
|
* skeleton's breath; the picture dissolves in when it lands; a broken
|
|
5
|
-
* source leaves the `fallback` — or the placeholder
|
|
5
|
+
* source leaves the `fallback` — or the placeholder icon when the
|
|
6
6
|
* caller has nothing local to say. The frame's size is the consumer's
|
|
7
7
|
* to give. */
|
|
8
8
|
export interface ImageProps extends Omit<HTMLAttributes<HTMLElement>, "onError" | "onLoad"> {
|
|
@@ -10,8 +10,17 @@ export interface ImageProps extends Omit<HTMLAttributes<HTMLElement>, "onError"
|
|
|
10
10
|
alt?: string;
|
|
11
11
|
fit?: "cover" | "contain" | "fill" | "none";
|
|
12
12
|
loading?: "lazy" | "eager";
|
|
13
|
+
/** Intrinsic rendered width, reserved on the image to avoid layout
|
|
14
|
+
* shift while the source loads. */
|
|
15
|
+
width?: number | string;
|
|
16
|
+
/** Intrinsic rendered height, reserved on the image to avoid layout
|
|
17
|
+
* shift while the source loads. */
|
|
18
|
+
height?: number | string;
|
|
13
19
|
/** Shown in place of the picture when the source breaks. */
|
|
14
20
|
fallback?: ReactNode;
|
|
15
21
|
}
|
|
16
|
-
|
|
22
|
+
declare function ImageImpl({ src, alt, fit, loading, width, height, fallback, ...rest }: ImageProps): import("react").JSX.Element;
|
|
23
|
+
export declare const Image: typeof ImageImpl & {
|
|
24
|
+
Root: typeof ImageImpl;
|
|
25
|
+
};
|
|
17
26
|
//#endregion
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useEffect, useState } from "react";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
6
|
//#region src/components/image/index.tsx
|
|
5
|
-
|
|
6
|
-
|
|
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 }) {
|
|
7
|
+
const placeholderIcon = iconNode("image");
|
|
8
|
+
function ImageImpl({ src, alt = "", fit = "cover", loading = "lazy", width, height, fallback, ...rest }) {
|
|
31
9
|
injectComponentStyle("image");
|
|
32
10
|
const [state, setState] = useState("loading");
|
|
33
|
-
|
|
11
|
+
const imageRef = useRef(null);
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
setState("loading");
|
|
14
|
+
const image = imageRef.current;
|
|
15
|
+
if (image?.complete) setState(image.naturalWidth > 0 ? "loaded" : "error");
|
|
16
|
+
}, [src]);
|
|
34
17
|
return /* @__PURE__ */ jsxs("figure", {
|
|
35
18
|
...rest,
|
|
36
19
|
"data-scope": "image",
|
|
@@ -38,20 +21,24 @@ function Image({ src, alt = "", fit = "cover", loading = "lazy", fallback, ...re
|
|
|
38
21
|
"data-state": state,
|
|
39
22
|
"data-fit": fit,
|
|
40
23
|
children: [/* @__PURE__ */ jsx("img", {
|
|
24
|
+
ref: imageRef,
|
|
41
25
|
"data-scope": "image",
|
|
42
26
|
"data-part": "img",
|
|
43
27
|
src,
|
|
44
28
|
alt,
|
|
45
29
|
loading,
|
|
46
30
|
decoding: "async",
|
|
31
|
+
width,
|
|
32
|
+
height,
|
|
47
33
|
onLoad: () => setState("loaded"),
|
|
48
34
|
onError: () => setState("error")
|
|
49
35
|
}), state === "error" ? /* @__PURE__ */ jsx("div", {
|
|
50
36
|
"data-scope": "image",
|
|
51
37
|
"data-part": "fallback",
|
|
52
|
-
children: fallback ??
|
|
38
|
+
children: fallback ?? placeholderIcon
|
|
53
39
|
}) : null]
|
|
54
40
|
});
|
|
55
41
|
}
|
|
42
|
+
const Image = withSelfRoot(ImageImpl);
|
|
56
43
|
//#endregion
|
|
57
44
|
export { Image };
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
1
2
|
import { ImageCropper as ImageCropper$1 } from "@ark-ui/react/image-cropper";
|
|
2
3
|
//#region src/components/image-cropper/index.d.ts
|
|
3
|
-
/**
|
|
4
|
+
/** ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
4
5
|
* holding the photograph, one lit selection window framed by light hairlines.
|
|
5
6
|
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
6
7
|
* Context. */
|
|
7
|
-
|
|
8
|
+
declare function ImageCropperRoot(props: ComponentProps<typeof ImageCropper$1.Root>): import("react").JSX.Element;
|
|
9
|
+
export interface ImageCropperFacadeProps {
|
|
10
|
+
src: string;
|
|
11
|
+
alt?: string;
|
|
12
|
+
}
|
|
13
|
+
/** The complete cropper behind one photograph: viewport, selection frame,
|
|
14
|
+
* corner handles, and ruling grid arrive ready to use. */
|
|
15
|
+
declare function ImageCropperFacade({ src, alt }: ImageCropperFacadeProps): import("react").JSX.Element;
|
|
16
|
+
export declare const ImageCropper: typeof ImageCropperFacade & typeof ImageCropper$1 & {
|
|
17
|
+
Root: typeof ImageCropperRoot;
|
|
18
|
+
};
|
|
8
19
|
//#endregion
|
|
@@ -1,11 +1,43 @@
|
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { ImageCropper as ImageCropper$1 } from "@ark-ui/react/image-cropper";
|
|
3
5
|
//#region src/components/image-cropper/index.tsx
|
|
4
|
-
/**
|
|
6
|
+
/** ImageCropper, dressed in the paper-and-ink system: a rounded vessel
|
|
5
7
|
* holding the photograph, one lit selection window framed by light hairlines.
|
|
6
8
|
* The API is Ark's own — Root, Viewport, Image, Selection, Handle, Grid,
|
|
7
9
|
* Context. */
|
|
8
|
-
|
|
10
|
+
function ImageCropperRoot(props) {
|
|
11
|
+
const id = useElementId("image-cropper", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(ImageCropper$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** The complete cropper behind one photograph: viewport, selection frame,
|
|
18
|
+
* corner handles, and ruling grid arrive ready to use. */
|
|
19
|
+
function ImageCropperFacade({ src, alt }) {
|
|
20
|
+
return /* @__PURE__ */ jsx(ImageCropperRoot, { children: /* @__PURE__ */ jsxs(ImageCropper$1.Viewport, { children: [/* @__PURE__ */ jsx(ImageCropper$1.Image, {
|
|
21
|
+
src,
|
|
22
|
+
alt
|
|
23
|
+
}), /* @__PURE__ */ jsxs(ImageCropper$1.Selection, { children: [
|
|
24
|
+
[
|
|
25
|
+
"nw",
|
|
26
|
+
"ne",
|
|
27
|
+
"se",
|
|
28
|
+
"sw"
|
|
29
|
+
].map((position) => /* @__PURE__ */ jsx(ImageCropper$1.Handle, {
|
|
30
|
+
position,
|
|
31
|
+
children: /* @__PURE__ */ jsx("div", {})
|
|
32
|
+
}, position)),
|
|
33
|
+
/* @__PURE__ */ jsx(ImageCropper$1.Grid, { axis: "horizontal" }),
|
|
34
|
+
/* @__PURE__ */ jsx(ImageCropper$1.Grid, { axis: "vertical" })
|
|
35
|
+
] })] }) });
|
|
36
|
+
}
|
|
37
|
+
const ImageCropper = Object.assign(ImageCropperFacade, {
|
|
38
|
+
...ImageCropper$1,
|
|
39
|
+
Root: ImageCropperRoot
|
|
40
|
+
});
|
|
9
41
|
injectComponentStyle("image-cropper");
|
|
10
42
|
//#endregion
|
|
11
43
|
export { ImageCropper };
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
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
|
|
1
|
+
import { n as ImageViewerProps, t as ImageViewer } from "../../index-Dj8S4eyJ.mjs";
|
|
2
|
+
export { ImageViewer, ImageViewerProps };
|
|
@@ -1,110 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
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
|
|
1
|
+
import "../button-group/index.mjs";
|
|
2
|
+
import "../dialog/index.mjs";
|
|
3
|
+
import { t as ImageViewer } from "../../image-viewer-Cf6thHax.mjs";
|
|
110
4
|
export { ImageViewer };
|
|
@@ -15,5 +15,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
|
|
|
15
15
|
mask?: string;
|
|
16
16
|
onValueChange?: (value: string) => void;
|
|
17
17
|
}
|
|
18
|
-
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement
|
|
18
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>> & {
|
|
19
|
+
Root: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
20
|
+
};
|
|
19
21
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as Input } from "../../input-
|
|
1
|
+
import { t as Input } from "../../input-C21Zzuy6.mjs";
|
|
2
2
|
export { Input };
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
1
2
|
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/react/json-tree-view";
|
|
2
3
|
//#region src/components/json-tree-view/index.d.ts
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
4
|
+
/** The auto-rendered tree hands every branch its chevron from the
|
|
5
|
+
* `arrow` element — filled with the house icon unless the consumer
|
|
6
|
+
* draws their own, so a JSON tree never opens as a bare indent. */
|
|
7
|
+
declare function JsonTreeViewTree(props: ComponentProps<typeof JsonTreeView$1.Tree>): import("react").JSX.Element;
|
|
8
|
+
/** JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
9
|
+
* recipes re-scoped, with value nodes reading as tabular data. The parts —
|
|
10
|
+
* Root, Tree, plus createJsonTreeCollection. */
|
|
11
|
+
declare function JsonTreeViewRoot(props: ComponentProps<typeof JsonTreeView$1.Root>): import("react").JSX.Element;
|
|
12
|
+
/** The one-tag path for a read-only tree; custom node rendering stays on
|
|
13
|
+
* the anatomy. */
|
|
14
|
+
declare function JsonTreeViewFacade({ data, defaultExpandedDepth, ...rest }: {
|
|
15
|
+
data: unknown;
|
|
16
|
+
defaultExpandedDepth?: number;
|
|
17
|
+
} & ComponentProps<typeof JsonTreeViewRoot>): import("react").JSX.Element;
|
|
18
|
+
export declare const JsonTreeView: typeof JsonTreeViewFacade & {
|
|
19
|
+
Root: typeof JsonTreeViewRoot;
|
|
20
|
+
Tree: typeof JsonTreeViewTree;
|
|
21
|
+
RootProvider: import("react").ForwardRefExoticComponent<JsonTreeView$1.RootProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
};
|
|
7
23
|
//#endregion
|
|
@@ -1,10 +1,44 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
5
|
import { JsonTreeView as JsonTreeView$1 } from "@ark-ui/react/json-tree-view";
|
|
3
6
|
//#region src/components/json-tree-view/index.tsx
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
|
|
7
|
+
/** The auto-rendered tree hands every branch its chevron from the
|
|
8
|
+
* `arrow` element — filled with the house icon unless the consumer
|
|
9
|
+
* draws their own, so a JSON tree never opens as a bare indent. */
|
|
10
|
+
function JsonTreeViewTree(props) {
|
|
11
|
+
const { arrow = iconNode("chevron-right"), ...rest } = props;
|
|
12
|
+
return /* @__PURE__ */ jsx(JsonTreeView$1.Tree, {
|
|
13
|
+
...rest,
|
|
14
|
+
arrow
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** JsonTreeView, dressed in the paper-and-ink system: the tree-view
|
|
18
|
+
* recipes re-scoped, with value nodes reading as tabular data. The parts —
|
|
19
|
+
* Root, Tree, plus createJsonTreeCollection. */
|
|
20
|
+
function JsonTreeViewRoot(props) {
|
|
21
|
+
const id = useElementId("json-tree-view", props);
|
|
22
|
+
return /* @__PURE__ */ jsx(JsonTreeView$1.Root, {
|
|
23
|
+
...props,
|
|
24
|
+
id
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** The one-tag path for a read-only tree; custom node rendering stays on
|
|
28
|
+
* the anatomy. */
|
|
29
|
+
function JsonTreeViewFacade({ data, defaultExpandedDepth = 1, ...rest }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(JsonTreeViewRoot, {
|
|
31
|
+
...rest,
|
|
32
|
+
data,
|
|
33
|
+
defaultExpandedDepth,
|
|
34
|
+
children: /* @__PURE__ */ jsx(JsonTreeViewTree, {})
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const JsonTreeView = Object.assign(JsonTreeViewFacade, {
|
|
38
|
+
...JsonTreeView$1,
|
|
39
|
+
Root: JsonTreeViewRoot,
|
|
40
|
+
Tree: JsonTreeViewTree
|
|
41
|
+
});
|
|
8
42
|
injectComponentStyle("json-tree-view");
|
|
9
43
|
//#endregion
|
|
10
44
|
export { JsonTreeView };
|
|
@@ -2,5 +2,8 @@ import { HTMLAttributes } from "react";
|
|
|
2
2
|
//#region src/components/kbd/index.d.ts
|
|
3
3
|
/** A keycap in miniature, riding the type it annotates. */
|
|
4
4
|
export type KbdProps = HTMLAttributes<HTMLElement>;
|
|
5
|
-
|
|
5
|
+
declare function KbdImpl({ children, ...rest }: KbdProps): import("react").JSX.Element;
|
|
6
|
+
export declare const Kbd: typeof KbdImpl & {
|
|
7
|
+
Root: typeof KbdImpl;
|
|
8
|
+
};
|
|
6
9
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/kbd/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function KbdImpl({ children, ...rest }) {
|
|
5
6
|
injectComponentStyle("kbd");
|
|
6
7
|
return /* @__PURE__ */ jsx("kbd", {
|
|
7
8
|
...rest,
|
|
@@ -10,5 +11,6 @@ function Kbd({ children, ...rest }) {
|
|
|
10
11
|
children
|
|
11
12
|
});
|
|
12
13
|
}
|
|
14
|
+
const Kbd = withSelfRoot(KbdImpl);
|
|
13
15
|
//#endregion
|
|
14
16
|
export { Kbd };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HTMLAttributes, ReactNode } from "react";
|
|
1
|
+
import { Dispatch, HTMLAttributes, ReactNode, SetStateAction } from "react";
|
|
2
2
|
//#region src/components/layout/index.d.ts
|
|
3
3
|
/** Declare which edge the skeleton reserves for its sider — without
|
|
4
4
|
* it the root is a single column. */
|
|
@@ -6,10 +6,28 @@ export interface LayoutRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
6
6
|
sider?: "start" | "end";
|
|
7
7
|
children?: ReactNode;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
9
|
+
/** Runtime settings the sider shares with its root so the split can be
|
|
10
|
+
* driven by Ark while the public sizing props stay on `Layout.Sider`. */
|
|
11
|
+
export interface LayoutSiderState {
|
|
12
|
+
resizable: boolean;
|
|
13
|
+
collapsed: boolean;
|
|
14
|
+
width: string;
|
|
15
|
+
minWidth: string;
|
|
16
|
+
maxWidth: string;
|
|
17
|
+
}
|
|
18
|
+
export interface LayoutResizeHandlers {
|
|
19
|
+
start: () => void;
|
|
20
|
+
resize: (width: number) => void;
|
|
21
|
+
end: () => void;
|
|
22
|
+
}
|
|
11
23
|
export interface LayoutContextValue {
|
|
12
24
|
siderPlacement: () => "start" | "end" | undefined;
|
|
25
|
+
getSiderState: () => LayoutSiderState | null;
|
|
26
|
+
setSiderState: Dispatch<SetStateAction<LayoutSiderState | null>>;
|
|
27
|
+
setResizeHandlers: (handlers: LayoutResizeHandlers) => void;
|
|
28
|
+
resizeStart: () => void;
|
|
29
|
+
resize: (width: number) => void;
|
|
30
|
+
resizeEnd: () => void;
|
|
13
31
|
}
|
|
14
32
|
/**
|
|
15
33
|
* The application skeleton: Root, Header, Sider, Content, Footer —
|
|
@@ -17,7 +35,7 @@ export interface LayoutContextValue {
|
|
|
17
35
|
* root is a full-height grid; a declared `sider` turns the columns
|
|
18
36
|
* around to meet whichever edge the rail stands on.
|
|
19
37
|
*/
|
|
20
|
-
declare function Root({ sider, children, ...rest }: LayoutRootProps): import("react").JSX.Element;
|
|
38
|
+
declare function Root({ sider, children, style, ...rest }: LayoutRootProps): import("react").JSX.Element;
|
|
21
39
|
export interface LayoutSiderProps extends Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
22
40
|
/** The caller drives the fold; the sider mirrors it and echoes every
|
|
23
41
|
* change back through `onCollapsedChange`. */
|
|
@@ -27,9 +45,9 @@ export interface LayoutSiderProps extends Omit<HTMLAttributes<HTMLElement>, "chi
|
|
|
27
45
|
width?: string;
|
|
28
46
|
/** The inline size when folded. */
|
|
29
47
|
collapsedWidth?: string;
|
|
30
|
-
/** Offer the hairline at the flow edge: the rail's width
|
|
31
|
-
* hand
|
|
32
|
-
* every change rides `onWidthChange`. */
|
|
48
|
+
/** Offer the Ark-powered hairline at the flow edge: the rail's width
|
|
49
|
+
* follows the hand and keyboard, clamped by `minWidth`/`maxWidth`,
|
|
50
|
+
* and every change rides `onWidthChange`. */
|
|
33
51
|
resizable?: boolean;
|
|
34
52
|
/** The rail's narrowest inline size while resizing. */
|
|
35
53
|
minWidth?: string;
|