@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 { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Editable as Editable$1 } from "@ark-ui/react/editable";
|
|
4
|
+
//#region src/components/editable/index.tsx
|
|
5
|
+
function EditableRoot({ size = "md", ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(Editable$1.Root, {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-size": size
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
const Editable = {
|
|
12
|
+
...Editable$1,
|
|
13
|
+
Root: EditableRoot
|
|
14
|
+
};
|
|
15
|
+
injectComponentStyle("editable");
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Editable };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/ellipsis/index.d.ts
|
|
3
|
+
/** The overflow knife: text cut at one line, or held to N lines. The
|
|
4
|
+
* primitive only draws the cut — reaching the full text (title,
|
|
5
|
+
* tooltip) stays the consumer's decision. */
|
|
6
|
+
export interface EllipsisProps extends HTMLAttributes<HTMLElement> {
|
|
7
|
+
lines?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function Ellipsis({ lines, ...rest }: EllipsisProps): import("react").JSX.Element;
|
|
10
|
+
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/ellipsis/index.tsx
|
|
4
|
+
function Ellipsis({ lines = 1, ...rest }) {
|
|
5
|
+
injectComponentStyle("ellipsis");
|
|
6
|
+
const multiline = lines > 1;
|
|
7
|
+
return /* @__PURE__ */ jsx("span", {
|
|
8
|
+
...rest,
|
|
9
|
+
style: multiline ? {
|
|
10
|
+
...rest.style,
|
|
11
|
+
"--bs-ellipsis-lines": String(lines)
|
|
12
|
+
} : rest.style,
|
|
13
|
+
"data-scope": "ellipsis",
|
|
14
|
+
"data-part": "root",
|
|
15
|
+
"data-multiline": multiline ? "" : void 0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Ellipsis };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/empty/index.d.ts
|
|
3
|
+
export declare const Empty: {
|
|
4
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
} & {
|
|
7
|
+
Root: {
|
|
8
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
11
|
+
Visual: {
|
|
12
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Title: {
|
|
16
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Description: {
|
|
20
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
Actions: {
|
|
24
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/empty/index.tsx
|
|
4
|
+
/** An empty state: the page holds its breath. Root centers the column,
|
|
5
|
+
* Visual carries the mark, Title and Description carry the ink, Actions
|
|
6
|
+
* the way out. Any subset composes. */
|
|
7
|
+
function part(name, tag) {
|
|
8
|
+
const Tag = tag;
|
|
9
|
+
const Component = ({ children, ...rest }) => /* @__PURE__ */ jsx(Tag, {
|
|
10
|
+
...rest,
|
|
11
|
+
"data-scope": "empty",
|
|
12
|
+
"data-part": name.toLowerCase(),
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
Component.displayName = "Empty" + name;
|
|
16
|
+
return Component;
|
|
17
|
+
}
|
|
18
|
+
const Root = part("Root", "div");
|
|
19
|
+
const Visual = part("Visual", "div");
|
|
20
|
+
const Title = part("Title", "h3");
|
|
21
|
+
const Description = part("Description", "p");
|
|
22
|
+
const Actions = part("Actions", "div");
|
|
23
|
+
const Empty = Object.assign(Root, {
|
|
24
|
+
Root,
|
|
25
|
+
Visual,
|
|
26
|
+
Title,
|
|
27
|
+
Description,
|
|
28
|
+
Actions
|
|
29
|
+
});
|
|
30
|
+
injectComponentStyle("empty");
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Empty };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
2
|
+
//#region src/components/field/index.d.ts
|
|
3
|
+
/** Ark's Field, dressed in the paper-and-ink system: a tracked label, a
|
|
4
|
+
* border-and-halo control, and quiet help text. The API is Ark's own —
|
|
5
|
+
* Root, Label, Input, Textarea, Select, HelperText, ErrorText,
|
|
6
|
+
* RequiredIndicator. */
|
|
7
|
+
export declare const Field: typeof Field$1;
|
|
8
|
+
//#endregion
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
3
|
+
//#region src/components/field/index.tsx
|
|
4
|
+
/** Ark's Field, dressed in the paper-and-ink system: a tracked label, a
|
|
5
|
+
* border-and-halo control, and quiet help text. The API is Ark's own —
|
|
6
|
+
* Root, Label, Input, Textarea, Select, HelperText, ErrorText,
|
|
7
|
+
* RequiredIndicator. */
|
|
8
|
+
const Field = Field$1;
|
|
9
|
+
injectComponentStyle("field");
|
|
10
|
+
//#endregion
|
|
11
|
+
export { Field };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fieldset as Fieldset$1 } from "@ark-ui/react/fieldset";
|
|
2
|
+
//#region src/components/fieldset/index.d.ts
|
|
3
|
+
/** Ark's Fieldset, dressed in the paper-and-ink system: a song-serif
|
|
4
|
+
* legend heading a column of fields. The API is Ark's own — Root, Legend,
|
|
5
|
+
* HelperText, ErrorText. */
|
|
6
|
+
export declare const Fieldset: typeof Fieldset$1;
|
|
7
|
+
//#endregion
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Fieldset as Fieldset$1 } from "@ark-ui/react/fieldset";
|
|
3
|
+
//#region src/components/fieldset/index.tsx
|
|
4
|
+
/** Ark's Fieldset, dressed in the paper-and-ink system: a song-serif
|
|
5
|
+
* legend heading a column of fields. The API is Ark's own — Root, Legend,
|
|
6
|
+
* HelperText, ErrorText. */
|
|
7
|
+
const Fieldset = Fieldset$1;
|
|
8
|
+
injectComponentStyle("fieldset");
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Fieldset };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { FileUpload as FileUpload$1 } from "@ark-ui/react/file-upload";
|
|
3
|
+
//#region src/components/file-upload/index.d.ts
|
|
4
|
+
type FileUploadRootProps = ComponentProps<typeof FileUpload$1.Root> & {
|
|
5
|
+
/** One rung of the control-height ladder for the trigger. */
|
|
6
|
+
size?: "sm" | "md" | "lg";
|
|
7
|
+
};
|
|
8
|
+
declare function FileUploadRoot({ size, ...rest }: FileUploadRootProps): import("react").JSX.Element;
|
|
9
|
+
/** Ark's FileUpload, dressed in the paper-and-ink system: a dashed
|
|
10
|
+
* dropzone that floods with subtle light on drag-over, and accepted files
|
|
11
|
+
* as loose hairline slips. The API is Ark's own — Root, Label, Trigger,
|
|
12
|
+
* Dropzone, HiddenInput, ItemGroup, Item, ItemName, ItemSizeText,
|
|
13
|
+
* ItemPreview, ItemPreviewImage, ItemDeleteTrigger, ClearTrigger,
|
|
14
|
+
* Context. */
|
|
15
|
+
export declare const FileUpload: Omit<typeof FileUpload$1, "Root"> & {
|
|
16
|
+
Root: typeof FileUploadRoot;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { FileUpload as FileUpload$1 } from "@ark-ui/react/file-upload";
|
|
4
|
+
//#region src/components/file-upload/index.tsx
|
|
5
|
+
function FileUploadRoot({ size = "md", ...rest }) {
|
|
6
|
+
return /* @__PURE__ */ jsx(FileUpload$1.Root, {
|
|
7
|
+
...rest,
|
|
8
|
+
"data-size": size
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/** Ark's FileUpload, dressed in the paper-and-ink system: a dashed
|
|
12
|
+
* dropzone that floods with subtle light on drag-over, and accepted files
|
|
13
|
+
* as loose hairline slips. The API is Ark's own — Root, Label, Trigger,
|
|
14
|
+
* Dropzone, HiddenInput, ItemGroup, Item, ItemName, ItemSizeText,
|
|
15
|
+
* ItemPreview, ItemPreviewImage, ItemDeleteTrigger, ClearTrigger,
|
|
16
|
+
* Context. */
|
|
17
|
+
const FileUpload = {
|
|
18
|
+
...FileUpload$1,
|
|
19
|
+
Root: FileUploadRoot
|
|
20
|
+
};
|
|
21
|
+
injectComponentStyle("file-upload");
|
|
22
|
+
//#endregion
|
|
23
|
+
export { FileUpload };
|
|
@@ -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
|
+
class: 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,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/icon/index.d.ts
|
|
3
|
+
/** The inkwell: a standard box that keeps any inline svg at its optical
|
|
4
|
+
* measure and in the text's own ink — the icon carries no pigment and no
|
|
5
|
+
* size of its own. Bring a glyph through `name` from the registry, or
|
|
6
|
+
* bring your own; the well renders either. */
|
|
7
|
+
export interface IconProps extends HTMLAttributes<HTMLSpanElement> {
|
|
8
|
+
/** Size steps follow the surrounding font size; `inherit` is the
|
|
9
|
+
* default — one em of the text the icon sits in. */
|
|
10
|
+
size?: "inherit" | "sm" | "md" | "lg";
|
|
11
|
+
/** The accessible name. Without it the icon is presentation-only and
|
|
12
|
+
* hidden from the accessibility tree. */
|
|
13
|
+
label?: string;
|
|
14
|
+
/** A glyph from the registry. Ignored when children are given — an
|
|
15
|
+
* explicit glyph always wins over the registry. */
|
|
16
|
+
name?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Icon({ size, label, name, children, ...rest }: IconProps): import("react").JSX.Element;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { getIcon } from "@bysages/icons";
|
|
4
|
+
//#region src/components/icon/index.tsx
|
|
5
|
+
function Icon({ size = "inherit", label, name, children, ...rest }) {
|
|
6
|
+
injectComponentStyle("icon");
|
|
7
|
+
const glyph = name && children == null ? getIcon(name) : void 0;
|
|
8
|
+
if (name && children == null && !glyph) console.error(`[icons] unknown icon name "${name}" — extend packages/icons/icons.config.json and rerun the generator`);
|
|
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 ?? (glyph ? /* @__PURE__ */ jsx("svg", {
|
|
18
|
+
viewBox: `0 0 ${glyph.width ?? 24} ${glyph.height ?? 24}`,
|
|
19
|
+
fill: "currentColor",
|
|
20
|
+
"aria-hidden": "true",
|
|
21
|
+
dangerouslySetInnerHTML: { __html: glyph.body }
|
|
22
|
+
}) : null)
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Icon };
|