@bysages/react 0.3.1 → 0.4.1
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-BfKTmtCt.mjs → ai-response-nhDOlELQ.mjs} +4 -2
- package/dist/chevron-a2nIZKN4.mjs +6 -0
- package/dist/components/accordion/index.d.mts +22 -4
- package/dist/components/accordion/index.mjs +32 -2
- package/dist/components/affix/index.d.mts +4 -1
- package/dist/components/affix/index.mjs +6 -4
- package/dist/components/ai/index.d.mts +1 -1
- package/dist/components/ai/index.mjs +6 -4
- package/dist/components/ai-action/index.d.mts +4 -1
- package/dist/components/ai-action/index.mjs +4 -2
- package/dist/components/ai-attachments/index.d.mts +10 -4
- package/dist/components/ai-attachments/index.mjs +17 -45
- package/dist/components/ai-message/index.d.mts +4 -1
- package/dist/components/ai-message/index.mjs +4 -2
- package/dist/components/ai-prompt-input/index.d.mts +5 -2
- package/dist/components/ai-prompt-input/index.mjs +11 -15
- package/dist/components/ai-reasoning/index.d.mts +4 -1
- package/dist/components/ai-reasoning/index.mjs +5 -3
- package/dist/components/ai-response/index.d.mts +4 -1
- 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 +6 -3
- package/dist/components/ai-suggestion/index.d.mts +4 -1
- package/dist/components/ai-suggestion/index.mjs +4 -2
- package/dist/components/ai-tool/index.d.mts +4 -1
- package/dist/components/ai-tool/index.mjs +5 -3
- package/dist/components/alert/index.d.mts +2 -0
- package/dist/components/alert/index.mjs +12 -19
- package/dist/components/angle-slider/index.d.mts +19 -2
- package/dist/components/angle-slider/index.mjs +32 -9
- package/dist/components/aspect-ratio/index.d.mts +4 -1
- package/dist/components/aspect-ratio/index.mjs +4 -2
- package/dist/components/autocomplete/index.d.mts +3 -1
- package/dist/components/autocomplete/index.mjs +15 -3
- package/dist/components/avatar/index.d.mts +2 -2
- package/dist/components/avatar/index.mjs +10 -3
- package/dist/components/avatar-group/index.d.mts +4 -1
- package/dist/components/avatar-group/index.mjs +4 -2
- package/dist/components/back-top/index.d.mts +7 -1
- package/dist/components/back-top/index.mjs +13 -18
- package/dist/components/badge/index.d.mts +4 -1
- package/dist/components/badge/index.mjs +4 -2
- package/dist/components/banner/index.mjs +3 -12
- package/dist/components/bento/index.mjs +1 -1
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +4 -2
- package/dist/components/breadcrumb/index.mjs +1 -1
- package/dist/components/browser/index.mjs +1 -1
- package/dist/components/button/index.d.mts +4 -1
- package/dist/components/button/index.mjs +4 -2
- package/dist/components/button-group/index.mjs +1 -1
- package/dist/components/calendar/index.d.mts +3 -1
- package/dist/components/calendar/index.mjs +10 -11
- package/dist/components/card/index.mjs +1 -1
- package/dist/components/carousel/index.d.mts +21 -1
- package/dist/components/carousel/index.mjs +44 -3
- package/dist/components/cascade-select/index.d.mts +6 -1
- package/dist/components/cascade-select/index.mjs +13 -36
- package/dist/components/checkbox/index.d.mts +20 -2
- package/dist/components/checkbox/index.mjs +29 -9
- package/dist/components/checkbox-group/index.d.mts +8 -6
- package/dist/components/checkbox-group/index.mjs +45 -49
- package/dist/components/chip/index.d.mts +4 -1
- package/dist/components/chip/index.mjs +4 -2
- 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 +34 -6
- package/dist/components/collapsible/index.d.mts +16 -4
- package/dist/components/collapsible/index.mjs +26 -2
- package/dist/components/color-picker/index.d.mts +20 -4
- package/dist/components/color-picker/index.mjs +57 -15
- package/dist/components/combobox/index.d.mts +27 -1
- package/dist/components/combobox/index.mjs +63 -6
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +8 -2
- package/dist/components/comment/index.d.mts +4 -1
- package/dist/components/comment/index.mjs +4 -2
- package/dist/components/config-provider/index.d.mts +4 -1
- package/dist/components/config-provider/index.mjs +3 -1
- package/dist/components/container/index.d.mts +4 -1
- package/dist/components/container/index.mjs +4 -2
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +4 -2
- package/dist/components/date-input/index.d.mts +19 -4
- package/dist/components/date-input/index.mjs +34 -10
- package/dist/components/date-picker/index.d.mts +21 -4
- package/dist/components/date-picker/index.mjs +59 -12
- package/dist/components/deferred-content/index.d.mts +4 -1
- package/dist/components/deferred-content/index.mjs +4 -2
- package/dist/components/descriptions/index.d.mts +10 -2
- package/dist/components/descriptions/index.mjs +14 -9
- package/dist/components/dialog/index.d.mts +18 -5
- package/dist/components/dialog/index.mjs +44 -2
- package/dist/components/dock/index.mjs +1 -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 +41 -2
- package/dist/components/dynamic-input/index.d.mts +4 -1
- package/dist/components/dynamic-input/index.mjs +11 -19
- package/dist/components/editable/index.d.mts +28 -7
- package/dist/components/editable/index.mjs +44 -5
- package/dist/components/ellipsis/index.d.mts +4 -1
- package/dist/components/ellipsis/index.mjs +4 -2
- package/dist/components/empty/index.mjs +1 -1
- package/dist/components/field/index.d.mts +30 -5
- package/dist/components/field/index.mjs +37 -4
- package/dist/components/fieldset/index.d.mts +19 -4
- package/dist/components/fieldset/index.mjs +29 -4
- package/dist/components/file-upload/index.d.mts +29 -9
- package/dist/components/file-upload/index.mjs +47 -11
- package/dist/components/float-button/index.mjs +1 -1
- package/dist/components/floating-panel/index.d.mts +18 -6
- package/dist/components/floating-panel/index.mjs +56 -2
- 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 +6 -3
- 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 +4 -2
- package/dist/components/highlight/index.d.mts +3 -5
- package/dist/components/highlight/index.mjs +7 -2
- package/dist/components/hover-card/index.d.mts +20 -4
- package/dist/components/hover-card/index.mjs +33 -2
- package/dist/components/icon/index.d.mts +10 -8
- package/dist/components/icon/index.mjs +6 -4
- package/dist/components/image/index.d.mts +5 -2
- package/dist/components/image/index.mjs +15 -30
- package/dist/components/image-cropper/index.d.mts +13 -2
- package/dist/components/image-cropper/index.mjs +35 -3
- package/dist/components/image-viewer/index.d.mts +2 -24
- package/dist/components/image-viewer/index.mjs +3 -113
- package/dist/components/input/index.d.mts +3 -1
- package/dist/components/input/index.mjs +1 -1
- package/dist/components/input-group/index.mjs +1 -1
- package/dist/components/json-tree-view/index.d.mts +17 -1
- package/dist/components/json-tree-view/index.mjs +27 -6
- package/dist/components/kbd/index.d.mts +4 -1
- package/dist/components/kbd/index.mjs +4 -2
- package/dist/components/layout/index.d.mts +25 -7
- package/dist/components/layout/index.mjs +158 -64
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +4 -2
- package/dist/components/list/index.mjs +1 -1
- package/dist/components/listbox/index.d.mts +22 -1
- package/dist/components/listbox/index.mjs +37 -5
- package/dist/components/marquee/index.d.mts +18 -1
- package/dist/components/marquee/index.mjs +35 -3
- package/dist/components/masonry/index.d.mts +4 -1
- package/dist/components/masonry/index.mjs +4 -2
- 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 +35 -13
- package/dist/components/menubar/index.d.mts +3 -1
- package/dist/components/menubar/index.mjs +7 -2
- package/dist/components/meter/index.mjs +1 -1
- package/dist/components/navigation-menu/index.d.mts +25 -1
- package/dist/components/navigation-menu/index.mjs +37 -2
- package/dist/components/number-input/index.d.mts +28 -6
- package/dist/components/number-input/index.mjs +34 -9
- package/dist/components/order-list/index.d.mts +4 -1
- package/dist/components/order-list/index.mjs +27 -25
- package/dist/components/page-header/index.mjs +1 -1
- package/dist/components/pagination/index.d.mts +23 -3
- package/dist/components/pagination/index.mjs +58 -13
- package/dist/components/password-input/index.d.mts +24 -6
- package/dist/components/password-input/index.mjs +32 -9
- package/dist/components/pin-input/index.d.mts +23 -5
- package/dist/components/pin-input/index.mjs +30 -8
- package/dist/components/popconfirm/index.d.mts +9 -5
- package/dist/components/popconfirm/index.mjs +24 -19
- package/dist/components/popover/index.d.mts +2 -8
- package/dist/components/popover/index.mjs +45 -5
- 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 +35 -10
- package/dist/components/progress-group/index.d.mts +4 -1
- package/dist/components/progress-group/index.mjs +5 -3
- package/dist/components/qr-code/index.d.mts +14 -1
- package/dist/components/qr-code/index.mjs +27 -3
- package/dist/components/radio-group/index.d.mts +27 -2
- package/dist/components/radio-group/index.mjs +33 -9
- package/dist/components/rating-group/index.d.mts +20 -3
- package/dist/components/rating-group/index.mjs +27 -9
- package/dist/components/result/index.d.mts +1 -1
- package/dist/components/result/index.mjs +3 -3
- package/dist/components/scroll-area/index.d.mts +14 -1
- package/dist/components/scroll-area/index.mjs +33 -3
- package/dist/components/segment-group/index.d.mts +28 -2
- package/dist/components/segment-group/index.mjs +35 -8
- 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 +4 -2
- package/dist/components/signature-pad/index.d.mts +25 -5
- package/dist/components/signature-pad/index.mjs +38 -4
- package/dist/components/skeleton/index.d.mts +4 -1
- package/dist/components/skeleton/index.mjs +4 -2
- package/dist/components/slider/index.d.mts +21 -2
- package/dist/components/slider/index.mjs +32 -9
- package/dist/components/spinner/index.d.mts +4 -1
- package/dist/components/spinner/index.mjs +4 -2
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +13 -18
- package/dist/components/splitter/index.d.mts +17 -4
- package/dist/components/splitter/index.mjs +36 -2
- package/dist/components/spotlight/index.d.mts +4 -1
- package/dist/components/spotlight/index.mjs +4 -2
- package/dist/components/stack/index.d.mts +4 -1
- package/dist/components/stack/index.mjs +7 -5
- package/dist/components/stat/index.mjs +1 -1
- package/dist/components/steps/index.d.mts +26 -6
- package/dist/components/steps/index.mjs +27 -12
- package/dist/components/swap/index.d.mts +11 -5
- package/dist/components/swap/index.mjs +31 -4
- package/dist/components/switch/index.d.mts +20 -2
- package/dist/components/switch/index.mjs +28 -9
- package/dist/components/table/index.d.mts +4 -1
- package/dist/components/table/index.mjs +38 -60
- package/dist/components/tabs/index.d.mts +24 -2
- package/dist/components/tabs/index.mjs +26 -10
- package/dist/components/tags-input/index.d.mts +33 -8
- package/dist/components/tags-input/index.mjs +42 -10
- package/dist/components/terminal/index.d.mts +4 -1
- package/dist/components/terminal/index.mjs +4 -2
- package/dist/components/textarea/index.d.mts +4 -1
- package/dist/components/textarea/index.mjs +4 -2
- package/dist/components/timeline/index.mjs +1 -1
- package/dist/components/timer/index.d.mts +18 -1
- package/dist/components/timer/index.mjs +52 -3
- package/dist/components/toast/index.d.mts +3 -6
- package/dist/components/toast/index.mjs +23 -3
- package/dist/components/toc/index.d.mts +19 -5
- package/dist/components/toc/index.mjs +32 -6
- package/dist/components/toggle/index.d.mts +11 -4
- package/dist/components/toggle/index.mjs +22 -2
- package/dist/components/toggle-group/index.d.mts +26 -2
- package/dist/components/toggle-group/index.mjs +32 -7
- package/dist/components/toolbar/index.d.mts +4 -1
- package/dist/components/toolbar/index.mjs +4 -2
- package/dist/components/tooltip/index.d.mts +17 -4
- package/dist/components/tooltip/index.mjs +29 -2
- package/dist/components/tour/index.d.mts +18 -9
- package/dist/components/tour/index.mjs +45 -3
- package/dist/components/transfer/index.d.mts +3 -1
- package/dist/components/transfer/index.mjs +15 -27
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +12 -23
- package/dist/components/tree-view/index.d.mts +22 -2
- package/dist/components/tree-view/index.mjs +51 -9
- package/dist/components/typography/index.d.mts +4 -0
- package/dist/components/typography/index.mjs +2 -1
- package/dist/components/user/index.d.mts +4 -1
- package/dist/components/user/index.mjs +4 -2
- package/dist/components/virtual-list/index.d.mts +4 -1
- package/dist/components/virtual-list/index.mjs +11 -13
- package/dist/components/watermark/index.d.mts +4 -1
- package/dist/components/watermark/index.mjs +5 -3
- 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-B-hKFkEw.mjs +141 -0
- package/dist/{index-Dn5mHf1g.d.mts → index-B4twHAQC.d.mts} +194 -106
- package/dist/{index-Uefyw7Im.d.mts → index-Bbg4heDO.d.mts} +12 -7
- package/dist/index-BcRdWGY-.d.mts +115 -0
- package/dist/{index-Iy8m0Qev.d.mts → index-D_iKc2Uw.d.mts} +31 -2
- 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 +11 -10
- package/dist/{input-2oezH-dY.mjs → input-BDpQ0e6G.mjs} +4 -2
- package/dist/media-player-DjVvo1_7.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BwnyvdXz.mjs} +75 -43
- package/dist/select-i9UZsQCU.mjs +121 -0
- package/package.json +9 -81
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/glyph-VI989p8H.mjs +0 -14
- package/dist/select-eAHutw56.mjs +0 -70
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
import { useEffect, useRef, useState } from "react";
|
|
4
5
|
//#region src/components/deferred-content/index.tsx
|
|
@@ -6,7 +7,7 @@ import { useEffect, useRef, useState } from "react";
|
|
|
6
7
|
* tree until the placeholder scrolls near the viewport, then mounts
|
|
7
8
|
* once and stays. The placeholder is drawn by the caller, so the late
|
|
8
9
|
* arrival costs no layout shift it cannot predict. */
|
|
9
|
-
function
|
|
10
|
+
function DeferredContentImpl({ threshold = .2, placeholder, children, ...rest }) {
|
|
10
11
|
injectComponentStyle("deferred-content");
|
|
11
12
|
const host = useRef(null);
|
|
12
13
|
const [active, setActive] = useState(false);
|
|
@@ -30,5 +31,6 @@ function DeferredContent({ threshold = .2, placeholder, children, ...rest }) {
|
|
|
30
31
|
children: active ? children : placeholder
|
|
31
32
|
});
|
|
32
33
|
}
|
|
34
|
+
const DeferredContent = withSelfRoot(DeferredContentImpl);
|
|
33
35
|
//#endregion
|
|
34
36
|
export { DeferredContent };
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
//#region src/components/descriptions/index.d.ts
|
|
3
|
+
/** Simple term/detail records for the callable facade. */
|
|
4
|
+
export interface DescriptionsItemData {
|
|
5
|
+
term: string;
|
|
6
|
+
detail: string;
|
|
7
|
+
span?: number;
|
|
8
|
+
}
|
|
3
9
|
/** A ledger laid flat: term and detail pairs in one quiet grid. The
|
|
4
10
|
* horizontal layout reads as a table of two columns; the vertical one
|
|
5
11
|
* stacks each pair for narrow measures. */
|
|
@@ -10,16 +16,18 @@ export interface DescriptionsRootProps extends HTMLAttributes<HTMLDListElement>
|
|
|
10
16
|
bordered?: boolean;
|
|
11
17
|
/** Pairs across the grid: one ledger per column. */
|
|
12
18
|
column?: number;
|
|
19
|
+
items?: DescriptionsItemData[];
|
|
13
20
|
}
|
|
14
|
-
export declare function DescriptionsRoot({ layout, bordered, column, children, ...rest }: DescriptionsRootProps): import("react").JSX.Element;
|
|
21
|
+
export declare function DescriptionsRoot({ layout, bordered, column, items, children, ...rest }: DescriptionsRootProps): import("react").JSX.Element;
|
|
15
22
|
declare function DescriptionsItem({ span, children, ...rest }: HTMLAttributes<HTMLDivElement> & {
|
|
16
23
|
span?: number;
|
|
17
24
|
}): import("react").JSX.Element;
|
|
18
25
|
declare namespace DescriptionsItem {
|
|
19
26
|
var displayName: string;
|
|
20
27
|
}
|
|
21
|
-
export declare const Descriptions: {
|
|
28
|
+
export declare const Descriptions: typeof DescriptionsRoot & {
|
|
22
29
|
Root: typeof DescriptionsRoot;
|
|
30
|
+
} & {
|
|
23
31
|
Item: typeof DescriptionsItem;
|
|
24
32
|
Term: {
|
|
25
33
|
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/descriptions/index.tsx
|
|
4
|
-
function DescriptionsRoot({ layout = "horizontal", bordered = false, column = 1, children, ...rest }) {
|
|
5
|
+
function DescriptionsRoot({ layout = "horizontal", bordered = false, column = 1, items, children, ...rest }) {
|
|
5
6
|
injectComponentStyle("descriptions");
|
|
6
7
|
return /* @__PURE__ */ jsx("dl", {
|
|
7
8
|
...rest,
|
|
@@ -13,7 +14,10 @@ function DescriptionsRoot({ layout = "horizontal", bordered = false, column = 1,
|
|
|
13
14
|
...rest.style,
|
|
14
15
|
"--bs-desc-columns": String(column)
|
|
15
16
|
},
|
|
16
|
-
children
|
|
17
|
+
children: children ?? items?.map((item) => /* @__PURE__ */ jsxs(DescriptionsItem, {
|
|
18
|
+
span: item.span,
|
|
19
|
+
children: [/* @__PURE__ */ jsx(Term, { children: item.term }), /* @__PURE__ */ jsx(Detail, { children: item.detail })]
|
|
20
|
+
}, item.term))
|
|
17
21
|
});
|
|
18
22
|
}
|
|
19
23
|
function part(name, tag) {
|
|
@@ -40,11 +44,12 @@ function DescriptionsItem({ span = 1, children, ...rest }) {
|
|
|
40
44
|
});
|
|
41
45
|
}
|
|
42
46
|
DescriptionsItem.displayName = "DescriptionsItem";
|
|
43
|
-
const
|
|
44
|
-
|
|
47
|
+
const Term = part("Term", "dt");
|
|
48
|
+
const Detail = part("Detail", "dd");
|
|
49
|
+
const Descriptions = Object.assign(withSelfRoot(DescriptionsRoot), {
|
|
45
50
|
Item: DescriptionsItem,
|
|
46
|
-
Term
|
|
47
|
-
Detail
|
|
48
|
-
};
|
|
51
|
+
Term,
|
|
52
|
+
Detail
|
|
53
|
+
});
|
|
49
54
|
//#endregion
|
|
50
55
|
export { Descriptions, DescriptionsRoot };
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { Dialog as Dialog$1, DialogOpenChangeDetails } from "@ark-ui/react/dialog";
|
|
2
3
|
//#region src/components/dialog/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export interface DialogFacadeProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
trigger?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function DialogFacade({ open, defaultOpen, trigger, content, label, description, disabled, children, onOpenChange }: DialogFacadeProps): import("react").JSX.Element;
|
|
16
|
+
declare namespace DialogFacade {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
type DialogParts = typeof Dialog$1;
|
|
20
|
+
export declare const Dialog: typeof DialogFacade & DialogParts;
|
|
8
21
|
//#endregion
|
|
9
22
|
export type { DialogOpenChangeDetails };
|
|
@@ -1,11 +1,53 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
import { Dialog as Dialog$1 } from "@ark-ui/react/dialog";
|
|
3
6
|
//#region src/components/dialog/index.tsx
|
|
4
7
|
/** Ark's Dialog, dressed in the paper-and-ink system: the sheet dissolves
|
|
5
8
|
* in on elevation, the backdrop fades, and nested overlays stack through
|
|
6
9
|
* the shared z-index ladder. The API is Ark's own — Root, Trigger,
|
|
7
10
|
* Backdrop, Positioner, Content, Title, Description, CloseTrigger. */
|
|
8
|
-
|
|
11
|
+
function DialogRoot(props) {
|
|
12
|
+
const id = useElementId("dialog", props);
|
|
13
|
+
return /* @__PURE__ */ jsx(Dialog$1.Root, {
|
|
14
|
+
...props,
|
|
15
|
+
id
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function DialogFacade({ open, defaultOpen, trigger, content, label, description, disabled = false, children, onOpenChange }) {
|
|
19
|
+
const title = label ?? trigger;
|
|
20
|
+
return /* @__PURE__ */ jsxs(DialogRoot, {
|
|
21
|
+
...open === void 0 ? {} : { open },
|
|
22
|
+
...defaultOpen === void 0 ? {} : { defaultOpen },
|
|
23
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Dialog$1.Trigger, {
|
|
26
|
+
disabled,
|
|
27
|
+
children: trigger ?? title ?? "Open"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx(Dialog$1.Backdrop, {}),
|
|
30
|
+
/* @__PURE__ */ jsx(Dialog$1.Positioner, { children: /* @__PURE__ */ jsxs(Dialog$1.Content, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Dialog$1.Title, { children: title }),
|
|
32
|
+
description ? /* @__PURE__ */ jsx(Dialog$1.Description, { children: description }) : null,
|
|
33
|
+
content ? /* @__PURE__ */ jsx("p", { children: content }) : null,
|
|
34
|
+
children,
|
|
35
|
+
/* @__PURE__ */ jsx(Dialog$1.CloseTrigger, {
|
|
36
|
+
"aria-label": "Close",
|
|
37
|
+
children: iconNode("x", {
|
|
38
|
+
width: 14,
|
|
39
|
+
height: 14
|
|
40
|
+
})
|
|
41
|
+
})
|
|
42
|
+
] }) })
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
DialogFacade.displayName = "SDialog";
|
|
47
|
+
const Dialog = Object.assign(DialogFacade, {
|
|
48
|
+
...Dialog$1,
|
|
49
|
+
Root: DialogRoot
|
|
50
|
+
});
|
|
9
51
|
injectComponentStyle("dialog");
|
|
10
52
|
//#endregion
|
|
11
53
|
export { Dialog };
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { DownloadTriggerBaseProps, DownloadTriggerProps, DownloadableData, UseDownloadProps, UseDownloadReturn, useDownload } from "@ark-ui/react/download-trigger";
|
|
2
|
+
//#region src/components/download-trigger/index.d.ts
|
|
3
|
+
export declare const DownloadTrigger: import("react").ForwardRefExoticComponent<import("@ark-ui/react/download-trigger").DownloadTriggerProps & import("react").RefAttributes<HTMLButtonElement>> & {
|
|
4
|
+
Root: import("react").ForwardRefExoticComponent<import("@ark-ui/react/download-trigger").DownloadTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { type DownloadTriggerBaseProps, type DownloadTriggerProps, type DownloadableData, type UseDownloadProps, type UseDownloadReturn, useDownload };
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { DownloadTrigger as DownloadTrigger$1, useDownload } from "@ark-ui/react/download-trigger";
|
|
3
|
+
//#region src/components/download-trigger/index.tsx
|
|
4
|
+
const DownloadTrigger = withSelfRoot(DownloadTrigger$1);
|
|
5
|
+
//#endregion
|
|
2
6
|
export { DownloadTrigger, useDownload };
|
|
@@ -1,9 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { Drawer as Drawer$1 } from "@ark-ui/react/drawer";
|
|
2
3
|
//#region src/components/drawer/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export interface DrawerFacadeProps {
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
trigger?: string;
|
|
8
|
+
content?: string;
|
|
9
|
+
label: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
declare function DrawerFacade({ open, defaultOpen, trigger, content, label, description, disabled, children, onOpenChange }: DrawerFacadeProps): import("react").JSX.Element;
|
|
16
|
+
declare namespace DrawerFacade {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
type DrawerParts = typeof Drawer$1;
|
|
20
|
+
export declare const Drawer: typeof DrawerFacade & DrawerParts;
|
|
9
21
|
//#endregion
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
5
|
import { Drawer as Drawer$1 } from "@ark-ui/react/drawer";
|
|
3
6
|
//#region src/components/drawer/index.tsx
|
|
4
7
|
/** Ark's Drawer, dressed in the paper-and-ink system: a full-height sheet
|
|
@@ -6,7 +9,43 @@ import { Drawer as Drawer$1 } from "@ark-ui/react/drawer";
|
|
|
6
9
|
* under the grabber's hand. The API is Ark's own — Root, Trigger,
|
|
7
10
|
* Backdrop, Positioner, Content, Grabber, GrabberIndicator, Title,
|
|
8
11
|
* Description, CloseTrigger, SwipeArea. */
|
|
9
|
-
|
|
12
|
+
function DrawerRoot(props) {
|
|
13
|
+
const id = useElementId("drawer", props);
|
|
14
|
+
return /* @__PURE__ */ jsx(Drawer$1.Root, {
|
|
15
|
+
...props,
|
|
16
|
+
id
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function DrawerFacade({ open, defaultOpen, trigger, content, label, description, disabled = false, children, onOpenChange }) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(DrawerRoot, {
|
|
21
|
+
...open === void 0 ? {} : { open },
|
|
22
|
+
...defaultOpen === void 0 ? {} : { defaultOpen },
|
|
23
|
+
onOpenChange: (details) => onOpenChange?.(details.open),
|
|
24
|
+
children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Drawer$1.Trigger, {
|
|
26
|
+
disabled,
|
|
27
|
+
children: trigger ?? label
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ jsx(Drawer$1.Backdrop, {}),
|
|
30
|
+
/* @__PURE__ */ jsx(Drawer$1.Positioner, { children: /* @__PURE__ */ jsxs(Drawer$1.Content, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx(Drawer$1.Grabber, { children: /* @__PURE__ */ jsx(Drawer$1.GrabberIndicator, {}) }),
|
|
32
|
+
/* @__PURE__ */ jsx(Drawer$1.Title, { children: label }),
|
|
33
|
+
description ? /* @__PURE__ */ jsx(Drawer$1.Description, { children: description }) : null,
|
|
34
|
+
content ? /* @__PURE__ */ jsx("p", { children: content }) : null,
|
|
35
|
+
children,
|
|
36
|
+
/* @__PURE__ */ jsx(Drawer$1.CloseTrigger, {
|
|
37
|
+
"aria-label": "Close",
|
|
38
|
+
children: iconNode("x")
|
|
39
|
+
})
|
|
40
|
+
] }) })
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
DrawerFacade.displayName = "SDrawer";
|
|
45
|
+
const Drawer = Object.assign(DrawerFacade, {
|
|
46
|
+
...Drawer$1,
|
|
47
|
+
Root: DrawerRoot
|
|
48
|
+
});
|
|
10
49
|
injectComponentStyle("drawer");
|
|
11
50
|
//#endregion
|
|
12
51
|
export { Drawer };
|
|
@@ -24,5 +24,8 @@ export interface DynamicInputProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
24
24
|
* grows past `max`, and the group always keeps one row: an entry list
|
|
25
25
|
* that emptied itself would leave the reader no place to type.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
declare function DynamicInputImpl({ value, min, max, placeholder, addLabel, disabled, invalid, size, onValueChange, children: _children, ...rest }: DynamicInputProps): import("react").JSX.Element;
|
|
28
|
+
export declare const DynamicInput: typeof DynamicInputImpl & {
|
|
29
|
+
Root: typeof DynamicInputImpl;
|
|
30
|
+
};
|
|
28
31
|
//#endregion
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
3
|
import { n as useComponentMessages } from "../../messages-1jJWtaYU.mjs";
|
|
2
4
|
import { Button } from "../button/index.mjs";
|
|
3
|
-
import { t as Input } from "../../input-
|
|
4
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
5
|
+
import { t as Input } from "../../input-BDpQ0e6G.mjs";
|
|
6
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
5
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
8
|
//#region src/components/dynamic-input/index.tsx
|
|
7
9
|
/**
|
|
@@ -12,7 +14,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
12
14
|
* grows past `max`, and the group always keeps one row: an entry list
|
|
13
15
|
* that emptied itself would leave the reader no place to type.
|
|
14
16
|
*/
|
|
15
|
-
function
|
|
17
|
+
function DynamicInputImpl({ value, min = 0, max, placeholder, addLabel = "Add entry", disabled = false, invalid = false, size = "md", onValueChange, children: _children, ...rest }) {
|
|
16
18
|
injectComponentStyle("dynamic-input");
|
|
17
19
|
const messages = useComponentMessages();
|
|
18
20
|
const values = value ?? [""];
|
|
@@ -51,7 +53,7 @@ function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry"
|
|
|
51
53
|
disabled: disabled || !canRemove,
|
|
52
54
|
"aria-label": messages.dynamicEntry.remove,
|
|
53
55
|
onClick: () => remove(index),
|
|
54
|
-
children: crossIcon
|
|
56
|
+
children: crossIcon
|
|
55
57
|
})]
|
|
56
58
|
}, index)), /* @__PURE__ */ jsx("div", {
|
|
57
59
|
"data-scope": "dynamic-input",
|
|
@@ -66,20 +68,10 @@ function DynamicInput({ value, min = 0, max, placeholder, addLabel = "Add entry"
|
|
|
66
68
|
})]
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
viewBox: "0 0 24 24",
|
|
75
|
-
fill: "none",
|
|
76
|
-
stroke: "currentColor",
|
|
77
|
-
strokeWidth: 1.75,
|
|
78
|
-
strokeLinecap: "round",
|
|
79
|
-
strokeLinejoin: "round",
|
|
80
|
-
"aria-hidden": "true",
|
|
81
|
-
children: /* @__PURE__ */ jsx("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
82
|
-
});
|
|
83
|
-
}
|
|
71
|
+
const DynamicInput = withSelfRoot(DynamicInputImpl);
|
|
72
|
+
const crossIcon = iconNode("x", {
|
|
73
|
+
width: 16,
|
|
74
|
+
height: 16
|
|
75
|
+
});
|
|
84
76
|
//#endregion
|
|
85
77
|
export { DynamicInput };
|
|
@@ -1,16 +1,37 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
1
|
+
import { ComponentProps, ReactNode } from "react";
|
|
2
2
|
import { Editable as Editable$1 } from "@ark-ui/react/editable";
|
|
3
3
|
//#region src/components/editable/index.d.ts
|
|
4
|
-
/** Ark's Editable, dressed in the paper-and-ink system: bare ink while
|
|
5
|
-
* reading, the full field recipe while editing. The API is Ark's own —
|
|
6
|
-
* Root, Area, Label, Preview, Input, EditTrigger, SubmitTrigger,
|
|
7
|
-
* CancelTrigger, Control. */
|
|
8
4
|
type EditableRootProps = ComponentProps<typeof Editable$1.Root> & {
|
|
9
5
|
/** One rung of the control-height ladder for the editing field. */
|
|
10
6
|
size?: "sm" | "md" | "lg";
|
|
11
7
|
};
|
|
12
|
-
declare function EditableRoot(
|
|
13
|
-
|
|
8
|
+
declare function EditableRoot(props: EditableRootProps): import("react").JSX.Element;
|
|
9
|
+
interface EditableFacadeProps {
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
label?: string;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
invalid?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
size?: "sm" | "md" | "lg";
|
|
18
|
+
onValueChange?: (value: string) => void;
|
|
19
|
+
children?: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/** The one-tag path: a named value with the house edit controls. Modes,
|
|
22
|
+
* custom triggers, and alternate editors stay on the anatomy. */
|
|
23
|
+
declare function EditableFacade({ value, defaultValue, label, placeholder, disabled, invalid, required, size, onValueChange }: EditableFacadeProps): import("react").JSX.Element;
|
|
24
|
+
export declare const Editable: typeof EditableFacade & {
|
|
14
25
|
Root: typeof EditableRoot;
|
|
26
|
+
Area: import("react").ForwardRefExoticComponent<Editable$1.AreaProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
+
CancelTrigger: import("react").ForwardRefExoticComponent<Editable$1.CancelTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
28
|
+
Context: (props: Editable$1.ContextProps) => ReactNode;
|
|
29
|
+
Control: import("react").ForwardRefExoticComponent<Editable$1.ControlProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
EditTrigger: import("react").ForwardRefExoticComponent<Editable$1.EditTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
31
|
+
Input: import("react").ForwardRefExoticComponent<Editable$1.InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
32
|
+
Label: import("react").ForwardRefExoticComponent<Editable$1.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
33
|
+
Preview: import("react").ForwardRefExoticComponent<Editable$1.PreviewProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
34
|
+
RootProvider: import("react").ForwardRefExoticComponent<Editable$1.RootProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
35
|
+
SubmitTrigger: import("react").ForwardRefExoticComponent<Editable$1.SubmitTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
15
36
|
};
|
|
16
37
|
//#endregion
|
|
@@ -1,17 +1,56 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
3
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
5
|
import { Editable as Editable$1 } from "@ark-ui/react/editable";
|
|
4
6
|
//#region src/components/editable/index.tsx
|
|
5
|
-
function EditableRoot(
|
|
7
|
+
function EditableRoot(props) {
|
|
8
|
+
const id = useElementId("editable", props);
|
|
9
|
+
const { size = "md", ...rest } = props;
|
|
6
10
|
return /* @__PURE__ */ jsx(Editable$1.Root, {
|
|
7
11
|
...rest,
|
|
12
|
+
id,
|
|
8
13
|
"data-size": size
|
|
9
14
|
});
|
|
10
15
|
}
|
|
11
|
-
|
|
16
|
+
/** The one-tag path: a named value with the house edit controls. Modes,
|
|
17
|
+
* custom triggers, and alternate editors stay on the anatomy. */
|
|
18
|
+
function EditableFacade({ value, defaultValue, label, placeholder, disabled = false, invalid = false, required = false, size = "md", onValueChange }) {
|
|
19
|
+
return /* @__PURE__ */ jsxs(EditableRoot, {
|
|
20
|
+
size,
|
|
21
|
+
disabled,
|
|
22
|
+
invalid,
|
|
23
|
+
required,
|
|
24
|
+
placeholder,
|
|
25
|
+
defaultValue,
|
|
26
|
+
...value === void 0 ? {} : {
|
|
27
|
+
value,
|
|
28
|
+
onValueChange: (details) => onValueChange?.(details.value)
|
|
29
|
+
},
|
|
30
|
+
children: [
|
|
31
|
+
label ? /* @__PURE__ */ jsx(Editable$1.Label, { children: label }) : null,
|
|
32
|
+
/* @__PURE__ */ jsxs(Editable$1.Area, { children: [/* @__PURE__ */ jsx(Editable$1.Preview, {}), /* @__PURE__ */ jsx(Editable$1.Input, {})] }),
|
|
33
|
+
/* @__PURE__ */ jsxs(Editable$1.Control, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx(Editable$1.EditTrigger, {
|
|
35
|
+
"aria-label": "Edit",
|
|
36
|
+
children: iconNode("pencil")
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx(Editable$1.SubmitTrigger, {
|
|
39
|
+
"aria-label": "Submit",
|
|
40
|
+
children: iconNode("check")
|
|
41
|
+
}),
|
|
42
|
+
/* @__PURE__ */ jsx(Editable$1.CancelTrigger, {
|
|
43
|
+
"aria-label": "Cancel",
|
|
44
|
+
children: iconNode("x")
|
|
45
|
+
})
|
|
46
|
+
] })
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const Editable = Object.assign(EditableFacade, {
|
|
12
51
|
...Editable$1,
|
|
13
52
|
Root: EditableRoot
|
|
14
|
-
};
|
|
53
|
+
});
|
|
15
54
|
injectComponentStyle("editable");
|
|
16
55
|
//#endregion
|
|
17
56
|
export { Editable };
|
|
@@ -6,5 +6,8 @@ import { HTMLAttributes } from "react";
|
|
|
6
6
|
export interface EllipsisProps extends HTMLAttributes<HTMLElement> {
|
|
7
7
|
lines?: number;
|
|
8
8
|
}
|
|
9
|
-
|
|
9
|
+
declare function EllipsisImpl({ lines, ...rest }: EllipsisProps): import("react").JSX.Element;
|
|
10
|
+
export declare const Ellipsis: typeof EllipsisImpl & {
|
|
11
|
+
Root: typeof EllipsisImpl;
|
|
12
|
+
};
|
|
10
13
|
//#endregion
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
4
|
//#region src/components/ellipsis/index.tsx
|
|
4
|
-
function
|
|
5
|
+
function EllipsisImpl({ lines = 1, ...rest }) {
|
|
5
6
|
injectComponentStyle("ellipsis");
|
|
6
7
|
const multiline = lines > 1;
|
|
7
8
|
return /* @__PURE__ */ jsx("span", {
|
|
@@ -15,5 +16,6 @@ function Ellipsis({ lines = 1, ...rest }) {
|
|
|
15
16
|
"data-multiline": multiline ? "" : void 0
|
|
16
17
|
});
|
|
17
18
|
}
|
|
19
|
+
const Ellipsis = withSelfRoot(EllipsisImpl);
|
|
18
20
|
//#endregion
|
|
19
21
|
export { Ellipsis };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { injectComponentStyle } from "@bysages/core";
|
|
1
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/empty/index.tsx
|
|
4
4
|
/** An empty state: the page holds its breath. Root centers the column,
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
2
2
|
//#region src/components/field/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
interface FieldFacadeProps {
|
|
4
|
+
value?: string | number;
|
|
5
|
+
defaultValue?: string | number;
|
|
6
|
+
label?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
invalid?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
}
|
|
14
|
+
/** The one-tag path for a simple text field; textarea, select, and
|
|
15
|
+
* custom controls keep the anatomy. */
|
|
16
|
+
declare function FieldFacade({ value, defaultValue, label, description, placeholder, disabled, invalid, required, onValueChange }: FieldFacadeProps): import("react").JSX.Element;
|
|
17
|
+
export declare const Field: typeof FieldFacade & {
|
|
18
|
+
Root: typeof Field$1.Root;
|
|
19
|
+
Context: (props: Field$1.ContextProps) => import("react").ReactNode;
|
|
20
|
+
ErrorText: import("react").ForwardRefExoticComponent<Field$1.ErrorTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
21
|
+
HelperText: import("react").ForwardRefExoticComponent<Field$1.HelperTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
22
|
+
Input: import("react").ForwardRefExoticComponent<Field$1.InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
23
|
+
Item: {
|
|
24
|
+
(props: Field$1.ItemProps): import("react").JSX.Element;
|
|
25
|
+
displayName: string;
|
|
26
|
+
};
|
|
27
|
+
Label: import("react").ForwardRefExoticComponent<Field$1.LabelProps & import("react").RefAttributes<HTMLLabelElement>>;
|
|
28
|
+
RequiredIndicator: import("react").ForwardRefExoticComponent<Field$1.RequiredIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
29
|
+
RootProvider: import("react").ForwardRefExoticComponent<Field$1.RootProviderProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
30
|
+
Select: import("react").ForwardRefExoticComponent<Field$1.SelectProps & import("react").RefAttributes<HTMLSelectElement>>;
|
|
31
|
+
Textarea: import("react").ForwardRefExoticComponent<Field$1.TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
32
|
+
};
|
|
8
33
|
//#endregion
|
|
@@ -1,11 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
|
+
import { injectComponentStyle } from "@bysages/core/styling";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
4
|
import { Field as Field$1 } from "@ark-ui/react/field";
|
|
3
5
|
//#region src/components/field/index.tsx
|
|
4
|
-
/**
|
|
5
|
-
* border-and-halo control, and quiet help text. The
|
|
6
|
+
/** Field, dressed in the paper-and-ink system: a tracked label, a
|
|
7
|
+
* border-and-halo control, and quiet help text. The parts —
|
|
6
8
|
* Root, Label, Input, Textarea, Select, HelperText, ErrorText,
|
|
7
9
|
* RequiredIndicator. */
|
|
8
|
-
|
|
10
|
+
function FieldRoot(props) {
|
|
11
|
+
const id = useElementId("field", props);
|
|
12
|
+
return /* @__PURE__ */ jsx(Field$1.Root, {
|
|
13
|
+
...props,
|
|
14
|
+
id
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** The one-tag path for a simple text field; textarea, select, and
|
|
18
|
+
* custom controls keep the anatomy. */
|
|
19
|
+
function FieldFacade({ value, defaultValue, label, description, placeholder, disabled = false, invalid = false, required = false, onValueChange }) {
|
|
20
|
+
return /* @__PURE__ */ jsxs(FieldRoot, {
|
|
21
|
+
disabled,
|
|
22
|
+
invalid,
|
|
23
|
+
required,
|
|
24
|
+
children: [
|
|
25
|
+
label ? /* @__PURE__ */ jsx(Field$1.Label, { children: label }) : null,
|
|
26
|
+
/* @__PURE__ */ jsx(Field$1.Input, {
|
|
27
|
+
placeholder,
|
|
28
|
+
defaultValue,
|
|
29
|
+
...value === void 0 ? {} : {
|
|
30
|
+
value,
|
|
31
|
+
onChange: (event) => onValueChange?.(event.target.value)
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
34
|
+
description ? /* @__PURE__ */ jsx(Field$1.HelperText, { children: description }) : null
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
const Field = Object.assign(FieldFacade, {
|
|
39
|
+
...Field$1,
|
|
40
|
+
Root: FieldRoot
|
|
41
|
+
});
|
|
9
42
|
injectComponentStyle("field");
|
|
10
43
|
//#endregion
|
|
11
44
|
export { Field };
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { Fieldset as Fieldset$1 } from "@ark-ui/react/fieldset";
|
|
2
3
|
//#region src/components/fieldset/index.d.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
interface FieldsetFacadeProps {
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
invalid?: boolean;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** The one-tag path: one label and optional description around the
|
|
12
|
+
* caller controls; compound or bespoke groups keep the anatomy. */
|
|
13
|
+
declare function FieldsetFacade({ label, description, disabled, invalid, children }: FieldsetFacadeProps): import("react").JSX.Element;
|
|
14
|
+
export declare const Fieldset: typeof FieldsetFacade & {
|
|
15
|
+
Root: typeof Fieldset$1.Root;
|
|
16
|
+
Context: (props: Fieldset$1.ContextProps) => ReactNode;
|
|
17
|
+
ErrorText: import("react").ForwardRefExoticComponent<Fieldset$1.ErrorTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
18
|
+
HelperText: import("react").ForwardRefExoticComponent<Fieldset$1.HelperTextProps & import("react").RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
Legend: import("react").ForwardRefExoticComponent<Fieldset$1.LegendProps & import("react").RefAttributes<HTMLLegendElement>>;
|
|
20
|
+
RootProvider: import("react").ForwardRefExoticComponent<Fieldset$1.RootProviderProps & import("react").RefAttributes<HTMLFieldSetElement>>;
|
|
21
|
+
};
|
|
7
22
|
//#endregion
|