prime-ui-kit 0.11.0 → 0.12.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/README.md +2 -1
- package/bin/prime-ui-kit.js +0 -0
- package/dist/chunks/{chunk-GKX3QAUC.js → chunk-OTOIOHVE.js} +1 -1
- package/dist/chunks/{chunk-WDTSHOTD.js → chunk-VOZ7J72X.js} +7 -2
- package/dist/chunks/{chunk-CUH6DJ57.js → chunk-YJO3NJIJ.js} +716 -548
- package/dist/color-picker.js +2 -2
- package/dist/components/index.d.ts +2 -0
- package/dist/components/list/List.d.ts +105 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +6 -2
- package/dist/internal/VisuallyHidden.d.ts +6 -1
- package/dist/skill/api-contract.md +1 -1
- package/dist/skill/cheatsheet.md +1 -1
- package/dist/skill/choosing.md +4 -2
- package/dist/skill/components.md +2 -1
- package/dist/skill/composition.md +8 -0
- package/dist/skill/layouts.md +2 -1
- package/dist/skill/patterns/app-shell.module.css +18 -0
- package/dist/skill/patterns/app-shell.tsx +301 -0
- package/dist/skill/patterns/chat.module.css +0 -16
- package/dist/skill/patterns/chat.tsx +16 -19
- package/dist/skill/patterns/kanban-board.module.css +28 -0
- package/dist/skill/patterns/kanban-board.tsx +618 -0
- package/dist/skill/patterns/media-library.module.css +66 -0
- package/dist/skill/patterns/media-library.tsx +638 -0
- package/dist/skill/patterns/schedule.module.css +22 -0
- package/dist/skill/patterns/schedule.tsx +710 -0
- package/dist/skill/reference/components/file-upload/COMPONENT.md +3 -1
- package/dist/skill/reference/components/list/COMPONENT.md +180 -0
- package/dist/skill/reference/components/list/examples/as-link.tsx +37 -0
- package/dist/skill/reference/components/list/examples/examples.module.css +18 -0
- package/dist/skill/reference/components/list/examples/overflow.tsx +46 -0
- package/dist/skill/reference/components/list/examples/overview.tsx +63 -0
- package/dist/skill/reference/components/list/examples/sizes.tsx +35 -0
- package/dist/skill/reference/components/list/examples/states.tsx +27 -0
- package/dist/skill/reference/components/list/examples/with-icon.tsx +60 -0
- package/dist/skill/reference/components/page-content/COMPONENT.md +2 -2
- package/dist/skill/reference/components/page-content/examples/examples.module.css +5 -12
- package/dist/skill/reference/components/page-content/examples/list-detail.tsx +13 -18
- package/dist/skill/reference/components/visually-hidden/COMPONENT.md +6 -3
- package/dist/skill/reference/components/visually-hidden/examples/overview.tsx +2 -2
- package/package.json +3 -3
- package/src/components/file-upload/COMPONENT.md +3 -1
- package/src/components/list/COMPONENT.md +180 -0
- package/src/components/list/examples/as-link.tsx +37 -0
- package/src/components/list/examples/examples.module.css +18 -0
- package/src/components/list/examples/overflow.tsx +46 -0
- package/src/components/list/examples/overview.tsx +63 -0
- package/src/components/list/examples/sizes.tsx +35 -0
- package/src/components/list/examples/states.tsx +27 -0
- package/src/components/list/examples/with-icon.tsx +60 -0
- package/src/components/page-content/COMPONENT.md +2 -2
- package/src/components/page-content/examples/examples.module.css +5 -12
- package/src/components/page-content/examples/list-detail.tsx +13 -18
- package/src/components/visually-hidden/COMPONENT.md +6 -3
- package/src/components/visually-hidden/examples/overview.tsx +2 -2
|
@@ -126,7 +126,7 @@ import {
|
|
|
126
126
|
useSwatchOptions,
|
|
127
127
|
useSwipeDismiss,
|
|
128
128
|
visuallyHiddenClass
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-VOZ7J72X.js";
|
|
130
130
|
import {
|
|
131
131
|
ControlSizeProvider,
|
|
132
132
|
cx,
|
|
@@ -14227,7 +14227,7 @@ function DndRoot({ labels, children }) {
|
|
|
14227
14227
|
return /* @__PURE__ */ jsxs32(DragControllerContext, { value: controller, children: [
|
|
14228
14228
|
children,
|
|
14229
14229
|
/* @__PURE__ */ jsx43(DragOverlay, { controller }),
|
|
14230
|
-
/* @__PURE__ */ jsx43(VisuallyHidden, {
|
|
14230
|
+
/* @__PURE__ */ jsx43(VisuallyHidden, { live: "polite", children: message })
|
|
14231
14231
|
] });
|
|
14232
14232
|
}
|
|
14233
14233
|
DndRoot.displayName = "Dnd.Root";
|
|
@@ -15233,7 +15233,7 @@ function FileSetView({
|
|
|
15233
15233
|
status
|
|
15234
15234
|
});
|
|
15235
15235
|
};
|
|
15236
|
-
const region = announcer.own ? /* @__PURE__ */ jsx45(VisuallyHidden, {
|
|
15236
|
+
const region = announcer.own ? /* @__PURE__ */ jsx45(VisuallyHidden, { live: "polite", children: announcer.message }) : null;
|
|
15237
15237
|
if (layout === "list") {
|
|
15238
15238
|
return /* @__PURE__ */ jsxs34(Fragment20, { children: [
|
|
15239
15239
|
files.length > 0 || addTile ? /* @__PURE__ */ jsxs34("ul", { ...listProps, ref: setListRef, className: cx(FileUpload_default.queue, listProps.className), children: [
|
|
@@ -17252,7 +17252,7 @@ function ComposerRoot({
|
|
|
17252
17252
|
/* @__PURE__ */ jsx47(VisuallyHidden, { id: hintId, children: videoAvailable && voiceAvailable ? labels.recordSwitchHint : labels.recordHint })
|
|
17253
17253
|
] })
|
|
17254
17254
|
] }),
|
|
17255
|
-
/* @__PURE__ */ jsx47(VisuallyHidden, {
|
|
17255
|
+
/* @__PURE__ */ jsx47(VisuallyHidden, { live: "polite", children: announcement })
|
|
17256
17256
|
]
|
|
17257
17257
|
}
|
|
17258
17258
|
) }) });
|
|
@@ -19286,7 +19286,7 @@ function DataTable({
|
|
|
19286
19286
|
}
|
|
19287
19287
|
) }),
|
|
19288
19288
|
showSkeleton ? /* @__PURE__ */ jsx55(VisuallyHidden, { role: "status", children: labels.loading }) : null,
|
|
19289
|
-
selectable ? /* @__PURE__ */ jsx55(VisuallyHidden, {
|
|
19289
|
+
selectable ? /* @__PURE__ */ jsx55(VisuallyHidden, { live: "polite", children: selection.announcement }) : null,
|
|
19290
19290
|
/* @__PURE__ */ jsx55(
|
|
19291
19291
|
Footer,
|
|
19292
19292
|
{
|
|
@@ -23401,7 +23401,7 @@ function Gantt({
|
|
|
23401
23401
|
editableAtAll ? /* @__PURE__ */ jsx66(VisuallyHidden, { id: hintId, children: labels.editHint }) : null,
|
|
23402
23402
|
creatable ? /* @__PURE__ */ jsx66(VisuallyHidden, { id: createHintId, children: labels.createHint }) : null,
|
|
23403
23403
|
bodyState === "loading" ? /* @__PURE__ */ jsx66(VisuallyHidden, { role: "status", children: labels.loading }) : null,
|
|
23404
|
-
/* @__PURE__ */ jsx66(VisuallyHidden, {
|
|
23404
|
+
/* @__PURE__ */ jsx66(VisuallyHidden, { live: "polite", children: announcement })
|
|
23405
23405
|
]
|
|
23406
23406
|
}
|
|
23407
23407
|
) }) });
|
|
@@ -23869,13 +23869,179 @@ var Kanban = {
|
|
|
23869
23869
|
ItemCount: KanbanItemCount
|
|
23870
23870
|
};
|
|
23871
23871
|
|
|
23872
|
+
// src/components/list/List.tsx
|
|
23873
|
+
import * as React78 from "react";
|
|
23874
|
+
|
|
23875
|
+
// src/components/list/List.module.css
|
|
23876
|
+
var List_default = {
|
|
23877
|
+
root: "List_root",
|
|
23878
|
+
row: "List_row",
|
|
23879
|
+
item: "List_item",
|
|
23880
|
+
icon: "List_icon",
|
|
23881
|
+
body: "List_body",
|
|
23882
|
+
text: "List_text",
|
|
23883
|
+
description: "List_description",
|
|
23884
|
+
trail: "List_trail",
|
|
23885
|
+
trailStacked: "List_trailStacked",
|
|
23886
|
+
meta: "List_meta",
|
|
23887
|
+
count: "List_count"
|
|
23888
|
+
};
|
|
23889
|
+
|
|
23890
|
+
// src/components/list/List.tsx
|
|
23891
|
+
import { Fragment as Fragment29, jsx as jsx68, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
23892
|
+
function ListRoot({ size = "m", className, ...rest }) {
|
|
23893
|
+
return /* @__PURE__ */ jsx68(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx68("ul", { ...rest, className: cx(List_default.root, className), ...toDataAttributes({ size }) }) });
|
|
23894
|
+
}
|
|
23895
|
+
ListRoot.displayName = "List.Root";
|
|
23896
|
+
function ListItemIcon({ className, ...rest }) {
|
|
23897
|
+
return /* @__PURE__ */ jsx68("span", { ...rest, className: cx(List_default.icon, className), "aria-hidden": "true" });
|
|
23898
|
+
}
|
|
23899
|
+
ListItemIcon.displayName = "List.ItemIcon";
|
|
23900
|
+
function ListItemText({ className, ...rest }) {
|
|
23901
|
+
return /* @__PURE__ */ jsx68("span", { ...rest, className: cx(List_default.text, className) });
|
|
23902
|
+
}
|
|
23903
|
+
ListItemText.displayName = "List.ItemText";
|
|
23904
|
+
function ListItemDescription({ className, ...rest }) {
|
|
23905
|
+
return /* @__PURE__ */ jsx68("span", { ...rest, className: cx(List_default.description, className) });
|
|
23906
|
+
}
|
|
23907
|
+
ListItemDescription.displayName = "List.ItemDescription";
|
|
23908
|
+
function ListItemMeta({ className, ...rest }) {
|
|
23909
|
+
return /* @__PURE__ */ jsx68("span", { ...rest, className: cx(List_default.meta, className) });
|
|
23910
|
+
}
|
|
23911
|
+
ListItemMeta.displayName = "List.ItemMeta";
|
|
23912
|
+
function ListItemCount({ color = "gray", className, ...rest }) {
|
|
23913
|
+
return /* @__PURE__ */ jsx68(Badge.Root, { ...rest, color, className: cx(List_default.count, className) });
|
|
23914
|
+
}
|
|
23915
|
+
ListItemCount.displayName = "List.ItemCount";
|
|
23916
|
+
var isPart = (node, type) => React78.isValidElement(node) && node.type === type;
|
|
23917
|
+
function spaced(nodes) {
|
|
23918
|
+
return nodes.flatMap((node, index) => index === 0 ? [node] : [" ", node]);
|
|
23919
|
+
}
|
|
23920
|
+
function splitItemChildren3(children) {
|
|
23921
|
+
let leading = null;
|
|
23922
|
+
const body = [];
|
|
23923
|
+
const trail = [];
|
|
23924
|
+
let loose = [];
|
|
23925
|
+
let twoLines = false;
|
|
23926
|
+
const flushLoose = () => {
|
|
23927
|
+
if (loose.length === 0) return;
|
|
23928
|
+
body.push(
|
|
23929
|
+
/* @__PURE__ */ jsx68("span", { className: List_default.text, children: loose }, `text-${body.length}`)
|
|
23930
|
+
);
|
|
23931
|
+
loose = [];
|
|
23932
|
+
};
|
|
23933
|
+
for (const node of React78.Children.toArray(children)) {
|
|
23934
|
+
if (isPart(node, ListItemIcon)) {
|
|
23935
|
+
if (leading === null && body.length === 0 && loose.length === 0) leading = node;
|
|
23936
|
+
else
|
|
23937
|
+
trail.push(
|
|
23938
|
+
React78.cloneElement(node, {
|
|
23939
|
+
"data-edge": "end"
|
|
23940
|
+
})
|
|
23941
|
+
);
|
|
23942
|
+
} else if (isPart(node, ListItemMeta) || isPart(node, ListItemCount)) {
|
|
23943
|
+
trail.push(node);
|
|
23944
|
+
} else if (isPart(node, ListItemText) || isPart(node, ListItemDescription)) {
|
|
23945
|
+
flushLoose();
|
|
23946
|
+
if (isPart(node, ListItemDescription)) twoLines = true;
|
|
23947
|
+
body.push(node);
|
|
23948
|
+
} else {
|
|
23949
|
+
loose.push(node);
|
|
23950
|
+
}
|
|
23951
|
+
}
|
|
23952
|
+
flushLoose();
|
|
23953
|
+
return /* @__PURE__ */ jsxs57(Fragment29, { children: [
|
|
23954
|
+
leading,
|
|
23955
|
+
/* @__PURE__ */ jsx68("span", { className: List_default.body, children: spaced(body) }),
|
|
23956
|
+
trail.length > 0 ? /* @__PURE__ */ jsxs57(Fragment29, { children: [
|
|
23957
|
+
" ",
|
|
23958
|
+
/* @__PURE__ */ jsx68("span", { className: cx(List_default.trail, twoLines && List_default.trailStacked), children: spaced(trail) })
|
|
23959
|
+
] }) : null
|
|
23960
|
+
] });
|
|
23961
|
+
}
|
|
23962
|
+
function ListItem({
|
|
23963
|
+
current = false,
|
|
23964
|
+
disabled = false,
|
|
23965
|
+
asChild = false,
|
|
23966
|
+
href,
|
|
23967
|
+
className,
|
|
23968
|
+
children,
|
|
23969
|
+
onClick,
|
|
23970
|
+
type,
|
|
23971
|
+
ref,
|
|
23972
|
+
...rest
|
|
23973
|
+
}) {
|
|
23974
|
+
const link = href !== void 0 || asChild;
|
|
23975
|
+
const shared = {
|
|
23976
|
+
...rest,
|
|
23977
|
+
className: cx(List_default.item, className),
|
|
23978
|
+
onClick: (event) => {
|
|
23979
|
+
if (disabled) {
|
|
23980
|
+
event.preventDefault();
|
|
23981
|
+
return;
|
|
23982
|
+
}
|
|
23983
|
+
onClick?.(event);
|
|
23984
|
+
},
|
|
23985
|
+
"aria-current": current ? link ? "page" : "true" : rest["aria-current"],
|
|
23986
|
+
...toDataAttributes({ disabled: disabled || void 0 })
|
|
23987
|
+
};
|
|
23988
|
+
const child = asChild && React78.isValidElement(children) ? children : null;
|
|
23989
|
+
let element;
|
|
23990
|
+
if (child) {
|
|
23991
|
+
element = // A disabled child keeps its own `href` / `to`: out of the Tab order like the other kinds.
|
|
23992
|
+
/* @__PURE__ */ jsx68(
|
|
23993
|
+
Slot,
|
|
23994
|
+
{
|
|
23995
|
+
...shared,
|
|
23996
|
+
ref,
|
|
23997
|
+
"aria-disabled": disabled || void 0,
|
|
23998
|
+
tabIndex: disabled ? -1 : rest.tabIndex,
|
|
23999
|
+
children: React78.cloneElement(child, void 0, splitItemChildren3(child.props.children))
|
|
24000
|
+
}
|
|
24001
|
+
);
|
|
24002
|
+
} else if (href !== void 0) {
|
|
24003
|
+
element = /* @__PURE__ */ jsx68(
|
|
24004
|
+
"a",
|
|
24005
|
+
{
|
|
24006
|
+
...shared,
|
|
24007
|
+
ref,
|
|
24008
|
+
href: disabled ? void 0 : href,
|
|
24009
|
+
"aria-disabled": disabled || void 0,
|
|
24010
|
+
children: splitItemChildren3(children)
|
|
24011
|
+
}
|
|
24012
|
+
);
|
|
24013
|
+
} else {
|
|
24014
|
+
element = /* @__PURE__ */ jsx68(
|
|
24015
|
+
"button",
|
|
24016
|
+
{
|
|
24017
|
+
...shared,
|
|
24018
|
+
ref,
|
|
24019
|
+
type: type ?? "button",
|
|
24020
|
+
disabled,
|
|
24021
|
+
children: splitItemChildren3(children)
|
|
24022
|
+
}
|
|
24023
|
+
);
|
|
24024
|
+
}
|
|
24025
|
+
return /* @__PURE__ */ jsx68("li", { className: List_default.row, children: element });
|
|
24026
|
+
}
|
|
24027
|
+
ListItem.displayName = "List.Item";
|
|
24028
|
+
var List = {
|
|
24029
|
+
Root: ListRoot,
|
|
24030
|
+
Item: ListItem,
|
|
24031
|
+
ItemIcon: ListItemIcon,
|
|
24032
|
+
ItemText: ListItemText,
|
|
24033
|
+
ItemDescription: ListItemDescription,
|
|
24034
|
+
ItemMeta: ListItemMeta,
|
|
24035
|
+
ItemCount: ListItemCount
|
|
24036
|
+
};
|
|
24037
|
+
|
|
23872
24038
|
// src/components/typography/Typography.module.css
|
|
23873
24039
|
var Typography_default = {
|
|
23874
24040
|
root: "Typography_root"
|
|
23875
24041
|
};
|
|
23876
24042
|
|
|
23877
24043
|
// src/components/typography/Typography.tsx
|
|
23878
|
-
import { jsx as
|
|
24044
|
+
import { jsx as jsx69 } from "react/jsx-runtime";
|
|
23879
24045
|
var ROLE_CLASS = {
|
|
23880
24046
|
caption: textRole_default.caption,
|
|
23881
24047
|
"body-s": textRole_default.bodyS,
|
|
@@ -23905,7 +24071,7 @@ function Typography({
|
|
|
23905
24071
|
ref,
|
|
23906
24072
|
...rest
|
|
23907
24073
|
}) {
|
|
23908
|
-
return /* @__PURE__ */
|
|
24074
|
+
return /* @__PURE__ */ jsx69(
|
|
23909
24075
|
Tag,
|
|
23910
24076
|
{
|
|
23911
24077
|
ref,
|
|
@@ -23938,7 +24104,7 @@ var LoginForm_default = {
|
|
|
23938
24104
|
};
|
|
23939
24105
|
|
|
23940
24106
|
// src/components/login-form/LoginForm.tsx
|
|
23941
|
-
import { jsx as
|
|
24107
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
23942
24108
|
var TITLE_ROLE = {
|
|
23943
24109
|
xs: "title-s",
|
|
23944
24110
|
s: "title-m",
|
|
@@ -23971,7 +24137,7 @@ function LoginFormRoot({
|
|
|
23971
24137
|
...rest
|
|
23972
24138
|
}) {
|
|
23973
24139
|
const depth = useNestedSurfaceDepth();
|
|
23974
|
-
return /* @__PURE__ */
|
|
24140
|
+
return /* @__PURE__ */ jsx70(
|
|
23975
24141
|
"div",
|
|
23976
24142
|
{
|
|
23977
24143
|
ref,
|
|
@@ -23979,22 +24145,22 @@ function LoginFormRoot({
|
|
|
23979
24145
|
className: cx(LoginForm_default.root, className),
|
|
23980
24146
|
"data-depth": depth,
|
|
23981
24147
|
...toDataAttributes({ size, align, flat }),
|
|
23982
|
-
children: /* @__PURE__ */
|
|
24148
|
+
children: /* @__PURE__ */ jsx70(SurfaceDepthProvider, { value: depth, children: /* @__PURE__ */ jsx70(ControlSizeProvider, { value: size, children }) })
|
|
23983
24149
|
}
|
|
23984
24150
|
);
|
|
23985
24151
|
}
|
|
23986
24152
|
LoginFormRoot.displayName = "LoginForm.Root";
|
|
23987
24153
|
function LoginFormHeader({ className, children, ...rest }) {
|
|
23988
|
-
return /* @__PURE__ */
|
|
24154
|
+
return /* @__PURE__ */ jsx70("header", { className: cx(LoginForm_default.header, className), ...rest, children });
|
|
23989
24155
|
}
|
|
23990
24156
|
LoginFormHeader.displayName = "LoginForm.Header";
|
|
23991
24157
|
function LoginFormLogo({ className, children, ...rest }) {
|
|
23992
|
-
return /* @__PURE__ */
|
|
24158
|
+
return /* @__PURE__ */ jsx70("div", { className: cx(LoginForm_default.logo, className), ...rest, children });
|
|
23993
24159
|
}
|
|
23994
24160
|
LoginFormLogo.displayName = "LoginForm.Logo";
|
|
23995
24161
|
function LoginFormTitle({ as = "h1", className, children, ...rest }) {
|
|
23996
24162
|
const size = useLoginFormSize();
|
|
23997
|
-
return /* @__PURE__ */
|
|
24163
|
+
return /* @__PURE__ */ jsx70(
|
|
23998
24164
|
Typography,
|
|
23999
24165
|
{
|
|
24000
24166
|
as,
|
|
@@ -24008,7 +24174,7 @@ function LoginFormTitle({ as = "h1", className, children, ...rest }) {
|
|
|
24008
24174
|
LoginFormTitle.displayName = "LoginForm.Title";
|
|
24009
24175
|
function LoginFormDescription({ className, children, ...rest }) {
|
|
24010
24176
|
const size = useLoginFormSize();
|
|
24011
|
-
return /* @__PURE__ */
|
|
24177
|
+
return /* @__PURE__ */ jsx70(
|
|
24012
24178
|
Typography,
|
|
24013
24179
|
{
|
|
24014
24180
|
as: "p",
|
|
@@ -24022,20 +24188,20 @@ function LoginFormDescription({ className, children, ...rest }) {
|
|
|
24022
24188
|
}
|
|
24023
24189
|
LoginFormDescription.displayName = "LoginForm.Description";
|
|
24024
24190
|
function LoginFormBody({ className, children, ...rest }) {
|
|
24025
|
-
return /* @__PURE__ */
|
|
24191
|
+
return /* @__PURE__ */ jsx70("div", { className: cx(LoginForm_default.body, className), ...rest, children });
|
|
24026
24192
|
}
|
|
24027
24193
|
LoginFormBody.displayName = "LoginForm.Body";
|
|
24028
24194
|
function LoginFormForm({ className, children, ref, ...rest }) {
|
|
24029
|
-
return /* @__PURE__ */
|
|
24195
|
+
return /* @__PURE__ */ jsx70("form", { ref, className: cx(LoginForm_default.form, className), ...rest, children });
|
|
24030
24196
|
}
|
|
24031
24197
|
LoginFormForm.displayName = "LoginForm.Form";
|
|
24032
24198
|
function LoginFormActions({ className, children, ...rest }) {
|
|
24033
|
-
return /* @__PURE__ */
|
|
24199
|
+
return /* @__PURE__ */ jsx70("div", { className: cx(LoginForm_default.actions, className), ...rest, children });
|
|
24034
24200
|
}
|
|
24035
24201
|
LoginFormActions.displayName = "LoginForm.Actions";
|
|
24036
24202
|
function LoginFormFooter({ className, children, ...rest }) {
|
|
24037
24203
|
const size = useLoginFormSize();
|
|
24038
|
-
return /* @__PURE__ */
|
|
24204
|
+
return /* @__PURE__ */ jsx70(
|
|
24039
24205
|
Typography,
|
|
24040
24206
|
{
|
|
24041
24207
|
as: "p",
|
|
@@ -24069,7 +24235,7 @@ var NativeSelect_default = {
|
|
|
24069
24235
|
};
|
|
24070
24236
|
|
|
24071
24237
|
// src/components/native-select/NativeSelect.tsx
|
|
24072
|
-
import { jsx as
|
|
24238
|
+
import { jsx as jsx71, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
24073
24239
|
var NATIVE_SELECT_LABELS = { optional: "\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E" };
|
|
24074
24240
|
function NativeSelect({
|
|
24075
24241
|
size = "m",
|
|
@@ -24097,7 +24263,7 @@ function NativeSelect({
|
|
|
24097
24263
|
const labels = { ...NATIVE_SELECT_LABELS, ...labelsProp };
|
|
24098
24264
|
const ids = useFieldFrame(id, { hint, error, invalid }, ariaDescribedBy);
|
|
24099
24265
|
const initial = defaultValue ?? (value === void 0 && placeholder ? "" : void 0);
|
|
24100
|
-
return /* @__PURE__ */
|
|
24266
|
+
return /* @__PURE__ */ jsx71(
|
|
24101
24267
|
FieldFrame,
|
|
24102
24268
|
{
|
|
24103
24269
|
size,
|
|
@@ -24110,8 +24276,8 @@ function NativeSelect({
|
|
|
24110
24276
|
disabled,
|
|
24111
24277
|
optionalLabel: labels.optional,
|
|
24112
24278
|
className,
|
|
24113
|
-
children: /* @__PURE__ */
|
|
24114
|
-
/* @__PURE__ */
|
|
24279
|
+
children: /* @__PURE__ */ jsx71(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsxs58("span", { className: cx(fieldTierClass, NativeSelect_default.root), ...toDataAttributes({ size }), children: [
|
|
24280
|
+
/* @__PURE__ */ jsxs58(
|
|
24115
24281
|
"select",
|
|
24116
24282
|
{
|
|
24117
24283
|
...rest,
|
|
@@ -24133,12 +24299,12 @@ function NativeSelect({
|
|
|
24133
24299
|
"focus-ring": focusRing ? void 0 : false
|
|
24134
24300
|
}),
|
|
24135
24301
|
children: [
|
|
24136
|
-
placeholder ? /* @__PURE__ */
|
|
24302
|
+
placeholder ? /* @__PURE__ */ jsx71("option", { value: "", className: NativeSelect_default.placeholder, children: placeholder }) : null,
|
|
24137
24303
|
children
|
|
24138
24304
|
]
|
|
24139
24305
|
}
|
|
24140
24306
|
),
|
|
24141
|
-
/* @__PURE__ */
|
|
24307
|
+
/* @__PURE__ */ jsx71("span", { className: NativeSelect_default.chevron, "aria-hidden": "true", children: /* @__PURE__ */ jsx71(Icon, { name: "nav.chevronDown" }) })
|
|
24142
24308
|
] }) })
|
|
24143
24309
|
}
|
|
24144
24310
|
);
|
|
@@ -24146,7 +24312,7 @@ function NativeSelect({
|
|
|
24146
24312
|
NativeSelect.displayName = "NativeSelect";
|
|
24147
24313
|
|
|
24148
24314
|
// src/components/notification/Notification.tsx
|
|
24149
|
-
import * as
|
|
24315
|
+
import * as React79 from "react";
|
|
24150
24316
|
|
|
24151
24317
|
// src/components/notification/Notification.module.css
|
|
24152
24318
|
var Notification_default = {
|
|
@@ -24174,7 +24340,7 @@ var Notification_default = {
|
|
|
24174
24340
|
};
|
|
24175
24341
|
|
|
24176
24342
|
// src/components/notification/Notification.tsx
|
|
24177
|
-
import { jsx as
|
|
24343
|
+
import { jsx as jsx72, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
24178
24344
|
var NOTIFICATION_LABELS = {
|
|
24179
24345
|
close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0435",
|
|
24180
24346
|
regionTopLeft: "\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F \u0441\u0432\u0435\u0440\u0445\u0443 \u0441\u043B\u0435\u0432\u0430",
|
|
@@ -24192,7 +24358,7 @@ var REGION_LABEL_KEY = {
|
|
|
24192
24358
|
"bottom-center": "regionBottomCenter",
|
|
24193
24359
|
"bottom-right": "regionBottomRight"
|
|
24194
24360
|
};
|
|
24195
|
-
var NotificationLabelsContext =
|
|
24361
|
+
var NotificationLabelsContext = React79.createContext(NOTIFICATION_LABELS);
|
|
24196
24362
|
var TONE_ICON = {
|
|
24197
24363
|
info: "status.info",
|
|
24198
24364
|
success: "status.success",
|
|
@@ -24220,9 +24386,9 @@ function CardView({
|
|
|
24220
24386
|
stackExpanded = false,
|
|
24221
24387
|
...rest
|
|
24222
24388
|
}) {
|
|
24223
|
-
const labels =
|
|
24389
|
+
const labels = React79.useContext(NotificationLabelsContext);
|
|
24224
24390
|
const liveRole = tone === "danger" || tone === "warning" ? "alert" : "status";
|
|
24225
|
-
return /* @__PURE__ */
|
|
24391
|
+
return /* @__PURE__ */ jsxs59(
|
|
24226
24392
|
"article",
|
|
24227
24393
|
{
|
|
24228
24394
|
...rest,
|
|
@@ -24238,14 +24404,14 @@ function CardView({
|
|
|
24238
24404
|
"stack-expanded": stackExpanded
|
|
24239
24405
|
}),
|
|
24240
24406
|
children: [
|
|
24241
|
-
/* @__PURE__ */
|
|
24242
|
-
/* @__PURE__ */
|
|
24243
|
-
/* @__PURE__ */
|
|
24244
|
-
/* @__PURE__ */
|
|
24245
|
-
badge !== void 0 ? /* @__PURE__ */
|
|
24407
|
+
/* @__PURE__ */ jsx72("div", { className: Notification_default.iconWrap, "aria-hidden": "true", children: icon ?? /* @__PURE__ */ jsx72(Icon, { name: TONE_ICON[tone] }) }),
|
|
24408
|
+
/* @__PURE__ */ jsxs59("div", { className: Notification_default.content, children: [
|
|
24409
|
+
/* @__PURE__ */ jsxs59("header", { className: Notification_default.header, children: [
|
|
24410
|
+
/* @__PURE__ */ jsx72("p", { className: Notification_default.title, children: title }),
|
|
24411
|
+
badge !== void 0 ? /* @__PURE__ */ jsx72(Badge.Root, { size: "xs", color: TONE_BADGE_COLOR[tone], children: badge }) : null
|
|
24246
24412
|
] }),
|
|
24247
|
-
description ? /* @__PURE__ */
|
|
24248
|
-
action ? /* @__PURE__ */
|
|
24413
|
+
description ? /* @__PURE__ */ jsx72("p", { className: Notification_default.description, children: description }) : null,
|
|
24414
|
+
action ? /* @__PURE__ */ jsx72("div", { className: Notification_default.actionRow, children: /* @__PURE__ */ jsx72(
|
|
24249
24415
|
Button.Root,
|
|
24250
24416
|
{
|
|
24251
24417
|
variant: "soft",
|
|
@@ -24256,7 +24422,7 @@ function CardView({
|
|
|
24256
24422
|
}
|
|
24257
24423
|
) }) : null
|
|
24258
24424
|
] }),
|
|
24259
|
-
onClose ? /* @__PURE__ */
|
|
24425
|
+
onClose ? /* @__PURE__ */ jsx72("div", { className: Notification_default.closeWrap, children: /* @__PURE__ */ jsx72(
|
|
24260
24426
|
Button.Root,
|
|
24261
24427
|
{
|
|
24262
24428
|
variant: "ghost",
|
|
@@ -24264,10 +24430,10 @@ function CardView({
|
|
|
24264
24430
|
size: stepDown(size, 2),
|
|
24265
24431
|
"aria-label": labels.close,
|
|
24266
24432
|
onClick: onClose,
|
|
24267
|
-
children: /* @__PURE__ */
|
|
24433
|
+
children: /* @__PURE__ */ jsx72(Button.Icon, { children: /* @__PURE__ */ jsx72(Icon, { name: "action.close" }) })
|
|
24268
24434
|
}
|
|
24269
24435
|
) }) : null,
|
|
24270
|
-
countdown ? /* @__PURE__ */
|
|
24436
|
+
countdown ? /* @__PURE__ */ jsx72("div", { className: Notification_default.progressTrack, "aria-hidden": "true", children: /* @__PURE__ */ jsx72(
|
|
24271
24437
|
"span",
|
|
24272
24438
|
{
|
|
24273
24439
|
className: Notification_default.progressValue,
|
|
@@ -24285,14 +24451,14 @@ function CardView({
|
|
|
24285
24451
|
);
|
|
24286
24452
|
}
|
|
24287
24453
|
function NotificationCard({ onDismiss, ...props }) {
|
|
24288
|
-
return /* @__PURE__ */
|
|
24454
|
+
return /* @__PURE__ */ jsx72(CardView, { ...props, onClose: onDismiss });
|
|
24289
24455
|
}
|
|
24290
24456
|
function subscribeVisibility(listener) {
|
|
24291
24457
|
document.addEventListener("visibilitychange", listener);
|
|
24292
24458
|
return () => document.removeEventListener("visibilitychange", listener);
|
|
24293
24459
|
}
|
|
24294
24460
|
function useDocumentHidden() {
|
|
24295
|
-
return
|
|
24461
|
+
return React79.useSyncExternalStore(
|
|
24296
24462
|
subscribeVisibility,
|
|
24297
24463
|
() => document.visibilityState === "hidden",
|
|
24298
24464
|
() => false
|
|
@@ -24301,7 +24467,7 @@ function useDocumentHidden() {
|
|
|
24301
24467
|
function ToastCard({ item, paused, onDismiss, stackDepth, stackExpanded }) {
|
|
24302
24468
|
const hidden = useDocumentHidden();
|
|
24303
24469
|
const timed = !item.persistent && item.duration > 0;
|
|
24304
|
-
return /* @__PURE__ */
|
|
24470
|
+
return /* @__PURE__ */ jsx72(
|
|
24305
24471
|
CardView,
|
|
24306
24472
|
{
|
|
24307
24473
|
tone: item.tone,
|
|
@@ -24320,8 +24486,8 @@ function ToastCard({ item, paused, onDismiss, stackDepth, stackExpanded }) {
|
|
|
24320
24486
|
}
|
|
24321
24487
|
|
|
24322
24488
|
// src/components/notification/NotificationStore.tsx
|
|
24323
|
-
import * as
|
|
24324
|
-
import { jsx as
|
|
24489
|
+
import * as React80 from "react";
|
|
24490
|
+
import { jsx as jsx73, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
24325
24491
|
var DEFAULT_DURATION = 5e3;
|
|
24326
24492
|
var PEEK_VISIBLE = 3;
|
|
24327
24493
|
var SCALE_STEP = 0.05;
|
|
@@ -24353,7 +24519,7 @@ var POSITIONS = [
|
|
|
24353
24519
|
"bottom-right"
|
|
24354
24520
|
];
|
|
24355
24521
|
var TONES = ["success", "danger", "warning", "info"];
|
|
24356
|
-
var StoreContext =
|
|
24522
|
+
var StoreContext = React80.createContext(null);
|
|
24357
24523
|
function newId() {
|
|
24358
24524
|
return globalThis.crypto?.randomUUID?.() ?? `ntf-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
24359
24525
|
}
|
|
@@ -24367,17 +24533,17 @@ function NotificationStack({
|
|
|
24367
24533
|
onDismiss,
|
|
24368
24534
|
onExited
|
|
24369
24535
|
}) {
|
|
24370
|
-
const labels =
|
|
24371
|
-
const [expanded, setExpanded] =
|
|
24372
|
-
const [heights, setHeights] =
|
|
24373
|
-
const collapseTimerRef =
|
|
24374
|
-
const lastLayoutRef =
|
|
24375
|
-
const listRef =
|
|
24376
|
-
const hoveredRef =
|
|
24377
|
-
const focusedRef =
|
|
24536
|
+
const labels = React80.useContext(NotificationLabelsContext);
|
|
24537
|
+
const [expanded, setExpanded] = React80.useState(false);
|
|
24538
|
+
const [heights, setHeights] = React80.useState({});
|
|
24539
|
+
const collapseTimerRef = React80.useRef(null);
|
|
24540
|
+
const lastLayoutRef = React80.useRef(/* @__PURE__ */ new Map());
|
|
24541
|
+
const listRef = React80.useRef(null);
|
|
24542
|
+
const hoveredRef = React80.useRef(false);
|
|
24543
|
+
const focusedRef = React80.useRef(false);
|
|
24378
24544
|
const top = isTop(position);
|
|
24379
|
-
const step =
|
|
24380
|
-
const syncExpanded =
|
|
24545
|
+
const step = React80.useMemo(space2Px, []);
|
|
24546
|
+
const syncExpanded = React80.useCallback(() => {
|
|
24381
24547
|
if (collapseTimerRef.current !== null) {
|
|
24382
24548
|
clearTimeout(collapseTimerRef.current);
|
|
24383
24549
|
collapseTimerRef.current = null;
|
|
@@ -24388,29 +24554,29 @@ function NotificationStack({
|
|
|
24388
24554
|
collapseTimerRef.current = window.setTimeout(() => setExpanded(false), COLLAPSE_DELAY_MS);
|
|
24389
24555
|
}
|
|
24390
24556
|
}, []);
|
|
24391
|
-
const handleHover =
|
|
24557
|
+
const handleHover = React80.useCallback(
|
|
24392
24558
|
(hovered) => {
|
|
24393
24559
|
hoveredRef.current = hovered;
|
|
24394
24560
|
syncExpanded();
|
|
24395
24561
|
},
|
|
24396
24562
|
[syncExpanded]
|
|
24397
24563
|
);
|
|
24398
|
-
|
|
24564
|
+
React80.useLayoutEffect(() => {
|
|
24399
24565
|
if (!focusedRef.current) return;
|
|
24400
24566
|
if (listRef.current?.contains(document.activeElement)) return;
|
|
24401
24567
|
focusedRef.current = false;
|
|
24402
24568
|
syncExpanded();
|
|
24403
24569
|
});
|
|
24404
|
-
|
|
24570
|
+
React80.useEffect(
|
|
24405
24571
|
() => () => {
|
|
24406
24572
|
if (collapseTimerRef.current !== null) clearTimeout(collapseTimerRef.current);
|
|
24407
24573
|
},
|
|
24408
24574
|
[]
|
|
24409
24575
|
);
|
|
24410
|
-
const reportHeight =
|
|
24576
|
+
const reportHeight = React80.useCallback((id, height) => {
|
|
24411
24577
|
setHeights((prev) => prev[id] === height ? prev : { ...prev, [id]: height });
|
|
24412
24578
|
}, []);
|
|
24413
|
-
|
|
24579
|
+
React80.useEffect(() => {
|
|
24414
24580
|
setHeights((prev) => {
|
|
24415
24581
|
const ids = new Set(items.map((n) => n.id));
|
|
24416
24582
|
const stale = Object.keys(prev).filter((id) => !ids.has(id));
|
|
@@ -24437,14 +24603,14 @@ function NotificationStack({
|
|
|
24437
24603
|
});
|
|
24438
24604
|
const frontHeight = active.length > 0 ? heights[active[0].id] ?? 0 : 0;
|
|
24439
24605
|
const stackHeight = active.length === 0 ? 0 : expanded ? flowHeight - step : frontHeight + Math.min(active.length - 1, PEEK_VISIBLE - 1) * step;
|
|
24440
|
-
|
|
24606
|
+
React80.useLayoutEffect(() => {
|
|
24441
24607
|
for (const [id, layout] of layouts) lastLayoutRef.current.set(id, layout);
|
|
24442
24608
|
const ids = new Set(items.map((n) => n.id));
|
|
24443
24609
|
for (const id of lastLayoutRef.current.keys()) {
|
|
24444
24610
|
if (!ids.has(id)) lastLayoutRef.current.delete(id);
|
|
24445
24611
|
}
|
|
24446
24612
|
});
|
|
24447
|
-
return /* @__PURE__ */
|
|
24613
|
+
return /* @__PURE__ */ jsx73(
|
|
24448
24614
|
"ol",
|
|
24449
24615
|
{
|
|
24450
24616
|
ref: listRef,
|
|
@@ -24466,7 +24632,7 @@ function NotificationStack({
|
|
|
24466
24632
|
children: items.map((item) => {
|
|
24467
24633
|
const closing = item.dismissing === true;
|
|
24468
24634
|
const layout = layouts.get(item.id) ?? lastLayoutRef.current.get(item.id) ?? RESTING_LAYOUT;
|
|
24469
|
-
return /* @__PURE__ */
|
|
24635
|
+
return /* @__PURE__ */ jsx73(
|
|
24470
24636
|
NotificationStackItem,
|
|
24471
24637
|
{
|
|
24472
24638
|
item,
|
|
@@ -24488,7 +24654,7 @@ function NotificationStack({
|
|
|
24488
24654
|
}
|
|
24489
24655
|
);
|
|
24490
24656
|
}
|
|
24491
|
-
var NotificationStackItem =
|
|
24657
|
+
var NotificationStackItem = React80.memo(function NotificationStackItem2({
|
|
24492
24658
|
item,
|
|
24493
24659
|
position,
|
|
24494
24660
|
index,
|
|
@@ -24502,9 +24668,9 @@ var NotificationStackItem = React79.memo(function NotificationStackItem2({
|
|
|
24502
24668
|
onExited,
|
|
24503
24669
|
onHeight
|
|
24504
24670
|
}) {
|
|
24505
|
-
const ref =
|
|
24671
|
+
const ref = React80.useRef(null);
|
|
24506
24672
|
const { id } = item;
|
|
24507
|
-
|
|
24673
|
+
React80.useLayoutEffect(() => {
|
|
24508
24674
|
const el = ref.current;
|
|
24509
24675
|
if (!el) return;
|
|
24510
24676
|
onHeight(id, el.offsetHeight);
|
|
@@ -24515,10 +24681,10 @@ var NotificationStackItem = React79.memo(function NotificationStackItem2({
|
|
|
24515
24681
|
}, [id, onHeight]);
|
|
24516
24682
|
const state = closing ? "closed" : "open";
|
|
24517
24683
|
const { axis, sign } = swipeDirection(position);
|
|
24518
|
-
const dragRef =
|
|
24684
|
+
const dragRef = React80.useRef(
|
|
24519
24685
|
null
|
|
24520
24686
|
);
|
|
24521
|
-
const [swiping, setSwiping] =
|
|
24687
|
+
const [swiping, setSwiping] = React80.useState(false);
|
|
24522
24688
|
const swipeAmount = (client, origin) => {
|
|
24523
24689
|
const toward = (client - origin) * sign;
|
|
24524
24690
|
if (toward >= 0) return toward;
|
|
@@ -24569,7 +24735,7 @@ var NotificationStackItem = React79.memo(function NotificationStackItem2({
|
|
|
24569
24735
|
if (amount === 0 || prefersReducedMotion()) delete el.dataset.swipe;
|
|
24570
24736
|
else el.dataset.swipe = "return";
|
|
24571
24737
|
};
|
|
24572
|
-
return /* @__PURE__ */
|
|
24738
|
+
return /* @__PURE__ */ jsx73(
|
|
24573
24739
|
"li",
|
|
24574
24740
|
{
|
|
24575
24741
|
ref,
|
|
@@ -24583,7 +24749,7 @@ var NotificationStackItem = React79.memo(function NotificationStackItem2({
|
|
|
24583
24749
|
"--ntf-opacity": opacity,
|
|
24584
24750
|
zIndex: Z_FRONT - index
|
|
24585
24751
|
},
|
|
24586
|
-
children: /* @__PURE__ */
|
|
24752
|
+
children: /* @__PURE__ */ jsx73(
|
|
24587
24753
|
"div",
|
|
24588
24754
|
{
|
|
24589
24755
|
className: Notification_default.motion,
|
|
@@ -24600,7 +24766,7 @@ var NotificationStackItem = React79.memo(function NotificationStackItem2({
|
|
|
24600
24766
|
delete event.currentTarget.dataset.swipe;
|
|
24601
24767
|
}
|
|
24602
24768
|
},
|
|
24603
|
-
children: /* @__PURE__ */
|
|
24769
|
+
children: /* @__PURE__ */ jsx73(
|
|
24604
24770
|
ToastCard,
|
|
24605
24771
|
{
|
|
24606
24772
|
item,
|
|
@@ -24620,7 +24786,7 @@ function NotificationToaster({
|
|
|
24620
24786
|
onDismiss,
|
|
24621
24787
|
onExited
|
|
24622
24788
|
}) {
|
|
24623
|
-
const grouped =
|
|
24789
|
+
const grouped = React80.useMemo(() => {
|
|
24624
24790
|
const map = /* @__PURE__ */ new Map();
|
|
24625
24791
|
for (const entry of entries) {
|
|
24626
24792
|
if (!map.has(entry.position)) map.set(entry.position, /* @__PURE__ */ new Map());
|
|
@@ -24636,18 +24802,18 @@ function NotificationToaster({
|
|
|
24636
24802
|
}
|
|
24637
24803
|
return map;
|
|
24638
24804
|
}, [entries]);
|
|
24639
|
-
return /* @__PURE__ */
|
|
24805
|
+
return /* @__PURE__ */ jsx73(Portal, { children: /* @__PURE__ */ jsx73("div", { className: Notification_default.viewport, ...{ [LIVE_REGION_ATTR]: "" }, children: POSITIONS.map((pos) => {
|
|
24640
24806
|
const byTone = grouped.get(pos);
|
|
24641
24807
|
if (!byTone?.size) return null;
|
|
24642
24808
|
const [vertical, horizontal] = pos.split("-");
|
|
24643
24809
|
const stacks = TONES.map((tone) => ({ tone, items: byTone.get(tone) ?? [] })).filter(
|
|
24644
24810
|
(s) => s.items.length > 0
|
|
24645
24811
|
);
|
|
24646
|
-
return /* @__PURE__ */
|
|
24812
|
+
return /* @__PURE__ */ jsx73(
|
|
24647
24813
|
"section",
|
|
24648
24814
|
{
|
|
24649
24815
|
className: `${Notification_default.zone} ${Notification_default[vertical]} ${Notification_default[horizontal]}`,
|
|
24650
|
-
children: stacks.map((s) => /* @__PURE__ */
|
|
24816
|
+
children: stacks.map((s) => /* @__PURE__ */ jsx73(
|
|
24651
24817
|
NotificationStack,
|
|
24652
24818
|
{
|
|
24653
24819
|
position: pos,
|
|
@@ -24668,22 +24834,22 @@ function NotificationProvider({
|
|
|
24668
24834
|
max = 5,
|
|
24669
24835
|
labels: labelsProp
|
|
24670
24836
|
}) {
|
|
24671
|
-
const labels =
|
|
24837
|
+
const labels = React80.useMemo(
|
|
24672
24838
|
() => ({ ...NOTIFICATION_LABELS, ...labelsProp }),
|
|
24673
24839
|
[labelsProp]
|
|
24674
24840
|
);
|
|
24675
|
-
const [entries, setEntries] =
|
|
24676
|
-
const entriesRef =
|
|
24841
|
+
const [entries, setEntries] = React80.useState([]);
|
|
24842
|
+
const entriesRef = React80.useRef(entries);
|
|
24677
24843
|
entriesRef.current = entries;
|
|
24678
|
-
const exitTimersRef =
|
|
24679
|
-
|
|
24844
|
+
const exitTimersRef = React80.useRef(/* @__PURE__ */ new Map());
|
|
24845
|
+
React80.useEffect(() => {
|
|
24680
24846
|
const timers = exitTimersRef.current;
|
|
24681
24847
|
return () => {
|
|
24682
24848
|
for (const timer of timers.values()) clearTimeout(timer);
|
|
24683
24849
|
timers.clear();
|
|
24684
24850
|
};
|
|
24685
24851
|
}, []);
|
|
24686
|
-
const remove =
|
|
24852
|
+
const remove = React80.useCallback((id) => {
|
|
24687
24853
|
const timer = exitTimersRef.current.get(id);
|
|
24688
24854
|
if (timer !== void 0) {
|
|
24689
24855
|
clearTimeout(timer);
|
|
@@ -24691,14 +24857,14 @@ function NotificationProvider({
|
|
|
24691
24857
|
}
|
|
24692
24858
|
setEntries((prev) => prev.filter((n) => n.id !== id));
|
|
24693
24859
|
}, []);
|
|
24694
|
-
const announceLeave =
|
|
24860
|
+
const announceLeave = React80.useCallback((ids) => {
|
|
24695
24861
|
const target = new Set(ids);
|
|
24696
24862
|
for (const entry of entriesRef.current) {
|
|
24697
24863
|
if (!target.has(entry.id) || entry.dismissing) continue;
|
|
24698
24864
|
entry.onDismiss?.();
|
|
24699
24865
|
}
|
|
24700
24866
|
}, []);
|
|
24701
|
-
const startExit =
|
|
24867
|
+
const startExit = React80.useCallback(
|
|
24702
24868
|
(ids) => {
|
|
24703
24869
|
if (ids.length === 0) return;
|
|
24704
24870
|
announceLeave(ids);
|
|
@@ -24726,12 +24892,12 @@ function NotificationProvider({
|
|
|
24726
24892
|
},
|
|
24727
24893
|
[remove, announceLeave]
|
|
24728
24894
|
);
|
|
24729
|
-
const dismiss =
|
|
24730
|
-
const dismissAll =
|
|
24895
|
+
const dismiss = React80.useCallback((id) => startExit([id]), [startExit]);
|
|
24896
|
+
const dismissAll = React80.useCallback(
|
|
24731
24897
|
() => startExit(entriesRef.current.filter((n) => !n.dismissing).map((n) => n.id)),
|
|
24732
24898
|
[startExit]
|
|
24733
24899
|
);
|
|
24734
|
-
const notify =
|
|
24900
|
+
const notify = React80.useCallback(
|
|
24735
24901
|
(options) => {
|
|
24736
24902
|
const id = newId();
|
|
24737
24903
|
const record = {
|
|
@@ -24762,24 +24928,24 @@ function NotificationProvider({
|
|
|
24762
24928
|
},
|
|
24763
24929
|
[position, max, announceLeave]
|
|
24764
24930
|
);
|
|
24765
|
-
const publicItems =
|
|
24766
|
-
const value =
|
|
24931
|
+
const publicItems = React80.useMemo(() => entries.filter((n) => !n.dismissing), [entries]);
|
|
24932
|
+
const value = React80.useMemo(
|
|
24767
24933
|
() => ({ items: publicItems, notify, dismiss, dismissAll }),
|
|
24768
24934
|
[publicItems, notify, dismiss, dismissAll]
|
|
24769
24935
|
);
|
|
24770
|
-
return /* @__PURE__ */
|
|
24936
|
+
return /* @__PURE__ */ jsx73(StoreContext.Provider, { value, children: /* @__PURE__ */ jsxs60(NotificationLabelsContext.Provider, { value: labels, children: [
|
|
24771
24937
|
children,
|
|
24772
|
-
/* @__PURE__ */
|
|
24938
|
+
/* @__PURE__ */ jsx73(NotificationToaster, { entries, onDismiss: dismiss, onExited: remove })
|
|
24773
24939
|
] }) });
|
|
24774
24940
|
}
|
|
24775
24941
|
function useNotifications() {
|
|
24776
|
-
const ctx =
|
|
24942
|
+
const ctx = React80.useContext(StoreContext);
|
|
24777
24943
|
if (!ctx) throw new Error("useNotifications must be used within NotificationProvider");
|
|
24778
24944
|
return ctx;
|
|
24779
24945
|
}
|
|
24780
24946
|
|
|
24781
24947
|
// src/components/page-content/PageContent.tsx
|
|
24782
|
-
import * as
|
|
24948
|
+
import * as React81 from "react";
|
|
24783
24949
|
|
|
24784
24950
|
// src/components/page-content/PageContent.module.css
|
|
24785
24951
|
var PageContent_default = {
|
|
@@ -24801,14 +24967,14 @@ var PageContent_default = {
|
|
|
24801
24967
|
};
|
|
24802
24968
|
|
|
24803
24969
|
// src/components/page-content/PageContent.tsx
|
|
24804
|
-
import { jsx as
|
|
24970
|
+
import { jsx as jsx74, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
24805
24971
|
function PageContentRoot({
|
|
24806
24972
|
maxWidth = "full",
|
|
24807
24973
|
fill = false,
|
|
24808
24974
|
className,
|
|
24809
24975
|
...rest
|
|
24810
24976
|
}) {
|
|
24811
|
-
return /* @__PURE__ */
|
|
24977
|
+
return /* @__PURE__ */ jsx74(
|
|
24812
24978
|
"div",
|
|
24813
24979
|
{
|
|
24814
24980
|
className: cx(PageContent_default.root, className),
|
|
@@ -24822,25 +24988,25 @@ function PageContentRoot({
|
|
|
24822
24988
|
}
|
|
24823
24989
|
PageContentRoot.displayName = "PageContent.Root";
|
|
24824
24990
|
function PageContentSection({ className, ...rest }) {
|
|
24825
|
-
return /* @__PURE__ */
|
|
24991
|
+
return /* @__PURE__ */ jsx74("section", { className: cx(PageContent_default.section, className), ...rest });
|
|
24826
24992
|
}
|
|
24827
24993
|
PageContentSection.displayName = "PageContent.Section";
|
|
24828
24994
|
function PageContentActions({ className, ...rest }) {
|
|
24829
|
-
return /* @__PURE__ */
|
|
24995
|
+
return /* @__PURE__ */ jsx74("div", { className: cx(PageContent_default.actions, className), ...rest });
|
|
24830
24996
|
}
|
|
24831
24997
|
PageContentActions.displayName = "PageContent.Actions";
|
|
24832
24998
|
function PageContentHeader({ className, children, ...rest }) {
|
|
24833
|
-
const items =
|
|
24834
|
-
const isActions = (child) =>
|
|
24999
|
+
const items = React81.Children.toArray(children);
|
|
25000
|
+
const isActions = (child) => React81.isValidElement(child) && child.type === PageContentActions;
|
|
24835
25001
|
const actions = items.filter(isActions);
|
|
24836
|
-
return /* @__PURE__ */
|
|
25002
|
+
return /* @__PURE__ */ jsxs61(
|
|
24837
25003
|
"div",
|
|
24838
25004
|
{
|
|
24839
25005
|
className: cx(PageContent_default.header, className),
|
|
24840
25006
|
"data-has-actions": actions.length > 0 ? "true" : void 0,
|
|
24841
25007
|
...rest,
|
|
24842
25008
|
children: [
|
|
24843
|
-
/* @__PURE__ */
|
|
25009
|
+
/* @__PURE__ */ jsx74("div", { className: PageContent_default.heading, children: items.filter((child) => !isActions(child)) }),
|
|
24844
25010
|
actions
|
|
24845
25011
|
]
|
|
24846
25012
|
}
|
|
@@ -24848,7 +25014,7 @@ function PageContentHeader({ className, children, ...rest }) {
|
|
|
24848
25014
|
}
|
|
24849
25015
|
PageContentHeader.displayName = "PageContent.Header";
|
|
24850
25016
|
function PageContentTitle({ className, ...rest }) {
|
|
24851
|
-
return /* @__PURE__ */
|
|
25017
|
+
return /* @__PURE__ */ jsx74("h1", { className: cx(PageContent_default.title, className), ...rest });
|
|
24852
25018
|
}
|
|
24853
25019
|
PageContentTitle.displayName = "PageContent.Title";
|
|
24854
25020
|
function PageContentDescription({
|
|
@@ -24856,7 +25022,7 @@ function PageContentDescription({
|
|
|
24856
25022
|
measure: measure3 = "readable",
|
|
24857
25023
|
...rest
|
|
24858
25024
|
}) {
|
|
24859
|
-
return /* @__PURE__ */
|
|
25025
|
+
return /* @__PURE__ */ jsx74(
|
|
24860
25026
|
"p",
|
|
24861
25027
|
{
|
|
24862
25028
|
className: cx(PageContent_default.description, className),
|
|
@@ -24867,15 +25033,15 @@ function PageContentDescription({
|
|
|
24867
25033
|
}
|
|
24868
25034
|
PageContentDescription.displayName = "PageContent.Description";
|
|
24869
25035
|
function PageContentBody({ className, ...rest }) {
|
|
24870
|
-
return /* @__PURE__ */
|
|
25036
|
+
return /* @__PURE__ */ jsx74("div", { className: cx(PageContent_default.body, className), ...rest });
|
|
24871
25037
|
}
|
|
24872
25038
|
PageContentBody.displayName = "PageContent.Body";
|
|
24873
25039
|
var PAGE_CONTENT_LABELS = {
|
|
24874
25040
|
back: "\u041D\u0430\u0437\u0430\u0434 \u043A \u0441\u043F\u0438\u0441\u043A\u0443"
|
|
24875
25041
|
};
|
|
24876
|
-
var SplitContext =
|
|
25042
|
+
var SplitContext = React81.createContext(null);
|
|
24877
25043
|
function useSplit(part) {
|
|
24878
|
-
const value =
|
|
25044
|
+
const value = React81.useContext(SplitContext);
|
|
24879
25045
|
if (value === null) {
|
|
24880
25046
|
throw new Error(`[prime-ui-kit] \`${part}\` must be used inside \`PageContent.Split\`.`);
|
|
24881
25047
|
}
|
|
@@ -24896,13 +25062,13 @@ function PageContentSplit({
|
|
|
24896
25062
|
defaultValue: defaultOpen,
|
|
24897
25063
|
onChange: onOpenChange
|
|
24898
25064
|
});
|
|
24899
|
-
const listRef =
|
|
24900
|
-
const detailRef =
|
|
24901
|
-
const lastListFocus =
|
|
24902
|
-
const [entering, setEntering] =
|
|
24903
|
-
const previousOpen =
|
|
24904
|
-
const mergedLabels =
|
|
24905
|
-
|
|
25065
|
+
const listRef = React81.useRef(null);
|
|
25066
|
+
const detailRef = React81.useRef(null);
|
|
25067
|
+
const lastListFocus = React81.useRef(null);
|
|
25068
|
+
const [entering, setEntering] = React81.useState(null);
|
|
25069
|
+
const previousOpen = React81.useRef(open);
|
|
25070
|
+
const mergedLabels = React81.useMemo(() => ({ ...PAGE_CONTENT_LABELS, ...labels }), [labels]);
|
|
25071
|
+
React81.useLayoutEffect(() => {
|
|
24906
25072
|
if (previousOpen.current === open) return;
|
|
24907
25073
|
previousOpen.current = open;
|
|
24908
25074
|
const list = listRef.current;
|
|
@@ -24919,7 +25085,7 @@ function PageContentSplit({
|
|
|
24919
25085
|
});
|
|
24920
25086
|
}
|
|
24921
25087
|
}, [open]);
|
|
24922
|
-
const value =
|
|
25088
|
+
const value = React81.useMemo(
|
|
24923
25089
|
() => ({
|
|
24924
25090
|
open,
|
|
24925
25091
|
close: () => setOpen(false),
|
|
@@ -24932,13 +25098,13 @@ function PageContentSplit({
|
|
|
24932
25098
|
}),
|
|
24933
25099
|
[open, setOpen, mergedLabels, entering]
|
|
24934
25100
|
);
|
|
24935
|
-
return /* @__PURE__ */
|
|
25101
|
+
return /* @__PURE__ */ jsx74(SplitContext, { value, children: /* @__PURE__ */ jsx74(
|
|
24936
25102
|
"div",
|
|
24937
25103
|
{
|
|
24938
25104
|
...rest,
|
|
24939
25105
|
className: cx(PageContent_default.split, className),
|
|
24940
25106
|
...toDataAttributes({ open: open || void 0 }),
|
|
24941
|
-
children: /* @__PURE__ */
|
|
25107
|
+
children: /* @__PURE__ */ jsx74("div", { className: PageContent_default.panes, children })
|
|
24942
25108
|
}
|
|
24943
25109
|
) });
|
|
24944
25110
|
}
|
|
@@ -24954,7 +25120,7 @@ function PageContentList({
|
|
|
24954
25120
|
const mergedRef = useMergedRefs(split.listRef, ref);
|
|
24955
25121
|
return (
|
|
24956
25122
|
// biome-ignore lint/a11y/noStaticElementInteractions: the pane only records which list control had focus (focus bubbles from it), so going back can return there; it handles no input.
|
|
24957
|
-
/* @__PURE__ */
|
|
25123
|
+
/* @__PURE__ */ jsx74(
|
|
24958
25124
|
"div",
|
|
24959
25125
|
{
|
|
24960
25126
|
tabIndex: -1,
|
|
@@ -24982,7 +25148,7 @@ PageContentList.displayName = "PageContent.List";
|
|
|
24982
25148
|
function PageContentDetail({ className, ref, onAnimationEnd, ...rest }) {
|
|
24983
25149
|
const split = useSplit("PageContent.Detail");
|
|
24984
25150
|
const mergedRef = useMergedRefs(split.detailRef, ref);
|
|
24985
|
-
return /* @__PURE__ */
|
|
25151
|
+
return /* @__PURE__ */ jsx74(
|
|
24986
25152
|
"div",
|
|
24987
25153
|
{
|
|
24988
25154
|
tabIndex: -1,
|
|
@@ -25004,7 +25170,7 @@ function PageContentDetail({ className, ref, onAnimationEnd, ...rest }) {
|
|
|
25004
25170
|
PageContentDetail.displayName = "PageContent.Detail";
|
|
25005
25171
|
function PageContentBackButton({ className, onClick, ...rest }) {
|
|
25006
25172
|
const split = useSplit("PageContent.BackButton");
|
|
25007
|
-
return /* @__PURE__ */
|
|
25173
|
+
return /* @__PURE__ */ jsx74(
|
|
25008
25174
|
Button.Root,
|
|
25009
25175
|
{
|
|
25010
25176
|
variant: "soft",
|
|
@@ -25016,7 +25182,7 @@ function PageContentBackButton({ className, onClick, ...rest }) {
|
|
|
25016
25182
|
onClick?.(event);
|
|
25017
25183
|
if (!event.defaultPrevented) split.close();
|
|
25018
25184
|
},
|
|
25019
|
-
children: /* @__PURE__ */
|
|
25185
|
+
children: /* @__PURE__ */ jsx74(Button.Icon, { children: /* @__PURE__ */ jsx74(Icon, { name: "nav.chevronLeft" }) })
|
|
25020
25186
|
}
|
|
25021
25187
|
);
|
|
25022
25188
|
}
|
|
@@ -25036,7 +25202,7 @@ var PageContent = {
|
|
|
25036
25202
|
};
|
|
25037
25203
|
|
|
25038
25204
|
// src/components/page-toolbar/PageToolbar.tsx
|
|
25039
|
-
import * as
|
|
25205
|
+
import * as React82 from "react";
|
|
25040
25206
|
|
|
25041
25207
|
// src/components/page-toolbar/PageToolbar.module.css
|
|
25042
25208
|
var PageToolbar_default = {
|
|
@@ -25051,34 +25217,34 @@ var PageToolbar_default = {
|
|
|
25051
25217
|
};
|
|
25052
25218
|
|
|
25053
25219
|
// src/components/page-toolbar/PageToolbar.tsx
|
|
25054
|
-
import { jsx as
|
|
25220
|
+
import { jsx as jsx75, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
25055
25221
|
function PageToolbarRoot({ className, children, ref, ...rest }) {
|
|
25056
|
-
const items =
|
|
25057
|
-
const isChips = (child) =>
|
|
25058
|
-
return /* @__PURE__ */
|
|
25059
|
-
/* @__PURE__ */
|
|
25222
|
+
const items = React82.Children.toArray(children);
|
|
25223
|
+
const isChips = (child) => React82.isValidElement(child) && child.type === PageToolbarChips;
|
|
25224
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, ref, className: cx(PageToolbar_default.root, className), children: /* @__PURE__ */ jsxs62("div", { className: PageToolbar_default.layout, children: [
|
|
25225
|
+
/* @__PURE__ */ jsx75("div", { className: PageToolbar_default.bar, children: items.filter((child) => !isChips(child)) }),
|
|
25060
25226
|
items.filter(isChips)
|
|
25061
25227
|
] }) });
|
|
25062
25228
|
}
|
|
25063
25229
|
PageToolbarRoot.displayName = "PageToolbar.Root";
|
|
25064
25230
|
function PageToolbarSections({ className, ...rest }) {
|
|
25065
|
-
return /* @__PURE__ */
|
|
25231
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, className: cx(PageToolbar_default.sections, className) });
|
|
25066
25232
|
}
|
|
25067
25233
|
PageToolbarSections.displayName = "PageToolbar.Sections";
|
|
25068
25234
|
function PageToolbarTools({ className, ...rest }) {
|
|
25069
|
-
return /* @__PURE__ */
|
|
25235
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, className: cx(PageToolbar_default.tools, className) });
|
|
25070
25236
|
}
|
|
25071
25237
|
PageToolbarTools.displayName = "PageToolbar.Tools";
|
|
25072
25238
|
function PageToolbarView({ className, ...rest }) {
|
|
25073
|
-
return /* @__PURE__ */
|
|
25239
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, className: cx(PageToolbar_default.view, className) });
|
|
25074
25240
|
}
|
|
25075
25241
|
PageToolbarView.displayName = "PageToolbar.View";
|
|
25076
25242
|
function PageToolbarActions({ className, ...rest }) {
|
|
25077
|
-
return /* @__PURE__ */
|
|
25243
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, className: cx(PageToolbar_default.actions, className) });
|
|
25078
25244
|
}
|
|
25079
25245
|
PageToolbarActions.displayName = "PageToolbar.Actions";
|
|
25080
25246
|
function PageToolbarChips({ className, ...rest }) {
|
|
25081
|
-
return /* @__PURE__ */
|
|
25247
|
+
return /* @__PURE__ */ jsx75("div", { ...rest, className: cx(PageToolbar_default.chips, className) });
|
|
25082
25248
|
}
|
|
25083
25249
|
PageToolbarChips.displayName = "PageToolbar.Chips";
|
|
25084
25250
|
var PageToolbar = {
|
|
@@ -25091,7 +25257,7 @@ var PageToolbar = {
|
|
|
25091
25257
|
};
|
|
25092
25258
|
|
|
25093
25259
|
// src/components/progress-circle/ProgressCircle.tsx
|
|
25094
|
-
import * as
|
|
25260
|
+
import * as React83 from "react";
|
|
25095
25261
|
|
|
25096
25262
|
// src/components/progress-circle/ProgressCircle.module.css
|
|
25097
25263
|
var ProgressCircle_default = {
|
|
@@ -25108,7 +25274,7 @@ var ProgressCircle_default = {
|
|
|
25108
25274
|
};
|
|
25109
25275
|
|
|
25110
25276
|
// src/components/progress-circle/ProgressCircle.tsx
|
|
25111
|
-
import { Fragment as
|
|
25277
|
+
import { Fragment as Fragment30, jsx as jsx76, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
25112
25278
|
var HAIRLINE_GAP = RING_DATA_STROKE * 0.75;
|
|
25113
25279
|
var LOADING_ROWS2 = 3;
|
|
25114
25280
|
function arcStyle(start, length) {
|
|
@@ -25130,9 +25296,9 @@ function SegmentArcs({
|
|
|
25130
25296
|
}) {
|
|
25131
25297
|
if (gap === "hairline" && arcs.length > 1) {
|
|
25132
25298
|
const inset = (RING_DATA_STROKE + HAIRLINE_GAP) / 2;
|
|
25133
|
-
return /* @__PURE__ */
|
|
25299
|
+
return /* @__PURE__ */ jsx76(Fragment30, { children: arcs.map((a, i) => {
|
|
25134
25300
|
const own = a.rest ? { className: void 0 } : fillProps(a.fill);
|
|
25135
|
-
return /* @__PURE__ */
|
|
25301
|
+
return /* @__PURE__ */ jsx76(
|
|
25136
25302
|
RingCircle,
|
|
25137
25303
|
{
|
|
25138
25304
|
...own,
|
|
@@ -25146,10 +25312,10 @@ function SegmentArcs({
|
|
|
25146
25312
|
const parts = arcs.filter((a) => !a.rest);
|
|
25147
25313
|
const first = parts[0];
|
|
25148
25314
|
const last = parts[parts.length - 1];
|
|
25149
|
-
return /* @__PURE__ */
|
|
25315
|
+
return /* @__PURE__ */ jsxs63(Fragment30, { children: [
|
|
25150
25316
|
parts.map((a, i) => {
|
|
25151
25317
|
const own = fillProps(a.fill);
|
|
25152
|
-
return /* @__PURE__ */
|
|
25318
|
+
return /* @__PURE__ */ jsx76(
|
|
25153
25319
|
RingCircle,
|
|
25154
25320
|
{
|
|
25155
25321
|
...own,
|
|
@@ -25159,15 +25325,15 @@ function SegmentArcs({
|
|
|
25159
25325
|
i
|
|
25160
25326
|
);
|
|
25161
25327
|
}),
|
|
25162
|
-
first && last && !closed ? /* @__PURE__ */
|
|
25163
|
-
/* @__PURE__ */
|
|
25164
|
-
/* @__PURE__ */
|
|
25328
|
+
first && last && !closed ? /* @__PURE__ */ jsxs63(Fragment30, { children: [
|
|
25329
|
+
/* @__PURE__ */ jsx76(Cap, { position: first.start, fill: first.fill }),
|
|
25330
|
+
/* @__PURE__ */ jsx76(Cap, { position: last.start + last.length, fill: last.fill })
|
|
25165
25331
|
] }) : null
|
|
25166
25332
|
] });
|
|
25167
25333
|
}
|
|
25168
25334
|
function Cap({ position, fill }) {
|
|
25169
25335
|
const own = fillProps(fill);
|
|
25170
|
-
return /* @__PURE__ */
|
|
25336
|
+
return /* @__PURE__ */ jsx76(RingCap, { position, ...own, className: cx(own.className, ProgressCircle_default.cap) });
|
|
25171
25337
|
}
|
|
25172
25338
|
function ProgressCircle(props) {
|
|
25173
25339
|
const {
|
|
@@ -25187,7 +25353,7 @@ function ProgressCircle(props) {
|
|
|
25187
25353
|
labels,
|
|
25188
25354
|
...rest
|
|
25189
25355
|
} = props;
|
|
25190
|
-
const descriptionId =
|
|
25356
|
+
const descriptionId = React83.useId();
|
|
25191
25357
|
const swapped = useStateSwap(loading ? "loading" : "data");
|
|
25192
25358
|
const swapClass = swapped ? swapMotion_default.swapIn : void 0;
|
|
25193
25359
|
const isText2 = typeof children === "string" || typeof children === "number";
|
|
@@ -25216,10 +25382,10 @@ function ProgressCircle(props) {
|
|
|
25216
25382
|
const showLegend = legend && segments.length > 0;
|
|
25217
25383
|
const a11y = label ? { "aria-label": label, "aria-describedby": descriptionId } : { "aria-label": text };
|
|
25218
25384
|
if (label && !showLegend) {
|
|
25219
|
-
description = /* @__PURE__ */
|
|
25385
|
+
description = /* @__PURE__ */ jsx76(VisuallyHidden, { id: descriptionId, children: text });
|
|
25220
25386
|
}
|
|
25221
25387
|
if (legend) {
|
|
25222
|
-
legendNode = loading ? /* @__PURE__ */
|
|
25388
|
+
legendNode = loading ? /* @__PURE__ */ jsx76(
|
|
25223
25389
|
ProgressLegendSkeleton,
|
|
25224
25390
|
{
|
|
25225
25391
|
rows: segmentsProp.length || LOADING_ROWS2,
|
|
@@ -25227,7 +25393,7 @@ function ProgressCircle(props) {
|
|
|
25227
25393
|
className: cx(ProgressCircle_default.legend, swapClass)
|
|
25228
25394
|
},
|
|
25229
25395
|
"loading"
|
|
25230
|
-
) : showLegend ? /* @__PURE__ */
|
|
25396
|
+
) : showLegend ? /* @__PURE__ */ jsx76(
|
|
25231
25397
|
ProgressLegend,
|
|
25232
25398
|
{
|
|
25233
25399
|
id: label ? descriptionId : void 0,
|
|
@@ -25240,7 +25406,7 @@ function ProgressCircle(props) {
|
|
|
25240
25406
|
"data"
|
|
25241
25407
|
) : null;
|
|
25242
25408
|
}
|
|
25243
|
-
ring = /* @__PURE__ */
|
|
25409
|
+
ring = /* @__PURE__ */ jsx76(
|
|
25244
25410
|
Ring,
|
|
25245
25411
|
{
|
|
25246
25412
|
value: 0,
|
|
@@ -25250,7 +25416,7 @@ function ProgressCircle(props) {
|
|
|
25250
25416
|
role: "group",
|
|
25251
25417
|
...a11y,
|
|
25252
25418
|
...toDataAttributes({ "segment-gap": gap }),
|
|
25253
|
-
children: total > 0 ? /* @__PURE__ */
|
|
25419
|
+
children: total > 0 ? /* @__PURE__ */ jsx76(SegmentArcs, { arcs, gap, closed: free === 0 }) : null
|
|
25254
25420
|
},
|
|
25255
25421
|
"data"
|
|
25256
25422
|
);
|
|
@@ -25258,7 +25424,7 @@ function ProgressCircle(props) {
|
|
|
25258
25424
|
const unknown = valueProp === null || valueProp === void 0;
|
|
25259
25425
|
const { value, max, ratio } = resolveValue(valueProp ?? 0, maxProp);
|
|
25260
25426
|
tone = toneProp ?? "accent";
|
|
25261
|
-
ring = /* @__PURE__ */
|
|
25427
|
+
ring = /* @__PURE__ */ jsx76(
|
|
25262
25428
|
Ring,
|
|
25263
25429
|
{
|
|
25264
25430
|
value: unknown ? null : ratio,
|
|
@@ -25275,10 +25441,10 @@ function ProgressCircle(props) {
|
|
|
25275
25441
|
"data"
|
|
25276
25442
|
);
|
|
25277
25443
|
}
|
|
25278
|
-
const body = /* @__PURE__ */
|
|
25279
|
-
loading ? /* @__PURE__ */
|
|
25444
|
+
const body = /* @__PURE__ */ jsxs63(Fragment30, { children: [
|
|
25445
|
+
loading ? /* @__PURE__ */ jsx76(Skeleton, { shape: "block", className: cx(ProgressCircle_default.ringSkeleton, swapClass) }, "loading") : ring,
|
|
25280
25446
|
loading ? null : description,
|
|
25281
|
-
showInner ? /* @__PURE__ */
|
|
25447
|
+
showInner ? /* @__PURE__ */ jsx76("div", { className: ProgressCircle_default.inner, "aria-hidden": valueText !== void 0 ? true : void 0, children: /* @__PURE__ */ jsx76(GlyphSwap, { children }) }) : null
|
|
25282
25448
|
] });
|
|
25283
25449
|
const rootProps = {
|
|
25284
25450
|
...rest,
|
|
@@ -25286,16 +25452,16 @@ function ProgressCircle(props) {
|
|
|
25286
25452
|
...toDataAttributes({ size, tone, legend: legend || void 0 })
|
|
25287
25453
|
};
|
|
25288
25454
|
if (legend) {
|
|
25289
|
-
return /* @__PURE__ */
|
|
25290
|
-
/* @__PURE__ */
|
|
25455
|
+
return /* @__PURE__ */ jsxs63("div", { className: cx(ProgressCircle_default.root, className), ...rootProps, children: [
|
|
25456
|
+
/* @__PURE__ */ jsx76("div", { className: ProgressCircle_default.ring, children: body }),
|
|
25291
25457
|
legendNode
|
|
25292
25458
|
] });
|
|
25293
25459
|
}
|
|
25294
|
-
return /* @__PURE__ */
|
|
25460
|
+
return /* @__PURE__ */ jsx76("div", { className: cx(ProgressCircle_default.root, className), ...rootProps, children: body });
|
|
25295
25461
|
}
|
|
25296
25462
|
|
|
25297
25463
|
// src/components/radio/Radio.tsx
|
|
25298
|
-
import * as
|
|
25464
|
+
import * as React84 from "react";
|
|
25299
25465
|
|
|
25300
25466
|
// src/components/radio/Radio.module.css
|
|
25301
25467
|
var Radio_default = {
|
|
@@ -25306,7 +25472,7 @@ var Radio_default = {
|
|
|
25306
25472
|
};
|
|
25307
25473
|
|
|
25308
25474
|
// src/components/radio/Radio.tsx
|
|
25309
|
-
import { Fragment as
|
|
25475
|
+
import { Fragment as Fragment31, jsx as jsx77, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
25310
25476
|
var RADIO_GROUP_LABELS = { optional: "\u043D\u0435\u043E\u0431\u044F\u0437\u0430\u0442\u0435\u043B\u044C\u043D\u043E" };
|
|
25311
25477
|
var [RadioGroupProvider, useRadioGroupContext] = createComponentContext("Radio.Group");
|
|
25312
25478
|
function RadioGroup({
|
|
@@ -25336,7 +25502,7 @@ function RadioGroup({
|
|
|
25336
25502
|
const disabled = useInheritedDisabled(disabledProp);
|
|
25337
25503
|
const ids = useFieldFrame(id, { label, hint, error, invalid }, ariaDescribedBy);
|
|
25338
25504
|
const name = nameProp ?? ids.controlId;
|
|
25339
|
-
const reportChange =
|
|
25505
|
+
const reportChange = React84.useCallback(
|
|
25340
25506
|
(next) => {
|
|
25341
25507
|
if (next !== void 0) onValueChange?.(next);
|
|
25342
25508
|
},
|
|
@@ -25347,11 +25513,11 @@ function RadioGroup({
|
|
|
25347
25513
|
defaultValue,
|
|
25348
25514
|
onChange: reportChange
|
|
25349
25515
|
});
|
|
25350
|
-
const ctxValue =
|
|
25516
|
+
const ctxValue = React84.useMemo(
|
|
25351
25517
|
() => ({ name, value, setValue, size, disabled, invalid: ids.invalid, required }),
|
|
25352
25518
|
[name, value, setValue, size, disabled, ids.invalid, required]
|
|
25353
25519
|
);
|
|
25354
|
-
return /* @__PURE__ */
|
|
25520
|
+
return /* @__PURE__ */ jsx77(RadioGroupProvider, { value: ctxValue, children: /* @__PURE__ */ jsx77(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx77(
|
|
25355
25521
|
FieldFrame,
|
|
25356
25522
|
{
|
|
25357
25523
|
...rest,
|
|
@@ -25366,7 +25532,7 @@ function RadioGroup({
|
|
|
25366
25532
|
optionalLabel: labelsProp?.optional ?? RADIO_GROUP_LABELS.optional,
|
|
25367
25533
|
group: true,
|
|
25368
25534
|
className,
|
|
25369
|
-
children: /* @__PURE__ */
|
|
25535
|
+
children: /* @__PURE__ */ jsx77(
|
|
25370
25536
|
"div",
|
|
25371
25537
|
{
|
|
25372
25538
|
id: ids.controlId,
|
|
@@ -25401,7 +25567,7 @@ function RadioRoot({
|
|
|
25401
25567
|
const ids = useFieldFrame(id, { hint, invalid: group.invalid }, ariaDescribedBy);
|
|
25402
25568
|
const disabled = group.disabled || disabledProp;
|
|
25403
25569
|
const checked = group.value === value;
|
|
25404
|
-
return /* @__PURE__ */
|
|
25570
|
+
return /* @__PURE__ */ jsx77(
|
|
25405
25571
|
ChoiceField,
|
|
25406
25572
|
{
|
|
25407
25573
|
ids,
|
|
@@ -25410,8 +25576,8 @@ function RadioRoot({
|
|
|
25410
25576
|
disabled,
|
|
25411
25577
|
hint,
|
|
25412
25578
|
className: cx(Radio_default.root, className),
|
|
25413
|
-
control: /* @__PURE__ */
|
|
25414
|
-
/* @__PURE__ */
|
|
25579
|
+
control: /* @__PURE__ */ jsxs64(Fragment31, { children: [
|
|
25580
|
+
/* @__PURE__ */ jsx77(
|
|
25415
25581
|
"input",
|
|
25416
25582
|
{
|
|
25417
25583
|
...inputRest,
|
|
@@ -25429,7 +25595,7 @@ function RadioRoot({
|
|
|
25429
25595
|
"aria-describedby": ids.describedBy
|
|
25430
25596
|
}
|
|
25431
25597
|
),
|
|
25432
|
-
/* @__PURE__ */
|
|
25598
|
+
/* @__PURE__ */ jsx77("span", { className: cx(choiceVisualClass, Radio_default.control), "aria-hidden": "true", children: /* @__PURE__ */ jsx77("span", { className: Radio_default.dot }) })
|
|
25433
25599
|
] }),
|
|
25434
25600
|
children
|
|
25435
25601
|
}
|
|
@@ -25437,7 +25603,7 @@ function RadioRoot({
|
|
|
25437
25603
|
}
|
|
25438
25604
|
RadioRoot.displayName = "Radio.Root";
|
|
25439
25605
|
function RadioLabel(props) {
|
|
25440
|
-
return /* @__PURE__ */
|
|
25606
|
+
return /* @__PURE__ */ jsx77(ChoiceLabel, { ...props });
|
|
25441
25607
|
}
|
|
25442
25608
|
RadioLabel.displayName = "Radio.Label";
|
|
25443
25609
|
var Radio = {
|
|
@@ -25447,7 +25613,7 @@ var Radio = {
|
|
|
25447
25613
|
};
|
|
25448
25614
|
|
|
25449
25615
|
// src/components/sheet/Sheet.tsx
|
|
25450
|
-
import * as
|
|
25616
|
+
import * as React85 from "react";
|
|
25451
25617
|
|
|
25452
25618
|
// src/components/sheet/Sheet.module.css
|
|
25453
25619
|
var Sheet_default = {
|
|
@@ -25457,7 +25623,7 @@ var Sheet_default = {
|
|
|
25457
25623
|
};
|
|
25458
25624
|
|
|
25459
25625
|
// src/components/sheet/Sheet.tsx
|
|
25460
|
-
import { jsx as
|
|
25626
|
+
import { jsx as jsx78, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
25461
25627
|
var SHEET_LABELS = {
|
|
25462
25628
|
close: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C",
|
|
25463
25629
|
...DIALOG_DISCARD_LABELS
|
|
@@ -25467,12 +25633,12 @@ function SheetRoot({ labels, children, ...options }) {
|
|
|
25467
25633
|
...SHEET_LABELS,
|
|
25468
25634
|
...labels
|
|
25469
25635
|
};
|
|
25470
|
-
const discardLabels =
|
|
25636
|
+
const discardLabels = React85.useMemo(
|
|
25471
25637
|
() => ({ discardTitle, discardDescription, discardConfirm, discardCancel }),
|
|
25472
25638
|
[discardTitle, discardDescription, discardConfirm, discardCancel]
|
|
25473
25639
|
);
|
|
25474
25640
|
const state = useDialogRoot({ ...options, closeLabel: close, discardLabels });
|
|
25475
|
-
return /* @__PURE__ */
|
|
25641
|
+
return /* @__PURE__ */ jsx78(DialogRootProvider, { value: state, children });
|
|
25476
25642
|
}
|
|
25477
25643
|
SheetRoot.displayName = "Sheet.Root";
|
|
25478
25644
|
function SheetContent({ children, ...props }) {
|
|
@@ -25480,7 +25646,7 @@ function SheetContent({ children, ...props }) {
|
|
|
25480
25646
|
const presence = usePresence(open, { exitDuration: "base" });
|
|
25481
25647
|
const shown = useExitSnapshot(open, children);
|
|
25482
25648
|
if (!presence.mounted) return null;
|
|
25483
|
-
return /* @__PURE__ */
|
|
25649
|
+
return /* @__PURE__ */ jsx78(Portal, { children: /* @__PURE__ */ jsx78(SheetDialog, { ...props, state: presence.state, onExitEnd: presence.onExitEnd, children: shown }) });
|
|
25484
25650
|
}
|
|
25485
25651
|
function SheetDialog({
|
|
25486
25652
|
overlayClassName,
|
|
@@ -25498,7 +25664,7 @@ function SheetDialog({
|
|
|
25498
25664
|
const root = useDialogRootContext();
|
|
25499
25665
|
const { ref: layerRef, layer, onClose } = useDialogLayer(root);
|
|
25500
25666
|
const panelRef = useMergedRefs(layerRef, ref);
|
|
25501
|
-
const scrimRef =
|
|
25667
|
+
const scrimRef = React85.useRef(null);
|
|
25502
25668
|
const swipe = useSwipeDismiss({
|
|
25503
25669
|
// A guarded sheet does not slide away: busy ignores the dismiss, dirty asks first.
|
|
25504
25670
|
enabled: root.closeOnOutsideClick && state === "open" && !root.busy && !root.dirty,
|
|
@@ -25518,8 +25684,8 @@ function SheetDialog({
|
|
|
25518
25684
|
});
|
|
25519
25685
|
return (
|
|
25520
25686
|
// One portal root for scrim + sheet, so `useInertSiblings` never makes the scrim inert.
|
|
25521
|
-
/* @__PURE__ */
|
|
25522
|
-
/* @__PURE__ */
|
|
25687
|
+
/* @__PURE__ */ jsxs65("div", { className: Sheet_default.root, children: [
|
|
25688
|
+
/* @__PURE__ */ jsx78(
|
|
25523
25689
|
"div",
|
|
25524
25690
|
{
|
|
25525
25691
|
ref: scrimRef,
|
|
@@ -25528,7 +25694,7 @@ function SheetDialog({
|
|
|
25528
25694
|
"data-state": state
|
|
25529
25695
|
}
|
|
25530
25696
|
),
|
|
25531
|
-
/* @__PURE__ */
|
|
25697
|
+
/* @__PURE__ */ jsxs65(
|
|
25532
25698
|
"div",
|
|
25533
25699
|
{
|
|
25534
25700
|
ref: panelRef,
|
|
@@ -25552,8 +25718,8 @@ function SheetDialog({
|
|
|
25552
25718
|
swipe.onPointerDown(event);
|
|
25553
25719
|
},
|
|
25554
25720
|
children: [
|
|
25555
|
-
/* @__PURE__ */
|
|
25556
|
-
/* @__PURE__ */
|
|
25721
|
+
/* @__PURE__ */ jsx78("div", { className: sheet_default.handle, "data-swipe-handle": "", "aria-hidden": "true" }),
|
|
25722
|
+
/* @__PURE__ */ jsx78(DialogShellProvider, { value: shell.value, children: /* @__PURE__ */ jsx78(LayerProvider, { value: layer, children: /* @__PURE__ */ jsx78(SurfaceDepthProvider, { value: "floating", children }) }) })
|
|
25557
25723
|
]
|
|
25558
25724
|
}
|
|
25559
25725
|
)
|
|
@@ -25578,7 +25744,7 @@ var Sheet = {
|
|
|
25578
25744
|
};
|
|
25579
25745
|
|
|
25580
25746
|
// src/components/smart-filter/SmartFilter.tsx
|
|
25581
|
-
import * as
|
|
25747
|
+
import * as React86 from "react";
|
|
25582
25748
|
|
|
25583
25749
|
// src/components/smart-filter/model.ts
|
|
25584
25750
|
var EMPTY = { include: [], exclude: [] };
|
|
@@ -25675,7 +25841,7 @@ var SmartFilter_default = {
|
|
|
25675
25841
|
};
|
|
25676
25842
|
|
|
25677
25843
|
// src/components/smart-filter/SmartFilter.tsx
|
|
25678
|
-
import { Fragment as
|
|
25844
|
+
import { Fragment as Fragment33, jsx as jsx79, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
25679
25845
|
var DEFAULT_LABELS7 = {
|
|
25680
25846
|
filter: "\u0424\u0438\u043B\u044C\u0442\u0440",
|
|
25681
25847
|
searchPlaceholder: "\u041F\u043E\u0438\u0441\u043A",
|
|
@@ -25748,7 +25914,7 @@ function SmartFilterRoot({
|
|
|
25748
25914
|
defaultValue: defaultSearch,
|
|
25749
25915
|
onChange: onSearchChange
|
|
25750
25916
|
});
|
|
25751
|
-
const [open, setOpen] =
|
|
25917
|
+
const [open, setOpen] = React86.useState(false);
|
|
25752
25918
|
const context = {
|
|
25753
25919
|
fields,
|
|
25754
25920
|
value: current,
|
|
@@ -25765,14 +25931,14 @@ function SmartFilterRoot({
|
|
|
25765
25931
|
size,
|
|
25766
25932
|
collapsedLimit
|
|
25767
25933
|
};
|
|
25768
|
-
return /* @__PURE__ */
|
|
25934
|
+
return /* @__PURE__ */ jsx79(SmartFilterProvider, { value: context, children: /* @__PURE__ */ jsx79(Popover.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsx79("div", { ref, className: cx(SmartFilter_default.root, className), "data-size": size, children }) }) });
|
|
25769
25935
|
}
|
|
25770
25936
|
SmartFilterRoot.displayName = "SmartFilter.Root";
|
|
25771
25937
|
function SmartFilterToolbar({ searchable = true, className, ...rest }) {
|
|
25772
25938
|
const { fields, total, open, setOpen, search, setSearch, labels, size } = useSmartFilter();
|
|
25773
25939
|
const hasFilters = fields.length > 0;
|
|
25774
|
-
return /* @__PURE__ */
|
|
25775
|
-
/* @__PURE__ */
|
|
25940
|
+
return /* @__PURE__ */ jsxs66(Fragment33, { children: [
|
|
25941
|
+
/* @__PURE__ */ jsx79(Popover.Anchor, { children: /* @__PURE__ */ jsxs66(
|
|
25776
25942
|
"div",
|
|
25777
25943
|
{
|
|
25778
25944
|
...rest,
|
|
@@ -25780,15 +25946,15 @@ function SmartFilterToolbar({ searchable = true, className, ...rest }) {
|
|
|
25780
25946
|
"data-slot": "smart-filter-toolbar",
|
|
25781
25947
|
"data-searchable": searchable ? void 0 : "false",
|
|
25782
25948
|
children: [
|
|
25783
|
-
searchable && /* @__PURE__ */
|
|
25949
|
+
searchable && /* @__PURE__ */ jsx79(
|
|
25784
25950
|
Input.Root,
|
|
25785
25951
|
{
|
|
25786
25952
|
size,
|
|
25787
25953
|
className: SmartFilter_default.search,
|
|
25788
25954
|
labels: { clear: labels.clearSearch },
|
|
25789
|
-
children: /* @__PURE__ */
|
|
25790
|
-
/* @__PURE__ */
|
|
25791
|
-
/* @__PURE__ */
|
|
25955
|
+
children: /* @__PURE__ */ jsxs66(Input.Wrapper, { children: [
|
|
25956
|
+
/* @__PURE__ */ jsx79(Input.Icon, { side: "start", children: /* @__PURE__ */ jsx79(Icon, { name: "action.search", tone: "secondary" }) }),
|
|
25957
|
+
/* @__PURE__ */ jsx79(
|
|
25792
25958
|
Input.Field,
|
|
25793
25959
|
{
|
|
25794
25960
|
type: "search",
|
|
@@ -25803,11 +25969,11 @@ function SmartFilterToolbar({ searchable = true, className, ...rest }) {
|
|
|
25803
25969
|
}
|
|
25804
25970
|
}
|
|
25805
25971
|
),
|
|
25806
|
-
search.length > 0 && /* @__PURE__ */
|
|
25972
|
+
search.length > 0 && /* @__PURE__ */ jsx79(Input.ClearButton, { onClick: () => setSearch("") })
|
|
25807
25973
|
] })
|
|
25808
25974
|
}
|
|
25809
25975
|
),
|
|
25810
|
-
hasFilters && /* @__PURE__ */
|
|
25976
|
+
hasFilters && /* @__PURE__ */ jsxs66(
|
|
25811
25977
|
Button.Root,
|
|
25812
25978
|
{
|
|
25813
25979
|
variant: "soft",
|
|
@@ -25818,16 +25984,16 @@ function SmartFilterToolbar({ searchable = true, className, ...rest }) {
|
|
|
25818
25984
|
"aria-haspopup": "dialog",
|
|
25819
25985
|
onClick: () => setOpen(!open),
|
|
25820
25986
|
children: [
|
|
25821
|
-
/* @__PURE__ */
|
|
25987
|
+
/* @__PURE__ */ jsx79(Button.Icon, { children: /* @__PURE__ */ jsx79(Icon, { name: "action.filter" }) }),
|
|
25822
25988
|
labels.filter,
|
|
25823
|
-
total > 0 && /* @__PURE__ */
|
|
25989
|
+
total > 0 && /* @__PURE__ */ jsx79(Badge.Root, { color: "blue", children: total })
|
|
25824
25990
|
]
|
|
25825
25991
|
}
|
|
25826
25992
|
)
|
|
25827
25993
|
]
|
|
25828
25994
|
}
|
|
25829
25995
|
) }),
|
|
25830
|
-
hasFilters && /* @__PURE__ */
|
|
25996
|
+
hasFilters && /* @__PURE__ */ jsx79(Popover.Content, { matchTriggerWidth: searchable, flush: true, size, children: /* @__PURE__ */ jsx79(Panel, { searchable }) })
|
|
25831
25997
|
] });
|
|
25832
25998
|
}
|
|
25833
25999
|
SmartFilterToolbar.displayName = "SmartFilter.Toolbar";
|
|
@@ -25854,13 +26020,13 @@ function Panel({ searchable }) {
|
|
|
25854
26020
|
collapsedLimit
|
|
25855
26021
|
} = useSmartFilter();
|
|
25856
26022
|
const query = searchable ? search.trim() : "";
|
|
25857
|
-
const [expanded, setExpanded] =
|
|
26023
|
+
const [expanded, setExpanded] = React86.useState(() => /* @__PURE__ */ new Set());
|
|
25858
26024
|
const sections = [];
|
|
25859
26025
|
const empty = [];
|
|
25860
26026
|
if (query) {
|
|
25861
26027
|
sections.push({
|
|
25862
26028
|
key: "query",
|
|
25863
|
-
node: /* @__PURE__ */
|
|
26029
|
+
node: /* @__PURE__ */ jsx79("div", { className: SmartFilter_default.queryRow, children: /* @__PURE__ */ jsxs66(
|
|
25864
26030
|
Button.Root,
|
|
25865
26031
|
{
|
|
25866
26032
|
variant: "ghost",
|
|
@@ -25869,9 +26035,9 @@ function Panel({ searchable }) {
|
|
|
25869
26035
|
fullWidth: true,
|
|
25870
26036
|
onClick: () => setOpen(false),
|
|
25871
26037
|
children: [
|
|
25872
|
-
/* @__PURE__ */
|
|
26038
|
+
/* @__PURE__ */ jsx79(Button.Icon, { children: /* @__PURE__ */ jsx79(Icon, { name: "action.search" }) }),
|
|
25873
26039
|
formatLabel(labels.searchText, { query }),
|
|
25874
|
-
/* @__PURE__ */
|
|
26040
|
+
/* @__PURE__ */ jsx79(Kbd, { className: SmartFilter_default.queryKey, children: "\u21B5" })
|
|
25875
26041
|
]
|
|
25876
26042
|
}
|
|
25877
26043
|
) })
|
|
@@ -25883,16 +26049,16 @@ function Panel({ searchable }) {
|
|
|
25883
26049
|
if (query && matchIndex(field.label, query) < 0) continue;
|
|
25884
26050
|
sections.push({
|
|
25885
26051
|
key: `field:${field.key}`,
|
|
25886
|
-
node: /* @__PURE__ */
|
|
25887
|
-
/* @__PURE__ */
|
|
25888
|
-
field.kind === "range" ? /* @__PURE__ */
|
|
26052
|
+
node: /* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.row, "data-field": field.key, children: [
|
|
26053
|
+
/* @__PURE__ */ jsx79(Typography, { as: "span", variant: "body-s", tone: "secondary", children: field.label }),
|
|
26054
|
+
field.kind === "range" ? /* @__PURE__ */ jsx79(
|
|
25889
26055
|
NumberRange,
|
|
25890
26056
|
{
|
|
25891
26057
|
field,
|
|
25892
26058
|
range: isSmartFilterRange(entry) ? entry : void 0,
|
|
25893
26059
|
onRange: (range) => setEntry(field.key, range)
|
|
25894
26060
|
}
|
|
25895
|
-
) : /* @__PURE__ */
|
|
26061
|
+
) : /* @__PURE__ */ jsx79(
|
|
25896
26062
|
Datepicker.Root,
|
|
25897
26063
|
{
|
|
25898
26064
|
mode: "range",
|
|
@@ -25924,7 +26090,7 @@ function Panel({ searchable }) {
|
|
|
25924
26090
|
const all = field.options.map((o) => o.value);
|
|
25925
26091
|
const single = field.multiple === false;
|
|
25926
26092
|
const groups = groupOptions(shown);
|
|
25927
|
-
const toggle = (option) => /* @__PURE__ */
|
|
26093
|
+
const toggle = (option) => /* @__PURE__ */ jsx79(
|
|
25928
26094
|
ValueToggle,
|
|
25929
26095
|
{
|
|
25930
26096
|
option,
|
|
@@ -25940,7 +26106,7 @@ function Panel({ searchable }) {
|
|
|
25940
26106
|
},
|
|
25941
26107
|
option.value
|
|
25942
26108
|
);
|
|
25943
|
-
const more = collapsible ? /* @__PURE__ */
|
|
26109
|
+
const more = collapsible ? /* @__PURE__ */ jsxs66(
|
|
25944
26110
|
Badge.Root,
|
|
25945
26111
|
{
|
|
25946
26112
|
size,
|
|
@@ -25948,25 +26114,25 @@ function Panel({ searchable }) {
|
|
|
25948
26114
|
onPress: () => setExpanded((prev) => new Set(prev).add(field.key)),
|
|
25949
26115
|
children: [
|
|
25950
26116
|
formatLabel(labels.more, { count: matched.length - collapsedLimit }),
|
|
25951
|
-
/* @__PURE__ */
|
|
26117
|
+
/* @__PURE__ */ jsx79(Badge.Icon, { children: /* @__PURE__ */ jsx79(Icon, { name: "nav.chevronDown" }) })
|
|
25952
26118
|
]
|
|
25953
26119
|
}
|
|
25954
26120
|
) : null;
|
|
25955
26121
|
sections.push({
|
|
25956
26122
|
key: `field:${field.key}`,
|
|
25957
|
-
node: /* @__PURE__ */
|
|
25958
|
-
/* @__PURE__ */
|
|
25959
|
-
groups.some((g) => g.label !== void 0) ? /* @__PURE__ */
|
|
26123
|
+
node: /* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.row, "data-field": field.key, children: [
|
|
26124
|
+
/* @__PURE__ */ jsx79(Typography, { as: "span", variant: "body-s", tone: "secondary", children: field.label }),
|
|
26125
|
+
groups.some((g) => g.label !== void 0) ? /* @__PURE__ */ jsx79("div", { className: SmartFilter_default.groups, children: groups.map((group, index) => (
|
|
25960
26126
|
// biome-ignore lint/a11y/useSemanticElements: a labelled set of toggles, not a form fieldset
|
|
25961
|
-
/* @__PURE__ */
|
|
26127
|
+
/* @__PURE__ */ jsxs66(
|
|
25962
26128
|
"div",
|
|
25963
26129
|
{
|
|
25964
26130
|
className: SmartFilter_default.group,
|
|
25965
26131
|
role: "group",
|
|
25966
26132
|
"aria-label": group.label,
|
|
25967
26133
|
children: [
|
|
25968
|
-
group.label !== void 0 ? /* @__PURE__ */
|
|
25969
|
-
/* @__PURE__ */
|
|
26134
|
+
group.label !== void 0 ? /* @__PURE__ */ jsx79(Typography, { as: "span", variant: "caption", tone: "muted", children: group.label }) : null,
|
|
26135
|
+
/* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.values, children: [
|
|
25970
26136
|
group.options.map(toggle),
|
|
25971
26137
|
index === groups.length - 1 ? more : null
|
|
25972
26138
|
] })
|
|
@@ -25974,7 +26140,7 @@ function Panel({ searchable }) {
|
|
|
25974
26140
|
},
|
|
25975
26141
|
group.label ?? `group-${index}`
|
|
25976
26142
|
)
|
|
25977
|
-
)) }) : /* @__PURE__ */
|
|
26143
|
+
)) }) : /* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.values, children: [
|
|
25978
26144
|
shown.map(toggle),
|
|
25979
26145
|
more
|
|
25980
26146
|
] })
|
|
@@ -25984,21 +26150,21 @@ function Panel({ searchable }) {
|
|
|
25984
26150
|
if (empty.length > 0) {
|
|
25985
26151
|
sections.push({
|
|
25986
26152
|
key: "empty",
|
|
25987
|
-
node: /* @__PURE__ */
|
|
26153
|
+
node: /* @__PURE__ */ jsx79(EmptyPage.Root, { layout: "compact", size, role: "status", children: /* @__PURE__ */ jsx79(EmptyPage.Description, { children: formatLabel(labels.noMatches, { fields: empty.join(", ") }) }) })
|
|
25988
26154
|
});
|
|
25989
26155
|
}
|
|
25990
26156
|
sections.push({
|
|
25991
26157
|
key: "footer",
|
|
25992
|
-
node: /* @__PURE__ */
|
|
25993
|
-
/* @__PURE__ */
|
|
25994
|
-
/* @__PURE__ */
|
|
25995
|
-
total > 0 && /* @__PURE__ */
|
|
26158
|
+
node: /* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.footer, children: [
|
|
26159
|
+
/* @__PURE__ */ jsx79(Typography, { as: "span", variant: "caption", tone: "muted", className: SmartFilter_default.hint, children: labels.hint }),
|
|
26160
|
+
/* @__PURE__ */ jsx79(Typography, { as: "span", variant: "caption", tone: "muted", children: formatLabel(labels.count, { count: total }) }),
|
|
26161
|
+
total > 0 && /* @__PURE__ */ jsx79(Button.Root, { variant: "ghost", tone: "neutral", size: "xs", onClick: clearAll, children: labels.reset })
|
|
25996
26162
|
] })
|
|
25997
26163
|
});
|
|
25998
|
-
return /* @__PURE__ */
|
|
25999
|
-
/* @__PURE__ */
|
|
26000
|
-
sections.map((section, index) => /* @__PURE__ */
|
|
26001
|
-
index > 0 && /* @__PURE__ */
|
|
26164
|
+
return /* @__PURE__ */ jsxs66(Fragment33, { children: [
|
|
26165
|
+
/* @__PURE__ */ jsx79(Popover.Title, { children: /* @__PURE__ */ jsx79(VisuallyHidden, { children: labels.filter }) }),
|
|
26166
|
+
sections.map((section, index) => /* @__PURE__ */ jsxs66(React86.Fragment, { children: [
|
|
26167
|
+
index > 0 && /* @__PURE__ */ jsx79(Divider, { role: "presentation" }),
|
|
26002
26168
|
section.node
|
|
26003
26169
|
] }, section.key))
|
|
26004
26170
|
] });
|
|
@@ -26018,8 +26184,8 @@ function NumberRange({
|
|
|
26018
26184
|
const { labels, size } = useSmartFilter();
|
|
26019
26185
|
const from = range?.from ?? null;
|
|
26020
26186
|
const to = range?.to ?? null;
|
|
26021
|
-
const [draft, setDraft] =
|
|
26022
|
-
const [seen, setSeen] =
|
|
26187
|
+
const [draft, setDraft] = React86.useState({ from: boundText(from), to: boundText(to) });
|
|
26188
|
+
const [seen, setSeen] = React86.useState({ from, to });
|
|
26023
26189
|
if (seen.from !== from || seen.to !== to) {
|
|
26024
26190
|
setSeen({ from, to });
|
|
26025
26191
|
if (parseBound(draft.from) !== from || parseBound(draft.to) !== to) {
|
|
@@ -26027,7 +26193,7 @@ function NumberRange({
|
|
|
26027
26193
|
}
|
|
26028
26194
|
}
|
|
26029
26195
|
const invalid = from !== null && to !== null && from > to;
|
|
26030
|
-
const bound = (side) => /* @__PURE__ */
|
|
26196
|
+
const bound = (side) => /* @__PURE__ */ jsx79(Input.Root, { size, invalid, className: SmartFilter_default.bound, children: /* @__PURE__ */ jsx79(Input.Wrapper, { children: /* @__PURE__ */ jsx79(
|
|
26031
26197
|
Input.Field,
|
|
26032
26198
|
{
|
|
26033
26199
|
inputMode: "decimal",
|
|
@@ -26045,9 +26211,9 @@ function NumberRange({
|
|
|
26045
26211
|
}
|
|
26046
26212
|
}
|
|
26047
26213
|
) }) });
|
|
26048
|
-
return /* @__PURE__ */
|
|
26214
|
+
return /* @__PURE__ */ jsxs66("div", { className: SmartFilter_default.range, children: [
|
|
26049
26215
|
bound("from"),
|
|
26050
|
-
/* @__PURE__ */
|
|
26216
|
+
/* @__PURE__ */ jsx79("span", { className: SmartFilter_default.rangeDash, "aria-hidden": "true", children: "\u2013" }),
|
|
26051
26217
|
bound("to")
|
|
26052
26218
|
] });
|
|
26053
26219
|
}
|
|
@@ -26062,7 +26228,7 @@ var TIER_BELOW = {
|
|
|
26062
26228
|
};
|
|
26063
26229
|
function ValueToggle({ option, size, mode, single, canHide, query, onMode }) {
|
|
26064
26230
|
const { labels } = useSmartFilter();
|
|
26065
|
-
return /* @__PURE__ */
|
|
26231
|
+
return /* @__PURE__ */ jsxs66(
|
|
26066
26232
|
Badge.Root,
|
|
26067
26233
|
{
|
|
26068
26234
|
size: tagSizeOf(size),
|
|
@@ -26079,9 +26245,9 @@ function ValueToggle({ option, size, mode, single, canHide, query, onMode }) {
|
|
|
26079
26245
|
},
|
|
26080
26246
|
children: [
|
|
26081
26247
|
mode === "exclude" && `${labels.not} `,
|
|
26082
|
-
option.icon ? /* @__PURE__ */
|
|
26083
|
-
/* @__PURE__ */
|
|
26084
|
-
single ? null : /* @__PURE__ */
|
|
26248
|
+
option.icon ? /* @__PURE__ */ jsx79(Badge.Icon, { children: option.icon }) : null,
|
|
26249
|
+
/* @__PURE__ */ jsx79("span", { children: /* @__PURE__ */ jsx79(HighlightMatch, { text: option.label, query }) }),
|
|
26250
|
+
single ? null : /* @__PURE__ */ jsx79(
|
|
26085
26251
|
Badge.Action,
|
|
26086
26252
|
{
|
|
26087
26253
|
label: formatLabel(mode === "exclude" ? labels.unhideValue : labels.hideValue, {
|
|
@@ -26101,7 +26267,7 @@ function SmartFilterChips({ className, ...rest }) {
|
|
|
26101
26267
|
const { fields, value, setEntry, total, clearAll, setOpen, setSearch, labels, size } = useSmartFilter();
|
|
26102
26268
|
if (total === 0) return null;
|
|
26103
26269
|
const tagSize = tagSizeOf(size);
|
|
26104
|
-
const chip = (key, text, negated, onRemove) => /* @__PURE__ */
|
|
26270
|
+
const chip = (key, text, negated, onRemove) => /* @__PURE__ */ jsx79(
|
|
26105
26271
|
Badge.Root,
|
|
26106
26272
|
{
|
|
26107
26273
|
size: tagSize,
|
|
@@ -26113,7 +26279,7 @@ function SmartFilterChips({ className, ...rest }) {
|
|
|
26113
26279
|
},
|
|
26114
26280
|
key
|
|
26115
26281
|
);
|
|
26116
|
-
return /* @__PURE__ */
|
|
26282
|
+
return /* @__PURE__ */ jsxs66("div", { ...rest, className: cx(SmartFilter_default.chips, className), "data-slot": "smart-filter-chips", children: [
|
|
26117
26283
|
fields.flatMap((field) => {
|
|
26118
26284
|
const entry = value[field.key];
|
|
26119
26285
|
if (!entry) return [];
|
|
@@ -26147,7 +26313,7 @@ function SmartFilterChips({ className, ...rest }) {
|
|
|
26147
26313
|
...selection.exclude.map((v) => tag(v, true))
|
|
26148
26314
|
];
|
|
26149
26315
|
}),
|
|
26150
|
-
/* @__PURE__ */
|
|
26316
|
+
/* @__PURE__ */ jsxs66(
|
|
26151
26317
|
Badge.Root,
|
|
26152
26318
|
{
|
|
26153
26319
|
size: tagSize,
|
|
@@ -26156,12 +26322,12 @@ function SmartFilterChips({ className, ...rest }) {
|
|
|
26156
26322
|
setOpen(true);
|
|
26157
26323
|
},
|
|
26158
26324
|
children: [
|
|
26159
|
-
/* @__PURE__ */
|
|
26325
|
+
/* @__PURE__ */ jsx79(Badge.Icon, { children: /* @__PURE__ */ jsx79(Icon, { name: "action.add" }) }),
|
|
26160
26326
|
labels.add
|
|
26161
26327
|
]
|
|
26162
26328
|
}
|
|
26163
26329
|
),
|
|
26164
|
-
/* @__PURE__ */
|
|
26330
|
+
/* @__PURE__ */ jsx79(LinkButton, { asChild: true, tone: "neutral", size: TIER_BELOW[tagSize], className: SmartFilter_default.clearAll, children: /* @__PURE__ */ jsx79("button", { type: "button", onClick: clearAll, children: labels.clearAll }) })
|
|
26165
26331
|
] });
|
|
26166
26332
|
}
|
|
26167
26333
|
SmartFilterChips.displayName = "SmartFilter.Chips";
|
|
@@ -26172,7 +26338,7 @@ var SmartFilter = {
|
|
|
26172
26338
|
};
|
|
26173
26339
|
|
|
26174
26340
|
// src/components/sparkline/Sparkline.tsx
|
|
26175
|
-
import * as
|
|
26341
|
+
import * as React87 from "react";
|
|
26176
26342
|
|
|
26177
26343
|
// src/components/sparkline/Sparkline.module.css
|
|
26178
26344
|
var Sparkline_default = {
|
|
@@ -26201,7 +26367,7 @@ var Sparkline_default = {
|
|
|
26201
26367
|
};
|
|
26202
26368
|
|
|
26203
26369
|
// src/components/sparkline/Sparkline.tsx
|
|
26204
|
-
import { Fragment as
|
|
26370
|
+
import { Fragment as Fragment34, jsx as jsx80, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
26205
26371
|
var SPARKLINE_LABELS = { point: "{label}: {value}" };
|
|
26206
26372
|
var NUMBER3 = new Intl.NumberFormat("ru-RU");
|
|
26207
26373
|
var PERCENT = new Intl.NumberFormat("ru-RU", { maximumFractionDigits: 1 });
|
|
@@ -26227,11 +26393,11 @@ function Sparkline({
|
|
|
26227
26393
|
const labels = { ...SPARKLINE_LABELS, ...labelsProp };
|
|
26228
26394
|
const last = data.length - 1;
|
|
26229
26395
|
const restIndex = highlight !== void 0 && highlight >= 0 && highlight <= last ? Math.floor(highlight) : last;
|
|
26230
|
-
const [active, setActive] =
|
|
26396
|
+
const [active, setActive] = React87.useState(null);
|
|
26231
26397
|
const index = active === null ? restIndex : Math.min(active, last);
|
|
26232
26398
|
const point = data[index];
|
|
26233
26399
|
const bars = variant === "bars";
|
|
26234
|
-
const [series, setSeries] =
|
|
26400
|
+
const [series, setSeries] = React87.useState({ data, version: 0 });
|
|
26235
26401
|
if (series.data !== data) setSeries({ data, version: series.version + 1 });
|
|
26236
26402
|
const version = series.data === data ? series.version : series.version + 1;
|
|
26237
26403
|
const swapped = useStateSwap(loading ? "loading" : version);
|
|
@@ -26254,16 +26420,16 @@ function Sparkline({
|
|
|
26254
26420
|
const change = changeAt(data, index);
|
|
26255
26421
|
const valueText = point ? formatValue(point.value) : "";
|
|
26256
26422
|
if (loading) {
|
|
26257
|
-
return /* @__PURE__ */
|
|
26258
|
-
/* @__PURE__ */
|
|
26259
|
-
/* @__PURE__ */
|
|
26260
|
-
/* @__PURE__ */
|
|
26423
|
+
return /* @__PURE__ */ jsxs67("div", { ...rest, ref, className: cx(Sparkline_default.root, className), "aria-busy": "true", children: [
|
|
26424
|
+
/* @__PURE__ */ jsxs67("div", { className: Sparkline_default.head, children: [
|
|
26425
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.label, children: label }),
|
|
26426
|
+
/* @__PURE__ */ jsx80(Skeleton, { shape: "text", size: "s", className: cx(Sparkline_default.dateSkeleton, swapClass) })
|
|
26261
26427
|
] }),
|
|
26262
|
-
/* @__PURE__ */
|
|
26263
|
-
/* @__PURE__ */
|
|
26428
|
+
/* @__PURE__ */ jsx80(Skeleton, { shape: "block", className: cx(Sparkline_default.valueSkeleton, swapClass) }),
|
|
26429
|
+
/* @__PURE__ */ jsx80(Skeleton, { shape: "block", className: cx(Sparkline_default.plotSkeleton, swapClass) })
|
|
26264
26430
|
] });
|
|
26265
26431
|
}
|
|
26266
|
-
return /* @__PURE__ */
|
|
26432
|
+
return /* @__PURE__ */ jsxs67(
|
|
26267
26433
|
"div",
|
|
26268
26434
|
{
|
|
26269
26435
|
...rest,
|
|
@@ -26272,18 +26438,18 @@ function Sparkline({
|
|
|
26272
26438
|
"data-scrubbing": active !== null || void 0,
|
|
26273
26439
|
"data-variant": variant,
|
|
26274
26440
|
children: [
|
|
26275
|
-
/* @__PURE__ */
|
|
26276
|
-
/* @__PURE__ */
|
|
26277
|
-
/* @__PURE__ */
|
|
26441
|
+
/* @__PURE__ */ jsxs67("div", { className: Sparkline_default.head, children: [
|
|
26442
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.label, children: label }),
|
|
26443
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.date, children: point?.label })
|
|
26278
26444
|
] }),
|
|
26279
|
-
/* @__PURE__ */
|
|
26280
|
-
/* @__PURE__ */
|
|
26281
|
-
change !== null ? /* @__PURE__ */
|
|
26282
|
-
/* @__PURE__ */
|
|
26445
|
+
/* @__PURE__ */ jsxs67("div", { className: Sparkline_default.valueRow, children: [
|
|
26446
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.value, children: active === null ? /* @__PURE__ */ jsx80(RollingNumber, { children: valueText }) : valueText }),
|
|
26447
|
+
change !== null ? /* @__PURE__ */ jsxs67(Badge.Root, { color: change < 0 ? "red" : "green", className: Sparkline_default.change, children: [
|
|
26448
|
+
/* @__PURE__ */ jsx80(Badge.Icon, { className: Sparkline_default.trend, "data-down": change < 0 || void 0, children: /* @__PURE__ */ jsx80(Icon, { name: "status.trendUp" }) }),
|
|
26283
26449
|
`${change > 0 ? "+" : change < 0 ? "\u2212" : ""}${PERCENT.format(Math.abs(change))}%`
|
|
26284
26450
|
] }) : null
|
|
26285
26451
|
] }),
|
|
26286
|
-
/* @__PURE__ */
|
|
26452
|
+
/* @__PURE__ */ jsxs67(
|
|
26287
26453
|
"div",
|
|
26288
26454
|
{
|
|
26289
26455
|
className: Sparkline_default.plot,
|
|
@@ -26312,8 +26478,8 @@ function Sparkline({
|
|
|
26312
26478
|
},
|
|
26313
26479
|
onBlur: () => setActive(null),
|
|
26314
26480
|
children: [
|
|
26315
|
-
bars ? /* @__PURE__ */
|
|
26316
|
-
/* @__PURE__ */
|
|
26481
|
+
bars ? /* @__PURE__ */ jsxs67("div", { className: cx(Sparkline_default.bars, swapClass), "aria-hidden": "true", children: [
|
|
26482
|
+
/* @__PURE__ */ jsx80(
|
|
26317
26483
|
"span",
|
|
26318
26484
|
{
|
|
26319
26485
|
className: Sparkline_default.baseline,
|
|
@@ -26323,7 +26489,7 @@ function Sparkline({
|
|
|
26323
26489
|
data.map((p, i) => {
|
|
26324
26490
|
const top = Math.min(y(p.value), zero);
|
|
26325
26491
|
const height = Math.abs(zero - y(p.value));
|
|
26326
|
-
return /* @__PURE__ */
|
|
26492
|
+
return /* @__PURE__ */ jsx80(
|
|
26327
26493
|
"span",
|
|
26328
26494
|
{
|
|
26329
26495
|
className: Sparkline_default.slot,
|
|
@@ -26331,7 +26497,7 @@ function Sparkline({
|
|
|
26331
26497
|
current: i === index || void 0,
|
|
26332
26498
|
quiet: (active !== null || highlight !== void 0) && i !== index ? true : void 0
|
|
26333
26499
|
}),
|
|
26334
|
-
children: /* @__PURE__ */
|
|
26500
|
+
children: /* @__PURE__ */ jsx80(
|
|
26335
26501
|
"span",
|
|
26336
26502
|
{
|
|
26337
26503
|
className: Sparkline_default.bar,
|
|
@@ -26346,29 +26512,29 @@ function Sparkline({
|
|
|
26346
26512
|
i
|
|
26347
26513
|
);
|
|
26348
26514
|
})
|
|
26349
|
-
] }, version) : /* @__PURE__ */
|
|
26515
|
+
] }, version) : /* @__PURE__ */ jsx80(
|
|
26350
26516
|
"svg",
|
|
26351
26517
|
{
|
|
26352
26518
|
className: cx(Sparkline_default.svg, swapClass),
|
|
26353
26519
|
viewBox: "0 0 100 100",
|
|
26354
26520
|
preserveAspectRatio: "none",
|
|
26355
26521
|
"aria-hidden": "true",
|
|
26356
|
-
children: data.length > 1 ? /* @__PURE__ */
|
|
26357
|
-
/* @__PURE__ */
|
|
26358
|
-
/* @__PURE__ */
|
|
26522
|
+
children: data.length > 1 ? /* @__PURE__ */ jsxs67(Fragment34, { children: [
|
|
26523
|
+
/* @__PURE__ */ jsx80("path", { className: Sparkline_default.area, d: `${line}L100,100L0,100Z` }),
|
|
26524
|
+
/* @__PURE__ */ jsx80("path", { className: Sparkline_default.line, d: line })
|
|
26359
26525
|
] }) : null
|
|
26360
26526
|
},
|
|
26361
26527
|
version
|
|
26362
26528
|
),
|
|
26363
|
-
point && !bars ? /* @__PURE__ */
|
|
26529
|
+
point && !bars ? /* @__PURE__ */ jsxs67(
|
|
26364
26530
|
"span",
|
|
26365
26531
|
{
|
|
26366
26532
|
className: Sparkline_default.cursor,
|
|
26367
26533
|
"aria-hidden": "true",
|
|
26368
26534
|
style: { "--sparkline-x": x(index), "--sparkline-y": y(point.value) },
|
|
26369
26535
|
children: [
|
|
26370
|
-
/* @__PURE__ */
|
|
26371
|
-
/* @__PURE__ */
|
|
26536
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.guide }),
|
|
26537
|
+
/* @__PURE__ */ jsx80("span", { className: Sparkline_default.dot })
|
|
26372
26538
|
]
|
|
26373
26539
|
}
|
|
26374
26540
|
) : null
|
|
@@ -26381,7 +26547,7 @@ function Sparkline({
|
|
|
26381
26547
|
}
|
|
26382
26548
|
|
|
26383
26549
|
// src/components/stepper/Stepper.tsx
|
|
26384
|
-
import * as
|
|
26550
|
+
import * as React88 from "react";
|
|
26385
26551
|
|
|
26386
26552
|
// src/components/stepper/Stepper.module.css
|
|
26387
26553
|
var Stepper_default = {
|
|
@@ -26399,10 +26565,10 @@ var Stepper_default = {
|
|
|
26399
26565
|
};
|
|
26400
26566
|
|
|
26401
26567
|
// src/components/stepper/Stepper.tsx
|
|
26402
|
-
import { jsx as
|
|
26568
|
+
import { jsx as jsx81, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
26403
26569
|
var [StepperRootProvider, useStepperRootContext] = createComponentContext("Stepper");
|
|
26404
26570
|
var [StepperItemProvider, useStepperItemContext] = createComponentContext("Stepper.Item");
|
|
26405
|
-
var StepperIndexContext =
|
|
26571
|
+
var StepperIndexContext = React88.createContext(null);
|
|
26406
26572
|
function deriveStatus(index, current) {
|
|
26407
26573
|
if (index < current) return "completed";
|
|
26408
26574
|
if (index === current) return "active";
|
|
@@ -26423,21 +26589,21 @@ function StepperRoot({
|
|
|
26423
26589
|
defaultValue,
|
|
26424
26590
|
onChange: onValueChange
|
|
26425
26591
|
});
|
|
26426
|
-
const contextValue =
|
|
26592
|
+
const contextValue = React88.useMemo(() => ({ value, select: setValue }), [value, setValue]);
|
|
26427
26593
|
let nextIndex = 0;
|
|
26428
26594
|
const items = [];
|
|
26429
|
-
for (const child of
|
|
26430
|
-
if (!
|
|
26595
|
+
for (const child of React88.Children.toArray(children)) {
|
|
26596
|
+
if (!React88.isValidElement(child) || child.type !== StepperItem) {
|
|
26431
26597
|
items.push(child);
|
|
26432
26598
|
continue;
|
|
26433
26599
|
}
|
|
26434
26600
|
const index = nextIndex;
|
|
26435
26601
|
nextIndex += 1;
|
|
26436
26602
|
items.push(
|
|
26437
|
-
/* @__PURE__ */
|
|
26603
|
+
/* @__PURE__ */ jsx81(StepperIndexContext.Provider, { value: index, children: child }, child.key)
|
|
26438
26604
|
);
|
|
26439
26605
|
}
|
|
26440
|
-
return /* @__PURE__ */
|
|
26606
|
+
return /* @__PURE__ */ jsx81(StepperRootProvider, { value: contextValue, children: /* @__PURE__ */ jsx81(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx81(
|
|
26441
26607
|
"ol",
|
|
26442
26608
|
{
|
|
26443
26609
|
...rest,
|
|
@@ -26457,15 +26623,15 @@ function StepperItem({
|
|
|
26457
26623
|
...rest
|
|
26458
26624
|
}) {
|
|
26459
26625
|
const { value, select } = useStepperRootContext();
|
|
26460
|
-
const index =
|
|
26626
|
+
const index = React88.useContext(StepperIndexContext);
|
|
26461
26627
|
if (index === null) {
|
|
26462
26628
|
throw new Error("Stepper.Item must be a direct child of Stepper.Root");
|
|
26463
26629
|
}
|
|
26464
26630
|
const status = statusProp ?? deriveStatus(index, value);
|
|
26465
|
-
const itemContext =
|
|
26466
|
-
return /* @__PURE__ */
|
|
26467
|
-
/* @__PURE__ */
|
|
26468
|
-
/* @__PURE__ */
|
|
26631
|
+
const itemContext = React88.useMemo(() => ({ index, status }), [index, status]);
|
|
26632
|
+
return /* @__PURE__ */ jsx81(StepperItemProvider, { value: itemContext, children: /* @__PURE__ */ jsxs68("li", { className: Stepper_default.item, children: [
|
|
26633
|
+
/* @__PURE__ */ jsx81("span", { className: Stepper_default.separator, "aria-hidden": "true", children: /* @__PURE__ */ jsx81(Icon, { name: "nav.chevronRight", className: Stepper_default.separatorIcon, strokeWidth: 2 }) }),
|
|
26634
|
+
/* @__PURE__ */ jsx81(
|
|
26469
26635
|
"button",
|
|
26470
26636
|
{
|
|
26471
26637
|
...rest,
|
|
@@ -26486,32 +26652,32 @@ function StepperItem({
|
|
|
26486
26652
|
StepperItem.displayName = "Stepper.Item";
|
|
26487
26653
|
function StepperIndicator({ children, className, ...rest }) {
|
|
26488
26654
|
const { status, index } = useStepperItemContext();
|
|
26489
|
-
return /* @__PURE__ */
|
|
26655
|
+
return /* @__PURE__ */ jsx81(
|
|
26490
26656
|
"span",
|
|
26491
26657
|
{
|
|
26492
26658
|
...rest,
|
|
26493
26659
|
className: cx(Stepper_default.indicator, className),
|
|
26494
26660
|
"data-status": status,
|
|
26495
26661
|
"aria-hidden": "true",
|
|
26496
|
-
children: children ?? (status === "completed" ? /* @__PURE__ */
|
|
26662
|
+
children: children ?? (status === "completed" ? /* @__PURE__ */ jsx81(Icon, { name: "action.check", className: Stepper_default.check, strokeWidth: 2 }) : index + 1)
|
|
26497
26663
|
}
|
|
26498
26664
|
);
|
|
26499
26665
|
}
|
|
26500
26666
|
StepperIndicator.displayName = "Stepper.Indicator";
|
|
26501
26667
|
function StepperContent({ className, ...rest }) {
|
|
26502
|
-
return /* @__PURE__ */
|
|
26668
|
+
return /* @__PURE__ */ jsx81("span", { ...rest, className: cx(Stepper_default.content, className) });
|
|
26503
26669
|
}
|
|
26504
26670
|
StepperContent.displayName = "Stepper.Content";
|
|
26505
26671
|
function StepperTitle({ className, ...rest }) {
|
|
26506
|
-
return /* @__PURE__ */
|
|
26672
|
+
return /* @__PURE__ */ jsx81("span", { ...rest, className: cx(Stepper_default.title, className) });
|
|
26507
26673
|
}
|
|
26508
26674
|
StepperTitle.displayName = "Stepper.Title";
|
|
26509
26675
|
function StepperDescription({ className, ...rest }) {
|
|
26510
|
-
return /* @__PURE__ */
|
|
26676
|
+
return /* @__PURE__ */ jsx81("span", { ...rest, className: cx(Stepper_default.description, className) });
|
|
26511
26677
|
}
|
|
26512
26678
|
StepperDescription.displayName = "Stepper.Description";
|
|
26513
26679
|
function StepperArrow({ className, ...rest }) {
|
|
26514
|
-
return /* @__PURE__ */
|
|
26680
|
+
return /* @__PURE__ */ jsx81(
|
|
26515
26681
|
Icon,
|
|
26516
26682
|
{
|
|
26517
26683
|
...rest,
|
|
@@ -26541,7 +26707,7 @@ var Switch_default = {
|
|
|
26541
26707
|
};
|
|
26542
26708
|
|
|
26543
26709
|
// src/components/switch/Switch.tsx
|
|
26544
|
-
import { Fragment as
|
|
26710
|
+
import { Fragment as Fragment35, jsx as jsx82, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
26545
26711
|
function SwitchRoot({
|
|
26546
26712
|
id,
|
|
26547
26713
|
checked: checkedProp,
|
|
@@ -26578,7 +26744,7 @@ function SwitchRoot({
|
|
|
26578
26744
|
}
|
|
26579
26745
|
changes.track(next, outcome, { onResolve: () => setStored(next) });
|
|
26580
26746
|
};
|
|
26581
|
-
return /* @__PURE__ */
|
|
26747
|
+
return /* @__PURE__ */ jsx82(
|
|
26582
26748
|
ChoiceField,
|
|
26583
26749
|
{
|
|
26584
26750
|
ids,
|
|
@@ -26589,8 +26755,8 @@ function SwitchRoot({
|
|
|
26589
26755
|
hint,
|
|
26590
26756
|
error,
|
|
26591
26757
|
className: cx(Switch_default.root, className),
|
|
26592
|
-
control: /* @__PURE__ */
|
|
26593
|
-
/* @__PURE__ */
|
|
26758
|
+
control: /* @__PURE__ */ jsxs69(Fragment35, { children: [
|
|
26759
|
+
/* @__PURE__ */ jsx82(
|
|
26594
26760
|
"input",
|
|
26595
26761
|
{
|
|
26596
26762
|
...inputRest,
|
|
@@ -26610,13 +26776,13 @@ function SwitchRoot({
|
|
|
26610
26776
|
}
|
|
26611
26777
|
}
|
|
26612
26778
|
),
|
|
26613
|
-
/* @__PURE__ */
|
|
26779
|
+
/* @__PURE__ */ jsx82(
|
|
26614
26780
|
"span",
|
|
26615
26781
|
{
|
|
26616
26782
|
className: cx(choiceVisualClass, Switch_default.track),
|
|
26617
26783
|
"data-loading": busy || void 0,
|
|
26618
26784
|
"aria-hidden": "true",
|
|
26619
|
-
children: /* @__PURE__ */
|
|
26785
|
+
children: /* @__PURE__ */ jsx82("span", { className: Switch_default.thumb, children: busy ? /* @__PURE__ */ jsx82(Spinner, { "aria-hidden": "true", className: cx(Switch_default.spinner, enterMotion_default.enter) }) : null })
|
|
26620
26786
|
}
|
|
26621
26787
|
)
|
|
26622
26788
|
] }),
|
|
@@ -26627,7 +26793,7 @@ function SwitchRoot({
|
|
|
26627
26793
|
SwitchRoot.displayName = "Switch.Root";
|
|
26628
26794
|
var takeNext = (_current, next) => next;
|
|
26629
26795
|
function SwitchLabel(props) {
|
|
26630
|
-
return /* @__PURE__ */
|
|
26796
|
+
return /* @__PURE__ */ jsx82(ChoiceLabel, { ...props });
|
|
26631
26797
|
}
|
|
26632
26798
|
SwitchLabel.displayName = "Switch.Label";
|
|
26633
26799
|
var Switch = {
|
|
@@ -26636,7 +26802,7 @@ var Switch = {
|
|
|
26636
26802
|
};
|
|
26637
26803
|
|
|
26638
26804
|
// src/components/tabs/Tabs.tsx
|
|
26639
|
-
import * as
|
|
26805
|
+
import * as React89 from "react";
|
|
26640
26806
|
|
|
26641
26807
|
// src/components/tabs/Tabs.module.css
|
|
26642
26808
|
var Tabs_default = {
|
|
@@ -26661,13 +26827,13 @@ var Tabs_default = {
|
|
|
26661
26827
|
};
|
|
26662
26828
|
|
|
26663
26829
|
// src/components/tabs/Tabs.tsx
|
|
26664
|
-
import { jsx as
|
|
26830
|
+
import { jsx as jsx83, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
26665
26831
|
var TABS_LABELS = {
|
|
26666
26832
|
remove: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0432\u043A\u043B\u0430\u0434\u043A\u0443 \xAB{label}\xBB"
|
|
26667
26833
|
};
|
|
26668
26834
|
var [TabsProvider, useTabsContext] = createComponentContext("Tabs");
|
|
26669
|
-
var CollapseContext =
|
|
26670
|
-
var TabIdContext =
|
|
26835
|
+
var CollapseContext = React89.createContext("full");
|
|
26836
|
+
var TabIdContext = React89.createContext(null);
|
|
26671
26837
|
var idPart = (value) => value.replace(/[^A-Za-z0-9_-]/g, "_");
|
|
26672
26838
|
var tabId = (rootId, value) => `prime-ui-kit-tab-${rootId}-${idPart(value)}`;
|
|
26673
26839
|
var panelId = (rootId, value) => `prime-ui-kit-panel-${rootId}-${idPart(value)}`;
|
|
@@ -26688,15 +26854,15 @@ function TabsRoot({
|
|
|
26688
26854
|
style,
|
|
26689
26855
|
...rest
|
|
26690
26856
|
}) {
|
|
26691
|
-
const rootId =
|
|
26857
|
+
const rootId = React89.useId();
|
|
26692
26858
|
const [activeValue, setActiveValue] = useControllableState({
|
|
26693
26859
|
value,
|
|
26694
26860
|
defaultValue,
|
|
26695
26861
|
onChange: onValueChange
|
|
26696
26862
|
});
|
|
26697
26863
|
const removeLabel = labels?.remove ?? TABS_LABELS.remove;
|
|
26698
|
-
const userChangeRef =
|
|
26699
|
-
const select =
|
|
26864
|
+
const userChangeRef = React89.useRef(false);
|
|
26865
|
+
const select = React89.useCallback(
|
|
26700
26866
|
(next) => {
|
|
26701
26867
|
if (next === activeValue) return;
|
|
26702
26868
|
userChangeRef.current = true;
|
|
@@ -26704,7 +26870,7 @@ function TabsRoot({
|
|
|
26704
26870
|
},
|
|
26705
26871
|
[activeValue, setActiveValue]
|
|
26706
26872
|
);
|
|
26707
|
-
const context =
|
|
26873
|
+
const context = React89.useMemo(
|
|
26708
26874
|
() => ({
|
|
26709
26875
|
activeValue,
|
|
26710
26876
|
select,
|
|
@@ -26720,14 +26886,14 @@ function TabsRoot({
|
|
|
26720
26886
|
...minItemWidth !== void 0 && { "--tabs-item-min": cssLength(minItemWidth) },
|
|
26721
26887
|
...maxItemWidth !== void 0 && { "--tabs-item-max": cssLength(maxItemWidth) }
|
|
26722
26888
|
};
|
|
26723
|
-
return /* @__PURE__ */
|
|
26889
|
+
return /* @__PURE__ */ jsx83(TabsProvider, { value: context, children: /* @__PURE__ */ jsx83(
|
|
26724
26890
|
"div",
|
|
26725
26891
|
{
|
|
26726
26892
|
...rest,
|
|
26727
26893
|
className: cx(Tabs_default.root, className),
|
|
26728
26894
|
style: { ...style, ...widths },
|
|
26729
26895
|
...toDataAttributes({ orientation, size, tone, "full-width": fullWidth }),
|
|
26730
|
-
children: /* @__PURE__ */
|
|
26896
|
+
children: /* @__PURE__ */ jsx83("div", { className: Tabs_default.layout, children })
|
|
26731
26897
|
}
|
|
26732
26898
|
) });
|
|
26733
26899
|
}
|
|
@@ -26833,8 +26999,8 @@ function revealActive(list, smooth) {
|
|
|
26833
26999
|
list.scrollTo({ left, behavior: smooth ? "smooth" : "auto" });
|
|
26834
27000
|
}
|
|
26835
27001
|
function useListLayout(listRef, indicatorRef, userChangeRef, activeValue, horizontal) {
|
|
26836
|
-
const [collapse, setCollapse] =
|
|
26837
|
-
|
|
27002
|
+
const [collapse, setCollapse] = React89.useState("full");
|
|
27003
|
+
React89.useLayoutEffect(() => {
|
|
26838
27004
|
const list = listRef.current;
|
|
26839
27005
|
const indicator = indicatorRef.current;
|
|
26840
27006
|
if (!list || !indicator) return;
|
|
@@ -26871,15 +27037,15 @@ function useListLayout(listRef, indicatorRef, userChangeRef, activeValue, horizo
|
|
|
26871
27037
|
resize?.disconnect();
|
|
26872
27038
|
};
|
|
26873
27039
|
}, [listRef, indicatorRef, userChangeRef, activeValue, horizontal]);
|
|
26874
|
-
|
|
27040
|
+
React89.useLayoutEffect(() => {
|
|
26875
27041
|
userChangeRef.current = false;
|
|
26876
27042
|
});
|
|
26877
27043
|
return collapse;
|
|
26878
27044
|
}
|
|
26879
27045
|
function TabsList({ children, className, ref, ...rest }) {
|
|
26880
27046
|
const { orientation, activeValue, select, userChangeRef, size } = useTabsContext();
|
|
26881
|
-
const listRef =
|
|
26882
|
-
const indicatorRef =
|
|
27047
|
+
const listRef = React89.useRef(null);
|
|
27048
|
+
const indicatorRef = React89.useRef(null);
|
|
26883
27049
|
const mergedRef = useMergedRefs(listRef, ref);
|
|
26884
27050
|
const horizontal = orientation === "horizontal";
|
|
26885
27051
|
const collapse = useListLayout(listRef, indicatorRef, userChangeRef, activeValue, horizontal);
|
|
@@ -26898,7 +27064,7 @@ function TabsList({ children, className, ref, ...rest }) {
|
|
|
26898
27064
|
}
|
|
26899
27065
|
return (
|
|
26900
27066
|
// The strip paints the band; the list inside scrolls and fades over it, the band never fades.
|
|
26901
|
-
/* @__PURE__ */
|
|
27067
|
+
/* @__PURE__ */ jsx83("div", { className: Tabs_default.strip, children: /* @__PURE__ */ jsxs70(
|
|
26902
27068
|
ScrollContainer,
|
|
26903
27069
|
{
|
|
26904
27070
|
...rest,
|
|
@@ -26912,7 +27078,7 @@ function TabsList({ children, className, ref, ...rest }) {
|
|
|
26912
27078
|
"data-collapse": collapse,
|
|
26913
27079
|
onKeyDown: handleKeyDown,
|
|
26914
27080
|
children: [
|
|
26915
|
-
/* @__PURE__ */
|
|
27081
|
+
/* @__PURE__ */ jsx83(
|
|
26916
27082
|
"div",
|
|
26917
27083
|
{
|
|
26918
27084
|
ref: indicatorRef,
|
|
@@ -26926,7 +27092,7 @@ function TabsList({ children, className, ref, ...rest }) {
|
|
|
26926
27092
|
}
|
|
26927
27093
|
}
|
|
26928
27094
|
),
|
|
26929
|
-
/* @__PURE__ */
|
|
27095
|
+
/* @__PURE__ */ jsx83(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx83(CollapseContext.Provider, { value: collapse, children }) })
|
|
26930
27096
|
]
|
|
26931
27097
|
}
|
|
26932
27098
|
) })
|
|
@@ -26934,23 +27100,23 @@ function TabsList({ children, className, ref, ...rest }) {
|
|
|
26934
27100
|
}
|
|
26935
27101
|
TabsList.displayName = "Tabs.List";
|
|
26936
27102
|
function hasChildOfType2(children, type) {
|
|
26937
|
-
return
|
|
26938
|
-
(child) =>
|
|
27103
|
+
return React89.Children.toArray(children).some(
|
|
27104
|
+
(child) => React89.isValidElement(child) && child.type === type
|
|
26939
27105
|
);
|
|
26940
27106
|
}
|
|
26941
27107
|
function labelOf(children) {
|
|
26942
|
-
for (const child of
|
|
27108
|
+
for (const child of React89.Children.toArray(children)) {
|
|
26943
27109
|
if (typeof child === "string" || typeof child === "number") return child;
|
|
26944
|
-
if (
|
|
27110
|
+
if (React89.isValidElement(child) && child.type === TabsLabel) {
|
|
26945
27111
|
return child.props.children;
|
|
26946
27112
|
}
|
|
26947
27113
|
}
|
|
26948
27114
|
return null;
|
|
26949
27115
|
}
|
|
26950
27116
|
function wrapText2(children) {
|
|
26951
|
-
return
|
|
27117
|
+
return React89.Children.map(
|
|
26952
27118
|
children,
|
|
26953
|
-
(child) => (typeof child === "string" || typeof child === "number") && String(child).trim() !== "" ? /* @__PURE__ */
|
|
27119
|
+
(child) => (typeof child === "string" || typeof child === "number") && String(child).trim() !== "" ? /* @__PURE__ */ jsx83(TabsLabel, { children: child }) : child
|
|
26954
27120
|
);
|
|
26955
27121
|
}
|
|
26956
27122
|
function TabsItem({
|
|
@@ -26966,10 +27132,10 @@ function TabsItem({
|
|
|
26966
27132
|
...rest
|
|
26967
27133
|
}) {
|
|
26968
27134
|
const { activeValue, select, size, rootId, labels } = useTabsContext();
|
|
26969
|
-
const collapse =
|
|
26970
|
-
const [tooltipOpen, setTooltipOpen] =
|
|
26971
|
-
const [removing, setRemoving] =
|
|
26972
|
-
const tabRef =
|
|
27135
|
+
const collapse = React89.useContext(CollapseContext);
|
|
27136
|
+
const [tooltipOpen, setTooltipOpen] = React89.useState(false);
|
|
27137
|
+
const [removing, setRemoving] = React89.useState(false);
|
|
27138
|
+
const tabRef = React89.useRef(null);
|
|
26973
27139
|
const mergedRef = useMergedRefs(tabRef, ref);
|
|
26974
27140
|
const isActive = activeValue === value;
|
|
26975
27141
|
const id = tabId(rootId, value);
|
|
@@ -27012,7 +27178,7 @@ function TabsItem({
|
|
|
27012
27178
|
() => setRemoving(false)
|
|
27013
27179
|
);
|
|
27014
27180
|
}
|
|
27015
|
-
return /* @__PURE__ */
|
|
27181
|
+
return /* @__PURE__ */ jsxs70(
|
|
27016
27182
|
"div",
|
|
27017
27183
|
{
|
|
27018
27184
|
className: Tabs_default.item,
|
|
@@ -27023,8 +27189,8 @@ function TabsItem({
|
|
|
27023
27189
|
removable: removable || void 0
|
|
27024
27190
|
}),
|
|
27025
27191
|
children: [
|
|
27026
|
-
/* @__PURE__ */
|
|
27027
|
-
/* @__PURE__ */
|
|
27192
|
+
/* @__PURE__ */ jsxs70(Tooltip.Root, { open: iconOnly && tooltipOpen, onOpenChange: setTooltipOpen, children: [
|
|
27193
|
+
/* @__PURE__ */ jsx83(Tooltip.Trigger, { children: /* @__PURE__ */ jsx83(
|
|
27028
27194
|
"button",
|
|
27029
27195
|
{
|
|
27030
27196
|
...rest,
|
|
@@ -27065,14 +27231,14 @@ function TabsItem({
|
|
|
27065
27231
|
event.preventDefault();
|
|
27066
27232
|
remove();
|
|
27067
27233
|
},
|
|
27068
|
-
children: /* @__PURE__ */
|
|
27234
|
+
children: /* @__PURE__ */ jsx83("span", { className: Tabs_default.content, children: /* @__PURE__ */ jsx83(TabIdContext.Provider, { value: id, children: wrapText2(children) }) })
|
|
27069
27235
|
}
|
|
27070
27236
|
) }),
|
|
27071
|
-
iconOnly ? /* @__PURE__ */
|
|
27237
|
+
iconOnly ? /* @__PURE__ */ jsx83(Tooltip.Content, { children: label }) : null
|
|
27072
27238
|
] }),
|
|
27073
27239
|
removable ? (
|
|
27074
27240
|
// Out of the tab order: the focused tab closes with Delete; the button is for the pointer.
|
|
27075
|
-
/* @__PURE__ */
|
|
27241
|
+
/* @__PURE__ */ jsx83("span", { className: Tabs_default.remove, children: /* @__PURE__ */ jsx83(
|
|
27076
27242
|
Button.Root,
|
|
27077
27243
|
{
|
|
27078
27244
|
variant: "ghost",
|
|
@@ -27082,7 +27248,7 @@ function TabsItem({
|
|
|
27082
27248
|
loading: removing,
|
|
27083
27249
|
"aria-label": formatLabel(labels.remove, { label: labelText }),
|
|
27084
27250
|
onClick: remove,
|
|
27085
|
-
children: /* @__PURE__ */
|
|
27251
|
+
children: /* @__PURE__ */ jsx83(Button.Icon, { children: /* @__PURE__ */ jsx83(Icon, { name: "action.close" }) })
|
|
27086
27252
|
}
|
|
27087
27253
|
) })
|
|
27088
27254
|
) : null
|
|
@@ -27092,27 +27258,27 @@ function TabsItem({
|
|
|
27092
27258
|
}
|
|
27093
27259
|
TabsItem.displayName = "Tabs.Item";
|
|
27094
27260
|
function TabsIcon({ children, className, ...rest }) {
|
|
27095
|
-
return /* @__PURE__ */
|
|
27261
|
+
return /* @__PURE__ */ jsx83("span", { className: cx(Tabs_default.icon, className), "aria-hidden": "true", ...rest, children });
|
|
27096
27262
|
}
|
|
27097
27263
|
TabsIcon.displayName = "Tabs.Icon";
|
|
27098
27264
|
function TabsLabel({ children, className, ...rest }) {
|
|
27099
|
-
const id =
|
|
27265
|
+
const id = React89.useContext(TabIdContext);
|
|
27100
27266
|
const text = typeof children === "string" || typeof children === "number" ? String(children) : "";
|
|
27101
|
-
return /* @__PURE__ */
|
|
27267
|
+
return /* @__PURE__ */ jsx83(
|
|
27102
27268
|
"span",
|
|
27103
27269
|
{
|
|
27104
27270
|
id: id ? `${id}-label` : void 0,
|
|
27105
27271
|
className: cx(Tabs_default.label, className),
|
|
27106
27272
|
"data-text": text || void 0,
|
|
27107
27273
|
...rest,
|
|
27108
|
-
children: /* @__PURE__ */
|
|
27274
|
+
children: /* @__PURE__ */ jsx83("span", { className: Tabs_default.labelText, children })
|
|
27109
27275
|
}
|
|
27110
27276
|
);
|
|
27111
27277
|
}
|
|
27112
27278
|
TabsLabel.displayName = "Tabs.Label";
|
|
27113
27279
|
function TabsCount({ color = "gray", children, className, ...rest }) {
|
|
27114
|
-
const id =
|
|
27115
|
-
return /* @__PURE__ */
|
|
27280
|
+
const id = React89.useContext(TabIdContext);
|
|
27281
|
+
return /* @__PURE__ */ jsx83(
|
|
27116
27282
|
Badge.Root,
|
|
27117
27283
|
{
|
|
27118
27284
|
...rest,
|
|
@@ -27125,8 +27291,8 @@ function TabsCount({ color = "gray", children, className, ...rest }) {
|
|
|
27125
27291
|
}
|
|
27126
27292
|
TabsCount.displayName = "Tabs.Count";
|
|
27127
27293
|
function TabsDescription({ children, className, ...rest }) {
|
|
27128
|
-
const id =
|
|
27129
|
-
return /* @__PURE__ */
|
|
27294
|
+
const id = React89.useContext(TabIdContext);
|
|
27295
|
+
return /* @__PURE__ */ jsx83(
|
|
27130
27296
|
"span",
|
|
27131
27297
|
{
|
|
27132
27298
|
id: id ? `${id}-description` : void 0,
|
|
@@ -27139,7 +27305,7 @@ function TabsDescription({ children, className, ...rest }) {
|
|
|
27139
27305
|
TabsDescription.displayName = "Tabs.Description";
|
|
27140
27306
|
function TabsSeparator({ className, ...rest }) {
|
|
27141
27307
|
const { orientation } = useTabsContext();
|
|
27142
|
-
return /* @__PURE__ */
|
|
27308
|
+
return /* @__PURE__ */ jsx83(
|
|
27143
27309
|
Divider,
|
|
27144
27310
|
{
|
|
27145
27311
|
...rest,
|
|
@@ -27154,7 +27320,7 @@ TabsSeparator.displayName = "Tabs.Separator";
|
|
|
27154
27320
|
function TabsPanel({ value, children, className, ...rest }) {
|
|
27155
27321
|
const { activeValue, rootId } = useTabsContext();
|
|
27156
27322
|
if (activeValue !== value) return null;
|
|
27157
|
-
return /* @__PURE__ */
|
|
27323
|
+
return /* @__PURE__ */ jsx83(
|
|
27158
27324
|
"div",
|
|
27159
27325
|
{
|
|
27160
27326
|
...rest,
|
|
@@ -27163,7 +27329,7 @@ function TabsPanel({ value, children, className, ...rest }) {
|
|
|
27163
27329
|
"aria-labelledby": tabId(rootId, value),
|
|
27164
27330
|
tabIndex: 0,
|
|
27165
27331
|
className: cx(Tabs_default.panel, className),
|
|
27166
|
-
children: /* @__PURE__ */
|
|
27332
|
+
children: /* @__PURE__ */ jsx83("div", { className: cx(Tabs_default.panelContent, enterMotion_default.enterBase), children })
|
|
27167
27333
|
}
|
|
27168
27334
|
);
|
|
27169
27335
|
}
|
|
@@ -27181,10 +27347,10 @@ var Tabs = {
|
|
|
27181
27347
|
};
|
|
27182
27348
|
|
|
27183
27349
|
// src/components/tag-select/TagSelect.tsx
|
|
27184
|
-
import * as
|
|
27350
|
+
import * as React93 from "react";
|
|
27185
27351
|
|
|
27186
27352
|
// src/components/tag-select/TagOptionMenu.tsx
|
|
27187
|
-
import * as
|
|
27353
|
+
import * as React90 from "react";
|
|
27188
27354
|
|
|
27189
27355
|
// src/components/tag-select/TagSelect.module.css
|
|
27190
27356
|
var TagSelect_default = {
|
|
@@ -27213,7 +27379,7 @@ var TagSelect_default = {
|
|
|
27213
27379
|
};
|
|
27214
27380
|
|
|
27215
27381
|
// src/components/tag-select/TagOptionMenu.tsx
|
|
27216
|
-
import { Fragment as
|
|
27382
|
+
import { Fragment as Fragment36, jsx as jsx84, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
27217
27383
|
var TAG_COLORS = [
|
|
27218
27384
|
"gray",
|
|
27219
27385
|
"red",
|
|
@@ -27239,8 +27405,8 @@ function TagOptionMenu({
|
|
|
27239
27405
|
pending,
|
|
27240
27406
|
saving
|
|
27241
27407
|
}) {
|
|
27242
|
-
const [draft, setDraft] =
|
|
27243
|
-
|
|
27408
|
+
const [draft, setDraft] = React90.useState(label);
|
|
27409
|
+
React90.useEffect(() => {
|
|
27244
27410
|
if (open) setDraft(label);
|
|
27245
27411
|
}, [open, label]);
|
|
27246
27412
|
const commitLabel = () => {
|
|
@@ -27248,8 +27414,8 @@ function TagOptionMenu({
|
|
|
27248
27414
|
if (next && next !== label) onUpdate?.(value, { label: next });
|
|
27249
27415
|
if (!next) setDraft(label);
|
|
27250
27416
|
};
|
|
27251
|
-
return /* @__PURE__ */
|
|
27252
|
-
/* @__PURE__ */
|
|
27417
|
+
return /* @__PURE__ */ jsxs71(Popover.Root, { open, onOpenChange, children: [
|
|
27418
|
+
/* @__PURE__ */ jsx84(Popover.Trigger, { children: /* @__PURE__ */ jsx84(
|
|
27253
27419
|
Button.Root,
|
|
27254
27420
|
{
|
|
27255
27421
|
variant: "ghost",
|
|
@@ -27260,11 +27426,11 @@ function TagOptionMenu({
|
|
|
27260
27426
|
loading: pending || saving,
|
|
27261
27427
|
className: TagSelect_default.menuTrigger,
|
|
27262
27428
|
onMouseDown: (event) => event.preventDefault(),
|
|
27263
|
-
children: /* @__PURE__ */
|
|
27429
|
+
children: /* @__PURE__ */ jsx84(Button.Icon, { children: /* @__PURE__ */ jsx84(Icon, { name: "action.more" }) })
|
|
27264
27430
|
}
|
|
27265
27431
|
) }),
|
|
27266
|
-
/* @__PURE__ */
|
|
27267
|
-
onUpdate ? /* @__PURE__ */
|
|
27432
|
+
/* @__PURE__ */ jsx84(Popover.Content, { size: "s", flush: true, className: TagSelect_default.menuPanel, children: /* @__PURE__ */ jsxs71("div", { className: TagSelect_default.menuBody, children: [
|
|
27433
|
+
onUpdate ? /* @__PURE__ */ jsx84(Input.Root, { size: "s", children: /* @__PURE__ */ jsx84(Input.Wrapper, { children: /* @__PURE__ */ jsx84(
|
|
27268
27434
|
Input.Field,
|
|
27269
27435
|
{
|
|
27270
27436
|
autoFocus: true,
|
|
@@ -27280,7 +27446,7 @@ function TagOptionMenu({
|
|
|
27280
27446
|
}
|
|
27281
27447
|
}
|
|
27282
27448
|
) }) }) : null,
|
|
27283
|
-
onDelete ? /* @__PURE__ */
|
|
27449
|
+
onDelete ? /* @__PURE__ */ jsxs71(
|
|
27284
27450
|
Button.Root,
|
|
27285
27451
|
{
|
|
27286
27452
|
variant: "ghost",
|
|
@@ -27292,15 +27458,15 @@ function TagOptionMenu({
|
|
|
27292
27458
|
onDelete(value);
|
|
27293
27459
|
},
|
|
27294
27460
|
children: [
|
|
27295
|
-
/* @__PURE__ */
|
|
27461
|
+
/* @__PURE__ */ jsx84(Button.Icon, { children: /* @__PURE__ */ jsx84(Icon, { name: "action.delete" }) }),
|
|
27296
27462
|
labels.delete
|
|
27297
27463
|
]
|
|
27298
27464
|
}
|
|
27299
27465
|
) : null,
|
|
27300
|
-
onUpdate ? /* @__PURE__ */
|
|
27301
|
-
/* @__PURE__ */
|
|
27302
|
-
/* @__PURE__ */
|
|
27303
|
-
/* @__PURE__ */
|
|
27466
|
+
onUpdate ? /* @__PURE__ */ jsxs71(Fragment36, { children: [
|
|
27467
|
+
/* @__PURE__ */ jsx84(Divider, { className: menu_default.separator }),
|
|
27468
|
+
/* @__PURE__ */ jsx84("div", { className: menu_default.groupLabel, children: labels.colors }),
|
|
27469
|
+
/* @__PURE__ */ jsx84("div", { className: menu_default.tier, "data-size": "s", children: TAG_COLORS.map((hue) => /* @__PURE__ */ jsxs71(
|
|
27304
27470
|
"button",
|
|
27305
27471
|
{
|
|
27306
27472
|
type: "button",
|
|
@@ -27308,8 +27474,8 @@ function TagOptionMenu({
|
|
|
27308
27474
|
className: cx(menu_default.item, TagSelect_default.colorRow),
|
|
27309
27475
|
onClick: () => onUpdate(value, { color: hue }),
|
|
27310
27476
|
children: [
|
|
27311
|
-
/* @__PURE__ */
|
|
27312
|
-
/* @__PURE__ */
|
|
27477
|
+
/* @__PURE__ */ jsx84(Badge.Root, { color: hue, children: labels.colorNames[hue] }),
|
|
27478
|
+
/* @__PURE__ */ jsx84("span", { className: TagSelect_default.colorCheck, "aria-hidden": "true", children: color === hue ? /* @__PURE__ */ jsx84(Icon, { name: "action.check" }) : null })
|
|
27313
27479
|
]
|
|
27314
27480
|
},
|
|
27315
27481
|
hue
|
|
@@ -27320,7 +27486,7 @@ function TagOptionMenu({
|
|
|
27320
27486
|
}
|
|
27321
27487
|
|
|
27322
27488
|
// src/components/tag-select/useChipOverflow.ts
|
|
27323
|
-
import * as
|
|
27489
|
+
import * as React91 from "react";
|
|
27324
27490
|
function useChipOverflow({
|
|
27325
27491
|
rowRef,
|
|
27326
27492
|
measureRef,
|
|
@@ -27329,8 +27495,8 @@ function useChipOverflow({
|
|
|
27329
27495
|
inputCollapsed
|
|
27330
27496
|
}) {
|
|
27331
27497
|
const count = chips.length;
|
|
27332
|
-
const [visible, setVisible] =
|
|
27333
|
-
const recompute =
|
|
27498
|
+
const [visible, setVisible] = React91.useState(count);
|
|
27499
|
+
const recompute = React91.useCallback(() => {
|
|
27334
27500
|
const row = rowRef.current;
|
|
27335
27501
|
const measure3 = measureRef.current;
|
|
27336
27502
|
if (!row || !measure3) return;
|
|
@@ -27357,10 +27523,10 @@ function useChipOverflow({
|
|
|
27357
27523
|
}
|
|
27358
27524
|
setVisible((prev) => prev === next ? prev : next);
|
|
27359
27525
|
}, [rowRef, measureRef, inputRef, inputCollapsed]);
|
|
27360
|
-
|
|
27526
|
+
React91.useLayoutEffect(() => {
|
|
27361
27527
|
recompute();
|
|
27362
27528
|
}, [recompute, chips]);
|
|
27363
|
-
|
|
27529
|
+
React91.useEffect(() => {
|
|
27364
27530
|
const row = rowRef.current;
|
|
27365
27531
|
const measure3 = measureRef.current;
|
|
27366
27532
|
if (!row || typeof ResizeObserver === "undefined") return;
|
|
@@ -27373,8 +27539,8 @@ function useChipOverflow({
|
|
|
27373
27539
|
}
|
|
27374
27540
|
|
|
27375
27541
|
// src/components/tag-select/VirtualOptions.tsx
|
|
27376
|
-
import * as
|
|
27377
|
-
import { Fragment as
|
|
27542
|
+
import * as React92 from "react";
|
|
27543
|
+
import { Fragment as Fragment38, jsx as jsx85, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
27378
27544
|
var ONE_GROUP2 = () => 0;
|
|
27379
27545
|
function VirtualOptions({
|
|
27380
27546
|
count,
|
|
@@ -27385,18 +27551,18 @@ function VirtualOptions({
|
|
|
27385
27551
|
renderOption,
|
|
27386
27552
|
ref
|
|
27387
27553
|
}) {
|
|
27388
|
-
const startRef =
|
|
27389
|
-
const offset =
|
|
27554
|
+
const startRef = React92.useRef(null);
|
|
27555
|
+
const offset = React92.useCallback(() => {
|
|
27390
27556
|
const scroller = scrollRef.current;
|
|
27391
27557
|
const start = startRef.current;
|
|
27392
27558
|
if (!scroller || !start) return 0;
|
|
27393
27559
|
return start.getBoundingClientRect().top - scroller.getBoundingClientRect().top + scroller.scrollTop;
|
|
27394
27560
|
}, [scrollRef]);
|
|
27395
|
-
const estimate =
|
|
27561
|
+
const estimate = React92.useMemo(
|
|
27396
27562
|
() => readCssLengthPx(`--prime-control-${size}-height`, 36),
|
|
27397
27563
|
[size]
|
|
27398
27564
|
);
|
|
27399
|
-
const estimateSize =
|
|
27565
|
+
const estimateSize = React92.useCallback(() => estimate, [estimate]);
|
|
27400
27566
|
const virtual = useVirtualRows({
|
|
27401
27567
|
count,
|
|
27402
27568
|
scrollRef,
|
|
@@ -27407,7 +27573,7 @@ function VirtualOptions({
|
|
|
27407
27573
|
pinned
|
|
27408
27574
|
});
|
|
27409
27575
|
const { startOf } = virtual;
|
|
27410
|
-
|
|
27576
|
+
React92.useImperativeHandle(
|
|
27411
27577
|
ref,
|
|
27412
27578
|
() => ({
|
|
27413
27579
|
reveal(index) {
|
|
@@ -27424,10 +27590,10 @@ function VirtualOptions({
|
|
|
27424
27590
|
[scrollRef, offset, startOf]
|
|
27425
27591
|
);
|
|
27426
27592
|
const laid = rowGaps(virtual);
|
|
27427
|
-
const spacer = (key, height) => height > 0 ? /* @__PURE__ */
|
|
27428
|
-
return /* @__PURE__ */
|
|
27429
|
-
/* @__PURE__ */
|
|
27430
|
-
laid.rows.map(({ index, gap }) => /* @__PURE__ */
|
|
27593
|
+
const spacer = (key, height) => height > 0 ? /* @__PURE__ */ jsx85("div", { className: TagSelect_default.spacer, style: { height }, "aria-hidden": "true" }, key) : null;
|
|
27594
|
+
return /* @__PURE__ */ jsxs72(Fragment38, { children: [
|
|
27595
|
+
/* @__PURE__ */ jsx85("div", { ref: startRef, "aria-hidden": "true" }),
|
|
27596
|
+
laid.rows.map(({ index, gap }) => /* @__PURE__ */ jsxs72(React92.Fragment, { children: [
|
|
27431
27597
|
spacer("gap", gap),
|
|
27432
27598
|
renderOption(index, virtual.measure(index))
|
|
27433
27599
|
] }, getKey(index))),
|
|
@@ -27436,7 +27602,7 @@ function VirtualOptions({
|
|
|
27436
27602
|
}
|
|
27437
27603
|
|
|
27438
27604
|
// src/components/tag-select/TagSelect.tsx
|
|
27439
|
-
import { Fragment as
|
|
27605
|
+
import { Fragment as Fragment39, jsx as jsx86, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
27440
27606
|
var TAG_SELECT_LABELS = {
|
|
27441
27607
|
panelHint: "\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0430\u0440\u0438\u0430\u043D\u0442 \u0438\u043B\u0438 \u0441\u043E\u0437\u0434\u0430\u0439\u0442\u0435 \u043D\u043E\u0432\u044B\u0439",
|
|
27442
27608
|
create: "\u0421\u043E\u0437\u0434\u0430\u0442\u044C",
|
|
@@ -27514,7 +27680,7 @@ function TagSelect({
|
|
|
27514
27680
|
...rest
|
|
27515
27681
|
}) {
|
|
27516
27682
|
const disabled = useInheritedDisabled(disabledProp);
|
|
27517
|
-
const labels =
|
|
27683
|
+
const labels = React93.useMemo(
|
|
27518
27684
|
() => ({
|
|
27519
27685
|
...TAG_SELECT_LABELS,
|
|
27520
27686
|
...labelsProp,
|
|
@@ -27535,31 +27701,31 @@ function TagSelect({
|
|
|
27535
27701
|
defaultValue: defaultOpen,
|
|
27536
27702
|
onChange: onOpenChange
|
|
27537
27703
|
});
|
|
27538
|
-
const [inputValue, setInputValue] =
|
|
27539
|
-
const [focusWithin, setFocusWithin] =
|
|
27540
|
-
const [announcement, setAnnouncement] =
|
|
27704
|
+
const [inputValue, setInputValue] = React93.useState("");
|
|
27705
|
+
const [focusWithin, setFocusWithin] = React93.useState(false);
|
|
27706
|
+
const [announcement, setAnnouncement] = React93.useState("");
|
|
27541
27707
|
const highlight = useCreateStore(void 0);
|
|
27542
|
-
const [menuValue, setMenuValue] =
|
|
27543
|
-
const [created, setCreated] =
|
|
27544
|
-
const [deleting, setDeleting] =
|
|
27545
|
-
const [creating, setCreating] =
|
|
27546
|
-
const pendingChipFocus =
|
|
27547
|
-
const triggerRef =
|
|
27548
|
-
const chipsRef =
|
|
27549
|
-
const measureRef =
|
|
27550
|
-
const inputRef =
|
|
27551
|
-
const knownOptions =
|
|
27708
|
+
const [menuValue, setMenuValue] = React93.useState(null);
|
|
27709
|
+
const [created, setCreated] = React93.useState([]);
|
|
27710
|
+
const [deleting, setDeleting] = React93.useState(() => /* @__PURE__ */ new Set());
|
|
27711
|
+
const [creating, setCreating] = React93.useState(() => /* @__PURE__ */ new Set());
|
|
27712
|
+
const pendingChipFocus = React93.useRef(null);
|
|
27713
|
+
const triggerRef = React93.useRef(null);
|
|
27714
|
+
const chipsRef = React93.useRef(null);
|
|
27715
|
+
const measureRef = React93.useRef(null);
|
|
27716
|
+
const inputRef = React93.useRef(null);
|
|
27717
|
+
const knownOptions = React93.useMemo(() => {
|
|
27552
27718
|
const extra = created.filter((c) => !options.some((o) => o.value === c.value));
|
|
27553
27719
|
return extra.length ? [...options, ...extra] : options;
|
|
27554
27720
|
}, [options, created]);
|
|
27555
27721
|
const optionChanges = usePendingChanges(knownOptions, updateOption);
|
|
27556
27722
|
const allOptions = optionChanges.shown;
|
|
27557
|
-
const updating =
|
|
27723
|
+
const updating = React93.useMemo(
|
|
27558
27724
|
() => new Set(optionChanges.pending.map((change) => change.value)),
|
|
27559
27725
|
[optionChanges.pending]
|
|
27560
27726
|
);
|
|
27561
27727
|
const inputTrim = inputValue.trim();
|
|
27562
|
-
const listed =
|
|
27728
|
+
const listed = React93.useMemo(
|
|
27563
27729
|
() => listOptions(allOptions, inputValue, selected),
|
|
27564
27730
|
[allOptions, inputValue, selected]
|
|
27565
27731
|
);
|
|
@@ -27567,14 +27733,14 @@ function TagSelect({
|
|
|
27567
27733
|
const hasPanelContent = listed.length > 0 || showCreate;
|
|
27568
27734
|
const manageable = Boolean(onOptionUpdate || onOptionDelete);
|
|
27569
27735
|
const shown = open && hasPanelContent;
|
|
27570
|
-
const navigable =
|
|
27736
|
+
const navigable = React93.useMemo(
|
|
27571
27737
|
() => [
|
|
27572
27738
|
...showCreate ? [CREATE_VALUE] : [],
|
|
27573
27739
|
...listed.filter((o) => !o.disabled).map((o) => o.value)
|
|
27574
27740
|
],
|
|
27575
27741
|
[listed, showCreate]
|
|
27576
27742
|
);
|
|
27577
|
-
|
|
27743
|
+
React93.useLayoutEffect(() => {
|
|
27578
27744
|
const current = highlight.get();
|
|
27579
27745
|
if (!shown || navigable.length === 0) highlight.set(void 0);
|
|
27580
27746
|
else if (current === void 0 || !navigable.includes(current)) highlight.set(navigable[0]);
|
|
@@ -27587,17 +27753,17 @@ function TagSelect({
|
|
|
27587
27753
|
matchAnchorWidth: true
|
|
27588
27754
|
});
|
|
27589
27755
|
const listboxRef = floating.contentRef;
|
|
27590
|
-
const scrollerRef =
|
|
27591
|
-
const virtualRef =
|
|
27756
|
+
const scrollerRef = React93.useRef(null);
|
|
27757
|
+
const virtualRef = React93.useRef(null);
|
|
27592
27758
|
const virtualized = listed.length > VIRTUAL_FROM2;
|
|
27593
27759
|
const pinnedHighlight = useStoreSlice(highlight, (value) => virtualized ? value : void 0);
|
|
27594
|
-
const pinnedOptions =
|
|
27760
|
+
const pinnedOptions = React93.useMemo(() => {
|
|
27595
27761
|
if (!virtualized) return [];
|
|
27596
27762
|
return listed.flatMap(
|
|
27597
27763
|
(option, index) => option.value === pinnedHighlight || option.value === menuValue ? [index] : []
|
|
27598
27764
|
);
|
|
27599
27765
|
}, [virtualized, listed, pinnedHighlight, menuValue]);
|
|
27600
|
-
const getOptionKey =
|
|
27766
|
+
const getOptionKey = React93.useCallback((index) => listed[index]?.value ?? "", [listed]);
|
|
27601
27767
|
const revealOption = (value) => {
|
|
27602
27768
|
const index = virtualized ? listed.findIndex((option) => option.value === value) : -1;
|
|
27603
27769
|
if (index >= 0) virtualRef.current?.reveal(index);
|
|
@@ -27687,7 +27853,7 @@ function TagSelect({
|
|
|
27687
27853
|
}
|
|
27688
27854
|
setInputValue("");
|
|
27689
27855
|
};
|
|
27690
|
-
const chips =
|
|
27856
|
+
const chips = React93.useMemo(() => {
|
|
27691
27857
|
const byValue = new Map(allOptions.map((o) => [o.value, o]));
|
|
27692
27858
|
return selected.map((v) => {
|
|
27693
27859
|
const option = byValue.get(v);
|
|
@@ -27703,7 +27869,7 @@ function TagSelect({
|
|
|
27703
27869
|
// A chip on its way out (`data-leaving`) is a copy that only closes up.
|
|
27704
27870
|
chipsRef.current?.querySelectorAll("[data-chip-value]:not([data-leaving])") ?? []
|
|
27705
27871
|
);
|
|
27706
|
-
|
|
27872
|
+
React93.useLayoutEffect(() => {
|
|
27707
27873
|
const target = pendingChipFocus.current;
|
|
27708
27874
|
if (target === null) return;
|
|
27709
27875
|
pendingChipFocus.current = null;
|
|
@@ -27722,7 +27888,7 @@ function TagSelect({
|
|
|
27722
27888
|
});
|
|
27723
27889
|
const visibleChips = expanded ? chips : chips.slice(0, visibleCount);
|
|
27724
27890
|
const hiddenChips = expanded ? [] : chips.slice(visibleCount);
|
|
27725
|
-
|
|
27891
|
+
React93.useEffect(() => {
|
|
27726
27892
|
const row = chipsRef.current;
|
|
27727
27893
|
if (expanded && row) row.scrollTop = row.scrollHeight;
|
|
27728
27894
|
}, [expanded]);
|
|
@@ -27800,19 +27966,19 @@ function TagSelect({
|
|
|
27800
27966
|
const pickOption = () => {
|
|
27801
27967
|
if (!option.disabled) pick(option.value);
|
|
27802
27968
|
};
|
|
27803
|
-
const content = /* @__PURE__ */
|
|
27804
|
-
/* @__PURE__ */
|
|
27805
|
-
/* @__PURE__ */
|
|
27969
|
+
const content = /* @__PURE__ */ jsxs73(Fragment39, { children: [
|
|
27970
|
+
/* @__PURE__ */ jsx86(Checkbox.Indicator, { checked: isSelected, disabled: option.disabled, size: stepDown(size) }),
|
|
27971
|
+
/* @__PURE__ */ jsx86(
|
|
27806
27972
|
Badge.Root,
|
|
27807
27973
|
{
|
|
27808
27974
|
color: option.color ?? defaultColor,
|
|
27809
27975
|
disabled: option.disabled,
|
|
27810
27976
|
className: TagSelect_default.chip,
|
|
27811
|
-
children: /* @__PURE__ */
|
|
27977
|
+
children: /* @__PURE__ */ jsx86("span", { className: TagSelect_default.chipLabel, children: option.label })
|
|
27812
27978
|
}
|
|
27813
27979
|
)
|
|
27814
27980
|
] });
|
|
27815
|
-
return /* @__PURE__ */
|
|
27981
|
+
return /* @__PURE__ */ jsx86(
|
|
27816
27982
|
OptionRow,
|
|
27817
27983
|
{
|
|
27818
27984
|
id: optionDomId(listboxId, option.value),
|
|
@@ -27827,8 +27993,8 @@ function TagSelect({
|
|
|
27827
27993
|
ref: windowed?.measure,
|
|
27828
27994
|
posInSet: windowed ? windowed.index + 1 + (showCreate ? 1 : 0) : void 0,
|
|
27829
27995
|
setSize: windowed ? setSize : void 0,
|
|
27830
|
-
children: manageable ? /* @__PURE__ */
|
|
27831
|
-
/* @__PURE__ */
|
|
27996
|
+
children: manageable ? /* @__PURE__ */ jsxs73(Fragment39, { children: [
|
|
27997
|
+
/* @__PURE__ */ jsx86(
|
|
27832
27998
|
"button",
|
|
27833
27999
|
{
|
|
27834
28000
|
type: "button",
|
|
@@ -27842,7 +28008,7 @@ function TagSelect({
|
|
|
27842
28008
|
children: content
|
|
27843
28009
|
}
|
|
27844
28010
|
),
|
|
27845
|
-
option.disabled ? null : /* @__PURE__ */
|
|
28011
|
+
option.disabled ? null : /* @__PURE__ */ jsx86(
|
|
27846
28012
|
TagOptionMenu,
|
|
27847
28013
|
{
|
|
27848
28014
|
value: option.value,
|
|
@@ -27863,7 +28029,7 @@ function TagSelect({
|
|
|
27863
28029
|
option.value
|
|
27864
28030
|
);
|
|
27865
28031
|
};
|
|
27866
|
-
return /* @__PURE__ */
|
|
28032
|
+
return /* @__PURE__ */ jsx86(
|
|
27867
28033
|
FieldFrame,
|
|
27868
28034
|
{
|
|
27869
28035
|
...rest,
|
|
@@ -27877,8 +28043,8 @@ function TagSelect({
|
|
|
27877
28043
|
disabled,
|
|
27878
28044
|
optionalLabel: labels.optional,
|
|
27879
28045
|
className,
|
|
27880
|
-
children: /* @__PURE__ */
|
|
27881
|
-
/* @__PURE__ */
|
|
28046
|
+
children: /* @__PURE__ */ jsxs73(ControlSizeProvider, { value: size, children: [
|
|
28047
|
+
/* @__PURE__ */ jsxs73(
|
|
27882
28048
|
"div",
|
|
27883
28049
|
{
|
|
27884
28050
|
ref: triggerRef,
|
|
@@ -27905,7 +28071,7 @@ function TagSelect({
|
|
|
27905
28071
|
"focus-ring": focusRing ? void 0 : false
|
|
27906
28072
|
}),
|
|
27907
28073
|
children: [
|
|
27908
|
-
/* @__PURE__ */
|
|
28074
|
+
/* @__PURE__ */ jsxs73(
|
|
27909
28075
|
ScrollContainer,
|
|
27910
28076
|
{
|
|
27911
28077
|
ref: chipsRef,
|
|
@@ -27913,7 +28079,7 @@ function TagSelect({
|
|
|
27913
28079
|
lock: !expanded,
|
|
27914
28080
|
className: TagSelect_default.chips,
|
|
27915
28081
|
children: [
|
|
27916
|
-
visibleChips.map((chip, index) => /* @__PURE__ */
|
|
28082
|
+
visibleChips.map((chip, index) => /* @__PURE__ */ jsx86(
|
|
27917
28083
|
Badge.Root,
|
|
27918
28084
|
{
|
|
27919
28085
|
color: chip.color,
|
|
@@ -27931,13 +28097,13 @@ function TagSelect({
|
|
|
27931
28097
|
onClick: (event) => {
|
|
27932
28098
|
if (event.target.closest("button")) event.stopPropagation();
|
|
27933
28099
|
},
|
|
27934
|
-
children: /* @__PURE__ */
|
|
28100
|
+
children: /* @__PURE__ */ jsx86("span", { className: TagSelect_default.chipLabel, children: chip.label })
|
|
27935
28101
|
},
|
|
27936
28102
|
chip.value
|
|
27937
28103
|
)),
|
|
27938
28104
|
hiddenChips.length > 0 ? (
|
|
27939
28105
|
// A real button; the click bubbles to the field, which expands and opens the list.
|
|
27940
|
-
/* @__PURE__ */
|
|
28106
|
+
/* @__PURE__ */ jsxs73(
|
|
27941
28107
|
Badge.Root,
|
|
27942
28108
|
{
|
|
27943
28109
|
disabled,
|
|
@@ -27945,16 +28111,16 @@ function TagSelect({
|
|
|
27945
28111
|
title: hiddenChips.map((chip) => chip.label).join(", "),
|
|
27946
28112
|
onPress: () => inputRef.current?.focus(),
|
|
27947
28113
|
children: [
|
|
27948
|
-
/* @__PURE__ */
|
|
28114
|
+
/* @__PURE__ */ jsxs73("span", { "aria-hidden": "true", children: [
|
|
27949
28115
|
"+",
|
|
27950
28116
|
hiddenChips.length
|
|
27951
28117
|
] }),
|
|
27952
|
-
/* @__PURE__ */
|
|
28118
|
+
/* @__PURE__ */ jsx86(VisuallyHidden, { children: formatLabel(labels.more, { count: hiddenChips.length }) })
|
|
27953
28119
|
]
|
|
27954
28120
|
}
|
|
27955
28121
|
)
|
|
27956
28122
|
) : null,
|
|
27957
|
-
/* @__PURE__ */
|
|
28123
|
+
/* @__PURE__ */ jsx86(
|
|
27958
28124
|
"input",
|
|
27959
28125
|
{
|
|
27960
28126
|
ref: inputRef,
|
|
@@ -27991,9 +28157,9 @@ function TagSelect({
|
|
|
27991
28157
|
]
|
|
27992
28158
|
}
|
|
27993
28159
|
),
|
|
27994
|
-
name ? selected.map((item) => /* @__PURE__ */
|
|
27995
|
-
/* @__PURE__ */
|
|
27996
|
-
/* @__PURE__ */
|
|
28160
|
+
name ? selected.map((item) => /* @__PURE__ */ jsx86("input", { type: "hidden", name, value: item, disabled }, item)) : null,
|
|
28161
|
+
/* @__PURE__ */ jsx86(VisuallyHidden, { role: "status", "aria-live": "polite", children: announcement }),
|
|
28162
|
+
/* @__PURE__ */ jsx86(
|
|
27997
28163
|
MeasureRow,
|
|
27998
28164
|
{
|
|
27999
28165
|
ref: measureRef,
|
|
@@ -28002,11 +28168,11 @@ function TagSelect({
|
|
|
28002
28168
|
removeLabel: labels.remove
|
|
28003
28169
|
}
|
|
28004
28170
|
),
|
|
28005
|
-
/* @__PURE__ */
|
|
28171
|
+
/* @__PURE__ */ jsx86("span", { className: TagSelect_default.chevron, "aria-hidden": "true", children: /* @__PURE__ */ jsx86(Icon, { name: "nav.chevronDown" }) })
|
|
28006
28172
|
]
|
|
28007
28173
|
}
|
|
28008
28174
|
),
|
|
28009
|
-
/* @__PURE__ */
|
|
28175
|
+
/* @__PURE__ */ jsxs73(
|
|
28010
28176
|
FloatingPanel,
|
|
28011
28177
|
{
|
|
28012
28178
|
floating,
|
|
@@ -28021,8 +28187,8 @@ function TagSelect({
|
|
|
28021
28187
|
ref: scrollerRef,
|
|
28022
28188
|
className: cx(menu_default.tier, menu_default.menu, TagSelect_default.panel),
|
|
28023
28189
|
children: [
|
|
28024
|
-
labels.panelHint ? /* @__PURE__ */
|
|
28025
|
-
showCreate ? /* @__PURE__ */
|
|
28190
|
+
labels.panelHint ? /* @__PURE__ */ jsx86("div", { className: TagSelect_default.panelHint, children: labels.panelHint }) : null,
|
|
28191
|
+
showCreate ? /* @__PURE__ */ jsxs73(
|
|
28026
28192
|
OptionRow,
|
|
28027
28193
|
{
|
|
28028
28194
|
id: optionDomId(listboxId, CREATE_VALUE),
|
|
@@ -28034,13 +28200,13 @@ function TagSelect({
|
|
|
28034
28200
|
managed: false,
|
|
28035
28201
|
onPick: () => pick(CREATE_VALUE),
|
|
28036
28202
|
children: [
|
|
28037
|
-
/* @__PURE__ */
|
|
28038
|
-
/* @__PURE__ */
|
|
28039
|
-
/* @__PURE__ */
|
|
28203
|
+
/* @__PURE__ */ jsx86("span", { className: TagSelect_default.createIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsx86(Icon, { name: "action.add" }) }),
|
|
28204
|
+
/* @__PURE__ */ jsx86("span", { className: TagSelect_default.createLabel, children: labels.create }),
|
|
28205
|
+
/* @__PURE__ */ jsx86(Badge.Root, { color: defaultColor, className: TagSelect_default.chip, children: /* @__PURE__ */ jsx86("span", { className: TagSelect_default.chipLabel, children: inputTrim }) })
|
|
28040
28206
|
]
|
|
28041
28207
|
}
|
|
28042
28208
|
) : null,
|
|
28043
|
-
virtualized ? /* @__PURE__ */
|
|
28209
|
+
virtualized ? /* @__PURE__ */ jsx86(
|
|
28044
28210
|
VirtualOptions,
|
|
28045
28211
|
{
|
|
28046
28212
|
ref: virtualRef,
|
|
@@ -28098,7 +28264,7 @@ function OptionRow({
|
|
|
28098
28264
|
...toDataAttributes({ value, label, highlighted, selected, disabled, pending })
|
|
28099
28265
|
};
|
|
28100
28266
|
if (managed) {
|
|
28101
|
-
return /* @__PURE__ */
|
|
28267
|
+
return /* @__PURE__ */ jsx86(
|
|
28102
28268
|
"div",
|
|
28103
28269
|
{
|
|
28104
28270
|
...props,
|
|
@@ -28108,7 +28274,7 @@ function OptionRow({
|
|
|
28108
28274
|
}
|
|
28109
28275
|
);
|
|
28110
28276
|
}
|
|
28111
|
-
return /* @__PURE__ */
|
|
28277
|
+
return /* @__PURE__ */ jsx86(
|
|
28112
28278
|
"button",
|
|
28113
28279
|
{
|
|
28114
28280
|
type: "button",
|
|
@@ -28123,14 +28289,14 @@ function OptionRow({
|
|
|
28123
28289
|
}
|
|
28124
28290
|
);
|
|
28125
28291
|
}
|
|
28126
|
-
var MeasureRow =
|
|
28292
|
+
var MeasureRow = React93.memo(function MeasureRow2({
|
|
28127
28293
|
chips,
|
|
28128
28294
|
disabled,
|
|
28129
28295
|
removeLabel,
|
|
28130
28296
|
ref
|
|
28131
28297
|
}) {
|
|
28132
|
-
return /* @__PURE__ */
|
|
28133
|
-
chips.map((chip) => /* @__PURE__ */
|
|
28298
|
+
return /* @__PURE__ */ jsxs73("div", { ref, className: TagSelect_default.measure, "aria-hidden": true, inert: true, children: [
|
|
28299
|
+
chips.map((chip) => /* @__PURE__ */ jsx86(
|
|
28134
28300
|
Badge.Root,
|
|
28135
28301
|
{
|
|
28136
28302
|
color: chip.color,
|
|
@@ -28138,11 +28304,11 @@ var MeasureRow = React92.memo(function MeasureRow2({
|
|
|
28138
28304
|
className: TagSelect_default.chip,
|
|
28139
28305
|
labels: { remove: formatLabel(removeLabel, { label: chip.label }) },
|
|
28140
28306
|
onRemove: noop,
|
|
28141
|
-
children: /* @__PURE__ */
|
|
28307
|
+
children: /* @__PURE__ */ jsx86("span", { className: TagSelect_default.chipLabel, children: chip.label })
|
|
28142
28308
|
},
|
|
28143
28309
|
chip.value
|
|
28144
28310
|
)),
|
|
28145
|
-
/* @__PURE__ */
|
|
28311
|
+
/* @__PURE__ */ jsxs73(Badge.Root, { className: TagSelect_default.chipMore, children: [
|
|
28146
28312
|
"+",
|
|
28147
28313
|
Math.max(chips.length, 9)
|
|
28148
28314
|
] })
|
|
@@ -28152,7 +28318,7 @@ function noop() {
|
|
|
28152
28318
|
}
|
|
28153
28319
|
|
|
28154
28320
|
// src/components/timeline/Timeline.tsx
|
|
28155
|
-
import * as
|
|
28321
|
+
import * as React94 from "react";
|
|
28156
28322
|
|
|
28157
28323
|
// src/components/timeline/Timeline.module.css
|
|
28158
28324
|
var Timeline_default = {
|
|
@@ -28176,18 +28342,18 @@ var Timeline_default = {
|
|
|
28176
28342
|
};
|
|
28177
28343
|
|
|
28178
28344
|
// src/components/timeline/Timeline.tsx
|
|
28179
|
-
import { Fragment as
|
|
28345
|
+
import { Fragment as Fragment40, jsx as jsx87, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
28180
28346
|
function TimelineRoot({ size = "m", children, className, ...rest }) {
|
|
28181
|
-
return /* @__PURE__ */
|
|
28347
|
+
return /* @__PURE__ */ jsx87(ControlSizeProvider, { value: size, children: /* @__PURE__ */ jsx87("div", { ...rest, className: cx(Timeline_default.root, className), ...toDataAttributes({ size }), children }) });
|
|
28182
28348
|
}
|
|
28183
28349
|
TimelineRoot.displayName = "Timeline.Root";
|
|
28184
|
-
var EdgeContext =
|
|
28185
|
-
var isGap = (child) =>
|
|
28350
|
+
var EdgeContext = React94.createContext({ first: false, last: false });
|
|
28351
|
+
var isGap = (child) => React94.isValidElement(child) && child.type === TimelineGap;
|
|
28186
28352
|
function TimelineGroup({ label, children, className, ...rest }) {
|
|
28187
|
-
const labelId =
|
|
28353
|
+
const labelId = React94.useId();
|
|
28188
28354
|
const hasLabel = label !== void 0 && label !== null && label !== false;
|
|
28189
|
-
const events =
|
|
28190
|
-
const items = events.map((child, index) => /* @__PURE__ */
|
|
28355
|
+
const events = React94.Children.toArray(children);
|
|
28356
|
+
const items = events.map((child, index) => /* @__PURE__ */ jsx87(
|
|
28191
28357
|
EdgeContext.Provider,
|
|
28192
28358
|
{
|
|
28193
28359
|
value: {
|
|
@@ -28198,11 +28364,11 @@ function TimelineGroup({ label, children, className, ...rest }) {
|
|
|
28198
28364
|
},
|
|
28199
28365
|
children: child
|
|
28200
28366
|
},
|
|
28201
|
-
|
|
28367
|
+
React94.isValidElement(child) ? child.key : index
|
|
28202
28368
|
));
|
|
28203
|
-
return /* @__PURE__ */
|
|
28204
|
-
hasLabel ? /* @__PURE__ */
|
|
28205
|
-
/* @__PURE__ */
|
|
28369
|
+
return /* @__PURE__ */ jsxs74("div", { className: Timeline_default.group, children: [
|
|
28370
|
+
hasLabel ? /* @__PURE__ */ jsx87("div", { id: labelId, className: Timeline_default.groupLabel, children: label }) : null,
|
|
28371
|
+
/* @__PURE__ */ jsx87(
|
|
28206
28372
|
"ol",
|
|
28207
28373
|
{
|
|
28208
28374
|
"aria-labelledby": hasLabel ? labelId : void 0,
|
|
@@ -28232,7 +28398,7 @@ function TimelineItem({
|
|
|
28232
28398
|
ref,
|
|
28233
28399
|
...rest
|
|
28234
28400
|
}) {
|
|
28235
|
-
const edge =
|
|
28401
|
+
const edge = React94.useContext(EdgeContext);
|
|
28236
28402
|
const rowRef = useMergedRefs(ref);
|
|
28237
28403
|
const interactive = Boolean(asChild || href || onClick);
|
|
28238
28404
|
const rowProps = {
|
|
@@ -28245,73 +28411,73 @@ function TimelineItem({
|
|
|
28245
28411
|
interactive: interactive || void 0
|
|
28246
28412
|
})
|
|
28247
28413
|
};
|
|
28248
|
-
const dot = /* @__PURE__ */
|
|
28414
|
+
const dot = /* @__PURE__ */ jsx87("span", { className: Timeline_default.dot, "aria-hidden": "true" });
|
|
28249
28415
|
let row;
|
|
28250
28416
|
if (asChild) {
|
|
28251
|
-
const child =
|
|
28252
|
-
if (!
|
|
28417
|
+
const child = React94.Children.only(children);
|
|
28418
|
+
if (!React94.isValidElement(child)) {
|
|
28253
28419
|
throw new Error("Timeline.Item asChild needs a single element child");
|
|
28254
28420
|
}
|
|
28255
|
-
row = /* @__PURE__ */
|
|
28421
|
+
row = /* @__PURE__ */ jsx87(Slot, { ...rowProps, onClick, children: React94.cloneElement(
|
|
28256
28422
|
child,
|
|
28257
28423
|
void 0,
|
|
28258
|
-
/* @__PURE__ */
|
|
28424
|
+
/* @__PURE__ */ jsxs74(Fragment40, { children: [
|
|
28259
28425
|
dot,
|
|
28260
28426
|
child.props.children
|
|
28261
28427
|
] })
|
|
28262
28428
|
) });
|
|
28263
28429
|
} else if (href) {
|
|
28264
|
-
row = /* @__PURE__ */
|
|
28430
|
+
row = /* @__PURE__ */ jsxs74("a", { ...rowProps, href, onClick, children: [
|
|
28265
28431
|
dot,
|
|
28266
28432
|
children
|
|
28267
28433
|
] });
|
|
28268
28434
|
} else if (onClick) {
|
|
28269
|
-
row = /* @__PURE__ */
|
|
28435
|
+
row = /* @__PURE__ */ jsxs74("button", { ...rowProps, type: "button", onClick, children: [
|
|
28270
28436
|
dot,
|
|
28271
28437
|
children
|
|
28272
28438
|
] });
|
|
28273
28439
|
} else {
|
|
28274
|
-
row = /* @__PURE__ */
|
|
28440
|
+
row = /* @__PURE__ */ jsxs74("div", { ...rowProps, children: [
|
|
28275
28441
|
dot,
|
|
28276
28442
|
children
|
|
28277
28443
|
] });
|
|
28278
28444
|
}
|
|
28279
|
-
return /* @__PURE__ */
|
|
28445
|
+
return /* @__PURE__ */ jsx87("li", { className: Timeline_default.item, ...toDataAttributes(edgeAttributes(edge)), children: row });
|
|
28280
28446
|
}
|
|
28281
28447
|
TimelineItem.displayName = "Timeline.Item";
|
|
28282
28448
|
function TimelineTitle({ children, className, ...rest }) {
|
|
28283
|
-
return /* @__PURE__ */
|
|
28449
|
+
return /* @__PURE__ */ jsx87("span", { ...rest, className: cx(Timeline_default.title, className), children });
|
|
28284
28450
|
}
|
|
28285
28451
|
TimelineTitle.displayName = "Timeline.Title";
|
|
28286
28452
|
function TimelineMeta({ children, className, ...rest }) {
|
|
28287
|
-
return /* @__PURE__ */
|
|
28453
|
+
return /* @__PURE__ */ jsx87("span", { ...rest, className: cx(Timeline_default.meta, className), children });
|
|
28288
28454
|
}
|
|
28289
28455
|
TimelineMeta.displayName = "Timeline.Meta";
|
|
28290
28456
|
function TimelineMetaPrimary({ children, className, ...rest }) {
|
|
28291
|
-
return /* @__PURE__ */
|
|
28457
|
+
return /* @__PURE__ */ jsx87("span", { ...rest, className: cx(Timeline_default.metaPrimary, className), children });
|
|
28292
28458
|
}
|
|
28293
28459
|
TimelineMetaPrimary.displayName = "Timeline.MetaPrimary";
|
|
28294
28460
|
function TimelineValue({ tone = "neutral", children, className, ...rest }) {
|
|
28295
|
-
return /* @__PURE__ */
|
|
28461
|
+
return /* @__PURE__ */ jsx87("span", { ...rest, className: cx(Timeline_default.value, className), ...toDataAttributes({ tone }), children });
|
|
28296
28462
|
}
|
|
28297
28463
|
TimelineValue.displayName = "Timeline.Value";
|
|
28298
28464
|
function TimelineValueMeta({ children, className, ...rest }) {
|
|
28299
|
-
return /* @__PURE__ */
|
|
28465
|
+
return /* @__PURE__ */ jsx87("span", { ...rest, className: cx(Timeline_default.valueMeta, className), children });
|
|
28300
28466
|
}
|
|
28301
28467
|
TimelineValueMeta.displayName = "Timeline.ValueMeta";
|
|
28302
28468
|
function TimelineGapMeta({ className, ...rest }) {
|
|
28303
|
-
return /* @__PURE__ */
|
|
28469
|
+
return /* @__PURE__ */ jsx87("span", { className: cx(Timeline_default.gapTrailing, className), ...rest });
|
|
28304
28470
|
}
|
|
28305
28471
|
TimelineGapMeta.displayName = "Timeline.GapMeta";
|
|
28306
28472
|
function TimelineGap({ tone = "neutral", children, className, ...rest }) {
|
|
28307
|
-
const parts =
|
|
28308
|
-
const isMeta = (child) =>
|
|
28473
|
+
const parts = React94.Children.toArray(children);
|
|
28474
|
+
const isMeta = (child) => React94.isValidElement(child) && child.type === TimelineGapMeta;
|
|
28309
28475
|
const caption = parts.filter((child) => !isMeta(child));
|
|
28310
28476
|
const meta = parts.filter(isMeta);
|
|
28311
|
-
const edge =
|
|
28312
|
-
return /* @__PURE__ */
|
|
28313
|
-
/* @__PURE__ */
|
|
28314
|
-
/* @__PURE__ */
|
|
28477
|
+
const edge = React94.useContext(EdgeContext);
|
|
28478
|
+
return /* @__PURE__ */ jsx87("li", { className: cx(Timeline_default.item, Timeline_default.gapItem), ...toDataAttributes(edgeAttributes(edge)), children: /* @__PURE__ */ jsxs74("div", { ...rest, className: cx(Timeline_default.gapRow, className), ...toDataAttributes({ tone }), children: [
|
|
28479
|
+
/* @__PURE__ */ jsx87("span", { className: Timeline_default.gapDot, "aria-hidden": "true" }),
|
|
28480
|
+
/* @__PURE__ */ jsx87("span", { className: Timeline_default.gapCaption, children: caption }),
|
|
28315
28481
|
meta
|
|
28316
28482
|
] }) });
|
|
28317
28483
|
}
|
|
@@ -28330,7 +28496,7 @@ var Timeline = {
|
|
|
28330
28496
|
};
|
|
28331
28497
|
|
|
28332
28498
|
// src/components/video-note/VideoNote.tsx
|
|
28333
|
-
import * as
|
|
28499
|
+
import * as React95 from "react";
|
|
28334
28500
|
|
|
28335
28501
|
// src/components/video-note/VideoNote.module.css
|
|
28336
28502
|
var VideoNote_default = {
|
|
@@ -28349,7 +28515,7 @@ var VideoNote_default = {
|
|
|
28349
28515
|
};
|
|
28350
28516
|
|
|
28351
28517
|
// src/components/video-note/VideoNote.tsx
|
|
28352
|
-
import { jsx as
|
|
28518
|
+
import { jsx as jsx88, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
28353
28519
|
var VIDEO_NOTE_LABELS = {
|
|
28354
28520
|
player: "\u0412\u0438\u0434\u0435\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
|
|
28355
28521
|
play: "\u0412\u043E\u0441\u043F\u0440\u043E\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0432\u0438\u0434\u0435\u043E\u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
|
|
@@ -28365,22 +28531,22 @@ function VideoNoteInner(props) {
|
|
|
28365
28531
|
const { overlay } = useMessagePart();
|
|
28366
28532
|
const around = useSurfaceDepth();
|
|
28367
28533
|
const blockDepth = useInMessage() ? void 0 : nextSurfaceDepth(around);
|
|
28368
|
-
const videoRef =
|
|
28369
|
-
const ringRef =
|
|
28370
|
-
const rootRef =
|
|
28534
|
+
const videoRef = React95.useRef(null);
|
|
28535
|
+
const ringRef = React95.useRef(null);
|
|
28536
|
+
const rootRef = React95.useRef(null);
|
|
28371
28537
|
const mergedRef = useMergedRefs(rootRef, ref);
|
|
28372
|
-
const descriptionId =
|
|
28373
|
-
const [state, setState] =
|
|
28374
|
-
const [frame, setFrame] =
|
|
28375
|
-
const [metaDuration, setMetaDuration] =
|
|
28376
|
-
const [current, setCurrent] =
|
|
28377
|
-
const stateRef =
|
|
28538
|
+
const descriptionId = React95.useId();
|
|
28539
|
+
const [state, setState] = React95.useState("idle");
|
|
28540
|
+
const [frame, setFrame] = React95.useState("loading");
|
|
28541
|
+
const [metaDuration, setMetaDuration] = React95.useState(null);
|
|
28542
|
+
const [current, setCurrent] = React95.useState(0);
|
|
28543
|
+
const stateRef = React95.useRef(state);
|
|
28378
28544
|
stateRef.current = state;
|
|
28379
28545
|
const { wanted, setWanted, transcript, disabled, covered, inactive, transferDisk } = useMediaPlayer(videoRef, player, labels);
|
|
28380
|
-
const inactiveRef =
|
|
28546
|
+
const inactiveRef = React95.useRef(inactive);
|
|
28381
28547
|
inactiveRef.current = inactive;
|
|
28382
28548
|
const duration = metaDuration ?? durationProp ?? null;
|
|
28383
|
-
|
|
28549
|
+
React95.useEffect(() => {
|
|
28384
28550
|
const video = videoRef.current;
|
|
28385
28551
|
const ring = ringRef.current;
|
|
28386
28552
|
if (!video || !ring) return;
|
|
@@ -28421,7 +28587,7 @@ function VideoNoteInner(props) {
|
|
|
28421
28587
|
if (stateRef.current === "playing") videoRef.current?.pause();
|
|
28422
28588
|
else start();
|
|
28423
28589
|
};
|
|
28424
|
-
|
|
28590
|
+
React95.useEffect(() => {
|
|
28425
28591
|
if (wanted && stateRef.current !== "playing") start();
|
|
28426
28592
|
else if (!wanted && stateRef.current === "playing") videoRef.current?.pause();
|
|
28427
28593
|
}, [wanted]);
|
|
@@ -28469,7 +28635,7 @@ function VideoNoteInner(props) {
|
|
|
28469
28635
|
].filter(Boolean).join(", ");
|
|
28470
28636
|
return (
|
|
28471
28637
|
// biome-ignore lint/a11y/useSemanticElements: a media player's controls, not a form fieldset
|
|
28472
|
-
/* @__PURE__ */
|
|
28638
|
+
/* @__PURE__ */ jsxs75(
|
|
28473
28639
|
"div",
|
|
28474
28640
|
{
|
|
28475
28641
|
role: "group",
|
|
@@ -28483,7 +28649,7 @@ function VideoNoteInner(props) {
|
|
|
28483
28649
|
transfer: covered || void 0
|
|
28484
28650
|
}),
|
|
28485
28651
|
children: [
|
|
28486
|
-
/* @__PURE__ */
|
|
28652
|
+
/* @__PURE__ */ jsxs75(
|
|
28487
28653
|
"div",
|
|
28488
28654
|
{
|
|
28489
28655
|
className: VideoNote_default.circle,
|
|
@@ -28492,9 +28658,9 @@ function VideoNoteInner(props) {
|
|
|
28492
28658
|
"data-frame": frame,
|
|
28493
28659
|
"data-covered": covered || void 0,
|
|
28494
28660
|
children: [
|
|
28495
|
-
/* @__PURE__ */
|
|
28496
|
-
frame === "loading" ? /* @__PURE__ */
|
|
28497
|
-
/* @__PURE__ */
|
|
28661
|
+
/* @__PURE__ */ jsxs75("span", { className: VideoNote_default.media, "aria-hidden": "true", children: [
|
|
28662
|
+
frame === "loading" ? /* @__PURE__ */ jsx88(Skeleton, { shape: "block", className: VideoNote_default.fill }) : null,
|
|
28663
|
+
/* @__PURE__ */ jsx88(
|
|
28498
28664
|
"video",
|
|
28499
28665
|
{
|
|
28500
28666
|
ref: videoRef,
|
|
@@ -28515,8 +28681,8 @@ function VideoNoteInner(props) {
|
|
|
28515
28681
|
}
|
|
28516
28682
|
)
|
|
28517
28683
|
] }),
|
|
28518
|
-
/* @__PURE__ */
|
|
28519
|
-
/* @__PURE__ */
|
|
28684
|
+
/* @__PURE__ */ jsx88(Ring, { ref: ringRef, value: 0, live: true, track: false, className: VideoNote_default.ring }),
|
|
28685
|
+
/* @__PURE__ */ jsx88(
|
|
28520
28686
|
"span",
|
|
28521
28687
|
{
|
|
28522
28688
|
className: VideoNote_default.hit,
|
|
@@ -28525,7 +28691,7 @@ function VideoNoteInner(props) {
|
|
|
28525
28691
|
onClick: inactive ? void 0 : toggle
|
|
28526
28692
|
}
|
|
28527
28693
|
),
|
|
28528
|
-
/* @__PURE__ */
|
|
28694
|
+
/* @__PURE__ */ jsx88("span", { className: VideoNote_default.play, "data-badge": "play", "data-shown": state !== "playing", children: /* @__PURE__ */ jsx88(
|
|
28529
28695
|
PlayDisk,
|
|
28530
28696
|
{
|
|
28531
28697
|
look: "shade",
|
|
@@ -28539,12 +28705,12 @@ function VideoNoteInner(props) {
|
|
|
28539
28705
|
describedBy: description ? descriptionId : void 0
|
|
28540
28706
|
}
|
|
28541
28707
|
) }),
|
|
28542
|
-
description ? /* @__PURE__ */
|
|
28543
|
-
shown !== null ? /* @__PURE__ */
|
|
28708
|
+
description ? /* @__PURE__ */ jsx88(VisuallyHidden, { id: descriptionId, children: description }) : null,
|
|
28709
|
+
shown !== null ? /* @__PURE__ */ jsxs75("span", { className: cx(mediaPill_default.pill, VideoNote_default.duration), "data-badge": "duration", "aria-hidden": "true", children: [
|
|
28544
28710
|
formatClock(shown),
|
|
28545
|
-
unplayed ? /* @__PURE__ */
|
|
28711
|
+
unplayed ? /* @__PURE__ */ jsx88("span", { className: VideoNote_default.dot }) : null
|
|
28546
28712
|
] }) : null,
|
|
28547
|
-
transcript ? /* @__PURE__ */
|
|
28713
|
+
transcript ? /* @__PURE__ */ jsx88(
|
|
28548
28714
|
TranscriptButton,
|
|
28549
28715
|
{
|
|
28550
28716
|
transcript,
|
|
@@ -28563,7 +28729,7 @@ function VideoNoteInner(props) {
|
|
|
28563
28729
|
);
|
|
28564
28730
|
}
|
|
28565
28731
|
function VideoNote(props) {
|
|
28566
|
-
return /* @__PURE__ */
|
|
28732
|
+
return /* @__PURE__ */ jsx88(VideoNoteInner, { ...props }, props.src);
|
|
28567
28733
|
}
|
|
28568
28734
|
var NOTE_PX = 14.5 * 16 * 1.15;
|
|
28569
28735
|
defineMessagePart(VideoNote, {
|
|
@@ -28575,7 +28741,7 @@ defineMessagePart(VideoNote, {
|
|
|
28575
28741
|
});
|
|
28576
28742
|
|
|
28577
28743
|
// src/components/voice-player/VoicePlayer.tsx
|
|
28578
|
-
import * as
|
|
28744
|
+
import * as React96 from "react";
|
|
28579
28745
|
|
|
28580
28746
|
// src/components/voice-player/VoicePlayer.module.css
|
|
28581
28747
|
var VoicePlayer_default = {
|
|
@@ -28642,7 +28808,7 @@ async function getWaveform(source, bars = WAVEFORM_BARS) {
|
|
|
28642
28808
|
}
|
|
28643
28809
|
|
|
28644
28810
|
// src/components/voice-player/VoicePlayer.tsx
|
|
28645
|
-
import { jsx as
|
|
28811
|
+
import { jsx as jsx89, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
28646
28812
|
var RATES = [1, 1.5, 2];
|
|
28647
28813
|
var VOICE_PLAYER_LABELS = {
|
|
28648
28814
|
player: "\u0413\u043E\u043B\u043E\u0441\u043E\u0432\u043E\u0435 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",
|
|
@@ -28680,7 +28846,7 @@ function Bars({
|
|
|
28680
28846
|
className,
|
|
28681
28847
|
ref
|
|
28682
28848
|
}) {
|
|
28683
|
-
return /* @__PURE__ */
|
|
28849
|
+
return /* @__PURE__ */ jsx89("span", { ref, className: cx(VoicePlayer_default.bars, className), "aria-hidden": "true", children: levels.map((level, i) => /* @__PURE__ */ jsx89(
|
|
28684
28850
|
"span",
|
|
28685
28851
|
{
|
|
28686
28852
|
className: VoicePlayer_default.bar,
|
|
@@ -28702,31 +28868,31 @@ function VoicePlayer(props) {
|
|
|
28702
28868
|
ref,
|
|
28703
28869
|
...rest
|
|
28704
28870
|
} = own;
|
|
28705
|
-
const labels =
|
|
28871
|
+
const labels = React96.useMemo(() => ({ ...VOICE_PLAYER_LABELS, ...labelsProp }), [labelsProp]);
|
|
28706
28872
|
const { spacer } = useMessagePart();
|
|
28707
28873
|
const [rate, setRate] = useControllableState({
|
|
28708
28874
|
value: rateProp,
|
|
28709
28875
|
defaultValue: defaultRate,
|
|
28710
28876
|
onChange: onRateChange
|
|
28711
28877
|
});
|
|
28712
|
-
const rootRef =
|
|
28878
|
+
const rootRef = React96.useRef(null);
|
|
28713
28879
|
const mergedRef = useMergedRefs(rootRef, ref);
|
|
28714
|
-
const audioRef =
|
|
28715
|
-
const waveRef =
|
|
28716
|
-
const playedRef =
|
|
28717
|
-
const resumeAfterDrag =
|
|
28718
|
-
const seekingRef =
|
|
28719
|
-
const [playing, setMediaPlaying] =
|
|
28880
|
+
const audioRef = React96.useRef(null);
|
|
28881
|
+
const waveRef = React96.useRef(null);
|
|
28882
|
+
const playedRef = React96.useRef(null);
|
|
28883
|
+
const resumeAfterDrag = React96.useRef(false);
|
|
28884
|
+
const seekingRef = React96.useRef(false);
|
|
28885
|
+
const [playing, setMediaPlaying] = React96.useState(false);
|
|
28720
28886
|
const { wanted, setWanted, transcript, disabled, covered, inactive, transferDisk } = useMediaPlayer(audioRef, player, labels);
|
|
28721
|
-
const [seeking, setSeeking] =
|
|
28722
|
-
const [position, setPosition] =
|
|
28723
|
-
const [mediaDuration, setMediaDuration] =
|
|
28724
|
-
const [barCount, setBarCount] =
|
|
28887
|
+
const [seeking, setSeeking] = React96.useState(false);
|
|
28888
|
+
const [position, setPosition] = React96.useState(0);
|
|
28889
|
+
const [mediaDuration, setMediaDuration] = React96.useState(null);
|
|
28890
|
+
const [barCount, setBarCount] = React96.useState(DEFAULT_BARS);
|
|
28725
28891
|
const total = mediaDuration ?? Math.max(0, durationProp ?? 0);
|
|
28726
28892
|
const showElapsed = playing || seeking || position > 0;
|
|
28727
|
-
const bars =
|
|
28893
|
+
const bars = React96.useMemo(() => resample(waveform, barCount), [waveform, barCount]);
|
|
28728
28894
|
const dot = usePresence(unplayed, { exitDuration: "fast" });
|
|
28729
|
-
const paint =
|
|
28895
|
+
const paint = React96.useCallback(
|
|
28730
28896
|
(seconds) => {
|
|
28731
28897
|
playedRef.current?.style.setProperty(
|
|
28732
28898
|
"--vp-progress",
|
|
@@ -28735,10 +28901,10 @@ function VoicePlayer(props) {
|
|
|
28735
28901
|
},
|
|
28736
28902
|
[total]
|
|
28737
28903
|
);
|
|
28738
|
-
|
|
28904
|
+
React96.useLayoutEffect(() => {
|
|
28739
28905
|
if (!playing) paint(position);
|
|
28740
28906
|
}, [playing, position, paint]);
|
|
28741
|
-
|
|
28907
|
+
React96.useEffect(() => {
|
|
28742
28908
|
if (!playing) return;
|
|
28743
28909
|
let frame = 0;
|
|
28744
28910
|
const tick = () => {
|
|
@@ -28753,11 +28919,11 @@ function VoicePlayer(props) {
|
|
|
28753
28919
|
frame = requestAnimationFrame(tick);
|
|
28754
28920
|
return () => cancelAnimationFrame(frame);
|
|
28755
28921
|
}, [playing, paint]);
|
|
28756
|
-
|
|
28922
|
+
React96.useEffect(() => {
|
|
28757
28923
|
const audio = audioRef.current;
|
|
28758
28924
|
if (audio) audio.playbackRate = rate;
|
|
28759
28925
|
}, [rate]);
|
|
28760
|
-
|
|
28926
|
+
React96.useEffect(() => {
|
|
28761
28927
|
const wave = waveRef.current;
|
|
28762
28928
|
if (!wave || typeof ResizeObserver === "undefined") return;
|
|
28763
28929
|
const observer2 = new ResizeObserver(([entry]) => {
|
|
@@ -28767,7 +28933,7 @@ function VoicePlayer(props) {
|
|
|
28767
28933
|
observer2.observe(wave);
|
|
28768
28934
|
return () => observer2.disconnect();
|
|
28769
28935
|
}, []);
|
|
28770
|
-
|
|
28936
|
+
React96.useEffect(() => {
|
|
28771
28937
|
const audio = audioRef.current;
|
|
28772
28938
|
if (!audio || seekingRef.current) return;
|
|
28773
28939
|
if (wanted && audio.paused && !inactive) {
|
|
@@ -28865,7 +29031,7 @@ function VoicePlayer(props) {
|
|
|
28865
29031
|
const open = transcript?.expanded ?? false;
|
|
28866
29032
|
return (
|
|
28867
29033
|
// biome-ignore lint/a11y/useSemanticElements: a media player's controls, not a form fieldset
|
|
28868
|
-
/* @__PURE__ */
|
|
29034
|
+
/* @__PURE__ */ jsxs76(
|
|
28869
29035
|
"div",
|
|
28870
29036
|
{
|
|
28871
29037
|
role: "group",
|
|
@@ -28880,7 +29046,7 @@ function VoicePlayer(props) {
|
|
|
28880
29046
|
transfer: covered || void 0
|
|
28881
29047
|
}),
|
|
28882
29048
|
children: [
|
|
28883
|
-
/* @__PURE__ */
|
|
29049
|
+
/* @__PURE__ */ jsx89(
|
|
28884
29050
|
"audio",
|
|
28885
29051
|
{
|
|
28886
29052
|
ref: audioRef,
|
|
@@ -28894,8 +29060,8 @@ function VoicePlayer(props) {
|
|
|
28894
29060
|
onDurationChange: handleMetadata
|
|
28895
29061
|
}
|
|
28896
29062
|
),
|
|
28897
|
-
/* @__PURE__ */
|
|
28898
|
-
/* @__PURE__ */
|
|
29063
|
+
/* @__PURE__ */ jsxs76("div", { className: VoicePlayer_default.row, children: [
|
|
29064
|
+
/* @__PURE__ */ jsx89(
|
|
28899
29065
|
PlayDisk,
|
|
28900
29066
|
{
|
|
28901
29067
|
look: "solid",
|
|
@@ -28907,9 +29073,9 @@ function VoicePlayer(props) {
|
|
|
28907
29073
|
onToggle: toggle
|
|
28908
29074
|
}
|
|
28909
29075
|
),
|
|
28910
|
-
/* @__PURE__ */
|
|
28911
|
-
/* @__PURE__ */
|
|
28912
|
-
/* @__PURE__ */
|
|
29076
|
+
/* @__PURE__ */ jsxs76("div", { className: VoicePlayer_default.body, children: [
|
|
29077
|
+
/* @__PURE__ */ jsxs76("div", { className: VoicePlayer_default.waveLine, children: [
|
|
29078
|
+
/* @__PURE__ */ jsxs76(
|
|
28913
29079
|
"div",
|
|
28914
29080
|
{
|
|
28915
29081
|
ref: waveRef,
|
|
@@ -28932,12 +29098,12 @@ function VoicePlayer(props) {
|
|
|
28932
29098
|
onLostPointerCapture: endDrag,
|
|
28933
29099
|
onKeyDown: handleKeyDown,
|
|
28934
29100
|
children: [
|
|
28935
|
-
/* @__PURE__ */
|
|
28936
|
-
/* @__PURE__ */
|
|
29101
|
+
/* @__PURE__ */ jsx89(Bars, { levels: bars }),
|
|
29102
|
+
/* @__PURE__ */ jsx89(Bars, { ref: playedRef, levels: bars, className: VoicePlayer_default.played })
|
|
28937
29103
|
]
|
|
28938
29104
|
}
|
|
28939
29105
|
),
|
|
28940
|
-
transcript ? /* @__PURE__ */
|
|
29106
|
+
transcript ? /* @__PURE__ */ jsx89(
|
|
28941
29107
|
TranscriptButton,
|
|
28942
29108
|
{
|
|
28943
29109
|
transcript,
|
|
@@ -28946,9 +29112,9 @@ function VoicePlayer(props) {
|
|
|
28946
29112
|
}
|
|
28947
29113
|
) : null
|
|
28948
29114
|
] }),
|
|
28949
|
-
/* @__PURE__ */
|
|
28950
|
-
/* @__PURE__ */
|
|
28951
|
-
dot.mounted ? /* @__PURE__ */
|
|
29115
|
+
/* @__PURE__ */ jsxs76("div", { className: VoicePlayer_default.meta, children: [
|
|
29116
|
+
/* @__PURE__ */ jsx89("span", { className: VoicePlayer_default.time, "aria-hidden": "true", children: formatClock(shownTime) }),
|
|
29117
|
+
dot.mounted ? /* @__PURE__ */ jsx89(
|
|
28952
29118
|
"span",
|
|
28953
29119
|
{
|
|
28954
29120
|
className: VoicePlayer_default.dot,
|
|
@@ -28957,8 +29123,8 @@ function VoicePlayer(props) {
|
|
|
28957
29123
|
"aria-hidden": "true"
|
|
28958
29124
|
}
|
|
28959
29125
|
) : null,
|
|
28960
|
-
unplayed ? /* @__PURE__ */
|
|
28961
|
-
/* @__PURE__ */
|
|
29126
|
+
unplayed ? /* @__PURE__ */ jsx89(VisuallyHidden, { children: labels.unplayed }) : null,
|
|
29127
|
+
/* @__PURE__ */ jsx89(
|
|
28962
29128
|
"button",
|
|
28963
29129
|
{
|
|
28964
29130
|
type: "button",
|
|
@@ -28966,7 +29132,7 @@ function VoicePlayer(props) {
|
|
|
28966
29132
|
"aria-label": formatLabel(labels.rate, { rate: rateText }),
|
|
28967
29133
|
disabled: inactive,
|
|
28968
29134
|
onClick: cycleRate,
|
|
28969
|
-
children: /* @__PURE__ */
|
|
29135
|
+
children: /* @__PURE__ */ jsx89(MorphText, { children: rateText })
|
|
28970
29136
|
}
|
|
28971
29137
|
),
|
|
28972
29138
|
open ? null : spacer
|
|
@@ -28986,10 +29152,10 @@ defineMessagePart(VoicePlayer, {
|
|
|
28986
29152
|
});
|
|
28987
29153
|
|
|
28988
29154
|
// src/hooks/useTokenValue.ts
|
|
28989
|
-
import * as
|
|
29155
|
+
import * as React97 from "react";
|
|
28990
29156
|
function useTokenValue(token, fallbackPx = 0) {
|
|
28991
|
-
const [value, setValue] =
|
|
28992
|
-
|
|
29157
|
+
const [value, setValue] = React97.useState(() => readCssLengthPx(token, fallbackPx));
|
|
29158
|
+
React97.useLayoutEffect(() => {
|
|
28993
29159
|
const update = () => setValue(readCssLengthPx(token, fallbackPx));
|
|
28994
29160
|
update();
|
|
28995
29161
|
const observer2 = new MutationObserver(update);
|
|
@@ -29008,7 +29174,7 @@ function useTokenValue(token, fallbackPx = 0) {
|
|
|
29008
29174
|
}
|
|
29009
29175
|
|
|
29010
29176
|
// src/hooks/useUploadQueue.ts
|
|
29011
|
-
import * as
|
|
29177
|
+
import * as React98 from "react";
|
|
29012
29178
|
var DEFAULT_CONCURRENCY = 3;
|
|
29013
29179
|
var sequence = 0;
|
|
29014
29180
|
function reasonOf2(error) {
|
|
@@ -29023,17 +29189,17 @@ function revokePreview(url) {
|
|
|
29023
29189
|
if (url && typeof URL.revokeObjectURL === "function") URL.revokeObjectURL(url);
|
|
29024
29190
|
}
|
|
29025
29191
|
function useUploadQueue(options) {
|
|
29026
|
-
const [items, setItems] =
|
|
29027
|
-
const itemsRef =
|
|
29192
|
+
const [items, setItems] = React98.useState([]);
|
|
29193
|
+
const itemsRef = React98.useRef(items);
|
|
29028
29194
|
itemsRef.current = items;
|
|
29029
|
-
const optionsRef =
|
|
29195
|
+
const optionsRef = React98.useRef(options);
|
|
29030
29196
|
optionsRef.current = options;
|
|
29031
|
-
const running =
|
|
29032
|
-
const prefix =
|
|
29033
|
-
const update =
|
|
29197
|
+
const running = React98.useRef(/* @__PURE__ */ new Map());
|
|
29198
|
+
const prefix = React98.useId();
|
|
29199
|
+
const update = React98.useCallback((id, patch) => {
|
|
29034
29200
|
setItems((current) => current.map((item) => item.id === id ? { ...item, ...patch } : item));
|
|
29035
29201
|
}, []);
|
|
29036
|
-
const start =
|
|
29202
|
+
const start = React98.useCallback(
|
|
29037
29203
|
(item) => {
|
|
29038
29204
|
const controller = new AbortController();
|
|
29039
29205
|
running.current.set(item.id, controller);
|
|
@@ -29063,7 +29229,7 @@ function useUploadQueue(options) {
|
|
|
29063
29229
|
},
|
|
29064
29230
|
[update]
|
|
29065
29231
|
);
|
|
29066
|
-
|
|
29232
|
+
React98.useEffect(() => {
|
|
29067
29233
|
const limit = Math.max(1, optionsRef.current.concurrency ?? DEFAULT_CONCURRENCY);
|
|
29068
29234
|
let free = limit - running.current.size;
|
|
29069
29235
|
if (free <= 0) return;
|
|
@@ -29077,7 +29243,7 @@ function useUploadQueue(options) {
|
|
|
29077
29243
|
free -= 1;
|
|
29078
29244
|
}
|
|
29079
29245
|
});
|
|
29080
|
-
|
|
29246
|
+
React98.useEffect(() => {
|
|
29081
29247
|
const current = itemsRef.current;
|
|
29082
29248
|
if (current.some((item) => item.preview === "")) {
|
|
29083
29249
|
setItems(
|
|
@@ -29097,7 +29263,7 @@ function useUploadQueue(options) {
|
|
|
29097
29263
|
setItems(itemsRef.current);
|
|
29098
29264
|
};
|
|
29099
29265
|
}, []);
|
|
29100
|
-
const add =
|
|
29266
|
+
const add = React98.useCallback(
|
|
29101
29267
|
(files) => {
|
|
29102
29268
|
const added = files.map(
|
|
29103
29269
|
(file) => ({
|
|
@@ -29113,27 +29279,27 @@ function useUploadQueue(options) {
|
|
|
29113
29279
|
},
|
|
29114
29280
|
[prefix]
|
|
29115
29281
|
);
|
|
29116
|
-
const retry =
|
|
29282
|
+
const retry = React98.useCallback((id) => {
|
|
29117
29283
|
setItems(
|
|
29118
29284
|
(current) => current.map(
|
|
29119
29285
|
(item) => item.id === id && item.status === "failed" ? { ...item, status: "queued", progress: 0, error: void 0 } : item
|
|
29120
29286
|
)
|
|
29121
29287
|
);
|
|
29122
29288
|
}, []);
|
|
29123
|
-
const remove =
|
|
29289
|
+
const remove = React98.useCallback((id) => {
|
|
29124
29290
|
running.current.get(id)?.abort();
|
|
29125
29291
|
running.current.delete(id);
|
|
29126
29292
|
const item = itemsRef.current.find((entry) => entry.id === id);
|
|
29127
29293
|
revokePreview(item?.preview);
|
|
29128
29294
|
setItems((current) => current.filter((entry) => entry.id !== id));
|
|
29129
29295
|
}, []);
|
|
29130
|
-
const clear =
|
|
29296
|
+
const clear = React98.useCallback(() => {
|
|
29131
29297
|
for (const controller of running.current.values()) controller.abort();
|
|
29132
29298
|
running.current.clear();
|
|
29133
29299
|
for (const item of itemsRef.current) revokePreview(item.preview);
|
|
29134
29300
|
setItems([]);
|
|
29135
29301
|
}, []);
|
|
29136
|
-
const move =
|
|
29302
|
+
const move = React98.useCallback((id, beforeId) => {
|
|
29137
29303
|
setItems((current) => {
|
|
29138
29304
|
const item = current.find((entry) => entry.id === id);
|
|
29139
29305
|
if (!item || id === beforeId) return current;
|
|
@@ -29143,7 +29309,7 @@ function useUploadQueue(options) {
|
|
|
29143
29309
|
return next.every((entry, index) => entry === current[index]) ? current : next;
|
|
29144
29310
|
});
|
|
29145
29311
|
}, []);
|
|
29146
|
-
return
|
|
29312
|
+
return React98.useMemo(
|
|
29147
29313
|
() => ({ items, add, retry, remove, clear, move }),
|
|
29148
29314
|
[items, add, retry, remove, clear, move]
|
|
29149
29315
|
);
|
|
@@ -29269,6 +29435,7 @@ export {
|
|
|
29269
29435
|
ChartFrame,
|
|
29270
29436
|
Dropdown,
|
|
29271
29437
|
formatMessageTime,
|
|
29438
|
+
formatFileSize,
|
|
29272
29439
|
Slider,
|
|
29273
29440
|
MediaViewer,
|
|
29274
29441
|
Gallery,
|
|
@@ -29305,6 +29472,7 @@ export {
|
|
|
29305
29472
|
Fieldset,
|
|
29306
29473
|
Gantt,
|
|
29307
29474
|
Kanban,
|
|
29475
|
+
List,
|
|
29308
29476
|
Typography,
|
|
29309
29477
|
LoginForm,
|
|
29310
29478
|
NativeSelect,
|