@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,31 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/banner/index.d.ts
|
|
3
|
+
export type BannerStatus = "ink" | "info" | "success" | "warning" | "danger";
|
|
4
|
+
export interface BannerRootProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
status?: BannerStatus;
|
|
6
|
+
}
|
|
7
|
+
export declare const Banner: (({ status, children, ...rest }: BannerRootProps) => import("react").JSX.Element) & {
|
|
8
|
+
Root: ({ status, children, ...rest }: BannerRootProps) => import("react").JSX.Element;
|
|
9
|
+
Icon: {
|
|
10
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
Body: {
|
|
14
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
Title: {
|
|
18
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Description: {
|
|
22
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
Actions: {
|
|
26
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
Close: (rest: ButtonHTMLAttributes<HTMLButtonElement>) => import("react").JSX.Element;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/banner/index.tsx
|
|
4
|
+
/** A page-level notice, spoken across the full measure: a wash of the
|
|
5
|
+
* status pigment, one heavier hairline on the leading edge, and room
|
|
6
|
+
* for actions and a quiet close. Ink is the neutral register; the four
|
|
7
|
+
* semantic pigments are fixed. */
|
|
8
|
+
const Root = ({ status = "ink", children, ...rest }) => /* @__PURE__ */ jsx("div", {
|
|
9
|
+
...rest,
|
|
10
|
+
role: status === "ink" ? void 0 : "status",
|
|
11
|
+
"data-scope": "banner",
|
|
12
|
+
"data-part": "root",
|
|
13
|
+
"data-status": status,
|
|
14
|
+
children
|
|
15
|
+
});
|
|
16
|
+
function part(name, tag) {
|
|
17
|
+
const Tag = tag;
|
|
18
|
+
const Component = ({ children, ...rest }) => /* @__PURE__ */ jsx(Tag, {
|
|
19
|
+
...rest,
|
|
20
|
+
"data-scope": "banner",
|
|
21
|
+
"data-part": name.toLowerCase(),
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
Component.displayName = "Banner" + name;
|
|
25
|
+
return Component;
|
|
26
|
+
}
|
|
27
|
+
const Icon = part("Icon", "span");
|
|
28
|
+
const Body = part("Body", "div");
|
|
29
|
+
const Title = part("Title", "p");
|
|
30
|
+
const Description = part("Description", "p");
|
|
31
|
+
const Actions = part("Actions", "div");
|
|
32
|
+
/** The quiet close: a plain square-cut button; dismissal stays the
|
|
33
|
+
* consumer's state. */
|
|
34
|
+
const Close = (rest) => /* @__PURE__ */ jsx("button", {
|
|
35
|
+
...rest,
|
|
36
|
+
type: rest.type ?? "button",
|
|
37
|
+
"aria-label": rest["aria-label"] ?? "Dismiss",
|
|
38
|
+
"data-scope": "banner",
|
|
39
|
+
"data-part": "close",
|
|
40
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
41
|
+
viewBox: "0 0 16 16",
|
|
42
|
+
fill: "none",
|
|
43
|
+
"aria-hidden": true,
|
|
44
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
45
|
+
d: "M4 4l8 8M12 4l-8 8",
|
|
46
|
+
stroke: "currentColor",
|
|
47
|
+
strokeWidth: 1.5,
|
|
48
|
+
strokeLinecap: "round"
|
|
49
|
+
})
|
|
50
|
+
})
|
|
51
|
+
});
|
|
52
|
+
const Banner = Object.assign(Root, {
|
|
53
|
+
Root,
|
|
54
|
+
Icon,
|
|
55
|
+
Body,
|
|
56
|
+
Title,
|
|
57
|
+
Description,
|
|
58
|
+
Actions,
|
|
59
|
+
Close
|
|
60
|
+
});
|
|
61
|
+
injectComponentStyle("banner");
|
|
62
|
+
//#endregion
|
|
63
|
+
export { Banner };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/breadcrumb/index.d.ts
|
|
3
|
+
export declare const Breadcrumb: {
|
|
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
|
+
List: {
|
|
12
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Item: {
|
|
16
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
19
|
+
Link: {
|
|
20
|
+
({ children, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement>): import("react").JSX.Element;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
Current: {
|
|
24
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
Separator: {
|
|
28
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
29
|
+
displayName: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/breadcrumb/index.tsx
|
|
4
|
+
/** A trail of waymarks: Root wraps the nav, List the ordered trail, and
|
|
5
|
+
* each Item carries a Link — or the Current page — parted by a quiet
|
|
6
|
+
* Separator. Links take href and the rest through attributes. */
|
|
7
|
+
function part(name, tag, extra = {}, fallback) {
|
|
8
|
+
const Tag = tag;
|
|
9
|
+
const Component = ({ children, ...rest }) => /* @__PURE__ */ jsx(Tag, {
|
|
10
|
+
...extra,
|
|
11
|
+
...rest,
|
|
12
|
+
"data-scope": "breadcrumb",
|
|
13
|
+
"data-part": name.toLowerCase(),
|
|
14
|
+
children: children ?? fallback
|
|
15
|
+
});
|
|
16
|
+
Component.displayName = "Breadcrumb" + name;
|
|
17
|
+
return Component;
|
|
18
|
+
}
|
|
19
|
+
const Root = part("Root", "nav", { "aria-label": "Breadcrumb" });
|
|
20
|
+
const List = part("List", "ol");
|
|
21
|
+
const Item = part("Item", "li");
|
|
22
|
+
const Link = part("Link", "a");
|
|
23
|
+
const Current = part("Current", "span", { "aria-current": "page" });
|
|
24
|
+
const Separator = part("Separator", "span", { "aria-hidden": "true" }, "/");
|
|
25
|
+
const Breadcrumb = Object.assign(Root, {
|
|
26
|
+
Root,
|
|
27
|
+
List,
|
|
28
|
+
Item,
|
|
29
|
+
Link,
|
|
30
|
+
Current,
|
|
31
|
+
Separator
|
|
32
|
+
});
|
|
33
|
+
injectComponentStyle("breadcrumb");
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Breadcrumb };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/button/index.d.ts
|
|
3
|
+
/** The control recipe as a standalone button: the variant chooses how it
|
|
4
|
+
* rests, the tone chooses the pigment. Ink is the solemn default; any
|
|
5
|
+
* action can carry the primary weight. */
|
|
6
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
7
|
+
variant?: "solid" | "outline" | "ghost" | "subtle";
|
|
8
|
+
tone?: "ink" | "info" | "success" | "warning" | "danger";
|
|
9
|
+
size?: "sm" | "md" | "lg";
|
|
10
|
+
/** Icon-only: the silhouette squares to the control height. */
|
|
11
|
+
square?: boolean;
|
|
12
|
+
/** Render the child element as the button — the recipe rides on it
|
|
13
|
+
* (a router Link, say) instead of wrapping it in a nested <button>. */
|
|
14
|
+
asChild?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare function Button({ variant, tone, size, square, asChild, disabled, type, children, ...rest }: ButtonProps): import("react").JSX.Element | null;
|
|
19
|
+
//#endregion
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
4
|
+
//#region src/components/button/index.tsx
|
|
5
|
+
function Button({ variant = "solid", tone = "ink", size = "md", square = false, asChild = false, disabled = false, type = "button", children, ...rest }) {
|
|
6
|
+
injectComponentStyle("button");
|
|
7
|
+
const partProps = {
|
|
8
|
+
...rest,
|
|
9
|
+
"data-scope": "button",
|
|
10
|
+
"data-part": "root",
|
|
11
|
+
"data-variant": variant,
|
|
12
|
+
"data-tone": tone,
|
|
13
|
+
"data-size": size,
|
|
14
|
+
"data-square": square ? "true" : void 0,
|
|
15
|
+
"data-motion": "ink-ripple lit"
|
|
16
|
+
};
|
|
17
|
+
if (asChild) {
|
|
18
|
+
const child = Children.only(children);
|
|
19
|
+
return isValidElement(child) ? cloneElement(child, partProps) : null;
|
|
20
|
+
}
|
|
21
|
+
return /* @__PURE__ */ jsx("button", {
|
|
22
|
+
type,
|
|
23
|
+
disabled,
|
|
24
|
+
...partProps,
|
|
25
|
+
children
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { Button };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/button-group/index.d.ts
|
|
3
|
+
export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** The seam runs across the group (default) or down it. */
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
/** One register for every member: falls onto data-size for the
|
|
7
|
+
* stylesheet to retune the buttons' heights. */
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
/** The members' corner register: retunes --bs-radius-control for the
|
|
10
|
+
* whole fused shape — edges and trimmed seams keep one story. */
|
|
11
|
+
radius?: "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Buttons fused into one control: the group owns only the joinery, so
|
|
16
|
+
* members keep every variant they were given — a solid action can sit
|
|
17
|
+
* beside an outline one and the seam still reads. Selection belongs to
|
|
18
|
+
* the toggle group; this is layout alone.
|
|
19
|
+
*/
|
|
20
|
+
declare function Root({ orientation, size, radius, children, ...rest }: ButtonGroupProps): import("react").JSX.Element;
|
|
21
|
+
export declare const ButtonGroup: typeof Root & {
|
|
22
|
+
Root: typeof Root;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/button-group/index.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Buttons fused into one control: the group owns only the joinery, so
|
|
6
|
+
* members keep every variant they were given — a solid action can sit
|
|
7
|
+
* beside an outline one and the seam still reads. Selection belongs to
|
|
8
|
+
* the toggle group; this is layout alone.
|
|
9
|
+
*/
|
|
10
|
+
function Root({ orientation = "horizontal", size, radius, children, ...rest }) {
|
|
11
|
+
return /* @__PURE__ */ jsx("div", {
|
|
12
|
+
...rest,
|
|
13
|
+
role: "group",
|
|
14
|
+
"data-scope": "button-group",
|
|
15
|
+
"data-part": "root",
|
|
16
|
+
"data-orientation": orientation,
|
|
17
|
+
"data-size": size,
|
|
18
|
+
"data-radius": radius,
|
|
19
|
+
children
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
const ButtonGroup = Object.assign(Root, { Root });
|
|
23
|
+
injectComponentStyle("button-group");
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ButtonGroup };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
import { DatePickerRootProps } from "@ark-ui/react/date-picker";
|
|
3
|
+
//#region src/components/calendar/index.d.ts
|
|
4
|
+
export interface CalendarProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** Selected date(s) — an array, as the machine speaks in ranges. */
|
|
6
|
+
value?: DatePickerRootProps["value"];
|
|
7
|
+
min?: DatePickerRootProps["min"];
|
|
8
|
+
max?: DatePickerRootProps["max"];
|
|
9
|
+
onValueChange?: (value: NonNullable<DatePickerRootProps["value"]>) => void;
|
|
10
|
+
}
|
|
11
|
+
/** The date-picker's month grid, standing on the page without its
|
|
12
|
+
* popup: always open, the trigger gone, the vessel a quiet card. The
|
|
13
|
+
* title zooms out through month and year grids; the grids themselves
|
|
14
|
+
* are the shared machinery — value, range selection, and focus ride
|
|
15
|
+
* Ark's own contract. */
|
|
16
|
+
export declare function Calendar({ value, min, max, onValueChange, children, ...rest }: CalendarProps): import("react").JSX.Element;
|
|
17
|
+
//#endregion
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { DatePicker } from "@ark-ui/react/date-picker";
|
|
4
|
+
//#region src/components/calendar/index.tsx
|
|
5
|
+
function chevron(dir) {
|
|
6
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
7
|
+
width: 16,
|
|
8
|
+
height: 16,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
fill: "none",
|
|
11
|
+
stroke: "currentColor",
|
|
12
|
+
strokeWidth: 1.75,
|
|
13
|
+
"aria-hidden": true,
|
|
14
|
+
style: dir === "left" ? { transform: "rotate(180deg)" } : void 0,
|
|
15
|
+
children: /* @__PURE__ */ jsx("path", { d: "m9 5 7 7-7 7" })
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/** The date-picker's month grid, standing on the page without its
|
|
19
|
+
* popup: always open, the trigger gone, the vessel a quiet card. The
|
|
20
|
+
* title zooms out through month and year grids; the grids themselves
|
|
21
|
+
* are the shared machinery — value, range selection, and focus ride
|
|
22
|
+
* Ark's own contract. */
|
|
23
|
+
function Calendar({ value, min, max, onValueChange, children, ...rest }) {
|
|
24
|
+
injectComponentStyle("calendar");
|
|
25
|
+
injectComponentStyle("date-picker");
|
|
26
|
+
const title = (dp) => {
|
|
27
|
+
const d = dp.focusedValue;
|
|
28
|
+
if (!d) return "";
|
|
29
|
+
if (dp.view === "day") return dp.format(d, {
|
|
30
|
+
month: "long",
|
|
31
|
+
year: "numeric"
|
|
32
|
+
});
|
|
33
|
+
if (dp.view === "month") return dp.format(d, { year: "numeric" });
|
|
34
|
+
const decade = Math.floor(d.year / 10) * 10;
|
|
35
|
+
return `${decade} - ${decade + 9}`;
|
|
36
|
+
};
|
|
37
|
+
const header = /* @__PURE__ */ jsx("div", {
|
|
38
|
+
"data-scope": "calendar",
|
|
39
|
+
"data-part": "header",
|
|
40
|
+
children: /* @__PURE__ */ jsxs(DatePicker.ViewControl, { children: [
|
|
41
|
+
/* @__PURE__ */ jsx(DatePicker.PrevTrigger, { children: chevron("left") }),
|
|
42
|
+
/* @__PURE__ */ jsx(DatePicker.Context, { children: (dp) => /* @__PURE__ */ jsx(DatePicker.ViewTrigger, { children: title(dp) }) }),
|
|
43
|
+
/* @__PURE__ */ jsx(DatePicker.NextTrigger, { children: chevron("right") })
|
|
44
|
+
] })
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
...rest,
|
|
48
|
+
"data-scope": "calendar",
|
|
49
|
+
"data-part": "root",
|
|
50
|
+
children: [/* @__PURE__ */ jsxs(DatePicker.Root, {
|
|
51
|
+
open: true,
|
|
52
|
+
closeOnSelect: true,
|
|
53
|
+
inline: true,
|
|
54
|
+
...value !== void 0 ? { value } : {},
|
|
55
|
+
...min !== void 0 ? { min } : {},
|
|
56
|
+
...max !== void 0 ? { max } : {},
|
|
57
|
+
onValueChange: (details) => onValueChange?.(details.value),
|
|
58
|
+
children: [
|
|
59
|
+
/* @__PURE__ */ jsxs(DatePicker.View, {
|
|
60
|
+
view: "day",
|
|
61
|
+
children: [header, /* @__PURE__ */ jsxs(DatePicker.Table, { children: [/* @__PURE__ */ jsx(DatePicker.TableHead, { children: /* @__PURE__ */ jsx(DatePicker.TableRow, { children: /* @__PURE__ */ jsx(DatePicker.Context, { children: (dp) => dp.weekDays.map((day, id) => /* @__PURE__ */ jsx(DatePicker.TableHeader, {
|
|
62
|
+
"aria-label": day.long,
|
|
63
|
+
children: day.narrow
|
|
64
|
+
}, id)) }) }) }), /* @__PURE__ */ jsx(DatePicker.TableBody, { children: /* @__PURE__ */ jsx(DatePicker.Context, { children: (dp) => dp.weeks.map((week, id) => /* @__PURE__ */ jsx(DatePicker.TableRow, { children: week.map((day, id2) => /* @__PURE__ */ jsx(DatePicker.TableCell, {
|
|
65
|
+
value: day,
|
|
66
|
+
children: /* @__PURE__ */ jsx(DatePicker.TableCellTrigger, { children: day.day })
|
|
67
|
+
}, id2)) }, id)) }) })] })]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ jsxs(DatePicker.View, {
|
|
70
|
+
view: "month",
|
|
71
|
+
children: [header, /* @__PURE__ */ jsx(DatePicker.Table, {
|
|
72
|
+
columns: 3,
|
|
73
|
+
children: /* @__PURE__ */ jsx(DatePicker.TableBody, { children: /* @__PURE__ */ jsx(DatePicker.Context, { children: (dp) => dp.getMonthsGrid({ columns: 3 }).map((months, id) => /* @__PURE__ */ jsx(DatePicker.TableRow, { children: months.map((month, id2) => /* @__PURE__ */ jsx(DatePicker.TableCell, {
|
|
74
|
+
value: month.value,
|
|
75
|
+
columns: 3,
|
|
76
|
+
children: /* @__PURE__ */ jsx(DatePicker.TableCellTrigger, { children: month.label })
|
|
77
|
+
}, id2)) }, id)) }) })
|
|
78
|
+
})]
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ jsxs(DatePicker.View, {
|
|
81
|
+
view: "year",
|
|
82
|
+
children: [header, /* @__PURE__ */ jsx(DatePicker.Table, {
|
|
83
|
+
columns: 3,
|
|
84
|
+
children: /* @__PURE__ */ jsx(DatePicker.TableBody, { children: /* @__PURE__ */ jsx(DatePicker.Context, { children: (dp) => dp.getYearsGrid({ columns: 3 }).map((years, id) => /* @__PURE__ */ jsx(DatePicker.TableRow, { children: years.map((year, id2) => /* @__PURE__ */ jsx(DatePicker.TableCell, {
|
|
85
|
+
value: year.value,
|
|
86
|
+
columns: 3,
|
|
87
|
+
children: /* @__PURE__ */ jsx(DatePicker.TableCellTrigger, { children: year.label })
|
|
88
|
+
}, id2)) }, id)) }) })
|
|
89
|
+
})]
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
}), children]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Calendar };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/card/index.d.ts
|
|
3
|
+
export declare const Card: {
|
|
4
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
5
|
+
asChild?: boolean;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
7
|
+
displayName: string;
|
|
8
|
+
} & {
|
|
9
|
+
Root: {
|
|
10
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
Header: {
|
|
16
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}): import("react").JSX.Element | null;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
21
|
+
Title: {
|
|
22
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
}): import("react").JSX.Element | null;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
Description: {
|
|
28
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
29
|
+
asChild?: boolean;
|
|
30
|
+
}): import("react").JSX.Element | null;
|
|
31
|
+
displayName: string;
|
|
32
|
+
};
|
|
33
|
+
Content: {
|
|
34
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
35
|
+
asChild?: boolean;
|
|
36
|
+
}): import("react").JSX.Element | null;
|
|
37
|
+
displayName: string;
|
|
38
|
+
};
|
|
39
|
+
Footer: {
|
|
40
|
+
({ asChild, children, ...rest }: HTMLAttributes<HTMLElement> & {
|
|
41
|
+
asChild?: boolean;
|
|
42
|
+
}): import("react").JSX.Element | null;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
//#endregion
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Children, cloneElement, isValidElement } from "react";
|
|
4
|
+
//#region src/components/card/index.tsx
|
|
5
|
+
/** A vessel: round, resting at the first elevation, one hairline for its
|
|
6
|
+
* edge. Root, Header, Title, Description, Content, Footer — sections
|
|
7
|
+
* carry their own whitespace, so any subset composes. */
|
|
8
|
+
function part(name, tag) {
|
|
9
|
+
const Tag = tag;
|
|
10
|
+
const Component = ({ asChild, children, ...rest }) => {
|
|
11
|
+
const partProps = {
|
|
12
|
+
...rest,
|
|
13
|
+
"data-scope": "card",
|
|
14
|
+
"data-part": name.toLowerCase()
|
|
15
|
+
};
|
|
16
|
+
if (asChild) {
|
|
17
|
+
const child = Children.only(children);
|
|
18
|
+
return isValidElement(child) ? cloneElement(child, partProps) : null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(Tag, {
|
|
21
|
+
...partProps,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
Component.displayName = "Card" + name;
|
|
26
|
+
return Component;
|
|
27
|
+
}
|
|
28
|
+
const Root = part("Root", "section");
|
|
29
|
+
const Header = part("Header", "header");
|
|
30
|
+
const Title = part("Title", "h3");
|
|
31
|
+
const Description = part("Description", "p");
|
|
32
|
+
const Content = part("Content", "div");
|
|
33
|
+
const Footer = part("Footer", "footer");
|
|
34
|
+
const Card = Object.assign(Root, {
|
|
35
|
+
Root,
|
|
36
|
+
Header,
|
|
37
|
+
Title,
|
|
38
|
+
Description,
|
|
39
|
+
Content,
|
|
40
|
+
Footer
|
|
41
|
+
});
|
|
42
|
+
injectComponentStyle("card");
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Card };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
2
|
+
//#region src/components/carousel/index.d.ts
|
|
3
|
+
/** Ark's Carousel, dressed in the paper-and-ink system: slides ride in one
|
|
4
|
+
* hairline-clipped lane, the triggers are quiet outline controls, and the
|
|
5
|
+
* current indicator alone carries the ink. The API is Ark's own — Root,
|
|
6
|
+
* Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup,
|
|
7
|
+
* Indicator, AutoplayTrigger, ProgressText. */
|
|
8
|
+
export declare const Carousel: typeof Carousel$1;
|
|
9
|
+
//#endregion
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
+
import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
3
|
+
//#region src/components/carousel/index.tsx
|
|
4
|
+
/** Ark's Carousel, dressed in the paper-and-ink system: slides ride in one
|
|
5
|
+
* hairline-clipped lane, the triggers are quiet outline controls, and the
|
|
6
|
+
* current indicator alone carries the ink. The API is Ark's own — Root,
|
|
7
|
+
* Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup,
|
|
8
|
+
* Indicator, AutoplayTrigger, ProgressText. */
|
|
9
|
+
const Carousel = Carousel$1;
|
|
10
|
+
injectComponentStyle("carousel");
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Carousel };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { HTMLAttributes } from "react";
|
|
2
|
+
//#region src/components/cascade-select/index.d.ts
|
|
3
|
+
export interface CascadeSelectNode {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
children?: CascadeSelectNode[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A corridor of linked columns: pick a branch and the next column
|
|
11
|
+
* dissolves open beside it, until a leaf click settles the whole path.
|
|
12
|
+
* `value` is the selected path (or paths, when `multiple`) — the joined
|
|
13
|
+
* labels ride the trigger. `highlightTrigger: "hover"` turns the
|
|
14
|
+
* classic cascading menu: pointing is enough to unfold. `filterable`
|
|
15
|
+
* swaps the corridor for a flat list of matching paths while a query
|
|
16
|
+
* runs — each hit still reads as its full route.
|
|
17
|
+
*/
|
|
18
|
+
export interface CascadeSelectProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
value?: string[][];
|
|
20
|
+
data: CascadeSelectNode[];
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
highlightTrigger?: "click" | "hover";
|
|
23
|
+
filterable?: boolean;
|
|
24
|
+
multiple?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** One rung of the control-height ladder for the trigger. */
|
|
27
|
+
size?: "sm" | "md" | "lg";
|
|
28
|
+
onValueChange?: (value: string[][]) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function CascadeSelect({ value, data, placeholder, highlightTrigger, filterable, multiple, disabled, size, onValueChange, ...rest }: CascadeSelectProps): import("react").JSX.Element;
|
|
31
|
+
//#endregion
|