@bysages/react 0.2.2 → 0.3.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/README.md +16 -2
- 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 +23 -0
- package/dist/components/avatar/index.mjs +15 -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/bento/index.d.mts +26 -0
- package/dist/components/bento/index.mjs +41 -0
- package/dist/components/block-ui/index.d.mts +12 -0
- package/dist/components/block-ui/index.mjs +24 -0
- package/dist/components/breadcrumb/index.d.mts +32 -0
- package/dist/components/breadcrumb/index.mjs +35 -0
- package/dist/components/browser/index.d.mts +23 -0
- package/dist/components/browser/index.mjs +70 -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 +229 -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/data-view/index.d.mts +18 -0
- package/dist/components/data-view/index.mjs +64 -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/deferred-content/index.d.mts +16 -0
- package/dist/components/deferred-content/index.mjs +34 -0
- package/dist/components/descriptions/index.d.mts +33 -0
- package/dist/components/descriptions/index.mjs +50 -0
- package/dist/components/dialog/index.d.mts +9 -0
- package/dist/components/dialog/index.mjs +11 -0
- package/dist/components/dock/index.d.mts +25 -0
- package/dist/components/dock/index.mjs +51 -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 +24 -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 +19 -0
- package/dist/components/input/index.mjs +2 -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/order-list/index.d.mts +21 -0
- package/dist/components/order-list/index.mjs +162 -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/result/index.d.mts +31 -0
- package/dist/components/result/index.mjs +59 -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 +2 -0
- package/dist/components/select/index.mjs +2 -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/spotlight/index.d.mts +12 -0
- package/dist/components/spotlight/index.mjs +33 -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 +20 -0
- package/dist/components/tabs/index.mjs +24 -0
- package/dist/components/tags-input/index.d.mts +17 -0
- package/dist/components/tags-input/index.mjs +22 -0
- package/dist/components/terminal/index.d.mts +17 -0
- package/dist/components/terminal/index.mjs +65 -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 +26 -0
- package/dist/components/timeline/index.mjs +40 -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/toolbar/index.d.mts +17 -0
- package/dist/components/toolbar/index.mjs +29 -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/user/index.d.mts +20 -0
- package/dist/components/user/index.mjs +42 -0
- package/dist/components/virtual-list/index.d.mts +17 -0
- package/dist/components/virtual-list/index.mjs +52 -0
- package/dist/components/watermark/index.d.mts +16 -0
- package/dist/components/watermark/index.mjs +80 -0
- package/dist/index-CsfxYv6J.d.mts +10383 -0
- package/dist/index-DFN9F5Zt.d.mts +42 -0
- package/dist/index-Uefyw7Im.d.mts +108 -0
- package/dist/index-uPyYiWaL.d.mts +1813 -0
- package/dist/index.d.mts +141 -15446
- package/dist/index.mjs +141 -4871
- package/dist/input-2oezH-dY.mjs +58 -0
- package/dist/mentions-DMIBCBOd.mjs +181 -0
- package/dist/select-D1xiT1oJ.mjs +68 -0
- package/package.json +103 -9
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/float-button/index.d.ts
|
|
3
|
+
export type FloatButtonPlacement = "bottom-end" | "bottom-start" | "top-end" | "top-start";
|
|
4
|
+
export type FloatButtonSize = "sm" | "md" | "lg";
|
|
5
|
+
/** The group's openness, shared from the mooring to its parts. */
|
|
6
|
+
export interface FloatButtonContextValue {
|
|
7
|
+
open: boolean;
|
|
8
|
+
/** The group's button rung; the trigger takes it whole, the items
|
|
9
|
+
* step down one. */
|
|
10
|
+
size: FloatButtonSize;
|
|
11
|
+
toggle: () => void;
|
|
12
|
+
/** Folds the fan — an Item calls this once its action fires, the way
|
|
13
|
+
* a speed dial closes after a choice. */
|
|
14
|
+
close: () => void;
|
|
15
|
+
}
|
|
16
|
+
/** Context for {@link FloatButtonContextValue}, exported so a custom
|
|
17
|
+
* part can read the group's state. */
|
|
18
|
+
export declare const FLOAT_BUTTON_CONTEXT: import("react").Context<FloatButtonContextValue | null>;
|
|
19
|
+
export interface FloatButtonRootProps extends HTMLAttributes<HTMLDivElement> {
|
|
20
|
+
/** Controlled openness: leave unset to let the group hold its own
|
|
21
|
+
* state; while set, the Trigger reports back through
|
|
22
|
+
* `onOpenChange`. */
|
|
23
|
+
open?: boolean;
|
|
24
|
+
/** Which corner the group moors at. */
|
|
25
|
+
placement?: FloatButtonPlacement;
|
|
26
|
+
/** One rung of the button ladder for the whole group. */
|
|
27
|
+
size?: FloatButtonSize;
|
|
28
|
+
onOpenChange?: (open: boolean) => void;
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A floating action and its fanned-out alternatives — FAB and speed
|
|
33
|
+
* dial in one family. The Root moors the group at a page corner and
|
|
34
|
+
* holds the openness (mirrored from `open` when controlled); the
|
|
35
|
+
* Trigger flips it; each Item is a round action with its name surfacing
|
|
36
|
+
* beside it while the group is open. The buttons are the shared recipe
|
|
37
|
+
* (vessels here: round); this family owns only the mooring, the fan
|
|
38
|
+
* and the fold.
|
|
39
|
+
*/
|
|
40
|
+
declare function Root({ open: openProp, placement, size, onOpenChange, children, ...rest }: FloatButtonRootProps): import("react").JSX.Element;
|
|
41
|
+
declare function Trigger({ label, children }: {
|
|
42
|
+
label?: string;
|
|
43
|
+
children?: ReactNode;
|
|
44
|
+
}): import("react").JSX.Element;
|
|
45
|
+
interface FloatButtonItemProps {
|
|
46
|
+
/** The action's name: the button's accessible name and the
|
|
47
|
+
* annotation surfaced beside it while the group is open. */
|
|
48
|
+
label: string;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
onClick?: () => void;
|
|
51
|
+
children?: ReactNode;
|
|
52
|
+
}
|
|
53
|
+
declare function Item({ label, disabled, onClick, children }: FloatButtonItemProps): import("react").JSX.Element;
|
|
54
|
+
export declare const FloatButton: typeof Root & {
|
|
55
|
+
Root: typeof Root;
|
|
56
|
+
Trigger: typeof Trigger;
|
|
57
|
+
Item: typeof Item;
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Button } from "../button/index.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { createContext, useContext, useState } from "react";
|
|
5
|
+
//#region src/components/float-button/index.tsx
|
|
6
|
+
/** Context for {@link FloatButtonContextValue}, exported so a custom
|
|
7
|
+
* part can read the group's state. */
|
|
8
|
+
const FLOAT_BUTTON_CONTEXT = createContext(null);
|
|
9
|
+
/**
|
|
10
|
+
* A floating action and its fanned-out alternatives — FAB and speed
|
|
11
|
+
* dial in one family. The Root moors the group at a page corner and
|
|
12
|
+
* holds the openness (mirrored from `open` when controlled); the
|
|
13
|
+
* Trigger flips it; each Item is a round action with its name surfacing
|
|
14
|
+
* beside it while the group is open. The buttons are the shared recipe
|
|
15
|
+
* (vessels here: round); this family owns only the mooring, the fan
|
|
16
|
+
* and the fold.
|
|
17
|
+
*/
|
|
18
|
+
function Root({ open: openProp, placement = "bottom-end", size, onOpenChange, children, ...rest }) {
|
|
19
|
+
const [inner, setInner] = useState(false);
|
|
20
|
+
const open = openProp !== void 0 ? openProp : inner;
|
|
21
|
+
const setOpen = (value) => {
|
|
22
|
+
setInner(value);
|
|
23
|
+
onOpenChange?.(value);
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsx(FLOAT_BUTTON_CONTEXT.Provider, {
|
|
26
|
+
value: {
|
|
27
|
+
open,
|
|
28
|
+
size: size ?? "lg",
|
|
29
|
+
toggle: () => setOpen(!open),
|
|
30
|
+
close: () => setOpen(false)
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
33
|
+
...rest,
|
|
34
|
+
"data-scope": "float-button",
|
|
35
|
+
"data-part": "root",
|
|
36
|
+
"data-placement": placement,
|
|
37
|
+
"data-state": open ? "open" : "closed",
|
|
38
|
+
children
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const STEP_DOWN = {
|
|
43
|
+
lg: "md",
|
|
44
|
+
md: "sm",
|
|
45
|
+
sm: "sm"
|
|
46
|
+
};
|
|
47
|
+
function Trigger({ label, children }) {
|
|
48
|
+
const context = useContext(FLOAT_BUTTON_CONTEXT);
|
|
49
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
50
|
+
variant: "solid",
|
|
51
|
+
square: true,
|
|
52
|
+
size: context?.size ?? "lg",
|
|
53
|
+
onClick: () => context?.toggle(),
|
|
54
|
+
"aria-label": label || "Actions",
|
|
55
|
+
"aria-expanded": context ? context.open : false,
|
|
56
|
+
children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function Item({ label, disabled = false, onClick, children }) {
|
|
60
|
+
const context = useContext(FLOAT_BUTTON_CONTEXT);
|
|
61
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
62
|
+
"data-scope": "float-button",
|
|
63
|
+
"data-part": "item",
|
|
64
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
65
|
+
variant: "outline",
|
|
66
|
+
square: true,
|
|
67
|
+
size: context ? STEP_DOWN[context.size] : "md",
|
|
68
|
+
disabled,
|
|
69
|
+
"aria-label": label,
|
|
70
|
+
onClick: () => {
|
|
71
|
+
onClick?.();
|
|
72
|
+
context?.close();
|
|
73
|
+
},
|
|
74
|
+
children
|
|
75
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
76
|
+
"data-scope": "float-button",
|
|
77
|
+
"data-part": "item-label",
|
|
78
|
+
"aria-hidden": "true",
|
|
79
|
+
children: label
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const FloatButton = Object.assign(Root, {
|
|
84
|
+
Root,
|
|
85
|
+
Trigger,
|
|
86
|
+
Item
|
|
87
|
+
});
|
|
88
|
+
injectComponentStyle("float-button");
|
|
89
|
+
//#endregion
|
|
90
|
+
export { FLOAT_BUTTON_CONTEXT, FloatButton };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FloatingPanel as FloatingPanel$1 } from "@ark-ui/react/floating-panel";
|
|
2
|
+
//#region src/components/floating-panel/index.d.ts
|
|
3
|
+
/** Ark's FloatingPanel, dressed in the paper-and-ink system: the shared
|
|
4
|
+
* popup vessel let loose — a draggable, resizable sheet whose header is the
|
|
5
|
+
* handle. The API is Ark's own — Root, Trigger, Positioner, Content, Header,
|
|
6
|
+
* Title, Control, DragTrigger, StageTrigger, CloseTrigger, ResizeTrigger,
|
|
7
|
+
* Body. */
|
|
8
|
+
export declare const FloatingPanel: typeof FloatingPanel$1;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { FloatingPanel as FloatingPanel$1 } from "@ark-ui/react/floating-panel";
|
|
3
|
+
//#region src/components/floating-panel/index.tsx
|
|
4
|
+
/** Ark's FloatingPanel, dressed in the paper-and-ink system: the shared
|
|
5
|
+
* popup vessel let loose — a draggable, resizable sheet whose header is the
|
|
6
|
+
* handle. The API is Ark's own — Root, Trigger, Positioner, Content, Header,
|
|
7
|
+
* Title, Control, DragTrigger, StageTrigger, CloseTrigger, ResizeTrigger,
|
|
8
|
+
* Body. */
|
|
9
|
+
const FloatingPanel = FloatingPanel$1;
|
|
10
|
+
injectComponentStyle("floating-panel");
|
|
11
|
+
//#endregion
|
|
12
|
+
export { FloatingPanel };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { Field } from "@ark-ui/react/field";
|
|
5
|
+
import { useField, useForm } from "@tanstack/react-form";
|
|
6
|
+
//#region src/components/form/index.tsx
|
|
7
|
+
const FormContext = createContext(null);
|
|
8
|
+
/** A validator's complaint is a string or a Standard Schema issue; both
|
|
9
|
+
* reduce to the sentence the field shows. */
|
|
10
|
+
function errorText(error) {
|
|
11
|
+
if (error == null) return "";
|
|
12
|
+
if (typeof error === "string") return error;
|
|
13
|
+
if (typeof error === "object" && "message" in error) return String(error.message);
|
|
14
|
+
return "";
|
|
15
|
+
}
|
|
16
|
+
function Form({ form, children, ...rest }) {
|
|
17
|
+
injectComponentStyle("form");
|
|
18
|
+
injectComponentStyle("field");
|
|
19
|
+
return /* @__PURE__ */ jsx(FormContext.Provider, {
|
|
20
|
+
value: form,
|
|
21
|
+
children: /* @__PURE__ */ jsx("form", {
|
|
22
|
+
...rest,
|
|
23
|
+
"data-scope": "form",
|
|
24
|
+
"data-part": "root",
|
|
25
|
+
noValidate: true,
|
|
26
|
+
onSubmit: (event) => {
|
|
27
|
+
event.preventDefault();
|
|
28
|
+
form.handleSubmit();
|
|
29
|
+
},
|
|
30
|
+
children
|
|
31
|
+
})
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function FormField({ form: formProp, name, label, hint, required = false, invalid = false, disabled = false, children, ...rest }) {
|
|
35
|
+
const injected = useContext(FormContext);
|
|
36
|
+
const form = formProp ?? injected;
|
|
37
|
+
const { className: klass, style, ...fieldOptions } = rest;
|
|
38
|
+
const assemble = (field) => {
|
|
39
|
+
const meta = field?.state.meta;
|
|
40
|
+
const errors = (!meta ? [] : meta.isTouched ? meta.errors ?? [] : [meta.errorMap?.onSubmit].flat().filter(Boolean)).map(errorText).filter(Boolean);
|
|
41
|
+
const isInvalid = invalid || errors.length > 0;
|
|
42
|
+
return /* @__PURE__ */ jsx("div", {
|
|
43
|
+
className: klass,
|
|
44
|
+
style,
|
|
45
|
+
"data-form-field": name,
|
|
46
|
+
children: /* @__PURE__ */ jsxs(Field.Root, {
|
|
47
|
+
invalid: isInvalid,
|
|
48
|
+
required,
|
|
49
|
+
disabled,
|
|
50
|
+
children: [
|
|
51
|
+
label ? /* @__PURE__ */ jsx(Field.Label, { children: label }) : null,
|
|
52
|
+
typeof children === "function" ? children(field) : children,
|
|
53
|
+
hint && errors.length === 0 ? /* @__PURE__ */ jsx(Field.HelperText, { children: hint }) : null,
|
|
54
|
+
errors.length > 0 ? /* @__PURE__ */ jsx(Field.ErrorText, { children: errors[0] }) : null
|
|
55
|
+
]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
if (!form) return assemble(void 0);
|
|
60
|
+
return /* @__PURE__ */ jsx(form.Field, {
|
|
61
|
+
...fieldOptions,
|
|
62
|
+
name,
|
|
63
|
+
children: assemble
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
//#endregion
|
|
67
|
+
export { Form, FormField, useField, useForm };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Format as Format$1 } from "@ark-ui/react/format";
|
|
2
|
+
//#region src/components/format/index.d.ts
|
|
3
|
+
/** Ark's Format, dressed in the paper-and-ink system: Intl formatting for
|
|
4
|
+
* numbers, currency, bytes and relative time. The components render bare
|
|
5
|
+
* text with no DOM of their own — typography flows from the token layer,
|
|
6
|
+
* so there is no component stylesheet. The API is Ark's own — Number,
|
|
7
|
+
* Byte, Time, RelativeTime. */
|
|
8
|
+
export declare const Format: typeof Format$1;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Format as Format$1 } from "@ark-ui/react/format";
|
|
2
|
+
//#region src/components/format/index.tsx
|
|
3
|
+
/** Ark's Format, dressed in the paper-and-ink system: Intl formatting for
|
|
4
|
+
* numbers, currency, bytes and relative time. The components render bare
|
|
5
|
+
* text with no DOM of their own — typography flows from the token layer,
|
|
6
|
+
* so there is no component stylesheet. The API is Ark's own — Number,
|
|
7
|
+
* Byte, Time, RelativeTime. */
|
|
8
|
+
const Format = Format$1;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Format };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/frame/index.d.ts
|
|
2
|
+
/** Ark's Frame, dressed in the paper-and-ink system: a sandboxed
|
|
3
|
+
* iframe whose body teleports the children and whose `head` prop
|
|
4
|
+
* carries extra <head> nodes — styles the child renders must travel
|
|
5
|
+
* through that prop. The frame measures its content and grows to
|
|
6
|
+
* fit; the vessel's border and paper belong to the consumer, since
|
|
7
|
+
* an iframe carries no anatomy attributes for the core stylesheet
|
|
8
|
+
* to hook. The API is Ark's own. */
|
|
9
|
+
export declare const Frame: import("react").ForwardRefExoticComponent<import("@ark-ui/react/frame").FrameProps & import("react").RefAttributes<HTMLIFrameElement>>;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Frame as Frame$1 } from "@ark-ui/react/frame";
|
|
2
|
+
//#region src/components/frame/index.tsx
|
|
3
|
+
/** Ark's Frame, dressed in the paper-and-ink system: a sandboxed
|
|
4
|
+
* iframe whose body teleports the children and whose `head` prop
|
|
5
|
+
* carries extra <head> nodes — styles the child renders must travel
|
|
6
|
+
* through that prop. The frame measures its content and grows to
|
|
7
|
+
* fit; the vessel's border and paper belong to the consumer, since
|
|
8
|
+
* an iframe carries no anatomy attributes for the core stylesheet
|
|
9
|
+
* to hook. The API is Ark's own. */
|
|
10
|
+
const Frame = Frame$1;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Frame };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/grid/index.d.ts
|
|
3
|
+
/** An alignment lattice: tracks of equal measure, sized by column count
|
|
4
|
+
* — or, with `minChildWidth`, as many tracks as the container fits. */
|
|
5
|
+
export interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
columns?: number;
|
|
7
|
+
gap?: "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
8
|
+
/** Switch to the auto-fill lattice: each track is at least this wide,
|
|
9
|
+
* and the container decides how many fit. */
|
|
10
|
+
minChildWidth?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Grid({ columns, gap, minChildWidth, ...rest }: GridProps): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/grid/index.tsx
|
|
4
|
+
/** The same named steps of the space ramp the stack uses — one
|
|
5
|
+
* vocabulary of distance across the layout primitives. */
|
|
6
|
+
const gapVars = {
|
|
7
|
+
none: "0",
|
|
8
|
+
xs: "var(--bs-gap-xs)",
|
|
9
|
+
sm: "var(--bs-gap-sm)",
|
|
10
|
+
md: "var(--bs-gap-md)",
|
|
11
|
+
lg: "var(--bs-gap-lg)",
|
|
12
|
+
xl: "var(--bs-gap-xl)"
|
|
13
|
+
};
|
|
14
|
+
function Grid({ columns = 12, gap = "md", minChildWidth, ...rest }) {
|
|
15
|
+
injectComponentStyle("grid");
|
|
16
|
+
const style = {
|
|
17
|
+
...rest.style,
|
|
18
|
+
"--bs-grid-columns": String(columns),
|
|
19
|
+
"--bs-grid-gap": gapVars[gap] ?? gapVars.md,
|
|
20
|
+
...minChildWidth != null ? { "--bs-grid-min-child-width": minChildWidth } : {}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsx("div", {
|
|
23
|
+
...rest,
|
|
24
|
+
style,
|
|
25
|
+
"data-scope": "grid",
|
|
26
|
+
"data-part": "root",
|
|
27
|
+
"data-autofill": minChildWidth != null ? "" : void 0
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { Grid };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/components/highlight/index.d.ts
|
|
2
|
+
/** Ark's Highlight, dressed in the paper-and-ink system: query hits are
|
|
3
|
+
* strokes of pigment on the page — a quiet tint of the accent behind the
|
|
4
|
+
* ink, never neon. The component renders bare <mark> elements, so the
|
|
5
|
+
* document-wide mark default carries the look. The API is Ark's own. */
|
|
6
|
+
export declare const Highlight: (props: import("@ark-ui/react/highlight").HighlightProps) => import("react").JSX.Element;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Highlight as Highlight$1 } from "@ark-ui/react/highlight";
|
|
3
|
+
//#region src/components/highlight/index.tsx
|
|
4
|
+
/** Ark's Highlight, dressed in the paper-and-ink system: query hits are
|
|
5
|
+
* strokes of pigment on the page — a quiet tint of the accent behind the
|
|
6
|
+
* ink, never neon. The component renders bare <mark> elements, so the
|
|
7
|
+
* document-wide mark default carries the look. The API is Ark's own. */
|
|
8
|
+
const Highlight = Highlight$1;
|
|
9
|
+
injectComponentStyle("highlight");
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Highlight };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HoverCard as HoverCard$1 } from "@ark-ui/react/hover-card";
|
|
2
|
+
//#region src/components/hover-card/index.d.ts
|
|
3
|
+
/** Ark's HoverCard, dressed in the paper-and-ink system: a preview card
|
|
4
|
+
* that dissolves in over a quiet inline link, never stealing focus. The
|
|
5
|
+
* API is Ark's own — Root, Trigger, Positioner, Content, Arrow, ArrowTip. */
|
|
6
|
+
export declare const HoverCard: typeof HoverCard$1;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { HoverCard as HoverCard$1 } from "@ark-ui/react/hover-card";
|
|
3
|
+
//#region src/components/hover-card/index.tsx
|
|
4
|
+
/** Ark's HoverCard, dressed in the paper-and-ink system: a preview card
|
|
5
|
+
* that dissolves in over a quiet inline link, never stealing focus. The
|
|
6
|
+
* API is Ark's own — Root, Trigger, Positioner, Content, Arrow, ArrowTip. */
|
|
7
|
+
const HoverCard = HoverCard$1;
|
|
8
|
+
injectComponentStyle("hover-card");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { HoverCard };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { IconifyIcon } from "@bysages/core/icons";
|
|
3
|
+
//#region src/components/icon/index.d.ts
|
|
4
|
+
/** The inkwell: a standard box that keeps any inline svg at its optical
|
|
5
|
+
* measure and in the text's own ink — the icon carries no pigment and no
|
|
6
|
+
* size of its own. Bring a glyph through `glyph` (a direct registry
|
|
7
|
+
* import), through `name` from the whitelisted registry, or bring your
|
|
8
|
+
* own; the well renders either. */
|
|
9
|
+
export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
|
|
10
|
+
/** Size steps follow the surrounding font size; `inherit` is the
|
|
11
|
+
* default — one em of the text the icon sits in. */
|
|
12
|
+
size?: "inherit" | "sm" | "md" | "lg";
|
|
13
|
+
/** The accessible name. Without it the icon is presentation-only and
|
|
14
|
+
* hidden from the accessibility tree. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** A glyph from the registry, imported directly. Ignored when children
|
|
17
|
+
* are given — an explicit glyph always wins. */
|
|
18
|
+
glyph?: IconifyIcon;
|
|
19
|
+
/** A registry name — only the whitelisted set the wrappers draw
|
|
20
|
+
* themselves. Ignored when `glyph` or children are given. */
|
|
21
|
+
name?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function Icon({ size, label, glyph, name, children, ...rest }: IconProps): import("react").JSX.Element;
|
|
24
|
+
//#endregion
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { getIcon } from "@bysages/core/icons";
|
|
4
|
+
//#region src/components/icon/index.tsx
|
|
5
|
+
function Icon({ size = "inherit", label, glyph, name, children, ...rest }) {
|
|
6
|
+
injectComponentStyle("icon");
|
|
7
|
+
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 wrappers' whitelist; import the glyph from @bysages/icons and pass it as glyph`);
|
|
9
|
+
return /* @__PURE__ */ jsx("span", {
|
|
10
|
+
...rest,
|
|
11
|
+
role: label != null ? "img" : void 0,
|
|
12
|
+
"aria-label": label,
|
|
13
|
+
"aria-hidden": label != null ? void 0 : "true",
|
|
14
|
+
"data-scope": "icon",
|
|
15
|
+
"data-part": "root",
|
|
16
|
+
"data-size": size,
|
|
17
|
+
children: children ?? (resolved ? /* @__PURE__ */ jsx("svg", {
|
|
18
|
+
viewBox: `0 0 ${resolved.width ?? 24} ${resolved.height ?? 24}`,
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
dangerouslySetInnerHTML: { __html: resolved.body }
|
|
22
|
+
}) : null)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Icon };
|
|
@@ -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
|