@vokality/design-system 1.3.0 → 2.0.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/CHANGELOG.md +26 -0
- package/README.md +2 -2
- package/dist/components/Field/Field.js +2 -2
- package/dist/components/Fieldset/Fieldset.js +3 -3
- package/dist/components/Grid/Grid.d.ts +866 -4
- package/dist/components/Grid/Grid.js +2 -3
- package/dist/components/Inline/Inline.d.ts +866 -4
- package/dist/components/Inline/Inline.js +2 -3
- package/dist/components/Stack/Stack.d.ts +866 -4
- package/dist/components/Stack/Stack.js +2 -3
- package/dist/components/Text/Text.d.ts +9 -5
- package/dist/components/Text/Text.js +3 -4
- package/dist/components.css +102 -52
- package/dist/internal/describedBy.d.ts +3 -0
- package/dist/internal/describedBy.js +4 -0
- package/dist/tokens.css +2 -0
- package/dist/tokens.dtcg.json +10 -0
- package/dist/tokens.json +10 -0
- package/dist/types.d.ts +6 -1
- package/dist/vokality.css +104 -52
- package/dist/vokality.iife.js +331 -349
- package/docs/brand.md +2 -2
- package/docs/components/Badge/README.md +1 -1
- package/docs/components/Button/README.md +4 -2
- package/docs/components/Inline/README.md +1 -1
- package/docs/components/Text/README.md +1 -1
- package/package.json +1 -1
package/dist/vokality.iife.js
CHANGED
|
@@ -13013,6 +13013,11 @@ Defaulting to \`null\`.`;
|
|
|
13013
13013
|
return ids.size > 0 ? Array.from(ids).join(" ") : undefined;
|
|
13014
13014
|
}
|
|
13015
13015
|
__name41(concatAriaDescribedby4, "concatAriaDescribedby");
|
|
13016
|
+
// src/internal/describedBy.ts
|
|
13017
|
+
function describedBy(id, hint, error, existing) {
|
|
13018
|
+
return [existing, hint ? id + "-hint" : null, error ? id + "-error" : null].filter(Boolean).join(" ") || undefined;
|
|
13019
|
+
}
|
|
13020
|
+
|
|
13016
13021
|
// src/internal/useUid.ts
|
|
13017
13022
|
var import_react8 = __toESM(require_react(), 1);
|
|
13018
13023
|
"use client";
|
|
@@ -13026,9 +13031,8 @@ Defaulting to \`null\`.`;
|
|
|
13026
13031
|
function Field(props) {
|
|
13027
13032
|
const uid = useUid("vk-field");
|
|
13028
13033
|
const id = props.id || uid;
|
|
13029
|
-
const describedBy = [props.hint ? id + "-hint" : null, props.error ? id + "-error" : null].filter(Boolean).join(" ") || undefined;
|
|
13030
13034
|
const labelId = id + "-label";
|
|
13031
|
-
const control = import_react9.isValidElement(props.children) ? import_react9.cloneElement(props.children, { id, "aria-labelledby": labelId, "aria-describedby": describedBy, "aria-invalid": props.error ? true : undefined }) : props.children;
|
|
13035
|
+
const control = import_react9.isValidElement(props.children) ? import_react9.cloneElement(props.children, { id, "aria-labelledby": labelId, "aria-describedby": describedBy(id, props.hint, props.error), "aria-invalid": props.error ? true : undefined }) : props.children;
|
|
13032
13036
|
const focusControl = (e) => {
|
|
13033
13037
|
const el = document.getElementById(id);
|
|
13034
13038
|
if (el && el.getAttribute("role") === "combobox") {
|
|
@@ -13070,15 +13074,14 @@ Defaulting to \`null\`.`;
|
|
|
13070
13074
|
var import_react10 = __toESM(require_react(), 1);
|
|
13071
13075
|
var jsx_dev_runtime18 = __toESM(require_jsx_dev_runtime(), 1);
|
|
13072
13076
|
"use client";
|
|
13073
|
-
var Fieldset = import_react10.forwardRef(function Fieldset({ legend, hint, error, children, className, id, "aria-describedby":
|
|
13077
|
+
var Fieldset = import_react10.forwardRef(function Fieldset({ legend, hint, error, children, className, id, "aria-describedby": existing, ...rest }, ref) {
|
|
13074
13078
|
const uid = useUid("vk-fieldset");
|
|
13075
13079
|
const groupId = id || uid;
|
|
13076
|
-
const descriptions = [describedBy, hint ? groupId + "-hint" : null, error ? groupId + "-error" : null].filter(Boolean).join(" ") || undefined;
|
|
13077
13080
|
return /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("fieldset", {
|
|
13078
13081
|
ref,
|
|
13079
13082
|
id: groupId,
|
|
13080
13083
|
className: cx("vk-fieldset", className),
|
|
13081
|
-
"aria-describedby":
|
|
13084
|
+
"aria-describedby": describedBy(groupId, hint, error, existing),
|
|
13082
13085
|
"aria-invalid": error ? true : undefined,
|
|
13083
13086
|
...rest,
|
|
13084
13087
|
children: [
|
|
@@ -13087,7 +13090,7 @@ Defaulting to \`null\`.`;
|
|
|
13087
13090
|
children: legend
|
|
13088
13091
|
}, undefined, false, undefined, this),
|
|
13089
13092
|
hint ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("p", {
|
|
13090
|
-
className: "vk-fieldset-hint",
|
|
13093
|
+
className: "vk-field-hint vk-fieldset-hint",
|
|
13091
13094
|
id: groupId + "-hint",
|
|
13092
13095
|
children: hint
|
|
13093
13096
|
}, undefined, false, undefined, this) : null,
|
|
@@ -13096,7 +13099,7 @@ Defaulting to \`null\`.`;
|
|
|
13096
13099
|
children
|
|
13097
13100
|
}, undefined, false, undefined, this),
|
|
13098
13101
|
error ? /* @__PURE__ */ jsx_dev_runtime18.jsxDEV("p", {
|
|
13099
|
-
className: "vk-fieldset-error",
|
|
13102
|
+
className: "vk-field-error vk-fieldset-error",
|
|
13100
13103
|
id: groupId + "-error",
|
|
13101
13104
|
children: error
|
|
13102
13105
|
}, undefined, false, undefined, this) : null
|
|
@@ -17149,6 +17152,9 @@ Defaulting to \`null\`.`;
|
|
|
17149
17152
|
]
|
|
17150
17153
|
}, undefined, true, undefined, this);
|
|
17151
17154
|
}
|
|
17155
|
+
// src/components/Stack/Stack.tsx
|
|
17156
|
+
var import_react37 = __toESM(require_react(), 1);
|
|
17157
|
+
|
|
17152
17158
|
// src/lib/space.ts
|
|
17153
17159
|
var SPACE = {
|
|
17154
17160
|
none: "0",
|
|
@@ -17166,87 +17172,68 @@ Defaulting to \`null\`.`;
|
|
|
17166
17172
|
}
|
|
17167
17173
|
|
|
17168
17174
|
// src/components/Stack/Stack.tsx
|
|
17169
|
-
var jsx_dev_runtime59 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17170
17175
|
function Stack({ as, gap, align, children, className, style, ...rest }) {
|
|
17171
|
-
|
|
17172
|
-
return /* @__PURE__ */ jsx_dev_runtime59.jsxDEV(Tag, {
|
|
17173
|
-
className: cx("vk-layout-stack", className),
|
|
17174
|
-
style: { gap: space(gap, "md"), alignItems: align, ...style },
|
|
17175
|
-
...rest,
|
|
17176
|
-
children
|
|
17177
|
-
}, undefined, false, undefined, this);
|
|
17176
|
+
return import_react37.createElement(as || "div", { className: cx("vk-layout-stack", className), style: { gap: space(gap, "md"), alignItems: align, ...style }, ...rest }, children);
|
|
17178
17177
|
}
|
|
17179
17178
|
// src/components/Inline/Inline.tsx
|
|
17180
|
-
var
|
|
17179
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
17181
17180
|
function Inline({ as, gap, align, justify, wrap, children, className, style, ...rest }) {
|
|
17182
|
-
|
|
17183
|
-
return /* @__PURE__ */ jsx_dev_runtime60.jsxDEV(Tag, {
|
|
17184
|
-
className: cx("vk-layout-inline", className),
|
|
17185
|
-
style: { gap: space(gap, "sm"), alignItems: align || "center", justifyContent: justify, flexWrap: wrap === false ? "nowrap" : "wrap", ...style },
|
|
17186
|
-
...rest,
|
|
17187
|
-
children
|
|
17188
|
-
}, undefined, false, undefined, this);
|
|
17181
|
+
return import_react38.createElement(as || "div", { className: cx("vk-layout-inline", className), style: { gap: space(gap, "sm"), alignItems: align || "center", justifyContent: justify, flexWrap: wrap === false ? "nowrap" : "wrap", ...style }, ...rest }, children);
|
|
17189
17182
|
}
|
|
17190
17183
|
// src/components/Grid/Grid.tsx
|
|
17191
|
-
var
|
|
17184
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
17192
17185
|
function Grid({ as, columns, min, gap, children, className, style, ...rest }) {
|
|
17193
|
-
const Tag = as || "div";
|
|
17194
17186
|
const fixed = typeof columns === "number";
|
|
17195
17187
|
const template = fixed ? "repeat(" + columns + ", minmax(0, 1fr))" : "repeat(auto-fit, minmax(min(" + (min || "16rem") + ", 100%), 1fr))";
|
|
17196
|
-
return
|
|
17197
|
-
className: cx("vk-layout-grid", fixed ? "vk-layout-grid-fixed" : null, className),
|
|
17198
|
-
style: { gap: space(gap, "lg"), gridTemplateColumns: template, ...style },
|
|
17199
|
-
...rest,
|
|
17200
|
-
children
|
|
17201
|
-
}, undefined, false, undefined, this);
|
|
17188
|
+
return import_react39.createElement(as || "div", { className: cx("vk-layout-grid", fixed ? "vk-layout-grid-fixed" : null, className), style: { gap: space(gap, "lg"), gridTemplateColumns: template, ...style }, ...rest }, children);
|
|
17202
17189
|
}
|
|
17203
17190
|
// src/components/Container/Container.tsx
|
|
17204
|
-
var
|
|
17191
|
+
var jsx_dev_runtime59 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17205
17192
|
function Container({ as, size, padded, children, className }) {
|
|
17206
17193
|
const Tag = as || "div";
|
|
17207
|
-
return /* @__PURE__ */
|
|
17194
|
+
return /* @__PURE__ */ jsx_dev_runtime59.jsxDEV(Tag, {
|
|
17208
17195
|
className: cx("vk-container", size === "prose" ? "vk-container-prose" : null, padded === false ? null : "vk-container-padded", className),
|
|
17209
17196
|
children
|
|
17210
17197
|
}, undefined, false, undefined, this);
|
|
17211
17198
|
}
|
|
17212
17199
|
// src/components/PageHeader/PageHeader.tsx
|
|
17213
|
-
var
|
|
17200
|
+
var jsx_dev_runtime60 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17214
17201
|
function PageHeader({ title, description, eyebrow, breadcrumbs, actions, badge, badgeTone, divider, headingAs, children, className }) {
|
|
17215
17202
|
const Heading = headingAs || "h1";
|
|
17216
17203
|
const Description = para(description);
|
|
17217
|
-
return /* @__PURE__ */
|
|
17204
|
+
return /* @__PURE__ */ jsx_dev_runtime60.jsxDEV("header", {
|
|
17218
17205
|
className: cx("vk-page-header", divider ? "vk-page-header-divider" : null, className),
|
|
17219
17206
|
children: [
|
|
17220
|
-
breadcrumbs ? /* @__PURE__ */
|
|
17207
|
+
breadcrumbs ? /* @__PURE__ */ jsx_dev_runtime60.jsxDEV(Breadcrumbs, {
|
|
17221
17208
|
items: breadcrumbs
|
|
17222
17209
|
}, undefined, false, undefined, this) : null,
|
|
17223
|
-
/* @__PURE__ */
|
|
17210
|
+
/* @__PURE__ */ jsx_dev_runtime60.jsxDEV("div", {
|
|
17224
17211
|
className: "vk-page-header-row",
|
|
17225
17212
|
children: [
|
|
17226
|
-
/* @__PURE__ */
|
|
17213
|
+
/* @__PURE__ */ jsx_dev_runtime60.jsxDEV("div", {
|
|
17227
17214
|
className: "vk-page-header-text",
|
|
17228
17215
|
children: [
|
|
17229
|
-
eyebrow ? /* @__PURE__ */
|
|
17216
|
+
eyebrow ? /* @__PURE__ */ jsx_dev_runtime60.jsxDEV("p", {
|
|
17230
17217
|
className: "vk-page-header-eyebrow",
|
|
17231
17218
|
children: eyebrow
|
|
17232
17219
|
}, undefined, false, undefined, this) : null,
|
|
17233
|
-
/* @__PURE__ */
|
|
17220
|
+
/* @__PURE__ */ jsx_dev_runtime60.jsxDEV(Heading, {
|
|
17234
17221
|
className: "vk-page-header-title",
|
|
17235
17222
|
children: [
|
|
17236
17223
|
title,
|
|
17237
|
-
badge ? /* @__PURE__ */
|
|
17224
|
+
badge ? /* @__PURE__ */ jsx_dev_runtime60.jsxDEV(Badge, {
|
|
17238
17225
|
tone: badgeTone,
|
|
17239
17226
|
children: badge
|
|
17240
17227
|
}, undefined, false, undefined, this) : null
|
|
17241
17228
|
]
|
|
17242
17229
|
}, undefined, true, undefined, this),
|
|
17243
|
-
description ? /* @__PURE__ */
|
|
17230
|
+
description ? /* @__PURE__ */ jsx_dev_runtime60.jsxDEV(Description, {
|
|
17244
17231
|
className: "vk-page-header-description",
|
|
17245
17232
|
children: description
|
|
17246
17233
|
}, undefined, false, undefined, this) : null
|
|
17247
17234
|
]
|
|
17248
17235
|
}, undefined, true, undefined, this),
|
|
17249
|
-
actions ? /* @__PURE__ */
|
|
17236
|
+
actions ? /* @__PURE__ */ jsx_dev_runtime60.jsxDEV("div", {
|
|
17250
17237
|
className: "vk-page-header-actions",
|
|
17251
17238
|
children: actions
|
|
17252
17239
|
}, undefined, false, undefined, this) : null
|
|
@@ -17257,48 +17244,48 @@ Defaulting to \`null\`.`;
|
|
|
17257
17244
|
}, undefined, true, undefined, this);
|
|
17258
17245
|
}
|
|
17259
17246
|
// src/components/AppShell/AppShell.tsx
|
|
17260
|
-
var
|
|
17261
|
-
var
|
|
17247
|
+
var import_react40 = __toESM(require_react(), 1);
|
|
17248
|
+
var jsx_dev_runtime61 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17262
17249
|
"use client";
|
|
17263
17250
|
function AppShell(props) {
|
|
17264
|
-
const [mobileOpen, setMobileOpen] =
|
|
17265
|
-
const [collapsed, setCollapsed] =
|
|
17251
|
+
const [mobileOpen, setMobileOpen] = import_react40.useState(false);
|
|
17252
|
+
const [collapsed, setCollapsed] = import_react40.useState(Boolean(props.defaultCollapsed));
|
|
17266
17253
|
const sidebarId = useUid("vk-sidebar");
|
|
17267
17254
|
const mainId = props.mainId || "main";
|
|
17268
17255
|
useCloseWhenWide(mobileOpen, setMobileOpen);
|
|
17269
|
-
return /* @__PURE__ */
|
|
17256
|
+
return /* @__PURE__ */ jsx_dev_runtime61.jsxDEV(Dialog, {
|
|
17270
17257
|
open: mobileOpen,
|
|
17271
17258
|
onOpenChange: setMobileOpen,
|
|
17272
|
-
children: /* @__PURE__ */
|
|
17259
|
+
children: /* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17273
17260
|
className: cx("vk-shell", collapsed ? "vk-shell-collapsed" : null, mobileOpen ? "vk-shell-mobile-open" : null, props.className),
|
|
17274
17261
|
style: props.height ? { height: props.height, minHeight: 0, overflow: "hidden" } : undefined,
|
|
17275
17262
|
children: [
|
|
17276
|
-
/* @__PURE__ */
|
|
17263
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("a", {
|
|
17277
17264
|
className: "vk-skip-link",
|
|
17278
17265
|
href: "#" + mainId,
|
|
17279
17266
|
children: props.skipLabel || "Skip to content"
|
|
17280
17267
|
}, undefined, false, undefined, this),
|
|
17281
|
-
/* @__PURE__ */
|
|
17268
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV(ShellTopbar, {
|
|
17282
17269
|
...props,
|
|
17283
17270
|
sidebarId,
|
|
17284
17271
|
mobileOpen,
|
|
17285
17272
|
collapsed,
|
|
17286
17273
|
onToggleCollapsed: () => setCollapsed(!collapsed)
|
|
17287
17274
|
}, undefined, false, undefined, this),
|
|
17288
|
-
/* @__PURE__ */
|
|
17275
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17289
17276
|
className: "vk-shell-body",
|
|
17290
17277
|
children: [
|
|
17291
|
-
/* @__PURE__ */
|
|
17278
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV(ShellSidebar, {
|
|
17292
17279
|
id: sidebarId,
|
|
17293
17280
|
modal: mobileOpen,
|
|
17294
17281
|
label: props.sidebarLabel || "Sidebar",
|
|
17295
17282
|
footer: props.sidebarFooter,
|
|
17296
17283
|
children: props.sidebar
|
|
17297
17284
|
}, undefined, false, undefined, this),
|
|
17298
|
-
/* @__PURE__ */
|
|
17285
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV(DialogOverlay, {
|
|
17299
17286
|
className: "vk-shell-scrim"
|
|
17300
17287
|
}, undefined, false, undefined, this),
|
|
17301
|
-
/* @__PURE__ */
|
|
17288
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("main", {
|
|
17302
17289
|
id: mainId,
|
|
17303
17290
|
tabIndex: -1,
|
|
17304
17291
|
className: "vk-shell-main",
|
|
@@ -17311,7 +17298,7 @@ Defaulting to \`null\`.`;
|
|
|
17311
17298
|
}, undefined, false, undefined, this);
|
|
17312
17299
|
}
|
|
17313
17300
|
function useCloseWhenWide(open, setOpen) {
|
|
17314
|
-
|
|
17301
|
+
import_react40.useEffect(() => {
|
|
17315
17302
|
if (!open || typeof window.matchMedia !== "function")
|
|
17316
17303
|
return;
|
|
17317
17304
|
const mq = window.matchMedia("(max-width: 48rem)");
|
|
@@ -17327,18 +17314,18 @@ Defaulting to \`null\`.`;
|
|
|
17327
17314
|
function ShellTopbar(props) {
|
|
17328
17315
|
const { sidebarId, mobileOpen, collapsed } = props;
|
|
17329
17316
|
const collapseLabel = collapsed ? props.expandLabel || "Show sidebar" : props.collapseLabel || "Hide sidebar";
|
|
17330
|
-
return /* @__PURE__ */
|
|
17317
|
+
return /* @__PURE__ */ jsx_dev_runtime61.jsxDEV("header", {
|
|
17331
17318
|
className: "vk-shell-topbar",
|
|
17332
17319
|
children: [
|
|
17333
|
-
/* @__PURE__ */
|
|
17320
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV(DialogTrigger, {
|
|
17334
17321
|
className: "vk-icon-btn vk-icon-btn-ghost vk-shell-menu",
|
|
17335
17322
|
"aria-label": props.menuLabel || "Menu",
|
|
17336
17323
|
"aria-controls": sidebarId,
|
|
17337
|
-
children: /* @__PURE__ */
|
|
17324
|
+
children: /* @__PURE__ */ jsx_dev_runtime61.jsxDEV(Icon, {
|
|
17338
17325
|
name: mobileOpen ? "x" : "menu"
|
|
17339
17326
|
}, undefined, false, undefined, this)
|
|
17340
17327
|
}, undefined, false, undefined, this),
|
|
17341
|
-
/* @__PURE__ */
|
|
17328
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("button", {
|
|
17342
17329
|
type: "button",
|
|
17343
17330
|
className: "vk-icon-btn vk-icon-btn-ghost vk-shell-collapse",
|
|
17344
17331
|
"aria-label": collapseLabel,
|
|
@@ -17346,19 +17333,19 @@ Defaulting to \`null\`.`;
|
|
|
17346
17333
|
"aria-controls": sidebarId,
|
|
17347
17334
|
title: collapseLabel,
|
|
17348
17335
|
onClick: props.onToggleCollapsed,
|
|
17349
|
-
children: /* @__PURE__ */
|
|
17336
|
+
children: /* @__PURE__ */ jsx_dev_runtime61.jsxDEV(Icon, {
|
|
17350
17337
|
name: "sidebar"
|
|
17351
17338
|
}, undefined, false, undefined, this)
|
|
17352
17339
|
}, undefined, false, undefined, this),
|
|
17353
|
-
/* @__PURE__ */
|
|
17340
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17354
17341
|
className: "vk-shell-brand",
|
|
17355
17342
|
children: props.brand
|
|
17356
17343
|
}, undefined, false, undefined, this),
|
|
17357
|
-
props.search ? /* @__PURE__ */
|
|
17344
|
+
props.search ? /* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17358
17345
|
className: "vk-shell-search",
|
|
17359
17346
|
children: props.search
|
|
17360
17347
|
}, undefined, false, undefined, this) : null,
|
|
17361
|
-
/* @__PURE__ */
|
|
17348
|
+
/* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17362
17349
|
className: "vk-shell-actions",
|
|
17363
17350
|
children: props.actions
|
|
17364
17351
|
}, undefined, false, undefined, this)
|
|
@@ -17366,15 +17353,15 @@ Defaulting to \`null\`.`;
|
|
|
17366
17353
|
}, undefined, true, undefined, this);
|
|
17367
17354
|
}
|
|
17368
17355
|
function ShellSidebar({ id, modal, label, footer, children }) {
|
|
17369
|
-
const sidebarRef =
|
|
17370
|
-
const aside = /* @__PURE__ */
|
|
17356
|
+
const sidebarRef = import_react40.useRef(null);
|
|
17357
|
+
const aside = /* @__PURE__ */ jsx_dev_runtime61.jsxDEV("aside", {
|
|
17371
17358
|
ref: sidebarRef,
|
|
17372
17359
|
id,
|
|
17373
17360
|
className: "vk-shell-sidebar",
|
|
17374
17361
|
"aria-label": label,
|
|
17375
17362
|
children: [
|
|
17376
17363
|
children,
|
|
17377
|
-
footer ? /* @__PURE__ */
|
|
17364
|
+
footer ? /* @__PURE__ */ jsx_dev_runtime61.jsxDEV("div", {
|
|
17378
17365
|
className: "vk-shell-sidebar-footer",
|
|
17379
17366
|
children: footer
|
|
17380
17367
|
}, undefined, false, undefined, this) : null
|
|
@@ -17382,7 +17369,7 @@ Defaulting to \`null\`.`;
|
|
|
17382
17369
|
}, undefined, true, undefined, this);
|
|
17383
17370
|
if (!modal)
|
|
17384
17371
|
return aside;
|
|
17385
|
-
return /* @__PURE__ */
|
|
17372
|
+
return /* @__PURE__ */ jsx_dev_runtime61.jsxDEV(DialogContent, {
|
|
17386
17373
|
asChild: true,
|
|
17387
17374
|
"aria-modal": "true",
|
|
17388
17375
|
"aria-describedby": undefined,
|
|
@@ -17396,19 +17383,19 @@ Defaulting to \`null\`.`;
|
|
|
17396
17383
|
}, undefined, false, undefined, this);
|
|
17397
17384
|
}
|
|
17398
17385
|
// src/components/PasswordInput/PasswordInput.tsx
|
|
17399
|
-
var
|
|
17400
|
-
var
|
|
17386
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
17387
|
+
var jsx_dev_runtime62 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17401
17388
|
"use client";
|
|
17402
|
-
var PasswordInput =
|
|
17403
|
-
const [shown, setShown] =
|
|
17389
|
+
var PasswordInput = import_react41.forwardRef(function PasswordInput(props, ref) {
|
|
17390
|
+
const [shown, setShown] = import_react41.useState(false);
|
|
17404
17391
|
const rest = omit(props, ["showLabel", "hideLabel"]);
|
|
17405
|
-
return /* @__PURE__ */
|
|
17392
|
+
return /* @__PURE__ */ jsx_dev_runtime62.jsxDEV(Input, {
|
|
17406
17393
|
autoComplete: "current-password",
|
|
17407
17394
|
spellCheck: false,
|
|
17408
17395
|
...rest,
|
|
17409
17396
|
ref,
|
|
17410
17397
|
type: shown ? "text" : "password",
|
|
17411
|
-
suffix: /* @__PURE__ */
|
|
17398
|
+
suffix: /* @__PURE__ */ jsx_dev_runtime62.jsxDEV("button", {
|
|
17412
17399
|
type: "button",
|
|
17413
17400
|
className: "vk-affix-button",
|
|
17414
17401
|
"aria-pressed": shown ? "true" : "false",
|
|
@@ -17419,18 +17406,18 @@ Defaulting to \`null\`.`;
|
|
|
17419
17406
|
}, undefined, false, undefined, this);
|
|
17420
17407
|
});
|
|
17421
17408
|
// src/components/NumberInput/NumberInput.tsx
|
|
17422
|
-
var
|
|
17423
|
-
var
|
|
17409
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
17410
|
+
var jsx_dev_runtime63 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17424
17411
|
"use client";
|
|
17425
|
-
var NumberInput =
|
|
17412
|
+
var NumberInput = import_react42.forwardRef(function NumberInput(props, ref) {
|
|
17426
17413
|
const { min, max } = props;
|
|
17427
17414
|
const step = props.step || 1;
|
|
17428
17415
|
const controlled = props.value !== undefined;
|
|
17429
|
-
const [internal, setInternal] =
|
|
17416
|
+
const [internal, setInternal] = import_react42.useState(props.defaultValue != null ? props.defaultValue : null);
|
|
17430
17417
|
const value = props.value !== undefined ? props.value : internal;
|
|
17431
|
-
const [text, setText] =
|
|
17432
|
-
const editing =
|
|
17433
|
-
|
|
17418
|
+
const [text, setText] = import_react42.useState(value == null ? "" : String(value));
|
|
17419
|
+
const editing = import_react42.useRef(false);
|
|
17420
|
+
import_react42.useEffect(() => {
|
|
17434
17421
|
if (!editing.current)
|
|
17435
17422
|
setText(value == null ? "" : String(value));
|
|
17436
17423
|
}, [value]);
|
|
@@ -17451,7 +17438,7 @@ Defaulting to \`null\`.`;
|
|
|
17451
17438
|
};
|
|
17452
17439
|
const bump = (d) => set((value ?? min ?? 0) + d);
|
|
17453
17440
|
const rest = omit(props, ["value", "defaultValue", "onChange", "min", "max", "step", "decrementLabel", "incrementLabel", "suffix", "prefix", "className"]);
|
|
17454
|
-
return /* @__PURE__ */
|
|
17441
|
+
return /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(Input, {
|
|
17455
17442
|
...rest,
|
|
17456
17443
|
ref,
|
|
17457
17444
|
className: cx("vk-number", props.className),
|
|
@@ -17504,7 +17491,7 @@ Defaulting to \`null\`.`;
|
|
|
17504
17491
|
set(max);
|
|
17505
17492
|
}
|
|
17506
17493
|
},
|
|
17507
|
-
suffix: /* @__PURE__ */
|
|
17494
|
+
suffix: /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(Stepper, {
|
|
17508
17495
|
unit: props.suffix,
|
|
17509
17496
|
value,
|
|
17510
17497
|
min,
|
|
@@ -17519,34 +17506,34 @@ Defaulting to \`null\`.`;
|
|
|
17519
17506
|
function Stepper({ unit, value, min, max, disabled, decrementLabel, incrementLabel, onStep }) {
|
|
17520
17507
|
const atMin = min != null && value != null && value <= min;
|
|
17521
17508
|
const atMax = max != null && value != null && value >= max;
|
|
17522
|
-
return /* @__PURE__ */
|
|
17509
|
+
return /* @__PURE__ */ jsx_dev_runtime63.jsxDEV("span", {
|
|
17523
17510
|
className: "vk-stepper",
|
|
17524
17511
|
children: [
|
|
17525
|
-
unit ? /* @__PURE__ */
|
|
17512
|
+
unit ? /* @__PURE__ */ jsx_dev_runtime63.jsxDEV("span", {
|
|
17526
17513
|
className: "vk-stepper-unit",
|
|
17527
17514
|
"aria-hidden": "true",
|
|
17528
17515
|
children: unit
|
|
17529
17516
|
}, undefined, false, undefined, this) : null,
|
|
17530
|
-
/* @__PURE__ */
|
|
17517
|
+
/* @__PURE__ */ jsx_dev_runtime63.jsxDEV("button", {
|
|
17531
17518
|
type: "button",
|
|
17532
17519
|
tabIndex: -1,
|
|
17533
17520
|
className: "vk-stepper-btn",
|
|
17534
17521
|
"aria-label": decrementLabel || "Decrease",
|
|
17535
17522
|
disabled: disabled || atMin,
|
|
17536
17523
|
onClick: () => onStep(-1),
|
|
17537
|
-
children: /* @__PURE__ */
|
|
17524
|
+
children: /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(Icon, {
|
|
17538
17525
|
name: "minus",
|
|
17539
17526
|
size: 14
|
|
17540
17527
|
}, undefined, false, undefined, this)
|
|
17541
17528
|
}, undefined, false, undefined, this),
|
|
17542
|
-
/* @__PURE__ */
|
|
17529
|
+
/* @__PURE__ */ jsx_dev_runtime63.jsxDEV("button", {
|
|
17543
17530
|
type: "button",
|
|
17544
17531
|
tabIndex: -1,
|
|
17545
17532
|
className: "vk-stepper-btn",
|
|
17546
17533
|
"aria-label": incrementLabel || "Increase",
|
|
17547
17534
|
disabled: disabled || atMax,
|
|
17548
17535
|
onClick: () => onStep(1),
|
|
17549
|
-
children: /* @__PURE__ */
|
|
17536
|
+
children: /* @__PURE__ */ jsx_dev_runtime63.jsxDEV(Icon, {
|
|
17550
17537
|
name: "plus",
|
|
17551
17538
|
size: 14
|
|
17552
17539
|
}, undefined, false, undefined, this)
|
|
@@ -17555,13 +17542,13 @@ Defaulting to \`null\`.`;
|
|
|
17555
17542
|
}, undefined, true, undefined, this);
|
|
17556
17543
|
}
|
|
17557
17544
|
// src/components/Slider/Slider.tsx
|
|
17558
|
-
var
|
|
17559
|
-
var
|
|
17545
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
17546
|
+
var jsx_dev_runtime64 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17560
17547
|
"use client";
|
|
17561
17548
|
function Slider2(props) {
|
|
17562
17549
|
const min = props.min == null ? 0 : props.min, max = props.max == null ? 100 : props.max, step = props.step || 1;
|
|
17563
17550
|
const controlled = props.value !== undefined;
|
|
17564
|
-
const [uncontrolled, setUncontrolled] =
|
|
17551
|
+
const [uncontrolled, setUncontrolled] = import_react43.useState(props.defaultValue != null ? props.defaultValue : min);
|
|
17565
17552
|
const value = controlled ? props.value : uncontrolled;
|
|
17566
17553
|
const uid = useUid("vk-slider");
|
|
17567
17554
|
const id = props.id || uid;
|
|
@@ -17581,15 +17568,15 @@ Defaulting to \`null\`.`;
|
|
|
17581
17568
|
set(next);
|
|
17582
17569
|
};
|
|
17583
17570
|
const text = announce(props, value);
|
|
17584
|
-
return /* @__PURE__ */
|
|
17571
|
+
return /* @__PURE__ */ jsx_dev_runtime64.jsxDEV("div", {
|
|
17585
17572
|
className: cx("vk-slider", props.className),
|
|
17586
17573
|
children: [
|
|
17587
|
-
props.showValue ? /* @__PURE__ */
|
|
17574
|
+
props.showValue ? /* @__PURE__ */ jsx_dev_runtime64.jsxDEV("output", {
|
|
17588
17575
|
className: "vk-slider-value",
|
|
17589
17576
|
htmlFor: id,
|
|
17590
17577
|
children: text
|
|
17591
17578
|
}, undefined, false, undefined, this) : null,
|
|
17592
|
-
/* @__PURE__ */
|
|
17579
|
+
/* @__PURE__ */ jsx_dev_runtime64.jsxDEV(Slider, {
|
|
17593
17580
|
className: "vk-slider-track",
|
|
17594
17581
|
min,
|
|
17595
17582
|
max,
|
|
@@ -17600,10 +17587,10 @@ Defaulting to \`null\`.`;
|
|
|
17600
17587
|
onValueChange: (v) => set(v[0]),
|
|
17601
17588
|
onKeyDown,
|
|
17602
17589
|
children: [
|
|
17603
|
-
/* @__PURE__ */
|
|
17590
|
+
/* @__PURE__ */ jsx_dev_runtime64.jsxDEV(SliderRange, {
|
|
17604
17591
|
className: "vk-slider-fill"
|
|
17605
17592
|
}, undefined, false, undefined, this),
|
|
17606
|
-
/* @__PURE__ */
|
|
17593
|
+
/* @__PURE__ */ jsx_dev_runtime64.jsxDEV(SliderThumb, {
|
|
17607
17594
|
id,
|
|
17608
17595
|
className: "vk-slider-thumb",
|
|
17609
17596
|
"aria-valuenow": value,
|
|
@@ -17615,7 +17602,7 @@ Defaulting to \`null\`.`;
|
|
|
17615
17602
|
}, undefined, false, undefined, this)
|
|
17616
17603
|
]
|
|
17617
17604
|
}, undefined, true, undefined, this),
|
|
17618
|
-
props.showLimits ? /* @__PURE__ */
|
|
17605
|
+
props.showLimits ? /* @__PURE__ */ jsx_dev_runtime64.jsxDEV(SliderLimits, {
|
|
17619
17606
|
min,
|
|
17620
17607
|
max,
|
|
17621
17608
|
format: props.format
|
|
@@ -17629,26 +17616,26 @@ Defaulting to \`null\`.`;
|
|
|
17629
17616
|
return format ? format(value) : String(value);
|
|
17630
17617
|
}
|
|
17631
17618
|
function SliderLimits({ min, max, format }) {
|
|
17632
|
-
return /* @__PURE__ */
|
|
17619
|
+
return /* @__PURE__ */ jsx_dev_runtime64.jsxDEV("div", {
|
|
17633
17620
|
className: "vk-slider-limits",
|
|
17634
17621
|
"aria-hidden": "true",
|
|
17635
17622
|
children: [
|
|
17636
|
-
/* @__PURE__ */
|
|
17623
|
+
/* @__PURE__ */ jsx_dev_runtime64.jsxDEV("span", {
|
|
17637
17624
|
children: format ? format(min) : min
|
|
17638
17625
|
}, undefined, false, undefined, this),
|
|
17639
|
-
/* @__PURE__ */
|
|
17626
|
+
/* @__PURE__ */ jsx_dev_runtime64.jsxDEV("span", {
|
|
17640
17627
|
children: format ? format(max) : max
|
|
17641
17628
|
}, undefined, false, undefined, this)
|
|
17642
17629
|
]
|
|
17643
17630
|
}, undefined, true, undefined, this);
|
|
17644
17631
|
}
|
|
17645
17632
|
// src/components/OtpInput/OtpInput.tsx
|
|
17646
|
-
var
|
|
17647
|
-
var
|
|
17633
|
+
var import_react44 = __toESM(require_react(), 1);
|
|
17634
|
+
var jsx_dev_runtime65 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17648
17635
|
"use client";
|
|
17649
17636
|
function OtpBox({ index: i, length, value, pattern, firstId, props, boxRef, set, focus }) {
|
|
17650
17637
|
const first = i === 0;
|
|
17651
|
-
return /* @__PURE__ */
|
|
17638
|
+
return /* @__PURE__ */ jsx_dev_runtime65.jsxDEV("input", {
|
|
17652
17639
|
ref: boxRef,
|
|
17653
17640
|
id: first ? firstId : undefined,
|
|
17654
17641
|
className: "vk-input vk-otp-box",
|
|
@@ -17700,9 +17687,9 @@ Defaulting to \`null\`.`;
|
|
|
17700
17687
|
}
|
|
17701
17688
|
function OtpInput(props) {
|
|
17702
17689
|
const length = props.length || 6;
|
|
17703
|
-
const [uncontrolled, setUncontrolled] =
|
|
17690
|
+
const [uncontrolled, setUncontrolled] = import_react44.useState(() => (props.defaultValue || "").slice(0, length));
|
|
17704
17691
|
const value = props.value !== undefined ? props.value : uncontrolled;
|
|
17705
|
-
const refs =
|
|
17692
|
+
const refs = import_react44.useRef([]);
|
|
17706
17693
|
const uid = useUid("vk-otp");
|
|
17707
17694
|
const pattern = props.numeric === false ? /[^\s]/ : /\d/;
|
|
17708
17695
|
const set = (next) => {
|
|
@@ -17722,7 +17709,7 @@ Defaulting to \`null\`.`;
|
|
|
17722
17709
|
};
|
|
17723
17710
|
const boxes = [];
|
|
17724
17711
|
for (let i = 0;i < length; i++) {
|
|
17725
|
-
boxes.push(/* @__PURE__ */
|
|
17712
|
+
boxes.push(/* @__PURE__ */ jsx_dev_runtime65.jsxDEV(OtpBox, {
|
|
17726
17713
|
index: i,
|
|
17727
17714
|
length,
|
|
17728
17715
|
value,
|
|
@@ -17736,14 +17723,14 @@ Defaulting to \`null\`.`;
|
|
|
17736
17723
|
focus
|
|
17737
17724
|
}, i, false, undefined, this));
|
|
17738
17725
|
}
|
|
17739
|
-
return /* @__PURE__ */
|
|
17726
|
+
return /* @__PURE__ */ jsx_dev_runtime65.jsxDEV("div", {
|
|
17740
17727
|
role: "group",
|
|
17741
17728
|
className: cx("vk-otp", props.className),
|
|
17742
17729
|
"aria-labelledby": props["aria-labelledby"],
|
|
17743
17730
|
"aria-label": props["aria-labelledby"] ? undefined : props["aria-label"] || "One-time code",
|
|
17744
17731
|
children: [
|
|
17745
17732
|
boxes,
|
|
17746
|
-
props.name ? /* @__PURE__ */
|
|
17733
|
+
props.name ? /* @__PURE__ */ jsx_dev_runtime65.jsxDEV("input", {
|
|
17747
17734
|
type: "hidden",
|
|
17748
17735
|
name: props.name,
|
|
17749
17736
|
value
|
|
@@ -17752,8 +17739,8 @@ Defaulting to \`null\`.`;
|
|
|
17752
17739
|
}, undefined, true, undefined, this);
|
|
17753
17740
|
}
|
|
17754
17741
|
// src/components/TimePicker/TimePicker.tsx
|
|
17755
|
-
var
|
|
17756
|
-
var
|
|
17742
|
+
var import_react45 = __toESM(require_react(), 1);
|
|
17743
|
+
var jsx_dev_runtime66 = __toESM(require_jsx_dev_runtime(), 1);
|
|
17757
17744
|
"use client";
|
|
17758
17745
|
function timeOptions(stepMin, from, to, locale) {
|
|
17759
17746
|
const times = [];
|
|
@@ -17772,11 +17759,11 @@ Defaulting to \`null\`.`;
|
|
|
17772
17759
|
function useTimeValue(props, locale, from, to) {
|
|
17773
17760
|
const valueProp = props.value;
|
|
17774
17761
|
const controlled = valueProp !== undefined;
|
|
17775
|
-
const [uncontrolled, setUncontrolled] =
|
|
17762
|
+
const [uncontrolled, setUncontrolled] = import_react45.useState(props.defaultValue || null);
|
|
17776
17763
|
const value = controlled ? valueProp : uncontrolled;
|
|
17777
|
-
const [text, setText] =
|
|
17778
|
-
const [invalid, setInvalid] =
|
|
17779
|
-
|
|
17764
|
+
const [text, setText] = import_react45.useState(() => formatTime(value, locale));
|
|
17765
|
+
const [invalid, setInvalid] = import_react45.useState(false);
|
|
17766
|
+
import_react45.useEffect(() => {
|
|
17780
17767
|
setText(formatTime(value, locale));
|
|
17781
17768
|
}, [value, locale]);
|
|
17782
17769
|
const commit = (v) => {
|
|
@@ -17810,15 +17797,15 @@ Defaulting to \`null\`.`;
|
|
|
17810
17797
|
};
|
|
17811
17798
|
}
|
|
17812
17799
|
function InvalidTime({ id, message, locale }) {
|
|
17813
|
-
return /* @__PURE__ */
|
|
17800
|
+
return /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("span", {
|
|
17814
17801
|
id,
|
|
17815
17802
|
className: "vk-field-error vk-inline-error",
|
|
17816
17803
|
children: message || "Enter a time like " + formatTime("14:30", locale) + "."
|
|
17817
17804
|
}, undefined, false, undefined, this);
|
|
17818
17805
|
}
|
|
17819
17806
|
function TimeList({ listId, label, times, value, open, active, setActive, onPick, rootRef, escaped }) {
|
|
17820
|
-
const [list, setList] =
|
|
17821
|
-
|
|
17807
|
+
const [list, setList] = import_react45.useState(null);
|
|
17808
|
+
import_react45.useEffect(() => {
|
|
17822
17809
|
if (!open || !list || active < 0)
|
|
17823
17810
|
return;
|
|
17824
17811
|
const el = list.querySelector(`[data-index="${active}"]`);
|
|
@@ -17830,8 +17817,8 @@ Defaulting to \`null\`.`;
|
|
|
17830
17817
|
else if (bottom > list.scrollTop + list.clientHeight)
|
|
17831
17818
|
list.scrollTop = bottom - list.clientHeight;
|
|
17832
17819
|
}, [open, list, active]);
|
|
17833
|
-
return /* @__PURE__ */
|
|
17834
|
-
children: /* @__PURE__ */
|
|
17820
|
+
return /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(PopoverPortal, {
|
|
17821
|
+
children: /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(PopoverContent, {
|
|
17835
17822
|
asChild: true,
|
|
17836
17823
|
side: "bottom",
|
|
17837
17824
|
align: "start",
|
|
@@ -17846,14 +17833,14 @@ Defaulting to \`null\`.`;
|
|
|
17846
17833
|
if (rootRef.current && rootRef.current.contains(e.target))
|
|
17847
17834
|
e.preventDefault();
|
|
17848
17835
|
},
|
|
17849
|
-
children: /* @__PURE__ */
|
|
17836
|
+
children: /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("ul", {
|
|
17850
17837
|
ref: setList,
|
|
17851
17838
|
id: listId,
|
|
17852
17839
|
role: "listbox",
|
|
17853
17840
|
"aria-label": label,
|
|
17854
17841
|
className: "vk-select-menu vk-time-menu",
|
|
17855
17842
|
onMouseDown: (e) => e.preventDefault(),
|
|
17856
|
-
children: times.map((t, i) => /* @__PURE__ */
|
|
17843
|
+
children: times.map((t, i) => /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("li", {
|
|
17857
17844
|
id: listId + "-" + i,
|
|
17858
17845
|
"data-index": i,
|
|
17859
17846
|
role: "option",
|
|
@@ -17865,11 +17852,11 @@ Defaulting to \`null\`.`;
|
|
|
17865
17852
|
},
|
|
17866
17853
|
onClick: () => onPick(t.value),
|
|
17867
17854
|
children: [
|
|
17868
|
-
/* @__PURE__ */
|
|
17855
|
+
/* @__PURE__ */ jsx_dev_runtime66.jsxDEV("span", {
|
|
17869
17856
|
className: "vk-time-option",
|
|
17870
17857
|
children: t.label
|
|
17871
17858
|
}, undefined, false, undefined, this),
|
|
17872
|
-
t.value === value ? /* @__PURE__ */
|
|
17859
|
+
t.value === value ? /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(Icon, {
|
|
17873
17860
|
name: "check",
|
|
17874
17861
|
size: 16,
|
|
17875
17862
|
className: "vk-select-check"
|
|
@@ -17880,13 +17867,13 @@ Defaulting to \`null\`.`;
|
|
|
17880
17867
|
}, undefined, false, undefined, this)
|
|
17881
17868
|
}, undefined, false, undefined, this);
|
|
17882
17869
|
}
|
|
17883
|
-
var TimePicker =
|
|
17870
|
+
var TimePicker = import_react45.forwardRef(function TimePicker(props, ref) {
|
|
17884
17871
|
const locale = resolveLocale(props.locale);
|
|
17885
17872
|
const from = parseTime(props.min || "00:00"), to = parseTime(props.max || "23:59");
|
|
17886
17873
|
const times = timeOptions(props.step || 30, from, to, locale);
|
|
17887
17874
|
const { value, text, invalid, type, commit, commitText } = useTimeValue(props, locale, from, to);
|
|
17888
|
-
const [open, setOpen] =
|
|
17889
|
-
const [active, setActive] =
|
|
17875
|
+
const [open, setOpen] = import_react45.useState(Boolean(props.defaultOpen));
|
|
17876
|
+
const [active, setActive] = import_react45.useState(() => {
|
|
17890
17877
|
if (!props.defaultOpen)
|
|
17891
17878
|
return -1;
|
|
17892
17879
|
const i = times.findIndex((t) => value && t.value >= value);
|
|
@@ -17894,9 +17881,9 @@ Defaulting to \`null\`.`;
|
|
|
17894
17881
|
});
|
|
17895
17882
|
const uid = useUid("vk-time");
|
|
17896
17883
|
const listId = uid + "-list";
|
|
17897
|
-
const rootRef =
|
|
17898
|
-
const escaped =
|
|
17899
|
-
const setInputRef =
|
|
17884
|
+
const rootRef = import_react45.useRef(null);
|
|
17885
|
+
const escaped = import_react45.useRef(false);
|
|
17886
|
+
const setInputRef = import_react45.useCallback((el) => {
|
|
17900
17887
|
if (typeof ref === "function")
|
|
17901
17888
|
ref(el);
|
|
17902
17889
|
else if (ref)
|
|
@@ -17946,20 +17933,20 @@ Defaulting to \`null\`.`;
|
|
|
17946
17933
|
}
|
|
17947
17934
|
};
|
|
17948
17935
|
const a11y = omit(props, ["value", "defaultValue", "onChange", "step", "min", "max", "locale", "id", "name", "placeholder", "defaultOpen", "className", "disabled", "invalidMessage"]);
|
|
17949
|
-
return /* @__PURE__ */
|
|
17936
|
+
return /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(Popover, {
|
|
17950
17937
|
open,
|
|
17951
17938
|
onOpenChange: setOpen,
|
|
17952
|
-
children: /* @__PURE__ */
|
|
17939
|
+
children: /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("div", {
|
|
17953
17940
|
ref: rootRef,
|
|
17954
17941
|
className: cx("vk-select", "vk-timepicker", props.className),
|
|
17955
17942
|
"data-state": open ? "open" : "closed",
|
|
17956
17943
|
children: [
|
|
17957
|
-
/* @__PURE__ */
|
|
17944
|
+
/* @__PURE__ */ jsx_dev_runtime66.jsxDEV(PopoverAnchor, {
|
|
17958
17945
|
asChild: true,
|
|
17959
|
-
children: /* @__PURE__ */
|
|
17946
|
+
children: /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("div", {
|
|
17960
17947
|
className: "vk-combobox-field",
|
|
17961
17948
|
children: [
|
|
17962
|
-
/* @__PURE__ */
|
|
17949
|
+
/* @__PURE__ */ jsx_dev_runtime66.jsxDEV("input", {
|
|
17963
17950
|
ref: setInputRef,
|
|
17964
17951
|
id: props.id || uid,
|
|
17965
17952
|
type: "text",
|
|
@@ -17988,7 +17975,7 @@ Defaulting to \`null\`.`;
|
|
|
17988
17975
|
...a11y,
|
|
17989
17976
|
...invalidAria(invalid, props, uid + "-err")
|
|
17990
17977
|
}, undefined, false, undefined, this),
|
|
17991
|
-
/* @__PURE__ */
|
|
17978
|
+
/* @__PURE__ */ jsx_dev_runtime66.jsxDEV(Icon, {
|
|
17992
17979
|
name: "clock",
|
|
17993
17980
|
size: 16,
|
|
17994
17981
|
className: "vk-select-icon"
|
|
@@ -17996,7 +17983,7 @@ Defaulting to \`null\`.`;
|
|
|
17996
17983
|
]
|
|
17997
17984
|
}, undefined, true, undefined, this)
|
|
17998
17985
|
}, undefined, false, undefined, this),
|
|
17999
|
-
/* @__PURE__ */
|
|
17986
|
+
/* @__PURE__ */ jsx_dev_runtime66.jsxDEV(TimeList, {
|
|
18000
17987
|
listId,
|
|
18001
17988
|
label: props["aria-label"] || "Times",
|
|
18002
17989
|
times,
|
|
@@ -18008,12 +17995,12 @@ Defaulting to \`null\`.`;
|
|
|
18008
17995
|
rootRef,
|
|
18009
17996
|
escaped
|
|
18010
17997
|
}, undefined, false, undefined, this),
|
|
18011
|
-
invalid ? /* @__PURE__ */
|
|
17998
|
+
invalid ? /* @__PURE__ */ jsx_dev_runtime66.jsxDEV(InvalidTime, {
|
|
18012
17999
|
id: uid + "-err",
|
|
18013
18000
|
message: props.invalidMessage,
|
|
18014
18001
|
locale
|
|
18015
18002
|
}, undefined, false, undefined, this) : null,
|
|
18016
|
-
props.name ? /* @__PURE__ */
|
|
18003
|
+
props.name ? /* @__PURE__ */ jsx_dev_runtime66.jsxDEV("input", {
|
|
18017
18004
|
type: "hidden",
|
|
18018
18005
|
name: props.name,
|
|
18019
18006
|
value: value || ""
|
|
@@ -18023,47 +18010,47 @@ Defaulting to \`null\`.`;
|
|
|
18023
18010
|
}, undefined, false, undefined, this);
|
|
18024
18011
|
});
|
|
18025
18012
|
// src/components/ErrorSummary/ErrorSummary.tsx
|
|
18026
|
-
var
|
|
18027
|
-
var
|
|
18013
|
+
var import_react46 = __toESM(require_react(), 1);
|
|
18014
|
+
var jsx_dev_runtime67 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18028
18015
|
"use client";
|
|
18029
18016
|
function ErrorSummary(props) {
|
|
18030
|
-
const ref =
|
|
18017
|
+
const ref = import_react46.useRef(null);
|
|
18031
18018
|
const errors = props.errors || [];
|
|
18032
|
-
const autoFocusRef =
|
|
18033
|
-
|
|
18019
|
+
const autoFocusRef = import_react46.useRef(props.autoFocus);
|
|
18020
|
+
import_react46.useEffect(() => {
|
|
18034
18021
|
autoFocusRef.current = props.autoFocus;
|
|
18035
18022
|
}, [props.autoFocus]);
|
|
18036
|
-
|
|
18023
|
+
import_react46.useEffect(() => {
|
|
18037
18024
|
if (errors.length && ref.current && autoFocusRef.current !== false)
|
|
18038
18025
|
ref.current.focus();
|
|
18039
18026
|
}, [errors.length]);
|
|
18040
18027
|
if (!errors.length)
|
|
18041
18028
|
return null;
|
|
18042
18029
|
const title = props.title || (errors.length === 1 ? "Fix 1 problem to continue" : "Fix " + errors.length + " problems to continue");
|
|
18043
|
-
return /* @__PURE__ */
|
|
18030
|
+
return /* @__PURE__ */ jsx_dev_runtime67.jsxDEV("div", {
|
|
18044
18031
|
ref,
|
|
18045
18032
|
tabIndex: -1,
|
|
18046
18033
|
role: "alert",
|
|
18047
18034
|
className: "vk-alert vk-alert-danger vk-error-summary",
|
|
18048
18035
|
"aria-labelledby": "vk-errsum-title",
|
|
18049
18036
|
children: [
|
|
18050
|
-
/* @__PURE__ */
|
|
18037
|
+
/* @__PURE__ */ jsx_dev_runtime67.jsxDEV(Icon, {
|
|
18051
18038
|
name: "circle-alert",
|
|
18052
18039
|
size: 18,
|
|
18053
18040
|
className: "vk-alert-icon"
|
|
18054
18041
|
}, undefined, false, undefined, this),
|
|
18055
|
-
/* @__PURE__ */
|
|
18042
|
+
/* @__PURE__ */ jsx_dev_runtime67.jsxDEV("div", {
|
|
18056
18043
|
className: "vk-alert-body",
|
|
18057
18044
|
children: [
|
|
18058
|
-
/* @__PURE__ */
|
|
18045
|
+
/* @__PURE__ */ jsx_dev_runtime67.jsxDEV("p", {
|
|
18059
18046
|
id: "vk-errsum-title",
|
|
18060
18047
|
className: "vk-alert-title",
|
|
18061
18048
|
children: title
|
|
18062
18049
|
}, undefined, false, undefined, this),
|
|
18063
|
-
/* @__PURE__ */
|
|
18050
|
+
/* @__PURE__ */ jsx_dev_runtime67.jsxDEV("ul", {
|
|
18064
18051
|
className: "vk-error-summary-list",
|
|
18065
|
-
children: errors.map(({ field, message }) => /* @__PURE__ */
|
|
18066
|
-
children: field ? /* @__PURE__ */
|
|
18052
|
+
children: errors.map(({ field, message }) => /* @__PURE__ */ jsx_dev_runtime67.jsxDEV("li", {
|
|
18053
|
+
children: field ? /* @__PURE__ */ jsx_dev_runtime67.jsxDEV("a", {
|
|
18067
18054
|
href: "#" + field,
|
|
18068
18055
|
className: "vk-link",
|
|
18069
18056
|
onClick: (ev) => {
|
|
@@ -18085,11 +18072,11 @@ Defaulting to \`null\`.`;
|
|
|
18085
18072
|
}, undefined, true, undefined, this);
|
|
18086
18073
|
}
|
|
18087
18074
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
18088
|
-
var
|
|
18089
|
-
var
|
|
18075
|
+
var import_react47 = __toESM(require_react(), 1);
|
|
18076
|
+
var jsx_dev_runtime68 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18090
18077
|
"use client";
|
|
18091
18078
|
function ContextMenu2({ items, children, label, disabled, className }) {
|
|
18092
|
-
const [state, setState] =
|
|
18079
|
+
const [state, setState] = import_react47.useState("closed");
|
|
18093
18080
|
const open = state === "open";
|
|
18094
18081
|
const { defer, flush } = useDeferredSelect();
|
|
18095
18082
|
const { arm, onFocus } = useFocusOnOpen();
|
|
@@ -18097,11 +18084,11 @@ Defaulting to \`null\`.`;
|
|
|
18097
18084
|
arm(next ? "first" : null);
|
|
18098
18085
|
setState((s) => !next ? "closed" : s === "open" ? "open" : "opening");
|
|
18099
18086
|
};
|
|
18100
|
-
|
|
18087
|
+
import_react47.useEffect(() => {
|
|
18101
18088
|
if (state === "opening")
|
|
18102
18089
|
setState("open");
|
|
18103
18090
|
}, [state]);
|
|
18104
|
-
|
|
18091
|
+
import_react47.useEffect(() => {
|
|
18105
18092
|
if (!open)
|
|
18106
18093
|
return;
|
|
18107
18094
|
const onScroll = (e) => {
|
|
@@ -18113,15 +18100,15 @@ Defaulting to \`null\`.`;
|
|
|
18113
18100
|
window.addEventListener("scroll", onScroll, true);
|
|
18114
18101
|
return () => window.removeEventListener("scroll", onScroll, true);
|
|
18115
18102
|
}, [open, arm]);
|
|
18116
|
-
return /* @__PURE__ */
|
|
18103
|
+
return /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ContextMenu, {
|
|
18117
18104
|
open,
|
|
18118
18105
|
onOpenChange,
|
|
18119
18106
|
modal: false,
|
|
18120
18107
|
children: [
|
|
18121
|
-
/* @__PURE__ */
|
|
18108
|
+
/* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ContextMenuTrigger, {
|
|
18122
18109
|
asChild: true,
|
|
18123
18110
|
disabled,
|
|
18124
|
-
children: /* @__PURE__ */
|
|
18111
|
+
children: /* @__PURE__ */ jsx_dev_runtime68.jsxDEV("div", {
|
|
18125
18112
|
className: cx("vk-context-target", className),
|
|
18126
18113
|
onContextMenu: (e) => {
|
|
18127
18114
|
if (!e.currentTarget.contains(e.target))
|
|
@@ -18140,8 +18127,8 @@ Defaulting to \`null\`.`;
|
|
|
18140
18127
|
children
|
|
18141
18128
|
}, undefined, false, undefined, this)
|
|
18142
18129
|
}, undefined, false, undefined, this),
|
|
18143
|
-
/* @__PURE__ */
|
|
18144
|
-
children: /* @__PURE__ */
|
|
18130
|
+
/* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ContextMenuPortal, {
|
|
18131
|
+
children: /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(ContextMenuContent, {
|
|
18145
18132
|
className: "vk-menu vk-context-menu",
|
|
18146
18133
|
"aria-label": label || "Actions",
|
|
18147
18134
|
collisionPadding: 8,
|
|
@@ -18155,7 +18142,7 @@ Defaulting to \`null\`.`;
|
|
|
18155
18142
|
onOpenChange(false);
|
|
18156
18143
|
}
|
|
18157
18144
|
},
|
|
18158
|
-
children: /* @__PURE__ */
|
|
18145
|
+
children: /* @__PURE__ */ jsx_dev_runtime68.jsxDEV(MenuEntries, {
|
|
18159
18146
|
parts: exports_dist7,
|
|
18160
18147
|
items: items || [],
|
|
18161
18148
|
defer
|
|
@@ -18166,36 +18153,36 @@ Defaulting to \`null\`.`;
|
|
|
18166
18153
|
}, undefined, true, undefined, this);
|
|
18167
18154
|
}
|
|
18168
18155
|
// src/components/List/List.tsx
|
|
18169
|
-
var
|
|
18156
|
+
var jsx_dev_runtime69 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18170
18157
|
function List({ as, children, divided, bordered, label, className }) {
|
|
18171
18158
|
const Tag = as || "ul";
|
|
18172
|
-
return /* @__PURE__ */
|
|
18159
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV(Tag, {
|
|
18173
18160
|
className: cx("vk-list", divided !== false && "vk-list-divided", bordered && "vk-list-bordered", className),
|
|
18174
18161
|
"aria-label": label,
|
|
18175
18162
|
children
|
|
18176
18163
|
}, undefined, false, undefined, this);
|
|
18177
18164
|
}
|
|
18178
18165
|
function ListItemBody({ title, description, meta, leading }) {
|
|
18179
|
-
return /* @__PURE__ */
|
|
18166
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV(jsx_dev_runtime69.Fragment, {
|
|
18180
18167
|
children: [
|
|
18181
|
-
leading ? /* @__PURE__ */
|
|
18168
|
+
leading ? /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18182
18169
|
className: "vk-list-leading",
|
|
18183
18170
|
children: leading
|
|
18184
18171
|
}, undefined, false, undefined, this) : null,
|
|
18185
|
-
/* @__PURE__ */
|
|
18172
|
+
/* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18186
18173
|
className: "vk-list-text",
|
|
18187
18174
|
children: [
|
|
18188
|
-
/* @__PURE__ */
|
|
18175
|
+
/* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18189
18176
|
className: "vk-list-title",
|
|
18190
18177
|
children: title
|
|
18191
18178
|
}, undefined, false, undefined, this),
|
|
18192
|
-
description ? /* @__PURE__ */
|
|
18179
|
+
description ? /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18193
18180
|
className: "vk-list-description",
|
|
18194
18181
|
children: description
|
|
18195
18182
|
}, undefined, false, undefined, this) : null
|
|
18196
18183
|
]
|
|
18197
18184
|
}, undefined, true, undefined, this),
|
|
18198
|
-
meta ? /* @__PURE__ */
|
|
18185
|
+
meta ? /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18199
18186
|
className: "vk-list-meta",
|
|
18200
18187
|
children: meta
|
|
18201
18188
|
}, undefined, false, undefined, this) : null
|
|
@@ -18204,41 +18191,41 @@ Defaulting to \`null\`.`;
|
|
|
18204
18191
|
}
|
|
18205
18192
|
function ListItemMain({ href, onClick, selected, children }) {
|
|
18206
18193
|
if (href)
|
|
18207
|
-
return /* @__PURE__ */
|
|
18194
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV(Anchor, {
|
|
18208
18195
|
href,
|
|
18209
18196
|
className: "vk-list-main vk-list-interactive",
|
|
18210
18197
|
"aria-current": selected ? "true" : undefined,
|
|
18211
18198
|
children
|
|
18212
18199
|
}, undefined, false, undefined, this);
|
|
18213
18200
|
if (onClick)
|
|
18214
|
-
return /* @__PURE__ */
|
|
18201
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("button", {
|
|
18215
18202
|
type: "button",
|
|
18216
18203
|
className: "vk-list-main vk-list-interactive",
|
|
18217
18204
|
"aria-pressed": selected != null ? selected ? "true" : "false" : undefined,
|
|
18218
18205
|
onClick,
|
|
18219
18206
|
children
|
|
18220
18207
|
}, undefined, false, undefined, this);
|
|
18221
|
-
return /* @__PURE__ */
|
|
18208
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("div", {
|
|
18222
18209
|
className: "vk-list-main",
|
|
18223
18210
|
children
|
|
18224
18211
|
}, undefined, false, undefined, this);
|
|
18225
18212
|
}
|
|
18226
18213
|
function ListItem({ title, description, meta, leading, trailing, href, onClick, selected, className }) {
|
|
18227
|
-
return /* @__PURE__ */
|
|
18214
|
+
return /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("li", {
|
|
18228
18215
|
className: cx("vk-list-item", selected && "vk-list-item-selected", className),
|
|
18229
18216
|
children: [
|
|
18230
|
-
/* @__PURE__ */
|
|
18217
|
+
/* @__PURE__ */ jsx_dev_runtime69.jsxDEV(ListItemMain, {
|
|
18231
18218
|
href,
|
|
18232
18219
|
onClick,
|
|
18233
18220
|
selected,
|
|
18234
|
-
children: /* @__PURE__ */
|
|
18221
|
+
children: /* @__PURE__ */ jsx_dev_runtime69.jsxDEV(ListItemBody, {
|
|
18235
18222
|
title,
|
|
18236
18223
|
description,
|
|
18237
18224
|
meta,
|
|
18238
18225
|
leading
|
|
18239
18226
|
}, undefined, false, undefined, this)
|
|
18240
18227
|
}, undefined, false, undefined, this),
|
|
18241
|
-
trailing ? /* @__PURE__ */
|
|
18228
|
+
trailing ? /* @__PURE__ */ jsx_dev_runtime69.jsxDEV("span", {
|
|
18242
18229
|
className: "vk-list-trailing",
|
|
18243
18230
|
children: trailing
|
|
18244
18231
|
}, undefined, false, undefined, this) : null
|
|
@@ -18246,7 +18233,7 @@ Defaulting to \`null\`.`;
|
|
|
18246
18233
|
}, undefined, true, undefined, this);
|
|
18247
18234
|
}
|
|
18248
18235
|
// src/components/AvatarGroup/AvatarGroup.tsx
|
|
18249
|
-
var
|
|
18236
|
+
var jsx_dev_runtime70 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18250
18237
|
function AvatarGroup(props) {
|
|
18251
18238
|
const people = props.people || [];
|
|
18252
18239
|
const max = props.max || 4;
|
|
@@ -18254,24 +18241,24 @@ Defaulting to \`null\`.`;
|
|
|
18254
18241
|
const rest = people.length - shown.length;
|
|
18255
18242
|
const size = props.size || 28;
|
|
18256
18243
|
const label = props.label || people.map((p) => p.name).join(", ");
|
|
18257
|
-
return /* @__PURE__ */
|
|
18244
|
+
return /* @__PURE__ */ jsx_dev_runtime70.jsxDEV("span", {
|
|
18258
18245
|
className: "vk-avatar-group",
|
|
18259
18246
|
role: "img",
|
|
18260
18247
|
"aria-label": label,
|
|
18261
18248
|
children: [
|
|
18262
|
-
shown.map((p) => /* @__PURE__ */
|
|
18249
|
+
shown.map((p) => /* @__PURE__ */ jsx_dev_runtime70.jsxDEV("span", {
|
|
18263
18250
|
className: "vk-avatar-group-item",
|
|
18264
18251
|
title: p.name,
|
|
18265
|
-
children: /* @__PURE__ */
|
|
18252
|
+
children: /* @__PURE__ */ jsx_dev_runtime70.jsxDEV(Avatar, {
|
|
18266
18253
|
src: p.src,
|
|
18267
18254
|
name: p.name,
|
|
18268
18255
|
size,
|
|
18269
18256
|
decorative: true
|
|
18270
18257
|
}, undefined, false, undefined, this)
|
|
18271
18258
|
}, p.name, false, undefined, this)),
|
|
18272
|
-
rest > 0 ? /* @__PURE__ */
|
|
18259
|
+
rest > 0 ? /* @__PURE__ */ jsx_dev_runtime70.jsxDEV("span", {
|
|
18273
18260
|
className: "vk-avatar-group-item",
|
|
18274
|
-
children: /* @__PURE__ */
|
|
18261
|
+
children: /* @__PURE__ */ jsx_dev_runtime70.jsxDEV("span", {
|
|
18275
18262
|
className: "vk-avatar vk-avatar-initials vk-avatar-more",
|
|
18276
18263
|
style: { width: size + "px", height: size + "px", fontSize: Math.round(size * 0.36) + "px" },
|
|
18277
18264
|
"aria-hidden": "true",
|
|
@@ -18282,41 +18269,41 @@ Defaulting to \`null\`.`;
|
|
|
18282
18269
|
}, undefined, true, undefined, this);
|
|
18283
18270
|
}
|
|
18284
18271
|
// src/components/Timeline/Timeline.tsx
|
|
18285
|
-
var
|
|
18272
|
+
var jsx_dev_runtime71 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18286
18273
|
var STATUS_TEXT = STATUS_WORD;
|
|
18287
18274
|
function Timeline({ items, label, className }) {
|
|
18288
|
-
return /* @__PURE__ */
|
|
18275
|
+
return /* @__PURE__ */ jsx_dev_runtime71.jsxDEV("ol", {
|
|
18289
18276
|
className: cx("vk-timeline", className),
|
|
18290
18277
|
"aria-label": label,
|
|
18291
|
-
children: (items || []).map((it, i) => /* @__PURE__ */
|
|
18278
|
+
children: (items || []).map((it, i) => /* @__PURE__ */ jsx_dev_runtime71.jsxDEV("li", {
|
|
18292
18279
|
className: cx("vk-timeline-item", it.status && "vk-timeline-" + it.status),
|
|
18293
18280
|
children: [
|
|
18294
|
-
/* @__PURE__ */
|
|
18281
|
+
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV("span", {
|
|
18295
18282
|
className: "vk-timeline-marker",
|
|
18296
18283
|
"aria-hidden": "true",
|
|
18297
|
-
children: it.icon ? /* @__PURE__ */
|
|
18284
|
+
children: it.icon ? /* @__PURE__ */ jsx_dev_runtime71.jsxDEV(Icon, {
|
|
18298
18285
|
name: it.icon,
|
|
18299
18286
|
size: 14
|
|
18300
18287
|
}, undefined, false, undefined, this) : null
|
|
18301
18288
|
}, undefined, false, undefined, this),
|
|
18302
|
-
/* @__PURE__ */
|
|
18289
|
+
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV("div", {
|
|
18303
18290
|
className: "vk-timeline-body",
|
|
18304
18291
|
children: [
|
|
18305
|
-
/* @__PURE__ */
|
|
18292
|
+
/* @__PURE__ */ jsx_dev_runtime71.jsxDEV("p", {
|
|
18306
18293
|
className: "vk-timeline-title",
|
|
18307
18294
|
children: [
|
|
18308
18295
|
it.title,
|
|
18309
|
-
it.status ? /* @__PURE__ */
|
|
18296
|
+
it.status ? /* @__PURE__ */ jsx_dev_runtime71.jsxDEV("span", {
|
|
18310
18297
|
className: "vk-sr-only",
|
|
18311
18298
|
children: " (" + (STATUS_TEXT[it.status] || it.status) + ")"
|
|
18312
18299
|
}, undefined, false, undefined, this) : null
|
|
18313
18300
|
]
|
|
18314
18301
|
}, undefined, true, undefined, this),
|
|
18315
|
-
it.description ? /* @__PURE__ */
|
|
18302
|
+
it.description ? /* @__PURE__ */ jsx_dev_runtime71.jsxDEV("div", {
|
|
18316
18303
|
className: "vk-timeline-description",
|
|
18317
18304
|
children: it.description
|
|
18318
18305
|
}, undefined, false, undefined, this) : null,
|
|
18319
|
-
it.time ? /* @__PURE__ */
|
|
18306
|
+
it.time ? /* @__PURE__ */ jsx_dev_runtime71.jsxDEV("time", {
|
|
18320
18307
|
className: "vk-timeline-time",
|
|
18321
18308
|
dateTime: it.dateTime,
|
|
18322
18309
|
children: it.time
|
|
@@ -18328,8 +18315,8 @@ Defaulting to \`null\`.`;
|
|
|
18328
18315
|
}, undefined, false, undefined, this);
|
|
18329
18316
|
}
|
|
18330
18317
|
// src/components/TreeView/TreeView.tsx
|
|
18331
|
-
var
|
|
18332
|
-
var
|
|
18318
|
+
var import_react48 = __toESM(require_react(), 1);
|
|
18319
|
+
var jsx_dev_runtime72 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18333
18320
|
"use client";
|
|
18334
18321
|
function flattenTree(items, expanded, level, parent, out) {
|
|
18335
18322
|
(items || []).forEach((it) => {
|
|
@@ -18340,15 +18327,15 @@ Defaulting to \`null\`.`;
|
|
|
18340
18327
|
return out;
|
|
18341
18328
|
}
|
|
18342
18329
|
function TreeView({ items, selected: selectedProp, defaultSelected, onSelect, defaultExpanded, toggleOnSelect, label, className }) {
|
|
18343
|
-
const [expanded, setExpanded] =
|
|
18344
|
-
const [selectedState, setSelectedState] =
|
|
18330
|
+
const [expanded, setExpanded] = import_react48.useState(defaultExpanded || []);
|
|
18331
|
+
const [selectedState, setSelectedState] = import_react48.useState(defaultSelected || null);
|
|
18345
18332
|
const selected = selectedProp !== undefined ? selectedProp : selectedState;
|
|
18346
18333
|
const expandedSet = new Set(expanded);
|
|
18347
18334
|
const visible = flattenTree(items, expandedSet, 1, null, []);
|
|
18348
|
-
const [focusId, setFocusId] =
|
|
18349
|
-
const ref =
|
|
18350
|
-
const moved =
|
|
18351
|
-
|
|
18335
|
+
const [focusId, setFocusId] = import_react48.useState(selected || visible[0]?.item.id);
|
|
18336
|
+
const ref = import_react48.useRef(null);
|
|
18337
|
+
const moved = import_react48.useRef(false);
|
|
18338
|
+
import_react48.useEffect(() => {
|
|
18352
18339
|
if (!moved.current || !ref.current)
|
|
18353
18340
|
return;
|
|
18354
18341
|
const el = ref.current.querySelector('[data-id="' + focusId + '"]');
|
|
@@ -18427,7 +18414,7 @@ Defaulting to \`null\`.`;
|
|
|
18427
18414
|
const renderLevel = (levelItems, level) => levelItems.map((it, i) => {
|
|
18428
18415
|
const kids = it.children && it.children.length ? it.children : null;
|
|
18429
18416
|
const open = expandedSet.has(it.id);
|
|
18430
|
-
return /* @__PURE__ */
|
|
18417
|
+
return /* @__PURE__ */ jsx_dev_runtime72.jsxDEV("li", {
|
|
18431
18418
|
role: "treeitem",
|
|
18432
18419
|
"data-id": it.id,
|
|
18433
18420
|
tabIndex: it.id === focusId ? 0 : -1,
|
|
@@ -18449,34 +18436,34 @@ Defaulting to \`null\`.`;
|
|
|
18449
18436
|
toggle(it.id);
|
|
18450
18437
|
},
|
|
18451
18438
|
children: [
|
|
18452
|
-
/* @__PURE__ */
|
|
18439
|
+
/* @__PURE__ */ jsx_dev_runtime72.jsxDEV("span", {
|
|
18453
18440
|
className: cx("vk-tree-row", it.id === selected && "vk-tree-row-selected"),
|
|
18454
18441
|
style: { paddingLeft: 0.5 + (level - 1) * 1.25 + "rem" },
|
|
18455
18442
|
children: [
|
|
18456
|
-
kids ? /* @__PURE__ */
|
|
18443
|
+
kids ? /* @__PURE__ */ jsx_dev_runtime72.jsxDEV(Icon, {
|
|
18457
18444
|
name: "chevron-right",
|
|
18458
18445
|
size: 14,
|
|
18459
18446
|
className: cx("vk-tree-caret", open && "vk-tree-caret-open")
|
|
18460
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
18447
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime72.jsxDEV("span", {
|
|
18461
18448
|
className: "vk-tree-caret",
|
|
18462
18449
|
"aria-hidden": "true"
|
|
18463
18450
|
}, undefined, false, undefined, this),
|
|
18464
|
-
it.icon ? /* @__PURE__ */
|
|
18451
|
+
it.icon ? /* @__PURE__ */ jsx_dev_runtime72.jsxDEV(Icon, {
|
|
18465
18452
|
name: it.icon,
|
|
18466
18453
|
size: 16,
|
|
18467
18454
|
className: "vk-tree-icon"
|
|
18468
18455
|
}, undefined, false, undefined, this) : null,
|
|
18469
|
-
/* @__PURE__ */
|
|
18456
|
+
/* @__PURE__ */ jsx_dev_runtime72.jsxDEV("span", {
|
|
18470
18457
|
className: "vk-tree-label",
|
|
18471
18458
|
children: it.label
|
|
18472
18459
|
}, undefined, false, undefined, this),
|
|
18473
|
-
it.meta ? /* @__PURE__ */
|
|
18460
|
+
it.meta ? /* @__PURE__ */ jsx_dev_runtime72.jsxDEV("span", {
|
|
18474
18461
|
className: "vk-tree-meta",
|
|
18475
18462
|
children: it.meta
|
|
18476
18463
|
}, undefined, false, undefined, this) : null
|
|
18477
18464
|
]
|
|
18478
18465
|
}, undefined, true, undefined, this),
|
|
18479
|
-
kids && open ? /* @__PURE__ */
|
|
18466
|
+
kids && open ? /* @__PURE__ */ jsx_dev_runtime72.jsxDEV("ul", {
|
|
18480
18467
|
role: "group",
|
|
18481
18468
|
className: "vk-tree-group",
|
|
18482
18469
|
children: renderLevel(kids, level + 1)
|
|
@@ -18484,7 +18471,7 @@ Defaulting to \`null\`.`;
|
|
|
18484
18471
|
]
|
|
18485
18472
|
}, it.id, true, undefined, this);
|
|
18486
18473
|
});
|
|
18487
|
-
return /* @__PURE__ */
|
|
18474
|
+
return /* @__PURE__ */ jsx_dev_runtime72.jsxDEV("ul", {
|
|
18488
18475
|
ref,
|
|
18489
18476
|
role: "tree",
|
|
18490
18477
|
"aria-label": label,
|
|
@@ -18494,51 +18481,46 @@ Defaulting to \`null\`.`;
|
|
|
18494
18481
|
}, undefined, false, undefined, this);
|
|
18495
18482
|
}
|
|
18496
18483
|
// src/components/Heading/Heading.tsx
|
|
18497
|
-
var
|
|
18484
|
+
var jsx_dev_runtime73 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18498
18485
|
var HEADING_SIZE = { 1: "heading-1", 2: "heading-2", 3: "title", 4: "title-sm" };
|
|
18499
18486
|
function Heading({ level: levelProp, size, id, children, className }) {
|
|
18500
18487
|
const level = levelProp || 2;
|
|
18501
18488
|
const style = size || HEADING_SIZE[level];
|
|
18502
18489
|
const Tag = `h${level}`;
|
|
18503
|
-
return /* @__PURE__ */
|
|
18490
|
+
return /* @__PURE__ */ jsx_dev_runtime73.jsxDEV(Tag, {
|
|
18504
18491
|
id,
|
|
18505
18492
|
className: cx("vk-heading", "vk-text-" + style, className),
|
|
18506
18493
|
children
|
|
18507
18494
|
}, undefined, false, undefined, this);
|
|
18508
18495
|
}
|
|
18509
18496
|
// src/components/Text/Text.tsx
|
|
18510
|
-
var
|
|
18511
|
-
function Text({ as, size, tone, numeric,
|
|
18512
|
-
|
|
18513
|
-
return /* @__PURE__ */ jsx_dev_runtime77.jsxDEV(Tag, {
|
|
18514
|
-
className: cx("vk-text", "vk-text-" + (size || "body"), tone && "vk-tone-" + tone, numeric && "vk-text-numeric", wrap === "anywhere" && "vk-text-wrap-anywhere", truncate && "vk-text-truncate", weight && "vk-weight-" + weight, className),
|
|
18515
|
-
...rest,
|
|
18516
|
-
children
|
|
18517
|
-
}, undefined, false, undefined, this);
|
|
18497
|
+
var import_react49 = __toESM(require_react(), 1);
|
|
18498
|
+
function Text({ as, size, tone, numeric, overflowWrap, truncate, weight, children, className, ...rest }) {
|
|
18499
|
+
return import_react49.createElement(as || "p", { className: cx("vk-text", "vk-text-" + (size || "body"), tone && "vk-tone-" + tone, numeric && "vk-text-numeric", overflowWrap === "anywhere" && "vk-text-wrap-anywhere", truncate && "vk-text-truncate", weight && "vk-weight-" + weight, className), ...rest }, children);
|
|
18518
18500
|
}
|
|
18519
18501
|
// src/components/Prose/Prose.tsx
|
|
18520
|
-
var
|
|
18502
|
+
var jsx_dev_runtime74 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18521
18503
|
function Prose({ as, children, className }) {
|
|
18522
18504
|
const Tag = as || "div";
|
|
18523
|
-
return /* @__PURE__ */
|
|
18505
|
+
return /* @__PURE__ */ jsx_dev_runtime74.jsxDEV(Tag, {
|
|
18524
18506
|
className: cx("vk-prose", className),
|
|
18525
18507
|
children
|
|
18526
18508
|
}, undefined, false, undefined, this);
|
|
18527
18509
|
}
|
|
18528
18510
|
// src/components/Code/Code.tsx
|
|
18529
|
-
var
|
|
18511
|
+
var jsx_dev_runtime75 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18530
18512
|
function Code({ children, className }) {
|
|
18531
|
-
return /* @__PURE__ */
|
|
18513
|
+
return /* @__PURE__ */ jsx_dev_runtime75.jsxDEV("code", {
|
|
18532
18514
|
className: cx("vk-code", className),
|
|
18533
18515
|
children
|
|
18534
18516
|
}, undefined, false, undefined, this);
|
|
18535
18517
|
}
|
|
18536
18518
|
// src/components/CodeBlock/CodeBlock.tsx
|
|
18537
|
-
var
|
|
18538
|
-
var
|
|
18519
|
+
var import_react50 = __toESM(require_react(), 1);
|
|
18520
|
+
var jsx_dev_runtime76 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18539
18521
|
"use client";
|
|
18540
18522
|
function useCopy(code, preRef) {
|
|
18541
|
-
const [copied, setCopied] =
|
|
18523
|
+
const [copied, setCopied] = import_react50.useState(false);
|
|
18542
18524
|
const selectAll = () => {
|
|
18543
18525
|
const pre = preRef.current;
|
|
18544
18526
|
const sel = window.getSelection();
|
|
@@ -18563,23 +18545,23 @@ Defaulting to \`null\`.`;
|
|
|
18563
18545
|
return { copied, copy };
|
|
18564
18546
|
}
|
|
18565
18547
|
function CodeBlockHead({ title, showCopy, copied, onCopy }) {
|
|
18566
|
-
return /* @__PURE__ */
|
|
18548
|
+
return /* @__PURE__ */ jsx_dev_runtime76.jsxDEV("figcaption", {
|
|
18567
18549
|
className: "vk-codeblock-head",
|
|
18568
18550
|
children: [
|
|
18569
|
-
/* @__PURE__ */
|
|
18551
|
+
/* @__PURE__ */ jsx_dev_runtime76.jsxDEV("span", {
|
|
18570
18552
|
className: "vk-codeblock-title",
|
|
18571
18553
|
children: title
|
|
18572
18554
|
}, undefined, false, undefined, this),
|
|
18573
|
-
showCopy ? /* @__PURE__ */
|
|
18555
|
+
showCopy ? /* @__PURE__ */ jsx_dev_runtime76.jsxDEV("button", {
|
|
18574
18556
|
type: "button",
|
|
18575
18557
|
className: "vk-codeblock-copy",
|
|
18576
18558
|
onClick: onCopy,
|
|
18577
18559
|
children: [
|
|
18578
|
-
/* @__PURE__ */
|
|
18560
|
+
/* @__PURE__ */ jsx_dev_runtime76.jsxDEV(Icon, {
|
|
18579
18561
|
name: copied ? "check" : "copy",
|
|
18580
18562
|
size: 14
|
|
18581
18563
|
}, undefined, false, undefined, this),
|
|
18582
|
-
/* @__PURE__ */
|
|
18564
|
+
/* @__PURE__ */ jsx_dev_runtime76.jsxDEV("span", {
|
|
18583
18565
|
"aria-live": "polite",
|
|
18584
18566
|
children: copied ? "Copied" : "Copy"
|
|
18585
18567
|
}, undefined, false, undefined, this)
|
|
@@ -18589,27 +18571,27 @@ Defaulting to \`null\`.`;
|
|
|
18589
18571
|
}, undefined, true, undefined, this);
|
|
18590
18572
|
}
|
|
18591
18573
|
function CodeBlock({ code, title, language, lineNumbers, copy: showCopy, className }) {
|
|
18592
|
-
const preRef =
|
|
18574
|
+
const preRef = import_react50.useRef(null);
|
|
18593
18575
|
const { copied, copy } = useCopy(code, preRef);
|
|
18594
18576
|
const lines = String(code || "").replace(/\n$/, "").split(`
|
|
18595
18577
|
`);
|
|
18596
18578
|
const canCopy = showCopy !== false;
|
|
18597
|
-
return /* @__PURE__ */
|
|
18579
|
+
return /* @__PURE__ */ jsx_dev_runtime76.jsxDEV("figure", {
|
|
18598
18580
|
className: cx("vk-codeblock", className),
|
|
18599
18581
|
children: [
|
|
18600
|
-
title || language || canCopy ? /* @__PURE__ */
|
|
18582
|
+
title || language || canCopy ? /* @__PURE__ */ jsx_dev_runtime76.jsxDEV(CodeBlockHead, {
|
|
18601
18583
|
title: title || language,
|
|
18602
18584
|
showCopy: canCopy,
|
|
18603
18585
|
copied,
|
|
18604
18586
|
onCopy: copy
|
|
18605
18587
|
}, undefined, false, undefined, this) : null,
|
|
18606
|
-
/* @__PURE__ */
|
|
18588
|
+
/* @__PURE__ */ jsx_dev_runtime76.jsxDEV("pre", {
|
|
18607
18589
|
ref: preRef,
|
|
18608
18590
|
className: cx("vk-codeblock-pre", lineNumbers && "vk-codeblock-numbered"),
|
|
18609
18591
|
tabIndex: 0,
|
|
18610
18592
|
"aria-label": title || (language ? language + " code" : "Code"),
|
|
18611
|
-
children: /* @__PURE__ */
|
|
18612
|
-
children: lineNumbers ? lines.map((l, i) => /* @__PURE__ */
|
|
18593
|
+
children: /* @__PURE__ */ jsx_dev_runtime76.jsxDEV("code", {
|
|
18594
|
+
children: lineNumbers ? lines.map((l, i) => /* @__PURE__ */ jsx_dev_runtime76.jsxDEV("span", {
|
|
18613
18595
|
className: "vk-code-line",
|
|
18614
18596
|
children: l + `
|
|
18615
18597
|
`
|
|
@@ -18621,21 +18603,21 @@ Defaulting to \`null\`.`;
|
|
|
18621
18603
|
}, undefined, true, undefined, this);
|
|
18622
18604
|
}
|
|
18623
18605
|
// src/components/Figure/Figure.tsx
|
|
18624
|
-
var
|
|
18606
|
+
var jsx_dev_runtime77 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18625
18607
|
function Figure({ src, alt, ratio, caption, children, className }) {
|
|
18626
|
-
return /* @__PURE__ */
|
|
18608
|
+
return /* @__PURE__ */ jsx_dev_runtime77.jsxDEV("figure", {
|
|
18627
18609
|
className: cx("vk-figure", className),
|
|
18628
18610
|
children: [
|
|
18629
|
-
/* @__PURE__ */
|
|
18611
|
+
/* @__PURE__ */ jsx_dev_runtime77.jsxDEV("div", {
|
|
18630
18612
|
className: "vk-figure-media",
|
|
18631
18613
|
style: ratio ? { aspectRatio: ratio } : undefined,
|
|
18632
|
-
children: src ? /* @__PURE__ */
|
|
18614
|
+
children: src ? /* @__PURE__ */ jsx_dev_runtime77.jsxDEV("img", {
|
|
18633
18615
|
src,
|
|
18634
18616
|
alt: alt || "",
|
|
18635
18617
|
loading: "lazy"
|
|
18636
18618
|
}, undefined, false, undefined, this) : children
|
|
18637
18619
|
}, undefined, false, undefined, this),
|
|
18638
|
-
caption ? /* @__PURE__ */
|
|
18620
|
+
caption ? /* @__PURE__ */ jsx_dev_runtime77.jsxDEV("figcaption", {
|
|
18639
18621
|
className: "vk-figure-caption",
|
|
18640
18622
|
children: caption
|
|
18641
18623
|
}, undefined, false, undefined, this) : null
|
|
@@ -18643,13 +18625,13 @@ Defaulting to \`null\`.`;
|
|
|
18643
18625
|
}, undefined, true, undefined, this);
|
|
18644
18626
|
}
|
|
18645
18627
|
// src/components/CommandPalette/CommandPalette.tsx
|
|
18646
|
-
var
|
|
18628
|
+
var import_react52 = __toESM(require_react(), 1);
|
|
18647
18629
|
|
|
18648
18630
|
// src/internal/useScrollActive.ts
|
|
18649
|
-
var
|
|
18631
|
+
var import_react51 = __toESM(require_react(), 1);
|
|
18650
18632
|
"use client";
|
|
18651
18633
|
function useScrollActive(open, listRef, active) {
|
|
18652
|
-
|
|
18634
|
+
import_react51.useEffect(() => {
|
|
18653
18635
|
if (!open || !listRef.current || active < 0)
|
|
18654
18636
|
return;
|
|
18655
18637
|
const el = listRef.current.querySelector(`[data-index="${active}"]`);
|
|
@@ -18659,11 +18641,11 @@ Defaulting to \`null\`.`;
|
|
|
18659
18641
|
}
|
|
18660
18642
|
|
|
18661
18643
|
// src/components/CommandPalette/CommandPalette.tsx
|
|
18662
|
-
var
|
|
18644
|
+
var jsx_dev_runtime78 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18663
18645
|
"use client";
|
|
18664
18646
|
function CommandPalette({ commands, open: openProp, onOpenChange, hotkey, placeholder, emptyText, title }) {
|
|
18665
18647
|
const controlled = openProp !== undefined;
|
|
18666
|
-
const [openState, setOpenState] =
|
|
18648
|
+
const [openState, setOpenState] = import_react52.useState(false);
|
|
18667
18649
|
const open = openProp ?? openState;
|
|
18668
18650
|
const setOpen = (v) => {
|
|
18669
18651
|
if (!controlled)
|
|
@@ -18671,11 +18653,11 @@ Defaulting to \`null\`.`;
|
|
|
18671
18653
|
onOpenChange?.(v);
|
|
18672
18654
|
};
|
|
18673
18655
|
const uid = useUid("vk-cmd");
|
|
18674
|
-
const toggleRef =
|
|
18656
|
+
const toggleRef = import_react52.useRef(() => setOpen(!open));
|
|
18675
18657
|
useIsoLayoutEffect(() => {
|
|
18676
18658
|
toggleRef.current = () => setOpen(!open);
|
|
18677
18659
|
});
|
|
18678
|
-
|
|
18660
|
+
import_react52.useEffect(() => {
|
|
18679
18661
|
if (hotkey === false)
|
|
18680
18662
|
return;
|
|
18681
18663
|
const onKey = (e) => {
|
|
@@ -18687,7 +18669,7 @@ Defaulting to \`null\`.`;
|
|
|
18687
18669
|
document.addEventListener("keydown", onKey);
|
|
18688
18670
|
return () => document.removeEventListener("keydown", onKey);
|
|
18689
18671
|
}, [hotkey]);
|
|
18690
|
-
return /* @__PURE__ */
|
|
18672
|
+
return /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Dialog2, {
|
|
18691
18673
|
open,
|
|
18692
18674
|
onClose: () => setOpen(false),
|
|
18693
18675
|
title: title || "Command palette",
|
|
@@ -18695,29 +18677,29 @@ Defaulting to \`null\`.`;
|
|
|
18695
18677
|
size: "md",
|
|
18696
18678
|
closeOnBackdrop: true,
|
|
18697
18679
|
children: [
|
|
18698
|
-
/* @__PURE__ */
|
|
18680
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(PaletteSearch, {
|
|
18699
18681
|
uid,
|
|
18700
18682
|
commands,
|
|
18701
18683
|
placeholder,
|
|
18702
18684
|
emptyText,
|
|
18703
18685
|
close: () => setOpen(false)
|
|
18704
18686
|
}, undefined, false, undefined, this),
|
|
18705
|
-
/* @__PURE__ */
|
|
18687
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18706
18688
|
className: "vk-cmd-footer",
|
|
18707
18689
|
"aria-hidden": "true",
|
|
18708
18690
|
children: [
|
|
18709
|
-
/* @__PURE__ */
|
|
18691
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Kbd, {
|
|
18710
18692
|
children: "↑"
|
|
18711
18693
|
}, undefined, false, undefined, this),
|
|
18712
|
-
/* @__PURE__ */
|
|
18694
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Kbd, {
|
|
18713
18695
|
children: "↓"
|
|
18714
18696
|
}, undefined, false, undefined, this),
|
|
18715
18697
|
" to move ",
|
|
18716
|
-
/* @__PURE__ */
|
|
18698
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Kbd, {
|
|
18717
18699
|
children: "Enter"
|
|
18718
18700
|
}, undefined, false, undefined, this),
|
|
18719
18701
|
" to run ",
|
|
18720
|
-
/* @__PURE__ */
|
|
18702
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Kbd, {
|
|
18721
18703
|
children: "Esc"
|
|
18722
18704
|
}, undefined, false, undefined, this),
|
|
18723
18705
|
" to close"
|
|
@@ -18727,9 +18709,9 @@ Defaulting to \`null\`.`;
|
|
|
18727
18709
|
}, undefined, true, undefined, this);
|
|
18728
18710
|
}
|
|
18729
18711
|
function PaletteSearch({ uid, commands, placeholder, emptyText, close }) {
|
|
18730
|
-
const [query, setQuery] =
|
|
18731
|
-
const [active, setActive] =
|
|
18732
|
-
const listRef =
|
|
18712
|
+
const [query, setQuery] = import_react52.useState("");
|
|
18713
|
+
const [active, setActive] = import_react52.useState(0);
|
|
18714
|
+
const listRef = import_react52.useRef(null);
|
|
18733
18715
|
const cmds = (commands || []).filter((c) => {
|
|
18734
18716
|
if (!query)
|
|
18735
18717
|
return true;
|
|
@@ -18751,17 +18733,17 @@ Defaulting to \`null\`.`;
|
|
|
18751
18733
|
groups.push({ name: g, items: [] });
|
|
18752
18734
|
groups[groups.length - 1].items.push({ c, i });
|
|
18753
18735
|
});
|
|
18754
|
-
return /* @__PURE__ */
|
|
18736
|
+
return /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(jsx_dev_runtime78.Fragment, {
|
|
18755
18737
|
children: [
|
|
18756
|
-
/* @__PURE__ */
|
|
18738
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18757
18739
|
className: "vk-cmd-search",
|
|
18758
18740
|
children: [
|
|
18759
|
-
/* @__PURE__ */
|
|
18741
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Icon, {
|
|
18760
18742
|
name: "search",
|
|
18761
18743
|
size: 16,
|
|
18762
18744
|
className: "vk-search-icon"
|
|
18763
18745
|
}, undefined, false, undefined, this),
|
|
18764
|
-
/* @__PURE__ */
|
|
18746
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV("input", {
|
|
18765
18747
|
"data-autofocus": "",
|
|
18766
18748
|
type: "text",
|
|
18767
18749
|
role: "combobox",
|
|
@@ -18792,22 +18774,22 @@ Defaulting to \`null\`.`;
|
|
|
18792
18774
|
}, undefined, false, undefined, this)
|
|
18793
18775
|
]
|
|
18794
18776
|
}, undefined, true, undefined, this),
|
|
18795
|
-
cmds.length ? /* @__PURE__ */
|
|
18777
|
+
cmds.length ? /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18796
18778
|
ref: listRef,
|
|
18797
18779
|
id: uid + "-list",
|
|
18798
18780
|
role: "listbox",
|
|
18799
18781
|
"aria-label": "Commands",
|
|
18800
18782
|
className: "vk-cmd-list",
|
|
18801
|
-
children: groups.map((g) => /* @__PURE__ */
|
|
18783
|
+
children: groups.map((g) => /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18802
18784
|
role: "group",
|
|
18803
18785
|
"aria-label": g.name || undefined,
|
|
18804
18786
|
children: [
|
|
18805
|
-
g.name ? /* @__PURE__ */
|
|
18787
|
+
g.name ? /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18806
18788
|
className: "vk-menu-label",
|
|
18807
18789
|
"aria-hidden": "true",
|
|
18808
18790
|
children: g.name
|
|
18809
18791
|
}, undefined, false, undefined, this) : null,
|
|
18810
|
-
g.items.map(({ c, i }) => /* @__PURE__ */
|
|
18792
|
+
g.items.map(({ c, i }) => /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("div", {
|
|
18811
18793
|
id: uid + "-" + i,
|
|
18812
18794
|
"data-index": i,
|
|
18813
18795
|
role: "option",
|
|
@@ -18821,18 +18803,18 @@ Defaulting to \`null\`.`;
|
|
|
18821
18803
|
onMouseDown: (e) => e.preventDefault(),
|
|
18822
18804
|
onClick: () => run(c),
|
|
18823
18805
|
children: [
|
|
18824
|
-
c.icon ? /* @__PURE__ */
|
|
18806
|
+
c.icon ? /* @__PURE__ */ jsx_dev_runtime78.jsxDEV(Icon, {
|
|
18825
18807
|
name: c.icon,
|
|
18826
18808
|
size: 16,
|
|
18827
18809
|
className: "vk-menu-item-icon"
|
|
18828
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
18810
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("span", {
|
|
18829
18811
|
className: "vk-menu-item-icon"
|
|
18830
18812
|
}, undefined, false, undefined, this),
|
|
18831
|
-
/* @__PURE__ */
|
|
18813
|
+
/* @__PURE__ */ jsx_dev_runtime78.jsxDEV("span", {
|
|
18832
18814
|
className: "vk-menu-item-label",
|
|
18833
18815
|
children: highlight(c.label, query)
|
|
18834
18816
|
}, undefined, false, undefined, this),
|
|
18835
|
-
c.shortcut ? /* @__PURE__ */
|
|
18817
|
+
c.shortcut ? /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("kbd", {
|
|
18836
18818
|
className: "vk-menu-shortcut",
|
|
18837
18819
|
children: c.shortcut
|
|
18838
18820
|
}, undefined, false, undefined, this) : null
|
|
@@ -18840,7 +18822,7 @@ Defaulting to \`null\`.`;
|
|
|
18840
18822
|
}, c.id || c.label, true, undefined, this))
|
|
18841
18823
|
]
|
|
18842
18824
|
}, g.name || "_", true, undefined, this))
|
|
18843
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
18825
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime78.jsxDEV("p", {
|
|
18844
18826
|
className: "vk-select-empty",
|
|
18845
18827
|
role: "status",
|
|
18846
18828
|
children: emptyText || "No commands match “" + query + "”"
|
|
@@ -18849,8 +18831,8 @@ Defaulting to \`null\`.`;
|
|
|
18849
18831
|
}, undefined, true, undefined, this);
|
|
18850
18832
|
}
|
|
18851
18833
|
// src/charts/chart.tsx
|
|
18852
|
-
var
|
|
18853
|
-
var
|
|
18834
|
+
var import_react53 = __toESM(require_react(), 1);
|
|
18835
|
+
var jsx_dev_runtime79 = __toESM(require_jsx_dev_runtime(), 1);
|
|
18854
18836
|
"use client";
|
|
18855
18837
|
function cell(row, key) {
|
|
18856
18838
|
return typeof row === "object" && row !== null ? Reflect.get(row, key) : undefined;
|
|
@@ -18860,13 +18842,13 @@ Defaulting to \`null\`.`;
|
|
|
18860
18842
|
}
|
|
18861
18843
|
function cellLabel(row, key) {
|
|
18862
18844
|
const v = cell(row, key);
|
|
18863
|
-
return typeof v === "string" || typeof v === "number" ||
|
|
18845
|
+
return typeof v === "string" || typeof v === "number" || import_react53.isValidElement(v) ? v : null;
|
|
18864
18846
|
}
|
|
18865
18847
|
function formatCell(format, row, key) {
|
|
18866
18848
|
return format(cell(row, key));
|
|
18867
18849
|
}
|
|
18868
18850
|
function useWidth(ref, fallback) {
|
|
18869
|
-
const [width, setWidth] =
|
|
18851
|
+
const [width, setWidth] = import_react53.useState(fallback);
|
|
18870
18852
|
useIsoLayoutEffect(() => {
|
|
18871
18853
|
const el = ref.current;
|
|
18872
18854
|
if (!el)
|
|
@@ -18889,11 +18871,11 @@ Defaulting to \`null\`.`;
|
|
|
18889
18871
|
return "var(--chart-" + (i % 8 + 1) + ")";
|
|
18890
18872
|
}
|
|
18891
18873
|
function ChartLegend({ series }) {
|
|
18892
|
-
return /* @__PURE__ */
|
|
18874
|
+
return /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("ul", {
|
|
18893
18875
|
className: "vk-chart-legend",
|
|
18894
|
-
children: series.map((s, i) => /* @__PURE__ */
|
|
18876
|
+
children: series.map((s, i) => /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("li", {
|
|
18895
18877
|
children: [
|
|
18896
|
-
/* @__PURE__ */
|
|
18878
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("span", {
|
|
18897
18879
|
className: "vk-chart-swatch",
|
|
18898
18880
|
style: { background: seriesColor(i) },
|
|
18899
18881
|
"aria-hidden": "true"
|
|
@@ -18905,21 +18887,21 @@ Defaulting to \`null\`.`;
|
|
|
18905
18887
|
}
|
|
18906
18888
|
function ChartTable(props) {
|
|
18907
18889
|
const { data, series, format, xKey } = props;
|
|
18908
|
-
return /* @__PURE__ */
|
|
18890
|
+
return /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("table", {
|
|
18909
18891
|
className: cx("vk-table", props.hidden ? null : "vk-chart-table"),
|
|
18910
18892
|
children: [
|
|
18911
|
-
/* @__PURE__ */
|
|
18893
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("caption", {
|
|
18912
18894
|
className: "vk-sr-only",
|
|
18913
18895
|
children: props.title
|
|
18914
18896
|
}, undefined, false, undefined, this),
|
|
18915
|
-
/* @__PURE__ */
|
|
18916
|
-
children: /* @__PURE__ */
|
|
18897
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("thead", {
|
|
18898
|
+
children: /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("tr", {
|
|
18917
18899
|
children: [
|
|
18918
|
-
/* @__PURE__ */
|
|
18900
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("th", {
|
|
18919
18901
|
scope: "col",
|
|
18920
18902
|
children: props.xLabel || "Category"
|
|
18921
18903
|
}, undefined, false, undefined, this),
|
|
18922
|
-
series.map((s) => /* @__PURE__ */
|
|
18904
|
+
series.map((s) => /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("th", {
|
|
18923
18905
|
scope: "col",
|
|
18924
18906
|
className: "vk-td-end",
|
|
18925
18907
|
children: s.label
|
|
@@ -18927,14 +18909,14 @@ Defaulting to \`null\`.`;
|
|
|
18927
18909
|
]
|
|
18928
18910
|
}, undefined, true, undefined, this)
|
|
18929
18911
|
}, undefined, false, undefined, this),
|
|
18930
|
-
/* @__PURE__ */
|
|
18931
|
-
children: data.map((d, i) => /* @__PURE__ */
|
|
18912
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("tbody", {
|
|
18913
|
+
children: data.map((d, i) => /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("tr", {
|
|
18932
18914
|
children: [
|
|
18933
|
-
/* @__PURE__ */
|
|
18915
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("th", {
|
|
18934
18916
|
scope: "row",
|
|
18935
18917
|
children: cellLabel(d, xKey)
|
|
18936
18918
|
}, undefined, false, undefined, this),
|
|
18937
|
-
series.map((s) => /* @__PURE__ */
|
|
18919
|
+
series.map((s) => /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("td", {
|
|
18938
18920
|
className: "vk-td-end vk-td-num",
|
|
18939
18921
|
children: formatCell(format, d, s.key)
|
|
18940
18922
|
}, s.key, false, undefined, this))
|
|
@@ -18946,22 +18928,22 @@ Defaulting to \`null\`.`;
|
|
|
18946
18928
|
}
|
|
18947
18929
|
function ChartCaption({ title, description, allowTable, showTable, onToggle }) {
|
|
18948
18930
|
const Description = para(description);
|
|
18949
|
-
return /* @__PURE__ */
|
|
18931
|
+
return /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("figcaption", {
|
|
18950
18932
|
className: "vk-chart-head",
|
|
18951
18933
|
children: [
|
|
18952
|
-
/* @__PURE__ */
|
|
18934
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("div", {
|
|
18953
18935
|
children: [
|
|
18954
|
-
title ? /* @__PURE__ */
|
|
18936
|
+
title ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("p", {
|
|
18955
18937
|
className: "vk-chart-title",
|
|
18956
18938
|
children: title
|
|
18957
18939
|
}, undefined, false, undefined, this) : null,
|
|
18958
|
-
description ? /* @__PURE__ */
|
|
18940
|
+
description ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(Description, {
|
|
18959
18941
|
className: "vk-chart-description",
|
|
18960
18942
|
children: description
|
|
18961
18943
|
}, undefined, false, undefined, this) : null
|
|
18962
18944
|
]
|
|
18963
18945
|
}, undefined, true, undefined, this),
|
|
18964
|
-
allowTable !== false ? /* @__PURE__ */
|
|
18946
|
+
allowTable !== false ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(Button, {
|
|
18965
18947
|
variant: "ghost",
|
|
18966
18948
|
size: "sm",
|
|
18967
18949
|
"aria-pressed": showTable ? "true" : "false",
|
|
@@ -18972,33 +18954,33 @@ Defaulting to \`null\`.`;
|
|
|
18972
18954
|
}, undefined, true, undefined, this);
|
|
18973
18955
|
}
|
|
18974
18956
|
function ChartFrame(props) {
|
|
18975
|
-
const [showTable, setShowTable] =
|
|
18957
|
+
const [showTable, setShowTable] = import_react53.useState(false);
|
|
18976
18958
|
const { title, description, allowTable, series } = props;
|
|
18977
18959
|
const hasCaption = Boolean(title || description || allowTable !== false);
|
|
18978
|
-
return /* @__PURE__ */
|
|
18960
|
+
return /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("figure", {
|
|
18979
18961
|
className: cx("vk-chart", props.className),
|
|
18980
18962
|
children: [
|
|
18981
|
-
hasCaption ? /* @__PURE__ */
|
|
18963
|
+
hasCaption ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(ChartCaption, {
|
|
18982
18964
|
title,
|
|
18983
18965
|
description,
|
|
18984
18966
|
allowTable,
|
|
18985
18967
|
showTable,
|
|
18986
18968
|
onToggle: () => setShowTable(!showTable)
|
|
18987
18969
|
}, undefined, false, undefined, this) : null,
|
|
18988
|
-
series.length > 1 && !showTable ? /* @__PURE__ */
|
|
18970
|
+
series.length > 1 && !showTable ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(ChartLegend, {
|
|
18989
18971
|
series
|
|
18990
18972
|
}, undefined, false, undefined, this) : null,
|
|
18991
|
-
showTable ? /* @__PURE__ */
|
|
18973
|
+
showTable ? /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("div", {
|
|
18992
18974
|
className: "vk-table-wrap",
|
|
18993
|
-
children: /* @__PURE__ */
|
|
18975
|
+
children: /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(ChartTable, {
|
|
18994
18976
|
...props
|
|
18995
18977
|
}, undefined, false, undefined, this)
|
|
18996
|
-
}, undefined, false, undefined, this) : /* @__PURE__ */
|
|
18978
|
+
}, undefined, false, undefined, this) : /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(jsx_dev_runtime79.Fragment, {
|
|
18997
18979
|
children: [
|
|
18998
18980
|
props.children,
|
|
18999
|
-
/* @__PURE__ */
|
|
18981
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("div", {
|
|
19000
18982
|
className: "vk-sr-only",
|
|
19001
|
-
children: /* @__PURE__ */
|
|
18983
|
+
children: /* @__PURE__ */ jsx_dev_runtime79.jsxDEV(ChartTable, {
|
|
19002
18984
|
...props,
|
|
19003
18985
|
hidden: true
|
|
19004
18986
|
}, undefined, false, undefined, this)
|
|
@@ -19013,27 +18995,27 @@ Defaulting to \`null\`.`;
|
|
|
19013
18995
|
return null;
|
|
19014
18996
|
const d = props.data[idx];
|
|
19015
18997
|
const left = Math.min(Math.max(x, 80), width - 80);
|
|
19016
|
-
return /* @__PURE__ */
|
|
18998
|
+
return /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("div", {
|
|
19017
18999
|
className: "vk-chart-tooltip",
|
|
19018
19000
|
style: { left: left + "px" },
|
|
19019
19001
|
role: "presentation",
|
|
19020
19002
|
children: [
|
|
19021
|
-
/* @__PURE__ */
|
|
19003
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("p", {
|
|
19022
19004
|
className: "vk-chart-tooltip-title",
|
|
19023
19005
|
children: cellLabel(d, props.xKey)
|
|
19024
19006
|
}, undefined, false, undefined, this),
|
|
19025
|
-
props.series.map((s, i) => /* @__PURE__ */
|
|
19007
|
+
props.series.map((s, i) => /* @__PURE__ */ jsx_dev_runtime79.jsxDEV("p", {
|
|
19026
19008
|
className: "vk-chart-tooltip-row",
|
|
19027
19009
|
children: [
|
|
19028
|
-
/* @__PURE__ */
|
|
19010
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("span", {
|
|
19029
19011
|
className: "vk-chart-swatch",
|
|
19030
19012
|
style: { background: seriesColor(i) }
|
|
19031
19013
|
}, undefined, false, undefined, this),
|
|
19032
|
-
/* @__PURE__ */
|
|
19014
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("span", {
|
|
19033
19015
|
className: "vk-chart-tooltip-label",
|
|
19034
19016
|
children: s.label
|
|
19035
19017
|
}, undefined, false, undefined, this),
|
|
19036
|
-
/* @__PURE__ */
|
|
19018
|
+
/* @__PURE__ */ jsx_dev_runtime79.jsxDEV("span", {
|
|
19037
19019
|
className: "vk-chart-tooltip-value",
|
|
19038
19020
|
children: formatCell(props.format, d, s.key)
|
|
19039
19021
|
}, undefined, false, undefined, this)
|
|
@@ -19043,9 +19025,9 @@ Defaulting to \`null\`.`;
|
|
|
19043
19025
|
}, undefined, true, undefined, this);
|
|
19044
19026
|
}
|
|
19045
19027
|
function useChart(props) {
|
|
19046
|
-
const ref =
|
|
19028
|
+
const ref = import_react53.useRef(null);
|
|
19047
19029
|
const width = useWidth(ref, props.width || 640);
|
|
19048
|
-
const [active, setActive] =
|
|
19030
|
+
const [active, setActive] = import_react53.useState(null);
|
|
19049
19031
|
const fmt = props.valueFormat || ((v) => v == null ? "—" : numberFormat(props.locale || "en-US").format(v));
|
|
19050
19032
|
const series = props.series || [{ key: "value", label: props.valueLabel || "Value" }];
|
|
19051
19033
|
return { ref, width, active, setActive, fmt, series, xKey: props.xKey || "label" };
|
|
@@ -19071,7 +19053,7 @@ Defaulting to \`null\`.`;
|
|
|
19071
19053
|
}
|
|
19072
19054
|
|
|
19073
19055
|
// src/components/BarChart/BarChart.tsx
|
|
19074
|
-
var
|
|
19056
|
+
var jsx_dev_runtime80 = __toESM(require_jsx_dev_runtime(), 1);
|
|
19075
19057
|
"use client";
|
|
19076
19058
|
function BarChart(props) {
|
|
19077
19059
|
const c = useChart(props);
|
|
@@ -19099,7 +19081,7 @@ Defaulting to \`null\`.`;
|
|
|
19099
19081
|
return c.series.map((s, si) => {
|
|
19100
19082
|
const v = cellNumber(d, s.key), y1 = y(acc + v), y0 = y(acc);
|
|
19101
19083
|
acc += v;
|
|
19102
|
-
return /* @__PURE__ */
|
|
19084
|
+
return /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("rect", {
|
|
19103
19085
|
x: x0,
|
|
19104
19086
|
y: y1,
|
|
19105
19087
|
width: groupW,
|
|
@@ -19112,7 +19094,7 @@ Defaulting to \`null\`.`;
|
|
|
19112
19094
|
const w = (groupW - 2 * (c.series.length - 1)) / c.series.length;
|
|
19113
19095
|
return c.series.map((s, si) => {
|
|
19114
19096
|
const v = cellNumber(d, s.key);
|
|
19115
|
-
return /* @__PURE__ */
|
|
19097
|
+
return /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("rect", {
|
|
19116
19098
|
x: x0 + si * (w + 2),
|
|
19117
19099
|
y: y(v),
|
|
19118
19100
|
width: Math.max(1, w),
|
|
@@ -19124,9 +19106,9 @@ Defaulting to \`null\`.`;
|
|
|
19124
19106
|
});
|
|
19125
19107
|
const activeX = c.active == null ? 0 : pad.left + band * c.active + band / 2;
|
|
19126
19108
|
const view = { ...props, data, series: c.series, format: c.fmt, xKey: c.xKey };
|
|
19127
|
-
return /* @__PURE__ */
|
|
19109
|
+
return /* @__PURE__ */ jsx_dev_runtime80.jsxDEV(ChartFrame, {
|
|
19128
19110
|
...view,
|
|
19129
|
-
children: /* @__PURE__ */
|
|
19111
|
+
children: /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("div", {
|
|
19130
19112
|
ref: c.ref,
|
|
19131
19113
|
className: "vk-chart-plot",
|
|
19132
19114
|
tabIndex: 0,
|
|
@@ -19136,23 +19118,23 @@ Defaulting to \`null\`.`;
|
|
|
19136
19118
|
onMouseLeave: () => c.setActive(null),
|
|
19137
19119
|
onBlur: () => c.setActive(null),
|
|
19138
19120
|
children: [
|
|
19139
|
-
/* @__PURE__ */
|
|
19121
|
+
/* @__PURE__ */ jsx_dev_runtime80.jsxDEV("svg", {
|
|
19140
19122
|
width: c.width,
|
|
19141
19123
|
height,
|
|
19142
19124
|
viewBox: "0 0 " + c.width + " " + height,
|
|
19143
19125
|
"aria-hidden": "true",
|
|
19144
19126
|
className: "vk-chart-svg",
|
|
19145
19127
|
children: [
|
|
19146
|
-
ticks.map((t) => /* @__PURE__ */
|
|
19128
|
+
ticks.map((t) => /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("g", {
|
|
19147
19129
|
children: [
|
|
19148
|
-
/* @__PURE__ */
|
|
19130
|
+
/* @__PURE__ */ jsx_dev_runtime80.jsxDEV("line", {
|
|
19149
19131
|
x1: pad.left,
|
|
19150
19132
|
x2: c.width - pad.right,
|
|
19151
19133
|
y1: y(t),
|
|
19152
19134
|
y2: y(t),
|
|
19153
19135
|
className: t === 0 ? "vk-chart-baseline" : "vk-chart-grid"
|
|
19154
19136
|
}, undefined, false, undefined, this),
|
|
19155
|
-
/* @__PURE__ */
|
|
19137
|
+
/* @__PURE__ */ jsx_dev_runtime80.jsxDEV("text", {
|
|
19156
19138
|
x: pad.left - 8,
|
|
19157
19139
|
y: y(t),
|
|
19158
19140
|
dy: "0.32em",
|
|
@@ -19162,7 +19144,7 @@ Defaulting to \`null\`.`;
|
|
|
19162
19144
|
}, undefined, false, undefined, this)
|
|
19163
19145
|
]
|
|
19164
19146
|
}, t, true, undefined, this)),
|
|
19165
|
-
c.active != null ? /* @__PURE__ */
|
|
19147
|
+
c.active != null ? /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("rect", {
|
|
19166
19148
|
x: pad.left + band * c.active,
|
|
19167
19149
|
y: pad.top,
|
|
19168
19150
|
width: band,
|
|
@@ -19170,14 +19152,14 @@ Defaulting to \`null\`.`;
|
|
|
19170
19152
|
className: "vk-chart-hoverband"
|
|
19171
19153
|
}, undefined, false, undefined, this) : null,
|
|
19172
19154
|
bars,
|
|
19173
|
-
data.map((d, i) => /* @__PURE__ */
|
|
19155
|
+
data.map((d, i) => /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("text", {
|
|
19174
19156
|
x: pad.left + band * i + band / 2,
|
|
19175
19157
|
y: height - 8,
|
|
19176
19158
|
textAnchor: "middle",
|
|
19177
19159
|
className: "vk-chart-tick",
|
|
19178
19160
|
children: cellLabel(d, c.xKey)
|
|
19179
19161
|
}, "x" + i, false, undefined, this)),
|
|
19180
|
-
data.map((_, i) => /* @__PURE__ */
|
|
19162
|
+
data.map((_, i) => /* @__PURE__ */ jsx_dev_runtime80.jsxDEV("rect", {
|
|
19181
19163
|
x: pad.left + band * i,
|
|
19182
19164
|
y: pad.top,
|
|
19183
19165
|
width: band,
|
|
@@ -19193,7 +19175,7 @@ Defaulting to \`null\`.`;
|
|
|
19193
19175
|
}, undefined, false, undefined, this);
|
|
19194
19176
|
}
|
|
19195
19177
|
// src/components/LineChart/LineChart.tsx
|
|
19196
|
-
var
|
|
19178
|
+
var jsx_dev_runtime81 = __toESM(require_jsx_dev_runtime(), 1);
|
|
19197
19179
|
"use client";
|
|
19198
19180
|
function LineChart(props) {
|
|
19199
19181
|
const c = useChart(props);
|
|
@@ -19218,9 +19200,9 @@ Defaulting to \`null\`.`;
|
|
|
19218
19200
|
const i = Math.round((px - pad.left) / plotW * (data.length - 1));
|
|
19219
19201
|
c.setActive(Math.max(0, Math.min(data.length - 1, i)));
|
|
19220
19202
|
};
|
|
19221
|
-
return /* @__PURE__ */
|
|
19203
|
+
return /* @__PURE__ */ jsx_dev_runtime81.jsxDEV(ChartFrame, {
|
|
19222
19204
|
...view,
|
|
19223
|
-
children: /* @__PURE__ */
|
|
19205
|
+
children: /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("div", {
|
|
19224
19206
|
ref: c.ref,
|
|
19225
19207
|
className: "vk-chart-plot",
|
|
19226
19208
|
tabIndex: 0,
|
|
@@ -19231,23 +19213,23 @@ Defaulting to \`null\`.`;
|
|
|
19231
19213
|
onBlur: () => c.setActive(null),
|
|
19232
19214
|
onMouseMove,
|
|
19233
19215
|
children: [
|
|
19234
|
-
/* @__PURE__ */
|
|
19216
|
+
/* @__PURE__ */ jsx_dev_runtime81.jsxDEV("svg", {
|
|
19235
19217
|
width: c.width,
|
|
19236
19218
|
height,
|
|
19237
19219
|
viewBox: "0 0 " + c.width + " " + height,
|
|
19238
19220
|
"aria-hidden": "true",
|
|
19239
19221
|
className: "vk-chart-svg",
|
|
19240
19222
|
children: [
|
|
19241
|
-
ticks.map((t) => /* @__PURE__ */
|
|
19223
|
+
ticks.map((t) => /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("g", {
|
|
19242
19224
|
children: [
|
|
19243
|
-
/* @__PURE__ */
|
|
19225
|
+
/* @__PURE__ */ jsx_dev_runtime81.jsxDEV("line", {
|
|
19244
19226
|
x1: pad.left,
|
|
19245
19227
|
x2: pad.left + plotW,
|
|
19246
19228
|
y1: y(t),
|
|
19247
19229
|
y2: y(t),
|
|
19248
19230
|
className: t === 0 ? "vk-chart-baseline" : "vk-chart-grid"
|
|
19249
19231
|
}, undefined, false, undefined, this),
|
|
19250
|
-
/* @__PURE__ */
|
|
19232
|
+
/* @__PURE__ */ jsx_dev_runtime81.jsxDEV("text", {
|
|
19251
19233
|
x: pad.left - 8,
|
|
19252
19234
|
y: y(t),
|
|
19253
19235
|
dy: "0.32em",
|
|
@@ -19257,14 +19239,14 @@ Defaulting to \`null\`.`;
|
|
|
19257
19239
|
}, undefined, false, undefined, this)
|
|
19258
19240
|
]
|
|
19259
19241
|
}, t, true, undefined, this)),
|
|
19260
|
-
data.map((d, i) => i % every === 0 || i === data.length - 1 ? /* @__PURE__ */
|
|
19242
|
+
data.map((d, i) => i % every === 0 || i === data.length - 1 ? /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("text", {
|
|
19261
19243
|
x: x(i),
|
|
19262
19244
|
y: height - 8,
|
|
19263
19245
|
textAnchor: i === 0 ? "start" : i === data.length - 1 ? "end" : "middle",
|
|
19264
19246
|
className: "vk-chart-tick",
|
|
19265
19247
|
children: cellLabel(d, c.xKey)
|
|
19266
19248
|
}, "x" + i, false, undefined, this) : null),
|
|
19267
|
-
c.active != null ? /* @__PURE__ */
|
|
19249
|
+
c.active != null ? /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("line", {
|
|
19268
19250
|
x1: x(c.active),
|
|
19269
19251
|
x2: x(c.active),
|
|
19270
19252
|
y1: pad.top,
|
|
@@ -19273,7 +19255,7 @@ Defaulting to \`null\`.`;
|
|
|
19273
19255
|
}, undefined, false, undefined, this) : null,
|
|
19274
19256
|
c.series.map((s, si) => {
|
|
19275
19257
|
const pts = data.map((d, i) => x(i) + "," + y(cellNumber(d, s.key))).join(" ");
|
|
19276
|
-
return /* @__PURE__ */
|
|
19258
|
+
return /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("polyline", {
|
|
19277
19259
|
points: pts,
|
|
19278
19260
|
fill: "none",
|
|
19279
19261
|
stroke: seriesColor(si),
|
|
@@ -19287,7 +19269,7 @@ Defaulting to \`null\`.`;
|
|
|
19287
19269
|
const d = data[i];
|
|
19288
19270
|
if (!d)
|
|
19289
19271
|
return null;
|
|
19290
|
-
return /* @__PURE__ */
|
|
19272
|
+
return /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("circle", {
|
|
19291
19273
|
cx: x(i),
|
|
19292
19274
|
cy: y(cellNumber(d, s.key)),
|
|
19293
19275
|
r: 4,
|
|
@@ -19305,7 +19287,7 @@ Defaulting to \`null\`.`;
|
|
|
19305
19287
|
ly = o + 14;
|
|
19306
19288
|
});
|
|
19307
19289
|
lastY.push(ly);
|
|
19308
|
-
return /* @__PURE__ */
|
|
19290
|
+
return /* @__PURE__ */ jsx_dev_runtime81.jsxDEV("text", {
|
|
19309
19291
|
x: x(data.length - 1) + 10,
|
|
19310
19292
|
y: ly,
|
|
19311
19293
|
dy: "0.32em",
|
|
@@ -19321,7 +19303,7 @@ Defaulting to \`null\`.`;
|
|
|
19321
19303
|
}, undefined, false, undefined, this);
|
|
19322
19304
|
}
|
|
19323
19305
|
// src/components/Sparkline/Sparkline.tsx
|
|
19324
|
-
var
|
|
19306
|
+
var jsx_dev_runtime82 = __toESM(require_jsx_dev_runtime(), 1);
|
|
19325
19307
|
function Sparkline(props) {
|
|
19326
19308
|
const { width, height, tone, label, className } = props;
|
|
19327
19309
|
const values = props.values || [];
|
|
@@ -19332,7 +19314,7 @@ Defaulting to \`null\`.`;
|
|
|
19332
19314
|
const pts = values.map((v, i) => pt(v, i).join(",")).join(" ");
|
|
19333
19315
|
const end = values.length ? pt(values[values.length - 1], values.length - 1) : [0, 0];
|
|
19334
19316
|
const color = tone ? "var(--" + tone + ")" : "var(--chart-1)";
|
|
19335
|
-
return /* @__PURE__ */
|
|
19317
|
+
return /* @__PURE__ */ jsx_dev_runtime82.jsxDEV("svg", {
|
|
19336
19318
|
className: cx("vk-sparkline", className),
|
|
19337
19319
|
width: w,
|
|
19338
19320
|
height: hgt,
|
|
@@ -19340,7 +19322,7 @@ Defaulting to \`null\`.`;
|
|
|
19340
19322
|
role: "img",
|
|
19341
19323
|
"aria-label": label || "Trend: " + values.join(", "),
|
|
19342
19324
|
children: [
|
|
19343
|
-
/* @__PURE__ */
|
|
19325
|
+
/* @__PURE__ */ jsx_dev_runtime82.jsxDEV("polyline", {
|
|
19344
19326
|
points: pts,
|
|
19345
19327
|
fill: "none",
|
|
19346
19328
|
stroke: color,
|
|
@@ -19348,7 +19330,7 @@ Defaulting to \`null\`.`;
|
|
|
19348
19330
|
strokeLinejoin: "round",
|
|
19349
19331
|
strokeLinecap: "round"
|
|
19350
19332
|
}, undefined, false, undefined, this),
|
|
19351
|
-
values.length ? /* @__PURE__ */
|
|
19333
|
+
values.length ? /* @__PURE__ */ jsx_dev_runtime82.jsxDEV("circle", {
|
|
19352
19334
|
cx: end[0],
|
|
19353
19335
|
cy: end[1],
|
|
19354
19336
|
r: 2.5,
|
|
@@ -19358,7 +19340,7 @@ Defaulting to \`null\`.`;
|
|
|
19358
19340
|
}, undefined, true, undefined, this);
|
|
19359
19341
|
}
|
|
19360
19342
|
// src/hooks/useTheme.ts
|
|
19361
|
-
var
|
|
19343
|
+
var import_react54 = __toESM(require_react(), 1);
|
|
19362
19344
|
|
|
19363
19345
|
// src/lib/theme.ts
|
|
19364
19346
|
var THEMES = ["dark", "light", "contrast"];
|
|
@@ -19395,8 +19377,8 @@ Defaulting to \`null\`.`;
|
|
|
19395
19377
|
const key = o.storageKey || "vk-theme";
|
|
19396
19378
|
const fallback = isTheme(o.defaultTheme) ? o.defaultTheme : "dark";
|
|
19397
19379
|
const follow = o.followSystem !== false;
|
|
19398
|
-
const resolve =
|
|
19399
|
-
const subscribe =
|
|
19380
|
+
const resolve = import_react54.useCallback((pref) => pref !== "system" ? pref : follow ? systemTheme() : fallback, [follow, fallback]);
|
|
19381
|
+
const subscribe = import_react54.useCallback((cb) => {
|
|
19400
19382
|
const mqs = ["(prefers-contrast: more)", "(prefers-color-scheme: light)"].map((q) => window.matchMedia ? window.matchMedia(q) : null);
|
|
19401
19383
|
const onSystem = () => {
|
|
19402
19384
|
if (readPreference(key) === "system")
|
|
@@ -19424,9 +19406,9 @@ Defaulting to \`null\`.`;
|
|
|
19424
19406
|
window.removeEventListener("storage", onStorage);
|
|
19425
19407
|
};
|
|
19426
19408
|
}, [key, resolve]);
|
|
19427
|
-
const snapshot =
|
|
19428
|
-
const [pref, resolved] =
|
|
19429
|
-
const setTheme =
|
|
19409
|
+
const snapshot = import_react54.useCallback(() => readPreference(key) + "|" + (document.documentElement.getAttribute("data-theme") || resolve(readPreference(key))), [key, resolve]);
|
|
19410
|
+
const [pref, resolved] = import_react54.useSyncExternalStore(subscribe, snapshot, () => "system|" + fallback).split("|");
|
|
19411
|
+
const setTheme = import_react54.useCallback((next) => {
|
|
19430
19412
|
const choice = isTheme(next) ? next : "system";
|
|
19431
19413
|
try {
|
|
19432
19414
|
if (choice === "system")
|
|
@@ -19445,9 +19427,9 @@ Defaulting to \`null\`.`;
|
|
|
19445
19427
|
};
|
|
19446
19428
|
}
|
|
19447
19429
|
// src/components/ThemeScript/ThemeScript.tsx
|
|
19448
|
-
var
|
|
19430
|
+
var jsx_dev_runtime83 = __toESM(require_jsx_dev_runtime(), 1);
|
|
19449
19431
|
function ThemeScript(props) {
|
|
19450
|
-
return /* @__PURE__ */
|
|
19432
|
+
return /* @__PURE__ */ jsx_dev_runtime83.jsxDEV("script", {
|
|
19451
19433
|
nonce: props.nonce,
|
|
19452
19434
|
dangerouslySetInnerHTML: { __html: themeScript(props) }
|
|
19453
19435
|
}, undefined, false, undefined, this);
|