@bysages/react 0.3.1 → 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-BfKTmtCt.mjs → ai-response-B4DX7nmJ.mjs} +3 -1
- 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 +1 -1
- package/dist/components/ai/index.mjs +5 -3
- 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 +16 -44
- 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 +10 -14
- 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 +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 +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 +6 -1
- 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 +2 -11
- package/dist/components/block-ui/index.d.mts +4 -1
- package/dist/components/block-ui/index.mjs +3 -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 +12 -35
- 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 +7 -1
- 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 +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 +3 -1
- package/dist/components/data-view/index.d.mts +4 -1
- package/dist/components/data-view/index.mjs +3 -1
- 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 +10 -18
- 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 +29 -9
- package/dist/components/file-upload/index.mjs +46 -10
- 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 +5 -2
- package/dist/components/image/index.mjs +14 -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 -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/json-tree-view/index.d.mts +17 -1
- package/dist/components/json-tree-view/index.mjs +26 -5
- 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 +157 -63
- package/dist/components/link/index.d.mts +4 -1
- package/dist/components/link/index.mjs +3 -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 +6 -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 +26 -24
- 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 +3 -1
- package/dist/components/split-button/index.d.mts +3 -1
- package/dist/components/split-button/index.mjs +12 -17
- 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 +26 -6
- package/dist/components/steps/index.mjs +26 -11
- 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 +26 -56
- 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 +3 -1
- 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 +19 -5
- package/dist/components/toc/index.mjs +31 -5
- 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 +14 -26
- package/dist/components/tree-select/index.d.mts +3 -1
- package/dist/components/tree-select/index.mjs +11 -22
- package/dist/components/tree-view/index.d.mts +22 -2
- package/dist/components/tree-view/index.mjs +50 -8
- 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 +10 -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-Iy8m0Qev.d.mts → index-D_iKc2Uw.d.mts} +31 -2
- package/dist/{index-Dn5mHf1g.d.mts → index-DdNKngUQ.d.mts} +56 -17
- 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-C21Zzuy6.mjs} +3 -1
- package/dist/media-player-gQrnxU52.mjs +554 -0
- package/dist/{mentions-DMIBCBOd.mjs → mentions-BuWibdci.mjs} +74 -42
- package/dist/select-ozUFq0zd.mjs +121 -0
- package/package.json +3 -3
- package/dist/chevron-BeHvt46K.mjs +0 -17
- package/dist/glyph-VI989p8H.mjs +0 -14
- package/dist/select-eAHutw56.mjs +0 -70
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as iconNode } from "../../icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "../../id-C37UYLwJ.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
|
-
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
import {
|
|
5
|
-
import { TreeView as TreeView$1 } from "@ark-ui/react/tree-view";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { TreeView as TreeView$1, createTreeCollection } from "@ark-ui/react/tree-view";
|
|
6
6
|
//#region src/components/tree-view/index.tsx
|
|
7
7
|
function TreeViewRoot(props) {
|
|
8
|
+
injectComponentStyle("tree-view");
|
|
9
|
+
const id = useElementId("tree-view", props);
|
|
8
10
|
const { size = "md", ...rest } = props;
|
|
9
11
|
return /* @__PURE__ */ jsx(TreeView$1.Root, {
|
|
10
12
|
...rest,
|
|
13
|
+
id,
|
|
11
14
|
"data-size": size
|
|
12
15
|
});
|
|
13
16
|
}
|
|
@@ -22,18 +25,57 @@ function TreeViewNodeCheckbox(props) {
|
|
|
22
25
|
/** A branch is born with its chevron — the indicator stays a consumer's
|
|
23
26
|
* children to override, never a chore to remember. */
|
|
24
27
|
function TreeViewBranchIndicator(props) {
|
|
25
|
-
const { children =
|
|
28
|
+
const { children = iconNode("chevron-right"), ...rest } = props;
|
|
26
29
|
return /* @__PURE__ */ jsx(TreeView$1.BranchIndicator, {
|
|
27
30
|
...rest,
|
|
28
31
|
children
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
|
|
34
|
+
function treeNodes(items, path = []) {
|
|
35
|
+
return items.map((node, index) => {
|
|
36
|
+
const indexPath = [...path, index];
|
|
37
|
+
const row = node.children?.length ? /* @__PURE__ */ jsxs(TreeView$1.Branch, { children: [/* @__PURE__ */ jsxs(TreeView$1.BranchControl, { children: [/* @__PURE__ */ jsx(TreeView$1.BranchIndicator, { children: iconNode("chevron-right") }), /* @__PURE__ */ jsx(TreeView$1.BranchText, { children: node.label })] }), /* @__PURE__ */ jsx(TreeView$1.BranchContent, { children: treeNodes(node.children, indexPath) })] }) : /* @__PURE__ */ jsx(TreeView$1.Item, { children: /* @__PURE__ */ jsx(TreeView$1.ItemText, { children: node.label }) });
|
|
38
|
+
return /* @__PURE__ */ jsx(TreeView$1.NodeProvider, {
|
|
39
|
+
node,
|
|
40
|
+
indexPath,
|
|
41
|
+
children: row
|
|
42
|
+
}, node.value);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/** The complete tree behind selected values: nested options render their own
|
|
46
|
+
* branches and leaves, while async and checkbox trees remain anatomy work. */
|
|
47
|
+
function TreeViewFacade(props) {
|
|
48
|
+
const { value, defaultValue, options, multiple, label, size = "md", className, style, onValueChange } = props;
|
|
49
|
+
const branchValues = options.filter((option) => option.children?.length).map((option) => option.value);
|
|
50
|
+
const collection = createTreeCollection({
|
|
51
|
+
nodeToValue: (node) => node.value,
|
|
52
|
+
nodeToString: (node) => node.label,
|
|
53
|
+
isNodeDisabled: (node) => !!node.disabled,
|
|
54
|
+
rootNode: {
|
|
55
|
+
value: "root",
|
|
56
|
+
label: "",
|
|
57
|
+
children: options
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return /* @__PURE__ */ jsx(TreeViewRoot, {
|
|
61
|
+
size,
|
|
62
|
+
collection,
|
|
63
|
+
defaultExpandedValue: branchValues,
|
|
64
|
+
defaultSelectedValue: defaultValue,
|
|
65
|
+
selectedValue: value,
|
|
66
|
+
selectionMode: multiple ? "multiple" : "single",
|
|
67
|
+
"aria-label": label,
|
|
68
|
+
className,
|
|
69
|
+
style,
|
|
70
|
+
onSelectionChange: (event) => onValueChange?.(event.selectedValue),
|
|
71
|
+
children: /* @__PURE__ */ jsx(TreeView$1.Tree, { children: treeNodes(options) })
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
const TreeView = Object.assign(TreeViewFacade, {
|
|
32
75
|
...TreeView$1,
|
|
33
76
|
Root: TreeViewRoot,
|
|
34
77
|
NodeCheckbox: TreeViewNodeCheckbox,
|
|
35
78
|
BranchIndicator: TreeViewBranchIndicator
|
|
36
|
-
};
|
|
37
|
-
injectComponentStyle("tree-view");
|
|
79
|
+
});
|
|
38
80
|
//#endregion
|
|
39
81
|
export { TreeView };
|
|
@@ -4,6 +4,10 @@ export declare const Typography: {
|
|
|
4
4
|
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
} & {
|
|
7
|
+
Root: {
|
|
8
|
+
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
7
11
|
Display: {
|
|
8
12
|
({ children, ...rest }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
|
|
9
13
|
displayName: string;
|
|
@@ -16,5 +16,8 @@ export interface UserProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
16
16
|
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
17
17
|
* renders it here, so every size and shape the Avatar knows the user
|
|
18
18
|
* inherits; this row only lays the words out beside it. */
|
|
19
|
-
|
|
19
|
+
declare function UserImpl({ name, description, size, src, shape, children, ...rest }: UserProps): import("react").JSX.Element;
|
|
20
|
+
export declare const User: typeof UserImpl & {
|
|
21
|
+
Root: typeof UserImpl;
|
|
22
|
+
};
|
|
20
23
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { Avatar } from "../avatar/index.mjs";
|
|
2
3
|
import { injectComponentStyle } from "@bysages/core";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -9,7 +10,7 @@ function initialsOf(name) {
|
|
|
9
10
|
* quiet echo beneath. The mark is the Avatar itself — one component
|
|
10
11
|
* renders it here, so every size and shape the Avatar knows the user
|
|
11
12
|
* inherits; this row only lays the words out beside it. */
|
|
12
|
-
function
|
|
13
|
+
function UserImpl({ name, description, size, src, shape = "circle", children, ...rest }) {
|
|
13
14
|
injectComponentStyle("user");
|
|
14
15
|
return /* @__PURE__ */ jsxs("div", {
|
|
15
16
|
...rest,
|
|
@@ -38,5 +39,6 @@ function User({ name, description, size, src, shape = "circle", children, ...res
|
|
|
38
39
|
})]
|
|
39
40
|
});
|
|
40
41
|
}
|
|
42
|
+
const User = withSelfRoot(UserImpl);
|
|
41
43
|
//#endregion
|
|
42
44
|
export { User };
|
|
@@ -13,5 +13,8 @@ export interface VirtualListProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
* scroll length by a spacer sized from the row height, the rows
|
|
14
14
|
* themselves are positioned against it — a ten-thousand-row list
|
|
15
15
|
* costs the DOM a window, not the ledger. */
|
|
16
|
-
|
|
16
|
+
declare function VirtualListImpl({ items, itemHeight, height, renderItem, ...rest }: VirtualListProps): import("react").JSX.Element;
|
|
17
|
+
export declare const VirtualList: typeof VirtualListImpl & {
|
|
18
|
+
Root: typeof VirtualListImpl;
|
|
19
|
+
};
|
|
17
20
|
//#endregion
|
|
@@ -1,13 +1,17 @@
|
|
|
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
|
import { useRef } from "react";
|
|
4
5
|
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
5
6
|
//#region src/components/virtual-list/index.tsx
|
|
7
|
+
function toCssLength(length) {
|
|
8
|
+
return typeof length === "number" ? `${length}px` : length;
|
|
9
|
+
}
|
|
6
10
|
/** A ledger that only mounts the rows on stage: the viewport keeps its
|
|
7
11
|
* scroll length by a spacer sized from the row height, the rows
|
|
8
12
|
* themselves are positioned against it — a ten-thousand-row list
|
|
9
13
|
* costs the DOM a window, not the ledger. */
|
|
10
|
-
function
|
|
14
|
+
function VirtualListImpl({ items, itemHeight = 40, height = 320, renderItem, ...rest }) {
|
|
11
15
|
injectComponentStyle("virtual-list");
|
|
12
16
|
const viewport = useRef(null);
|
|
13
17
|
const virtualizer = useVirtualizer({
|
|
@@ -24,30 +28,24 @@ function VirtualList({ items, itemHeight = 40, height = 320, renderItem, ...rest
|
|
|
24
28
|
"data-part": "root",
|
|
25
29
|
style: {
|
|
26
30
|
...rest.style,
|
|
27
|
-
|
|
31
|
+
"--bs-virtual-list-height": toCssLength(height)
|
|
28
32
|
},
|
|
29
33
|
children: /* @__PURE__ */ jsx("div", {
|
|
30
34
|
"data-scope": "virtual-list",
|
|
31
35
|
"data-part": "inner",
|
|
32
|
-
style: {
|
|
33
|
-
blockSize: virtualizer.getTotalSize(),
|
|
34
|
-
position: "relative"
|
|
35
|
-
},
|
|
36
|
+
style: { "--bs-virtual-list-total": `${virtualizer.getTotalSize()}px` },
|
|
36
37
|
children: virtualizer.getVirtualItems().map((row) => /* @__PURE__ */ jsx("div", {
|
|
37
38
|
"data-scope": "virtual-list",
|
|
38
39
|
"data-part": "row",
|
|
39
40
|
style: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
insetInlineStart: 0,
|
|
43
|
-
inlineSize: "100%",
|
|
44
|
-
transform: `translateY(${row.start}px)`,
|
|
45
|
-
blockSize: row.size
|
|
41
|
+
"--bs-virtual-list-row-start": `${row.start}px`,
|
|
42
|
+
"--bs-virtual-list-row-size": `${row.size}px`
|
|
46
43
|
},
|
|
47
44
|
children: renderItem?.(items[row.index], row.index)
|
|
48
45
|
}, String(row.key)))
|
|
49
46
|
})
|
|
50
47
|
});
|
|
51
48
|
}
|
|
49
|
+
const VirtualList = withSelfRoot(VirtualListImpl);
|
|
52
50
|
//#endregion
|
|
53
51
|
export { VirtualList };
|
|
@@ -12,5 +12,8 @@ export interface WatermarkProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* density) and the marks layer repeats it over the children. The seal
|
|
13
13
|
* redraws itself when a prop turns — and it never takes a pointer.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
declare function WatermarkImpl({ content, opacity, rotate, fontSize, children, ...rest }: WatermarkProps): import("react").JSX.Element;
|
|
16
|
+
export declare const Watermark: typeof WatermarkImpl & {
|
|
17
|
+
Root: typeof WatermarkImpl;
|
|
18
|
+
};
|
|
16
19
|
//#endregion
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as withSelfRoot } from "../../family-DE_GQeeM.mjs";
|
|
1
2
|
import { injectComponentStyle } from "@bysages/core";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
import { useEffect, useState } from "react";
|
|
@@ -17,7 +18,7 @@ function toPx(size) {
|
|
|
17
18
|
* density) and the marks layer repeats it over the children. The seal
|
|
18
19
|
* redraws itself when a prop turns — and it never takes a pointer.
|
|
19
20
|
*/
|
|
20
|
-
function
|
|
21
|
+
function WatermarkImpl({ content, opacity = .06, rotate = -20, fontSize = "0.875rem", children, ...rest }) {
|
|
21
22
|
injectComponentStyle("watermark");
|
|
22
23
|
const [root, setRoot] = useState(null);
|
|
23
24
|
const [tile, setTile] = useState("");
|
|
@@ -72,9 +73,10 @@ function Watermark({ content, opacity = .06, rotate = -20, fontSize = "0.875rem"
|
|
|
72
73
|
"data-scope": "watermark",
|
|
73
74
|
"data-part": "marks",
|
|
74
75
|
"aria-hidden": "true",
|
|
75
|
-
style: {
|
|
76
|
+
style: { "--bs-watermark-image": tile }
|
|
76
77
|
})]
|
|
77
78
|
});
|
|
78
79
|
}
|
|
80
|
+
const Watermark = withSelfRoot(WatermarkImpl);
|
|
79
81
|
//#endregion
|
|
80
82
|
export { Watermark };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/internal/family.ts
|
|
2
|
+
/** Gives a single-component family the same callable + Root surface. */
|
|
3
|
+
function withSelfRoot(component) {
|
|
4
|
+
const family = component;
|
|
5
|
+
family.Root = component;
|
|
6
|
+
return family;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { withSelfRoot as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { getIcon } from "@bysages/core/icons";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/internal/icon.tsx
|
|
4
|
+
/** Render a curated registry icon as a bare svg element — the components
|
|
5
|
+
* own default icons. No span shell: the part rules size the svg directly.
|
|
6
|
+
* Extra body appends after the icon's own body, for composed marks. */
|
|
7
|
+
function iconNode(name, attrs = {}, extraBody = "") {
|
|
8
|
+
const icon = getIcon(name);
|
|
9
|
+
if (!icon) throw new Error(`Unknown icon "${name}" in the curated core registry`);
|
|
10
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
11
|
+
viewBox: `0 0 ${icon.width} ${icon.height}`,
|
|
12
|
+
"aria-hidden": "true",
|
|
13
|
+
...attrs,
|
|
14
|
+
dangerouslySetInnerHTML: { __html: icon.body + extraBody }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { iconNode as t };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useId } from "react";
|
|
2
|
+
//#region src/internal/id.ts
|
|
3
|
+
/** Zag composes owned-part ids with separators, so React's generated id
|
|
4
|
+
* is narrowed to characters that survive both markup and selectors. */
|
|
5
|
+
const UNSAFE_ID_CHARACTERS = /[^a-zA-Z0-9_-]/g;
|
|
6
|
+
/** Generates an SSR-stable machine base id while honoring an explicit id. */
|
|
7
|
+
function useElementId(scope, props = {}) {
|
|
8
|
+
const generated = useId();
|
|
9
|
+
const explicit = props.id;
|
|
10
|
+
return typeof explicit === "string" && explicit ? explicit : `bs-${scope}-${generated.replace(UNSAFE_ID_CHARACTERS, "-")}`;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { useElementId as t };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { t as iconNode } from "./icon-BALgGtNK.mjs";
|
|
2
|
+
import { t as useElementId } from "./id-C37UYLwJ.mjs";
|
|
3
|
+
import { n as useComponentMessages } from "./messages-1jJWtaYU.mjs";
|
|
4
|
+
import { Button } from "./components/button/index.mjs";
|
|
5
|
+
import { ButtonGroup } from "./components/button-group/index.mjs";
|
|
6
|
+
import { Dialog as Dialog$1 } from "./components/dialog/index.mjs";
|
|
7
|
+
import { injectComponentStyle } from "@bysages/core";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { useEffect, useState } from "react";
|
|
10
|
+
import { Portal } from "@ark-ui/react/portal";
|
|
11
|
+
import { Dialog } from "@ark-ui/react/dialog";
|
|
12
|
+
//#region src/components/image-viewer/preview.tsx
|
|
13
|
+
/** The default doorway is the curated preview icon; custom content keeps
|
|
14
|
+
* that icon as its hover and focus affordance. */
|
|
15
|
+
function ImageViewerPreview({ label, children, "data-part": dataPart, ...rest }) {
|
|
16
|
+
injectComponentStyle("image-viewer");
|
|
17
|
+
const messages = useComponentMessages();
|
|
18
|
+
const parts = [dataPart, "preview"].filter(Boolean).join(" ");
|
|
19
|
+
const isIcon = children == null;
|
|
20
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
21
|
+
...rest,
|
|
22
|
+
"data-scope": "image-viewer",
|
|
23
|
+
"data-part": parts,
|
|
24
|
+
...isIcon ? {
|
|
25
|
+
"data-empty": "true",
|
|
26
|
+
"aria-label": messages.imageViewer.preview
|
|
27
|
+
} : {},
|
|
28
|
+
children: [children ?? iconNode("eye"), isIcon ? null : /* @__PURE__ */ jsxs("span", {
|
|
29
|
+
"data-scope": "image-viewer",
|
|
30
|
+
"data-part": "preview-overlay",
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
children: [iconNode("eye"), label ? /* @__PURE__ */ jsx("span", {
|
|
33
|
+
"data-part": "preview-label",
|
|
34
|
+
children: label
|
|
35
|
+
}) : null]
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/components/image-viewer/index.tsx
|
|
41
|
+
const MIN_SCALE = .5;
|
|
42
|
+
const MAX_SCALE = 3;
|
|
43
|
+
const SCALE_STEP = .25;
|
|
44
|
+
const TOOL_ICONS = {
|
|
45
|
+
zoomIn: "zoom-in",
|
|
46
|
+
zoomOut: "zoom-out",
|
|
47
|
+
rotate: "rotate-cw",
|
|
48
|
+
close: "x"
|
|
49
|
+
};
|
|
50
|
+
function ImageViewerImpl({ src, alt = "", open, zoomable = true, width, height, children, onOpenChange, id }) {
|
|
51
|
+
injectComponentStyle("image-viewer");
|
|
52
|
+
const hostId = useElementId("image-viewer", { id });
|
|
53
|
+
const messages = useComponentMessages();
|
|
54
|
+
const [localOpen, setLocalOpen] = useState(false);
|
|
55
|
+
const [scale, setScale] = useState(1);
|
|
56
|
+
const [rotation, setRotation] = useState(0);
|
|
57
|
+
const isOpen = open ?? localOpen;
|
|
58
|
+
const setOpen = (value) => {
|
|
59
|
+
if (open === void 0) setLocalOpen(value);
|
|
60
|
+
onOpenChange?.(value);
|
|
61
|
+
};
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (isOpen) {
|
|
64
|
+
setScale(1);
|
|
65
|
+
setRotation(0);
|
|
66
|
+
}
|
|
67
|
+
}, [isOpen]);
|
|
68
|
+
function zoom(step) {
|
|
69
|
+
setScale((current) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, current + step)));
|
|
70
|
+
}
|
|
71
|
+
function rotate() {
|
|
72
|
+
setRotation((current) => (current + 90) % 360);
|
|
73
|
+
}
|
|
74
|
+
function toolButton(label, icon, onClick) {
|
|
75
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
76
|
+
variant: "ghost",
|
|
77
|
+
square: true,
|
|
78
|
+
size: "lg",
|
|
79
|
+
"aria-label": label,
|
|
80
|
+
onClick,
|
|
81
|
+
children: iconNode(icon)
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function closeToolButton(label, icon) {
|
|
85
|
+
return /* @__PURE__ */ jsx(Dialog.CloseTrigger, {
|
|
86
|
+
asChild: true,
|
|
87
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
88
|
+
variant: "ghost",
|
|
89
|
+
square: true,
|
|
90
|
+
size: "lg",
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
children: iconNode(icon)
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, {
|
|
97
|
+
id: `${hostId}:dialog`,
|
|
98
|
+
open: isOpen,
|
|
99
|
+
onOpenChange: (details) => setOpen(details.open),
|
|
100
|
+
lazyMount: true,
|
|
101
|
+
unmountOnExit: true,
|
|
102
|
+
children: [/* @__PURE__ */ jsx(Dialog.Trigger, {
|
|
103
|
+
asChild: true,
|
|
104
|
+
"data-scope": "image-viewer",
|
|
105
|
+
"data-part": "trigger",
|
|
106
|
+
children: children ?? /* @__PURE__ */ jsx(ImageViewerPreview, {})
|
|
107
|
+
}), /* @__PURE__ */ jsxs(Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "bs-image-viewer-backdrop" }), /* @__PURE__ */ jsx(Dialog.Positioner, {
|
|
108
|
+
className: "bs-image-viewer-positioner",
|
|
109
|
+
children: /* @__PURE__ */ jsxs(Dialog.Content, {
|
|
110
|
+
className: "bs-image-viewer-content",
|
|
111
|
+
"aria-label": alt || "Image preview",
|
|
112
|
+
onClick: (event) => {
|
|
113
|
+
if (event.target === event.currentTarget) setOpen(false);
|
|
114
|
+
},
|
|
115
|
+
children: [/* @__PURE__ */ jsx("img", {
|
|
116
|
+
"data-scope": "image-viewer",
|
|
117
|
+
"data-part": "viewport",
|
|
118
|
+
src,
|
|
119
|
+
alt,
|
|
120
|
+
width,
|
|
121
|
+
height,
|
|
122
|
+
style: { "--bs-image-viewer-transform": `scale(${scale}) rotate(${rotation}deg)` }
|
|
123
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
124
|
+
"data-scope": "image-viewer",
|
|
125
|
+
"data-part": "toolbar",
|
|
126
|
+
children: /* @__PURE__ */ jsxs(ButtonGroup, { children: [
|
|
127
|
+
zoomable ? [toolButton(messages.imageViewer.zoomIn, TOOL_ICONS.zoomIn, () => zoom(SCALE_STEP)), toolButton(messages.imageViewer.zoomOut, TOOL_ICONS.zoomOut, () => zoom(-.25))] : null,
|
|
128
|
+
toolButton(messages.imageViewer.rotate, TOOL_ICONS.rotate, rotate),
|
|
129
|
+
closeToolButton(messages.imageViewer.close, TOOL_ICONS.close)
|
|
130
|
+
] })
|
|
131
|
+
})]
|
|
132
|
+
})
|
|
133
|
+
})] })]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
const ImageViewer = Object.assign(ImageViewerImpl, {
|
|
137
|
+
...Dialog$1,
|
|
138
|
+
Preview: ImageViewerPreview
|
|
139
|
+
});
|
|
140
|
+
//#endregion
|
|
141
|
+
export { ImageViewer as t };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { t as Popover } from "./index-Eu-Bttta.mjs";
|
|
1
2
|
import { HTMLAttributes } from "react";
|
|
2
3
|
//#region src/components/mentions/use-mentions.d.ts
|
|
3
4
|
interface UseMentionsOptions {
|
|
@@ -45,6 +46,7 @@ interface MentionEntry {
|
|
|
45
46
|
value: string;
|
|
46
47
|
}
|
|
47
48
|
interface MentionsVesselProps {
|
|
49
|
+
id?: string;
|
|
48
50
|
/** The host field's rung, so the rows keep the field's register. */
|
|
49
51
|
size?: "sm" | "md" | "lg";
|
|
50
52
|
/** Whether the candidates are up. */
|
|
@@ -67,7 +69,10 @@ interface MentionsVesselProps {
|
|
|
67
69
|
* its own anatomy (the textarea rides where the host puts it) and the
|
|
68
70
|
* vessel still points at the right place. Shares the detection state
|
|
69
71
|
* with the host through `useMentions`. */
|
|
70
|
-
declare function
|
|
72
|
+
declare function MentionsVesselImpl({ size, open, matches, active, anchor, onInsert, onActiveChange, onOpenChange, id }: MentionsVesselProps): import("react").JSX.Element;
|
|
73
|
+
declare const MentionsVessel: typeof MentionsVesselImpl & {
|
|
74
|
+
Root: typeof MentionsVesselImpl;
|
|
75
|
+
};
|
|
71
76
|
/**
|
|
72
77
|
* @-mentions: a plain textarea that, when the text before the caret ends
|
|
73
78
|
* with the trigger character followed by a token, offers the matching
|
|
@@ -77,11 +82,10 @@ declare function MentionsVessel({ size, open, matches, active, anchor, onInsert,
|
|
|
77
82
|
*
|
|
78
83
|
* The field is the shared `Field.Textarea` — field wiring (label ids,
|
|
79
84
|
* the invalid state, autoresize) rides on it for free — and the vessel
|
|
80
|
-
* anchors
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* skip this shell and wire `useMentions` plus `MentionsVessel`
|
|
85
|
+
* anchors through the popover's own `Anchor` part wrapped around the
|
|
86
|
+
* field, so the machine, not a local rectangle, points the popup at the
|
|
87
|
+
* input. Composers that keep their own field anatomy (the AI prompt
|
|
88
|
+
* input) skip this shell and wire `useMentions` plus `MentionsVessel`
|
|
85
89
|
* themselves.
|
|
86
90
|
*/
|
|
87
91
|
interface MentionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -103,6 +107,7 @@ interface MentionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
103
107
|
/** Reports the field's next text. */
|
|
104
108
|
onValueChange?: (value: string) => void;
|
|
105
109
|
}
|
|
106
|
-
declare function
|
|
110
|
+
declare function MentionsImpl({ items, value, trigger, placeholder, autoresize, invalid, size, onValueChange, children, ...rest }: MentionsProps): import("react").JSX.Element;
|
|
111
|
+
declare const Mentions: typeof MentionsImpl & typeof Popover;
|
|
107
112
|
//#endregion
|
|
108
113
|
export { MentionsVesselProps as a, useMentions as c, MentionsVessel as i, Mentions as n, UseMentionsHandlers as o, MentionsProps as r, UseMentionsOptions as s, MentionEntry as t };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes, HTMLAttributes, InputHTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/components/media-player/parts.d.ts
|
|
3
|
+
type MediaPartProps = HTMLAttributes<HTMLElement>;
|
|
4
|
+
type ButtonPartProps = ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
5
|
+
label?: string;
|
|
6
|
+
};
|
|
7
|
+
type InputPartProps = InputHTMLAttributes<HTMLInputElement> & {
|
|
8
|
+
label?: string;
|
|
9
|
+
};
|
|
10
|
+
type DivPartProps = HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
label?: string;
|
|
12
|
+
};
|
|
13
|
+
/** The native media element, framed by the shared shell's state machine. */
|
|
14
|
+
declare function Media(props: MediaPartProps): import("react").JSX.Element;
|
|
15
|
+
/** Play and pause share one seal-cut control: the state changes the mark,
|
|
16
|
+
* never the control's place in the hand. */
|
|
17
|
+
declare function PlayButton({ label, ...props }: ButtonPartProps): import("react").JSX.Element;
|
|
18
|
+
/** The elapsed and total time bracket the timeline. */
|
|
19
|
+
declare function Time(props: HTMLAttributes<HTMLSpanElement>): import("react").JSX.Element;
|
|
20
|
+
/** Seeking writes straight to currentTime; buffered ranges can later
|
|
21
|
+
* ride the same part as a second ink wash. */
|
|
22
|
+
declare function Timeline({ label, ...props }: InputPartProps): import("react").JSX.Element;
|
|
23
|
+
/** Muting stays at the left of the volume well, the way a hand expects. */
|
|
24
|
+
declare function MuteButton({ label, ...props }: ButtonPartProps): import("react").JSX.Element;
|
|
25
|
+
declare function Volume({ label, ...props }: InputPartProps): import("react").JSX.Element;
|
|
26
|
+
/** Playback rate is a real choice, not hidden behind native menus. */
|
|
27
|
+
declare function Rate({ label, ...props }: DivPartProps): import("react").JSX.Element;
|
|
28
|
+
/** Text tracks use the browser's native model; the control chooses a
|
|
29
|
+
* track index, while rendering stays with the media element. */
|
|
30
|
+
declare function Captions({ label, ...props }: DivPartProps): import("react").JSX.Element | null;
|
|
31
|
+
/** Picture-in-picture is video-only and capability-detected. */
|
|
32
|
+
declare function PipButton({ label, ...props }: ButtonPartProps): import("react").JSX.Element | null;
|
|
33
|
+
/** Fullscreen takes the whole vessel, not just the moving picture. */
|
|
34
|
+
declare function FullscreenButton({ label, ...props }: MediaPartProps & {
|
|
35
|
+
label?: string;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/components/media-player/use-media-controls.d.ts
|
|
39
|
+
/** One alternative encoding offered to the browser before playback. */
|
|
40
|
+
interface MediaSourceOption {
|
|
41
|
+
src: string;
|
|
42
|
+
type?: string;
|
|
43
|
+
}
|
|
44
|
+
/** A WebVTT track handed to the native text-track model. */
|
|
45
|
+
interface MediaTextTrackOption {
|
|
46
|
+
src: string;
|
|
47
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata";
|
|
48
|
+
label?: string;
|
|
49
|
+
srcLang?: string;
|
|
50
|
+
default?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/** A compact clock for player chrome: hours only when the media asks
|
|
53
|
+
* for them, stable digits so the time never jitters the controls. */
|
|
54
|
+
declare function formatMediaTime(seconds: number): string;
|
|
55
|
+
//#endregion
|
|
56
|
+
//#region src/components/media-player/shell.d.ts
|
|
57
|
+
interface MediaPlayerProps extends Omit<HTMLAttributes<HTMLDivElement>, "onPlay" | "onPause" | "onEnded" | "onTimeUpdate" | "onVolumeChange" | "onRateChange" | "onError"> {
|
|
58
|
+
label?: string;
|
|
59
|
+
src?: string;
|
|
60
|
+
sources?: MediaSourceOption[];
|
|
61
|
+
tracks?: MediaTextTrackOption[];
|
|
62
|
+
autoplay?: boolean;
|
|
63
|
+
loop?: boolean;
|
|
64
|
+
muted?: boolean;
|
|
65
|
+
preload?: "none" | "metadata" | "auto";
|
|
66
|
+
volume?: number;
|
|
67
|
+
playbackRate?: number;
|
|
68
|
+
playbackRates?: number[];
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
poster?: string;
|
|
71
|
+
playsInline?: boolean;
|
|
72
|
+
onPlay?: (event: Event) => void;
|
|
73
|
+
onPause?: (event: Event) => void;
|
|
74
|
+
onEnded?: (event: Event) => void;
|
|
75
|
+
onTimeupdate?: (event: Event) => void;
|
|
76
|
+
onVolumechange?: (event: Event) => void;
|
|
77
|
+
onRatechange?: (event: Event) => void;
|
|
78
|
+
onError?: (event: Event) => void;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/components/media-player/index.d.ts
|
|
82
|
+
/** Audio and video share one instrument: the same state, the same keys,
|
|
83
|
+
* and the same control rhythm, while each face keeps its native element's
|
|
84
|
+
* own semantics. The parts — Root, Stage, Media, Controls, PlayButton,
|
|
85
|
+
* Timeline, Time, MuteButton, Volume, Rate, Captions, PipButton,
|
|
86
|
+
* FullscreenButton. */
|
|
87
|
+
declare const Audio: ((props: MediaPlayerProps) => import("react").JSX.Element) & {
|
|
88
|
+
Root: (props: MediaPlayerProps) => import("react").JSX.Element;
|
|
89
|
+
Stage: (props: import("react").HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
90
|
+
Media: typeof Media;
|
|
91
|
+
Controls: (props: import("react").HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
92
|
+
PlayButton: typeof PlayButton;
|
|
93
|
+
Timeline: typeof Timeline;
|
|
94
|
+
Time: typeof Time;
|
|
95
|
+
MuteButton: typeof MuteButton;
|
|
96
|
+
Volume: typeof Volume;
|
|
97
|
+
Rate: typeof Rate;
|
|
98
|
+
};
|
|
99
|
+
declare const Video: ((props: MediaPlayerProps) => import("react").JSX.Element) & {
|
|
100
|
+
Root: (props: MediaPlayerProps) => import("react").JSX.Element;
|
|
101
|
+
Stage: (props: import("react").HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
102
|
+
Media: typeof Media;
|
|
103
|
+
Controls: (props: import("react").HTMLAttributes<HTMLDivElement>) => import("react").JSX.Element;
|
|
104
|
+
PlayButton: typeof PlayButton;
|
|
105
|
+
Timeline: typeof Timeline;
|
|
106
|
+
Time: typeof Time;
|
|
107
|
+
MuteButton: typeof MuteButton;
|
|
108
|
+
Volume: typeof Volume;
|
|
109
|
+
Rate: typeof Rate;
|
|
110
|
+
Captions: typeof Captions;
|
|
111
|
+
PipButton: typeof PipButton;
|
|
112
|
+
FullscreenButton: typeof FullscreenButton;
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { MediaTextTrackOption as a, MediaSourceOption as i, Video as n, formatMediaTime as o, MediaPlayerProps as r, Audio as t };
|
|
@@ -35,8 +35,37 @@ type SelectOwnProps = {
|
|
|
35
35
|
size?: "sm" | "md" | "lg";
|
|
36
36
|
};
|
|
37
37
|
declare function SelectRoot<T extends CollectionItem>(props: SelectRootComponentProps<T, SelectOwnProps>): import("react").JSX.Element;
|
|
38
|
-
|
|
38
|
+
type SelectFacadeValue = string | string[];
|
|
39
|
+
type SelectParts = Omit<typeof Select, "Root"> & {
|
|
39
40
|
Root: typeof SelectRoot;
|
|
40
41
|
};
|
|
42
|
+
interface SelectFacadeProps {
|
|
43
|
+
value?: SelectFacadeValue;
|
|
44
|
+
defaultValue?: SelectFacadeValue;
|
|
45
|
+
options: NativeSelectOption[];
|
|
46
|
+
multiple?: boolean;
|
|
47
|
+
deselectable?: boolean;
|
|
48
|
+
/** Show the clear-value control when the machine allows it. */
|
|
49
|
+
clearable?: boolean;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
invalid?: boolean;
|
|
52
|
+
required?: boolean;
|
|
53
|
+
readOnly?: boolean;
|
|
54
|
+
label?: string;
|
|
55
|
+
/** Heading above the flat option list. */
|
|
56
|
+
groupLabel?: string;
|
|
57
|
+
placeholder?: string;
|
|
58
|
+
name?: string;
|
|
59
|
+
form?: string;
|
|
60
|
+
autoComplete?: string;
|
|
61
|
+
/** One rung of the control-height ladder for the trigger. */
|
|
62
|
+
size?: "sm" | "md" | "lg";
|
|
63
|
+
onValueChange?: (value: string | string[]) => void;
|
|
64
|
+
}
|
|
65
|
+
declare function SelectFacade({ value, defaultValue, options, multiple, deselectable, clearable, disabled, invalid, required, readOnly, label, groupLabel, placeholder, name, form, autoComplete, size, onValueChange }: SelectFacadeProps): import("react").JSX.Element;
|
|
66
|
+
declare namespace SelectFacade {
|
|
67
|
+
var displayName: string;
|
|
68
|
+
}
|
|
69
|
+
declare const Select$1: typeof SelectFacade & SelectParts;
|
|
41
70
|
//#endregion
|
|
42
|
-
export { NativeSelectProps as i,
|
|
71
|
+
export { NativeSelectProps as a, NativeSelectOption as i, SelectFacadeProps as n, NativeSelect as r, Select$1 as t };
|