@bysages/react 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-response-jZy-0Tvv.mjs → ai-response-B4DX7nmJ.mjs} +10 -4
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +31 -1
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +5 -3
- package/dist/components/ai/index.d.mts +2 -2
- package/dist/components/ai/index.mjs +29 -12
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +3 -1
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +19 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +3 -1
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +17 -17
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +4 -2
- package/dist/components/ai-response/index.d.mts +8 -3
- package/dist/components/ai-response/index.mjs +1 -1
- package/dist/components/ai-source/index.d.mts +8 -2
- package/dist/components/ai-source/index.mjs +5 -2
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +3 -1
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +4 -2
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +11 -18
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +31 -8
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +3 -1
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +9 -2
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +9 -2
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +3 -1
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +12 -17
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +3 -1
- package/dist/components/banner/index.mjs +13 -18
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -1
- package/dist/components/breadcrumb/index.d.mts +3 -8
- package/dist/components/breadcrumb/index.mjs +11 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +3 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +9 -10
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +43 -2
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +18 -37
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +28 -8
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +44 -48
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +3 -1
- package/dist/components/client-only/index.d.mts +7 -2
- package/dist/components/client-only/index.mjs +5 -1
- package/dist/components/clipboard/index.d.mts +17 -4
- package/dist/components/clipboard/index.mjs +33 -5
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +25 -1
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +56 -14
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +62 -5
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +15 -3
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +3 -1
- package/dist/components/config-provider/index.d.mts +8 -2
- package/dist/components/config-provider/index.mjs +5 -2
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +7 -3
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +33 -9
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +58 -11
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +3 -1
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +13 -8
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +43 -1
- package/dist/components/download-trigger/index.d.mts +7 -2
- package/dist/components/download-trigger/index.mjs +5 -1
- package/dist/components/drawer/index.d.mts +18 -6
- package/dist/components/drawer/index.mjs +40 -1
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +13 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +43 -4
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +3 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +36 -3
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +28 -3
- package/dist/components/file-upload/index.d.mts +36 -9
- package/dist/components/file-upload/index.mjs +66 -11
- package/dist/components/float-button/index.mjs +3 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +55 -1
- package/dist/components/focus-trap/index.d.mts +7 -2
- package/dist/components/focus-trap/index.mjs +5 -1
- package/dist/components/form/index.d.mts +1 -1
- package/dist/components/form/index.mjs +5 -2
- package/dist/components/frame/index.d.mts +4 -8
- package/dist/components/frame/index.mjs +13 -1
- package/dist/components/grid/index.d.mts +4 -1
- package/dist/components/grid/index.mjs +3 -1
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +6 -1
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +32 -1
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +5 -3
- package/dist/components/image/index.d.mts +11 -2
- package/dist/components/image/index.mjs +16 -29
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +34 -2
- package/dist/components/image-viewer/index.d.mts +2 -18
- package/dist/components/image-viewer/index.mjs +3 -109
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +20 -4
- package/dist/components/json-tree-view/index.mjs +38 -4
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +3 -1
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +159 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -1
- package/dist/components/list/index.d.mts +5 -4
- package/dist/components/list/index.mjs +10 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +36 -4
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +34 -2
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +3 -1
- package/dist/components/media-player/index.d.mts +2 -0
- package/dist/components/media-player/index.mjs +2 -0
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +29 -11
- package/dist/components/menu/index.mjs +34 -12
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +36 -1
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +33 -8
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +34 -33
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +57 -12
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +31 -8
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +29 -7
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +23 -18
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +44 -4
- package/dist/components/presence/index.d.mts +10 -2
- package/dist/components/presence/index.mjs +6 -1
- package/dist/components/progress/index.d.mts +18 -3
- package/dist/components/progress/index.mjs +34 -9
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +4 -2
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +26 -2
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +32 -8
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +26 -8
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +2 -2
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +32 -2
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +34 -7
- package/dist/components/select/index.d.mts +2 -2
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/separator/index.d.mts +4 -1
- package/dist/components/separator/index.mjs +3 -1
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +37 -3
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +3 -1
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +31 -8
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +6 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +15 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +35 -1
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +3 -1
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +6 -4
- package/dist/components/steps/index.d.mts +27 -3
- package/dist/components/steps/index.mjs +36 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +30 -3
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +27 -8
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +44 -70
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +25 -9
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +41 -9
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +8 -3
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +3 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +51 -2
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +22 -2
- package/dist/components/toc/index.d.mts +24 -4
- package/dist/components/toc/index.mjs +41 -3
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +21 -1
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +31 -6
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +3 -1
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +28 -1
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +44 -2
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +20 -30
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +15 -24
- package/dist/components/tree-view/index.d.mts +30 -1
- package/dist/components/tree-view/index.mjs +69 -6
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +1 -0
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +3 -1
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -12
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +4 -2
- package/dist/family-DE_GQeeM.mjs +9 -0
- package/dist/icon-BALgGtNK.mjs +18 -0
- package/dist/id-C37UYLwJ.mjs +13 -0
- package/dist/image-viewer-Cf6thHax.mjs +141 -0
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-DFN9F5Zt.d.mts → index-D_iKc2Uw.d.mts} +32 -3
- package/dist/{index-CsfxYv6J.d.mts → index-DdNKngUQ.d.mts} +63 -39
- package/dist/index-Dj8S4eyJ.d.mts +41 -0
- package/dist/index-Eu-Bttta.d.mts +24 -0
- package/dist/{index-uPyYiWaL.d.mts → index-PsgGWW3m.d.mts} +8 -2
- package/dist/index.d.mts +36 -35
- package/dist/index.mjs +13 -12
- package/dist/{input-2oezH-dY.mjs → input-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/messages-1jJWtaYU.mjs +16 -0
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/select-D1xiT1oJ.mjs +0 -68
|
@@ -1,18 +1,14 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { DatePicker as DatePicker$1 } from "../date-picker/index.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
6
|
import { DatePicker } from "@ark-ui/react/date-picker";
|
|
4
7
|
//#region src/components/calendar/index.tsx
|
|
5
8
|
function chevron(dir) {
|
|
6
|
-
return
|
|
9
|
+
return iconNode(dir === "left" ? "chevron-left" : "chevron-right", {
|
|
7
10
|
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" })
|
|
11
|
+
height: 16
|
|
16
12
|
});
|
|
17
13
|
}
|
|
18
14
|
/** The date-picker's month grid, standing on the page without its
|
|
@@ -20,9 +16,10 @@ function chevron(dir) {
|
|
|
20
16
|
* title zooms out through month and year grids; the grids themselves
|
|
21
17
|
* are the shared machinery — value, range selection, and focus ride
|
|
22
18
|
* Ark's own contract. */
|
|
23
|
-
function
|
|
19
|
+
function CalendarImpl({ value, min, max, onValueChange, children, ...rest }) {
|
|
24
20
|
injectComponentStyle("calendar");
|
|
25
21
|
injectComponentStyle("date-picker");
|
|
22
|
+
const hostId = useElementId("calendar", rest);
|
|
26
23
|
const title = (dp) => {
|
|
27
24
|
const d = dp.focusedValue;
|
|
28
25
|
if (!d) return "";
|
|
@@ -48,6 +45,7 @@ function Calendar({ value, min, max, onValueChange, children, ...rest }) {
|
|
|
48
45
|
"data-scope": "calendar",
|
|
49
46
|
"data-part": "root",
|
|
50
47
|
children: [/* @__PURE__ */ jsxs(DatePicker.Root, {
|
|
48
|
+
id: `${hostId}:date-picker`,
|
|
51
49
|
open: true,
|
|
52
50
|
closeOnSelect: true,
|
|
53
51
|
inline: true,
|
|
@@ -92,5 +90,6 @@ function Calendar({ value, min, max, onValueChange, children, ...rest }) {
|
|
|
92
90
|
}), children]
|
|
93
91
|
});
|
|
94
92
|
}
|
|
93
|
+
const Calendar = Object.assign(CalendarImpl, DatePicker$1);
|
|
95
94
|
//#endregion
|
|
96
95
|
export { Calendar };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties, ComponentProps } from "react";
|
|
1
2
|
import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
2
3
|
//#region src/components/carousel/index.d.ts
|
|
3
4
|
/** Ark's Carousel, dressed in the paper-and-ink system: slides ride in one
|
|
@@ -5,5 +6,24 @@ import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
|
5
6
|
* current indicator alone carries the ink. The API is Ark's own — Root,
|
|
6
7
|
* Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup,
|
|
7
8
|
* Indicator, AutoplayTrigger, ProgressText. */
|
|
8
|
-
|
|
9
|
+
declare function CarouselRoot(props: ComponentProps<typeof Carousel$1.Root>): import("react").JSX.Element;
|
|
10
|
+
type CarouselSlide = string | {
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
type CarouselFacadeProps = {
|
|
14
|
+
value?: number;
|
|
15
|
+
defaultValue?: number;
|
|
16
|
+
items: CarouselSlide[];
|
|
17
|
+
spacing?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
onValueChange?: (page: number) => void;
|
|
22
|
+
};
|
|
23
|
+
/** The complete carousel behind a slide list: arrows, progress, items, and
|
|
24
|
+
* indicators use the common lane. Custom slides remain anatomy work. */
|
|
25
|
+
declare function CarouselFacade(props: CarouselFacadeProps): import("react").JSX.Element;
|
|
26
|
+
export declare const Carousel: typeof CarouselFacade & Omit<typeof Carousel$1, "Root"> & {
|
|
27
|
+
Root: typeof CarouselRoot;
|
|
28
|
+
};
|
|
9
29
|
//#endregion
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
3
6
|
//#region src/components/carousel/index.tsx
|
|
4
7
|
/** Ark's Carousel, dressed in the paper-and-ink system: slides ride in one
|
|
@@ -6,7 +9,45 @@ import { Carousel as Carousel$1 } from "@ark-ui/react/carousel";
|
|
|
6
9
|
* current indicator alone carries the ink. The API is Ark's own — Root,
|
|
7
10
|
* Control, PrevTrigger, NextTrigger, ItemGroup, Item, IndicatorGroup,
|
|
8
11
|
* Indicator, AutoplayTrigger, ProgressText. */
|
|
9
|
-
|
|
10
|
-
injectComponentStyle("carousel");
|
|
12
|
+
function CarouselRoot(props) {
|
|
13
|
+
injectComponentStyle("carousel");
|
|
14
|
+
const id = useElementId("carousel", props);
|
|
15
|
+
return /* @__PURE__ */ jsx(Carousel$1.Root, {
|
|
16
|
+
...props,
|
|
17
|
+
id
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
/** The complete carousel behind a slide list: arrows, progress, items, and
|
|
21
|
+
* indicators use the common lane. Custom slides remain anatomy work. */
|
|
22
|
+
function CarouselFacade(props) {
|
|
23
|
+
const { value, defaultValue, items, spacing, label, className, style, onValueChange } = props;
|
|
24
|
+
const slides = items.map((item) => typeof item === "string" ? item : item.label);
|
|
25
|
+
return /* @__PURE__ */ jsxs(CarouselRoot, {
|
|
26
|
+
"aria-label": label,
|
|
27
|
+
slideCount: slides.length,
|
|
28
|
+
defaultPage: defaultValue,
|
|
29
|
+
page: value,
|
|
30
|
+
spacing,
|
|
31
|
+
className,
|
|
32
|
+
style,
|
|
33
|
+
onPageChange: (event) => onValueChange?.(event.page),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxs(Carousel$1.Control, { children: [
|
|
36
|
+
/* @__PURE__ */ jsx(Carousel$1.PrevTrigger, { children: iconNode("chevron-left") }),
|
|
37
|
+
/* @__PURE__ */ jsx(Carousel$1.ProgressText, {}),
|
|
38
|
+
/* @__PURE__ */ jsx(Carousel$1.NextTrigger, { children: iconNode("chevron-right") })
|
|
39
|
+
] }),
|
|
40
|
+
/* @__PURE__ */ jsx(Carousel$1.ItemGroup, { children: slides.map((slide, index) => /* @__PURE__ */ jsx(Carousel$1.Item, {
|
|
41
|
+
index,
|
|
42
|
+
children: slide
|
|
43
|
+
}, index)) }),
|
|
44
|
+
/* @__PURE__ */ jsx(Carousel$1.IndicatorGroup, { children: slides.map((_, index) => /* @__PURE__ */ jsx(Carousel$1.Indicator, { index }, index)) })
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
const Carousel = Object.assign(CarouselFacade, {
|
|
49
|
+
...Carousel$1,
|
|
50
|
+
Root: CarouselRoot
|
|
51
|
+
});
|
|
11
52
|
//#endregion
|
|
12
53
|
export { Carousel };
|
|
@@ -6,6 +6,8 @@ export interface CascadeSelectNode {
|
|
|
6
6
|
children?: CascadeSelectNode[];
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
|
|
9
11
|
/**
|
|
10
12
|
* A corridor of linked columns: pick a branch and the next column
|
|
11
13
|
* dissolves open beside it, until a leaf click settles the whole path.
|
|
@@ -27,5 +29,8 @@ export interface CascadeSelectProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
27
29
|
size?: "sm" | "md" | "lg";
|
|
28
30
|
onValueChange?: (value: string[][]) => void;
|
|
29
31
|
}
|
|
30
|
-
|
|
32
|
+
declare function CascadeSelectImpl({ value, data, placeholder, highlightTrigger, filterable, multiple, disabled, size, onValueChange, ...rest }: CascadeSelectProps): import("react").JSX.Element;
|
|
33
|
+
export declare const CascadeSelect: typeof CascadeSelectImpl & {
|
|
34
|
+
Root: typeof CascadeSelectImpl;
|
|
35
|
+
};
|
|
31
36
|
//#endregion
|
|
@@ -1,46 +1,24 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
4
|
+
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
5
|
+
import { t as Input } from "../../input-C21Zzuy6.mjs";
|
|
2
6
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
8
|
+
import { useMemo, useState } from "react";
|
|
5
9
|
import { Portal } from "@ark-ui/react/portal";
|
|
6
10
|
import { useEnvironmentContext } from "@ark-ui/react/environment";
|
|
7
11
|
import { useFilter, useLocaleContext } from "@ark-ui/react/locale";
|
|
8
12
|
import * as cascade from "@zag-js/cascade-select";
|
|
9
13
|
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
10
14
|
//#region src/components/cascade-select/index.tsx
|
|
11
|
-
const chevronDown =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
strokeWidth: 2,
|
|
16
|
-
strokeLinecap: "round",
|
|
17
|
-
strokeLinejoin: "round",
|
|
18
|
-
"aria-hidden": "true",
|
|
19
|
-
children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
|
|
20
|
-
});
|
|
21
|
-
const chevronRight = /* @__PURE__ */ jsx("svg", {
|
|
22
|
-
viewBox: "0 0 24 24",
|
|
23
|
-
fill: "none",
|
|
24
|
-
stroke: "currentColor",
|
|
25
|
-
strokeWidth: 2,
|
|
26
|
-
strokeLinecap: "round",
|
|
27
|
-
strokeLinejoin: "round",
|
|
28
|
-
"aria-hidden": "true",
|
|
29
|
-
children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
|
|
30
|
-
});
|
|
31
|
-
const checkGlyph = /* @__PURE__ */ jsx("svg", {
|
|
32
|
-
viewBox: "0 0 24 24",
|
|
33
|
-
fill: "none",
|
|
34
|
-
stroke: "currentColor",
|
|
35
|
-
strokeWidth: 3,
|
|
36
|
-
strokeLinecap: "round",
|
|
37
|
-
strokeLinejoin: "round",
|
|
38
|
-
"aria-hidden": "true",
|
|
39
|
-
children: /* @__PURE__ */ jsx("path", { d: "m5 12.5 5 5L19 7" })
|
|
40
|
-
});
|
|
41
|
-
function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
15
|
+
const chevronDown = iconNode("chevron-down");
|
|
16
|
+
const chevronRight = iconNode("chevron-right");
|
|
17
|
+
const checkIcon = iconNode("check");
|
|
18
|
+
function CascadeSelectImpl({ value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
42
19
|
injectComponentStyle("cascade-select");
|
|
43
|
-
const
|
|
20
|
+
const messages = useComponentMessages();
|
|
21
|
+
const id = useElementId("cascade-select", rest);
|
|
44
22
|
const locale = useLocaleContext();
|
|
45
23
|
const env = useEnvironmentContext();
|
|
46
24
|
const collection = cascade.collection({
|
|
@@ -158,7 +136,7 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
158
136
|
}) : null,
|
|
159
137
|
/* @__PURE__ */ jsx("span", {
|
|
160
138
|
...api.getItemIndicatorProps(itemProps),
|
|
161
|
-
children:
|
|
139
|
+
children: checkIcon
|
|
162
140
|
})
|
|
163
141
|
]
|
|
164
142
|
}, itemValue);
|
|
@@ -176,6 +154,7 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
176
154
|
...api.getControlProps(),
|
|
177
155
|
children: /* @__PURE__ */ jsxs("button", {
|
|
178
156
|
...api.getTriggerProps(),
|
|
157
|
+
"aria-labelledby": id + ":value-text",
|
|
179
158
|
onClick: (event) => {
|
|
180
159
|
api.getTriggerProps().onClick?.(event);
|
|
181
160
|
setQuery("");
|
|
@@ -183,6 +162,7 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
183
162
|
disabled: disabled || void 0,
|
|
184
163
|
children: [/* @__PURE__ */ jsx("span", {
|
|
185
164
|
...api.getValueTextProps(),
|
|
165
|
+
id: id + ":value-text",
|
|
186
166
|
children: display || placeholder
|
|
187
167
|
}), /* @__PURE__ */ jsx("span", {
|
|
188
168
|
...api.getIndicatorProps(),
|
|
@@ -201,8 +181,8 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
201
181
|
size: "sm",
|
|
202
182
|
value: query,
|
|
203
183
|
onValueChange: setQuery,
|
|
204
|
-
placeholder:
|
|
205
|
-
"aria-label":
|
|
184
|
+
placeholder: messages.select.filter,
|
|
185
|
+
"aria-label": messages.select.filter
|
|
206
186
|
})
|
|
207
187
|
}) : null, /* @__PURE__ */ jsx("div", {
|
|
208
188
|
"data-scope": "cascade-select",
|
|
@@ -225,5 +205,6 @@ function CascadeSelect({ value, data, placeholder = "Select…", highlightTrigge
|
|
|
225
205
|
}) })]
|
|
226
206
|
});
|
|
227
207
|
}
|
|
208
|
+
const CascadeSelect = withSelfRoot(CascadeSelectImpl);
|
|
228
209
|
//#endregion
|
|
229
210
|
export { CascadeSelect };
|
|
@@ -5,12 +5,30 @@ type CheckboxRootProps = ComponentProps<typeof Checkbox$1.Root> & {
|
|
|
5
5
|
/** One rung for the control's box: the tick scales with it. */
|
|
6
6
|
size?: "sm" | "md" | "lg";
|
|
7
7
|
};
|
|
8
|
-
declare function CheckboxRoot(
|
|
8
|
+
declare function CheckboxRoot(props: CheckboxRootProps): import("react").JSX.Element;
|
|
9
|
+
export interface CheckboxFacadeProps {
|
|
10
|
+
value?: boolean;
|
|
11
|
+
defaultValue?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
invalid?: boolean;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
/** One rung for the control's box: the tick scales with it. */
|
|
18
|
+
size?: "sm" | "md" | "lg";
|
|
19
|
+
className?: string;
|
|
20
|
+
onValueChange?: (value: boolean) => void;
|
|
21
|
+
}
|
|
22
|
+
declare function CheckboxFacade({ value, defaultValue, label, disabled, invalid, required, readOnly, size, className, onValueChange }: CheckboxFacadeProps): import("react").JSX.Element;
|
|
23
|
+
declare namespace CheckboxFacade {
|
|
24
|
+
var displayName: string;
|
|
25
|
+
}
|
|
9
26
|
/** Ark's Checkbox, dressed in the paper-and-ink system: a square-cut seal
|
|
10
27
|
* that fills flat with primary ink when ticked, the mark springing into
|
|
11
28
|
* place. The API is Ark's own — Root, Label, Control, Indicator,
|
|
12
29
|
* HiddenInput. */
|
|
13
|
-
|
|
30
|
+
type CheckboxParts = Omit<typeof Checkbox$1, "Root"> & {
|
|
14
31
|
Root: typeof CheckboxRoot;
|
|
15
32
|
};
|
|
33
|
+
export declare const Checkbox: typeof CheckboxFacade & CheckboxParts;
|
|
16
34
|
//#endregion
|
|
@@ -1,21 +1,41 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { Checkbox as Checkbox$1 } from "@ark-ui/react/checkbox";
|
|
4
6
|
//#region src/components/checkbox/index.tsx
|
|
5
|
-
function CheckboxRoot(
|
|
7
|
+
function CheckboxRoot(props) {
|
|
8
|
+
const id = useElementId("checkbox", props);
|
|
9
|
+
const { size = "md", ...rest } = props;
|
|
6
10
|
return /* @__PURE__ */ jsx(Checkbox$1.Root, {
|
|
7
11
|
...rest,
|
|
12
|
+
id,
|
|
8
13
|
"data-size": size
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
function CheckboxFacade({ value, defaultValue = false, label, disabled = false, invalid = false, required = false, readOnly = false, size = "md", className, onValueChange }) {
|
|
17
|
+
return /* @__PURE__ */ jsxs(CheckboxRoot, {
|
|
18
|
+
className,
|
|
19
|
+
size,
|
|
20
|
+
disabled,
|
|
21
|
+
invalid,
|
|
22
|
+
readOnly,
|
|
23
|
+
required,
|
|
24
|
+
defaultChecked: defaultValue,
|
|
25
|
+
...value === void 0 ? {} : { checked: value },
|
|
26
|
+
onCheckedChange: (details) => onValueChange?.(details.checked === true),
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Checkbox$1.Control, { children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, { children: iconNode("check") }) }),
|
|
29
|
+
label ? /* @__PURE__ */ jsx(Checkbox$1.Label, { children: label }) : null,
|
|
30
|
+
/* @__PURE__ */ jsx(Checkbox$1.HiddenInput, {})
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
CheckboxFacade.displayName = "SCheckbox";
|
|
35
|
+
const Checkbox = Object.assign(CheckboxFacade, {
|
|
16
36
|
...Checkbox$1,
|
|
17
37
|
Root: CheckboxRoot
|
|
18
|
-
};
|
|
38
|
+
});
|
|
19
39
|
injectComponentStyle("checkbox");
|
|
20
40
|
//#endregion
|
|
21
41
|
export { Checkbox };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Checkbox } from "../checkbox/index.mjs";
|
|
1
2
|
import { HTMLAttributes } from "react";
|
|
2
3
|
//#region src/components/checkbox-group/index.d.ts
|
|
3
4
|
export interface CheckboxOption {
|
|
@@ -7,6 +8,7 @@ export interface CheckboxOption {
|
|
|
7
8
|
}
|
|
8
9
|
export interface CheckboxGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
10
|
value?: string[];
|
|
11
|
+
defaultValue?: string[];
|
|
10
12
|
options: CheckboxOption[];
|
|
11
13
|
layout?: "vertical" | "horizontal";
|
|
12
14
|
/** One register for every box: falls onto each root's data-size for
|
|
@@ -18,11 +20,11 @@ export interface CheckboxGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
21
|
-
* checkboxes bound to a single array.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* its name dress every box at once.
|
|
23
|
+
* checkboxes bound to a single array. Ark's group owns selection, form
|
|
24
|
+
* wiring, and limits; the facade maps an options list onto it. Inside a
|
|
25
|
+
* `Field.Root` the group picks up the field context, so invalid and
|
|
26
|
+
* disabled states dress every box at once.
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
declare function CheckboxGroupImpl({ value, defaultValue, options, layout, size, invalid, disabled, onValueChange, ...rest }: CheckboxGroupProps): import("react").JSX.Element;
|
|
29
|
+
export declare const CheckboxGroup: typeof CheckboxGroupImpl & typeof Checkbox;
|
|
28
30
|
//#endregion
|
|
@@ -1,65 +1,61 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { Checkbox as Checkbox$1 } from "../checkbox/index.mjs";
|
|
1
4
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useId } from "react";
|
|
4
6
|
import { useFieldContext } from "@ark-ui/react/field";
|
|
5
7
|
import { Checkbox } from "@ark-ui/react/checkbox";
|
|
6
8
|
//#region src/components/checkbox-group/index.tsx
|
|
7
|
-
const
|
|
8
|
-
viewBox: "0 0 24 24",
|
|
9
|
-
fill: "none",
|
|
10
|
-
stroke: "currentColor",
|
|
11
|
-
strokeWidth: 3,
|
|
12
|
-
strokeLinecap: "round",
|
|
13
|
-
strokeLinejoin: "round",
|
|
14
|
-
"aria-hidden": "true",
|
|
15
|
-
children: /* @__PURE__ */ jsx("path", { d: "m5 12.5 5 5L19 7" })
|
|
16
|
-
});
|
|
9
|
+
const checkIcon = iconNode("check");
|
|
17
10
|
/**
|
|
18
11
|
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
19
|
-
* checkboxes bound to a single array.
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
* its name dress every box at once.
|
|
12
|
+
* checkboxes bound to a single array. Ark's group owns selection, form
|
|
13
|
+
* wiring, and limits; the facade maps an options list onto it. Inside a
|
|
14
|
+
* `Field.Root` the group picks up the field context, so invalid and
|
|
15
|
+
* disabled states dress every box at once.
|
|
24
16
|
*/
|
|
25
|
-
function
|
|
17
|
+
function CheckboxGroupImpl({ value, defaultValue, options, layout = "vertical", size = "md", invalid = false, disabled = false, onValueChange, ...rest }) {
|
|
26
18
|
injectComponentStyle("checkbox-group");
|
|
27
19
|
injectComponentStyle("checkbox");
|
|
28
20
|
const field = useFieldContext();
|
|
29
|
-
const uid =
|
|
30
|
-
const selected = new Set(value);
|
|
21
|
+
const uid = useElementId("checkbox-group", rest);
|
|
31
22
|
const isInvalid = invalid || field?.invalid === true;
|
|
32
23
|
const isDisabled = disabled || field?.disabled === true;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
24
|
+
return /* @__PURE__ */ jsx(Checkbox.Group, {
|
|
25
|
+
asChild: true,
|
|
26
|
+
...isInvalid ? { invalid: true } : {},
|
|
27
|
+
...isDisabled ? { disabled: true } : {},
|
|
28
|
+
...defaultValue === void 0 ? {} : { defaultValue },
|
|
29
|
+
...value === void 0 ? {} : { value },
|
|
30
|
+
onValueChange,
|
|
31
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
32
|
+
...rest,
|
|
33
|
+
id: uid,
|
|
34
|
+
"data-scope": "checkbox-group",
|
|
35
|
+
"data-part": "root",
|
|
36
|
+
"data-layout": layout,
|
|
37
|
+
"data-invalid": isInvalid ? "" : void 0,
|
|
38
|
+
children: options.map((option) => {
|
|
39
|
+
const checkboxId = `${uid}:checkbox:${option.value}`;
|
|
40
|
+
return /* @__PURE__ */ jsxs(Checkbox.Root, {
|
|
41
|
+
id: checkboxId,
|
|
42
|
+
value: option.value,
|
|
43
|
+
ids: {
|
|
44
|
+
label: `${checkboxId}:label`,
|
|
45
|
+
hiddenInput: `${checkboxId}:input`
|
|
46
|
+
},
|
|
47
|
+
"data-size": size,
|
|
48
|
+
disabled: isDisabled || option.disabled === true,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ jsx(Checkbox.Control, { children: /* @__PURE__ */ jsx(Checkbox.Indicator, { children: checkIcon }) }),
|
|
51
|
+
/* @__PURE__ */ jsx(Checkbox.Label, { children: option.label }),
|
|
52
|
+
/* @__PURE__ */ jsx(Checkbox.HiddenInput, {})
|
|
53
|
+
]
|
|
54
|
+
}, option.value);
|
|
55
|
+
})
|
|
56
|
+
})
|
|
62
57
|
});
|
|
63
58
|
}
|
|
59
|
+
const CheckboxGroup = Object.assign(CheckboxGroupImpl, Checkbox$1);
|
|
64
60
|
//#endregion
|
|
65
61
|
export { CheckboxGroup };
|
|
@@ -8,5 +8,8 @@ export interface ChipProps extends HTMLAttributes<HTMLSpanElement> {
|
|
|
8
8
|
tone?: "ink" | "info" | "success" | "warning" | "danger";
|
|
9
9
|
variant?: "solid" | "subtle" | "outline";
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
declare function ChipImpl({ value, max, tone, variant, ...rest }: ChipProps): import("react").JSX.Element;
|
|
12
|
+
export declare const Chip: typeof ChipImpl & {
|
|
13
|
+
Root: typeof ChipImpl;
|
|
14
|
+
};
|
|
12
15
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/chip/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function ChipImpl({ value, max, tone = "ink", variant = "solid", ...rest }) {
|
|
5
6
|
injectComponentStyle("chip");
|
|
6
7
|
const text = max != null && value > max ? `${max}+` : String(value);
|
|
7
8
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -13,5 +14,6 @@ function Chip({ value, max, tone = "ink", variant = "solid", ...rest }) {
|
|
|
13
14
|
children: text
|
|
14
15
|
});
|
|
15
16
|
}
|
|
17
|
+
const Chip = withSelfRoot(ChipImpl);
|
|
16
18
|
//#endregion
|
|
17
19
|
export { Chip };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { ClientOnlyProps } from "@ark-ui/react/client-only";
|
|
2
|
+
//#region src/components/client-only/index.d.ts
|
|
3
|
+
export declare const ClientOnly: ((props: import("@ark-ui/react/client-only").ClientOnlyProps) => React.ReactNode) & {
|
|
4
|
+
Root: (props: import("@ark-ui/react/client-only").ClientOnlyProps) => React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export type { ClientOnlyProps };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { ClientOnly as ClientOnly$1 } from "@ark-ui/react/client-only";
|
|
3
|
+
//#region src/components/client-only/index.tsx
|
|
4
|
+
const ClientOnly = withSelfRoot(ClientOnly$1);
|
|
5
|
+
//#endregion
|
|
2
6
|
export { ClientOnly };
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { CSSProperties, ComponentProps, HTMLAttributes } from "react";
|
|
2
2
|
import { Clipboard as Clipboard$1 } from "@ark-ui/react/clipboard";
|
|
3
3
|
//#region src/components/clipboard/index.d.ts
|
|
4
4
|
/** Ark's Clipboard, dressed in the paper-and-ink system: a hairline value
|
|
5
5
|
* field beside an icon-sized copy trigger whose ink turns bamboo while the
|
|
6
6
|
* copy is confirmed. The API is Ark's own — Root, Label, Control, Input,
|
|
7
7
|
* Trigger, Indicator, Context, HiddenInput. */
|
|
8
|
-
type ClipboardRootProps = ComponentProps<typeof Clipboard$1.Root> & {
|
|
8
|
+
type ClipboardRootProps = ComponentProps<typeof Clipboard$1.Root> & Pick<HTMLAttributes<HTMLDivElement>, "className" | "style"> & {
|
|
9
9
|
/** One rung of the control-height ladder for the value field and
|
|
10
10
|
* its copy seal. */
|
|
11
11
|
size?: "sm" | "md" | "lg";
|
|
12
12
|
};
|
|
13
|
-
declare function ClipboardRoot(
|
|
14
|
-
|
|
13
|
+
declare function ClipboardRoot(props: ClipboardRootProps): import("react").JSX.Element;
|
|
14
|
+
type ClipboardFacadeProps = {
|
|
15
|
+
value?: string;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
label?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
size?: "sm" | "md" | "lg";
|
|
20
|
+
className?: string;
|
|
21
|
+
style?: CSSProperties;
|
|
22
|
+
onValueChange?: (value: string) => void;
|
|
23
|
+
};
|
|
24
|
+
/** The complete copy field behind one value: a labelled read-only input and
|
|
25
|
+
* its confirmed copy trigger. */
|
|
26
|
+
declare function ClipboardFacade(props: ClipboardFacadeProps): import("react").JSX.Element;
|
|
27
|
+
export declare const Clipboard: typeof ClipboardFacade & Omit<typeof Clipboard$1, "Root"> & {
|
|
15
28
|
Root: typeof ClipboardRoot;
|
|
16
29
|
};
|
|
17
30
|
//#endregion
|
|
@@ -1,17 +1,45 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
1
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { Clipboard as Clipboard$1 } from "@ark-ui/react/clipboard";
|
|
4
6
|
//#region src/components/clipboard/index.tsx
|
|
5
|
-
function ClipboardRoot(
|
|
7
|
+
function ClipboardRoot(props) {
|
|
8
|
+
injectComponentStyle("clipboard");
|
|
9
|
+
const id = useElementId("clipboard", props);
|
|
10
|
+
const { size = "md", ...rest } = props;
|
|
6
11
|
return /* @__PURE__ */ jsx(Clipboard$1.Root, {
|
|
7
12
|
...rest,
|
|
13
|
+
id,
|
|
8
14
|
"data-size": size
|
|
9
15
|
});
|
|
10
16
|
}
|
|
11
|
-
|
|
17
|
+
/** The complete copy field behind one value: a labelled read-only input and
|
|
18
|
+
* its confirmed copy trigger. */
|
|
19
|
+
function ClipboardFacade(props) {
|
|
20
|
+
const { value, defaultValue, label, placeholder, size = "md", className, style, onValueChange } = props;
|
|
21
|
+
return /* @__PURE__ */ jsxs(ClipboardRoot, {
|
|
22
|
+
size,
|
|
23
|
+
defaultValue,
|
|
24
|
+
value,
|
|
25
|
+
className,
|
|
26
|
+
style,
|
|
27
|
+
onValueChange: (event) => onValueChange?.(event.value),
|
|
28
|
+
children: [label ? /* @__PURE__ */ jsx(Clipboard$1.Label, { children: label }) : null, /* @__PURE__ */ jsxs(Clipboard$1.Control, { children: [/* @__PURE__ */ jsx(Clipboard$1.Input, { placeholder }), /* @__PURE__ */ jsx(Clipboard$1.Trigger, { children: /* @__PURE__ */ jsx(Clipboard$1.Indicator, {
|
|
29
|
+
copied: iconNode("check", {
|
|
30
|
+
width: 14,
|
|
31
|
+
height: 14
|
|
32
|
+
}),
|
|
33
|
+
children: iconNode("copy", {
|
|
34
|
+
width: 14,
|
|
35
|
+
height: 14
|
|
36
|
+
})
|
|
37
|
+
}) })] })]
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const Clipboard = Object.assign(ClipboardFacade, {
|
|
12
41
|
...Clipboard$1,
|
|
13
42
|
Root: ClipboardRoot
|
|
14
|
-
};
|
|
15
|
-
injectComponentStyle("clipboard");
|
|
43
|
+
});
|
|
16
44
|
//#endregion
|
|
17
45
|
export { Clipboard };
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { Collapsible as Collapsible$1 } from "@ark-ui/react/collapsible";
|
|
2
3
|
//#region src/components/collapsible/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
export interface CollapsibleFacadeProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
label: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function CollapsibleFacade({ open, defaultOpen, label, disabled, className, children, onOpenChange }: CollapsibleFacadeProps): import("react").JSX.Element;
|
|
14
|
+
declare namespace CollapsibleFacade {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
}
|
|
17
|
+
type CollapsibleParts = typeof Collapsible$1;
|
|
18
|
+
export declare const Collapsible: typeof CollapsibleFacade & CollapsibleParts;
|
|
7
19
|
//#endregion
|