@bysages/react 0.5.0 → 0.6.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-B3vbpXlK.mjs → ai-B0o-dsAf.mjs} +1 -1
- package/dist/{ai-prompt-input-k34KssHJ.mjs → ai-prompt-input-Cl9ulICF.mjs} +1 -1
- package/dist/components/ai/index.mjs +1 -1
- package/dist/components/ai-prompt-input/index.d.mts +1 -1
- package/dist/components/ai-prompt-input/index.mjs +1 -1
- package/dist/components/autocomplete/index.d.mts +4 -1
- package/dist/components/autocomplete/index.mjs +9 -6
- package/dist/components/cascade-select/index.d.mts +4 -1
- package/dist/components/cascade-select/index.mjs +36 -33
- package/dist/components/color-picker/index.d.mts +9 -1
- package/dist/components/color-picker/index.mjs +36 -29
- package/dist/components/combobox/index.d.mts +9 -1
- package/dist/components/combobox/index.mjs +14 -8
- package/dist/components/command/index.d.mts +4 -1
- package/dist/components/command/index.mjs +71 -68
- package/dist/components/date-picker/index.d.mts +9 -1
- package/dist/components/date-picker/index.mjs +27 -21
- package/dist/components/dialog/index.d.mts +20 -3
- package/dist/components/dialog/index.mjs +28 -12
- package/dist/components/drawer/index.d.mts +19 -3
- package/dist/components/drawer/index.mjs +18 -12
- package/dist/components/floating-panel/index.d.mts +19 -3
- package/dist/components/floating-panel/index.mjs +34 -28
- package/dist/components/hover-card/index.d.mts +17 -3
- package/dist/components/hover-card/index.mjs +14 -8
- package/dist/components/image-viewer/index.d.mts +1 -1
- package/dist/components/image-viewer/index.mjs +1 -1
- package/dist/components/media-player/index.mjs +1 -1
- package/dist/components/mentions/index.d.mts +1 -1
- package/dist/components/mentions/index.mjs +1 -1
- package/dist/components/menu/index.d.mts +10 -2
- package/dist/components/menu/index.mjs +12 -6
- package/dist/components/menubar/index.d.mts +4 -1
- package/dist/components/menubar/index.mjs +12 -9
- package/dist/components/navigation-menu/index.d.mts +9 -1
- package/dist/components/navigation-menu/index.mjs +7 -1
- package/dist/components/pagination/index.d.mts +2 -2
- package/dist/components/popconfirm/index.d.mts +5 -2
- package/dist/components/popconfirm/index.mjs +31 -28
- package/dist/components/popover/index.d.mts +1 -1
- package/dist/components/popover/index.mjs +20 -14
- package/dist/components/select/index.d.mts +1 -1
- package/dist/components/select/index.mjs +1 -1
- package/dist/components/split-button/index.d.mts +4 -1
- package/dist/components/split-button/index.mjs +12 -9
- package/dist/components/table/index.d.mts +21 -1
- package/dist/components/table/index.mjs +24 -9
- package/dist/components/tooltip/index.d.mts +17 -3
- package/dist/components/tooltip/index.mjs +8 -2
- package/dist/components/tour/index.d.mts +20 -3
- package/dist/components/tour/index.mjs +16 -10
- package/dist/components/tree-select/index.d.mts +5 -2
- package/dist/components/tree-select/index.mjs +38 -35
- package/dist/components/typography/index.d.mts +10 -6
- package/dist/components/typography/index.mjs +9 -1
- package/dist/floating-BhcDRgnx.d.mts +7 -0
- package/dist/floating-CMR7cvmA.mjs +33 -0
- package/dist/generative/index.mjs +1 -1
- package/dist/{image-viewer-BYiXpi1X.mjs → image-viewer-BPTApdoP.mjs} +32 -29
- package/dist/{index-DcpvCyt6.d.mts → index-CEYybyEQ.d.mts} +8 -3
- package/dist/{index-DczfbPCg.d.mts → index-DZ2S5rMj.d.mts} +10 -2
- package/dist/index-j02dTkfc.d.mts +37 -0
- package/dist/{index-D4C52fI7.d.mts → index-n9VlNO7D.d.mts} +4 -1
- package/dist/index.d.mts +8 -8
- package/dist/index.mjs +6 -6
- package/dist/{media-player-CO2Cczl-.mjs → media-player-DxG0EYz7.mjs} +1 -1
- package/dist/{mentions-De7ChJbl.mjs → mentions-B59tQDPt.mjs} +31 -25
- package/dist/{select-DQ5669_K.mjs → select-BLFqfeVw.mjs} +20 -14
- package/package.json +2 -2
- package/dist/index-BVdkcSSY.d.mts +0 -22
|
@@ -3,7 +3,7 @@ import { t as withSelfRoot } from "./family-Co1YsN4N.mjs";
|
|
|
3
3
|
import { n as useComponentMessages } from "./messages-B6n0lVyt.mjs";
|
|
4
4
|
import { Action } from "./components/ai-action/index.mjs";
|
|
5
5
|
import { AiMessage as Message } from "./components/ai-message/index.mjs";
|
|
6
|
-
import { t as PromptInput } from "./ai-prompt-input-
|
|
6
|
+
import { t as PromptInput } from "./ai-prompt-input-Cl9ulICF.mjs";
|
|
7
7
|
import { AiReasoning as Reasoning } from "./components/ai-reasoning/index.mjs";
|
|
8
8
|
import { t as Response } from "./ai-response-DTxdL5rX.mjs";
|
|
9
9
|
import { AiSource as Source, AiSources as Sources } from "./components/ai-source/index.mjs";
|
|
@@ -4,7 +4,7 @@ import { t as withSelfRoot } from "./family-Co1YsN4N.mjs";
|
|
|
4
4
|
import { n as useComponentMessages } from "./messages-B6n0lVyt.mjs";
|
|
5
5
|
import { Button } from "./components/button/index.mjs";
|
|
6
6
|
import { Field } from "./components/field/index.mjs";
|
|
7
|
-
import { n as MentionsVessel, r as useMentions } from "./mentions-
|
|
7
|
+
import { n as MentionsVessel, r as useMentions } from "./mentions-B59tQDPt.mjs";
|
|
8
8
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
9
9
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
10
|
import { useEffect, useRef } from "react";
|
|
@@ -4,4 +4,4 @@ import "../ai-reasoning/index.mjs";
|
|
|
4
4
|
import "../ai-source/index.mjs";
|
|
5
5
|
import "../ai-suggestion/index.mjs";
|
|
6
6
|
import "../ai-tool/index.mjs";
|
|
7
|
-
export { t as Ai, n as AiActions, r as AiContent, i as AiConversation, a as AiJumpToLatest, o as AiMedia, s as AiParts, c as toolPartDisplay } from "../../ai-
|
|
7
|
+
export { t as Ai, n as AiActions, r as AiContent, i as AiConversation, a as AiJumpToLatest, o as AiMedia, s as AiParts, c as toolPartDisplay } from "../../ai-B0o-dsAf.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as MentionCommitKey, n as MentionPlacement, t as MentionEntry } from "../../index-
|
|
1
|
+
import { c as MentionCommitKey, n as MentionPlacement, t as MentionEntry } from "../../index-CEYybyEQ.mjs";
|
|
2
2
|
import { HTMLAttributes, ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* The prompt vessel: the shared field textarea — self-growing on the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as AiPromptInput, t as PromptInput } from "../../ai-prompt-input-
|
|
1
|
+
export { t as AiPromptInput, t as PromptInput } from "../../ai-prompt-input-Cl9ulICF.mjs";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { Combobox } from "../combobox/index.mjs";
|
|
2
3
|
import { HTMLAttributes } from "react";
|
|
3
4
|
/**
|
|
@@ -8,6 +9,8 @@ import { HTMLAttributes } from "react";
|
|
|
8
9
|
* a case-insensitive substring unless `filter` says otherwise.
|
|
9
10
|
*/
|
|
10
11
|
export interface AutoCompleteProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onSelect"> {
|
|
12
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
13
|
+
portal?: FloatingPortalTarget;
|
|
11
14
|
value?: string;
|
|
12
15
|
items?: string[];
|
|
13
16
|
placeholder?: string;
|
|
@@ -17,6 +20,6 @@ export interface AutoCompleteProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
17
20
|
size?: "sm" | "md" | "lg";
|
|
18
21
|
onValueChange?: (value: string) => void;
|
|
19
22
|
}
|
|
20
|
-
declare function AutoCompleteImpl({ value, items, placeholder, filter, size, onValueChange, ...rest }: AutoCompleteProps): import("react").JSX.Element;
|
|
23
|
+
declare function AutoCompleteImpl({ portal, value, items, placeholder, filter, size, onValueChange, ...rest }: AutoCompleteProps): import("react").JSX.Element;
|
|
21
24
|
export declare const AutoComplete: typeof AutoCompleteImpl & typeof Combobox;
|
|
22
25
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { t as useElementId } from "../../id-Ctic_3o8.mjs";
|
|
2
2
|
import { n as useComponentMessages } from "../../messages-B6n0lVyt.mjs";
|
|
3
|
+
import { t as FloatingPortal } from "../../floating-CMR7cvmA.mjs";
|
|
3
4
|
import { Combobox as Combobox$1 } from "../combobox/index.mjs";
|
|
4
5
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { useEffect, useRef } from "react";
|
|
7
|
-
import { Portal } from "@ark-ui/react/portal";
|
|
8
8
|
import { useListCollection } from "@ark-ui/react/collection";
|
|
9
9
|
import { Combobox } from "@ark-ui/react/combobox";
|
|
10
10
|
// src/components/autocomplete/index.tsx
|
|
11
|
-
function AutoCompleteImpl({ value = "", items = [], placeholder, filter, size = "md", onValueChange, ...rest }) {
|
|
11
|
+
function AutoCompleteImpl({ portal = false, value = "", items = [], placeholder, filter, size = "md", onValueChange, ...rest }) {
|
|
12
12
|
injectComponentStyle("combobox");
|
|
13
13
|
const messages = useComponentMessages();
|
|
14
14
|
const hostId = useElementId("autocomplete", rest);
|
|
@@ -38,10 +38,13 @@ function AutoCompleteImpl({ value = "", items = [], placeholder, filter, size =
|
|
|
38
38
|
onValueChange?.(details.inputValue);
|
|
39
39
|
},
|
|
40
40
|
positioning: { sameWidth: true },
|
|
41
|
-
children: [/* @__PURE__ */ jsx(Combobox.Control, { children: /* @__PURE__ */ jsx(Combobox.Input, { placeholder }) }), /* @__PURE__ */ jsx(
|
|
42
|
-
|
|
43
|
-
children: /* @__PURE__ */ jsx(Combobox.
|
|
44
|
-
|
|
41
|
+
children: [/* @__PURE__ */ jsx(Combobox.Control, { children: /* @__PURE__ */ jsx(Combobox.Input, { placeholder }) }), /* @__PURE__ */ jsx(FloatingPortal, {
|
|
42
|
+
portal,
|
|
43
|
+
children: /* @__PURE__ */ jsx(Combobox.Positioner, { children: /* @__PURE__ */ jsxs(Combobox.Content, { children: [/* @__PURE__ */ jsx(Combobox.Empty, { children: messages.command.noMatches }), collection.items.map((item) => /* @__PURE__ */ jsx(Combobox.Item, {
|
|
44
|
+
item,
|
|
45
|
+
children: /* @__PURE__ */ jsx(Combobox.ItemText, { children: item })
|
|
46
|
+
}, item))] }) })
|
|
47
|
+
})]
|
|
45
48
|
});
|
|
46
49
|
}
|
|
47
50
|
const AutoComplete = Object.assign(AutoCompleteImpl, Combobox$1);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { HTMLAttributes } from "react";
|
|
2
3
|
export interface CascadeSelectNode {
|
|
3
4
|
label: string;
|
|
@@ -17,6 +18,8 @@ export interface CascadeSelectNode {
|
|
|
17
18
|
* runs — each hit still reads as its full route.
|
|
18
19
|
*/
|
|
19
20
|
export interface CascadeSelectProps extends HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
22
|
+
portal?: FloatingPortalTarget;
|
|
20
23
|
value?: string[][];
|
|
21
24
|
data: CascadeSelectNode[];
|
|
22
25
|
placeholder?: string;
|
|
@@ -28,7 +31,7 @@ export interface CascadeSelectProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
28
31
|
size?: "sm" | "md" | "lg";
|
|
29
32
|
onValueChange?: (value: string[][]) => void;
|
|
30
33
|
}
|
|
31
|
-
declare function CascadeSelectImpl({ value, data, placeholder, highlightTrigger, filterable, multiple, disabled, size, onValueChange, ...rest }: CascadeSelectProps): import("react").JSX.Element;
|
|
34
|
+
declare function CascadeSelectImpl({ portal, value, data, placeholder, highlightTrigger, filterable, multiple, disabled, size, onValueChange, ...rest }: CascadeSelectProps): import("react").JSX.Element;
|
|
32
35
|
export declare const CascadeSelect: typeof CascadeSelectImpl & {
|
|
33
36
|
Root: typeof CascadeSelectImpl;
|
|
34
37
|
};
|
|
@@ -2,11 +2,11 @@ import { r as iconNode } from "../../icon-C9udWCyz.mjs";
|
|
|
2
2
|
import { t as useElementId } from "../../id-Ctic_3o8.mjs";
|
|
3
3
|
import { t as withSelfRoot } from "../../family-Co1YsN4N.mjs";
|
|
4
4
|
import { n as useComponentMessages } from "../../messages-B6n0lVyt.mjs";
|
|
5
|
+
import { t as FloatingPortal } from "../../floating-CMR7cvmA.mjs";
|
|
5
6
|
import { t as Input } from "../../input-YRjehBhU.mjs";
|
|
6
7
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { useMemo, useState } from "react";
|
|
9
|
-
import { Portal } from "@ark-ui/react/portal";
|
|
10
10
|
import { useEnvironmentContext } from "@ark-ui/react/environment";
|
|
11
11
|
import { useFilter, useLocaleContext } from "@ark-ui/react/locale";
|
|
12
12
|
import * as cascade from "@zag-js/cascade-select";
|
|
@@ -15,7 +15,7 @@ import { normalizeProps, useMachine } from "@zag-js/react";
|
|
|
15
15
|
const chevronDown = iconNode("chevron-down");
|
|
16
16
|
const chevronRight = iconNode("chevron-right");
|
|
17
17
|
const checkIcon = iconNode("check");
|
|
18
|
-
function CascadeSelectImpl({ value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
18
|
+
function CascadeSelectImpl({ portal = false, value, data, placeholder = "Select…", highlightTrigger, filterable = false, multiple = false, disabled = false, size = "md", onValueChange, ...rest }) {
|
|
19
19
|
injectComponentStyle("cascade-select");
|
|
20
20
|
const messages = useComponentMessages();
|
|
21
21
|
const id = useElementId("cascade-select", rest);
|
|
@@ -169,40 +169,43 @@ function CascadeSelectImpl({ value, data, placeholder = "Select…", highlightTr
|
|
|
169
169
|
children: chevronDown
|
|
170
170
|
})]
|
|
171
171
|
})
|
|
172
|
-
}), /* @__PURE__ */ jsx(
|
|
173
|
-
|
|
174
|
-
children: /* @__PURE__ */
|
|
175
|
-
...api.
|
|
176
|
-
"
|
|
177
|
-
|
|
178
|
-
"data-
|
|
179
|
-
|
|
180
|
-
children: /* @__PURE__ */ jsx(Input, {
|
|
181
|
-
size: "sm",
|
|
182
|
-
value: query,
|
|
183
|
-
onValueChange: setQuery,
|
|
184
|
-
placeholder: messages.select.filter,
|
|
185
|
-
"aria-label": messages.select.filter
|
|
186
|
-
})
|
|
187
|
-
}) : null, /* @__PURE__ */ jsx("div", {
|
|
188
|
-
"data-scope": "cascade-select",
|
|
189
|
-
"data-part": "corridor",
|
|
190
|
-
"data-flow": filtering ? "flat" : "columns",
|
|
191
|
-
children: filtering ? matchPaths.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
172
|
+
}), /* @__PURE__ */ jsx(FloatingPortal, {
|
|
173
|
+
portal,
|
|
174
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
175
|
+
...api.getPositionerProps(),
|
|
176
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
177
|
+
...api.getContentProps(),
|
|
178
|
+
"data-size": size,
|
|
179
|
+
children: [filterable ? /* @__PURE__ */ jsx("div", {
|
|
192
180
|
"data-scope": "cascade-select",
|
|
193
|
-
"data-part": "
|
|
194
|
-
children:
|
|
195
|
-
|
|
196
|
-
|
|
181
|
+
"data-part": "search",
|
|
182
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
183
|
+
size: "sm",
|
|
184
|
+
value: query,
|
|
185
|
+
onValueChange: setQuery,
|
|
186
|
+
placeholder: messages.select.filter,
|
|
187
|
+
"aria-label": messages.select.filter
|
|
188
|
+
})
|
|
189
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
197
190
|
"data-scope": "cascade-select",
|
|
198
|
-
"data-part": "
|
|
199
|
-
"data-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
191
|
+
"data-part": "corridor",
|
|
192
|
+
"data-flow": filtering ? "flat" : "columns",
|
|
193
|
+
children: filtering ? matchPaths.length === 0 ? /* @__PURE__ */ jsx("p", {
|
|
194
|
+
"data-scope": "cascade-select",
|
|
195
|
+
"data-part": "empty",
|
|
196
|
+
children: "Nothing matches"
|
|
197
|
+
}) : matchPaths.map((hit) => /* @__PURE__ */ jsx("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
"data-scope": "cascade-select",
|
|
200
|
+
"data-part": "match",
|
|
201
|
+
"data-selected": isSelected(hit.path) || void 0,
|
|
202
|
+
onClick: () => pickMatch(hit.path),
|
|
203
|
+
children: hit.labels.join(" / ")
|
|
204
|
+
}, hit.path.join("/"))) : renderColumn(collection.rootNode, [], [])
|
|
205
|
+
})]
|
|
206
|
+
})
|
|
204
207
|
})
|
|
205
|
-
})
|
|
208
|
+
})]
|
|
206
209
|
});
|
|
207
210
|
}
|
|
208
211
|
const CascadeSelect = withSelfRoot(CascadeSelectImpl);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget, t as FloatingPortalProps } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
2
3
|
import { Color, ColorPicker as ColorPicker$1 } from "@ark-ui/react/color-picker";
|
|
3
4
|
type ColorPickerRootProps = ComponentProps<typeof ColorPicker$1.Root> & {
|
|
@@ -14,6 +15,8 @@ declare function ColorPickerRoot(props: ColorPickerRootProps): import("react").J
|
|
|
14
15
|
* SwatchTrigger, SwatchIndicator, Swatch, EyeDropperTrigger, FormatTrigger,
|
|
15
16
|
* FormatSelect, HiddenInput, Context. */
|
|
16
17
|
type ColorPickerFacadeProps = {
|
|
18
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
19
|
+
portal?: FloatingPortalTarget;
|
|
17
20
|
value?: string | Color;
|
|
18
21
|
defaultValue?: string | Color;
|
|
19
22
|
disabled?: boolean;
|
|
@@ -30,8 +33,13 @@ type ColorPickerFacadeProps = {
|
|
|
30
33
|
/** The complete picker behind one color: the hex input rides beside the
|
|
31
34
|
* swatch trigger, while the popup carries the area and hue/alpha tracks.
|
|
32
35
|
* Saved swatches and format switches remain anatomy work. */
|
|
36
|
+
declare const ColorPickerPositioner: {
|
|
37
|
+
({ portal, ...rest }: FloatingPortalProps & ColorPicker$1.PositionerProps & import("react").RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
38
|
+
displayName: string;
|
|
39
|
+
};
|
|
33
40
|
declare function ColorPickerFacade(props: ColorPickerFacadeProps): import("react").JSX.Element;
|
|
34
|
-
export declare const ColorPicker: typeof ColorPickerFacade & Omit<typeof ColorPicker$1, "Root"> & {
|
|
41
|
+
export declare const ColorPicker: typeof ColorPickerFacade & Omit<typeof ColorPicker$1, "Root" | "Positioner"> & {
|
|
42
|
+
Positioner: typeof ColorPickerPositioner;
|
|
35
43
|
Root: typeof ColorPickerRoot;
|
|
36
44
|
};
|
|
37
45
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as iconNode } from "../../icon-C9udWCyz.mjs";
|
|
2
2
|
import { t as useElementId } from "../../id-Ctic_3o8.mjs";
|
|
3
|
+
import { n as definePositioner, t as FloatingPortal } from "../../floating-CMR7cvmA.mjs";
|
|
3
4
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { ColorPicker as ColorPicker$1, parseColor } from "@ark-ui/react/color-picker";
|
|
@@ -21,7 +22,9 @@ function ColorPickerRoot(props) {
|
|
|
21
22
|
/** The complete picker behind one color: the hex input rides beside the
|
|
22
23
|
* swatch trigger, while the popup carries the area and hue/alpha tracks.
|
|
23
24
|
* Saved swatches and format switches remain anatomy work. */
|
|
25
|
+
const ColorPickerPositioner = definePositioner(ColorPicker$1.Positioner);
|
|
24
26
|
function ColorPickerFacade(props) {
|
|
27
|
+
const { portal = false } = props;
|
|
25
28
|
const { value, defaultValue, disabled, invalid, required, label, swatches = [], size = "md", className, style, onValueChange } = props;
|
|
26
29
|
const toColor = (color) => typeof color === "string" ? parseColor(color) : color;
|
|
27
30
|
return /* @__PURE__ */ jsxs(ColorPickerRoot, {
|
|
@@ -37,44 +40,48 @@ function ColorPickerFacade(props) {
|
|
|
37
40
|
children: [
|
|
38
41
|
label ? /* @__PURE__ */ jsx(ColorPicker$1.Label, { children: label }) : null,
|
|
39
42
|
/* @__PURE__ */ jsxs(ColorPicker$1.Control, { children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelInput, { channel: "hex" }), /* @__PURE__ */ jsxs(ColorPicker$1.Trigger, { children: [/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}), /* @__PURE__ */ jsx(ColorPicker$1.ValueSwatch, {})] })] }),
|
|
40
|
-
/* @__PURE__ */ jsx(
|
|
41
|
-
|
|
42
|
-
/* @__PURE__ */ jsxs(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
|
|
46
|
-
width: 14,
|
|
47
|
-
height: 14
|
|
48
|
-
}) }), /* @__PURE__ */ jsxs("div", {
|
|
43
|
+
/* @__PURE__ */ jsx(FloatingPortal, {
|
|
44
|
+
portal,
|
|
45
|
+
children: /* @__PURE__ */ jsx(ColorPicker$1.Positioner, { children: /* @__PURE__ */ jsxs(ColorPicker$1.Content, { children: [
|
|
46
|
+
/* @__PURE__ */ jsxs(ColorPicker$1.Area, { children: [/* @__PURE__ */ jsx(ColorPicker$1.AreaBackground, {}), /* @__PURE__ */ jsx(ColorPicker$1.AreaThumb, {})] }),
|
|
47
|
+
/* @__PURE__ */ jsxs("div", {
|
|
49
48
|
"data-scope": "color-picker",
|
|
50
|
-
"data-part": "channel-
|
|
51
|
-
children: [/* @__PURE__ */
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}), /* @__PURE__ */ jsxs(
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
|
|
60
|
-
|
|
49
|
+
"data-part": "channel-controls",
|
|
50
|
+
children: [/* @__PURE__ */ jsx(ColorPicker$1.EyeDropperTrigger, { children: iconNode("pipette", {
|
|
51
|
+
width: 14,
|
|
52
|
+
height: 14
|
|
53
|
+
}) }), /* @__PURE__ */ jsxs("div", {
|
|
54
|
+
"data-scope": "color-picker",
|
|
55
|
+
"data-part": "channel-sliders",
|
|
56
|
+
children: [/* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
|
|
57
|
+
channel: "hue",
|
|
58
|
+
children: [/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}), /* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})]
|
|
59
|
+
}), /* @__PURE__ */ jsxs(ColorPicker$1.ChannelSlider, {
|
|
60
|
+
channel: "alpha",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ jsx(ColorPicker$1.TransparencyGrid, {}),
|
|
63
|
+
/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderTrack, {}),
|
|
64
|
+
/* @__PURE__ */ jsx(ColorPicker$1.ChannelSliderThumb, {})
|
|
65
|
+
]
|
|
66
|
+
})]
|
|
61
67
|
})]
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
swatches.length > 0 ? /* @__PURE__ */ jsx(ColorPicker$1.SwatchGroup, { children: swatches.map((color) => /* @__PURE__ */ jsx(ColorPicker$1.SwatchTrigger, {
|
|
65
|
-
value: color,
|
|
66
|
-
children: /* @__PURE__ */ jsx(ColorPicker$1.Swatch, {
|
|
68
|
+
}),
|
|
69
|
+
swatches.length > 0 ? /* @__PURE__ */ jsx(ColorPicker$1.SwatchGroup, { children: swatches.map((color) => /* @__PURE__ */ jsx(ColorPicker$1.SwatchTrigger, {
|
|
67
70
|
value: color,
|
|
68
|
-
children: /* @__PURE__ */ jsx(ColorPicker$1.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
children: /* @__PURE__ */ jsx(ColorPicker$1.Swatch, {
|
|
72
|
+
value: color,
|
|
73
|
+
children: /* @__PURE__ */ jsx(ColorPicker$1.SwatchIndicator, { children: checkIcon })
|
|
74
|
+
})
|
|
75
|
+
}, color)) }) : null
|
|
76
|
+
] }) })
|
|
77
|
+
}),
|
|
72
78
|
/* @__PURE__ */ jsx(ColorPicker$1.HiddenInput, {})
|
|
73
79
|
]
|
|
74
80
|
});
|
|
75
81
|
}
|
|
76
82
|
const ColorPicker = Object.assign(ColorPickerFacade, {
|
|
77
83
|
...ColorPicker$1,
|
|
84
|
+
Positioner: ColorPickerPositioner,
|
|
78
85
|
Root: ColorPickerRoot
|
|
79
86
|
});
|
|
80
87
|
export { ColorPicker };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget, t as FloatingPortalProps } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { CSSProperties } from "react";
|
|
2
3
|
import { CollectionItem } from "@ark-ui/react/collection";
|
|
3
4
|
import { Combobox as Combobox$1, ComboboxRootComponentProps } from "@ark-ui/react/combobox";
|
|
@@ -17,6 +18,8 @@ type ComboboxOption = {
|
|
|
17
18
|
};
|
|
18
19
|
type ComboboxFacadeValue = string | string[];
|
|
19
20
|
type ComboboxFacadeProps = {
|
|
21
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
22
|
+
portal?: FloatingPortalTarget;
|
|
20
23
|
value?: ComboboxFacadeValue;
|
|
21
24
|
defaultValue?: ComboboxFacadeValue;
|
|
22
25
|
options: ComboboxOption[];
|
|
@@ -35,8 +38,13 @@ type ComboboxFacadeProps = {
|
|
|
35
38
|
};
|
|
36
39
|
/** The complete combobox behind one model value: options become the vessel's
|
|
37
40
|
* rows while typing, clearing, and selection stay on the common field path. */
|
|
41
|
+
declare const ComboboxPositioner: {
|
|
42
|
+
({ portal, ...rest }: FloatingPortalProps & Combobox$1.PositionerProps & import("react").RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
43
|
+
displayName: string;
|
|
44
|
+
};
|
|
38
45
|
declare function ComboboxFacade(props: ComboboxFacadeProps): import("react").JSX.Element;
|
|
39
|
-
export declare const Combobox: typeof ComboboxFacade & Omit<typeof Combobox$1, "Root"> & {
|
|
46
|
+
export declare const Combobox: typeof ComboboxFacade & Omit<typeof Combobox$1, "Root" | "Positioner"> & {
|
|
47
|
+
Positioner: typeof ComboboxPositioner;
|
|
40
48
|
Root: typeof ComboboxRoot;
|
|
41
49
|
};
|
|
42
50
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as iconNode } from "../../icon-C9udWCyz.mjs";
|
|
2
2
|
import { t as useElementId } from "../../id-Ctic_3o8.mjs";
|
|
3
|
+
import { n as definePositioner, t as FloatingPortal } from "../../floating-CMR7cvmA.mjs";
|
|
3
4
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Combobox as Combobox$1, createListCollection } from "@ark-ui/react/combobox";
|
|
@@ -23,8 +24,9 @@ function fromComboboxValue(value, multiple) {
|
|
|
23
24
|
}
|
|
24
25
|
/** The complete combobox behind one model value: options become the vessel's
|
|
25
26
|
* rows while typing, clearing, and selection stay on the common field path. */
|
|
27
|
+
const ComboboxPositioner = definePositioner(Combobox$1.Positioner);
|
|
26
28
|
function ComboboxFacade(props) {
|
|
27
|
-
const { value, defaultValue, options, multiple, clearable = true, disabled, invalid, required, label, placeholder, size = "md", className, style, onValueChange } = props;
|
|
29
|
+
const { portal = false, value, defaultValue, options, multiple, clearable = true, disabled, invalid, required, label, placeholder, size = "md", className, style, onValueChange } = props;
|
|
28
30
|
const collection = createListCollection({ items: options });
|
|
29
31
|
return /* @__PURE__ */ jsxs(ComboboxRoot, {
|
|
30
32
|
size,
|
|
@@ -57,18 +59,22 @@ function ComboboxFacade(props) {
|
|
|
57
59
|
height: 16
|
|
58
60
|
}) })
|
|
59
61
|
] }),
|
|
60
|
-
/* @__PURE__ */ jsx(
|
|
61
|
-
|
|
62
|
-
children:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
/* @__PURE__ */ jsx(FloatingPortal, {
|
|
63
|
+
portal,
|
|
64
|
+
children: /* @__PURE__ */ jsx(Combobox$1.Positioner, { children: /* @__PURE__ */ jsxs(Combobox$1.Content, { children: [/* @__PURE__ */ jsx(Combobox$1.Empty, { children: "No results found" }), /* @__PURE__ */ jsx(Combobox$1.List, { children: collection.items.map((item) => /* @__PURE__ */ jsxs(Combobox$1.Item, {
|
|
65
|
+
item,
|
|
66
|
+
children: [/* @__PURE__ */ jsx(Combobox$1.ItemText, { children: item.label }), /* @__PURE__ */ jsx(Combobox$1.ItemIndicator, { children: iconNode("check", {
|
|
67
|
+
width: 14,
|
|
68
|
+
height: 14
|
|
69
|
+
}) })]
|
|
70
|
+
}, item.value)) })] }) })
|
|
71
|
+
})
|
|
67
72
|
]
|
|
68
73
|
});
|
|
69
74
|
}
|
|
70
75
|
const Combobox = Object.assign(ComboboxFacade, {
|
|
71
76
|
...Combobox$1,
|
|
77
|
+
Positioner: ComboboxPositioner,
|
|
72
78
|
Root: ComboboxRoot
|
|
73
79
|
});
|
|
74
80
|
export { Combobox };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { Dialog } from "../dialog/index.mjs";
|
|
2
3
|
export interface CommandEntry {
|
|
3
4
|
label: string;
|
|
@@ -17,6 +18,8 @@ export interface CommandEntry {
|
|
|
17
18
|
* grafts onto the sheet's list.
|
|
18
19
|
*/
|
|
19
20
|
export interface CommandProps {
|
|
21
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
22
|
+
portal?: FloatingPortalTarget;
|
|
20
23
|
id?: string;
|
|
21
24
|
/** The commands on offer, grouped as they arrive. */
|
|
22
25
|
items?: CommandEntry[];
|
|
@@ -40,6 +43,6 @@ export interface CommandProps {
|
|
|
40
43
|
/** Reports the field's live text. */
|
|
41
44
|
onInputValueChange?: (value: string) => void;
|
|
42
45
|
}
|
|
43
|
-
declare function CommandImpl({ items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }: CommandProps): import("react").JSX.Element;
|
|
46
|
+
declare function CommandImpl({ portal, items, placeholder, open, autoFilter, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }: CommandProps): import("react").JSX.Element;
|
|
44
47
|
export declare const Command: typeof CommandImpl & typeof Dialog;
|
|
45
48
|
export {};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { t as useElementId } from "../../id-Ctic_3o8.mjs";
|
|
2
2
|
import { n as useComponentMessages } from "../../messages-B6n0lVyt.mjs";
|
|
3
|
+
import { t as FloatingPortal } from "../../floating-CMR7cvmA.mjs";
|
|
3
4
|
import { Dialog as Dialog$1 } from "../dialog/index.mjs";
|
|
4
5
|
import { injectComponentStyle } from "@bysages/core/styling";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
import { useEffect, useState } from "react";
|
|
7
|
-
import { Portal } from "@ark-ui/react/portal";
|
|
8
8
|
import { useListCollection } from "@ark-ui/react/collection";
|
|
9
9
|
import { Combobox } from "@ark-ui/react/combobox";
|
|
10
10
|
import { Dialog } from "@ark-ui/react/dialog";
|
|
11
11
|
// src/components/command/index.tsx
|
|
12
|
-
function CommandImpl({ items = [], placeholder, open, autoFilter = true, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }) {
|
|
12
|
+
function CommandImpl({ portal = true, items = [], placeholder, open, autoFilter = true, inputValue, emptyText, onSelect, onOpenChange, onInputValueChange, id }) {
|
|
13
13
|
injectComponentStyle("command");
|
|
14
14
|
injectComponentStyle("dialog");
|
|
15
15
|
const hostId = useElementId("command", { id });
|
|
@@ -72,76 +72,79 @@ function CommandImpl({ items = [], placeholder, open, autoFilter = true, inputVa
|
|
|
72
72
|
id: `${hostId}:dialog`,
|
|
73
73
|
open: currentOpen,
|
|
74
74
|
onOpenChange: (details) => setOpen(details.open),
|
|
75
|
-
children: /* @__PURE__ */ jsxs(
|
|
76
|
-
|
|
77
|
-
children: /* @__PURE__ */ jsx(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
children: /* @__PURE__ */ jsx(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
children: /* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
})
|
|
114
|
-
}), /* @__PURE__ */ jsx(Combobox.Content, {
|
|
115
|
-
asChild: true,
|
|
116
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
117
|
-
"data-scope": "command",
|
|
118
|
-
"data-part": "list",
|
|
119
|
-
children: [Array.from(groups, ([group, entries]) => group === "" ? entries.map(row) : /* @__PURE__ */ jsx(Combobox.ItemGroup, {
|
|
120
|
-
asChild: true,
|
|
121
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
122
|
-
"data-scope": "command",
|
|
123
|
-
"data-part": "group",
|
|
124
|
-
children: [/* @__PURE__ */ jsx(Combobox.ItemGroupLabel, {
|
|
125
|
-
asChild: true,
|
|
126
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
127
|
-
"data-scope": "command",
|
|
128
|
-
"data-part": "group-label",
|
|
129
|
-
children: group
|
|
130
|
-
})
|
|
131
|
-
}), entries.map(row)]
|
|
132
|
-
})
|
|
133
|
-
}, group)), groups.size === 0 ? /* @__PURE__ */ jsx("div", {
|
|
75
|
+
children: /* @__PURE__ */ jsxs(FloatingPortal, {
|
|
76
|
+
portal,
|
|
77
|
+
children: [/* @__PURE__ */ jsx(Dialog.Backdrop, {}), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
78
|
+
asChild: true,
|
|
79
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
80
|
+
"data-scope": "command",
|
|
81
|
+
"data-part": "positioner",
|
|
82
|
+
children: /* @__PURE__ */ jsx(Dialog.Content, {
|
|
83
|
+
asChild: true,
|
|
84
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
85
|
+
"data-scope": "command",
|
|
86
|
+
"data-part": "content",
|
|
87
|
+
"aria-label": messages.command.palette,
|
|
88
|
+
children: /* @__PURE__ */ jsxs(Combobox.Root, {
|
|
89
|
+
id: `${hostId}:combobox`,
|
|
90
|
+
collection,
|
|
91
|
+
inputValue,
|
|
92
|
+
open: listOpen,
|
|
93
|
+
onOpenChange: (details) => setListOpen(details.open),
|
|
94
|
+
inputBehavior: "autohighlight",
|
|
95
|
+
loopFocus: true,
|
|
96
|
+
onInputValueChange: (details) => {
|
|
97
|
+
setFieldText(details.inputValue);
|
|
98
|
+
if (autoFilter) filter(details.inputValue);
|
|
99
|
+
onInputValueChange?.(details.inputValue);
|
|
100
|
+
},
|
|
101
|
+
onValueChange: (details) => {
|
|
102
|
+
const [first] = details.value;
|
|
103
|
+
if (first == null) return;
|
|
104
|
+
onSelect?.(first);
|
|
105
|
+
setOpen(false);
|
|
106
|
+
},
|
|
107
|
+
children: [/* @__PURE__ */ jsx(Combobox.Input, {
|
|
108
|
+
asChild: true,
|
|
109
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
110
|
+
type: "text",
|
|
111
|
+
placeholder: resolvedPlaceholder,
|
|
112
|
+
"aria-label": resolvedPlaceholder,
|
|
134
113
|
"data-scope": "command",
|
|
135
|
-
"data-part": "
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
114
|
+
"data-part": "input"
|
|
115
|
+
})
|
|
116
|
+
}), /* @__PURE__ */ jsx(Combobox.Content, {
|
|
117
|
+
asChild: true,
|
|
118
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
119
|
+
"data-scope": "command",
|
|
120
|
+
"data-part": "list",
|
|
121
|
+
children: [Array.from(groups, ([group, entries]) => group === "" ? entries.map(row) : /* @__PURE__ */ jsx(Combobox.ItemGroup, {
|
|
122
|
+
asChild: true,
|
|
123
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
124
|
+
"data-scope": "command",
|
|
125
|
+
"data-part": "group",
|
|
126
|
+
children: [/* @__PURE__ */ jsx(Combobox.ItemGroupLabel, {
|
|
127
|
+
asChild: true,
|
|
128
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
129
|
+
"data-scope": "command",
|
|
130
|
+
"data-part": "group-label",
|
|
131
|
+
children: group
|
|
132
|
+
})
|
|
133
|
+
}), entries.map(row)]
|
|
134
|
+
})
|
|
135
|
+
}, group)), groups.size === 0 ? /* @__PURE__ */ jsx("div", {
|
|
136
|
+
"data-scope": "command",
|
|
137
|
+
"data-part": "empty",
|
|
138
|
+
children: resolvedEmptyText
|
|
139
|
+
}) : null]
|
|
140
|
+
})
|
|
141
|
+
})]
|
|
142
|
+
})
|
|
140
143
|
})
|
|
141
144
|
})
|
|
142
145
|
})
|
|
143
|
-
})
|
|
144
|
-
})
|
|
146
|
+
})]
|
|
147
|
+
})
|
|
145
148
|
});
|
|
146
149
|
}
|
|
147
150
|
const Command = Object.assign(CommandImpl, Dialog$1);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { n as FloatingPortalTarget, t as FloatingPortalProps } from "../../floating-BhcDRgnx.mjs";
|
|
1
2
|
import { CSSProperties, ComponentProps } from "react";
|
|
2
3
|
import { DatePicker as DatePicker$1, DatePickerFocusChangeDetails, DatePickerOpenChangeDetails, DatePickerValueChangeDetails, DatePickerViewChangeDetails, DatePickerVisibleRangeChangeDetails, DateValue } from "@ark-ui/react/date-picker";
|
|
3
4
|
type DatePickerRootProps$1 = ComponentProps<typeof DatePicker$1.Root> & {
|
|
@@ -13,6 +14,8 @@ declare function DatePickerRoot(props: DatePickerRootProps$1): import("react").J
|
|
|
13
14
|
* NextTrigger, Table*, MonthSelect, YearSelect, PresetTrigger. */
|
|
14
15
|
type DatePickerFacadeValue = DateValue | DateValue[];
|
|
15
16
|
type DatePickerFacadeProps = {
|
|
17
|
+
/** Portal after hydration; `false` keeps the vessel inline. */
|
|
18
|
+
portal?: FloatingPortalTarget;
|
|
16
19
|
value?: DatePickerFacadeValue;
|
|
17
20
|
defaultValue?: DatePickerFacadeValue;
|
|
18
21
|
disabled?: boolean;
|
|
@@ -27,8 +30,13 @@ type DatePickerFacadeProps = {
|
|
|
27
30
|
};
|
|
28
31
|
/** The complete picker behind one date: the field opens a single day grid,
|
|
29
32
|
* while ranges, multiple selection, and custom views remain anatomy work. */
|
|
33
|
+
declare const DatePickerPositioner: {
|
|
34
|
+
({ portal, ...rest }: FloatingPortalProps & DatePicker$1.PositionerProps & import("react").RefAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
30
37
|
declare function DatePickerFacade(props: DatePickerFacadeProps): import("react").JSX.Element;
|
|
31
|
-
export declare const DatePicker: typeof DatePickerFacade & Omit<typeof DatePicker$1, "Root"> & {
|
|
38
|
+
export declare const DatePicker: typeof DatePickerFacade & Omit<typeof DatePicker$1, "Root" | "Positioner"> & {
|
|
39
|
+
Positioner: typeof DatePickerPositioner;
|
|
32
40
|
Root: typeof DatePickerRoot;
|
|
33
41
|
};
|
|
34
42
|
export type { DatePickerFocusChangeDetails, DatePickerOpenChangeDetails, DatePickerValueChangeDetails, DatePickerViewChangeDetails, DatePickerVisibleRangeChangeDetails };
|